Skip to content

Add a prepare script so dependicus installs from git - #101

Merged
irskep merged 3 commits into
mainfrom
prepare-script
Sep 17, 2026
Merged

irskep merged 3 commits into
mainfrom
prepare-script

Conversation

@irskep

@irskep irskep commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

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 dependicus package with no dist/, so the bin pointed 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 runs prepack. prepack already existed but ran pnpm run build, and yarn runs it in a bootstrap environment where only yarn is on PATH, so it died with command not found: pnpm. Both now spell the build out instead of delegating to a package manager, and a test keeps them in step with build.

Verified by installing from this branch:

result
npm works, no config
pnpm works with onlyBuiltDependencies
yarn 4 works with approvedGitRepositories
bun can't
aube can't

pnpm 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 prepare runs with no rolldown to 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: prepare also runs on a plain install in this repo, so a local install now builds too.

🤖 Generated with Claude Code

stevelandey-byte and others added 3 commits September 17, 2026 10:21
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
irskep merged commit a42fbf9 into main Sep 17, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants