@erclx/canon 5.37.0 → 5.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/claude/.claude-plugin/plugin.json +1 -1
- package/claude/skills/auto-ship/SKILL.md +1 -1
- package/claude/skills/backlog-triage/SKILL.md +1 -1
- package/claude/skills/build-in-slices/SKILL.md +1 -1
- package/claude/skills/git-issue/references/issue.md +11 -10
- package/claude/skills/markdown-craft/references/markdown.md +3 -2
- package/claude/skills/plan-groundwork/references/groundwork.md +53 -24
- package/claude/skills/review-pr/references/post.md +1 -1
- package/claude/skills/role-orchestrator/SKILL.md +1 -1
- package/claude/skills/role-orchestrator/references/orchestrator-parked.md +1 -1
- package/claude/skills/role-planner/SKILL.md +1 -1
- package/claude/skills/role-worker/SKILL.md +1 -1
- package/claude/skills/target-setup/SKILL.md +3 -4
- package/claude/skills/target-setup/references/verify.md +6 -5
- package/claude/skills/task-board/references/tasks.md +3 -1
- package/docs/target/projects.md +1 -1
- package/docs/target/scenarios.md +1 -1
- package/governance/detect.toml +6 -1
- package/package.json +6 -3
- package/scripts/core/install-check.sh +1 -1
- package/src/commands/claude.ts +0 -1
- package/src/commands/pr.ts +1 -1
- package/src/commands/records.ts +0 -1
- package/src/docs/read.ts +15 -21
- package/src/gate/stages.ts +14 -0
- package/src/markdown/structure.ts +1 -1
- package/src/sandbox/equivalence.ts +7 -9
- package/src/teach/browser/head.ts +2 -2
- package/src/teach/browser/sidebar.ts +3 -3
- package/src/teach/browser/theme.ts +2 -2
- package/src/tooling/inject.ts +2 -2
- package/src/tooling/package.ts +15 -18
- package/src/tooling/verify-stack.ts +6 -3
- package/tooling/astro/configs/.oxfmtrc.json +8 -0
- package/tooling/astro/configs/.prettierrc +13 -0
- package/tooling/astro/manifest.toml +13 -0
- package/tooling/astro/reference.md +15 -5
- package/tooling/base/configs/.oxfmtrc.json +7 -0
- package/tooling/base/configs/scripts/verify.ts +1 -1
- package/tooling/base/manifest.toml +6 -6
- package/tooling/base/reference.md +12 -9
- package/tooling/base/seeds/.lintstagedrc +1 -3
- package/tooling/base/seeds/canon/context/ci.md +3 -3
- package/tooling/base/seeds/canon/context/development.md +2 -2
- package/tooling/claude/manifest.toml +5 -1
- package/tooling/go/reference.md +2 -2
- package/tooling/nextjs/configs/.oxlintrc.json +223 -0
- package/tooling/nextjs/manifest.toml +2 -5
- package/tooling/nextjs/reference.md +4 -4
- package/tooling/php/manifest.toml +6 -1
- package/tooling/php/reference.md +2 -2
- package/tooling/python/manifest.toml +6 -1
- package/tooling/python/reference.md +4 -4
- package/tooling/vite-react/manifest.toml +1 -4
- package/tooling/vite-react/reference.md +3 -3
- package/tooling/web/configs/.oxlintrc.json +213 -0
- package/tooling/web/manifest.toml +9 -13
- package/tooling/web/reference.md +14 -14
- package/tooling/base/configs/.prettierrc +0 -12
- package/tooling/base/seeds/.prettierignore +0 -0
- package/tooling/nextjs/configs/eslint.config.js +0 -91
- package/tooling/web/configs/eslint.config.js +0 -82
package/tooling/web/reference.md
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
The web layer covers web-universal tooling shared across Vite + React, Astro, and any future web stack. It ships golden configs for
|
|
7
|
+
The web layer covers web-universal tooling shared across Vite + React, Astro, and any future web stack. It ships golden configs for oxlint, Vitest, Playwright, Tailwind v4, screenshots, VS Code integration, and CI. Framework-specific wiring (Vite plugins, Astro islands, Next.js config) lives in per-stack adapter folders that extend this layer.
|
|
8
8
|
|
|
9
9
|
## What ships as golden configs
|
|
10
10
|
|
|
11
11
|
Golden config files live in `tooling/web/configs/` and are copied into the target on `canon tooling sync web . --write`, replacing whatever sits at those paths. They are the source of truth. The reference covers rationale and tradeoffs. Configs show the concrete setup.
|
|
12
12
|
|
|
13
|
-
-
|
|
13
|
+
- `.oxlintrc.json`: migrated from the ESLint config it replaced. Runs the recommended JS and TypeScript rules, the React hooks and refresh rules, test-scoped vitest rules plus `no-focused-tests`, and `check-file` and `simple-import-sort` as JS plugins.
|
|
14
14
|
- `src/test/setup.ts`: `@testing-library/jest-dom/vitest` import, `cleanup` after each test.
|
|
15
15
|
- `e2e/screenshot.ts`: capture template. A single `CASES` record at the top carries one entry per output file, each naming a section, a theme, and a route, and the loop below crosses every case with the `VIEWPORTS` array and writes `screenshots/<hostname>/<section>/<width>--<theme>.png`, keyed on `SCREENSHOT_BASE_URL`'s hostname so a local and a deployed run land in different folders. `VIEWPORTS` holds four breakpoint buckets named by width, 320, 768, 1280 and 1536, with 320 as the base a page has to hold without wrapping or clipping. A case flagged `evidence: true` additionally writes `evidence/<section>/<width>--<theme>.png`, with no hostname segment, at the viewports flagged `evidence` alone, which are 320 and 1280. Committing all four multiplies the tracked frames by the width count, so the flag is what keeps the tracked set at twice the sections rather than four times. A case may name `excludeViewports` to skip a width, for a route whose long-form prose reflows at 320 instead of breaking. `SCREENSHOT_FILTER` narrows a run to the cases whose label, `<section>/<width>--<theme>`, contains any comma-separated term, exits 1 when nothing matches and lists the labels that exist, and leaves the rest of the sweep alone. `--require-base-url` skips a flagged case entirely, so a production smoke run neither writes to the committed path nor counts an evidence route in its console-clean check, and exits 1 when that leaves zero cases run, so flagging every case cannot silence the production check without saying so. Per-project cases extend the one record. A route's widths and themes sit together under its section folder, so the filename carries both. A case may also name `sections`, one `{ name, selector }` per addressable part of the route, and each writes its own frame at `screenshots/<hostname>/<section>/<name>/<width>--<theme>.png` beside the whole-page one, plus `evidence/<section>/<name>/<width>--<theme>.png` where the case is flagged and the width carries `evidence`. The field is optional, so a case that names none captures the page alone as before, and a selector matching nothing is reported and skipped rather than raised, since `CASES` is a template a project rewrites and a target that syncs this file before editing its own list would otherwise capture nothing at all. Testing that every named section resolves belongs to the project that owns the selectors, beside its own page. A case may also name `mask`, a list of selectors whose boxes are painted over in every frame the case writes, whole-page and section alike, for a value that moves between runs with no code change, so a double capture still compares everything else. A mask selector matching nothing is reported and skipped the same way. Every case settles before anything is shot: the context is created with `reducedMotion: 'reduce'`, each named section is scrolled into view so an `IntersectionObserver` fires and a frame marked `loading="lazy"` loads, the page returns to the top, and fonts, images and same-origin frames are waited out on a bounded condition rather than on a second `networkidle`, which is a lifecycle event of the navigation and does not re-arm for a load a scroll started. A section frame drops the page's floating chrome, being whatever computes to `position: sticky` or `fixed`, because a section taller than the viewport is scrolled into view to be cut and a sticky bar otherwise rides that scroll into the middle of the frame. The whole-page frame is shot first and keeps its chrome. `--check-console-clean` collects `console`-level error messages per case and exits 1 with the list if any fired, turning the capture into a smoke check. `--require-base-url` exits 1 before launching a browser when `SCREENSHOT_BASE_URL` is unset, guarding a script meant to run against a real deployment from silently capturing `localhost`.
|
|
16
16
|
- `scripts/screenshot.sh`: sources `scripts/lib/preview-server.sh`, then runs the capture against the served preview.
|
|
@@ -54,9 +54,8 @@ Two worktrees of one repository run the same stack, so a fixed port makes the se
|
|
|
54
54
|
|
|
55
55
|
Sticky negative knowledge. Do not relearn.
|
|
56
56
|
|
|
57
|
-
- Do NOT use `tsc -b` in a Vite project. Composite mode emits `.js` next to `.ts` and
|
|
58
|
-
- Do NOT
|
|
59
|
-
- Do NOT trust `vite-react`'s scaffolded `lint` script. It ships its own `"lint": "oxlint"` under a bare `.oxlintrc.json`, which runs a different rule set from the stack's ESLint config and never gates on it. `[scripts.override]` forces the stack's own eslint invocation back over it.
|
|
57
|
+
- Do NOT use `tsc -b` in a Vite project. Composite mode emits `.js` next to `.ts` and the linter lints the emitted files. Use `tsc --noEmit`.
|
|
58
|
+
- Do NOT trust `vite-react`'s scaffolded `lint` script. It ships a bare `"lint": "oxlint"`, which exits 0 on warnings. `[scripts.override]` forces `--max-warnings 0` over it, and the golden `.oxlintrc.json` overwrites the scaffold's bare one.
|
|
60
59
|
- Do NOT rely on bare-folder exclude globs like `exclude: ["e2e"]`. Use `"e2e/**/*"`.
|
|
61
60
|
- Do NOT ship Vitest with no-tests-fail. Fresh scaffolds have zero tests. Use `passWithNoTests: true` or equivalent until the project has at least one test.
|
|
62
61
|
- Do NOT put Playwright `trace` at the top level of `defineConfig`. It lives under `use`.
|
|
@@ -68,17 +67,18 @@ Sticky negative knowledge. Do not relearn.
|
|
|
68
67
|
- Unit tests: Vitest with jsdom, globals on, setup file at `src/test/setup.ts`, `@testing-library/react`, `@testing-library/user-event`.
|
|
69
68
|
- E2E: Playwright in `e2e/`. Chromium-only for Chrome extensions, all browsers for web apps.
|
|
70
69
|
- Tailwind: v4 via `@tailwindcss/vite`. Never the v3 integration.
|
|
71
|
-
-
|
|
70
|
+
- Lint: oxlint at an exact pin, since its JS plugin host is alpha and a minor release could break `check-file` or `simple-import-sort`. Astro keeps ESLint, which its own reference covers.
|
|
72
71
|
|
|
73
|
-
##
|
|
72
|
+
## oxlint
|
|
74
73
|
|
|
75
|
-
-
|
|
76
|
-
-
|
|
74
|
+
- Set `lint` and `lint:fix` through `[scripts.override]`, so an already-synced target stops running ESLint on its next sync.
|
|
75
|
+
- Delete a leftover `eslint.config.js` or `eslint.config.mjs`, and `bun remove` the ESLint packages this stack stopped shipping, by hand after that sync. Sync deletes nothing a stack stopped shipping.
|
|
76
|
+
- Keep import sorting on `simple-import-sort` rather than oxfmt's built-in sort, which orders imports differently and would rewrite every import block.
|
|
77
77
|
|
|
78
78
|
## lint-staged (extend)
|
|
79
79
|
|
|
80
|
-
- Add `**/*.{js,jsx,ts,tsx}` glob running `
|
|
81
|
-
- Extend the
|
|
80
|
+
- Add `**/*.{js,jsx,ts,tsx}` glob running `oxlint --fix --max-warnings 0`, and `oxfmt --no-error-on-unmatched-pattern`.
|
|
81
|
+
- Extend the oxfmt glob to include `css`: `**/*.{json,css,md}`.
|
|
82
82
|
|
|
83
83
|
## CI docs (extend)
|
|
84
84
|
|
|
@@ -87,7 +87,7 @@ Extend `canon/context/ci.md` so the `## Checks` table reflects the web jobs. <!-
|
|
|
87
87
|
Append rows:
|
|
88
88
|
|
|
89
89
|
| Typecheck | `bun run typecheck` | framework-specific typecheck passes |
|
|
90
|
-
| Lint | `bun run lint` |
|
|
90
|
+
| Lint | `bun run lint` | oxlint passes with zero warnings |
|
|
91
91
|
| Tests | `bun run test:coverage` | Vitest passes with coverage thresholds |
|
|
92
92
|
| Build | `bun run build` | Production build succeeds |
|
|
93
93
|
| E2E | `bun run test:e2e` | Playwright passes against the built preview |
|
|
@@ -100,8 +100,8 @@ Extend the `development` context entry under `canon/context/` so the `## Scripts
|
|
|
100
100
|
|
|
101
101
|
Append rows:
|
|
102
102
|
|
|
103
|
-
| `bun run lint` | Run
|
|
104
|
-
| `bun run lint:fix` | Auto-fix
|
|
103
|
+
| `bun run lint` | Run oxlint with zero warnings allowed. |
|
|
104
|
+
| `bun run lint:fix` | Auto-fix oxlint issues. |
|
|
105
105
|
| `bun run test` | Run Vitest in watch mode. |
|
|
106
106
|
| `bun run test:run` | Run Vitest once with verbose reporter. |
|
|
107
107
|
| `bun run test:coverage` | Run Vitest with coverage. |
|
|
File without changes
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import js from '@eslint/js'
|
|
2
|
-
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
3
|
-
import prettier from 'eslint-config-prettier'
|
|
4
|
-
import checkFile from 'eslint-plugin-check-file'
|
|
5
|
-
import reactHooks from 'eslint-plugin-react-hooks'
|
|
6
|
-
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
7
|
-
import simpleImportSort from 'eslint-plugin-simple-import-sort'
|
|
8
|
-
import vitest from 'eslint-plugin-vitest'
|
|
9
|
-
import globals from 'globals'
|
|
10
|
-
import tseslint from 'typescript-eslint'
|
|
11
|
-
|
|
12
|
-
export default defineConfig([
|
|
13
|
-
globalIgnores([
|
|
14
|
-
'.next',
|
|
15
|
-
'next-env.d.ts',
|
|
16
|
-
'dist',
|
|
17
|
-
'dist-ssr',
|
|
18
|
-
'coverage',
|
|
19
|
-
'release',
|
|
20
|
-
'.claude',
|
|
21
|
-
'.vscode',
|
|
22
|
-
'.husky',
|
|
23
|
-
'test-results',
|
|
24
|
-
'playwright-report',
|
|
25
|
-
'blob-report',
|
|
26
|
-
'playwright/.cache',
|
|
27
|
-
]),
|
|
28
|
-
js.configs.recommended,
|
|
29
|
-
...tseslint.configs.recommended,
|
|
30
|
-
{
|
|
31
|
-
files: ['**/*.{ts,tsx,js,jsx}'],
|
|
32
|
-
plugins: {
|
|
33
|
-
'react-hooks': reactHooks,
|
|
34
|
-
'react-refresh': reactRefresh,
|
|
35
|
-
'simple-import-sort': simpleImportSort,
|
|
36
|
-
'check-file': checkFile,
|
|
37
|
-
},
|
|
38
|
-
languageOptions: {
|
|
39
|
-
globals: {
|
|
40
|
-
...globals.browser,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
rules: {
|
|
44
|
-
...reactHooks.configs.recommended.rules,
|
|
45
|
-
'react-refresh/only-export-components': [
|
|
46
|
-
'warn',
|
|
47
|
-
{ allowConstantExport: true },
|
|
48
|
-
],
|
|
49
|
-
'simple-import-sort/imports': 'error',
|
|
50
|
-
'simple-import-sort/exports': 'error',
|
|
51
|
-
'@typescript-eslint/no-unused-vars': [
|
|
52
|
-
'error',
|
|
53
|
-
{ varsIgnorePattern: '^_', argsIgnorePattern: '^_' },
|
|
54
|
-
],
|
|
55
|
-
'check-file/filename-naming-convention': [
|
|
56
|
-
'error',
|
|
57
|
-
{ '**/*.{ts,tsx}': 'KEBAB_CASE' },
|
|
58
|
-
{ ignoreMiddleExtensions: true },
|
|
59
|
-
],
|
|
60
|
-
'check-file/folder-naming-convention': [
|
|
61
|
-
'error',
|
|
62
|
-
{ 'src/**/!(__tests__)/': 'KEBAB_CASE' },
|
|
63
|
-
],
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
// App Router route and layout files export non-component values (metadata, route handlers) and use bracket, paren, and at-sign folder syntax (dynamic segments, route groups, parallel slots), which these rules flag as violations.
|
|
68
|
-
files: ['src/app/**/*.{ts,tsx}'],
|
|
69
|
-
rules: {
|
|
70
|
-
'react-refresh/only-export-components': 'off',
|
|
71
|
-
'check-file/folder-naming-convention': 'off',
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
files: ['**/*.test.{ts,tsx}', '**/*.spec.{ts,tsx}'],
|
|
76
|
-
...vitest.configs.recommended,
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
files: [
|
|
80
|
-
'*.config.{js,mjs,cjs,ts}',
|
|
81
|
-
'vitest.config.ts',
|
|
82
|
-
'playwright.config.ts',
|
|
83
|
-
],
|
|
84
|
-
languageOptions: {
|
|
85
|
-
globals: {
|
|
86
|
-
...globals.node,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
prettier,
|
|
91
|
-
])
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import js from '@eslint/js'
|
|
2
|
-
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
3
|
-
import prettier from 'eslint-config-prettier'
|
|
4
|
-
import checkFile from 'eslint-plugin-check-file'
|
|
5
|
-
import reactHooks from 'eslint-plugin-react-hooks'
|
|
6
|
-
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
7
|
-
import simpleImportSort from 'eslint-plugin-simple-import-sort'
|
|
8
|
-
import vitest from 'eslint-plugin-vitest'
|
|
9
|
-
import globals from 'globals'
|
|
10
|
-
import tseslint from 'typescript-eslint'
|
|
11
|
-
|
|
12
|
-
export default defineConfig([
|
|
13
|
-
globalIgnores([
|
|
14
|
-
'dist',
|
|
15
|
-
'dist-ssr',
|
|
16
|
-
'coverage',
|
|
17
|
-
'release',
|
|
18
|
-
'.claude',
|
|
19
|
-
'.vscode',
|
|
20
|
-
'.husky',
|
|
21
|
-
'test-results',
|
|
22
|
-
'playwright-report',
|
|
23
|
-
'blob-report',
|
|
24
|
-
'playwright/.cache',
|
|
25
|
-
]),
|
|
26
|
-
js.configs.recommended,
|
|
27
|
-
...tseslint.configs.recommended,
|
|
28
|
-
{
|
|
29
|
-
files: ['**/*.{ts,tsx,js,jsx}'],
|
|
30
|
-
plugins: {
|
|
31
|
-
'react-hooks': reactHooks,
|
|
32
|
-
'react-refresh': reactRefresh,
|
|
33
|
-
'simple-import-sort': simpleImportSort,
|
|
34
|
-
'check-file': checkFile,
|
|
35
|
-
},
|
|
36
|
-
languageOptions: {
|
|
37
|
-
globals: {
|
|
38
|
-
...globals.browser,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
rules: {
|
|
42
|
-
...reactHooks.configs.recommended.rules,
|
|
43
|
-
'react-refresh/only-export-components': [
|
|
44
|
-
'warn',
|
|
45
|
-
{ allowConstantExport: true },
|
|
46
|
-
],
|
|
47
|
-
'simple-import-sort/imports': 'error',
|
|
48
|
-
'simple-import-sort/exports': 'error',
|
|
49
|
-
'@typescript-eslint/no-unused-vars': [
|
|
50
|
-
'error',
|
|
51
|
-
{ varsIgnorePattern: '^_', argsIgnorePattern: '^_' },
|
|
52
|
-
],
|
|
53
|
-
'check-file/filename-naming-convention': [
|
|
54
|
-
'error',
|
|
55
|
-
{ '**/!(App).{ts,tsx}': 'KEBAB_CASE' },
|
|
56
|
-
{ ignoreMiddleExtensions: true },
|
|
57
|
-
],
|
|
58
|
-
'check-file/folder-naming-convention': [
|
|
59
|
-
'error',
|
|
60
|
-
{ 'src/**/!(__tests__)/': 'KEBAB_CASE' },
|
|
61
|
-
],
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
files: ['**/*.test.{ts,tsx}', '**/*.spec.{ts,tsx}'],
|
|
66
|
-
...vitest.configs.recommended,
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
files: [
|
|
70
|
-
'*.config.{js,mjs,cjs,ts}',
|
|
71
|
-
'vite.config.ts',
|
|
72
|
-
'vitest.config.ts',
|
|
73
|
-
'playwright.config.ts',
|
|
74
|
-
],
|
|
75
|
-
languageOptions: {
|
|
76
|
-
globals: {
|
|
77
|
-
...globals.node,
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
prettier,
|
|
82
|
-
])
|