Skip to content

Commit 52ec6a5

Browse files
committed
Address build failures with Node.js 22 due to top-level await
1 parent dce6fa2 commit 52ec6a5

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

gulpfile.js

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,30 @@ import { rimraf } from "rimraf";
66
import { ConventionalGitClient } from "@conventional-changelog/git-client";
77

88
const is_production = process.env.NODE_ENV === "production";
9-
const current_version = is_production
10-
? await obtain_version_from_tag()
11-
: "0.0.0";
129

1310
const task_delete = create_task("delete -> delete build folders", () => {
1411
return rimraf(["dist", "coverage", "docs/public/js"]);
1512
});
1613

17-
const task_update_packages = create_task(`update -> update version to '${current_version}'`, () => {
18-
const update_version = data => {
19-
data.version = current_version;
20-
return data;
21-
};
14+
const task_update_packages = create_task("update -> update version", async done => {
15+
if (is_production) {
16+
const current_version = await obtain_version_from_tag();
2217

23-
return gulp
24-
.src("src/plugins/**/package.json")
25-
.pipe(json_transform(update_version, 2))
26-
.pipe(gulp.dest("dist"));
18+
const update_version = data => {
19+
data.version = current_version;
20+
return data;
21+
};
22+
23+
const timestamp = new Date().toLocaleTimeString("en", { hour12: false });
24+
console.log(`[\x1b[35m${timestamp}\x1b[0m] Updating version to \x1b[32m${current_version}\x1b[0m`);
25+
26+
return gulp
27+
.src("src/plugins/**/package.json")
28+
.pipe(json_transform(update_version, 2))
29+
.pipe(gulp.dest("dist"));
30+
}
31+
32+
done();
2733
});
2834

2935
const task_copy_readme = create_task("update -> copy README.md", () => {

0 commit comments

Comments
 (0)