Skip to content

test: add package entrypoint smoke tests for every export - #217

Merged
truthixify merged 3 commits into
wraith-protocol:developfrom
collinsezedike:test/entrypoint-smoke-tests
Sep 25, 2026
Merged

truthixify merged 3 commits into
wraith-protocol:developfrom
collinsezedike:test/entrypoint-smoke-tests

Conversation

@collinsezedike

Copy link
Copy Markdown
Contributor

Summary

Adds smoke tests that import every published package entry point the way a consumer does, so a broken exports map, a missing build artifact, an accidental Node-only import, or an unresolvable declaration file fails CI before release.

Checks

Fixtures live in test/smoke/ and run via pnpm test:exports after pnpm build:

  • ESM: import every exports subpath through its import condition and assert it exposes exports.
  • CommonJS: require every exports subpath through its require condition and assert it exposes exports.
  • Node-free: walk each entry point's authored source graph and fail on any node:* or bare Node builtin, keeping the browser-safe entry points browser-safe.
  • Types: assert every types target exists and type-checks when imported by its package specifier with tsc --noEmit.

The entry point list is derived from package.json exports, so new subpaths are covered automatically once they ship in the build.

CI

A dedicated entrypoints job builds the package and runs the suite across Node 20 and 22.

Notes

The Node-free check scans authored source rather than bundled output. A third-party dependency can select a Node crypto shim through export conditions, which would flag the bundle even though the package's own code is browser-safe. Scanning source targets the intended guard: code authored in this package never importing a Node-only module.

The CI workflow is covered by CODEOWNERS, so the workflow change requires maintainer review.

Closes #205

@drips-wave

drips-wave Bot commented Sep 23, 2026

Copy link
Copy Markdown

@collinsezedike 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 merged commit e636da1 into wraith-protocol:develop Sep 25, 2026
16 checks passed
@truthixify

Copy link
Copy Markdown
Contributor

Merged. The entrypoint checks cover ESM, CJS, declarations, and browser-safe imports cleanly. Thanks @collinsezedike.

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 9] Add package entrypoint smoke tests for every export

2 participants