@devassure/cli 1.0.5 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devassure/cli",
3
- "version": "1.0.5",
3
+ "version": "1.0.8",
4
4
  "type": "module",
5
5
  "description": "DevAssure CLI application",
6
6
  "main": "dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "postpack": "node scripts/postpack-restore.cjs",
29
29
  "pack:test": "pnpm run build && node scripts/prepack-modify.cjs && npm pack --silent && node scripts/postpack-restore.cjs",
30
30
  "install:tgz": "node scripts/install-tgz.cjs",
31
- "preinstall": "node scripts/require-global-install.cjs",
31
+ "preinstall": "node scripts/check-node-version.cjs && node scripts/require-global-install.cjs",
32
32
  "postinstall": "node scripts/postinstall-setup.cjs",
33
33
  "prepublishOnly": "node scripts/prepublish-check.cjs"
34
34
  },
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ const minMajor = 18;
4
+ const current = process.versions.node;
5
+ const major = parseInt(current.split(".")[0], 10);
6
+
7
+ if (major < minMajor) {
8
+ console.error(`
9
+ ❌ DevAssure CLI requires Node.js ${minMajor} or higher.
10
+ Current: ${current}
11
+
12
+ Please upgrade Node.js: https://nodejs.org/
13
+ `);
14
+ process.exit(1);
15
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Wrapper that checks Node.js version before loading the ESM CLI.
3
+ * Use only syntax supported by Node 12 so users on old Node get a clear message
4
+ * instead of "Unexpected token '.'" from optional chaining in the main bundle.
5
+ */
6
+ const path = require("path");
7
+ const { spawnSync } = require("child_process");
8
+
9
+ const MIN_MAJOR = 18;
10
+ const parts = process.versions.node.split(".");
11
+ const major = parseInt(parts[0], 10);
12
+
13
+ if (major < MIN_MAJOR) {
14
+ console.error(
15
+ "DevAssure CLI requires Node.js " +
16
+ MIN_MAJOR +
17
+ " or later. Current: " +
18
+ process.versions.node
19
+ );
20
+ process.exit(1);
21
+ }
22
+
23
+ const entry = path.join(__dirname, "..", "dist", "index.js");
24
+ const result = spawnSync(process.execPath, [entry].concat(process.argv.slice(2)), {
25
+ stdio: "inherit",
26
+ windowsHide: true,
27
+ });
28
+
29
+ process.exit(result.status !== null ? result.status : 1);