Build and commands
Before you start
- Install Node.js 20 or later, and npm. For the harness, install
ungoogled-chromium. The launch script looks for the program in this sequence:CHROMIUM_PATH, then/Applications/Chromium.app/Contents/MacOS/Chromium, thenungoogled-chromium,chromium, orchromium-browserinPATH. - Run
npm install. Thepostinstallstep runswxt prepareand makes.wxt/tsconfig.jsonagain. You must do this in a new copy of the repository beforenpm run compile.
Commands
| Command | Function |
|---|---|
npm run dev / npm run dev:firefox | Start the WXT server for development |
npm run build / npm run build:firefox | Make the build in .output/chrome-mv3 or in the Firefox directory |
npm run zip / npm run zip:firefox | Make a ZIP file for the store |
npm run compile | Examine the types (tsc --noEmit) |
npm test | Run all Vitest tests (see tests). No browser, no requests |
npm run test:watch | Run Vitest and keep it in operation for each change |
npm run normalize:check | Examine the normalizer with the recorded data (tests/normalize.test.ts) |
npm run throttle:check | Examine the request limits (see request limits) |
npm run docs:check | Examine the frontmatter, links, and paths of this site and memory.md |
npm run browser:launch | Start the harness browser. Other flags go to the browser |
npm run api:inspect [-- --once | --check] | Record the answers of Patreon in .api-dumps/ |
npm run api:check | Examine the session and the memberships. Exit code 0 means that the session is correct |
npm run bundle:mine [-- --visit=<url>] | Read the JavaScript files of the web site for the list of endpoints |
npm run site:dev | Start this documentation site locally |
npm run site:build | Build this documentation site |
Files in the repository
entrypoints/ WXT entrypoints background.ts Service worker: routes messages, limits requests, writes the cache patreon.content.ts Runner: fetch, classify, normalize sidepanel/ Side panel on Chrome, sidebar on Firefox tab/ Extension tab; operates on all browserslib/ Code that all surfaces use db.ts Dexie schema and transactions messages.ts Message contract, examination, failure codes throttle.ts Request limits and backoff media-cache.ts Cache API for media bytes format.ts Formats numbers, sizes, and dates gallery.ts Joins the images onto the posts for the photo view patreon/ jsonapi.ts, endpoints.ts, normalize.ts, types.tscomponents/ The panel App.tsx Layout, queries, actions, keyboard MembershipList.tsx Filters.tsx PostList.tsx PostCard.tsx PhotoGallery.tsx The photo view: square tiles, one section for each month media.tsx One viewer for each media type, and the image viewer RichText.tsx Makes React elements from permitted HTML StatusBanner.tsx Text for each failure and each empty condition LanguagePicker.tsx The language setting, in the header i18n.tsx hooks.ts The translator; messages and storage globals.css Palette, Tailwind theme, container width ui/ The components from the Aqua registry (`@aqua`)tests/ Vitest tests normalize.test.ts Examine the normalizer with the recorded answers throttle.test.ts Examine the request limits docs.test.ts Examine this site and `memory.md` i18n.test.ts Examine the localization layer gallery.test.ts Examine the join behind the photo viewscripts/ Tools that tsx runs launch-browser.sh Start Chromium with CDP on port 9222 inspect-api.ts Record the answers of Patreon mine-bundle.ts Read the JavaScript files for the list of endpointssite/ This documentation site (Astro + Starlight)public/ Icons and gopher.svg