Add a prepare script so dependicus installs from git - #101
Merged
Merged
Conversation
mblair
approved these changes
Sep 17, 2026
Installing from a git URL clones the repo and runs `prepare`, which didn't exist, so `dist/` was never built and the `dependicus` bin pointed at nothing. `prepare` spells the build command out rather than delegating to a package manager, since it runs under whichever one the installing project uses. A test keeps it in step with `build`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Yarn builds a git dependency by running prepack in a bootstrap environment where only yarn is on PATH, so `pnpm run build` failed there with "command not found: pnpm". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Each package manager gates a git dependency's build script differently. pnpm and yarn need a line of config naming dependicus as trusted; npm needs nothing. Bun and aube can't do it at all. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
irskep
force-pushed
the
prepare-script
branch
from
September 17, 2026 17:21
55a3e98 to
43e5be5
Compare
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.
This PR is because I want to run the commit in #100 in CI for Atticus until there's a release.
Installing from a git URL gave you a
dependicuspackage with nodist/, so thebinpointed at a file that wasn't there. Package managers build a git dependency by running a lifecycle script after cloning, and this package didn't have one.There are two, because they disagree about which: npm, pnpm and bun run
prepare, yarn runsprepack.prepackalready existed but ranpnpm run build, and yarn runs it in a bootstrap environment where only yarn is on PATH, so it died withcommand not found: pnpm. Both now spell the build out instead of delegating to a package manager, and a test keeps them in step withbuild.Verified by installing from this branch:
onlyBuiltDependenciesapprovedGitRepositoriespnpm and yarn refuse to run a git dependency's build script until you name the package as trusted, which is a sensible thing for them to do and just needs one line from the installing project. The README section has both.
Bun installs a git dependency without its devDependencies, so
prepareruns with norolldownto build with. Aube doesn't take git specifiers at all. Neither is fixable from this side, so the README says so rather than letting people find out themselves.One behavior change worth knowing:
preparealso runs on a plaininstallin this repo, so a local install now builds too.🤖 Generated with Claude Code