Skip to content

feat: smoke-test companion workspace package tarballs - #263

Open
cybermax4200 wants to merge 5 commits into
wraith-protocol:developfrom
cybermax4200:feat/companion-package-tarball-smoke-tests
Open

cybermax4200 wants to merge 5 commits into
wraith-protocol:developfrom
cybermax4200:feat/companion-package-tarball-smoke-tests

Conversation

@cybermax4200

Copy link
Copy Markdown

What

Adds a pnpm test:packages smoke suite (test/smoke/packages.mjs) that packs each companion workspace package into a tarball and verifies it as an independently publishable package:

  • sdk-agent, sdk-react, sdk-vue, sdk-solid, sdk-svelte, codemod, test-vectors
  • Per package: fresh tsup build → pnpm pack --dry-run --json file-list check (files coverage, deny rules, entry-point targets) → real tarball unpacked into a clean fixture's node_modules/ → ESM import of every entry point → tsc --noEmit declaration resolution → documented-export existence check
  • Fails explicitly when a workspace-only import (@wraith-protocol/*: workspace:*) cannot resolve from npm — the signal this issue asks for
  • Wired into CI via a new packages job (Node 20/22/24) mirroring the existing entrypoints job

Why

Wave 9's pack/export checks only covered the core SDK entrypoints; sdk-react, sdk-vue, sdk-solid, sdk-svelte, sdk-agent, codemod, and test-vectors were never smoke-tested as independently published tarballs (#205 left a gap).

Closes #241

@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

@cybermax4200 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@truthixify truthixify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: test/smoke/packages.mjs:282-295 deliberately skips every @wraith-protocol dependency, then lines 444-457 manually unpack only the target tarball. That is not the layout produced by npm/pnpm install: these companion packages legitimately declare the core SDK and other Wraith packages as dependencies, and pack rewrites workspace:* to publishable versions. The new required job therefore fails sdk-agent, sdk-react, sdk-vue, sdk-solid, and sdk-svelte on Node 20/22/24 by construction. Install the target tarball through the package manager and satisfy in-repo dependencies with their packed tarballs (or the rewritten published versions), then separately assert that no workspace: protocol remains in the packed manifest. The required matrix must pass.

- Replace installThirdPartyDeps + manual unpackTarball with installPackage,
  which writes a fixture package.json referencing @wraith-protocol/* deps as
  file: tarballs and third-party deps by version range, then runs pnpm install
  so the fixture layout matches a real consumer install.
- Add packWraithDeps / collectWraithDeps to transitively pack every
  @wraith-protocol/* workspace dependency into the same temp dir.
- Add noWorkspaceProtocolInPacked to assert pnpm rewrote all workspace:*
  references before packaging.
- Remove mkdirSync import (no longer used).

Fixes sdk-agent, sdk-react, sdk-vue, sdk-solid, sdk-svelte on Node 20/22/24.
@cybermax4200

cybermax4200 commented Oct 22, 2026 •

Copy link
Copy Markdown
Author

Blocking: test/smoke/packages.mjs:282-295 deliberately skips every @wraith-protocol dependency, then lines 444-457 manually unpack only the target tarball. That is not the layout produced by npm/pnpm install: these companion packages legitimately declare the core SDK and other Wraith packages as dependencies, and pack rewrites workspace:* to publishable versions. The new required job therefore fails sdk-agent, sdk-react, sdk-vue, sdk-solid, and sdk-svelte on Node 20/22/24 by construction. Install the target tarball through the package manager and satisfy in-repo dependencies with their packed tarballs (or the rewritten published versions), then separately assert that no workspace: protocol remains in the packed manifest. The required matrix must pass.

It's done. Please review

@truthixify truthixify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The companion tarball matrix remains red on this head. The fixture exposes real publishability failures: sdk-agent imports AgentResponseError that the packed core does not export, sdk-react imports the unexported ./chains/stellar subpath, and the Vue/Solid/Svelte fixtures still resolve @wraith-protocol/sdk-agent from npm and get 404 instead of installing its packed workspace tarball. Ensure every declared Wraith dependency is packed and installed locally, then fix the packed core exports/version alignment so Node 20/22/24 all pass.

- Correct packTarball to locate the exact package tarball by name and version
  instead of taking the last file in readdir order.
- Cache packed workspace dependencies in a shared directory across the test run
  so transitive dependencies (like @wraith-protocol/sdk) are only built and packed once.
- Write pnpm-workspace.yaml in clean fixtures to ensure pnpm overrides transitive
  @wraith-protocol/* workspace dependencies to local tarballs.
- Simplify types check to resolve declarations directly from the fixture node_modules.
- Fail immediately on fixture installation errors.
- Guard dynamic require of react-native-get-random-values in sdk-react/native.
- Declare @stellar/stellar-sdk in peerDependencies of sdk-vue and sdk-solid.
@cybermax4200
cybermax4200 force-pushed the feat/companion-package-tarball-smoke-tests branch from af38d85 to 28d19ec Compare October 23, 2026 10:24

@truthixify truthixify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested on exact head 28d19ec. The companion package matrix is now green, so the prior packaging blocker is resolved. The required Security audit gate is still red on an untracked critical advisory: GHSA-2464-fhr4-w9xw (Next.js unauthenticated RCE through SVG Image Optimization), with next 14.2.35 installed and the reported patched line at >=15.5.28. Remediate the dependency and lockfile rather than allowlisting an unresolved critical RCE, then rerun the required gate.

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.

[Wave 10][Carryover] Smoke-test every companion package tarball

2 participants