chore(perch-js): make @stellar-registry/perch publishable to npm - #30
Open
willemneal wants to merge 1 commit into
Open
chore(perch-js): make @stellar-registry/perch publishable to npm#30willemneal wants to merge 1 commit into
willemneal wants to merge 1 commit into
Conversation
Turns the TS surface into a real, installable package so consumers (e.g. nidohq/nido's testkit) can depend on it instead of vendoring canonical.ts. - drop `private: true`; point main/types + `exports` at the built dist, add `files: ["dist"]`, `sideEffects: false`, and `publishConfig.access: public`. - add a build: `tsconfig.build.json` emits ESM + .d.ts to dist (NodeNext; every relative import already carries a .js suffix), wired as `npm run build` and `prepublishOnly`. - add a package README (shown on the npm page). - add .github/workflows/npm-publish.yml — publishes on a GitHub Release (or manual dispatch), SHA-pinned actions matching ci.yml, using an org NPM_TOKEN secret. The published doc_hash stays byte-identical to on-chain perch (canonical form unchanged). `npm pack --dry-run` ships only dist/; build + 20 tests green. First publish requires the NPM_TOKEN repo secret (@stellar-registry scope) and cutting a release; this PR does not publish. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
|
|
||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 |
| run: | ||
| working-directory: packages/perch-js | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| - name: Publish (public) | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| run: npm publish --access public |
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.
Turns the TS surface into a real, installable npm package, so consumers (e.g. nidohq/nido's
@nidohq/testkit) candependon it instead of vendoringcanonical.ts— removing the drift risk that a vendored copy carries.Changes
package.json— dropprivate: true; pointmain/types+exportsat the builtdist/, addfiles: ["dist"],sideEffects: false,publishConfig.access: public.tsconfig.build.json— emits ESM +.d.tstodist/(NodeNext; every relative import already carries a.jssuffix). Wired asnpm run build+prepublishOnly.README.md(package) — shown on the npm page..github/workflows/npm-publish.yml— publishes on a GitHub Release (or manual dispatch); SHA-pinned actions matchingci.yml; uses an orgNPM_TOKENsecret.Guarantees
doc_hashstays byte-identical to on-chain perch — the canonical form is unchanged.npm pack --dry-runships onlydist/(src/test excluded);npm run build+vitest(20 tests) green.To actually publish (not done by this PR)
NPM_TOKEN— an npm automation token with publish rights to the@stellar-registryscope.versionif needed, then cut a GitHub Release (or run the workflow via Run workflow). It builds, tests, andnpm publish --access public.🤖 Generated with Claude Code