chore: update dependencies
hugo to 0.55.6
This commit is contained in:
parent
4b14c4be61
commit
f966ed0782
9
.babelrc
9
.babelrc
@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"presets": ["es2015"],
|
"presets": [
|
||||||
"plugins": [
|
"@babel/preset-env"
|
||||||
"syntax-object-rest-spread",
|
],
|
||||||
"transform-object-rest-spread"
|
"plugins": []
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/hugo_0.55.6_darwin_amd64
Executable file
BIN
bin/hugo_0.55.6_darwin_amd64
Executable file
Binary file not shown.
BIN
bin/hugo_0.55.6_linux_amd64
Executable file
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
BIN
bin/hugo_0.55.6_windows_amd64.exe
Executable file
Binary file not shown.
@ -1,64 +1,89 @@
|
|||||||
import gulp from "gulp";
|
import babel from "gulp-babel";
|
||||||
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 BrowserSync from "browser-sync";
|
import BrowserSync from "browser-sync";
|
||||||
import webpack from "webpack";
|
import cp from "child_process";
|
||||||
import webpackConfig from "./webpack.conf";
|
import cssImport from "postcss-import";
|
||||||
import inquirer from "inquirer";
|
import cssnext from "postcss-preset-env";
|
||||||
import toml from "tomljs";
|
import del from "del";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import gulp from "gulp";
|
||||||
|
import inquirer from "inquirer";
|
||||||
import kebabCase from "lodash.kebabcase";
|
import kebabCase from "lodash.kebabcase";
|
||||||
|
import path from "path";
|
||||||
|
import postcss from "gulp-postcss";
|
||||||
|
import toml from "tomljs";
|
||||||
import tomlify from "tomlify-j0.4";
|
import tomlify from "tomlify-j0.4";
|
||||||
|
|
||||||
const browserSync = BrowserSync.create();
|
const browserSync = BrowserSync.create();
|
||||||
const platform = getPlatform(process.platform);
|
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 defaultArgs = ["-s", "site", "-v"];
|
||||||
const buildArgs = ["-d", "../dist"];
|
const buildArgs = ["-d", "../dist"];
|
||||||
|
|
||||||
gulp.task("hugo", (cb) => buildSite(cb));
|
function getPlatform(platform) {
|
||||||
gulp.task("hugo-preview", (cb) => buildSite(cb, ["--buildDrafts", "--buildFuture"]));
|
switch (platform) {
|
||||||
|
case "win32":
|
||||||
|
case "win64": {
|
||||||
|
return "windows";
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
return platform;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gulp.task("build", ["css", "js", "hugo"]);
|
function generateFrontMatter(frontMatter, answers) {
|
||||||
gulp.task("build-preview", ["css", "js", "hugo-preview"]);
|
return `+++
|
||||||
|
${tomlify.toToml(frontMatter, null, 2)}
|
||||||
|
+++
|
||||||
|
${answers.description}`;
|
||||||
|
}
|
||||||
|
|
||||||
gulp.task("css", () => (
|
const hugo = (done, options) => {
|
||||||
gulp.src("./src/css/*.css")
|
cp.spawn(hugoBin, ["version"], {
|
||||||
.pipe(postcss([cssnext(), cssImport({from: "./src/css/main.css"})]))
|
stdio: "inherit"
|
||||||
.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();
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
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({
|
browserSync.init({
|
||||||
server: {
|
server: {
|
||||||
baseDir: "./dist"
|
baseDir: "./dist"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
gulp.watch("./src/js/**/*.js", ["js"]);
|
gulp.watch("./src/js/**/*.js", js);
|
||||||
gulp.watch("./src/css/**/*.css", ["css"]);
|
gulp.watch("./src/css/**/*.css", css);
|
||||||
gulp.watch("./site/**/*", ["hugo"]);
|
gulp.watch("./site/**/*", hugo);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task("new-incident", (cb) => {
|
export const newIncident = (done) => {
|
||||||
const file = fs.readFileSync("site/config.toml").toString();
|
const file = fs.readFileSync("site/config.toml").toString();
|
||||||
const config = toml(file);
|
const config = toml(file);
|
||||||
|
|
||||||
@ -105,7 +130,9 @@ gulp.task("new-incident", (cb) => {
|
|||||||
let args = ["new", `incidents${path.sep}${kebabCase(answers.name)}.md`];
|
let args = ["new", `incidents${path.sep}${kebabCase(answers.name)}.md`];
|
||||||
args = args.concat(defaultArgs);
|
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) => {
|
hugo.stdout.on("data", (data) => {
|
||||||
const message = data.toString();
|
const message = data.toString();
|
||||||
|
|
||||||
@ -151,45 +178,16 @@ gulp.task("new-incident", (cb) => {
|
|||||||
|
|
||||||
hugo.on("close", (code) => {
|
hugo.on("close", (code) => {
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
cb();
|
done();
|
||||||
} else {
|
} else {
|
||||||
cb("new incident creation failed");
|
done("new incident creation failed");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
};
|
||||||
|
|
||||||
function getPlatform(platform) {
|
export const clean = (done) => del(["dist"], done);
|
||||||
switch (platform) {
|
export const hugoPreview = (done) => hugo(done, ["--buildDrafts", "--buildFuture"]);
|
||||||
case "win32":
|
export const build = gulp.series(clean, gulp.parallel(css, js), hugo);
|
||||||
case "win64": {
|
export const buildPreview = gulp.series(clean, gulp.parallel(css, js), hugoPreview);
|
||||||
return "windows";
|
export default hugo;
|
||||||
}
|
|
||||||
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");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
12770
package-lock.json
generated
12770
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
48
package.json
48
package.json
@ -15,36 +15,26 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"autoprefixer": "^6.3.7",
|
"@babel/core": "^7.2.2",
|
||||||
"babel-eslint": "^6.1.2",
|
"@babel/preset-env": "^7.3.1",
|
||||||
"babel-loader": "^6.2.4",
|
"@babel/register": "^7.0.0",
|
||||||
"babel-plugin-syntax-object-rest-spread": "^6.13.0",
|
"babel-eslint": "^10.0.1",
|
||||||
"babel-plugin-transform-class-properties": "^6.10.2",
|
"browser-sync": "^2.26.7",
|
||||||
"babel-plugin-transform-object-assign": "^6.8.0",
|
"del": "^4.1.1",
|
||||||
"babel-plugin-transform-object-rest-spread": "^6.8.0",
|
"eslint": "^5.13.0",
|
||||||
"babel-preset-es2015": "^6.9.0",
|
"eslint-plugin-import": "^2.16.0",
|
||||||
"babel-register": "^6.11.6",
|
"exports-loader": "^0.7.0",
|
||||||
"browser-sync": "^2.13.0",
|
"gulp": "^4.0.0",
|
||||||
"css-loader": "^0.23.1",
|
"gulp-babel": "^8.0.0-beta.2",
|
||||||
"eslint": "^3.1.1",
|
"gulp-postcss": "^8.0.0",
|
||||||
"eslint-plugin-import": "^1.11.1",
|
"imports-loader": "^0.8.0",
|
||||||
"exports-loader": "^0.6.3",
|
"inquirer": "^6.2.2",
|
||||||
"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",
|
|
||||||
"lodash.kebabcase": "^4.1.1",
|
"lodash.kebabcase": "^4.1.1",
|
||||||
"postcss-cssnext": "^2.7.0",
|
"postcss-import": "^12.0.1",
|
||||||
"postcss-import": "^8.1.2",
|
"postcss-loader": "^3.0.0",
|
||||||
"postcss-loader": "^0.9.1",
|
"postcss-preset-env": "^6.5.0",
|
||||||
"tomlify-j0.4": "^2.2.0",
|
"tomlify-j0.4": "^3.0.0",
|
||||||
"tomljs": "^0.1.3",
|
"tomljs": "^0.1.3"
|
||||||
"url-loader": "^0.5.7",
|
|
||||||
"webpack": "^1.13.1",
|
|
||||||
"whatwg-fetch": "^1.0.0"
|
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"fsevents": "^1.0.15"
|
"fsevents": "^1.0.15"
|
||||||
|
Loading…
Reference in New Issue
Block a user