Skip to content
This repository was archived by the owner on May 24, 2026. It is now read-only.

Harden CI: run on Node 20 & 22 and add entrypoint/pack smoke tests#6

Merged
GsCommand merged 1 commit into
mainfrom
codex/light-hardening-pass-for-protocol-commons
Mar 18, 2026
Merged

Harden CI: run on Node 20 & 22 and add entrypoint/pack smoke tests#6
GsCommand merged 1 commit into
mainfrom
codex/light-hardening-pass-for-protocol-commons

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

Motivation

  • Improve CI hardening by verifying the package on recent LTS Node versions (20 and 22) and adding lightweight runtime checks that surface obvious packaging or import-time issues without changing schemas or package structure.
  • Ensure existing validation and checksum verification steps remain intact and are exercised in CI to prevent regressions.

Description

  • Update the workflow at .github/workflows/validate.yml to use a matrix node-version: [20, 22], enable cache: npm, and switch installs to npm ci, while preserving the existing validation steps and adding smoke-test steps for import and pack.
  • Add scripts/smoke-import.mjs which imports the package entrypoint and asserts exports exist, and add scripts/smoke-pack.mjs which runs npm pack --json into a temp dir, tolerates mixed stdout from prepack, and verifies a non-empty tarball is produced.
  • Add two npm scripts in package.json: test:smoke:import and test:smoke:pack, and keep existing validate and checksum scripts unchanged.
  • No schemas, example data, package exports, publish behavior, or docs were altered. The smoke pack script only parses npm pack --json output more defensively to handle prepack stdout lines.

Testing

  • Ran npm run validate which executed npm run validate:schemas and npm run validate:examples and completed successfully (all schemas compiled and examples validated).
  • Ran npm run checksums:verify which verified checksums for all listed schema files and succeeded.
  • Ran npm run test:smoke:import which imported index.js and passed, reporting 20 exports.
  • Ran npm run test:smoke:pack which produced an npm pack tarball and verified it is present and non-empty.
  • Attempted a local Node 20 run via npx -p node@20 but it was blocked by registry policy (npm returned 403), so Node 20 could not be validated locally here; the workflow matrix will validate Node 20 and 22 in CI.

Files changed:

  • .github/workflows/validate.yml
  • package.json
  • scripts/smoke-import.mjs
  • scripts/smoke-pack.mjs

Codex Task

@GsCommand GsCommand merged commit ec424e6 into main Mar 18, 2026
0 of 2 checks passed
@GsCommand GsCommand deleted the codex/light-hardening-pass-for-protocol-commons branch March 20, 2026 01:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant