Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,22 @@ jobs:
with:
node-version: '20'
cache: 'npm'
- uses: extractions/setup-just@v4
- run: npm ci
# Each step is a Justfile recipe, so `just ci` runs the same list locally.
- name: Lint
run: npm run lint
run: just lint
- name: Type check
run: npx tsc --noEmit
run: just typecheck
- name: Unit tests
run: npm run test
run: just test
- name: Cloudflare worker tests
# bash expands the globs; the workers have no dependencies to install.
run: node --test infra/cors-worker/*.test.mjs infra/cors-stats/*.test.mjs
# The workers have no dependencies to install.
run: just test-workers
- name: Extension release script tests
run: node --test scripts/extension-release.test.mjs
run: just test-extension
- name: Extension lint (AMO's unlisted rules)
run: npx --yes web-ext@10 lint --self-hosted --source-dir browser-extension
run: just lint-extension

e2e-smoke:
runs-on: ubuntu-latest
Expand Down
49 changes: 49 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Common commands. App recipes delegate to package.json scripts (the source of
# truth for how the app builds and tests); the rest are commands that otherwise
# lived only in CI or in READMEs. `just ci` runs what the unit-tests CI job runs.

default:
@just --list

# Vite dev server (debug on)
dev:
npm run dev

build:
npm run build

lint:
npm run lint

typecheck:
npx tsc --noEmit

# Jest unit tests
test *args:
npm test -- {{args}}

# Playwright e2e via scripts/run-e2e.js (per-worktree ports); pass spec paths to narrow
e2e *args:
npm run test:e2e -- {{args}}

# CORS proxy and stats workers (node --test)
test-workers:
node --test infra/cors-worker/*.test.mjs infra/cors-stats/*.test.mjs

test-extension:
node --test scripts/extension-release.test.mjs

# AMO's rules for unlisted (self-hosted) Firefox add-ons
lint-extension:
npx --yes web-ext@10 lint --self-hosted --source-dir browser-extension

# Everything the unit-tests CI job runs, in the same order
ci: lint typecheck test test-workers test-extension lint-extension

# Deploy your own token-locked CORS proxy worker (Cloudflare auth required)
deploy-proxy:
cd infra/cors-worker && npx wrangler deploy --env=""

# Deploy the SHARED public proxy instance (maintainers only)
deploy-proxy-public:
cd infra/cors-worker && npx wrangler deploy --env public
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ This is a front end react app. Run like so:

Then visit http://localhost:3000

Common commands are also in the [Justfile](Justfile) (run `just` to list them). `just ci` runs exactly what the unit-test CI job runs.

If you want to test PWA/production then do

> npm run build:prod && npm run start
Expand Down
5 changes: 5 additions & 0 deletions docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ Key settings in `playwright.config.ts`:

## Common Development Tasks

The repo-root `Justfile` collects the common commands (`just` lists them).
App recipes delegate to the npm scripts. `just ci` runs the same steps, in the
same order, as the `unit-tests` job in `.github/workflows/test.yml`, which calls
each recipe directly. Any check added to CI should be added as a recipe and to `ci`.

### Fix Linting Issues

```bash
Expand Down
Loading