@bobfrankston/npmglobalize 1.0.234 → 1.0.235

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 +2 -0
  2. package/lib.js +21 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -527,6 +527,8 @@ 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)
531
+
530
532
  `ts` is already the default on git (source is tracked). Pass `-npm ts` to ship
531
533
  the same files to npm — useful for debugging installed packages or "source on
532
534
  demand" packages. `noEmit` projects automatically ship `.ts` files (they *are*
package/lib.js CHANGED
@@ -1088,7 +1088,7 @@ export async function cascadePublicVisibility(cwd, opts = {}) {
1088
1088
  console.log(colors.green(` ✓ Flipped ${targetName} to PUBLIC on npm`));
1089
1089
  }
1090
1090
  else {
1091
- blockers.push({ name: targetName, reason: `npm access set failed: ${r.stderr || r.output || 'unknown'}` });
1091
+ blockers.push({ name: targetName, reason: explainAccessChangeFailure(targetName, 'public', r) });
1092
1092
  }
1093
1093
  }
1094
1094
  else {
@@ -6107,6 +6107,24 @@ function checkNpmAuth() {
6107
6107
  return { authenticated: false, error: error.message };
6108
6108
  }
6109
6109
  }
6110
+ /** Explain a failed `npm access set status=...` and say what will actually work.
6111
+ * 2026-09-23 01:10 EDT — Claude Code (Fable 5.1), at Bob's direction. Since early Aug
6112
+ * 2026 a granular token that bypasses 2FA no longer covers package-access changes
6113
+ * (https://gh.io/npm-gat-bypass2fa-deprecation): the registry answers the access POST
6114
+ * with a bare 403 and npm never offers an OTP prompt. The old message here said "Try
6115
+ * manually: npm access set ..." — the same command with the same token, which fails
6116
+ * the same way. The path that works is the package's Access page on npmjs.com, signed
6117
+ * in with 2FA. Recorded as a build issue too, so it survives to the Issues Summary. */
6118
+ function explainAccessChangeFailure(name, status, result) {
6119
+ const text = `${result.stderr}\n${result.output}`;
6120
+ const tokenBlocked = /\bE?403\b/.test(text) && /\/access\b/.test(text);
6121
+ const page = `https://www.npmjs.com/package/${name}/access`;
6122
+ const message = tokenBlocked
6123
+ ? `Cannot change ${name} to ${status} with the npm token in .npmrc (403 on the access endpoint): since Aug 2026 bypass-2FA tokens no longer cover access changes. Set Package Status on ${page} (browser, 2FA), then rerun.`
6124
+ : `Failed to change ${name} to ${status}. Try manually: npm access set status=${status} ${name} (or on ${page}).`;
6125
+ recordBuildIssue(name, 'error', message);
6126
+ return message;
6127
+ }
6110
6128
  /** Get authentication setup instructions */
6111
6129
  function getAuthInstructions() {
6112
6130
  const npmrcPath = path.join(process.env.USERPROFILE || process.env.HOME || '~', '.npmrc');
@@ -7981,7 +7999,7 @@ export async function globalize(cwd, options = {}, configOptions = {}) {
7981
7999
  currentAccess = 'restricted';
7982
8000
  }
7983
8001
  else {
7984
- console.error(colors.red(`Failed to change access. Try manually: npm access set status=restricted ${pkg.name}`));
8002
+ console.error(colors.red(explainAccessChangeFailure(pkg.name, 'restricted', accessResult)));
7985
8003
  if (!force)
7986
8004
  return false;
7987
8005
  }
@@ -8004,7 +8022,7 @@ export async function globalize(cwd, options = {}, configOptions = {}) {
8004
8022
  currentAccess = 'public';
8005
8023
  }
8006
8024
  else {
8007
- console.error(colors.red(`Failed to change access. Try manually: npm access set status=public ${pkg.name}`));
8025
+ console.error(colors.red(explainAccessChangeFailure(pkg.name, 'public', accessResult)));
8008
8026
  if (!force)
8009
8027
  return false;
8010
8028
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/npmglobalize",
3
- "version": "1.0.234",
3
+ "version": "1.0.235",
4
4
  "description": "Transform file: dependencies to npm versions for publishing",
5
5
  "main": "index.js",
6
6
  "type": "module",