Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
0c5bacb
feat(frontend): v1 scaffold, strict TypeScript and import boundary (U…
jaseemjaskp Oct 26, 2026
5c55a7c
fix(frontend): close v1 guardrail bypasses found in self-review (UN-4…
jaseemjaskp Oct 26, 2026
87c803c
feat(frontend): run v1 checks in CI and tighten what pages may import…
jaseemjaskp Oct 27, 2026
f86de0b
refactor(frontend): address SonarCloud findings on the v1 guardrails …
jaseemjaskp Oct 27, 2026
67be34b
refactor(frontend): split the contract-matrix builder to cut its comp…
jaseemjaskp Oct 27, 2026
81e15b1
fix(frontend): check every glob pattern and v0 -> v1 imports Biome ca…
jaseemjaskp Oct 27, 2026
7e541ab
UN-4299 [MISC] Turn on skipLibCheck for v1: vitest 3.2 and @types/cha…
praveen-formido Oct 28, 2026
6f22f62
UN-4299 [FEAT] Add the v1 theme model: three modes, follow-system and…
praveen-formido Oct 28, 2026
7aa5bf4
UN-4299 [FEAT] Add the v1 portal container and the theme preference s…
praveen-formido Oct 28, 2026
0c85cd6
UN-4299 [FEAT] Add the v1 token source, the generator and tokens.css …
praveen-formido Oct 28, 2026
6393d31
UN-4299 [FIX] Prefix the spacing utilities in the token table so they…
praveen-formido Oct 28, 2026
4a05a26
UN-4299 [FEAT] Add cn() configured for the v1 utility prefix
praveen-formido Oct 28, 2026
a9307e7
UN-4299 [FIX] Pin the v1 prefix in cn() with a test that fails withou…
praveen-formido Oct 28, 2026
5a361ae
UN-4299 [FIX] Use "ui" as the v1 utility prefix: Tailwind accepts low…
praveen-formido Oct 28, 2026
0e2b7a0
UN-4299 [FEAT] Add the prefixed v1 Tailwind root with fonts, modes, t…
praveen-formido Oct 28, 2026
d737fa8
UN-4299 [FIX] Exclude the generated tokens.css from Biome formatting …
praveen-formido Oct 28, 2026
a9acf5e
UN-4299 [FIX] Sort the imports in cn.ts so biome ci passes
praveen-formido Oct 28, 2026
54469cb
UN-4299 [FIX] Make the root compile test fail on unscoped selector li…
praveen-formido Oct 28, 2026
43c9ced
UN-4299 [FEAT] Add ThemeProvider: the v1 root, follow-system binding …
praveen-formido Oct 28, 2026
cc6126c
UN-4299 [FIX] Apply the stored theme before first paint with useLayou…
praveen-formido Oct 28, 2026
0e13d94
UN-4299 [FEAT] Enforce the v1 styling policy: raw colours, pixels, in…
praveen-formido Oct 28, 2026
c3a703c
UN-4299 [FIX] Scope the styling lint to class strings and cover vh/vw…
praveen-formido Oct 28, 2026
a35da5b
UN-4299 [FIX] Keep v0's Tailwind scan out of src/v1, the lint scripts…
praveen-formido Oct 28, 2026
d6047e9
UN-4299 [FIX] Teach cn the type roles so a role and a text colour no …
praveen-formido Oct 28, 2026
b29503d
UN-4299 [FIX] Reject colour literals outside class strings, named-col…
praveen-formido Oct 28, 2026
e064614
UN-4299 [FIX] Keep the focus ring visible in forced-colors mode and s…
praveen-formido Oct 28, 2026
88354e1
UN-4299 [FIX] Create the portal container before the mode changes so …
praveen-formido Oct 28, 2026
a41e1ba
UN-4299 [FIX] Document the v0 rules that reach v1, the focus-ring usa…
praveen-formido Oct 28, 2026
8231919
UN-4299 [FIX] Name the theme storage key in the v1 README
praveen-formido Oct 28, 2026
d0c1be0
UN-4299 [MISC] Name the three theme modes in the v1 README
praveen-formido Oct 28, 2026
bef9515
UN-4299 [FEAT] Let a v1 style attribute set CSS custom properties only
praveen-formido Oct 29, 2026
678efbb
UN-4299 [FIX] Make check-v1-styles.mjs executable to match its shebang
praveen-formido Oct 29, 2026
8028a73
UN-4299 [FIX] Type the custom-property keys a v1 style attribute may set
praveen-formido Oct 29, 2026
aca2e0d
UN-4287 [FEAT] Add composeRefs to v1 lib
athul-rs Oct 29, 2026
9a254a0
UN-4287 [FEAT] Add v1 text inputs on one field frame
athul-rs Oct 29, 2026
c8438dc
UN-4287 [FIX] Derive helper and error ids from the control id
athul-rs Oct 29, 2026
fa87ac6
UN-4287 [FIX] Match the field fill, padding and gaps to the Input Gro…
athul-rs Oct 29, 2026
9ae418b
UN-4287 [FIX] Run React 19 ref cleanups in composeRefs
athul-rs Oct 29, 2026
c320695
UN-4287 [FIX] Fix the review round 1 findings in the text inputs
athul-rs Oct 29, 2026
e611579
UN-4287 [FIX] Test ref forwarding and that a field action never submits
athul-rs Oct 29, 2026
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
12 changes: 12 additions & 0 deletions .github/workflows/ci-frontend-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,18 @@ jobs:
working-directory: frontend
run: bun run typecheck

# src/v1 is excluded from the step above and checked under its own
# stricter tsconfig, after scripts/check-v1.mjs rejects non-TS files.
- name: Run v1 typecheck
working-directory: frontend
run: bun run typecheck:v1

# Biome on src/v1, then the folder import contract, PropTypes and `ant-`
# checks in scripts/check-v1.mjs, which `biome ci` cannot express.
- name: Run v1 lint
working-directory: frontend
run: bun run lint:v1

# ci-test.yaml runs the same suite as the rig's `frontend` group, but its
# tiers skip frontend-only PRs; this job is what gates those.
vitest:
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ eggs/
lib/
lib64/
# The Python `lib/` rule above also matches the frontend's shadcn/ui helper
# directory (`@/lib/utils` per components.json). Keep that tracked.
# directory (`@/lib/utils` per components.json), the v1 `lib/` folder and the
# v1 guardrail fixtures. Keep those tracked, or their files are silently left
# out of commits.
!frontend/src/lib/
!frontend/src/v1/**/lib/
!frontend/test-fixtures/**/lib/
parts/
sdist/
var/
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ repos:
- id: check-docstring-first
- id: check-ast
- id: check-json
# Both files are JSONC — their tooling (VS Code, tsc) allows comments,
# These files are JSONC — their tooling (VS Code, tsc) allows comments,
# but this hook parses with strict `json.loads`, which does not.
exclude: "(\\.vscode/launch\\.json|frontend/tsconfig\\.json)$"
exclude: "(\\.vscode/launch\\.json|frontend/(src/v1/)?tsconfig\\.json)$"
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-toml
Expand Down
74 changes: 73 additions & 1 deletion frontend/biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,77 @@
"assist": {
"enabled": true,
"actions": { "source": { "organizeImports": "on" } }
}
},
"overrides": [
{
"includes": ["src/v1/**"],
"linter": {
"rules": {
"style": {
"noRestrictedImports": {
"level": "error",
"options": {
"paths": {
"prop-types": "v1 is typed with TypeScript; PropTypes are not used under src/v1.",
"antd": "antd is not used under src/v1."
},
"patterns": [
{
"group": [
"../**",
"..",
"./../**",
"/**",
"@/**",
"src/**"
],
"message": "v1 imports nothing outside src/v1, and never with '../'. Use './' within a folder and '@v1/...' across folders."
},
{
"group": ["@ant-design/**", "antd/**"],
"message": "antd is not used under src/v1."
},
{
"group": ["prop-types/**"],
"message": "v1 is typed with TypeScript; PropTypes are not used under src/v1."
},
{
"group": ["**/*.css", "!@v1/styles/**"],
"message": "No component .css under src/v1; style with tokens and Tailwind. Global v1 styles live in @v1/styles/."
}
]
}
}
},
"suspicious": {
"noExplicitAny": "error"
}
}
}
},
{
"includes": ["src/v1/styles/tokens.css"],
"formatter": { "enabled": false }
},
{
"includes": ["src/**", "!src/v1/**"],
"linter": {
"rules": {
"style": {
"noRestrictedImports": {
"level": "error",
"options": {
"patterns": [
{
"group": ["@v1/**", "**/v1", "**/v1/**", "!@v1"],
"message": "v0 may import only the v1 public entry, as '@v1'."
}
]
}
}
}
}
}
}
]
}
7 changes: 3 additions & 4 deletions frontend/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions frontend/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
"@/*": ["./src/*"],
"@v1": ["./src/v1/index.ts"]
}
},
"include": ["src/**/*"],
"exclude": ["node_modules", "build"]
"exclude": ["node_modules", "build", "src/v1"]
}
7 changes: 6 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@
"check:fix": "biome check --write src/",
"lint:all": "biome check --write src/",
"lint:changed": "(git diff --name-only --diff-filter=ACMR; git ls-files --others --exclude-standard) | grep -E '\\.[jt]sx?$' | sed 's|^frontend/||' | sort -u | xargs -r biome check --write",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"tokens:v1": "node scripts/build-v1-tokens.mjs",
"typecheck:v1": "node scripts/check-v1.mjs --files && tsc -p src/v1/tsconfig.json",
"lint:v1": "biome lint src/v1/ && node scripts/check-v1.mjs --code && node scripts/check-v1-styles.mjs",
"test:v1": "vitest run --dir src/v1 --passWithNoTests && node --test test-fixtures/v1-boundary/boundary.fixtures.mjs"
},
"browserslist": {
"production": [
Expand All @@ -93,6 +97,7 @@
},
"devDependencies": {
"@biomejs/biome": "^2.3.13",
"@tailwindcss/node": "4.3.3",
"@tailwindcss/postcss": "^4",
"@tailwindcss/typography": "^0.5.20",
"@tailwindcss/vite": "^4",
Expand Down
40 changes: 40 additions & 0 deletions frontend/scripts/build-v1-tokens.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import fs from "node:fs";
import { registerHooks } from "node:module";
import path from "node:path";

// Node's ESM resolver needs file extensions; v1 source imports siblings without
// them (`./theme`), as Vite and tsc expect. Retry such relative imports as `.ts`.
registerHooks({
resolve(specifier, context, nextResolve) {
try {
return nextResolve(specifier, context);
} catch (error) {
if (specifier.startsWith(".") && !path.extname(specifier)) {
return nextResolve(`${specifier}.ts`, context);
}
throw error;
}
},
});

const { renderTokensCss } = await import("../src/v1/lib/tokens.ts");
const { TOKENS } = await import("../src/v1/styles/tokens.ts");
const out = path.join(
import.meta.dirname,
"..",
"src",
"v1",
"styles",
"tokens.css",
);
const css = renderTokensCss(TOKENS);
if (process.argv.includes("--check")) {
if (fs.readFileSync(out, "utf8") !== css) {
console.error(
"src/v1/styles/tokens.css is stale; run `bun run tokens:v1`.",
);
process.exit(1);
}
} else {
fs.writeFileSync(out, css);
}
Loading
Loading