Skip to content

Commit

Permalink
Merge pull request #273 from wasabee-project/releases/0.20
Browse files Browse the repository at this point in the history
Release 0.20
  • Loading branch information
le-jeu authored Jun 30, 2021
2 parents e1b59f9 + ef517ff commit 71fe29f
Show file tree
Hide file tree
Showing 81 changed files with 14,423 additions and 3,801 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"es2020": true
},
"rules": {
"prettier/prettier": ["error", { "endOfLine": "auto" }],
"no-console": "off",
"lines-between-class-members": ["error", "always"],
"no-template-curly-in-string": 1,
Expand Down
57 changes: 33 additions & 24 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const eslint = require("gulp-eslint");
const del = require("del");
const webpack = require("webpack");
const PluginError = require("plugin-error");
const log = require("fancy-log");
const prettier = require("gulp-prettier");

const ensureDirectoryExistence = (filePath) => {
Expand Down Expand Up @@ -54,13 +53,15 @@ gulp.task("buildheaders", (cb) => {
let newline = l;
for (const k of Object.keys(cfg.headers.common)) {
if (l.indexOf(`@${k} `) == 3) {
newline = `// @${k} ${cfg.headers.common[k]}`;
const key = k.padEnd(13);
newline = `// @${key} ${cfg.headers.common[k]}`;
break;
}
}
for (const k of Object.keys(cfg.headers[status.mode])) {
if (l.indexOf(`@${k} `) == 3) {
newline = `// @${k} ${cfg.headers[status.mode][k]}`;
const key = k.padEnd(13);
newline = `// @${key} ${cfg.headers[status.mode][k]}`;
break;
}
}
Expand All @@ -70,16 +71,16 @@ gulp.task("buildheaders", (cb) => {
// XXX just append to the version rather than overwriting a fixed string now
const gbd = () => {
const d = new Date();
let bd = d.getFullYear();
let t = ("0" + (d.getMonth() + 1)).substr(-2);
let bd = d.getUTCFullYear();
let t = ("0" + (d.getUTCMonth() + 1)).substr(-2);
bd += t;
t = ("0" + d.getDate()).substr(-2);
t = ("0" + d.getUTCDate()).substr(-2);
bd += t;
t = ("0" + d.getHours()).substr(-2);
t = ("0" + d.getUTCHours()).substr(-2);
bd += t;
t = ("0" + d.getMinutes()).substr(-2);
t = ("0" + d.getUTCMinutes()).substr(-2);
bd += t;
t = ("0" + d.getSeconds()).substr(-2);
t = ("0" + d.getUTCSeconds()).substr(-2);
bd += t;
return bd;
};
Expand All @@ -102,17 +103,27 @@ gulp.task("webpack", (callback) => {
// webpackConfig.optimization.minimize = true;
}
webpack(webpackConfig, function (err, stats) {
log(
"[webpack]",
if (err) {
throw new PluginError({ plugin: "webpack", message: err });
}

if (stats.hasErrors()) {
throw new PluginError({
plugin: "webpack",
message: stats.toString({
// output options
colors: true,
}),
});
}

console.log(
stats.toString({
// output options
colors: true,
})
);

if (err) {
throw new PluginError("webpack", err);
}

callback();
});
});
Expand Down Expand Up @@ -163,8 +174,8 @@ gulp.task("eslint", (cb) => {
cb();
});

gulp.task("eslint-fix", (cb) => {
gulp
gulp.task("eslint-fix", () => {
return gulp
.src([
"**/*.js",
"!node_modules/**",
Expand All @@ -174,9 +185,8 @@ gulp.task("eslint-fix", (cb) => {
])
.pipe(eslint({ fix: true }))
.pipe(eslint.format())
.pipe(eslint.failAfterError())
.pipe(gulp.dest("."));
cb();
.pipe(gulp.dest("."))
.pipe(eslint.failAfterError());
});

gulp.task("prettier", () => {
Expand All @@ -192,14 +202,13 @@ gulp.task("prettier", () => {
.pipe(gulp.dest("."));
});

// eslint at the end to catch unused variables, etc
gulp.task(
"build",
gulp.series(["buildheaders", "buildmeta", "webpack", "buildplugin", "eslint"])
gulp.series(["buildheaders", "buildmeta", "webpack", "buildplugin"])
);

// eslint-fix too
gulp.task("format", gulp.series(["prettier", "eslint-fix"]));
// eslint-fix already formats the file
gulp.task("format", gulp.series(["eslint-fix"]));
// gulp.task("format", gulp.series(["prettier"]));

gulp.task(
Expand Down
Loading

0 comments on commit 71fe29f

Please sign in to comment.