94b320074d
- The page takes the screens' words its mockup draws from their own texts: screen.ha (Home Assistant's words, filled from Home Assistant), screen.time, screen.date, screen.number and screen.tile.page, per language next to _meta and editor. The copies under editor.mockup go; the rest of `screen` and all of `addon` stay out of the build. - Numbers in the mockup follow the screens' language (screen.number, with its minimum grouping) or the chosen style, as the firmware writes them. - @intlify/unplugin-vue-i18n compiles every text at build time, so the page runs vue-i18n's runtime-only build without the message compiler; every language's _meta comes with the page. Empty texts stay out while building. - The live updates carry the editor's language (api/events?language=), as an EventSource sends no headers. - web/ needs Node 22.13 or newer: vue-i18n 11.4, Vite 7 and the unplugin ask for it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
18 lines
735 B
TypeScript
18 lines
735 B
TypeScript
import vue from "@vitejs/plugin-vue";
|
|
import { defineConfig } from "vitest/config";
|
|
import { editorTexts, translations } from "./vite.config";
|
|
|
|
// Unit and component tests of the editor: the grid rules, the top bar rules, the store and the components,
|
|
// in jsdom. `npm test` runs them; `npm run test:watch` while developing. The components mount with the
|
|
// editor's texts (tests/setup.ts), in English, compiled as for the page; vue-i18n keeps its compiler here, for the
|
|
// texts the tests add themselves.
|
|
export default defineConfig({
|
|
plugins: [editorTexts(), translations(false), vue()],
|
|
test: {
|
|
environment: "jsdom",
|
|
include: ["tests/**/*.spec.ts"],
|
|
setupFiles: ["tests/setup.ts"],
|
|
restoreMocks: true,
|
|
},
|
|
});
|