@bobfrankston/npmglobalize 1.0.235 → 1.0.237

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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/lib.js +28 -8
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -527,7 +527,7 @@ not what you meant to publish, so npmglobalize lists the conflicted files and st
527
527
  Example: -npm public,ts
528
528
  ```
529
529
 
530
- Flipping an already-published package between private and public runs `npm access set`. Since Aug 2026 that fails with a bare 403 when the token in `.npmrc` is a bypass-2FA granular token (npm no longer lets such tokens change package access, and offers no OTP prompt). npmglobalize recognizes that case, says so, and points at the package's Access page on npmjs.com (`https://www.npmjs.com/package/<name>/access`, browser sign-in with 2FA); set the status there and rerun. The finding is repeated in the Issues Summary. Publishing itself is unaffected until the Jan 2027 phase of the same deprecation. (2026-09-23)
530
+ Flipping an already-published package between private and public runs `npm access set`. Since Aug 2026 that fails with a bare 403 when the token in `.npmrc` is a bypass-2FA granular token (npm no longer lets such tokens change package access, and offers no OTP prompt). npmglobalize recognizes that case, says so, and points at the package's Access page on npmjs.com (`https://www.npmjs.com/package/<name>/access`, browser sign-in with 2FA); set the status there and rerun. The failed flip does not stop the publish: the package still goes up with the access npm currently has (the run says so, and the summary reports that access, not the requested one), and the requested visibility stays in `.globalize.json5` so the next run tries the flip again. The finding is repeated in the Issues Summary. Publishing itself is unaffected until the Jan 2027 phase of the same deprecation. (2026-09-23)
531
531
 
532
532
  `ts` is already the default on git (source is tracked). Pass `-npm ts` to ship
533
533
  the same files to npm — useful for debugging installed packages or "source on
package/lib.js CHANGED
@@ -7993,15 +7993,26 @@ export async function globalize(cwd, options = {}, configOptions = {}) {
7993
7993
  if (currentAccess === 'public') {
7994
7994
  console.log(colors.yellow(`Package '${pkg.name}' is currently PUBLIC on npm. Converting to private...`));
7995
7995
  if (!dryRun) {
7996
- const accessResult = await runCommandAsync('npm', ['access', 'set', 'status=restricted', pkg.name], { cwd, silent: false });
7996
+ // 2026-09-23 01:15 EDT — Claude Code (Fable 5.1): silent:true so npm's output is
7997
+ // CAPTURED (stdio 'inherit' captures nothing, and v1.0.235's 403 detection never
7998
+ // fired on httppoly). The captured text is echoed below on failure, so nothing is lost.
7999
+ const accessResult = await runCommandAsync('npm', ['access', 'set', 'status=restricted', pkg.name], { cwd, silent: true });
7997
8000
  if (accessResult.success) {
7998
8001
  console.log(colors.green(`✓ Changed ${pkg.name} to PRIVATE on npm`));
7999
8002
  currentAccess = 'restricted';
8000
8003
  }
8001
8004
  else {
8005
+ if (accessResult.stderr.trim())
8006
+ console.error(colors.dim(accessResult.stderr.trim()));
8002
8007
  console.error(colors.red(explainAccessChangeFailure(pkg.name, 'restricted', accessResult)));
8003
- if (!force)
8004
- return false;
8008
+ // 2026-09-23 01:20 EDT — Claude Code (Fable 5.1), Bob: "even if public fails
8009
+ // the npm store should still be updated". A failed flip no longer aborts the
8010
+ // publish: the package goes up with the access npm currently has, and
8011
+ // effectiveNpmVisibility is downgraded to match so the publish args and the
8012
+ // summaries report what actually happened. The requested visibility stays in
8013
+ // .globalize.json5, so the next run tries the flip again.
8014
+ effectiveNpmVisibility = 'public';
8015
+ console.log(colors.yellow(`Publishing ${pkg.name} as PUBLIC anyway (its current npm status); set it to private on the website, then rerun.`));
8005
8016
  }
8006
8017
  }
8007
8018
  else {
@@ -8009,29 +8020,38 @@ export async function globalize(cwd, options = {}, configOptions = {}) {
8009
8020
  }
8010
8021
  }
8011
8022
  // Don't set "private": true in package.json - that blocks all publishing
8012
- console.log(`Package '${pkg.name}' will publish as PRIVATE (restricted access).`);
8023
+ if (effectiveNpmVisibility === 'private')
8024
+ console.log(`Package '${pkg.name}' will publish as PRIVATE (restricted access).`);
8013
8025
  }
8014
8026
  else if (effectiveNpmVisibility === 'public') {
8015
8027
  // User explicitly wants public (or confirmed via prompt)
8016
8028
  if (currentAccess === 'restricted') {
8017
8029
  console.log(colors.yellow(`Package '${pkg.name}' is currently PRIVATE on npm. Converting to public...`));
8018
8030
  if (!dryRun) {
8019
- const accessResult = await runCommandAsync('npm', ['access', 'set', 'status=public', pkg.name], { cwd, silent: false });
8031
+ // 2026-09-23 01:15 EDT — Claude Code (Fable 5.1): silent:true to capture npm's
8032
+ // output for the 403 detection; echoed on failure. Same as the restricted branch.
8033
+ const accessResult = await runCommandAsync('npm', ['access', 'set', 'status=public', pkg.name], { cwd, silent: true });
8020
8034
  if (accessResult.success) {
8021
8035
  console.log(colors.green(`✓ Changed ${pkg.name} to PUBLIC on npm`));
8022
8036
  currentAccess = 'public';
8023
8037
  }
8024
8038
  else {
8039
+ if (accessResult.stderr.trim())
8040
+ console.error(colors.dim(accessResult.stderr.trim()));
8025
8041
  console.error(colors.red(explainAccessChangeFailure(pkg.name, 'public', accessResult)));
8026
- if (!force)
8027
- return false;
8042
+ // 2026-09-23 01:20 EDT — Claude Code (Fable 5.1), Bob: "even if public fails
8043
+ // the npm store should still be updated". Publish with the access npm has now
8044
+ // (restricted); no --access public is passed and the summaries say PRIVATE. The
8045
+ // requested visibility stays in .globalize.json5 so the next run retries the flip.
8046
+ effectiveNpmVisibility = 'private';
8047
+ console.log(colors.yellow(`Publishing ${pkg.name} as PRIVATE anyway (its current npm status); set it to public on the website, then rerun.`));
8028
8048
  }
8029
8049
  }
8030
8050
  else {
8031
8051
  console.log(colors.dim(` [dry-run] Would run: npm access set status=public ${pkg.name}`));
8032
8052
  }
8033
8053
  }
8034
- if (!publicConfirmed) {
8054
+ if (!publicConfirmed && effectiveNpmVisibility === 'public') {
8035
8055
  console.log(`Will publish '${pkg.name}' to PUBLIC npm registry.`);
8036
8056
  if (pkg.bin) {
8037
8057
  console.log(colors.yellow(` CLI tool - to install globally: npm install -g ${pkg.name}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/npmglobalize",
3
- "version": "1.0.235",
3
+ "version": "1.0.237",
4
4
  "description": "Transform file: dependencies to npm versions for publishing",
5
5
  "main": "index.js",
6
6
  "type": "module",