careervivid 1.12.24 → 1.12.25

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/dist/index.js CHANGED
@@ -19,6 +19,16 @@
19
19
  * cv update [files...] Update existing content on CareerVivid
20
20
  * cv --help / cv --version
21
21
  */
22
+ // ── Node version guard (must be before ESM imports) ─────────────────────────
23
+ // Uses only Node built-ins so it works on ANY Node version.
24
+ const [nodeMajor] = process.versions.node.split(".").map(Number);
25
+ if (nodeMajor < 18) {
26
+ process.stderr.write(`\n⚠️ CareerVivid CLI requires Node.js v18 or higher.\n` +
27
+ ` You are running Node ${process.versions.node}.\n\n` +
28
+ ` Upgrade at: https://nodejs.org (download the LTS release)\n` +
29
+ ` or: nvm install --lts && nvm use --lts\n\n`);
30
+ process.exit(1);
31
+ }
22
32
  import { Command } from "commander";
23
33
  import { readFileSync, existsSync } from "fs";
24
34
  import chalk from "chalk";
@@ -2,7 +2,7 @@
2
2
  * CareerVivid CLI — Post-install hook
3
3
  *
4
4
  * This script runs after 'npm install -g careervivid'.
5
- * It prints a beautiful welcome/onboarding message to the user.
5
+ * It checks Node version compatibility and prints a welcome message.
6
6
  */
7
7
  export declare function printPostInstall(): void;
8
8
  //# sourceMappingURL=postinstall.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"postinstall.d.ts","sourceRoot":"","sources":["../src/postinstall.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,wBAAgB,gBAAgB,SA2C/B"}
1
+ {"version":3,"file":"postinstall.d.ts","sourceRoot":"","sources":["../src/postinstall.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiCH,wBAAgB,gBAAgB,SA4C/B"}
@@ -2,13 +2,33 @@
2
2
  * CareerVivid CLI — Post-install hook
3
3
  *
4
4
  * This script runs after 'npm install -g careervivid'.
5
- * It prints a beautiful welcome/onboarding message to the user.
5
+ * It checks Node version compatibility and prints a welcome message.
6
6
  */
7
7
  import chalk from "chalk";
8
8
  import boxen from "boxen";
9
9
  import { getHelpHeader } from "./branding.js";
10
10
  const VERSION = "1.1.14";
11
+ const MIN_NODE_MAJOR = 18;
12
+ function checkNodeVersion() {
13
+ const [major] = process.versions.node.split(".").map(Number);
14
+ if (major < MIN_NODE_MAJOR) {
15
+ console.error(boxen(`${chalk.bold.red("⚠️ Node.js version too old")}\n\n` +
16
+ `You have Node ${chalk.bold(process.versions.node)}, but CareerVivid CLI requires ${chalk.bold(`v${MIN_NODE_MAJOR}+`)}\n\n` +
17
+ `${chalk.bold("To upgrade Node.js:")}\n` +
18
+ ` ${chalk.cyan("https://nodejs.org")} (download the LTS release)\n` +
19
+ ` ${chalk.dim("or")} ${chalk.cyan("nvm install --lts && nvm use --lts")}\n\n` +
20
+ `${chalk.dim("The CLI may not work correctly until you upgrade.")}`, {
21
+ padding: 1,
22
+ borderStyle: "round",
23
+ borderColor: "red",
24
+ title: "Version Warning",
25
+ titleAlignment: "center",
26
+ }));
27
+ // Don't exit — let them at least see the welcome message
28
+ }
29
+ }
11
30
  export function printPostInstall() {
31
+ checkNodeVersion();
12
32
  console.log();
13
33
  console.log(getHelpHeader());
14
34
  // ── Onboarding box ──────────────────────────────────────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "careervivid",
3
- "version": "1.12.24",
3
+ "version": "1.12.25",
4
4
  "description": "Official CLI for CareerVivid — publish articles, diagrams, and portfolio updates from your terminal or AI agent",
5
5
  "type": "module",
6
6
  "bin": {
@@ -43,7 +43,7 @@
43
43
  "typescript": "^5.4.0"
44
44
  },
45
45
  "engines": {
46
- "node": ">=20.0.0"
46
+ "node": ">=18.0.0"
47
47
  },
48
48
  "overrides": {
49
49
  "braces": "3.0.3",