managarten/packages/shared-ui/package.json
Till JS 4b8defcc4a chore(ci): add v8 test coverage tracking (non-blocking baseline)
CI previously ran `pnpm run test || true` — test failures were silently
swallowed with no artifact, so we had no visibility into what was actually
passing across 1,296 test files.

- New `test:coverage` turbo pipeline task + root script; packages that opt
  in by declaring their own `test:coverage` get picked up automatically.
- Wired up three high-value Vitest targets: apps/mana/apps/web (main
  frontend, ~590 tests), shared-ui (Svelte component library), and
  shared-storage (S3 client). Each emits lcov.info + coverage-summary.json
  + browsable HTML.
- apps/mana/apps/web `"test"` was running in watch mode (just `vitest`),
  which hangs under turbo orchestration — changed to `vitest run` and
  added `test:watch` for the interactive case.
- CI uploads coverage artifacts (14-day retention) regardless of whether
  tests passed. `continue-on-error: true` replaces `|| true` so a failed
  suite shows up as a warning annotation on the PR rather than being
  invisible. Flip to a hard gate once main is green for a full week.
- Testing guideline documents the pattern + the template vitest config
  + the planned 80% threshold.
- ESLint flat-config `vitest.config.ts` ignore only matched at the root;
  widened to `**/vitest.config.{ts,js,mjs}` so nested configs don't trip
  the project-service parser.

Coverage baseline produced locally:
  shared-storage:  91.37% lines (6 files, 123 tests)
  shared-ui:        2.87% lines (mostly Svelte components, untested)
  apps/mana/web:    9/59 test files fail — pre-existing, not regression

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 19:21:14 +02:00

77 lines
1.8 KiB
JSON

{
"name": "@mana/shared-ui",
"version": "0.1.0",
"private": true,
"type": "module",
"sideEffects": [
"**/*.svelte",
"**/*.css"
],
"svelte": "./src/index.ts",
"main": "./src/index.ts",
"types": "./src/index.ts",
"exports": {
".": {
"svelte": "./src/index.ts",
"types": "./src/index.ts",
"default": "./src/index.ts"
},
"./atoms": {
"svelte": "./src/atoms/index.ts",
"types": "./src/atoms/index.ts",
"default": "./src/atoms/index.ts"
},
"./molecules": {
"svelte": "./src/molecules/index.ts",
"types": "./src/molecules/index.ts",
"default": "./src/molecules/index.ts"
},
"./organisms": {
"svelte": "./src/organisms/index.ts",
"types": "./src/organisms/index.ts",
"default": "./src/organisms/index.ts"
},
"./dnd": {
"svelte": "./src/dnd/index.ts",
"types": "./src/dnd/index.ts",
"default": "./src/dnd/index.ts"
},
"./toast": {
"svelte": "./src/toast/index.ts",
"types": "./src/toast/index.ts",
"default": "./src/toast/index.ts"
}
},
"scripts": {
"lint": "eslint .",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage"
},
"peerDependencies": {
"svelte": "^5.0.0"
},
"dependencies": {
"@mana/shared-branding": "workspace:*",
"@mana/shared-icons": "workspace:*",
"@mana/shared-theme": "workspace:*",
"@mana/shared-types": "workspace:*",
"d3-force": "^3.0.0",
"d3-selection": "^3.0.0",
"d3-transition": "^3.0.0",
"d3-zoom": "^3.0.0",
"date-fns": "^4.1.0"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^7.0.0",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/svelte": "^5.3.1",
"@types/d3-force": "^3.0.10",
"@types/d3-selection": "^3.0.11",
"@types/d3-transition": "^3.0.9",
"@types/d3-zoom": "^3.0.8",
"@vitest/coverage-v8": "^4.1.2",
"jsdom": "^29.0.1",
"vitest": "^4.1.2"
}
}