chore: update dependencies

hugo to 0.55.6
This commit is contained in:
steveoh 2019-06-13 09:50:40 -06:00
parent 4b14c4be61
commit f966ed0782
No known key found for this signature in database
GPG Key ID: EA66E1A6342F51DC
10 changed files with 7241 additions and 5740 deletions

View File

@ -1,7 +1,6 @@
{
"presets": ["es2015"],
"plugins": [
"syntax-object-rest-spread",
"transform-object-rest-spread"
]
"presets": [
"@babel/preset-env"
],
"plugins": []
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bin/hugo_0.55.6_darwin_amd64 Executable file

Binary file not shown.

BIN
bin/hugo_0.55.6_linux_amd64 Executable file

Binary file not shown.

BIN
bin/hugo_0.55.6_windows_amd64.exe Executable file

Binary file not shown.

View File

@ -1,64 +1,89 @@
import gulp from "gulp";
import cp from "child_process";
import gutil from "gulp-util";
import postcss from "gulp-postcss";
import cssImport from "postcss-import";
import cssnext from "postcss-cssnext";
import babel from "gulp-babel";
import BrowserSync from "browser-sync";
import webpack from "webpack";
import webpackConfig from "./webpack.conf";
import inquirer from "inquirer";
import toml from "tomljs";
import cp from "child_process";
import cssImport from "postcss-import";
import cssnext from "postcss-preset-env";
import del from "del";
import fs from "fs";
import path from "path";
import gulp from "gulp";
import inquirer from "inquirer";
import kebabCase from "lodash.kebabcase";
import path from "path";
import postcss from "gulp-postcss";
import toml from "tomljs";
import tomlify from "tomlify-j0.4";
const browserSync = BrowserSync.create();
const platform = getPlatform(process.platform);
const hugoBin = `./bin/hugo_0.26_${platform}_amd64${platform === "windows" ? ".exe" : ""}`;
const hugoBin = `./bin/hugo_0.55.6_${platform}_amd64${platform === "windows" ? ".exe" : ""}`;
const defaultArgs = ["-s", "site", "-v"];
const buildArgs = ["-d", "../dist"];
gulp.task("hugo", (cb) => buildSite(cb));
gulp.task("hugo-preview", (cb) => buildSite(cb, ["--buildDrafts", "--buildFuture"]));
function getPlatform(platform) {
switch (platform) {
case "win32":
case "win64": {
return "windows";
}
default: {
return platform;
}
}
}
gulp.task("build", ["css", "js", "hugo"]);
gulp.task("build-preview", ["css", "js", "hugo-preview"]);
function generateFrontMatter(frontMatter, answers) {
return `+++
${tomlify.toToml(frontMatter, null, 2)}
+++
${answers.description}`;
}
gulp.task("css", () => (
gulp.src("./src/css/*.css")
.pipe(postcss([cssnext(), cssImport({from: "./src/css/main.css"})]))
.pipe(gulp.dest("./dist/css"))
.pipe(browserSync.stream())
));
gulp.task("js", (cb) => {
const myConfig = Object.assign({}, webpackConfig);
webpack(myConfig, (err, stats) => {
if (err) throw new gutil.PluginError("webpack", err);
gutil.log("[webpack]", stats.toString({
colors: true,
progress: true
}));
browserSync.reload();
cb();
const hugo = (done, options) => {
cp.spawn(hugoBin, ["version"], {
stdio: "inherit"
});
});
gulp.task("server", ["hugo", "css", "js"], () => {
let args = options ? defaultArgs.concat(options) : defaultArgs;
args = args.concat(buildArgs);
// cp needs to be in site directory
cp.spawn(hugoBin, args, {
stdio: "inherit"
}).on("close", (code) => {
if (code === 0) {
browserSync.reload();
done();
} else {
browserSync.notify("Hugo build failed :(");
done("Hugo build failed");
}
});
return done;
};
export const css = () => gulp.src("./src/css/**/*.css")
.pipe(postcss([cssnext(), cssImport({
from: "./src/css/main.css"
})]))
.pipe(gulp.dest("./dist/css"));
export const js = () => gulp.src("./src/js/*.js")
.pipe(babel())
.pipe(gulp.dest("./dist/js"));
export const server = gulp.series(gulp.parallel(css, js), hugo, () => {
browserSync.init({
server: {
baseDir: "./dist"
}
});
gulp.watch("./src/js/**/*.js", ["js"]);
gulp.watch("./src/css/**/*.css", ["css"]);
gulp.watch("./site/**/*", ["hugo"]);
gulp.watch("./src/js/**/*.js", js);
gulp.watch("./src/css/**/*.css", css);
gulp.watch("./site/**/*", hugo);
});
gulp.task("new-incident", (cb) => {
export const newIncident = (done) => {
const file = fs.readFileSync("site/config.toml").toString();
const config = toml(file);
@ -105,7 +130,9 @@ gulp.task("new-incident", (cb) => {
let args = ["new", `incidents${path.sep}${kebabCase(answers.name)}.md`];
args = args.concat(defaultArgs);
const hugo = cp.spawn(hugoBin, args, {stdio: "pipe"});
const hugo = cp.spawn(hugoBin, args, {
stdio: "pipe"
});
hugo.stdout.on("data", (data) => {
const message = data.toString();
@ -151,45 +178,16 @@ gulp.task("new-incident", (cb) => {
hugo.on("close", (code) => {
if (code === 0) {
cb();
done();
} else {
cb("new incident creation failed");
done("new incident creation failed");
}
});
});
});
};
function getPlatform(platform) {
switch (platform) {
case "win32":
case "win64": {
return "windows";
}
default: {
return platform;
}
}
}
function generateFrontMatter(frontMatter, answers) {
return `+++
${tomlify(frontMatter, null, 2)}
+++
${answers.description}`;
}
function buildSite(cb, options) {
let args = options ? defaultArgs.concat(options) : defaultArgs;
args = args.concat(buildArgs);
// cp needs to be in site directory
return cp.spawn(hugoBin, args, {stdio: "inherit"}).on("close", (code) => {
if (code === 0) {
browserSync.reload();
cb();
} else {
browserSync.notify("Hugo build failed :(");
cb("Hugo build failed");
}
});
}
export const clean = (done) => del(["dist"], done);
export const hugoPreview = (done) => hugo(done, ["--buildDrafts", "--buildFuture"]);
export const build = gulp.series(clean, gulp.parallel(css, js), hugo);
export const buildPreview = gulp.series(clean, gulp.parallel(css, js), hugoPreview);
export default hugo;

12666
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -15,36 +15,26 @@
"author": "",
"license": "MIT",
"dependencies": {
"autoprefixer": "^6.3.7",
"babel-eslint": "^6.1.2",
"babel-loader": "^6.2.4",
"babel-plugin-syntax-object-rest-spread": "^6.13.0",
"babel-plugin-transform-class-properties": "^6.10.2",
"babel-plugin-transform-object-assign": "^6.8.0",
"babel-plugin-transform-object-rest-spread": "^6.8.0",
"babel-preset-es2015": "^6.9.0",
"babel-register": "^6.11.6",
"browser-sync": "^2.13.0",
"css-loader": "^0.23.1",
"eslint": "^3.1.1",
"eslint-plugin-import": "^1.11.1",
"exports-loader": "^0.6.3",
"file-loader": "^0.9.0",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
"gulp-postcss": "^6.1.1",
"gulp-util": "^3.0.7",
"imports-loader": "^0.6.5",
"inquirer": "^3.2.3",
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.3.1",
"@babel/register": "^7.0.0",
"babel-eslint": "^10.0.1",
"browser-sync": "^2.26.7",
"del": "^4.1.1",
"eslint": "^5.13.0",
"eslint-plugin-import": "^2.16.0",
"exports-loader": "^0.7.0",
"gulp": "^4.0.0",
"gulp-babel": "^8.0.0-beta.2",
"gulp-postcss": "^8.0.0",
"imports-loader": "^0.8.0",
"inquirer": "^6.2.2",
"lodash.kebabcase": "^4.1.1",
"postcss-cssnext": "^2.7.0",
"postcss-import": "^8.1.2",
"postcss-loader": "^0.9.1",
"tomlify-j0.4": "^2.2.0",
"tomljs": "^0.1.3",
"url-loader": "^0.5.7",
"webpack": "^1.13.1",
"whatwg-fetch": "^1.0.0"
"postcss-import": "^12.0.1",
"postcss-loader": "^3.0.0",
"postcss-preset-env": "^6.5.0",
"tomlify-j0.4": "^3.0.0",
"tomljs": "^0.1.3"
},
"optionalDependencies": {
"fsevents": "^1.0.15"