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
17 changes: 10 additions & 7 deletions .github/workflows/browser-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
submodules: recursive
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v5
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: browser-extension/package-lock.json
- run: npm ci
working-directory: browser-extension
- run: npm run biome
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm run biome
working-directory: browser-extension
- run: npm test
- run: pnpm test
working-directory: browser-extension
- run: npm run compile
- run: pnpm run typecheck
working-directory: browser-extension
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "packages/overtype"]
path = packages/overtype
url = https://github.com/diffplug/overtype.git
22 changes: 11 additions & 11 deletions browser-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

### Hotreload development

- `npm install`
- `npm run dev`
- `pnpm install`
- `pnpm run dev`
- open [`chrome://extensions`](chrome://extensions)
- toggle **Developer mode** (top-right)
- click "Load unpacked" (far left)
Expand All @@ -14,15 +14,15 @@
- click the puzzle icon next to the url bar, then pin the Gitcasso icon

### Testing and quality
- `npm run biome` - runs `biome check` (lint & formatting)
- `npm run biome:fix` - fixes most of what `biome check` finds
- `npm run compile` - typechecking
- `npm test` - vitest
- `npm test -- -u` updates all the snapshots
- `pnpm run biome` - runs `biome check` (lint & formatting)
- `pnpm run biome:fix` - fixes most of what `biome check` finds
- `pnpm run compile` - typechecking
- `pnpm test` - vitest
- `pnpm test -- -u` updates all the snapshots

### Deployment
- `npm run build` - build for mv3 for most browsers
- `npm run build:firefox` - build mv2 specifically for Firefox
- `pnpm run build` - build for mv3 for most browsers
- `pnpm run build:firefox` - build mv2 specifically for Firefox

## How it works

Expand All @@ -48,15 +48,15 @@ When the `textarea` gets removed from the page, the `TextareaRegistry` is notifi

In `tests/har` there are various `.har` files. These are complete recordings of a single page load.

- `npm run har:view` and you can see the recordings, with or without our browser extension.
- `pnpm run har:view` and you can see the recordings, with or without our browser extension.

### Recording new HAR files

- you can add or change URLs in `tests/har-index.ts`
- `npx playwright codegen https://github.com/login --save-storage=playwright/.auth/gh.json` will store new auth tokens
- login manually, then close the browser
- ***these cookies are very sensitive! we only run this script using a test account that has no permissions or memberships to anything, recommend you do the same!***
- `npm run har:record` this records new snapshots using those auth tokens (it needs args, run it with no args for docs)
- `pnpm run har:record` this records new snapshots using those auth tokens (it needs args, run it with no args for docs)
- DO NOT COMMIT AND PUSH NEW OR CHANGED `har` files!
- we try to sanitize these (see `har-record.ts` for details) but there may be important PII in them
- if you need new HAR files for something, let us know and we will generate them ourselves using a dummy account
Expand Down
2 changes: 1 addition & 1 deletion browser-extension/biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
"$schema": "https://biomejs.dev/schemas/2.2.3/schema.json",
"assist": {
"actions": {
"source": {
Expand Down
Loading