chore: add prepack script mirroring prepare (SDK-763) - #191
Merged
Merged
Conversation
brax10ward
force-pushed
the
braxton/sdk-763-add-prepack-script
branch
from
September 1, 2026 23:29
420ebdb to
a46e618
Compare
Yarn 4's git-dep prep pipeline runs `yarn pack` on the clone before consuming it. `yarn pack` executes `prepack`, not `prepare`, so nothing built `lib/` and downstream consumers pulling this repo as a git dep (e.g. `github:atomicfi/atomic-transact-react-native#master`) ended up with a package whose `main`/`exports` pointed at nonexistent files. Add `prepack` as a mirror of `prepare` so the built output is present in the packed tarball regardless of which hook the consumer's tooling invokes. `prepare` stays in place — it still runs on local `yarn install` for our dev flow and on `npm publish`.
brax10ward
force-pushed
the
braxton/sdk-763-add-prepack-script
branch
from
September 3, 2026 16:26
a46e618 to
ce88d35
Compare
brax10ward
marked this pull request as ready for review
September 3, 2026 16:39
wesleyeff
approved these changes
Sep 3, 2026
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.
Linear Link
SDK-763
Type of change
Summary
Adds a
prepackscript topackage.jsonthat mirrors the existingpreparescript (bob build && cp package.json lib/package.json). Unblocks consumers who install this repo as a git dep via Yarn 4 (e.g.github:atomicfi/atomic-transact-react-native#master), whose current install produces a package with nolib/because Yarn 4's git-dep prep runsyarn pack→prepack, notprepare.Yarn 4's git-dep preparation pipeline clones the repo, runs
yarn installin it, then runsyarn packto produce a virtual tarball.yarn packexecutes theprepacklifecycle hook — notprepare. Because ourpackage.jsononly definedprepare, nothing builtlib/during that pipeline, so the resulting tarball respected ourfilesallowlist but shipped without the compiled output.main/exportsin the SDK point atlib/commonjs/index.js, so downstream consumers resolving via those fields (Node, Jest, tooling, and modern Metro with package-exports enabled) failed to load the SDK.Adding
prepackalongsideprepare(keeping both) means:yarn installin this repo still runsprepare— dev flow unchanged.npm publishstill runsprepare— published tarballs unchanged.yarn pack(including inside Yarn 4's git-dep prep pipeline) now runsprepack— downstream git-dep consumers get a working install.Verified
Before this change:
After this change:
Checklist: