|
|
|
|
/**
|
|
|
|
|
* Lint an eidos component CSS against its morfo contract.
|
|
|
|
|
*
|
|
|
|
|
* Usage: npx tsx scripts/eidos-lint.ts <component-kebab>
|
|
|
|
|
* e.g. npx tsx scripts/eidos-lint.ts toggle
|
|
|
|
|
*
|
uix: drawer/popover/toast/accordion eidos wrappers + sema packs + /uix docs scaffold
- eidos: migrate drawer / popover / toast / accordion to wrapper subdirectory
pattern (provider + parts + tokens + recipe per component); avatar wrapper
added; toggle/switch/collapsible recipe polish.
- sema: per-component packs (accordion, drawer, popover, toast); engine /
resolver / event / sema-map updates; visual channel hold refinements.
- morfo: drawer event surface (variant, dragToDismiss, isDragging, minSize/
maxSize, onDragStart); popover/toast/accordion event refinements; schema +
types updates.
- soma: drawer provider rewrite (variant, dragToDismiss, isDragging binding,
drag callbacks); toast provider/toaster restructure with toast-main +
toast-status parts; popover content/arrow polish; gesture/floating layer
updates; manipulation layer scaffold; avatar removed (eidos owns it now).
- web/routes: legacy demos updated for new APIs; new /uix docs scaffold
(web/routes/uix/) with Radix-style shell, theme/lang/format/semantic prefs,
and standardized component template (Drawer page first — 6 tabs, live
controls, drag-hint arrows, scroll-safe body wrapper).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
|
|
|
* Reads `src/uix/morfo/components/{name}.ts` +
|
|
|
|
|
* `src/uix/eidos/components/{name}/{name}.css` (or legacy flat
|
|
|
|
|
* `components/{name}.css`), compiles the morfo, and reports which
|
|
|
|
|
* selectors are morfo-backed, eidos-only DOM signals/wrapper attrs, or
|
|
|
|
|
* invalid (value not in declared enum).
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { readFileSync, existsSync } from 'node:fs'
|
|
|
|
|
import { resolve } from 'node:path'
|
|
|
|
|
|
|
|
|
|
import { compileMorfo } from '../src/uix/morfo/compile'
|
|
|
|
|
import { formatLintReport, lintEidosCss } from '../src/uix/eidos/lint'
|
|
|
|
|
import type { Morfo } from '../src/uix/morfo/types'
|
|
|
|
|
|
|
|
|
|
async function main() {
|
|
|
|
|
const name = process.argv[2]
|
|
|
|
|
if (!name) {
|
|
|
|
|
console.error('Usage: tsx scripts/eidos-lint.ts <component-kebab>')
|
|
|
|
|
process.exit(2)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const morfoPath = resolve(`src/uix/morfo/components/${name}.ts`)
|
uix: drawer/popover/toast/accordion eidos wrappers + sema packs + /uix docs scaffold
- eidos: migrate drawer / popover / toast / accordion to wrapper subdirectory
pattern (provider + parts + tokens + recipe per component); avatar wrapper
added; toggle/switch/collapsible recipe polish.
- sema: per-component packs (accordion, drawer, popover, toast); engine /
resolver / event / sema-map updates; visual channel hold refinements.
- morfo: drawer event surface (variant, dragToDismiss, isDragging, minSize/
maxSize, onDragStart); popover/toast/accordion event refinements; schema +
types updates.
- soma: drawer provider rewrite (variant, dragToDismiss, isDragging binding,
drag callbacks); toast provider/toaster restructure with toast-main +
toast-status parts; popover content/arrow polish; gesture/floating layer
updates; manipulation layer scaffold; avatar removed (eidos owns it now).
- web/routes: legacy demos updated for new APIs; new /uix docs scaffold
(web/routes/uix/) with Radix-style shell, theme/lang/format/semantic prefs,
and standardized component template (Drawer page first — 6 tabs, live
controls, drag-hint arrows, scroll-safe body wrapper).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
|
|
|
const subfolderCssPath = resolve(`src/uix/eidos/components/${name}/${name}.css`)
|
|
|
|
|
const flatCssPath = resolve(`src/uix/eidos/components/${name}.css`)
|
|
|
|
|
const cssPath = existsSync(subfolderCssPath) ? subfolderCssPath : flatCssPath
|
|
|
|
|
if (!existsSync(morfoPath)) {
|
|
|
|
|
console.error(`No morfo file at ${morfoPath}`)
|
|
|
|
|
process.exit(2)
|
|
|
|
|
}
|
|
|
|
|
if (!existsSync(cssPath)) {
|
uix: drawer/popover/toast/accordion eidos wrappers + sema packs + /uix docs scaffold
- eidos: migrate drawer / popover / toast / accordion to wrapper subdirectory
pattern (provider + parts + tokens + recipe per component); avatar wrapper
added; toggle/switch/collapsible recipe polish.
- sema: per-component packs (accordion, drawer, popover, toast); engine /
resolver / event / sema-map updates; visual channel hold refinements.
- morfo: drawer event surface (variant, dragToDismiss, isDragging, minSize/
maxSize, onDragStart); popover/toast/accordion event refinements; schema +
types updates.
- soma: drawer provider rewrite (variant, dragToDismiss, isDragging binding,
drag callbacks); toast provider/toaster restructure with toast-main +
toast-status parts; popover content/arrow polish; gesture/floating layer
updates; manipulation layer scaffold; avatar removed (eidos owns it now).
- web/routes: legacy demos updated for new APIs; new /uix docs scaffold
(web/routes/uix/) with Radix-style shell, theme/lang/format/semantic prefs,
and standardized component template (Drawer page first — 6 tabs, live
controls, drag-hint arrows, scroll-safe body wrapper).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
|
|
|
console.error(`No eidos CSS at ${subfolderCssPath} or ${flatCssPath}`)
|
|
|
|
|
process.exit(2)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const mod = (await import(`../src/uix/morfo/components/${name}`)) as Record<string, unknown>
|
|
|
|
|
const morfoExportName = `${name.replace(/-([a-z])/g, (_, c: string) => c.toUpperCase())}Morfo`
|
|
|
|
|
const morfo = mod[morfoExportName] as Morfo | undefined
|
|
|
|
|
if (!morfo) {
|
|
|
|
|
console.error(`Module exports ${Object.keys(mod).join(', ')}; expected ${morfoExportName}.`)
|
|
|
|
|
process.exit(2)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const compiled = compileMorfo(morfo)
|
|
|
|
|
const css = readFileSync(cssPath, 'utf-8')
|
|
|
|
|
const report = lintEidosCss(css, compiled)
|
|
|
|
|
console.log(formatLintReport(report))
|
|
|
|
|
|
|
|
|
|
if (report.counts.invalid > 0) process.exit(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
main().catch((err) => {
|
|
|
|
|
console.error(err)
|
|
|
|
|
process.exit(2)
|
|
|
|
|
})
|