Repository navigation
chore: add prepare script so github-installed consumers get dist/ - #1
Merged
Merged
Conversation
When this package is installed via a git ref (e.g. "github:willow-network/willow-sdk-typescript" in a consumer's package.json) npm checks out the source but doesn't run any build, so the resolved dependency has no dist/ and consumers fail with "Cannot find module '@willow-network/sdk'". prepare runs automatically after npm install both in this repo's own dev flow AND for git-installed consumers. Same idiom most TS libs use to be installable straight from git without first being published to npm. prepublishOnly stays — it's the canonical pre-npm-publish hook.
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.
Summary
When this package is installed via a git ref (e.g.
"github:willow-network/willow-sdk-typescript"in a consumer's package.json), npm checks out the source but doesn't run any build — so the resolved dependency has nodist/and consumers fail withCannot find module '@willow-network/sdk'.prepareruns automatically afternpm installboth in this repo's own dev flow AND for git-installed consumers. Same idiom most TS libs use to be installable straight from git without first being published to npm.prepublishOnlystays — it's the canonical pre-npm-publish hook.Motivation
Hit this trying to use the SDK as a github dep from the new (in-progress)
willow-mcprepo. Once@willow-network/sdkis published to npm proper, github-ref installs become less relevant — but until then, this unblocks any downstream consumer pulling from git.