Skip to content

fix: declare no runtime dependencies so npm install cargo-hauler works on npm 12 - #82

Merged
ScriptedAlchemy merged 3 commits into
masterfrom
fix/no-runtime-dependencies
Sep 4, 2026
Merged

ScriptedAlchemy merged 3 commits into
masterfrom
fix/no-runtime-dependencies

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Problem

A fresh npm install -g cargo-hauler@0.4.7 fails for anyone on npm 12 (Node 24+):

npm error code EALLOWREMOTE
npm error Fetching packages of type "remote" have been disabled
npm error Refusing to fetch "@agent-bundle/runtime@https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@42539ff…"

npm 12 ships allow-remote=none and allow-git=none by default. package.json listed @agent-bundle/runtime (pkg.pr.new tarball) and bashjsast (github: ref) under dependencies, plus effect, react, zod, MCP SDK, etc. None of it is needed at install or run time: every file in dist/bin and artifact/** imports only Node built-ins (verified on the published tarball), because agent-bundle bundles all dependencies into the outputs. The README's "the agent-bundle framework is a development dependency only" was the intent; the manifest said otherwise.

Change

  • Move everything in dependencies to devDependencies. Build, validate, and typecheck are unaffected (same packages, same versions, same lockfile resolution).
  • README Install: one sentence stating the package declares no runtime dependencies.
  • Changeset (patch).

Proof

pnpm run build && npm pack, then in an empty directory with stock npm 12.0.2 defaults:

$ npm install ../cargo-hauler-0.4.7.tgz
$ ls node_modules
cargo-hauler
$ node node_modules/cargo-hauler/dist/bin/hauler.js --help           # works
$ node node_modules/cargo-hauler/dist/bin/cargo-hauler-install.js --help   # works

Upstream, agent-bundle PR #547 adds prepack diagnostics AB7014 (a declared dependency no packed JS imports) and AB7015 (git / remote / path dependency specifier) so this cannot ship again; run against this repo's 0.4.7 tarball it reports exactly the 11 unused entries and the 2 non-registry specifiers fixed here.

Follow-up (not in this PR)

npm 12 prints 1 package had install scripts blocked … cargo-hauler (prepare: effect-tsgo patch …) on consumer installs. The prepare script is a contributor-only step; it does not run for tarball installs, but the warning is noise worth removing from the published manifest.

Every shipped file (dist/bin/*.js, artifact/**) bundles the libraries it
uses, yet package.json listed the whole build-time stack under
dependencies — including @agent-bundle/runtime as a pkg.pr.new tarball and
bashjsast as a github: ref. npm 12 refuses those by default
(allow-remote=none, allow-git=none), so `npm install -g cargo-hauler@0.4.7`
fails with EALLOWREMOTE before any code runs. Move the stack to
devDependencies; the emitted packs and executables are byte-for-byte the
same shape, and a clean-room `npm install <tarball>` now installs exactly
one package.
@changeset-bot

changeset-bot Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 138cbb6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
cargo-hauler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-04T09:10:07.148630Z 138cbb6 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 138cbb6267

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ScriptedAlchemy
ScriptedAlchemy merged commit 3ad6b7e into master Sep 4, 2026
2 checks passed
@ScriptedAlchemy
ScriptedAlchemy deleted the fix/no-runtime-dependencies branch September 4, 2026 10:04
@github-actions github-actions Bot mentioned this pull request Sep 4, 2026
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