Skip to content

fix(packaging): include auth/ and operator/ in published tarball (2.7.2)#31

Merged
Sentinel-Bluebuilder merged 1 commit into
masterfrom
fix/include-auth-dir-in-package-files
May 2, 2026
Merged

fix(packaging): include auth/ and operator/ in published tarball (2.7.2)#31
Sentinel-Bluebuilder merged 1 commit into
masterfrom
fix/include-auth-dir-in-package-files

Conversation

@Sentinel-Bluebuilder
Copy link
Copy Markdown
Owner

What

Fix the 2.7.1 packaging regression: auth/ and operator/ were missing from the published tarball, so every npm install blue-js-sdk@2.7.1 failed with ERR_MODULE_NOT_FOUND.

Why this slipped through

package.json "files" listed chain/, connection/, protocol/, etc., but not auth/ or operator/. The CI "Verify all imports resolve" step walked the source tree and resolved every from './...' against the on-disk directories — which all existed. The actual published tarball was never installed and imported in CI, so the gap between source and published surface was invisible.

Plan Manager surfaced it during the 2.7.0 → 2.7.1 upgrade attempt:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module
  '<...>\node_modules\blue-js-sdk\auth\adr36.js'
imported from <...>\node_modules\blue-js-sdk\index.js

After patching auth/, a clean-room verify revealed the same failure on operator/auto-lease.js. So it's not a one-off — it's a category of bug.

Fix

File Change
package.json Add \"auth/\" and \"operator/\" to \"files\"; bump to 2.7.2
.github/workflows/ci.yml New step: Verify published tarball imports cleanly. npm pack → install tarball in mktemp -dimport('blue-js-sdk') and assert ≥100 exports. This is the only test that exercises the actual published surface
CHANGELOG.md Document the regression and the new rule

Rule going forward

Every directory imported by index.js MUST appear in package.json "files".
Local-import checks cannot enforce this — they pass against the source tree even when the publish manifest omits a directory. The tarball-install CI step is the gate.

Verification

Locally, in a clean temp dir, against the patched tarball:

```
npm install ./blue-js-sdk-2.7.2.tgz
node -e "import('blue-js-sdk').then(m => console.log(Object.keys(m).length))"
→ 401
```

The new CI step runs the same sequence on every PR.

Consumer-side context

  • Plan Manager (Desktop/plans) attempted to bump to 2.7.1 to remove its runtime RPC-patch shim. Bump reverted to 2.7.0 after the install error. After 2.7.2 ships, Plan Manager will retry the bump and drop the patch.
  • Any other consumer that ran npm install blue-js-sdk@2.7.1 after publish hit the same ERR_MODULE_NOT_FOUND.

2.7.1 shipped broken: package.json "files" omitted auth/ and operator/, so
every `npm install blue-js-sdk@2.7.1` failed with ERR_MODULE_NOT_FOUND on
auth/adr36.js (and operator/auto-lease.js once auth was patched). Local CI
passed because every relative import resolved on disk — only a tarball
install would have caught it.

Changes:
- package.json: add "auth/" and "operator/" to "files"; bump to 2.7.2.
- .github/workflows/ci.yml: add "Verify published tarball imports cleanly"
  step. npm pack → install tarball in temp dir → import blue-js-sdk. This
  is the only test that exercises the actual published surface; the
  existing import checks all run against the source tree.
- CHANGELOG.md: document the regression and the new rule (every directory
  imported by index.js must appear in "files"; the tarball-install CI
  step is the gate).

Surfaced by: Plan Manager 2.7.0 → 2.7.1 upgrade attempt threw
`ERR_MODULE_NOT_FOUND: ...blue-js-sdk/auth/adr36.js`. Plan Manager
remained pinned to 2.7.0 with a runtime RPC patch as a workaround.

Verified: clean-room `npm pack` + temp-dir install + `import('blue-js-sdk')`
returns 401 exports.
@Sentinel-Bluebuilder Sentinel-Bluebuilder merged commit ce0254a into master May 2, 2026
2 checks passed
@Sentinel-Bluebuilder Sentinel-Bluebuilder deleted the fix/include-auth-dir-in-package-files branch May 2, 2026 21:19
Sentinel-Bluebuilder pushed a commit to Sentinel-Bluebuilder/sentinel-plan-manager that referenced this pull request May 3, 2026
SDK 2.7.2 ships an audited 12-endpoint RPC pool (rpc.sentinel.co excluded,
all the alternates we were injecting are now first-class). Plan Manager's
runtime patch in lib/chain.js (removeRpcEndpoint/addRpcEndpoint at module
load) is now redundant and removed. Refresh signing-RPC list in
lib/constants.js to match the in-sync set.

Verified: import('blue-js-sdk') → 401 exports clean; live rpcQueryBalance
through the default pool reaches a real Sentinel node.

PR upstream: Sentinel-Bluebuilder/blue-js-sdk#31
Sentinel-Bluebuilder pushed a commit to Sentinel-Bluebuilder/sentinel-plan-manager that referenced this pull request May 3, 2026
SDK 2.7.2 ships an audited 12-endpoint RPC pool (rpc.sentinel.co excluded,
all the alternates we were injecting are now first-class). Plan Manager's
runtime patch in lib/chain.js (removeRpcEndpoint/addRpcEndpoint at module
load) is now redundant and removed. Refresh signing-RPC list in
lib/constants.js to match the in-sync set.

Verified: import('blue-js-sdk') → 401 exports clean; live rpcQueryBalance
through the default pool reaches a real Sentinel node.

PR upstream: Sentinel-Bluebuilder/blue-js-sdk#31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant