Build dist on install so a branch or SHA can be depended on - #1228
Conversation
package.json ships `files: ["dist"]` and dist is gitignored, so `"@37signals/lexxy": "basecamp/lexxy#some-sha"` installed a package whose `module` entry pointed at a file that wasn't there. Verified before adding this: the install succeeds, and node_modules/@37signals/lexxy has no dist at all. `prepare` is the lifecycle npm and yarn both run for a git dependency, with devDependencies available, so pointing it at the npm rollup config makes a branch install produce the same dist a publish would. It also runs before publish, which is harmless — release already builds explicitly. That matters right now because three security branches are open against this repo and the consumer needs to test against them before any of it is released.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds an npm lifecycle script to automatically run the Rollup build for the npm bundle.
Changes:
- Adds a
preparescript that runsrollup -c rollup.config.npm.mjs.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
Handoff note for the whole campaign, including QA results and what still needs a human decision: #1234 |
One line in
package.json: apreparescript, soyarn installbuildsdist/.Without it,
"@37signals/lexxy": "basecamp/lexxy#<sha>"installs a package withno built output and the import fails. With it, a consumer can point at a branch
or a commit to try a change before it is released — which is how the rest of this
series gets QA'd against bc3.
No effect on the published package:
dist/is built by the release processeither way.
prepareruns onyarn installfrom a git ref and on local installs;it does not run for consumers installing from the registry.
Part of a series re-filing #1227 at reviewable scope, after #1227 was reverted
from
mainin 8c64aa4. Merge order: this → #dompurify → #images → #instance →#trusted-types → #1226. Nothing here is released.
Draft: needs human review and a soak period before merging.