@bobfrankston/npmglobalize 1.0.225 → 1.0.227
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/README.md +8 -6
- package/cli.js +15 -9
- package/lib.d.ts +2 -1
- package/lib.js +33 -14
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -486,9 +486,9 @@ not what you meant to publish, so npmglobalize lists the conflicted files and st
|
|
|
486
486
|
-install, -i Install globally after publish (from registry)
|
|
487
487
|
-link Install globally via symlink (npm install -g .)
|
|
488
488
|
-local-install Install from the local directory only — skip transform/publish, just
|
|
489
|
-
npm install -g . with file: deps as-is (also -localinstall
|
|
490
|
-
the
|
|
491
|
-
to npmchanges.md as "(local)"
|
|
489
|
+
npm install -g . with file: deps as-is (also -localinstall, -install-local,
|
|
490
|
+
-installlocal; the old -local is an error). Persisted; a .commitmsg is
|
|
491
|
+
still logged to npmchanges.md as "(local)"
|
|
492
492
|
-global Clear a persisted -local-install in .globalize.json5 — back to the normal
|
|
493
493
|
transform/publish flow (publishes to npm again)
|
|
494
494
|
-wsl Also install in WSL
|
|
@@ -898,9 +898,11 @@ This is useful for:
|
|
|
898
898
|
- Testing a CLI before publishing
|
|
899
899
|
- Projects with `file:` deps that should stay as-is
|
|
900
900
|
|
|
901
|
-
`-localinstall`
|
|
902
|
-
|
|
903
|
-
|
|
901
|
+
`-localinstall`, `-install-local` and `-installlocal` are accepted as well. The old
|
|
902
|
+
spelling `-local` is an error that names the replacement and exits without doing anything;
|
|
903
|
+
it was renamed (2026-09-07) because "local" read as "local mode" rather than "install from
|
|
904
|
+
the local directory", and a warning that then ran the whole cascade anyway was easy to miss
|
|
905
|
+
(2026-09-08).
|
|
904
906
|
|
|
905
907
|
`-local-install` is persisted to `.globalize.json5` (`"localInstall": true`; the older
|
|
906
908
|
`"local"` key is still read and is rewritten to the new name the next time the file is
|
package/cli.js
CHANGED
|
@@ -71,9 +71,9 @@ Install Options:
|
|
|
71
71
|
-install, -i Global install after publish (from registry)
|
|
72
72
|
-link Global install via symlink (npm install -g .)
|
|
73
73
|
-local-install Install from the local directory only — skip transform/publish, just
|
|
74
|
-
npm install -g . with file: deps as-is (also -localinstall
|
|
75
|
-
the
|
|
76
|
-
to npmchanges.md as "(local)"
|
|
74
|
+
npm install -g . with file: deps as-is (also -localinstall, -install-local,
|
|
75
|
+
-installlocal; the old -local is an error). Persisted; a .commitmsg is
|
|
76
|
+
still logged to npmchanges.md as "(local)"
|
|
77
77
|
-global Clear a persisted -local-install in .globalize.json5 — back to the normal
|
|
78
78
|
transform/publish flow (publishes to npm again)
|
|
79
79
|
-wsl Also install globally in WSL
|
|
@@ -233,15 +233,21 @@ function parseArgs(args) {
|
|
|
233
233
|
// 2026-09-07 — Claude Code (Fable 5.1), at Bob's direction: "-local is
|
|
234
234
|
// confusing" — it read like "local mode" / "local deps" rather than "install
|
|
235
235
|
// from the local directory". Renamed to -local-install (-localinstall also
|
|
236
|
-
// accepted).
|
|
237
|
-
//
|
|
238
|
-
//
|
|
239
|
-
//
|
|
236
|
+
// accepted). The .globalize.json5 key was renamed "local" → "localInstall"
|
|
237
|
+
// the same day; readConfig accepts the old name and rewrites it.
|
|
238
|
+
// 2026-09-08 — Claude Code (Fable 5.1), at Bob's direction: -local is now a
|
|
239
|
+
// hard error, not a warning. As a warning it printed one yellow line and then
|
|
240
|
+
// ran the whole cascade anyway (Bob: "you continue rather than exiting"), so
|
|
241
|
+
// the note scrolled off before it could be acted on. Same exit path as an
|
|
242
|
+
// unrecognized flag. -install-local / -installlocal are accepted too: the word
|
|
243
|
+
// order is easy to get backwards (Bob typed "-installlocal" reporting this).
|
|
240
244
|
case '-local':
|
|
241
|
-
|
|
242
|
-
|
|
245
|
+
options.error = '-local was renamed -local-install (or -localinstall). Same meaning: npm install -g . from the local directory, no publish.';
|
|
246
|
+
break;
|
|
243
247
|
case '-local-install':
|
|
244
248
|
case '-localinstall':
|
|
249
|
+
case '-install-local':
|
|
250
|
+
case '-installlocal':
|
|
245
251
|
options.localInstall = true;
|
|
246
252
|
options.explicitKeys.add('localInstall');
|
|
247
253
|
break;
|
package/lib.d.ts
CHANGED
|
@@ -204,7 +204,8 @@ export declare function getUserConfigDir(): string;
|
|
|
204
204
|
export declare function readUserNpmConfig(): UserNpmConfig;
|
|
205
205
|
/** Write global npm config to %USERPROFILE%\.userconfig\npm.json5 */
|
|
206
206
|
export declare function writeUserNpmConfig(config: UserNpmConfig): void;
|
|
207
|
-
/** Read .globalize.json5 config file
|
|
207
|
+
/** Read .globalize.json5 config file. A file carrying a renamed key is
|
|
208
|
+
* rewritten on the spot, once. */
|
|
208
209
|
export declare function readConfig(dir: string): Partial<GlobalizeOptions>;
|
|
209
210
|
/** Write .globalize.json5 config file */
|
|
210
211
|
export declare function writeConfig(dir: string, config: Partial<GlobalizeOptions>, explicitKeys?: Set<string>): void;
|
package/lib.js
CHANGED
|
@@ -304,32 +304,50 @@ export function writeUserNpmConfig(config) {
|
|
|
304
304
|
const merged = { ...existing, ...config };
|
|
305
305
|
writeUserConfig(merged);
|
|
306
306
|
}
|
|
307
|
-
/**
|
|
308
|
-
|
|
307
|
+
/** Parse .globalize.json5 and apply key migrations in memory. Does not touch
|
|
308
|
+
* the file; readConfig does the rewrite so writeConfig can call this without
|
|
309
|
+
* recursing into itself. */
|
|
310
|
+
function parseConfig(dir) {
|
|
309
311
|
const configPath = path.join(dir, '.globalize.json5');
|
|
310
312
|
if (!fs.existsSync(configPath)) {
|
|
311
|
-
return {};
|
|
313
|
+
return { config: {}, migrated: false };
|
|
312
314
|
}
|
|
313
315
|
try {
|
|
314
316
|
const content = fs.readFileSync(configPath, 'utf-8');
|
|
315
317
|
const config = JSON5.parse(content);
|
|
316
318
|
// 2026-09-07 — Claude Code (Fable 5.1), at Bob's direction: the "local" key
|
|
317
319
|
// was renamed "localInstall" along with the -local → -local-install flag.
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
320
|
+
let migrated = false;
|
|
321
|
+
if ('local' in config) {
|
|
322
|
+
if (!('localInstall' in config))
|
|
323
|
+
config.localInstall = config.local;
|
|
324
|
+
delete config.local;
|
|
325
|
+
migrated = true;
|
|
324
326
|
}
|
|
325
|
-
|
|
326
|
-
return config;
|
|
327
|
+
return { config, migrated };
|
|
327
328
|
}
|
|
328
329
|
catch (error) {
|
|
329
330
|
console.warn(`Warning: Could not parse .globalize.json5 config: ${error.message}`);
|
|
330
|
-
return {};
|
|
331
|
+
return { config: {}, migrated: false };
|
|
331
332
|
}
|
|
332
333
|
}
|
|
334
|
+
/** Read .globalize.json5 config file. A file carrying a renamed key is
|
|
335
|
+
* rewritten on the spot, once. */
|
|
336
|
+
export function readConfig(dir) {
|
|
337
|
+
const { config, migrated } = parseConfig(dir);
|
|
338
|
+
// 2026-09-08 — Claude Code (Fable 5.1), at Bob's direction. The migration
|
|
339
|
+
// used to be applied in memory only and announced "rewritten on the next
|
|
340
|
+
// persist" -- on every one of the several readConfig calls a package gets
|
|
341
|
+
// during a cascade, so the same line printed twice per dep and the file
|
|
342
|
+
// stayed stale until that package itself published. Now the file is
|
|
343
|
+
// rewritten immediately; the split into parseConfig keeps writeConfig's
|
|
344
|
+
// own read from re-entering this rewrite.
|
|
345
|
+
if (migrated) {
|
|
346
|
+
writeConfig(dir, config, new Set(['localInstall']));
|
|
347
|
+
console.log(colors.dim(` (${path.join(dir, '.globalize.json5')}: renamed "local" to "localInstall")`));
|
|
348
|
+
}
|
|
349
|
+
return config;
|
|
350
|
+
}
|
|
333
351
|
/** Inline comments for boolean settings in .globalize.json5. Value-aware: a
|
|
334
352
|
* negated setting must not read as though it still does the thing (a
|
|
335
353
|
* `"quiet": false` line saying "Suppress npm warnings" describes the
|
|
@@ -374,8 +392,9 @@ export function writeConfig(dir, config, explicitKeys) {
|
|
|
374
392
|
freeze: false,
|
|
375
393
|
usePaths: true
|
|
376
394
|
};
|
|
377
|
-
// Read existing config to preserve values
|
|
378
|
-
|
|
395
|
+
// Read existing config to preserve values (parseConfig, not readConfig:
|
|
396
|
+
// readConfig may rewrite the file, which calls back into writeConfig)
|
|
397
|
+
const existing = parseConfig(dir).config;
|
|
379
398
|
// Filter out temporary flags and default values (unless explicitly set)
|
|
380
399
|
const filtered = {};
|
|
381
400
|
// upstream is bookkeeping written by recordUpstream, never a CLI option, so
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobfrankston/npmglobalize",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.227",
|
|
4
4
|
"description": "Transform file: dependencies to npm versions for publishing",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@bobfrankston/freezepak": "^0.1.9",
|
|
35
35
|
"@bobfrankston/importgen": "^0.1.43",
|
|
36
36
|
"@bobfrankston/themecolors": "^0.1.10",
|
|
37
|
-
"@bobfrankston/userconfig": "^1.0.
|
|
37
|
+
"@bobfrankston/userconfig": "^1.0.13",
|
|
38
38
|
"@npmcli/package-json": "^7.0.4",
|
|
39
39
|
"json5": "^2.2.3",
|
|
40
40
|
"libnpmversion": "^8.0.3",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@bobfrankston/freezepak": "^0.1.9",
|
|
63
63
|
"@bobfrankston/importgen": "^0.1.43",
|
|
64
64
|
"@bobfrankston/themecolors": "^0.1.10",
|
|
65
|
-
"@bobfrankston/userconfig": "^1.0.
|
|
65
|
+
"@bobfrankston/userconfig": "^1.0.13",
|
|
66
66
|
"@npmcli/package-json": "^7.0.4",
|
|
67
67
|
"json5": "^2.2.3",
|
|
68
68
|
"libnpmversion": "^8.0.3",
|