Files
Stirling-PDF/frontend/package.json
T
Reece Browne 22ec0947c9 Storybook coverage: scan harness + stories (#7073)
## What

Gets most of the app's components into Storybook and adds a scan that
runs every story in a real browser, so we have a base to build
accessibility testing on next.

- **~380 new stories**, taking story files from 144 to 526. Components
with a story:

  | Layer | Before | After |
  |---|---|---|
  | core | 41 / 309 (13%) | **183 / 309 (59%)** |
  | portal | 91 / 161 (57%) | **127 / 161 (79%)** |
  | proprietary | 1 / 105 (1%) | **39 / 105 (37%)** |
| cloud / desktop / saas / portal-saas / prototypes | 0 / 84 | 0 / 84
(unchanged) |
  | **Total** | **133 / 659 (20%)** | **349 / 659 (53%)** |

Both columns are counted the same way — every `.tsx` exporting a
component, so the denominator includes things that aren't really visual
units (contexts, providers, barrels). Excluding those it's 22% → 58%.
Either way it's reproducible from the tree rather than a number you have
to take on trust.

- **Scan harness** — the Storybook Vitest addon runs each story in
headless Chromium as a **render/smoke check** (a story must mount
without throwing). New task: `task frontend:storybook:test` (pass a
filter, e.g. `-- Button`). Separate Vitest config so it doesn't touch
the existing jsdom unit tests.

## Scope

- **Stories and Storybook config only, with one exception:** a one-line
fix to `ProviderCard`, which re-rendered forever whenever its optional
`settings` prop was omitted. Called out because it's the only component
source change here.
- The preview gains a `QueryClientProvider` (the portal app has one, so
stories reaching a query hook threw without it), and the scan task now
installs the browser it drives.
- **a11y is report-only** and **nothing runs the scan in CI yet** —
enforcing a11y and wiring it into CI is the follow-up, #7086.
- Components that can't render as an isolated unit are **not** included:
anything needing the full editor runtime (ToolWorkflow / FileManager /
AppConfig / a live PDF engine) or that's headless (providers, gates, API
bridges, config factories). Stories that only rendered by mounting the
whole `AppProviders` tree were dropped for the same reason — that isn't
isolation, and the tree's ErrorBoundary swallowed render failures so
those stories could never fail. A few that need assets the headless
browser can't serve are tagged `!test`, so they still show in the UI but
sit out the scan.

## Testing

Typecheck (all build variants), ESLint, Prettier and the unit suite
pass. Every story in the scanned set mounts without throwing.

## Notes for reviewers

- Stories use the `@app`/`@core`/`@portal`/`@proprietary` aliases (no
deep relative imports) and mock data-fetching components with MSW.
- Running the full suite in one go can flake on the Vite dep-optimizer;
scan in small batches (or by filter) for a stable local run.
2026-07-28 16:06:06 +00:00

186 lines
6.3 KiB
JSON

