Skip to content

Commit 4bcc0f3

Browse files
docs: refine cdn usage and lint task.
1 parent 9706f33 commit 4bcc0f3

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ Repository structure:
4949
## CDN and runtime expectations
5050

5151
- Keep dependency loading compatible with existing provider/fallback model in src/cdn.js.
52+
- Treat src/cdn.js as the source of truth for CDN-managed runtime libraries; add/update
53+
CDN candidates there instead of hardcoding module URLs in feature modules.
5254
- Prefer extending existing CDN import key patterns instead of ad hoc dynamic imports.
5355
- Maintain graceful fallback behavior when CDN modules fail to load.
5456
- Keep the app usable in local dev without requiring a local bundle step.

docs/build-and-deploy.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ Related docs:
9999

100100
- `docs/code-mirror.md` for CodeMirror CDN integration rules, fallback behavior, and validation checklist.
101101

102+
- `src/cdn.js` is the source of truth for CDN-managed runtime libraries (including fallback candidates). Add/update CDN specs there instead of hardcoding module URLs inside feature modules.
103+
102104
- In production, the current preferred deploy mode is ESM resolution (`window.__KNIGHTED_PRIMARY_CDN__ = "esm"`).
103105
- In `importMap` mode, runtime resolution is import-map first; if a specifier is missing from the generated map, runtime falls back through the CDN
104106
provider chain configured in `src/cdn.js`.

docs/next-steps.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,24 @@
33
Focused follow-up work for `@knighted/develop`.
44

55
1. **In-browser component/style linting**
6-
- Explore running lint checks for component and style sources directly in the playground.
7-
- Prefer CDN-delivered tooling where possible and preserve graceful fallback behavior when unavailable.
6+
- Replace the current ESLint/Stylelint worker direction with a Biome-first plan using `@biomejs/wasm-web` loaded from CDN.
7+
- Remove lint-specific web worker plumbing and run lint directly on demand in the main runtime, while keeping lint execution isolated behind a small module boundary.
8+
- Add a single lint service module that:
9+
- lazily loads and initializes Biome WASM once,
10+
- caches the initialized runtime,
11+
- exposes `lintComponent(source, filename)` and `lintStyles(source, filename, styleMode)` entrypoints.
12+
- Keep `src/modules/cdn.js` as the source of truth for Biome runtime candidates and provider fallbacks.
13+
- Define an explicit style-mode strategy for non-CSS sources:
14+
- CSS/CSS Modules: lint directly as CSS.
15+
- Less/Sass: start with graceful "not yet supported" diagnostics, or optionally lint post-compiled CSS if output mapping quality is acceptable.
16+
- Normalize Biome diagnostics into existing diagnostics UI shape (headline + line/column + severity + rule id), so no diagnostics drawer redesign is required.
17+
- Preserve graceful degradation: if Biome fails to load/initialize, show a clear "Lint unavailable" message without breaking render/typecheck loops.
18+
- Add Playwright coverage for:
19+
- successful component lint run,
20+
- successful CSS lint run,
21+
- runtime-load failure path showing recovery-oriented messaging.
22+
- Suggested implementation prompt:
23+
- "Refactor `@knighted/develop` in-browser linting to use `@biomejs/wasm-web` as the primary engine for component and style lint checks. Remove lint web worker plumbing, add a lazy-initialized Biome lint service, keep CDN provider fallback definitions in `src/modules/cdn.js`, and map Biome diagnostics into existing component/styles diagnostics UI. For Less/Sass, add an explicit temporary unsupported diagnostic (or post-compile CSS lint only if mapping remains readable). Validate with `npm run lint`, `npm run build:esm`, and targeted lint-button Playwright checks."
824

925
2. **In-browser component type checking**
1026
- Add editor-linked diagnostics navigation so each issue can jump to the exact line/column in the component source.

0 commit comments

Comments
 (0)