chore: track build/ in git for git-ref installs#7
Merged
Conversation
Until this package is published to npm, downstream packages (notably escalated-adonis) must consume it via a git URL pinned to a tag: "@escalated-dev/plugin-sdk": "github:escalated-dev/escalated-plugin-sdk#v0.1.1" The previous setup added a `prepare` hook so npm would build the SDK right after cloning the git dep. That works on npm 10 but breaks on npm 11 (the cli ships with mutually exclusive --prefer-offline and --prefer-online flags during git-prepare child installs - see https://github.com/npm/cli for the open issue tracking this regression). Track build/ in git so the consumer install path is "clone the ref, read package.json's main/exports/types, done" with no on-install build step. Run-tests CI now fails when the committed build/ drifts from src/, so a stale build can never silently ship.
mpge
added a commit
that referenced
this pull request
Apr 19, 2026
Now that build/ ships in the repo (#7), the prepare lifecycle is unneeded. Worse, leaving it in triggers an npm 11 bug for git-URL consumers: npm spawns the prepare child install with both --prefer-offline=false AND --prefer-online=false, which the cli now rejects as mutually exclusive. Removing prepare bypasses that path entirely and lets git-ref installs succeed on every npm version. prepublishOnly is kept so an eventual `npm publish` still runs the build before packaging.
mpge
added a commit
that referenced
this pull request
Apr 19, 2026
Now that build/ ships in the repo (#7), the prepare lifecycle is unneeded. Worse, leaving it in triggers an npm 11 bug for git-URL consumers: npm spawns the prepare child install with both --prefer-offline=false AND --prefer-online=false, which the cli now rejects as mutually exclusive. Removing prepare bypasses that path entirely and lets git-ref installs succeed on every npm version. prepublishOnly is kept so an eventual `npm publish` still runs the build before packaging.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Until
@escalated-dev/plugin-sdkis published to npm, downstream consumers (notably escalated-adonis) install it via a git URL pinned to a tag:\"@escalated-dev/plugin-sdk\": \"github:escalated-dev/escalated-plugin-sdk#v0.1.1\"#6 added a
preparelifecycle hook so npm would build the SDK right after cloning the git dep. That worked on npm 10 but breaks on npm 11 (the bundled cli ships with mutually exclusive--prefer-offlineand--prefer-onlineflags during git-prepare child installs — both are passed simultaneously, which the cli now rejects with an Exit prior to config file resolving error).This PR tracks
build/in git so the consumer install path is just "clone the ref, read package.json's exports/main/types, done" with no on-install build step.A new freshness check in
run-tests.ymlfails the build whenever committedbuild/drifts fromsrc/, so a stalebuild/can never silently ship.When the package is later published to npm, this
build/-in-git arrangement can be unwound (revert this PR) and consumers can switch to a normal version range.Test plan
npm ci && npm run build && npx tsx --test ...— 5/5 tests passgit diff --quiet -- buildreturns clean immediately afternpm run build