Skip to content

Releases: felmonon/msw-inspector

v0.3.2

Choose a tag to compare

@felmonon felmonon released this 10 Jul 08:06
c2dc40e

v0.3.2 fixes the documented CLI version command.

  • Adds standard --version and -V support.
  • Reports the installed package version and exits successfully.
  • Adds regression coverage so users can reliably include their version in bug reports.

The JSON report schema and scanner behavior are unchanged.

v0.3.1

Choose a tag to compare

@felmonon felmonon released this 10 Jul 07:57
d610e45

v0.3.1 is a correctness release for static MSW handler coverage.

Scanner reliability

  • Resolves direct and const-backed new URL(...).href handler matchers, including absolute URLs without a base.
  • Preserves JavaScript new RegExp(pattern, flags) semantics when matching static handler patterns.
  • Resolves MSW import bindings and same-file matcher constants by lexical scope, so shadowed aliases and values are not mistaken for handlers.

CLI and docs

  • --limit now consistently caps unsupported-pattern output as well as the other detailed text sections.
  • Clarifies the published package name (msw-inspector-cli) and installed binary (msw-inspector).
  • Corrects the maintainer release runbook so GitHub Releases trigger npm publication.

The JSON report schema is unchanged.

v0.3.0

Choose a tag to compare

@felmonon felmonon released this 09 Jul 19:03
05fbf1b

Output identity release: the two places msw-inspector is actually seen — the terminal and the PR comment — now communicate a verdict at a glance.

Terminal

  • Every run ends with a bold verdict line: ✗ 74% mock coverage — 8 unmocked calls (red), ◌ … ambiguous calls to review (yellow), ✓ 100% … all calls mocked (green).
  • Consistent glyph grammar throughout: green fine, red gap, yellow needs review.

