Skip to content

Commit 25a8165

Browse files
committed
chore: refactor setup-dev-demo script and enhance Node.js version check
1 parent c807d61 commit 25a8165

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

dev-demo/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
"install-adapters": "cd ../adapters && bash install-adapters.sh",
1919
"build-adminforth": "cd ../adminforth && npm ci && npm run build && npm link",
2020
"migrate:all": "npm run migrate:sqlite && npm run migrate:mysql && npm run migrate:postgres && npm run migrate:clickhouse",
21-
"check-node-docker": "node scripts/check-node.js && node scripts/check-docker.js",
22-
"setup-dev-demo": "npm run check-node-docker && npm run build-adminforth && cp .env.local .env && npm run install-plugins && npm run install-adapters && npm install && npm link adminforth && bash ./scripts/run_inventory.sh"
21+
"preinstall": "node scripts/check-node.js",
22+
"check-docker": "node scripts/check-docker.js",
23+
"setup-dev-demo": "npm run preinstall && npm run check-docker && npm run build-adminforth && cp .env.local .env && npm run install-plugins && npm run install-adapters && npm install && npm link adminforth && bash ./scripts/run_inventory.sh"
2324
},
2425
"author": "",
2526
"license": "ISC",

dev-demo/scripts/check-node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
const [major] = process.versions.node.split('.').map(Number);
22

3-
if (major < 20) {
3+
if (major < 20 || major > 22) {
44
console.error(
55
`❌ Node.js ${process.versions.node} detected.\n` +
6-
`Please install Node.js 20 or newer.`
6+
`Please use Node.js version 20, 21, or 22.`,
77
);
88
process.exit(1);
99
}

0 commit comments

Comments
 (0)