chore(core): commit built dist/ for git-dependency consumption#239
Open
sksizer wants to merge 1 commit into
Open
chore(core): commit built dist/ for git-dependency consumption#239sksizer wants to merge 1 commit into
sksizer wants to merge 1 commit into
Conversation
The package is consumed as a private git dependency (no npm publish) and exports/types/bin all point into dist/. A git install can't build it on the consumer's machine: the dependency never receives its own devDependencies (no tsc/@types), and pnpm/bun both block lifecycle scripts of git deps by default — pnpm additionally mis-detects the install tool for the prepare flow (tries yarn). So the committed dist/ is what git installs resolve against. Rebuild with 'bun run build' in packages/core when src/ changes.
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.
Problem
The package is private (no npm publish) and meant to be consumed as a git dependency (
github:sksizer/markdown-contract#<ref>&path:packages/core). Butexports/types/binall point intodist/, which is gitignored — so every git install resolves to a package with no code. Downstream (sksizer/family) currently works around this by vendoring a hand-built tarball in-repo.Why not a
preparescriptTried and verified it fails for real consumers:
devDependencies, sotsc/@typesaren't there to build with.onlyBuiltDependencies.yarn install(ERR_PNPM_PREPARE_PACKAGE: spawn yarn ENOENT).Fix
Commit the built
dist/(39 modules + d.ts + maps) and carvepackages/core/distout of the root gitignore, with a comment explaining why. No lifecycle scripts added — consumers just pack what's in the tree (files: ["dist"]), which is deterministic across pnpm/bun/npm and needs zero consumer-side configuration.Verified end to end with a fresh consumer:
Maintenance
dist/must be rebuilt (bun run buildinpackages/core) wheneversrc/changes — noted in the gitignore comment. A lefthook pre-push check (build + diff) could enforce freshness later if drift becomes a problem.Supersedes the stale
chore/add-prepare-scriptbranch (cut ~1000 commits ago, pre-monorepo), which reached the same conclusion; that branch can be deleted.Once merged,
sksizer/familycan dropvendor/markdown-contract-0.1.0-69c4e66.tgzand depend on a plain git ref.