Repository navigation
ci(sdk): pack the SDK and import it from a clean install - #132
Merged
Merged
Conversation
…ocol#107) Adds a clean-install job to sdk-test.yml that runs packages/sdk/scripts/clean-install-check.mjs: npm pack, install the tarball into an empty temp project, then ESM import, CJS require and a tsc --noEmit type-check against the shipped .d.ts, constructing Agent#initX402() and x402Serve() with dummy config (no network). Also stops publishing compiled tests (dist/*.test.js/.d.ts) via a negated files entry; the job asserts no *.test.* file is in the tarball. Closes nirium-protocol#107 AI disclosure: drafted with AI assistance under my direction and reviewed by hand.
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.
Closes #107
What
clean-installjob in.github/workflows/sdk-test.yml(Node 22,npm install --no-audit --no-fund --legacy-peer-deps,npm run build), runningpackages/sdk/scripts/clean-install-check.mjs.npm pack --json→ asserts no*.test.*file and thatdist/index.js/dist/index.d.tsare present → installs the tarball into an empty temp project outside the monorepo → ESMimport+ CJSrequire, constructingnew Agent(),initX402({ secretKey })andx402Serve()with dummy config (no network: facilitator preflight is lazy, telemetry is off by default) →tsc --noEmit --strict(nodenext) of a consumer file against the shipped.d.ts. The temp dir is always cleaned up.packages/sdk/package.jsonfiles: adds"!dist/**/*.test.*", so compiled tests (dist/*.test.js/.d.ts) are no longer published. tsconfig and ts-jest are untouched.Why
Tests only ran from source, so the 0.10.0 / 0.13.0 / #68 packaging bugs were invisible to CI.
Verified locally (Node 22)
Packed tarball with 16 files and no test files; ESM, CJS and types all ok. Without the
fileschange the job fails with "tarball ships test files". On Node 20 the ESM import fails (ERR_REQUIRE_CYCLE_MODULEfrom stellar-sdk), consistent withengines: >=22.12.0.AI disclosure
Drafted with AI assistance under my direction; I reviewed the diff and the local run by hand before opening it.