Skip to content
Open
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
15 changes: 8 additions & 7 deletions .agents/commands/pre-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ allowed-tools:
- Bash(uv lock --check:*)
- Bash(uv lock:*)
- Bash(cd frontend*:*)
- Bash(npm run codegen*:*)
- Bash(npx biome*:*)
- Bash(npx betterer*:*)
- Bash(pnpm codegen*:*)
- Bash(pnpm biome*:*)
- Bash(pnpm exec betterer*:*)
- Bash(npx markdownlint*:*)
---

Expand Down Expand Up @@ -44,10 +44,11 @@ Auto-fixes markdown formatting issues.
### 3. Format and lint frontend code (Biome)

```bash
cd frontend/app && npx biome check --write .
cd frontend && pnpm biome:fix
```

Auto-fixes formatting and lint issues in TypeScript/TSX files. If Biome reports errors that cannot be auto-fixed, report them to the user.
Auto-fixes formatting and lint issues across the whole pnpm workspace — `app` and
`packages/*` alike. Run it from `frontend/`, not `frontend/app`, or the packages go unchecked. If Biome reports errors that cannot be auto-fixed, report them to the user.

## Phase 2 — Fast checks (parallel)

Expand All @@ -56,7 +57,7 @@ Auto-fixes formatting and lint issues in TypeScript/TSX files. If Biome reports
1. `uv run invoke main.lint` — If ruff reports issues, report them to the user.
2. `uv run ruff check . --exclude python_sdk` — The exact command CI's `python-lint` job runs. This is not redundant with `main.lint`: that task lints only `tasks`, `models`, `utilities`, and `python_testcontainers`, and `backend.lint` only `backend`, so a violation anywhere else (`development/`, root-level scripts, `tests/`) passes locally and fails in CI. Only the whole-repo check proves CI will pass.
3. `uv lock --check` — Ensures `uv.lock` matches `pyproject.toml`. If this fails, run `uv lock` and commit the updated lockfile.
4. `cd frontend/app && npm run codegen:graphql` — Regenerates `graphql-env.d.ts` and `graphql-cache.d.ts` from `schema/schema.graphql`. If the files change, they need to be staged and committed.
4. `cd frontend/app && pnpm codegen:graphql` — Regenerates `graphql-env.d.ts` and `graphql-cache.d.ts` from `schema/schema.graphql`. If the files change, they need to be staged and committed.

---

Expand All @@ -69,7 +70,7 @@ Auto-fixes formatting and lint issues in TypeScript/TSX files. If Biome reports
**IMPORTANT: Send ALL 7 commands below in a SINGLE message with 7 parallel Bash tool calls.** Do NOT run them one at a time.

1. `uv run invoke backend.lint` — Run separately from main.lint to avoid `uv run invoke lint` which includes a `yamllint -s .` step that fails on vendored packages in `.venv`. Its ruff step covers `backend` only, the same coverage gap noted in Phase 2; the ty/mypy output is what this check adds.
2. `cd frontend/app && npx betterer` — Ensures no new TypeScript errors are introduced. The issue count must stay the same or decrease. If it increases, report the new issues to the user.
2. `cd frontend/app && pnpm exec betterer` — Ensures no new TypeScript errors are introduced. The issue count must stay the same or decrease. If it increases, report the new issues to the user.
3. `uv run invoke docs.lint` — Report any errors. Note: some pre-existing errors in `docs/docs/` may exist — only flag errors in files the user has changed.
4. `uv run invoke backend.validate-generated` — Ensures generated schema and protocol files are up to date. If this fails, run `uv run invoke backend.generate` and report the regenerated files.
5. `uv run invoke schema.validate-graphqlschema` — Ensures `schema/schema.graphql` is up to date. Regenerates the file then checks for uncommitted diffs. If validation fails, the correct file is already on disk — just stage and commit it.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bug-agent-fix.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ separately (do NOT amend previous commits).
```bash
uv run invoke format
uv run invoke docs.format
(cd frontend/app && pnpm exec biome check --write .)
(cd frontend && pnpm exec biome check --write .)
Comment thread
saltas888 marked this conversation as resolved.
```

If Phase 1 changed any source files, you must re-run from Phase 2.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bug-agent-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ uv run invoke lint

**Frontend** (if applicable):
```bash
cd frontend/app && pnpm exec biome check --write .
cd frontend && pnpm exec biome check --write .
Comment thread
saltas888 marked this conversation as resolved.
```

### Step 9: Commit test files
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Check formatting and linting (Biome)
# Run from the pnpm workspace root: one Biome config now covers the app
# and frontend/packages/*, so this single check gates the whole frontend.
working-directory: ./frontend
run: pnpm exec biome ci .
- name: Check unused exports (Knip)
run: pnpm knip
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/claude-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ jobs:
"Bash(npm run test)", "Bash(npm run test *)",
"Bash(cd frontend/app && npm run test)",
"Bash(cd frontend/app && npm run test *)",
"Bash(cd frontend/app && npx biome check --write .)",
"Bash(cd frontend && pnpm biome:fix)",
"Bash(pnpm run test)", "Bash(pnpm run test *)",
"Bash(cd frontend/app && pnpm run test)",
"Bash(cd frontend/app && pnpm run test *)",
"Bash(cd frontend/app && pnpm exec biome check --write .)",
"Bash(cd frontend && pnpm exec biome check --write .)",
"Bash(ls)", "Bash(ls *)",
"Bash(mkdir -p *)"
],
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ See `tests/e2e/README.md` for the suite architecture and data fixtures.
```bash
uv run invoke format # Format all Python code
uv run invoke lint # Lint all Python code
cd frontend/app && pnpm biome:fix # Format/lint frontend
cd frontend && pnpm biome:fix # Format/lint frontend (app + packages/*)
Comment thread
saltas888 marked this conversation as resolved.
uv run invoke docs.lint # Lint documentation
```

