Repository navigation
chore: verify the node floor in CI - #174
Conversation
The mock target ran against `src/`, so nothing exercised what a consumer installs. `vitest.dist.config.ts` points the two specifiers the tests reach the library through at `dist/index.js`, leaving every test file and source file untouched. The run is 148 tests where `pnpm test:mock` is 174. The config comment breaks the gap down, since the two halves of it have different causes and 148 is not "the whole suite against dist".
The suite above cannot reach the lowest Node the package claims. vitest 4 pulls in rolldown, rolldown calls `util.styleText`, and Node 20 grew that mid-line, so the runner does not start below 20.13.0. `scripts/smoke.mjs` covers what the runner cannot. It imports `node:assert` and `dist/` and nothing else, so whatever Node can run the package can run it. It drives a join, a room broadcast, and the sender's exclusion from it rather than only importing the module, so a floor that loads but delivers nothing fails here. Non-receipt is proven with the marker pattern from `src/test-events.ts`, never with a timeout.
Install and build run on 22, since pnpm 11 needs 22.13 and cannot move down. The two steps that follow switch Node and reuse that `node_modules`, so no reinstall and no artifact hand-off is needed. The smoke runs on 20.0.0 and the dist suite on 20.13.0. Those are different numbers on purpose: the second is the lowest Node vitest itself starts on, which is a fact about our runner rather than about smocket, and keeping it out of the declared range is the point of splitting the check in two.
|
Warning Review limit reached
Next review available in: 54 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe package now declares Node.js 20 or newer as its runtime floor. It adds a built-package smoke test, distribution test configuration, and CI coverage for Node 20 and Node 22. ChangesNode support validation
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The package declared nothing, so the floor was whatever a consumer happened to have. `>=20` is now the claim, and the job added ahead of it is what makes the claim checkable rather than stated: the smoke runs the built package on 20.0.0 itself, so the exact version named here is exercised. #104 planned to copy socket.io's `>=10.2.0`, on the reasoning that the mock should not claim a narrower range than the oracle. That reasoning is dropped. socket.io keeps a low floor for its own users, who run it on servers they cannot upgrade; smocket is a devDependency and shares neither the users nor the reason. The oracle governs delivery behavior, not install conditions. Lowering a floor later is not a breaking change, so `>=20` costs nothing if it turns out to be conservative. Raising one is, which is why this lands before v1.0.0 rather than after. Closes #143
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 69-109: Update the node-floor job by adding a job-level
permissions block granting only contents: read, and configure its
actions/checkout step with persist-credentials: false. Keep the existing
checkout, installation, build, and Node-version steps unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: a6465692-33a5-4085-a92a-33ac65cfed45
📒 Files selected for processing (4)
.github/workflows/ci.ymlpackage.jsonscripts/smoke.mjsvitest.dist.config.ts
Neither was set on any job. The workflow only ever reads the repository, so `permissions: contents: read` sits at the top and covers all seven rather than being repeated per job. The repository default is already `read`, which makes it a guard against that setting widening later rather than a change in what runs today. `persist-credentials: false` is the one with an effect now. Checkout leaves the token in `.git/config`, and `pnpm install` runs dependency scripts that could reach it. All seven checkouts are covered, since hardening one job would leave the other six as they were.
Summary
Adds the two-tier check that lets smocket declare a Node floor it actually runs.
vitest.dist.config.tsruns the mock target againstdist/instead ofsrc/, so the suite exercises what a consumer installs.scripts/smoke.mjscovers the part that suite cannot reach: vitest 4 pulls in rolldown, rolldown callsutil.styleText, and Node 20 grew that mid-line, so the runner does not start below 20.13.0. The smoke importsnode:assertanddist/and nothing else, and drives a join, a room broadcast, and the sender's exclusion from it, so a floor that loads but delivers nothing fails.The CI job installs and builds on 22, then switches Node twice and reuses that
node_modules. Verified locally on Windows across 20.0.0, 20.12.0, 20.13.0, 20.14.0, 20.15.1, 20.16.0, 20.17.0, 20.18.0, and 20.19.4. This PR is draft until the ubuntu runner confirms the same, since pnpm'snode_modulesis a symlink tree on Linux and a junction tree on Windows.engines.nodeis deliberately not in these commits. It lands once the job is green, so a red run costs a CI change rather than a published contract.Related issue
Closes #143
Checklist
The dist suite is the existing dual-run tests against the built package, so the real target is unchanged at 174.