Phase 0 — docs/release/v0.2-frontend-overhaul.md as single source of truth for the v0.2 frontend coherence pass. Records hard rules, tooling pins, sacred-behaviour contract list, wrapper catalogue, per-page migration order, verification matrix, KI-05 plan, and the explicit "DO NOT add Skeleton" line. Phase 1 — tooling baseline. All exact-pinned per the plan: - @playwright/test@1.60.0 + playwright@1.60.0 + @axe-core/playwright@4.11.3 - rollup-plugin-visualizer@7.0.1 (wired behind ANALYZE=1) - @vitest/browser@4.1.6 + @vitest/browser-playwright@4.1.6 (provider) - vitest-browser-svelte@2.1.1 (runes-aware Svelte 5 bridge) - cargo-nextest installed globally New configs: playwright.config.ts (frontend-only, dev:frontend webServer, 900x700 + 1440x900 projects, visual baselines deferred), vitest.browser.config.js (separate from jsdom suite). New scripts: test:e2e, test:e2e:ui, test:browser, analyze, test:rust:fast, guard:no-skeleton. guard-no-skeleton.mjs walks package.json + package-lock + src/ for any @skeletonlabs reference and exits 1 if found — locks in the no-Skeleton hard rule for any future agent. Smoke baseline (tests/e2e/smoke.spec.ts): 16 tests passing across two viewports — app loads without Tauri runtime, keyboard nav, axe scan (color-contrast deferred to Phase 7 per docs/release/v0.1-contrast-audit.md), light/dark theme cycle, all three sensory zones (cave/energy/reset). 10 screenshots emitted to test-results/ as non-failing artefacts. Surfaced + fixed two browser-preview bugs while landing the baseline: - src/lib/utils/osInfo.ts: FALLBACK_BROWSER_INFO was evaluated at SSR module-load (navigator undefined → os: 'unknown'), and the UA check ran before navigator.platform — so Playwright's Windows-UA Chromium on a Linux runner detected as Windows, useCustomChrome went true, Titlebar mounted and tripped Tauri-only APIs. Now lazy-built per call; platform is the primary signal, UA only a fallback. - src/lib/components/Titlebar.svelte: defensive hasTauriRuntime() guard on every handler and the $effect. Titlebar should not crash if any future code path mounts it without Tauri. .gitignore: reports/, .playwright/, test-results/, playwright-report/. Per-phase gate green: npm run check (0/0), npm test (0/0), npm run test:e2e (16/16), npm run guard:no-skeleton (clean). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
68 lines
1.8 KiB
JavaScript
68 lines
1.8 KiB
JavaScript
#!/usr/bin/env node
|
|
// Fails (exit 1) if any reference to @skeletonlabs appears in package.json,
|
|
// package-lock.json, or anywhere under src/. Prevents a future agent
|
|
// reading "frontend overhaul" from reaching for Skeleton — see
|
|
// docs/release/v0.2-frontend-overhaul.md §16.
|
|
|
|
import { readFileSync, readdirSync, statSync } from "node:fs";
|
|
import { join, relative } from "node:path";
|
|
|
|
const ROOT = process.cwd();
|
|
const NEEDLE = "@skeletonlabs";
|
|
const hits = [];
|
|
|
|
function checkFile(path) {
|
|
try {
|
|
const content = readFileSync(path, "utf8");
|
|
if (content.includes(NEEDLE)) {
|
|
const rel = relative(ROOT, path);
|
|
const lines = content.split("\n");
|
|
for (let i = 0; i < lines.length; i++) {
|
|
if (lines[i].includes(NEEDLE)) {
|
|
hits.push(`${rel}:${i + 1}: ${lines[i].trim()}`);
|
|
}
|
|
}
|
|
}
|
|
} catch {
|
|
// unreadable -> ignore
|
|
}
|
|
}
|
|
|
|
function walk(dir) {
|
|
let entries;
|
|
try {
|
|
entries = readdirSync(dir);
|
|
} catch {
|
|
return;
|
|
}
|
|
for (const name of entries) {
|
|
if (name === "node_modules" || name === ".svelte-kit" || name === ".git") continue;
|
|
const full = join(dir, name);
|
|
let st;
|
|
try {
|
|
st = statSync(full);
|
|
} catch {
|
|
continue;
|
|
}
|
|
if (st.isDirectory()) {
|
|
walk(full);
|
|
} else {
|
|
checkFile(full);
|
|
}
|
|
}
|
|
}
|
|
|
|
checkFile(join(ROOT, "package.json"));
|
|
checkFile(join(ROOT, "package-lock.json"));
|
|
walk(join(ROOT, "src"));
|
|
|
|
if (hits.length > 0) {
|
|
console.error(`guard-no-skeleton: found ${hits.length} reference(s) to ${NEEDLE}:`);
|
|
for (const h of hits) console.error(" " + h);
|
|
console.error("\nLumotia v0.2 frontend overhaul forbids Skeleton.");
|
|
console.error("See docs/release/v0.2-frontend-overhaul.md §16.");
|
|
process.exit(1);
|
|
}
|
|
|
|
console.log(`guard-no-skeleton: clean (no ${NEEDLE} references in package.json, package-lock.json, or src/)`);
|