circuitforge-core/packages/display/vite.config.ts
pyr0ball 6d82f3561f
Some checks failed
CI / test (pull_request) Has been cancelled
feat(display): add @circuitforge/display strip-display Vue package
New packages/display/ — Vue 3 primitives for products running a secondary
1920x480 landscape / 480x1920 portrait kiosk display, per the strip display
spec. First non-Python module in this repo; published as its own npm
package (not part of the Python circuitforge-core distribution) so products
that don't use a strip display never pull in Vue as a dependency.

- DisplayLayout — root wrapper: identity zone, orientation-aware grid
  (landscape/portrait), dark-default theme, #metrics/#alerts/#macros slots.
- DisplayMetric — value/label tile with optional unit, severity colour,
  sparkline.
- DisplayAlert — timestamped, severity-coloured alert row.
- DisplayMacroButton — touch target (44px+ min) emitting a
  shell/url/api/display_switch action payload; execution stays product-side.
- theme.ts — central theme file: CSS custom properties (dark/light) plus
  UnoCSS theme/shortcut fragments for products that already run UnoCSS
  (Turnstone, Robin) to spread into their own uno.config.ts.
- launcher/launcher.html — static, framework-free product switcher reading
  a sibling launcher.config.json.

37 Vitest tests across all four components; vue-tsc type-checks clean;
vite build produces ESM/CJS bundles + CSS + .d.ts.

First consumer: Turnstone's sysadmin profile (turnstone#25, currently
blocked on this ticket).

Closes: #69
2026-07-10 18:29:21 -07:00

25 lines
661 B
TypeScript

import { resolve } from 'node:path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [vue()],
build: {
// vue-tsc --emitDeclarationOnly runs before this and writes .d.ts files
// into dist/ — don't let Vite's default emptyOutDir wipe them out.
emptyOutDir: false,
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'CircuitForgeDisplay',
fileName: 'circuitforge-display',
formats: ['es', 'cjs'],
},
rollupOptions: {
external: ['vue'],
},
},
test: {
environment: 'jsdom',
include: ['src/tests/**/*.spec.ts'],
},
})