frontend-harness 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cli/index.js +2 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/runtime/builtin-skills.js +4 -1
- package/dist/runtime/builtin-skills.js.map +1 -1
- package/dist/runtime/plan/component-resolver.js +82 -1
- package/dist/runtime/plan/component-resolver.js.map +1 -1
- package/dist/runtime/plan/guidance.js +5 -3
- package/dist/runtime/plan/guidance.js.map +1 -1
- package/dist/runtime/protocol-init.js +1 -1
- package/dist/runtime/protocol-init.js.map +1 -1
- package/dist/runtime/scaffold/template-renderer.d.ts +26 -0
- package/dist/runtime/scaffold/template-renderer.js +28 -0
- package/dist/runtime/scaffold/template-renderer.js.map +1 -0
- package/dist/runtime/scaffold/vue-template.d.ts +1 -5
- package/dist/runtime/scaffold/vue-template.js +43 -95
- package/dist/runtime/scaffold/vue-template.js.map +1 -1
- package/dist/runtime/scaffold.d.ts +1 -0
- package/dist/runtime/scaffold.js +13 -3
- package/dist/runtime/scaffold.js.map +1 -1
- package/dist/runtime/ui-restoration.d.ts +3 -3
- package/dist/runtime/ui-restoration.js +24 -11
- package/dist/runtime/ui-restoration.js.map +1 -1
- package/dist/runtime/verify.js +5 -1
- package/dist/runtime/verify.js.map +1 -1
- package/package.json +2 -1
- package/templates/scaffold/vue/.husky/pre-commit +1 -0
- package/templates/scaffold/vue/README.md.tpl +50 -0
- package/templates/scaffold/vue/eslint.config.mjs +49 -0
- package/templates/scaffold/vue/gitignore.tpl +23 -0
- package/templates/scaffold/vue/index.html.tpl +12 -0
- package/templates/scaffold/vue/playwright.config.mjs +29 -0
- package/templates/scaffold/vue/postcss.config.mjs +5 -0
- package/templates/scaffold/vue/src/App.vue +7 -0
- package/templates/scaffold/vue/src/env.d.ts +7 -0
- package/templates/scaffold/vue/src/features/home/HomeView.vue +86 -0
- package/templates/scaffold/vue/src/main.ts +5 -0
- package/templates/scaffold/vue/src/service/http.ts +18 -0
- package/templates/scaffold/vue/src/service/index.ts +1 -0
- package/templates/scaffold/vue/src/storage/index.ts +31 -0
- package/templates/scaffold/vue/src/styles/main.scss +21 -0
- package/templates/scaffold/vue/src/styles/tokens.scss +20 -0
- package/templates/scaffold/vue/src/utils/index.ts +11 -0
- package/templates/scaffold/vue/tests/e2e/app-desktop.spec.ts +10 -0
- package/templates/scaffold/vue/tests/e2e/app-mobile.spec.ts +9 -0
- package/templates/scaffold/vue/tests/integration/app.test.ts +15 -0
- package/templates/scaffold/vue/tests/render.ts +6 -0
- package/templates/scaffold/vue/tests/setup.ts +7 -0
- package/templates/scaffold/vue/vite.config.mjs +33 -0
- package/templates/scaffold/vue/vitest.config.mjs +34 -0
|
@@ -1,45 +1,53 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
|
-
import {
|
|
2
|
+
import { escapeHtml, json, renderScaffoldTemplateFiles } from "./template-renderer.js";
|
|
3
|
+
const VUE_TEMPLATE_ROOT = new URL("../../../templates/scaffold/vue/", import.meta.url);
|
|
4
|
+
const VUE_TEMPLATE_FILES = [
|
|
5
|
+
{ source: "gitignore.tpl", target: ".gitignore" },
|
|
6
|
+
{ source: ".husky/pre-commit", target: ".husky/pre-commit", mode: 0o755 },
|
|
7
|
+
{ source: "eslint.config.mjs", target: "eslint.config.mjs" },
|
|
8
|
+
{ source: "index.html.tpl", target: "index.html" },
|
|
9
|
+
{ source: "postcss.config.mjs", target: "postcss.config.mjs" },
|
|
10
|
+
{ source: "README.md.tpl", target: "README.md" },
|
|
11
|
+
{ source: "vite.config.mjs", target: "vite.config.mjs" },
|
|
12
|
+
{ source: "vitest.config.mjs", target: "vitest.config.mjs" },
|
|
13
|
+
{ source: "playwright.config.mjs", target: "playwright.config.mjs" },
|
|
14
|
+
{ source: "src/App.vue", target: "src/App.vue" },
|
|
15
|
+
{ source: "src/main.ts", target: "src/main.ts" },
|
|
16
|
+
{ source: "src/env.d.ts", target: "src/env.d.ts" },
|
|
17
|
+
{ source: "src/features/home/HomeView.vue", target: "src/features/home/HomeView.vue" },
|
|
18
|
+
{ source: "src/styles/main.scss", target: "src/styles/main.scss" },
|
|
19
|
+
{ source: "src/styles/tokens.scss", target: "src/styles/tokens.scss" },
|
|
20
|
+
{ source: "src/utils/index.ts", target: "src/utils/index.ts" },
|
|
21
|
+
{ source: "src/storage/index.ts", target: "src/storage/index.ts" },
|
|
22
|
+
{ source: "src/service/http.ts", target: "src/service/http.ts" },
|
|
23
|
+
{ source: "src/service/index.ts", target: "src/service/index.ts" },
|
|
24
|
+
{ source: "tests/setup.ts", target: "tests/setup.ts" },
|
|
25
|
+
{ source: "tests/render.ts", target: "tests/render.ts" },
|
|
26
|
+
{ source: "tests/integration/app.test.ts", target: "tests/integration/app.test.ts" },
|
|
27
|
+
{ source: "tests/e2e/app-desktop.spec.ts", target: "tests/e2e/app-desktop.spec.ts" },
|
|
28
|
+
{ source: "tests/e2e/app-mobile.spec.ts", target: "tests/e2e/app-mobile.spec.ts" }
|
|
29
|
+
];
|
|
3
30
|
export function buildVueScaffoldFiles(projectName) {
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
{ path: "src/App.vue", content: appVue() },
|
|
20
|
-
{ path: "src/main.ts", content: lines("import { createApp } from \"vue\";", "import App from \"./App.vue\";", "import \"./styles/main.scss\";", "", "createApp(App).mount(\"#app\");") },
|
|
21
|
-
{ path: "src/env.d.ts", content: envDts() },
|
|
22
|
-
{ path: "src/features/.gitkeep", content: "" },
|
|
23
|
-
{ path: "src/styles/main.scss", content: mainScss() },
|
|
24
|
-
{ path: "src/styles/tokens.scss", content: styleTokens() },
|
|
25
|
-
{ path: "src/utils/index.ts", content: utilsIndex() },
|
|
26
|
-
{ path: "src/storage/index.ts", content: storageIndex() },
|
|
27
|
-
{ path: "src/service/http.ts", content: serviceHttp() },
|
|
28
|
-
{ path: "src/service/index.ts", content: lines("export { http, normalizeHttpError } from \"./http\";") },
|
|
29
|
-
{ path: "tests/setup.ts", content: testSetup() },
|
|
30
|
-
{ path: "tests/render.ts", content: testRender() },
|
|
31
|
-
{ path: "tests/integration/app.test.ts", content: appIntegrationTest() },
|
|
32
|
-
{ path: "tests/e2e/app-desktop.spec.ts", content: appDesktopE2eTest() },
|
|
33
|
-
{ path: "tests/e2e/app-mobile.spec.ts", content: appMobileE2eTest() }
|
|
34
|
-
];
|
|
31
|
+
return renderScaffoldTemplateFiles({
|
|
32
|
+
templateRoot: VUE_TEMPLATE_ROOT,
|
|
33
|
+
context: {
|
|
34
|
+
projectName,
|
|
35
|
+
projectNameHtml: escapeHtml(projectName)
|
|
36
|
+
},
|
|
37
|
+
staticFiles: [
|
|
38
|
+
{ path: "package.json", content: packageJson(projectName) },
|
|
39
|
+
{ path: ".prettierrc.json", content: json({ semi: true, singleQuote: false, trailingComma: "none" }) },
|
|
40
|
+
{ path: ".frontend-harness/config.json", content: harnessConfig() },
|
|
41
|
+
{ path: "tsconfig.json", content: tsconfig() },
|
|
42
|
+
{ path: "tsconfig.node.json", content: tsconfigNode() }
|
|
43
|
+
],
|
|
44
|
+
manifestFiles: VUE_TEMPLATE_FILES
|
|
45
|
+
});
|
|
35
46
|
}
|
|
36
47
|
export function toPackageName(value) {
|
|
37
48
|
const normalized = value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
38
49
|
return normalized || "vue-scaffold";
|
|
39
50
|
}
|
|
40
|
-
function gitignore() {
|
|
41
|
-
return lines("node_modules", "dist", "coverage", ".DS_Store", "*.log", ".vite", "playwright-report", "test-results", "src/types/auto-imports.d.ts", "src/types/components.d.ts", "", "# frontend-harness generated runtime evidence", ".frontend-harness/context/", ".frontend-harness/plans/", ".frontend-harness/execution-units/", ".frontend-harness/component-graph/", ".frontend-harness/guidance/", ".frontend-harness/state.json", ".frontend-harness/verification/", ".frontend-harness/logs/", ".frontend-harness/repair/", ".frontend-harness/repair-decision/", ".frontend-harness/state-explain/");
|
|
42
|
-
}
|
|
43
51
|
function packageJson(projectName) {
|
|
44
52
|
return json({
|
|
45
53
|
name: projectName,
|
|
@@ -119,15 +127,6 @@ function harnessConfig() {
|
|
|
119
127
|
}
|
|
120
128
|
});
|
|
121
129
|
}
|
|
122
|
-
function eslintConfig() {
|
|
123
|
-
return lines("import js from \"@eslint/js\";", "import prettier from \"eslint-config-prettier\";", "import vue from \"eslint-plugin-vue\";", "import vueParser from \"vue-eslint-parser\";", "import tsParser from \"@typescript-eslint/parser\";", "", "export default [", " {", " ignores: [\"dist/**\", \"node_modules/**\"]", " },", " js.configs.recommended,", " ...vue.configs[\"flat/essential\"],", " prettier,", " {", " languageOptions: {", " globals: {", " document: \"readonly\",", " localStorage: \"readonly\",", " sessionStorage: \"readonly\",", " Storage: \"readonly\",", " window: \"readonly\"", " }", " }", " },", " {", " files: [\"**/*.{ts,tsx}\"],", " languageOptions: {", " parser: tsParser,", " parserOptions: {", " ecmaVersion: \"latest\",", " sourceType: \"module\"", " }", " }", " },", " {", " files: [\"**/*.vue\"],", " languageOptions: {", " parser: vueParser,", " parserOptions: {", " parser: tsParser,", " ecmaVersion: \"latest\",", " sourceType: \"module\"", " }", " },", " rules: {", " \"vue/multi-word-component-names\": \"off\"", " }", " }", "];");
|
|
124
|
-
}
|
|
125
|
-
function indexHtml(projectName) {
|
|
126
|
-
return lines("<!doctype html>", "<html lang=\"zh-CN\">", " <head>", " <meta charset=\"UTF-8\" />", " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />", ` <title>${escapeHtml(projectName)}</title>`, " </head>", " <body>", " <div id=\"app\"></div>", " <script type=\"module\" src=\"/src/main.ts\"></script>", " </body>", "</html>");
|
|
127
|
-
}
|
|
128
|
-
function readme(projectName) {
|
|
129
|
-
return lines(`# ${projectName}`, "", "Vue 3 + Vite engineering scaffold.", "", "This preset is based on the company Vue stack shape used in freight-admin, but it only includes engineering infrastructure.", "It intentionally avoids business pages, admin routes, dashboards, permissions, and domain components.", "", "## Scripts", "", "- `npm run dev`", "- `npm run build`", "- `npm run preview`", "- `npm run lint`", "- `npm run typecheck`", "- `npm test`", "- `npm run test:e2e`", "- `npm run format`", "- `npm run harness -- <command>`", "- `npm run harness:init`", "- `npm run harness:check`", "- `npm run harness:clean`", "", "## Base layers", "", "- `src/utils` for shared helpers", "- `src/storage` for browser storage wrappers", "- `src/service` for API client setup", "- `src/styles` for project-wide styles", "- `src/styles/tokens.scss` for reusable UI restoration tokens", "- `src/features/<feature>` for page-specific types, fixtures, columns, calculations, and components", "- `tests/integration` for Vitest + Testing Library behavior tests", "- `tests/e2e` for Playwright browser smoke tests", "", "## UI restoration workflow", "", "Use the injected `ui-implementation` project skill and `.frontend-harness/guidance/latest.md` for the current harness plan.", "Use selected `.frontend-harness/knowledge` cards for project semantics, interactions, and visible states; keep provider design output as evidence.", "When visual restoration is required, follow the evidence contract in `.frontend-harness/guidance/latest.md`: keep design, actual, and diff artifacts plus comparison metadata and matching hashes under `.frontend-harness/`.", "Place project-native UI work under `src/features/<feature>` and verify it with the commands named by the harness plan.", "", "## Harness onboarding", "", "This scaffold includes `.frontend-harness/config.json` so verification commands are explicit.", "Run `npm run harness:init` after installing dependencies to inject the agent protocol into `AGENTS.md` and `CLAUDE.md`.", "Use `npm run harness -- <command>` for other harness commands so the project-local `frontend-harness` dependency is used.", "", "## Testing", "", "`npm test` runs Vitest in jsdom with Testing Library helpers from `tests/render.ts` and `tests/setup.ts`.", "`npm run test:e2e` runs Playwright against `npm run preview`; install Playwright browsers in environments that need browser smoke coverage.");
|
|
130
|
-
}
|
|
131
130
|
function tsconfig() {
|
|
132
131
|
return json({
|
|
133
132
|
compilerOptions: {
|
|
@@ -166,55 +165,4 @@ function tsconfigNode() {
|
|
|
166
165
|
include: ["vite.config.mjs", "vitest.config.mjs", "playwright.config.mjs", "eslint.config.mjs", "postcss.config.mjs"]
|
|
167
166
|
});
|
|
168
167
|
}
|
|
169
|
-
function viteConfig() {
|
|
170
|
-
return lines("import { defineConfig } from \"vite\";", "import vue from \"@vitejs/plugin-vue\";", "import AutoImport from \"unplugin-auto-import/vite\";", "import Components from \"unplugin-vue-components/vite\";", "import { ElementPlusResolver } from \"unplugin-vue-components/resolvers\";", "import path from \"node:path\";", "import { fileURLToPath } from \"node:url\";", "", "const __dirname = path.dirname(fileURLToPath(import.meta.url));", "", "export default defineConfig({", " plugins: [", " vue(),", " AutoImport({", " imports: [\"vue\"],", " dts: \"src/types/auto-imports.d.ts\",", " resolvers: [ElementPlusResolver()]", " }),", " Components({", " dts: \"src/types/components.d.ts\",", " resolvers: [ElementPlusResolver()]", " })", " ],", " resolve: {", " alias: {", " \"@\": path.resolve(__dirname, \"src\")", " }", " },", " server: {", " host: true,", " hmr: { overlay: false }", " }", "});");
|
|
171
|
-
}
|
|
172
|
-
function vitestConfig() {
|
|
173
|
-
return lines("import { defineConfig } from \"vitest/config\";", "import vue from \"@vitejs/plugin-vue\";", "import AutoImport from \"unplugin-auto-import/vite\";", "import Components from \"unplugin-vue-components/vite\";", "import { ElementPlusResolver } from \"unplugin-vue-components/resolvers\";", "import path from \"node:path\";", "import { fileURLToPath } from \"node:url\";", "", "const __dirname = path.dirname(fileURLToPath(import.meta.url));", "", "export default defineConfig({", " plugins: [", " vue(),", " AutoImport({", " imports: [\"vue\"],", " dts: false,", " resolvers: [ElementPlusResolver()]", " }),", " Components({", " dts: false,", " resolvers: [ElementPlusResolver()]", " })", " ],", " resolve: {", " alias: {", " \"@\": path.resolve(__dirname, \"src\")", " }", " },", " test: {", " environment: \"jsdom\",", " include: [\"tests/**/*.test.ts\"],", " setupFiles: [\"tests/setup.ts\"]", " }", "});");
|
|
174
|
-
}
|
|
175
|
-
function playwrightConfig() {
|
|
176
|
-
return lines("import { defineConfig, devices } from \"@playwright/test\";", "", "export default defineConfig({", " testDir: \"./tests/e2e\",", " fullyParallel: true,", " reporter: [[\"list\"]],", " use: {", " baseURL: \"http://127.0.0.1:4173\",", " trace: \"retain-on-failure\"", " },", " webServer: {", " command: \"npm run preview -- --host 127.0.0.1 --port 4173 --strictPort\",", " url: \"http://127.0.0.1:4173\",", " reuseExistingServer: !process.env.CI,", " timeout: 120_000", " },", " projects: [", " {", " name: \"chromium-desktop\",", " testMatch: /desktop\\.spec\\.ts/,", " use: { ...devices[\"Desktop Chrome\"] }", " },", " {", " name: \"mobile-chrome\",", " testMatch: /mobile\\.spec\\.ts/,", " use: { ...devices[\"Pixel 7\"] }", " }", " ]", "});");
|
|
177
|
-
}
|
|
178
|
-
function appVue() {
|
|
179
|
-
return lines("<template>", " <main class=\"app-shell\">", " <section class=\"hero\">", " <p class=\"eyebrow\">Vue scaffold</p>", " <h1>Engineering base is ready</h1>", " <p class=\"lead\">", " This scaffold carries the company Vue engineering baseline: Vite, TypeScript, Element Plus, auto imports, storage, utility, and service layers.", " </p>", " </section>", " <section class=\"grid\">", " <article>", " <h2>utils</h2>", " <p>Shared helpers and data shaping utilities.</p>", " </article>", " <article>", " <h2>storage</h2>", " <p>Browser storage wrappers with JSON handling.</p>", " </article>", " <article>", " <h2>service</h2>", " <p>API client setup and error normalization.</p>", " </article>", " </section>", " </main>", "</template>", "", "<style scoped lang=\"scss\">", ".app-shell {", " min-height: 100vh;", " padding: 48px 24px;", " background: #f6f8fb;", " color: #102030;", "}", "", ".hero {", " max-width: 960px;", " margin: 0 auto 32px;", "}", "", ".eyebrow {", " margin: 0 0 12px;", " font-size: 12px;", " letter-spacing: 0.12em;", " text-transform: uppercase;", " color: #5f6b7a;", "}", "", "h1 {", " margin: 0;", " font-size: 40px;", " line-height: 1.1;", "}", "", ".lead {", " max-width: 680px;", " margin: 16px 0 0;", " font-size: 16px;", " line-height: 1.75;", " color: #425466;", "}", "", ".grid {", " display: grid;", " grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));", " gap: 16px;", " max-width: 960px;", " margin: 0 auto;", "}", "", "article {", " padding: 20px;", " border: 1px solid #d7deea;", " border-radius: 8px;", " background: #fff;", "}", "", "h2 {", " margin: 0 0 8px;", " font-size: 18px;", "}", "", "p {", " margin: 0;", " line-height: 1.7;", "}", "</style>");
|
|
180
|
-
}
|
|
181
|
-
function envDts() {
|
|
182
|
-
return lines("/// <reference types=\"vite/client\" />", "", "declare module \"*.vue\" {", " import type { DefineComponent } from \"vue\";", " const component: DefineComponent<{}, {}, any>;", " export default component;", "}");
|
|
183
|
-
}
|
|
184
|
-
function mainScss() {
|
|
185
|
-
return lines("@use \"./tokens\" as *;", "", ":root {", " color-scheme: light;", " font-family: Inter, \"PingFang SC\", \"Microsoft YaHei\", sans-serif;", " line-height: 1.5;", " font-weight: 400;", " font-synthesis: none;", " text-rendering: optimizeLegibility;", " -webkit-font-smoothing: antialiased;", " -moz-osx-font-smoothing: grayscale;", "}", "", "* { box-sizing: border-box; }", "", "html, body, #app {", " min-height: 100%;", " margin: 0;", "}", "", "body { background: $color-surface-muted; }");
|
|
186
|
-
}
|
|
187
|
-
function styleTokens() {
|
|
188
|
-
return lines("$color-surface: #ffffff;", "$color-surface-muted: #f6f8fb;", "$color-border: #d7deea;", "$color-text: #102030;", "$color-text-muted: #5f6b7a;", "$color-primary: #2563eb;", "$color-success: #16a34a;", "$color-warning: #d97706;", "$color-danger: #dc2626;", "", "$space-1: 4px;", "$space-2: 8px;", "$space-3: 12px;", "$space-4: 16px;", "$space-5: 20px;", "$space-6: 24px;", "", "$radius-control: 6px;", "$radius-card: 8px;", "$table-min-width: 960px;");
|
|
189
|
-
}
|
|
190
|
-
function utilsIndex() {
|
|
191
|
-
return lines("export function isNil(value: unknown): value is null | undefined {", " return value === null || value === undefined;", "}", "", "export function isBlank(value: unknown): value is string {", " return typeof value === \"string\" && value.trim().length === 0;", "}", "", "export function pickDefined<T extends Record<string, unknown>>(value: T): Partial<T> {", " return Object.fromEntries(Object.entries(value).filter(([, item]) => item !== undefined)) as Partial<T>;", "}");
|
|
192
|
-
}
|
|
193
|
-
function storageIndex() {
|
|
194
|
-
return lines("type StorageKind = \"local\" | \"session\";", "", "function resolveStorage(kind: StorageKind): Storage {", " return kind === \"session\" ? sessionStorage : localStorage;", "}", "", "export function createStorage(kind: StorageKind = \"local\") {", " const storage = resolveStorage(kind);", "", " return {", " get<T>(key: string): T | null {", " const raw = storage.getItem(key);", " if (raw === null) return null;", " try {", " return JSON.parse(raw) as T;", " } catch (error) {", " const message = error instanceof Error ? error.message : String(error);", " throw new Error(`Storage value for ${key} is not valid JSON: ${message}`);", " }", " },", " set<T>(key: string, value: T): void {", " storage.setItem(key, JSON.stringify(value));", " },", " remove(key: string): void {", " storage.removeItem(key);", " },", " clear(): void {", " storage.clear();", " }", " };", "}");
|
|
195
|
-
}
|
|
196
|
-
function serviceHttp() {
|
|
197
|
-
return lines("import axios from \"axios\";", "", "export const http = axios.create({", " baseURL: import.meta.env.VITE_API_BASE_URL || \"/api\",", " timeout: 15_000", "});", "", "http.interceptors.response.use(", " (response) => response,", " (error) => Promise.reject(normalizeHttpError(error))", ");", "", "export function normalizeHttpError(error: unknown): Error {", " if (axios.isAxiosError(error)) {", " return new Error(error.response?.data?.message || error.message || \"Request failed\");", " }", " return error instanceof Error ? error : new Error(String(error));", "}");
|
|
198
|
-
}
|
|
199
|
-
function testSetup() {
|
|
200
|
-
return lines("import \"@testing-library/jest-dom/vitest\";", "import { cleanup } from \"@testing-library/vue\";", "import { afterEach } from \"vitest\";", "", "afterEach(() => {", " cleanup();", "});");
|
|
201
|
-
}
|
|
202
|
-
function testRender() {
|
|
203
|
-
return lines("import { render } from \"@testing-library/vue\";", "import type { Component } from \"vue\";", "", "export function renderPage(component: Component) {", " return render(component);", "}");
|
|
204
|
-
}
|
|
205
|
-
function appIntegrationTest() {
|
|
206
|
-
return lines("import { screen } from \"@testing-library/vue\";", "import { describe, expect, it } from \"vitest\";", "import App from \"../../src/App.vue\";", "import { renderPage } from \"../render\";", "", "describe(\"scaffold app\", () => {", " it(\"renders the engineering baseline sections\", () => {", " renderPage(App);", "", " expect(screen.getByRole(\"heading\", { level: 1, name: \"Engineering base is ready\" })).toBeInTheDocument();", " expect(screen.getByRole(\"heading\", { level: 2, name: \"utils\" })).toBeInTheDocument();", " expect(screen.getByRole(\"heading\", { level: 2, name: \"storage\" })).toBeInTheDocument();", " expect(screen.getByRole(\"heading\", { level: 2, name: \"service\" })).toBeInTheDocument();", " });", "});");
|
|
207
|
-
}
|
|
208
|
-
function appDesktopE2eTest() {
|
|
209
|
-
return lines("import { expect, test } from \"@playwright/test\";", "", "test(\"desktop smoke renders the scaffold shell\", async ({ page }) => {", " await page.goto(\"/\");", "", " await expect(page.getByRole(\"heading\", { level: 1, name: \"Engineering base is ready\" })).toBeVisible();", " await expect(page.getByRole(\"heading\", { level: 2, name: \"utils\" })).toBeVisible();", " await expect(page.getByRole(\"heading\", { level: 2, name: \"storage\" })).toBeVisible();", " await expect(page.getByRole(\"heading\", { level: 2, name: \"service\" })).toBeVisible();", "});");
|
|
210
|
-
}
|
|
211
|
-
function appMobileE2eTest() {
|
|
212
|
-
return lines("import { expect, test } from \"@playwright/test\";", "", "test(\"mobile smoke keeps scaffold content in the viewport\", async ({ page }) => {", " await page.goto(\"/\");", "", " await expect(page.getByRole(\"heading\", { level: 1, name: \"Engineering base is ready\" })).toBeVisible();", " const documentOverflow = await page.evaluate(() => document.documentElement.scrollWidth > document.documentElement.clientWidth);", " expect(documentOverflow).toBe(false);", "});");
|
|
213
|
-
}
|
|
214
|
-
function escapeHtml(value) {
|
|
215
|
-
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
216
|
-
}
|
|
217
|
-
function json(value) {
|
|
218
|
-
return `${JSON.stringify(value, null, 2)}\n`;
|
|
219
|
-
}
|
|
220
168
|
//# sourceMappingURL=vue-template.js.map
|
|
@@ -1 +1 @@
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AAI;YACpB,MAAM,EAAE,iCAAiC;YACzC,MAAM,EAAE,QAAQ;YAChB,gBAAgB,EAAE,SAAS;YAC3B,4BAA4B,EAAE,IAAI;SACnC;QACD,OAAO,EAAE,CAAC,iBAAiB,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,oBAAoB,CAAC;KACtH,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -18,4 +18,5 @@ export interface ScaffoldResult {
|
|
|
18
18
|
force: boolean;
|
|
19
19
|
files: ScaffoldFileResult[];
|
|
20
20
|
}
|
|
21
|
+
export declare function isScaffoldPresetName(value: string): value is ScaffoldPresetName;
|
|
21
22
|
export declare function scaffoldProject(projectRoot: string, options: ScaffoldOptions): ScaffoldResult;
|
package/dist/runtime/scaffold.js
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { buildVueScaffoldFiles, toPackageName } from "./scaffold/vue-template.js";
|
|
4
|
+
const SCAFFOLD_PRESETS = {
|
|
5
|
+
vue: {
|
|
6
|
+
name: "vue",
|
|
7
|
+
buildFiles: buildVueScaffoldFiles
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
export function isScaffoldPresetName(value) {
|
|
11
|
+
return value in SCAFFOLD_PRESETS;
|
|
12
|
+
}
|
|
4
13
|
export function scaffoldProject(projectRoot, options) {
|
|
5
|
-
|
|
14
|
+
const preset = SCAFFOLD_PRESETS[options.preset];
|
|
15
|
+
if (!preset) {
|
|
6
16
|
throw new Error(`Unsupported scaffold preset: ${options.preset}`);
|
|
7
17
|
}
|
|
8
18
|
if (!options.target.trim()) {
|
|
@@ -29,7 +39,7 @@ export function scaffoldProject(projectRoot, options) {
|
|
|
29
39
|
}
|
|
30
40
|
const projectName = toPackageName(path.basename(targetPath));
|
|
31
41
|
const results = [];
|
|
32
|
-
for (const file of
|
|
42
|
+
for (const file of preset.buildFiles(projectName)) {
|
|
33
43
|
const fullPath = path.join(targetPath, file.path);
|
|
34
44
|
assertSafeScaffoldFilePath(projectRoot, fullPath, file.path);
|
|
35
45
|
const current = fs.existsSync(fullPath) ? fs.readFileSync(fullPath, "utf8") : null;
|
|
@@ -46,7 +56,7 @@ export function scaffoldProject(projectRoot, options) {
|
|
|
46
56
|
}
|
|
47
57
|
return {
|
|
48
58
|
status: options.dryRun ? "dry-run" : "passed",
|
|
49
|
-
preset:
|
|
59
|
+
preset: preset.name,
|
|
50
60
|
target: targetRelative ? targetRelative.split(path.sep).join("/") : ".",
|
|
51
61
|
projectName,
|
|
52
62
|
dryRun: Boolean(options.dryRun),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../src/runtime/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../src/runtime/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAgClF,MAAM,gBAAgB,GAAyD;IAC7E,GAAG,EAAE;QACH,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,qBAAqB;KAClC;CACF,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,KAAa;IAChD,OAAO,KAAK,IAAI,gBAAgB,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,WAAmB,EAAE,OAAwB;IAC3E,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI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,CAAC,CAAC;QACrC,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;YACvB,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const UI_RESTORATION_CONSTRAINTS: ("Treat provider-specific design output such as MCP/Pixso/Figma/MasterGo/Stitch/design_to_code/HTML as source material that must be analyzed before it is used as project code." | "For design-backed UI restoration, visual equivalence to the design source is the highest priority for the first project implementation; source material does not mean the agent may redesign the screen." | "When both design structure data and visual references exist, use design structure data for hierarchy, text, dimensions, tokens, and component boundaries; use visual references for final visual verification." | "Normalize provider-specific design evidence into
|
|
2
|
-
export declare const UI_RESTORATION_CORE_GUIDANCE: readonly ["For ordinary UI implementation, use the planned execution boundary, local component conventions, and user-visible state coverage without adding design-restoration evidence.", "When a real design source is provided,
|
|
1
|
+
export declare const UI_RESTORATION_CONSTRAINTS: ("Treat provider-specific design output such as MCP/Pixso/Figma/MasterGo/Stitch/design_to_code/HTML as source material that must be analyzed before it is used as project code." | "For design-backed UI restoration, visual equivalence to the design source is the highest priority for the first project implementation; source material does not mean the agent may redesign the screen." | "When both design structure data and visual references exist, use design structure data for hierarchy, text, dimensions, tokens, and component boundaries; use visual references for final visual verification." | "Normalize provider-specific design evidence into durable reference artifacts with visual reference, structure tree, style facts, optional generated code, and source metadata before implementation." | "Persist reusable UI reference files such as DST/DSL, provider JSON, screenshots, exported images, HTML, and design_to_code source under .frontend-harness/ so repair loops can re-read the same source material." | "When design_to_code or generated design markup is available, preserve it and classify its usability as usable_as_source, usable_as_visual_baseline, usable_for_patch_reference, or unusable before deciding whether it can drive implementation or repair." | "Use design_to_code as repair-loop evidence and a candidate implementation source: it may be copied into project source only after usability analysis proves it fits the project boundary and conventions." | "Do not classify generated design markup as usable_as_source when design-layer naming, wrapper-heavy structure, placeholder resources, missing localization, or unnatural mount structure still dominate the artifact unless inspection shows those issues are absent or have been removed." | "Classify design images before implementation as required content, functional UI element, brand/product asset, decorative sample, or replaceable placeholder, and preserve only required images as durable assets." | "Normalize generated UI into project components, naming, state, routing, and styling conventions." | "Allow project-native rewrites to change file placement, framework integration, semantic markup, asset localization, naming, state wiring, and component boundaries only when the rendered result preserves the design's primary layout, spacing, typography, color, density, hierarchy, and visible states." | "Split substantial restored screens into page orchestration, typed data fixtures, view configuration, calculations, and focused presentational components." | "Split components by semantic responsibility and reuse boundaries rather than mirroring every design layer as a component." | "Represent mock/domain data with named object fields instead of long positional factory arguments." | "Derive progress, summary values, badges, disabled states, and totals from source data or explicit workflow state instead of duplicating static literals." | "Preserve PRD terminology in visible labels and record stable domain wording in source-linked project knowledge when PRD input is provided." | "Implement expected interactions for the affected workflow, or mark unsupported interactions as explicit assumptions in the handoff evidence." | "Use reusable design tokens for colors, spacing, layout metrics, and status semantics instead of one-off page-only constants." | "Keep design source evidence, persisted UI reference artifact paths, design_to_code usability classification, semantic component mapping, PRD summary, component boundary notes, and visual verification findings as durable project artifacts only when they are grounded in real source material or inspection." | "Document how design nodes or generated markup map to semantic frontend components, including nodes that were merged, ignored, or converted into data-driven configuration." | "Replace visible placeholder labels for icons or visual primitives with real project icons, components, or CSS shapes." | "Preserve accessibility semantics for controls, forms, dialogs, tables, keyboard navigation, focus order, and icon-only actions." | "Keep visible copy, dates, numbers, directionality, and terminology compatible with the project's i18n and localization conventions." | "Use project theme tokens for light/dark mode, status colors, typography, density, and responsive breakpoints instead of one-off visual constants." | "Cross-check visible state consistency across selected steps, progress labels, percentages, bars, badges, disabled states, and summary counts." | "Preserve source and comparison evidence for each substantial projectization step so the loop can repair project code; evidence is not a post-hoc supplement for making verification pass." | "Use the final restoration verdict to decide whether to repair project code; record score, threshold, comparison tool and command, compared viewports, key visual differences, accepted gaps, and design/actual/diff artifacts only after real comparison." | "For complex design-backed screens, preserve viewport-specific screenshots, diff artifacts, and compared-region evidence that prove the main layout regions, controls, data displays, density, colors, typography, and visible states were compared." | "For any design source with multiple functional regions, compare the design screenshot against the actual app at region level: navigation state, content groups, controls, primary actions, data presentation, status indicators, color semantics, and pagination or continuation affordances when present." | "Keep generated build output such as dist/ out of lint and typecheck scopes.")[];
|
|
2
|
+
export declare const UI_RESTORATION_CORE_GUIDANCE: readonly ["For ordinary UI implementation, use the planned execution boundary, local component conventions, and user-visible state coverage without adding design-restoration evidence.", "When a real design source is provided, persist reusable UI reference files under `.frontend-harness/` before coding: DST/DSL or provider JSON, screenshots/exported images, source metadata, and any generated baseline or design_to_code source that may be useful during repair.", "Use source evidence by purpose: DST/DSL or structured design data provides hierarchy, text, tokens, and component-boundary facts; screenshots are the visual acceptance source for rendered appearance and missing visual states; design_to_code is repair-loop evidence and a candidate implementation source that must be classified before use.", "Classify design_to_code as usable_as_source, usable_as_visual_baseline, usable_for_patch_reference, or unusable. If it is design-layer HTML/CSS, mine it for visual facts during repair; if it fits project conventions and boundaries, it may seed implementation. Repair urgency or low visual-comparison scores can raise its repair priority, but not its usability grade.", "During visual repair, design_to_code may become a strong baseline or patch reference. Only treat it as usable_as_source after inspection shows design-layer naming, wrapper-heavy export structure, placeholder resources, and unnatural mount boundaries are absent or have been removed.", "For design-backed restoration, optimize the first implementation for visual equivalence; do not redesign the screen or replace required visual content.", "Use structured design data for hierarchy, text, dimensions, tokens, and component boundaries; use screenshots or images for final visual comparison when design evidence exists.", "Rewrite into project-native components, routing, state, styling, accessibility, and i18n conventions while preserving the planned UI behavior and, when applicable, the design.", "Choose semantic page and component names before coding. Use source node labels, export names, and generated filenames as evidence only, not as the default final code names.", "For restored screens with multiple major regions, keep the page shell thin and split out core semantic regions, but avoid unnecessary wrapper layers or one-component-per-design-layer decomposition.", "Document semantic component mapping, merged or ignored design nodes, required assets, accepted gaps, and unsupported interactions as durable evidence only when grounded in real design source or inspection.", "Use visual-restoration evidence to find and repair UI drift, backed by comparison provenance, viewport coverage, compared regions, design screenshots, actual screenshots, diff artifacts, and artifact hashes that match the actual files; do not treat evidence documents as a substitute for fixing project code.", "Finish ordinary UI work after configured verification and relevant behavior checks; require final visual-restoration checks only when the harness plan asks for it."];
|
|
3
3
|
export declare const UI_RESTORATION_VERIFICATION_FOCUS: readonly ["typecheck", "design source evidence", "semantic component mapping", "visual baseline", "component behavior", "affected interaction smoke", "responsive rendering", "visual restoration when design source is provided"];
|
|
4
|
-
export declare const UI_RESTORATION_GUIDANCE: ("Treat provider-specific design output such as MCP, Pixso, Figma, MasterGo, Stitch, design_to_code, or exported HTML as source material; analyze its usability before copying any of it into project source." | "For design-backed UI restoration, make visual equivalence the highest priority for the first project implementation; source material does not mean you may redesign the screen." | "Prefer DST, DSL, or structured design data for hierarchy, text, dimensions, tokens, and component boundaries; use screenshots or exported images to verify final rendered appearance, alignment, overflow, and visual state." | "Normalize Pixso, Figma, MasterGo, Stitch, screenshot, or HTML evidence into
|
|
4
|
+
export declare const UI_RESTORATION_GUIDANCE: ("Treat provider-specific design output such as MCP, Pixso, Figma, MasterGo, Stitch, design_to_code, or exported HTML as source material; analyze its usability before copying any of it into project source." | "For design-backed UI restoration, make visual equivalence the highest priority for the first project implementation; source material does not mean you may redesign the screen." | "Prefer DST, DSL, or structured design data for hierarchy, text, dimensions, tokens, and component boundaries; use screenshots or exported images to verify final rendered appearance, alignment, overflow, and visual state." | "Normalize Pixso, Figma, MasterGo, Stitch, screenshot, or HTML evidence into provider-neutral design artifacts before implementation." | "Persist reusable UI reference files such as DST/DSL, provider JSON, screenshots, exported images, HTML, and design_to_code source under `.frontend-harness/`; do not leave continuing repair references only in chat, browser state, temporary downloads, or external MCP responses." | "When design_to_code or generated design markup is available, preserve it and classify whether it is usable_as_source, usable_as_visual_baseline, usable_for_patch_reference, or unusable. Base the classification on visual fidelity, project fit, resource completeness, responsive behavior, semantic structure, and whether it is design-layer HTML/CSS rather than maintainable project code. A large visual diff may justify using it more aggressively during repair, but visual repair priority alone does not upgrade usability to usable_as_source." | "Use design_to_code as repair-loop evidence and a candidate implementation source. During visual repair, it may become a strong reference for layout, spacing, color, typography, assets, and hierarchy even when it should not be copied wholesale. Only classify it as usable_as_source when inspection shows it already fits, or has been rewritten to fit, the project boundary, conventions, maintainability needs, and semantic structure; otherwise keep it as usable_as_visual_baseline or usable_for_patch_reference." | "Do not classify generated design markup as usable_as_source while design-layer ids/classes, wrapper-heavy exports, placeholder or unlocalized resources, giant single-file expansion, or unnatural mount structure still dominate the artifact unless inspection shows those issues are absent or have been removed." | "Classify every design image as required content, functional UI element, brand/product asset, decorative sample, or replaceable placeholder; keep required images as durable assets and document replaced samples in the design evidence." | "Preserve the target project's component API, naming, routing, state, style, UI-library, icon, and layout conventions. Choose final page and component names by semantic responsibility or feature meaning, not by raw provider node names, export labels, or generated filenames." | "Project-native rewrites may change file placement, framework integration, semantic markup, asset localization, naming, state wiring, and component boundaries only when the rendered result preserves the design's primary layout, spacing, typography, color, density, hierarchy, and visible states." | "Keep page files thin; move types, data fixtures, view configuration, calculations, and repeated sections into feature modules or focused components. When a restored surface contains multiple major regions, separate page orchestration from at least one or more core semantic region components." | "Split components by semantic responsibility, reuse, and interaction boundary; do not create one component per design layer when a layer is decorative, static, or better represented as data or CSS. Keep mount and wrapper structure natural to the target project instead of introducing generic intermediate app shells unless that structure already exists locally." | "Use named object fixtures for domain rows; avoid long positional factory arguments in generated examples." | "Derive summary values, progress text, percentages, bars, badges, and disabled states from the same source state." | "Preserve PRD terminology in visible labels and capture stable domain wording in project knowledge with source_paths and coverage when PRD input is available." | "Implement or explicitly defer expected interactions for the affected workflow, such as filtering, selection, editing, navigation, dialogs, or bulk actions when applicable." | "Use reusable design tokens for colors, spacing, status colors, and layout metrics instead of page-only literals." | "Keep design source evidence, persisted UI reference artifact paths, design_to_code usability classification, semantic component mapping, PRD summary, component boundary notes, and visual verification screenshots or notes as project artifacts when a design source exists and the findings come from real source material or inspection." | "Document how design nodes or generated markup map to semantic frontend components, including merged, ignored, or data-driven regions." | "Replace visible placeholder labels for icons or visual primitives with real project icons, components, or CSS shapes." | "Use semantic HTML and project UI-library accessibility behavior for controls, forms, dialogs, tables, keyboard navigation, focus order, and icon-only actions." | "Follow project i18n conventions for visible copy, dates, numbers, directionality, and terminology instead of hard-coding locale-specific formatting." | "Use project theme tokens for light/dark mode, status colors, typography, density, and responsive breakpoints instead of page-only constants." | "Verify visible state consistency across selected steps, progress labels, percentages, bars, badges, disabled states, and summary counts." | "Preserve source and comparison evidence for each substantial projectization step so the loop can repair project code; evidence is not a post-hoc supplement for making verification pass." | "Use final visual comparison to decide whether the project code needs repair; record score, threshold, comparison tool and command, compared viewports, key visual differences, accepted gaps, and design/actual/diff artifacts only after real comparison." | "For complex design-backed screens, preserve viewport-specific screenshots, diff artifacts, and compared-region evidence that prove the main layout regions, controls, data displays, density, colors, typography, and visible states were compared." | "For any design source with multiple functional regions, compare the design screenshot against the actual app at region level: navigation state, content groups, controls, primary actions, data presentation, status indicators, color semantics, and pagination or continuation affordances when present." | "Keep generated build output such as dist/ out of lint and typecheck scopes.")[];
|
|
5
5
|
export declare function renderUiImplementationSkillBullets(): string;
|
|
6
6
|
export declare function renderUiRestorationChecklist(): string;
|
|
@@ -17,18 +17,28 @@ const UI_RESTORATION_RULES = [
|
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
section: "Source Material",
|
|
20
|
-
constraint: "Normalize provider-specific design evidence into
|
|
21
|
-
guidance: "Normalize Pixso, Figma, MasterGo, Stitch, screenshot, or HTML evidence into
|
|
20
|
+
constraint: "Normalize provider-specific design evidence into durable reference artifacts with visual reference, structure tree, style facts, optional generated code, and source metadata before implementation.",
|
|
21
|
+
guidance: "Normalize Pixso, Figma, MasterGo, Stitch, screenshot, or HTML evidence into provider-neutral design artifacts before implementation."
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
section: "Source Material",
|
|
25
|
+
constraint: "Persist reusable UI reference files such as DST/DSL, provider JSON, screenshots, exported images, HTML, and design_to_code source under .frontend-harness/ so repair loops can re-read the same source material.",
|
|
26
|
+
guidance: "Persist reusable UI reference files such as DST/DSL, provider JSON, screenshots, exported images, HTML, and design_to_code source under `.frontend-harness/`; do not leave continuing repair references only in chat, browser state, temporary downloads, or external MCP responses."
|
|
22
27
|
},
|
|
23
28
|
{
|
|
24
29
|
section: "Source Material",
|
|
25
30
|
constraint: "When design_to_code or generated design markup is available, preserve it and classify its usability as usable_as_source, usable_as_visual_baseline, usable_for_patch_reference, or unusable before deciding whether it can drive implementation or repair.",
|
|
26
|
-
guidance: "When design_to_code or generated design markup is available, preserve it and classify whether it is usable_as_source, usable_as_visual_baseline, usable_for_patch_reference, or unusable. Base the classification on visual fidelity, project fit, resource completeness, responsive behavior, semantic structure, and whether it is design-layer HTML/CSS rather than maintainable project code."
|
|
31
|
+
guidance: "When design_to_code or generated design markup is available, preserve it and classify whether it is usable_as_source, usable_as_visual_baseline, usable_for_patch_reference, or unusable. Base the classification on visual fidelity, project fit, resource completeness, responsive behavior, semantic structure, and whether it is design-layer HTML/CSS rather than maintainable project code. A large visual diff may justify using it more aggressively during repair, but visual repair priority alone does not upgrade usability to usable_as_source."
|
|
27
32
|
},
|
|
28
33
|
{
|
|
29
34
|
section: "Source Material",
|
|
30
35
|
constraint: "Use design_to_code as repair-loop evidence and a candidate implementation source: it may be copied into project source only after usability analysis proves it fits the project boundary and conventions.",
|
|
31
|
-
guidance: "Use design_to_code as repair-loop evidence and a candidate implementation source.
|
|
36
|
+
guidance: "Use design_to_code as repair-loop evidence and a candidate implementation source. During visual repair, it may become a strong reference for layout, spacing, color, typography, assets, and hierarchy even when it should not be copied wholesale. Only classify it as usable_as_source when inspection shows it already fits, or has been rewritten to fit, the project boundary, conventions, maintainability needs, and semantic structure; otherwise keep it as usable_as_visual_baseline or usable_for_patch_reference."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
section: "Source Material",
|
|
40
|
+
constraint: "Do not classify generated design markup as usable_as_source when design-layer naming, wrapper-heavy structure, placeholder resources, missing localization, or unnatural mount structure still dominate the artifact unless inspection shows those issues are absent or have been removed.",
|
|
41
|
+
guidance: "Do not classify generated design markup as usable_as_source while design-layer ids/classes, wrapper-heavy exports, placeholder or unlocalized resources, giant single-file expansion, or unnatural mount structure still dominate the artifact unless inspection shows those issues are absent or have been removed."
|
|
32
42
|
},
|
|
33
43
|
{
|
|
34
44
|
section: "Source Material",
|
|
@@ -38,7 +48,7 @@ const UI_RESTORATION_RULES = [
|
|
|
38
48
|
{
|
|
39
49
|
section: "Project Conventions",
|
|
40
50
|
constraint: "Normalize generated UI into project components, naming, state, routing, and styling conventions.",
|
|
41
|
-
guidance: "Preserve the target project's component API, naming, routing, state, style, UI-library, icon, and layout conventions."
|
|
51
|
+
guidance: "Preserve the target project's component API, naming, routing, state, style, UI-library, icon, and layout conventions. Choose final page and component names by semantic responsibility or feature meaning, not by raw provider node names, export labels, or generated filenames."
|
|
42
52
|
},
|
|
43
53
|
{
|
|
44
54
|
section: "Project Conventions",
|
|
@@ -48,12 +58,12 @@ const UI_RESTORATION_RULES = [
|
|
|
48
58
|
{
|
|
49
59
|
section: "Source Structure",
|
|
50
60
|
constraint: "Split substantial restored screens into page orchestration, typed data fixtures, view configuration, calculations, and focused presentational components.",
|
|
51
|
-
guidance: "Keep page files thin; move types, data fixtures, view configuration, calculations, and repeated sections into feature modules or focused components."
|
|
61
|
+
guidance: "Keep page files thin; move types, data fixtures, view configuration, calculations, and repeated sections into feature modules or focused components. When a restored surface contains multiple major regions, separate page orchestration from at least one or more core semantic region components."
|
|
52
62
|
},
|
|
53
63
|
{
|
|
54
64
|
section: "Source Structure",
|
|
55
65
|
constraint: "Split components by semantic responsibility and reuse boundaries rather than mirroring every design layer as a component.",
|
|
56
|
-
guidance: "Split components by semantic responsibility, reuse, and interaction boundary; do not create one component per design layer when a layer is decorative, static, or better represented as data or CSS."
|
|
66
|
+
guidance: "Split components by semantic responsibility, reuse, and interaction boundary; do not create one component per design layer when a layer is decorative, static, or better represented as data or CSS. Keep mount and wrapper structure natural to the target project instead of introducing generic intermediate app shells unless that structure already exists locally."
|
|
57
67
|
},
|
|
58
68
|
{
|
|
59
69
|
section: "Source Structure",
|
|
@@ -82,8 +92,8 @@ const UI_RESTORATION_RULES = [
|
|
|
82
92
|
},
|
|
83
93
|
{
|
|
84
94
|
section: "Required Artifacts",
|
|
85
|
-
constraint: "Keep design source evidence, design_to_code usability classification, semantic component mapping, PRD summary, component boundary notes, and visual verification findings as durable project artifacts only when they are grounded in real source material or inspection.",
|
|
86
|
-
guidance: "Keep design source evidence, design_to_code usability classification, semantic component mapping, PRD summary, component boundary notes, and visual verification screenshots or notes as project artifacts when a design source exists and the findings come from real source material or inspection."
|
|
95
|
+
constraint: "Keep design source evidence, persisted UI reference artifact paths, design_to_code usability classification, semantic component mapping, PRD summary, component boundary notes, and visual verification findings as durable project artifacts only when they are grounded in real source material or inspection.",
|
|
96
|
+
guidance: "Keep design source evidence, persisted UI reference artifact paths, design_to_code usability classification, semantic component mapping, PRD summary, component boundary notes, and visual verification screenshots or notes as project artifacts when a design source exists and the findings come from real source material or inspection."
|
|
87
97
|
},
|
|
88
98
|
{
|
|
89
99
|
section: "Required Artifacts",
|
|
@@ -144,12 +154,15 @@ const UI_RESTORATION_RULES = [
|
|
|
144
154
|
export const UI_RESTORATION_CONSTRAINTS = UI_RESTORATION_RULES.map((rule) => rule.constraint);
|
|
145
155
|
export const UI_RESTORATION_CORE_GUIDANCE = [
|
|
146
156
|
"For ordinary UI implementation, use the planned execution boundary, local component conventions, and user-visible state coverage without adding design-restoration evidence.",
|
|
147
|
-
"When a real design source is provided,
|
|
157
|
+
"When a real design source is provided, persist reusable UI reference files under `.frontend-harness/` before coding: DST/DSL or provider JSON, screenshots/exported images, source metadata, and any generated baseline or design_to_code source that may be useful during repair.",
|
|
148
158
|
"Use source evidence by purpose: DST/DSL or structured design data provides hierarchy, text, tokens, and component-boundary facts; screenshots are the visual acceptance source for rendered appearance and missing visual states; design_to_code is repair-loop evidence and a candidate implementation source that must be classified before use.",
|
|
149
|
-
"Classify design_to_code as usable_as_source, usable_as_visual_baseline, usable_for_patch_reference, or unusable. If it is design-layer HTML/CSS, mine it for visual facts during repair; if it fits project conventions and boundaries, it may seed implementation.",
|
|
159
|
+
"Classify design_to_code as usable_as_source, usable_as_visual_baseline, usable_for_patch_reference, or unusable. If it is design-layer HTML/CSS, mine it for visual facts during repair; if it fits project conventions and boundaries, it may seed implementation. Repair urgency or low visual-comparison scores can raise its repair priority, but not its usability grade.",
|
|
160
|
+
"During visual repair, design_to_code may become a strong baseline or patch reference. Only treat it as usable_as_source after inspection shows design-layer naming, wrapper-heavy export structure, placeholder resources, and unnatural mount boundaries are absent or have been removed.",
|
|
150
161
|
"For design-backed restoration, optimize the first implementation for visual equivalence; do not redesign the screen or replace required visual content.",
|
|
151
162
|
"Use structured design data for hierarchy, text, dimensions, tokens, and component boundaries; use screenshots or images for final visual comparison when design evidence exists.",
|
|
152
163
|
"Rewrite into project-native components, routing, state, styling, accessibility, and i18n conventions while preserving the planned UI behavior and, when applicable, the design.",
|
|
164
|
+
"Choose semantic page and component names before coding. Use source node labels, export names, and generated filenames as evidence only, not as the default final code names.",
|
|
165
|
+
"For restored screens with multiple major regions, keep the page shell thin and split out core semantic regions, but avoid unnecessary wrapper layers or one-component-per-design-layer decomposition.",
|
|
153
166
|
"Document semantic component mapping, merged or ignored design nodes, required assets, accepted gaps, and unsupported interactions as durable evidence only when grounded in real design source or inspection.",
|
|
154
167
|
"Use visual-restoration evidence to find and repair UI drift, backed by comparison provenance, viewport coverage, compared regions, design screenshots, actual screenshots, diff artifacts, and artifact hashes that match the actual files; do not treat evidence documents as a substitute for fixing project code.",
|
|
155
168
|
"Finish ordinary UI work after configured verification and relevant behavior checks; require final visual-restoration checks only when the harness plan asks for it."
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-restoration.js","sourceRoot":"","sources":["../../src/runtime/ui-restoration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAk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C,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACxE,CAAC"}
|
package/dist/runtime/verify.js
CHANGED
|
@@ -395,6 +395,7 @@ function validateEvidenceMetadata(projectRoot, entry, label, errors) {
|
|
|
395
395
|
requireMetadataTrue(metadata, "hasVisualReference", label, errors);
|
|
396
396
|
requireMetadataBoolean(metadata, "hasStructureReference", label, errors);
|
|
397
397
|
requireMetadataBoolean(metadata, "hasStyleReference", label, errors);
|
|
398
|
+
requireMetadataArtifactPathArray(metadata, "referenceArtifactPaths", projectRoot, label, errors);
|
|
398
399
|
break;
|
|
399
400
|
case "semantic-map":
|
|
400
401
|
requireMetadataObject(metadata, label, errors);
|
|
@@ -413,7 +414,7 @@ function validateEvidenceMetadata(projectRoot, entry, label, errors) {
|
|
|
413
414
|
case "visual-baseline":
|
|
414
415
|
requireMetadataObject(metadata, label, errors);
|
|
415
416
|
requireMetadataString(metadata, "sourceType", label, errors);
|
|
416
|
-
|
|
417
|
+
requireMetadataArtifactPathArray(metadata, "baselineArtifactPaths", projectRoot, label, errors);
|
|
417
418
|
requireMetadataStringArray(metadata, "viewports", label, errors);
|
|
418
419
|
requireMetadataString(metadata, "preservedAt", label, errors);
|
|
419
420
|
requireDesignToCodeUsability(metadata, label, errors);
|
|
@@ -458,6 +459,9 @@ function requireDesignToCodeUsability(metadata, label, errors) {
|
|
|
458
459
|
}
|
|
459
460
|
requireMetadataStringArray(metadata, "usabilityReasons", label, errors);
|
|
460
461
|
requireMetadataBoolean(metadata, "temporaryAssetsLocalized", label, errors);
|
|
462
|
+
if (usability === "usable_as_source") {
|
|
463
|
+
requireMetadataStringArray(metadata, "sourceReadinessReasons", label, errors);
|
|
464
|
+
}
|
|
461
465
|
}
|
|
462
466
|
function requireMetadataTrue(metadata, key, label, errors) {
|
|
463
467
|
if (!metadata) {
|