{
"name": "frontend",
"version": "0.1.0",
"private": true,
"type": "module",
"license": "SEE LICENSE IN https://raw.githubusercontent.com/Stirling-Tools/Stirling-PDF/refs/heads/main/proprietary/LICENSE",
"proxy": "http://localhost:8080",
"dependencies": {
"@atlaskit/pragmatic-drag-and-drop": "^1.7.7",
"@cantoo/pdf-lib": "^2.5.3",
"@dnd-kit/core": "^6.3.1",
"@embedpdf/core": "^2.14.4",
"@embedpdf/engines": "^2.14.4",
"@embedpdf/models": "^2.14.4",
"@embedpdf/plugin-annotation": "^2.14.4",
"@embedpdf/plugin-attachment": "^2.14.4",
"@embedpdf/plugin-bookmark": "^2.14.4",
"@embedpdf/plugin-document-manager": "^2.14.4",
"@embedpdf/plugin-export": "^2.14.4",
"@embedpdf/plugin-history": "^2.14.4",
"@embedpdf/plugin-interaction-manager": "^2.14.4",
"@embedpdf/plugin-pan": "^2.14.4",
"@embedpdf/plugin-print": "^2.14.4",
"@embedpdf/plugin-redaction": "^2.14.4",
"@embedpdf/plugin-render": "^2.14.4",
"@embedpdf/plugin-rotate": "^2.14.4",
"@embedpdf/plugin-scroll": "^2.14.4",
"@embedpdf/plugin-search": "^2.14.4",
"@embedpdf/plugin-selection": "^2.14.4",
"@embedpdf/plugin-spread": "^2.14.4",
"@embedpdf/plugin-thumbnail": "^2.14.4",
"@embedpdf/plugin-tiling": "^2.14.4",
"@embedpdf/plugin-viewport": "^2.14.4",
"@embedpdf/plugin-zoom": "^2.14.4",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@iconify/react": "^6.0.2",
"@mantine/core": "^8.3.1",
"@mantine/dates": "^8.3.1",
"@mantine/dropzone": "^8.3.1",
"@mantine/hooks": "^8.3.1",
"@mui/icons-material": "^9.0.0",
"@mui/material": "^9.0.0",
"@posthog/react": "^1.8.2",
"@reactour/tour": "^3.8.0",
"@stripe/react-stripe-js": "^4.0.2",
"@stripe/stripe-js": "^7.9.0",
"@supabase/supabase-js": "^2.47.13",
"@tailwindcss/postcss": "^4.1.13",
"@tanstack/react-query": "^5.101.4",
"@tanstack/react-virtual": "^3.13.12",
"@tauri-apps/api": "^2.10.1",
"@tauri-apps/plugin-dialog": "2.7.0",
"@tauri-apps/plugin-fs": "2.5.0",
"@tauri-apps/plugin-http": "^2.5.7",
"@tauri-apps/plugin-notification": "^2.3.3",
"@tauri-apps/plugin-shell": "^2.3.5",
"@userback/widget": "^0.3.12",
"autoprefixer": "^10.4.21",
"axios": "^1.15.0",
"d3": "^7.9.0",
"globals": "^17.5.0",
"i18next": "^25.10.10",
"i18next-browser-languagedetector": "^8.2.0",
"jszip": "^3.10.1",
"license-report": "^6.8.0",
"pdfjs-dist": "^5.4.149",
"peerjs": "^1.5.5",
"pixelmatch": "^7.1.0",
"posthog-js": "^1.268.0",
"qrcode.react": "^4.2.0",
"react": "^19.1.1",
"react-dom": "^19.1.1",
"react-easy-crop": "^5.5.6",
"react-i18next": "^16.6.6",
"react-markdown": "^9.0.3",
"react-rnd": "^10.5.2",
"react-router-dom": "^7.9.1",
"recharts": "^3.7.0",
"remark-gfm": "^4.0.1",
"signature_pad": "^5.0.4",
"smol-toml": "^1.4.2",
"tailwindcss": "^4.1.13",
"web-vitals": "^5.1.0"
},
"scripts": {
"docs:sync": "tsx editor/scripts/sync-portal-docs.mts",
"update:minor": "node scripts/update-minor.js",
"update:major": "npx npm-check-updates -u && npm install",
"update:interactive": "npx npm-check-updates -i",
"update:minor-strict": "npx npm-check-updates -u --target minor && npm install",
"tauri:setup-dev-update": "bash scripts/dev-update-test/setup-dev-updater.sh",
"tauri:build-dev-update": "bash scripts/dev-update-test/build-dev-update.sh",
"tauri:serve-dev-update": "bash scripts/dev-update-test/serve-update.sh",
"tauri:test-update-e2e": "bash scripts/dev-update-test/test-update-e2e.sh",
"tauri:test-update-e2e:install": "bash scripts/dev-update-test/test-update-e2e.sh --install",
"tauri:dev-with-update": "cd editor && npx tsx scripts/setup-env.mts --desktop && node scripts/generate-icons.js && npx tauri dev --config src-tauri/tauri.conf.dev-update.json"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@iconify-json/material-symbols": "^1.2.53",
"@iconify/utils": "^3.1.0",
"@playwright/test": "^1.55.0",
"@storybook/addon-a11y": "^9.1.20",
"@storybook/addon-docs": "^9.1.20",
"@storybook/addon-themes": "^9.1.20",
"@storybook/addon-vitest": "^9.1.20",
"@storybook/react-vite": "^9.1.20",
"@tauri-apps/cli": "^2.9.6",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.8.0",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/d3": "^7.4.3",
"@types/gapi": "^0.0.47",
"@types/gapi.client.drive-v3": "^0.0.5",
"@types/google.accounts": "^0.0.18",
"@types/google.picker": "^0.0.51",
"@types/node": "^24.5.2",
"@types/react": "^19.1.13",
"@types/react-dom": "^19.1.9",
"@typescript-eslint/eslint-plugin": "^8.61.1",
"@typescript-eslint/parser": "^8.61.1",
"@typescript/native": "npm:typescript@^7.0.2",
"@vitejs/plugin-react-swc": "^4.1.0",
"@vitest/browser": "^3.2.6",
"@vitest/coverage-v8": "^3.2.4",
"dotenv": "^16.4.7",
"dpdm": "^3.14.0",
"eslint": "^10.0.2",
"fake-indexeddb": "^6.2.5",
"jsdom": "^27.0.0",
"json-schema-to-typescript": "^15.0.4",
"license-checker": "^25.0.1",
"msw": "^2.14.6",
"msw-storybook-addon": "^2.0.7",
"postcss": "^8.5.12",
"postcss-cli": "^11.0.1",
"postcss-preset-mantine": "^1.18.0",
"postcss-simple-vars": "^7.0.1",
"prettier": "^3.8.1",
"puppeteer": "^24.25.0",
"rollup-plugin-visualizer": "^7.0.1",
"storybook": "^9.1.20",
"tsx": "^4.22.4",
"typescript": "npm:@typescript/typescript6@^6.0.2",
"typescript-eslint": "^8.61.1",
"vite": "^7.3.2",
"vite-plugin-compression2": "^2.5.3",
"vite-plugin-static-copy": "^3.1.4",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^3.2.4"
},
"depcheck": {
"ignoreMatches": [
"@emotion/*",
"tailwindcss",
"@testing-library/user-event",
"@vitest/coverage-v8"
]
},
"overrides": {
"devalue": "^5.8.1",
"tsconfck": {
"typescript": "$typescript"
}
},
"msw": {
"workerDirectory": [
"editor/public"
]
}
}