9fe6d7cc44
Rewrites Box/Text/Spacer/Static/Newline from h()/render functions to Vue <script setup> template SFCs (Transform stays a render fn — it inspects its own child vnodes), with vue-tsc-verified consumer types (template + JSX fixtures), provide/inject text context, the always-validate Text divergence (color + backgroundColor), and three renderer fixes the SFCs surfaced (static anchor skip, transform line-index Ink-parity, useBoxMetrics subtree drill). Integrates the five main commits landed after the branch point: #163 public-API audit, generic Static scoped-slot typing, foreground color validation, useWindowSize/divergence docs. Squashed from the SFC sub-commits + the two main-integration merges to keep a linear, rebaseable history. See PR #165 for the full breakdown. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { defineConfig } from "vite-plus";
|
|
import vueJsx from "@vitejs/plugin-vue-jsx";
|
|
import Vue from "unplugin-vue/rolldown";
|
|
import VueVite from "unplugin-vue/vite";
|
|
|
|
const HOST_TAGS = ["box", "text", "virtual-text", "static", "transform"];
|
|
|
|
export default defineConfig({
|
|
// `VueVite` parses `.vue` SFCs in the TEST/dev graph (unit tests may import the
|
|
// .vue components directly, e.g. host/text-measure.test.ts). The `pack` build has
|
|
// its own `Vue` rolldown plugin below; both need `isCustomElement` so the host
|
|
// tags (`<box>` / `<text>` / …) inside SFC templates compile to raw element
|
|
// vnodes instead of being resolved as components.
|
|
plugins: [
|
|
vueJsx(),
|
|
VueVite({
|
|
template: {
|
|
compilerOptions: {
|
|
isCustomElement: (tag: string) => HOST_TAGS.includes(tag),
|
|
},
|
|
},
|
|
}),
|
|
],
|
|
pack: {
|
|
entry: ["src/index.ts", "src/internal.ts"],
|
|
plugins: [
|
|
Vue({
|
|
isProduction: true,
|
|
template: {
|
|
compilerOptions: {
|
|
isCustomElement: (tag: string) => HOST_TAGS.includes(tag),
|
|
},
|
|
},
|
|
}),
|
|
],
|
|
dts: { vue: true },
|
|
exports: true,
|
|
},
|
|
});
|