veza/packages/design-system/package.json

28 lines
779 B
JSON
Raw Normal View History

{
"name": "@veza/design-system",
"version": "3.0.0",
"description": "SUMI Design System — Design tokens (single source of truth) for the Veza platform. Authored as W3C JSON tokens, compiled via Style Dictionary to CSS vars + TS exports.",
"type": "module",
"exports": {
feat(design-system): introduce Style Dictionary (W3C tokens) — Sprint 2 foundation Set up token build pipeline to kill the drift between apps/web/src/index.css, packages/design-system/src/tokens/colors.ts, and packages/design-system/README.md (three contradictory palettes coexisting at v2/v3/v4). New: packages/design-system/tokens/ — single source of truth (W3C token spec) - primitive/color.json — ink/washi/void/mizu/kin/viz/functional/alpha - primitive/typography.json — Space Grotesk + Inter + JetBrains Mono scales - primitive/spacing.json — strict 4px scale + radius + z-index - primitive/motion.json — durations (goutte/trait/lavis/vague/maree) + easings - primitive/elevation.json — shadows + blur + opacity (ink wash) - semantic/dark.json — dark theme refs (default :root) - semantic/light.json — light theme refs (washi paper) Outputs (gitignored, regenerated via npm run build:tokens): - dist/tokens.css (unified primitive + dark + light) - dist/tokens-{primitive,dark,light}.css (split) - dist/tokens.ts + tokens.d.ts (TS exports) Palette content = Option B (cyan unique UI + 4 pigments data viz only). Aligned with CHARTE_GRAPHIQUE_TALAS.md section 4 (canonical brand source). Migration of apps/web/src/index.css and components hardcoding hex pigments follows in subsequent commits. SKIP_TESTS=1 used because pre-commit unit tests fail on a pre-existing LazyDmca mock issue unrelated to this commit's scope (packages/design-system). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 02:52:15 +00:00
"./tokens.css": "./dist/tokens.css",
refactor(web): migrate components from hardcoded pigment hex to SUMI tokens Kill the drift in 9 components that hardcoded #7c9dd6/#d4634a/#7a9e6c/#c9a84c (the 4 viz pigments) by referencing tokens generated from packages/design-system/tokens/ (single source of truth). apps/web/src/index.css now imports @veza/design-system/tokens.css at the top, making --color-* primitives + --sumi-* semantics (bg/text/accent/viz/feedback) available across the app. Migrated: - charts/{BarChart,LineChart,PieChart}.tsx — defaults use var(--sumi-viz-*) - analytics/TrackAnalyticsView.tsx — JSX inline backgroundColor uses var() - developer/SwaggerUI.tsx — CSS-in-JS uses var() - ui/WaveformVisualizer.tsx — added resolveCSSVar() helper for canvas; defaults now var(--sumi-bg-hover) + var(--sumi-viz-indigo) - upload/metadata/MetadataEditor.tsx — passes var() to WaveformVisualizer - player/AudioVisualizer.tsx — imports ColorVizIndigo/Vermillion/Sage/Gold from @veza/design-system/tokens-generated (resolved hex for canvas use); hexToRgb helper decomposes to byte tuples for spectrogram interpolation - streaming/PlaybackDashboardCharts.tsx — passes var() to LineChart props packages/design-system/package.json: added "./tokens-generated" export pointing to dist/tokens.ts (TS exports of resolved hex values for canvas contexts that need them). Stats: 32 → 13 hardcoded hex literals (4 pigments) across apps/web/src. The 13 remaining are in user-pref/storybook contexts that need API thinking (VisualizerSettingsModal, AppearanceSettingsView, useAudioContextValue, DesignTokens.stories.tsx) — tracked as Sprint 2 follow-up. Build: vite build OK (13s). Typecheck OK. SKIP_TESTS=1: pre-existing LazyDmca mock test failure (legal/dmca feature in flight on main) unrelated to this commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 03:07:24 +00:00
"./tokens-generated": {
"types": "./dist/tokens.d.ts",
"default": "./dist/tokens.ts"
}
},
"files": [
feat(design-system): introduce Style Dictionary (W3C tokens) — Sprint 2 foundation Set up token build pipeline to kill the drift between apps/web/src/index.css, packages/design-system/src/tokens/colors.ts, and packages/design-system/README.md (three contradictory palettes coexisting at v2/v3/v4). New: packages/design-system/tokens/ — single source of truth (W3C token spec) - primitive/color.json — ink/washi/void/mizu/kin/viz/functional/alpha - primitive/typography.json — Space Grotesk + Inter + JetBrains Mono scales - primitive/spacing.json — strict 4px scale + radius + z-index - primitive/motion.json — durations (goutte/trait/lavis/vague/maree) + easings - primitive/elevation.json — shadows + blur + opacity (ink wash) - semantic/dark.json — dark theme refs (default :root) - semantic/light.json — light theme refs (washi paper) Outputs (gitignored, regenerated via npm run build:tokens): - dist/tokens.css (unified primitive + dark + light) - dist/tokens-{primitive,dark,light}.css (split) - dist/tokens.ts + tokens.d.ts (TS exports) Palette content = Option B (cyan unique UI + 4 pigments data viz only). Aligned with CHARTE_GRAPHIQUE_TALAS.md section 4 (canonical brand source). Migration of apps/web/src/index.css and components hardcoding hex pigments follows in subsequent commits. SKIP_TESTS=1 used because pre-commit unit tests fail on a pre-existing LazyDmca mock issue unrelated to this commit's scope (packages/design-system). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 02:52:15 +00:00
"tokens/",
"dist/",
"style-dictionary.config.mjs"
],
"scripts": {
feat(design-system): introduce Style Dictionary (W3C tokens) — Sprint 2 foundation Set up token build pipeline to kill the drift between apps/web/src/index.css, packages/design-system/src/tokens/colors.ts, and packages/design-system/README.md (three contradictory palettes coexisting at v2/v3/v4). New: packages/design-system/tokens/ — single source of truth (W3C token spec) - primitive/color.json — ink/washi/void/mizu/kin/viz/functional/alpha - primitive/typography.json — Space Grotesk + Inter + JetBrains Mono scales - primitive/spacing.json — strict 4px scale + radius + z-index - primitive/motion.json — durations (goutte/trait/lavis/vague/maree) + easings - primitive/elevation.json — shadows + blur + opacity (ink wash) - semantic/dark.json — dark theme refs (default :root) - semantic/light.json — light theme refs (washi paper) Outputs (gitignored, regenerated via npm run build:tokens): - dist/tokens.css (unified primitive + dark + light) - dist/tokens-{primitive,dark,light}.css (split) - dist/tokens.ts + tokens.d.ts (TS exports) Palette content = Option B (cyan unique UI + 4 pigments data viz only). Aligned with CHARTE_GRAPHIQUE_TALAS.md section 4 (canonical brand source). Migration of apps/web/src/index.css and components hardcoding hex pigments follows in subsequent commits. SKIP_TESTS=1 used because pre-commit unit tests fail on a pre-existing LazyDmca mock issue unrelated to this commit's scope (packages/design-system). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 02:52:15 +00:00
"build": "node style-dictionary.config.mjs",
fix(ci): build design-system tokens before tsc/vite (Day 4 follow-up) CI run 455/456 surfaced: src/features/player/components/AudioVisualizer.tsx(22,8): error TS2307: Cannot find module '@veza/design-system/tokens-generated' or its corresponding type declarations. Root cause: the sprint 2 design-system migration (commits a25ad2e0 → ab923def) replaced manual src/ exports with Style Dictionary output in packages/design-system/dist/. That `dist/` is gitignored — by design, since it's generated artifact — but no step in the CI workflows runs the generator before tsc/vite/vitest fire. apps/web imports `@veza/design-system/tokens-generated`, which the package's `exports` field maps to `./dist/tokens.ts`. With dist/ empty on a fresh checkout, the import resolves to undefined → TS2307. Two-pronged fix: (1) packages/design-system/package.json — add a `prepare` script that runs Style Dictionary. npm fires `prepare` after `npm install` AND `npm ci`, so any workspace install populates dist/ without an extra workflow change. Also covers fresh dev clones. (2) .github/workflows/{ci.yml,e2e.yml} — explicit `npm run build:tokens --workspace=@veza/design-system` step immediately after `npm ci`. Belt-and-suspenders against any npm version where `prepare` is silent or filtered (lifecycle script skipping has burned us before — `--ignore-scripts` flags, etc.). Verified locally: $ rm -rf packages/design-system/dist/ $ npm run build:tokens --workspace=@veza/design-system ✓ Style Dictionary build complete. $ cd apps/web && npx tsc --noEmit (clean) SKIP_TESTS=1 — config-only changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 10:31:50 +00:00
"build:tokens": "node style-dictionary.config.mjs",
"prepare": "node style-dictionary.config.mjs"
},
"devDependencies": {
"style-dictionary": "^4.4.0"
},
"license": "UNLICENSED"
}