XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 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
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

2 个文件 +10 -1
Modified package.json +1 -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\" .",
Added scripts/raw-precheck.js +9 -0
@@ -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 }