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
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: ci
"on":
push:
pull_request:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
Expand Down
14 changes: 7 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
behaviour being corrected both to validate the fix and to guard against
regression.
- Passes all relevant unit and behavioural tests according to the guidelines
above. See “### Testing”. (Use `make test` to verify).
above. (Use `make test` to verify).
- Passes lint checks. (Use `make lint` to verify).
- Adheres to formatting standards tested using a formatting validator. (Use
`make check-fmt` to verify).
Expand All @@ -79,7 +79,7 @@

## Refactoring Heuristics & Workflow

- **Recognizing Refactoring Needs:** Regularly assess the codebase for potential
- **Recognising Refactoring Needs:** Regularly assess the codebase for potential
refactoring opportunities. Consider refactoring when you observe:
- **Long Methods/Functions:** Functions or methods that are excessively long
or try to do too many things.
Expand Down Expand Up @@ -242,9 +242,9 @@ browser‑only runtime.
- `preview`: `vite preview`
- `test`: `vitest run --coverage`
- `audit`: `bun x npm@latest audit`
- `audit:snyk`: `bun x snyk test` (requires `snyk` CLI and authentication;
run `snyk auth` locally, and set `SNYK_TOKEN` in CI secrets)

- `audit:snyk`: `bun x snyk test`
- Note: `audit` requires a committed `bun.lock`; `audit:snyk` requires
installed dependencies—run `bun install` before invoking it.
### Compiler Configuration (Make It Sharp)

Use a strict `tsconfig.json` suitable for browser builds:
Expand Down Expand Up @@ -330,7 +330,7 @@ Keep docs close to code.
- **Version policy**: Use caret requirements (`^x.y.z`) for all direct
dependencies. Avoid `*`, `>=` or tag aliases like `latest`. Use tilde
(`~x.y.z`) only with a documented justification.
- **Lockfile**: Commit `bun.lock`. Recreate on major tool upgrades; keep
- **Lockfile**: Commit `bun.lock`. Recreate on major tool upgrades; keep
`bun.lockb` ignored.
- **Audit**: Run `bun run audit` locally and in automation. Track exceptions
with explicit expiry dates.
Expand Down Expand Up @@ -434,7 +434,7 @@ Keep docs close to code.

### Quick Checklist (Before Commit)

- `bun run fmt`, `bun run lint`, `bun test` all clean; no Biome warnings;
- `bun run fmt`, `bun run lint`, `bun run test` all clean; no Biome warnings;
no TypeScript errors; coverage thresholds hold.
- `bun run audit` passes or has justified, time‑boxed exceptions.
- No `any`, no `@ts-ignore`; use `@ts-expect-error` only with a reason.
Expand Down
13 changes: 13 additions & 0 deletions frontend-pwa/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- @file Root HTML document for Vite entry. -->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>myapp</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
6 changes: 3 additions & 3 deletions frontend-pwa/src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const userSchema = z.object({
id: z.string(),
display_name: z.string(),
});

export type User = z.infer<typeof userSchema>;
const usersSchema = z.array(userSchema);

export const listUsers = ({ signal }: { signal?: AbortSignal } = {}) =>
customFetchParsed('/api/users', usersSchema, { signal });
export const listUsers = (signal?: AbortSignal) =>
customFetchParsed('/api/users', z.array(userSchema), { signal });
14 changes: 5 additions & 9 deletions frontend-pwa/src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,26 @@ import { listUsers } from '../api/client';
export function App() {
const { data, isLoading, isError, error } = useQuery({
queryKey: ['users'],
queryFn: listUsers,
queryFn: ({ signal }) => listUsers(signal),
staleTime: 60_000,
});

if (isLoading) {
return (
<p
className="p-6 min-h-screen bg-base-200 text-base-content"
role="status"
aria-live="polite"
>
<output className="p-6 min-h-screen bg-base-200 text-base-content">
Loading users…
</p>
</output>
);
}

if (isError) {
if (import.meta.env.DEV) {
// eslint-disable-next-line no-console
console.error({ msg: 'Failed to load users', error });
console.error(error);
}
return (
<p className="p-6 min-h-screen bg-base-200 text-base-content" role="alert">
Failed to load users. Please try again.
Failed to load users.
</p>
);
}
Expand Down
2 changes: 1 addition & 1 deletion frontend-pwa/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import '@app/tokens/dist/css/variables.css';
import '@app/tokens/css/variables.css';
import './index.css';
import { App } from './app/App';

Expand Down
2 changes: 1 addition & 1 deletion packages/tokens/build/style-dictionary.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import StyleDictionary from 'style-dictionary';
import fs from 'node:fs';

const sd = StyleDictionary.extend({
const sd = new StyleDictionary({
source: ['src/tokens.json', 'src/themes/*.json'],
platforms: {
css: {
Expand Down