GitHub Action comment & job summary

  • Verdict emoji headline (## 🔴 MSW mock coverage: 25% (1/4)), unicode coverage bar, compact metric table.
  • Long lists collapse into <details> sections with file:line per item.
  • Footer linking back to the project.

Also adds a social preview card under assets/. JSON output and the report schema are unchanged. Update the action to msw-inspector-action@v1.2.0 (or the moving v1) for the new comment design.

v0.2.0

Choose a tag to compare

@felmonon felmonon released this 09 Jul 18:16
9ccd4d6

Trust-hardening release. The numbers msw-inspector reports are now reliable enough to gate CI on.

Correctness

  • Fixed stale-handler false positives: every handler matching a call is marked used, not just the first.
  • Calls whose HTTP method cannot be resolved statically but whose path matches a handler are now reported as ambiguousCalls instead of unmocked; their handlers are not flagged stale.
  • fetch(new Request(url, init)) resolves with static arguments (init overrides the Request method per spec).

CLI

  • Text output lists unmocked API calls and stale handlers with file:line; --limit controls how many.
  • --format, --min-coverage, and --limit are validated (usage errors exit 2); empty scans warn on stderr and --fail-on-empty turns that into a gate. Exit codes documented in the README.
  • Report file paths are relative to --cwd with forward slashes on every platform — reports are portable and safe as CI baselines.

Contract & project health

  • JSON report contract documented in docs/report-schema.md and frozen in schema/coverage-report.v1.json (ships with the package, validated in tests).
  • felmonon/msw-inspector-action is the canonical GitHub Action; this repo no longer ships action.yml or committed dist/.
  • CI: Node 20/22/24 on Ubuntu and Windows. Declared the real Node requirement (>=20).
  • Clean npm audit: path-to-regexp ReDoS fix, @actions/* off undici 5, esbuild override.

Full details in CHANGELOG.md.

Thanks

This is the first release carrying community contributions, and since v0.1.5 was never published to npm, both land for npm users here:

  • @Diyaaa-12 — unsupported patterns now print with file, line, kind, and reason in text output (#16)
  • @lovewave02 — the Vite + Vitest (#6) and Next.js (#26) coverage examples under docs/examples/

v0.1.5

Choose a tag to compare

@felmonon felmonon released this 08 Jul 02:32
102d0ba

Highlights

  • New: text output now lists unsupported patterns with file:line, kind, and reason (up to 5, plus an "and N more" count), so CLI output is actionable instead of a bare count. Thanks @Diyaaa-12 (#16).
  • Toolchain modernized to TypeScript 6, with a build fix for the baseUrl deprecation.

Features

  • feat(cli): show unsupported pattern locations in text output (#16)

Maintenance

  • Upgrade to TypeScript 6, ts-morph 28, commander 15, @actions/core 3, @actions/github 9 (#12, #11)
  • CI: bump actions/checkout to v7 and actions/setup-node to v6 (#10, #9)
  • Bump vite, postcss, brace-expansion, @types/node, and vitest (#15, #13, #14, #11)
  • fix(build): set ignoreDeprecations: "6.0" for the TypeScript 6 baseUrl deprecation

Docs

  • Add Vite + Vitest + MSW example. Thanks @lovewave02 (#6)
  • Add CONTRIBUTING, ROADMAP, SECURITY, SUPPORT, CODE_OF_CONDUCT, and README polish

Full Changelog: v0.1.4...v0.1.5

v0.1.4

Choose a tag to compare

@felmonon felmonon released this 25 Mar 02:36

Adds baseUrl-aware coverage analysis and updates the README to point to the dedicated GitHub Action repository.

  • new --base-url option for origin-aware matching of relative handlers and API calls
  • added real dogfooding examples and a screenshot from local repo runs
  • GitHub Action now lives in felmonon/msw-inspector-action

v0.1.3

Choose a tag to compare

@felmonon felmonon released this 25 Mar 02:13

msw-inspector v0.1.3

Installable npm release for the MSW mock coverage analyzer.

Install

npm install -D msw-inspector-cli

The package is published as msw-inspector-cli because msw-inspector is already taken on npm. The installed CLI binary remains msw-inspector.

Run

  • npx msw-inspector after install
  • npx msw-inspector-cli for one-off usage

Highlights

  • Scan MSW handlers from http.* and legacy rest.* APIs.
  • Scan API usage from fetch, window.fetch, globalThis.fetch, and common axios call shapes.
  • Report mocked API calls, unmocked API calls, stale handlers, and unsupported dynamic patterns.
  • Emit stable JSON output with schemaVersion: 1.
  • Ship a GitHub Action that publishes job summaries and optional sticky PR comments from the JSON report.

Validation

  • npm run check
  • npm run build

Repository

https://github.com/felmonon/msw-inspector

v0.1.1

Choose a tag to compare

@felmonon felmonon released this 25 Mar 01:44

msw-inspector v0.1.1

First npm-ready release of @felmonon/msw-inspector, a CLI and GitHub Action for finding gaps in MSW mock coverage.

Install

npm install -D @felmonon/msw-inspector

Run

npx msw-inspector after install, or npx @felmonon/msw-inspector for one-off usage.

Highlights

  • Scan MSW handlers from http.* and legacy rest.* APIs.
  • Scan API usage from fetch, window.fetch, globalThis.fetch, and common axios call shapes.
  • Report mocked API calls, unmocked API calls, stale handlers, and unsupported dynamic patterns.
  • Emit stable JSON output with schemaVersion: 1.
  • Ship a GitHub Action that publishes job summaries and optional sticky PR comments from the JSON report.

Validation

  • npm run check
  • npm run build

Repository

https://github.com/felmonon/msw-inspector

v0.1.0

Choose a tag to compare

@felmonon felmonon released this 25 Mar 01:28

msw-inspector v0.1.0

Initial release of msw-inspector, a CLI and GitHub Action for finding gaps in MSW mock coverage.

Highlights

  • Scan MSW handlers from http.* and legacy rest.* APIs.
  • Scan real API calls from fetch, window.fetch, globalThis.fetch, and common axios call shapes.
  • Compare handlers against actual API usage and report:
    • mocked API calls
    • unmocked API calls
    • stale handlers
    • unsupported dynamic patterns
  • Emit both text output and stable JSON output with schemaVersion: 1.
  • Ship a thin GitHub Action that publishes job summaries and optional sticky PR comments from the CLI JSON report.

Install

npm install -D msw-inspector

Example

npx msw-inspector --report-file msw-inspector.json --format json

First-release scope

This release is intentionally narrow and static-analysis-first. It favors explicit unsupported diagnostics over guessing at dynamic patterns.

Included in v0.1.0:

  • direct MSW http.* and rest.* handler extraction
  • static string, template, regex, and URL-based matcher resolution
  • same-file axios.create(...) instance support
  • coverage matching by HTTP method and normalized path

Not included yet:

  • custom API wrapper inference
  • cross-file constant resolution
  • GraphQL, WebSocket, or SSE analysis
  • baseline coverage deltas in the GitHub Action

Validation

Verified locally with:

  • npm run check
  • npm run build

Repository

https://github.com/felmonon/msw-inspector