Skip to content

Latest commit

 

History

History
56 lines (41 loc) · 3.19 KB

development.md

File metadata and controls

56 lines (41 loc) · 3.19 KB

Development

Back to Wirefolio · User guide

Set up and test

Node.js 24 is suitable for the current dependencies. Install the dependencies and Playwright Chromium binary:

npm ci
npx playwright install chromium
npm test

The suite runs Vitest, type-checks and builds the extension, then runs Playwright against the unpacked build and a loopback fixture server. The cURL and Python round-trip tests depend on the relevant executables. Python HTTP round trips use the installed packages among requests, httpx, and aiohttp.

Command What it does
npm run dev Watches changes and rebuilds dist/. Reload the extension in Chrome after changes.
npm run lint Type-checks the project.
npm run build Type-checks and builds into dist/.
npm run test:unit Runs unit tests and available code-generation round trips.
npm run test:e2e Tests the built extension in Chromium. Build first.

Set the HEADED environment variable to 1 to watch the browser tests. In PowerShell, use $env:HEADED = '1'.

Source layout

Directory Responsibility
src/background Manifest V3 worker, debugger sessions, recording, interception, and pins.
src/core Request types, messages, memory limits, rule matching, CDP payloads, HAR, and code generation.
src/ui React side panel and pop-out, virtualized request list, details, editor, and previews.
public Manifest and icons copied to the build.
tests Vitest unit tests and Chromium tests backed by a loopback fixture.

The worker translates Chrome’s Network.* events into captured rows. The UI receives metadata for the list and available bodies when you inspect a selected entry. The worker handles interception through Fetch.* events.

CDP forwarding paths

Operation CDP call
Continue or edit a request Fetch.continueRequest
Continue a response with status or header edits Fetch.continueResponse
Replace a response body Fetch.fulfillRequest
Block a held request Fetch.failRequest

Request header edits replace the captured list. Wirefolio strips pseudo-headers and clears stale length and encoding headers when updating a body. For a replacement response body, it sends decoded bytes, clears the original transfer and content encodings, and recalculates length. Chrome DevTools Protocol

Package a release

  1. Align the versions in package.json, the project entries in package-lock.json, and public/manifest.json.
  2. Run npm test from a clean checkout and check the production build.
  3. ZIP the contents of dist/ with manifest.json at the archive root. Include background.js, sidepanel.html, THIRD-PARTY-LICENSES.md, assets, and icons. Source maps are optional.
  4. Load the extracted package in a clean Chrome profile and record a request against a local app.
  5. Tag that commit as v<version> and attach the Chrome ZIP to a GitHub release. GitHub’s generated source archives are for reviewing source. Install the separately attached Chrome ZIP.