Skip to content

ci(sdk): pack the SDK and import it from a clean install - #132

Merged
Eras256 merged 1 commit into
nirium-protocol:mainfrom
Edgadafi:feat/clean-install-ci
Oct 14, 2026
Merged

Eras256 merged 1 commit into
nirium-protocol:mainfrom
Edgadafi:feat/clean-install-ci

Conversation

@Edgadafi

Copy link
Copy Markdown
Contributor

Closes #107

What

  • New clean-install job in .github/workflows/sdk-test.yml (Node 22, npm install --no-audit --no-fund --legacy-peer-deps, npm run build), running packages/sdk/scripts/clean-install-check.mjs.
  • The script: npm pack --json → asserts no *.test.* file and that dist/index.js / dist/index.d.ts are present → installs the tarball into an empty temp project outside the monorepo → ESM import + CJS require, constructing new Agent(), initX402({ secretKey }) and x402Serve() 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.json files: 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 files change the job fails with "tarball ships test files". On Node 20 the ESM import fails (ERR_REQUIRE_CYCLE_MODULE from stellar-sdk), consistent with engines: >=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.

…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.
@Eras256
Eras256 merged commit d451df5 into nirium-protocol:main Oct 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: pack the SDK and import it from a clean install

2 participants