CodeVetter · Repo Unpack · Contributor handoff
mswjs/msw
Start with current manifests and the shared network engine, then follow the affected environment and protocol boundary. Tests and CI were inspected, not executed; this brief provides no passing checks or exhaustive coverage assessment. Existing scripts and filename conventions identify focused checks for a later task that authorizes execution. Preserve worker protocol compatibility, handler ordering, cleanup semantics, and build/export boundaries when making small changes.
- Use package.json and test/README.md as current workflow pointers: CONTRIBUTING.md recommends pnpm 8.15 and older test/browser paths, while the manifest pins pnpm 11.27.1 and current tests use protocol/API domains and filename suffixes.
- Before request-resolution edits, read defineNetwork, HttpNetworkFrame, executeHandlers, and RequestHandler.run together; handler order, fallthrough, once rechecks, and response dispatch span those files.
- Maintain strict TypeScript, kebab-case filenames, single quotes, and no semicolons; production source imports should target concrete modules instead of package barrels, as enforced by oxlint.
- When execution is permitted, select the smallest relevant test:unit, test:node, test:browser, test:playwright, test:e2e, or test:ts script; inspected tests and CI remain unexecuted evidence in this report.
- Build-dependent verification needs lib output: Vitest imports lib/vite/index.js and tsdown emits public entries/declarations; source export changes should be reviewed alongside package exports and module compatibility jobs.
- Worker protocol edits require paired page/worker review plus checksum generation: copyServiceWorker injects placeholders, WorkerChannel translates payload to data, and browser response transport branches between streams and buffers.
- Keep teardown synchronous at the source boundary even when handlers dispose asynchronously; worker stop intentionally retains channel handling for in-flight requests, and regression tests assert both pending-request completion and disposal rejection observation.
- Review persistence and publication helpers without invoking them during source-only work: msw init writes destination files/package.json, the smoke script changes version and clones/installs examples, and release scripts publish externally.