@codevector/cli 0.4.0 → 0.5.1

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": "@codevector/cli",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "description": "CodeVector CLI — installs and configures first-party coding-tool integrations.",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {
@@ -29,8 +29,8 @@
29
29
  "typescript": "6.0.3",
30
30
  "vitest": "4.1.5",
31
31
  "zod": "4.4.2",
32
- "@codevector/api": "1.10.0",
33
- "@codevector/common": "1.10.0"
32
+ "@codevector/api": "1.13.0",
33
+ "@codevector/common": "1.13.0"
34
34
  },
35
35
  "engines": {
36
36
  "node": ">=20"
@@ -5,10 +5,12 @@
5
5
  *
6
6
  * 1. Migrate legacy single-profile credentials.json to the multi-profile
7
7
  * format introduced in v0.4.0.
8
- * 2. Detect which package manager invoked the install (npm / pnpm / yarn),
9
- * parsed out of `process.env.npm_config_user_agent`, and persist it to
10
- * `~/.config/codevector/install.json` so `codevector update` can use
11
- * the same manager without prompting.
8
+ * 2. On a *global* install, detect which package manager invoked it
9
+ * (npm / pnpm / yarn), parsed out of `process.env.npm_config_user_agent`,
10
+ * and persist it to `~/.config/codevector/install.json` so
11
+ * `codevector update` can use the same manager without prompting.
12
+ * Non-global installs are skipped so a monorepo dev install can't
13
+ * clobber the record.
12
14
  *
13
15
  * Runs automatically after `npm install` / `pnpm install` / `yarn add`.
14
16
  * Zero external dependencies — only Node built-ins. Any error is silently
@@ -83,6 +85,14 @@ function migrateCredentialsIfNeeded() {
83
85
  }
84
86
 
85
87
  function capturePackageManagerIfPossible() {
88
+ // Only record on a genuine global install. Otherwise a non-global install
89
+ // that runs this script — most commonly the monorepo's own `pnpm install`,
90
+ // where this CLI is a workspace package — would clobber install.json with
91
+ // the wrong manager. npm, pnpm, and yarn all set npm_config_global=true for
92
+ // `-g` installs. When the binary isn't global, `codevector update` infers
93
+ // the manager from the install path instead.
94
+ if (process.env.npm_config_global !== "true") return;
95
+
86
96
  const pm = detectPackageManager();
87
97
  if (!pm) return;
88
98