| Filename | Latest commit message | Latest commit date |
|---|---|---|
* fix(coverage): include core/ files in v8 per-file gate (#1301) Two issues prevented coverage.include's '../../core/...' globs from reaching core/ files: 1. allowExternal defaults to false — v8 drops any file whose absolute path doesn't start with the project root (clients/web/) before the include filter runs. Set allowExternal: true, and switch the globs to absolute paths so tinyglobby + picomatch handle them correctly. 2. vitest's coverage transformer only processes files inside a project root; for everything else it falls back to raw-TS parsing in rolldown, which can't handle TS-only syntax (e.g. import type) — silently dropping untested core/ files and bypassing the gate. Root the unit project at the repo root so the transformer reaches core/. The repo root has no node_modules, so add an explicit react alias and shift include/setupFiles paths accordingly. Also add the four pure-type core files (samplingCreateMessage, sessionStorage, inspectorClientProtocol, inspectorClientEventTarget) to the exclude list with a comment — they have no executable code. Verified by introducing an untested probe file, confirming exit=1 with threshold errors, then removing it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * refactor(coverage): address review feedback on #1305 - Drop allowExternal: true — with the unit project rooted at repoRoot, core/ files are no longer "external" to any project that collects coverage (the storybook project doesn't), so the flag is redundant. - Extract sharedAliases / sharedDedupe constants and reference them from both the top-level resolve and the unit project resolve, so the two stay in sync if a new core/* alias is added. - Add TODO(#1243) on the inspectorClientEventTarget.ts exclusion so it's revisited once the class gains real behavior in the InspectorClient port. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
| .. | ||
| .storybook | ||
| public | ||
| src | ||
| .gitignore | ||
| chromatic.config.json | ||
| eslint.config.js | ||
| index.html | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.app.json | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| tsconfig.storybook.json | ||
| tsconfig.test.json | ||
| vite.config.ts | ||
| vitest.shims.d.ts | ||
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Oxc
- @vitejs/plugin-react-swc uses SWC
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])