Skip to content

chore: build on install so a git dependency resolves - #3

Merged
dmccoystephenson merged 1 commit into
mainfrom
chore/prepare-script
Sep 1, 2026
Merged

chore: build on install so a git dependency resolves#3
dmccoystephenson merged 1 commit into
mainfrom
chore/prepare-script

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Contributor

main points into dist/, which is gitignored, and there is no prepare script — only prepublishOnly, which runs on npm publish, not on install.

So npm install github:kingdom-community/github-docs currently resolves to a package with no build output, and every import from it fails. Nothing is published to npm yet, so a git dependency is the only way anyone — including this org's own sites — can consume this package today.

Adding "prepare": "npm run build" makes npm build the package at install time from a git URL. It has no effect on a published install, where dist/ is already in the tarball.

npm runs `prepare` when a package is installed from a git URL, and
`main` points into `dist/`, which is not committed. Without this, a
git-URL install resolves to a package with no build output and every
import from it fails. `prepublishOnly` does not cover that case: it
only runs on `npm publish`.

Until the first release lands on npm, a git dependency is the only way
to consume this package, and this is what makes that work.
@dmccoystephenson
dmccoystephenson merged commit fecf87c into main Sep 1, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant