Repository navigation
fix: build dist/ in prepare so installs from git work - #39
Merged
Merged
Conversation
npm runs a git dependency's prepare script before packing it, but not prepack, so `npm install github:sidorares/node-rfb2#<branch>` gave a package without dist/ and `import 'rfb2'` failed. Build in prepare instead of prepack. npm also runs prepare on `npm install` / `npm ci` in a clone and before `npm pack` and `npm publish`, so the workflows no longer need their own build step.
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.
Installing from git gave a package without
dist/, soimport 'rfb2'failed withERR_MODULE_NOT_FOUND. npm runs a git dependency'spreparescript before packing it, but notprepack, anddist/was built inprepack.Change
package.json:"prepack": "npm run build"becomes"prepare": "npm run build". npm runsprepareon git installs, onnpm install/npm ciin a clone, and beforenpm packandnpm publish, soprepackisn't needed. Installs from the registry don't run it.filesis unchanged (dist,src).npm run buildsteps inci.yml,release-please.ymlandrelease.yml.npm cinow buildsdist/, andnpm pack --dry-runandnpm publishbuild it again before packing, so the extra step was a third build. Biome already ignoresdist/, so lint is unaffected whendist/exists before it runs.npm installalso buildsdist/, and how to install an unreleased branch from git.Verification
npm ciin a clean clone runsprepareand writesdist/.npm run checkpasses (Biome, tsc, 291 unit tests).npm pack --dry-runrunsprepareand listsdist/(70 files).The same install from
#mastergivesLICENSE README.md package.json srcandERR_MODULE_NOT_FOUND.Closes #35