Download Latest Version Release v1.3.0 source code.zip (206.4 kB)
Email in envelope

Get an email when there's a new version of PocketMocker

Home / v1.3.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-06-10 2.1 kB
Release v1.3.0 source code.tar.gz 2026-06-10 157.6 kB
Release v1.3.0 source code.zip 2026-06-10 206.4 kB
Totals: 3 Items   366.1 kB 0

New Features

  • Mock State 联动能力:
  • Added shared Mock State support for dynamic response functions through ctx.state.
  • Dynamic mock functions can now read and write shared state across different API rules.
  • Supports realistic CRUD flows such as creating a user with POST /api/users and reading it later with GET /api/users.
  • Exported MockContext and MockStateStore types for TypeScript users.

  • State Panel:

  • Added a new State tab to the PocketMocker dashboard.
  • Users can view, edit, save, clear, copy, and import shared Mock State as JSON.
  • Added a persistence toggle for controlling whether Mock State survives refreshes.

  • Mock State Persistence:

  • Local mode stores Mock State in localStorage.
  • Vite plugin mode stores Mock State in pocket-mock-state.json.
  • Added Vite plugin endpoints for reading, saving, and resetting Mock State.

  • Demo Experience:

  • Added a linked API state demo to src/main.ts.
  • Demo users can create records through POST /api/users and refresh GET /api/users to verify stateful API behavior.

Bug Fixes

  • Fixed absolute path matching so parent paths no longer implicitly match child paths.
  • For example, /appply no longer matches /appply/invite.
  • Use explicit wildcard rules such as /appply/* when child path matching is intended.

  • Added CodeMirror dependency dedupe configuration in Vite to avoid duplicate @codemirror/state instances causing editor initialization failures.

Tests

  • Added unit tests for Mock State store operations.
  • Added handler tests covering shared state between dynamic response functions.
  • Added Vite plugin tests for Mock State file read, save, validation, and reset behavior.
  • Added matcher regression tests for absolute path matching boundaries.

Documentation

  • Added docs/MOCK_STATE_DESIGN.zh-CN.md with the Mock State design, API shape, UI plan, persistence behavior, and rollout strategy.


📦 NPM Package: pocket-mocker@1.3.0

Source: README.md, updated 2026-06-10