返回提交历史
Modified
package.json
+1
-1
Added
scripts/raw-precheck.js
+9
-0
XFEstudio/XFESpaceNinjaServer
chore: handle 'npm run raw' being used on node versions below 22.7.0 (#2747)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2747 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
6b66cb49
代码差异
2 个文件
+10
-1
@@ -15,7 +15,7 @@
15
15
"dev:bun": "bun scripts/dev.cjs",
16
16
"verify": "tsgo --noEmit",
17
17
"verify:tsc": "tsc --noEmit",
18
"raw": "node --experimental-transform-types src/index.ts",
18
"raw": "node scripts/raw-precheck.js && node --experimental-transform-types src/index.ts",
19
19
"raw:bun": "bun src/index.ts",
20
20
"lint": "eslint --ext .ts .",
21
21
"lint:ci": "eslint --ext .ts --rule \"prettier/prettier: off\" .",
@@ -0,0 +1,9 @@
1
const [major, minor] = process.versions.node.split(".").map(x => parseInt(x));
2
if (major > 22 || (major == 22 && minor >= 7)) {
3
// ok
4
} else {
5
console.log("Sorry, your Node version is a bit too old for this. You have 2 options:");
6
console.log("- Update Node.js.");
7
console.log("- Use 'npm run build && npm run start'. Optional libraries must be installed for this.");
8
process.exit(1);
9
}