Expand Down
5 changes: 5 additions & 0 deletions changelog/+frontend-biome-consolidation.housekeeping.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Consolidated the frontend on a single linter and formatter. `frontend/packages/ui` and
Comment thread
saltas888 marked this conversation as resolved.
`frontend/packages/graph` used `oxlint` + `oxfmt`, which nothing in CI ever ran, while
`frontend/app` used Biome; both packages had therefore been unchecked since they were created.
Biome now owns the whole `frontend/` pnpm workspace from one root configuration, and the
`frontend-lint` CI job gates the app and the packages in a single step.
2 changes: 1 addition & 1 deletion dev/bug-pipeline/fix-implementation.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ separately (do NOT amend previous commits).
```bash
uv run invoke format
uv run invoke docs.format
(cd frontend/app && pnpm exec biome check --write .)
(cd frontend && pnpm exec biome check --write .)
```

If Phase 1 changed any source files, you must re-run from Phase 2.
Expand Down
2 changes: 1 addition & 1 deletion dev/bug-pipeline/test-writing.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ uv run invoke lint

**Frontend** (if applicable):
```bash
cd frontend/app && pnpm exec biome check --write .
cd frontend && pnpm exec biome check --write .
```

## Step 9: Commit test files
Expand Down
33 changes: 33 additions & 0 deletions dev/knowledge/frontend/design-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,39 @@ Each migrated component ships with a `*.stories.tsx`. Run Storybook from `fronte
| Importing `Button` / `Card` / `Modal` / `Spinner` from anywhere except `@infrahub/ui` | The shared packages are deduplicated for a reason — bundle size and styling consistency. |
| Adding a one-off `<dialog>` because Modal feels heavy | Use `Modal` — it handles focus trap, escape, and overlay. |

## Formatting and linting
Comment thread
saltas888 marked this conversation as resolved.

One toolchain covers the whole `frontend/` pnpm workspace: **Biome**, configured once at
`frontend/biome.jsonc` (the root config) with thin per-member configs that inherit it via
`"extends": "//"`:

| Config | Role |
|---|---|
| `frontend/biome.jsonc` | Shared formatter, import sorting, and lint rules; extends the `ultracite` presets |
| `frontend/app/biome.jsonc` | App-relative ignores (generated GraphQL/REST types, Playwright output) |
| `frontend/packages/{ui,graph}/biome.jsonc` | `noBarrelFile` off — `src/index.ts` is each package's public API |

Run it from the workspace root, never from a single member:

```bash
cd frontend && pnpm biome:fix # or: pnpm exec biome ci . (what CI runs)
```

Two things to know:

- **Run Biome from `frontend/`, not `frontend/app`.** Biome discovers its config by walking up from
the current directory, so invoking it inside `frontend/app` silently leaves `packages/*`
unchecked, and invoking it in a worktree with no config in the tree walks up past the repo
entirely and applies a *different* checkout's config.
- The per-package configs are what make each package its own Biome project. Without them,
`noUndeclaredDependencies` cannot find the package's own `package.json` and reports every import
as undeclared.

`packages/ui` and `packages/graph` previously used `oxlint` + `oxfmt`, which nothing in CI ever ran.
That split was removed in #10390; `packages/plugins/template` is a standalone published scaffold and
still ships its own ESLint setup, and `packages/schema-visualizer` is a git submodule with its own
Biome config. Both are excluded from the root config.

## Discovery commands

```bash
Expand Down
2 changes: 1 addition & 1 deletion dev/setup-environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ echo " uv run invoke backend.test-unit - Run backend unit tests"
echo " uv run invoke format - Format Python code"
echo " uv run invoke lint - Lint Python code"
echo " cd frontend/app && pnpm test - Run frontend tests"
echo " cd frontend/app && pnpm biome:fix - Format/lint frontend"
echo " cd frontend && pnpm biome:fix - Format/lint frontend"
echo ""

exit 0
7 changes: 4 additions & 3 deletions frontend/app/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@ cd frontend/app && pnpm install # Install app dependencies only (submodule mu
cd frontend/app && pnpm dev # Start dev server
cd frontend/app && pnpm build # Production build
cd frontend/app && pnpm test # Run unit tests
cd frontend/app && pnpm biome:fix # Format and lint
cd frontend && pnpm biome:fix # Format and lint the whole workspace (app + packages/*)
Comment thread
saltas888 marked this conversation as resolved.
cd frontend/app && pnpm codegen # Generate GraphQL types
```

## Before pushing (run the full CI gate locally)

`pnpm biome:fix` alone is **not** the CI gate. The `frontend-lint` job runs three checks and
`frontend-tests` runs the browser test suite. Run all of them before pushing — they each fail CI
independently:
independently. Note that Biome runs from `frontend/`, the pnpm workspace root, so that one
config and one command cover `app` and `packages/*` together:

```bash
cd frontend/app && pnpm exec biome ci . # format + lint (same as CI)
cd frontend && pnpm exec biome ci . # format + lint, whole workspace (same as CI)
cd frontend/app && pnpm knip # unused exports/files/deps
cd frontend/app && pnpm exec betterer ci # TypeScript-regression gate (NOT plain tsc)
cd frontend/app && pnpm test # vitest (browser mode)
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pnpm start # Start dev server
pnpm dev # Start dev server with devtools
pnpm build # Production build
pnpm test # Unit tests (Vitest)
pnpm biome:fix # Format and lint
pnpm -w biome:fix # Format and lint (workspace-wide, script lives at the root)
Comment thread
saltas888 marked this conversation as resolved.
```

## Architecture
Expand Down
Loading
Loading