Skip to content

Conversation

@EricGrill
Copy link
Contributor

Summary

Closes #7623 - Add e2e test that checks the integrity of the final npm package prior to pushing to the registry

Adds automated package integrity testing to catch issues before they reach npm users.

What This PR Adds

  1. New test script: scripts/test-package-integrity.mjs

    • Verifies npm pack works for main packages
    • Scans dist files for browser-incompatible node: imports
    • Validates package.json has required fields and entries exist
  2. CI Integration:

    • Added to nodejs.yml - runs on every PR after build
    • Added to publish.yml - runs before publishing to npm

Why This Matters

Recent issues like #7616 (clean-stack browser incompatibility) could have been caught before release if we had integrity testing. This test specifically checks for:

  • node: protocol imports that break webpack/Vite
  • Missing entry points in package.json
  • Broken npm pack

Files Changed

  • scripts/test-package-integrity.mjs - New test script
  • package.json - Added test:package-integrity script
  • .github/workflows/nodejs.yml - Run test on PRs
  • .github/workflows/publish.yml - Run test before publish

Test Plan

  • Run npm run test:package-integrity locally after building
  • Verify it catches issues when introduced
  • Verify CI runs the test on PRs

Generated with Claude Code

Adds a test script that verifies built packages before publishing to npm:
- Checks that npm pack works for main packages
- Scans dist files for browser-incompatible 'node:' imports
- Validates package.json has required fields and entries exist

This test runs in both the CI workflow (on PRs) and the publish workflow
(before releasing to npm), catching issues like the clean-stack 5.3.0+
browser incompatibility (decaporg#7616) before they reach users.

Closes decaporg#7623
@EricGrill EricGrill requested a review from a team as a code owner January 14, 2026 18:58
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.

e2e test that checks the integrity of the final npm package prior to pushing to the registry

1 participant