Skip to content

Commit 86c9d41

Browse files
author
DavidQ
committed
Rename first-class tool template to V2 and update references - PR_26126_070-tool-template-v2-rename
1 parent 762bc72 commit 86c9d41

46 files changed

Lines changed: 222 additions & 136 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/design/tools/TOOLS_REENGINEERING_INDEX.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This index lists the remaining rebuild anchors, schema baseline, and support fol
2727
| `codex` | `tools/codex` | support folder | reference-only | none | reference only; no normal rebuild doc |
2828
| `dev` | `tools/dev` | support folder | reference-only | none | reference only; no normal rebuild doc |
2929
| `shared` | `tools/shared` | support folder | reference-only | none | reference only; no normal rebuild doc |
30-
| `templates` | `tools/templates` | support folder | reference-only | none | reference only; no normal rebuild doc |
30+
| `templates-v2` | `tools/templates-v2` | support folder | reference-only | none | reference only; no normal rebuild doc |
3131

3232
## Classification Definitions
3333
- `global tool`: a launchable global surface. Palette Manager V2 is the only core rebuild anchor in this group.

docs/dev/PROJECT_INSTRUCTIONS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,3 +656,15 @@ New first-class tools must include registry, index, and NAV wiring where applica
656656
New first-class tools must include Playwright launch coverage.
657657

658658
Tool registration must not rely on hidden defaults or silent fallback.
659+
660+
## TOOL TEMPLATE V2 LOCATION
661+
662+
The official First-Class Tool V2 starter is:
663+
664+
`tools/templates-v2/`
665+
666+
Use the V2 naming consistently:
667+
- Tool Template V2
668+
- First-Class Tool Starter V2
669+
- First-Class Tools Surface V2
670+
- First-Class Tool V2

docs/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ Note: coverage entries are aggregated across every page/tool where coverageRepor
1313
Exercised tool entry points detected:
1414
(84%) Preview Generator V2 - exercised 19 runtime JS files
1515
(49%) Palette Manager - exercised 12 runtime JS files
16-
(84%) First-Class Tool Starter Template - exercised 10 runtime JS files
16+
(84%) Tool Template V2 - exercised 10 runtime JS files
1717
(0%) Workspace V2 - not exercised by this Playwright run
1818
(0%) Workspace Manager - not exercised by this Playwright run
1919

2020
Changed runtime JS files covered:
21-
(100%) none changed - no changed runtime JS files
21+
(0%) tools/shared/vectorNativeTemplate.js - not covered
22+
(0%) tools/shared/vectorTemplateSampleGame.js - not covered
2223

2324
Files with executed line/function counts where available:
2425
(2%) src/engine/input/ActionInputService.js - executed lines 397/397; executed functions 1/51
@@ -85,7 +86,7 @@ Files with executed line/function counts where available:
8586
(50%) tools/common/PaletteUsageService.js - executed lines 5/5; executed functions 1/2
8687
(50%) tools/palette-manager-v2/main.js - executed lines 88/88; executed functions 3/6
8788
(50%) tools/palette-manager-v2/modules/PaletteHistoryStack.js - executed lines 54/54; executed functions 5/10
88-
(50%) tools/templates/first-class-tool-starter/js/ToolStarterApp.js - executed lines 98/98; executed functions 8/16
89+
(50%) tools/templates-v2/js/ToolStarterApp.js - executed lines 98/98; executed functions 8/16
8990
(50%) tools/toolRegistry.js - executed lines 425/425; executed functions 4/8
9091
(55%) tools/palette-manager-v2/modules/SwatchRow.js - executed lines 115/115; executed functions 6/11
9192
(56%) src/engine/logging/Logger.js - executed lines 56/56; executed functions 5/9
@@ -108,10 +109,10 @@ Files with executed line/function counts where available:
108109
(80%) src/engine/theme/accordionV2/accordionV2.js - executed lines 26/26; executed functions 4/5
109110
(81%) tools/preview-generator-v2/PreviewGeneratorV2App.js - executed lines 539/539; executed functions 47/58
110111
(82%) samples/shared/sampleDetailPageEnhancement.js - executed lines 471/471; executed functions 41/50
111-
(86%) tools/templates/first-class-tool-starter/js/controls/StatusLogControl.js - executed lines 21/21; executed functions 6/7
112+
(86%) tools/templates-v2/js/controls/StatusLogControl.js - executed lines 21/21; executed functions 6/7
112113
(87%) tools/common/PaletteSortService.js - executed lines 103/103; executed functions 13/15
113-
(88%) tools/templates/first-class-tool-starter/js/controls/SourceInputControl.js - executed lines 33/33; executed functions 7/8
114-
(92%) tools/templates/first-class-tool-starter/js/controls/ToolStarterShellControl.js - executed lines 111/111; executed functions 11/12
114+
(88%) tools/templates-v2/js/controls/SourceInputControl.js - executed lines 33/33; executed functions 7/8
115+
(92%) tools/templates-v2/js/controls/ToolStarterShellControl.js - executed lines 111/111; executed functions 11/12
115116
(100%) samples/phase-01/0102/main.js - executed lines 23/23; executed functions 1/1
116117
(100%) samples/shared/numberUtils.js - executed lines 7/7; executed functions 1/1
117118
(100%) src/engine/audio/index.js - executed lines 15/15; executed functions 1/1
@@ -146,16 +147,21 @@ Files with executed line/function counts where available:
146147
(100%) tools/preview-generator-v2/PreviewGeneratorV2Logger.js - executed lines 19/19; executed functions 5/5
147148
(100%) tools/preview-generator-v2/PreviewGeneratorV2RepoAccess.js - executed lines 21/21; executed functions 5/5
148149
(100%) tools/preview-generator-v2/PreviewGeneratorV2Ui.js - executed lines 48/48; executed functions 9/9
149-
(100%) tools/templates/first-class-tool-starter/js/bootstrap.js - executed lines 48/48; executed functions 4/4
150-
(100%) tools/templates/first-class-tool-starter/js/controls/AccordionSection.js - executed lines 27/27; executed functions 5/5
151-
(100%) tools/templates/first-class-tool-starter/js/controls/ActionNavControl.js - executed lines 51/51; executed functions 5/5
152-
(100%) tools/templates/first-class-tool-starter/js/controls/InspectorControl.js - executed lines 8/8; executed functions 3/3
153-
(100%) tools/templates/first-class-tool-starter/js/controls/PreviewPanelControl.js - executed lines 23/23; executed functions 5/5
154-
(100%) tools/templates/first-class-tool-starter/js/services/ToolStateSerializer.js - executed lines 13/13; executed functions 3/3
150+
(100%) tools/templates-v2/js/bootstrap.js - executed lines 48/48; executed functions 4/4
151+
(100%) tools/templates-v2/js/controls/AccordionSection.js - executed lines 27/27; executed functions 5/5
152+
(100%) tools/templates-v2/js/controls/ActionNavControl.js - executed lines 51/51; executed functions 5/5
153+
(100%) tools/templates-v2/js/controls/InspectorControl.js - executed lines 8/8; executed functions 3/3
154+
(100%) tools/templates-v2/js/controls/PreviewPanelControl.js - executed lines 23/23; executed functions 5/5
155+
(100%) tools/templates-v2/js/services/ToolStateSerializer.js - executed lines 13/13; executed functions 3/3
155156

156157
Uncovered or low-coverage changed JS files:
157-
(100%) none changed - no changed runtime JS files
158+
(0%) tools/shared/vectorNativeTemplate.js - uncovered
159+
(0%) tools/shared/vectorTemplateSampleGame.js - uncovered
158160

159161
Changed JS files considered:
162+
(0%) tests/helpers/playwrightV8CoverageReporter.mjs - changed JS file not collected as browser runtime coverage
160163
(0%) tests/playwright/PreviewGeneratorV2Baseline.spec.mjs - changed JS file not collected as browser runtime coverage
161-
(0%) tools/templates/first-class-tool-starter/tests/playwright/FirstClassToolStarter.spec.mjs - changed JS file not collected as browser runtime coverage
164+
(0%) tests/tools/RuntimeAssetLookupConsolidation.test.mjs - changed JS file not collected as browser runtime coverage
165+
(0%) tests/tools/VectorNativeTemplate.test.mjs - changed JS file not collected as browser runtime coverage
166+
(0%) tools/shared/vectorNativeTemplate.js - changed JS file not collected as browser runtime coverage
167+
(0%) tools/shared/vectorTemplateSampleGame.js - changed JS file not collected as browser runtime coverage
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
PR_26126_070-tool-template-v2-rename
2+
3+
Scope:
4+
- Renamed the active template surface from tools/templates to tools/templates-v2.
5+
- Made tools/templates-v2/index.html the launchable Tool Template V2 entry point.
6+
- Moved support template folders under tools/templates-v2:
7+
- starter-project-template
8+
- vector-native-arcade
9+
- Updated active code, tests, and validation references that pointed at tools/templates.
10+
- No live tool folders, samples, schemas, start_of_day folders, or roadmap files were modified.
11+
12+
Changes:
13+
- Removed the old tools/templates active folder surface.
14+
- Standardized visible/template wording to:
15+
- First-Class Tool Starter V2
16+
- First-Class Tools Surface V2
17+
- Tool Template V2
18+
- First-Class Tool V2
19+
- Updated Tool Template V2 root links to use src/engine/theme from its new depth.
20+
- Updated Tool Template V2 tool id to tool-template-v2.
21+
- Updated Tool Template V2 README and control/service contract docs.
22+
- Added Tool Template V2 location/naming guidance to docs/dev/PROJECT_INSTRUCTIONS.md.
23+
- Updated Playwright launch and coverage references from tools/templates/first-class-tool-starter to tools/templates-v2.
24+
- Updated vector-native and starter-project support paths to tools/templates-v2.
25+
- Updated the starter project validation script to use tools/templates-v2 and to resolve physical paths before optional fragment identifiers.
26+
- Updated the vector arcade sample README path reference to tools/templates-v2.
27+
28+
Validation:
29+
- node --check tools/templates-v2/js/controls/ToolStarterShellControl.js
30+
- node --check tools/templates-v2/js/bootstrap.js
31+
- node --check tests/playwright/PreviewGeneratorV2Baseline.spec.mjs
32+
- node --check tests/helpers/playwrightV8CoverageReporter.mjs
33+
- node --check tools/shared/vectorNativeTemplate.js
34+
- node --check tools/shared/vectorTemplateSampleGame.js
35+
- node --check tools/templates-v2/tests/playwright/FirstClassToolStarter.spec.mjs
36+
- node --check scripts/validate-starter-project-template.mjs
37+
- node --test tests/tools/VectorNativeTemplate.test.mjs tests/tools/RuntimeAssetLookupConsolidation.test.mjs
38+
- node scripts/validate-starter-project-template.mjs
39+
- rg check confirmed tools/templates-v2/index.html has no inline style block, inline script block, or inline event handlers.
40+
- rg check confirmed active scripts, games README, tools, tests, docs/design index, and docs/dev/PROJECT_INSTRUCTIONS.md have no stale tools/templates path references.
41+
- git diff --check
42+
- npm run test:workspace-v2
43+
- npx playwright test --config tools/templates-v2/playwright.config.mjs --reporter=list
44+
45+
Playwright impacted: Yes
46+
- This PR changes the launch path and visible identity for the Tool Template V2 surface.
47+
- npm run test:workspace-v2 passed.
48+
- Template-local Playwright passed.
49+
50+
Playwright behavior validated:
51+
- tools/templates-v2/index.html launches.
52+
- tools/templates-v2/index.html?launch=workspace launches.
53+
- Default launch mode still shows tool NAV only.
54+
- Workspace launch mode still shows workspace NAV only.
55+
- Tool Template V2 uses src/engine/theme and has no tools/shared runtime dependency.
56+
- Existing accordions, panel role placement, primary action state, failure state, and status clear behavior still work.
57+
58+
Old reference handling:
59+
- No active tools/templates folder remains.
60+
- No compatibility redirect folder was created.
61+
- Active code/test/reference paths were updated to tools/templates-v2.
62+
- Remaining old tools/templates references found outside active scope are historical roadmap, archived PR/report, move-history, or prior-run report records. They were intentionally not rewritten because this PR forbids roadmap changes and those files document historical state rather than active launch paths.
63+
64+
Manual test notes:
65+
- Open tools/templates-v2/index.html and confirm First-Class Tool Starter V2 / First-Class Tools Surface V2 displays.
66+
- Confirm only the tool NAV is visible by default.
67+
- Open tools/templates-v2/index.html?launch=workspace and confirm only the workspace NAV is visible.
68+
- Confirm Status remains at the bottom of the right panel and still clears.
69+
70+
Full samples smoke test:
71+
- Skipped. This PR only renames the template surface and updates targeted path references/tests.

games/vector-arcade-sample/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Vector Arcade Sample
22

3-
This sample game is built from `tools/templates/vector-native-arcade/`.
3+
This sample game is built from `tools/templates-v2/vector-native-arcade/`.
44

55
## Baseline
66

scripts/validate-starter-project-template.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const __filename = fileURLToPath(import.meta.url);
1313
const __dirname = path.dirname(__filename);
1414
const repoRoot = path.resolve(__dirname, "..");
1515

16-
const TEMPLATE_MANIFEST_PATH = "tools/templates/starter-project-template/config/starter.project.json";
16+
const TEMPLATE_MANIFEST_PATH = "tools/templates-v2/starter-project-template/config/starter.project.json";
1717
const REPORT_PATH = "docs/dev/reports/starter_project_template_validation.txt";
1818

1919
function assert(condition, message, issues) {
@@ -23,8 +23,9 @@ function assert(condition, message, issues) {
2323
}
2424

2525
async function pathExists(repoRelativePath) {
26+
const physicalPath = repoRelativePath.split("#")[0];
2627
try {
27-
await fs.access(path.join(repoRoot, repoRelativePath));
28+
await fs.access(path.join(repoRoot, physicalPath));
2829
return true;
2930
} catch {
3031
return false;

tests/helpers/playwrightV8CoverageReporter.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { execFileSync } from "node:child_process";
2+
import { existsSync } from "node:fs";
23
import fs from "node:fs/promises";
34
import path from "node:path";
45

@@ -221,6 +222,7 @@ export class PlaywrightV8CoverageReporter {
221222
.filter(Boolean)
222223
.map((line) => this.pathFromStatusLine(line))
223224
.filter(Boolean)
225+
.filter((filePath) => existsSync(path.resolve(this.repoRoot, filePath)))
224226
.filter((filePath) => filePath.endsWith(".js") || filePath.endsWith(".mjs"))
225227
.sort((left, right) => left.localeCompare(right));
226228
}
@@ -280,7 +282,7 @@ export class PlaywrightV8CoverageReporter {
280282
const toolEntryPoints = [
281283
{ name: "Preview Generator V2", prefix: "tools/preview-generator-v2/" },
282284
{ name: "Palette Manager", prefix: "tools/palette-manager-v2/" },
283-
{ name: "First-Class Tool Starter Template", prefix: "tools/templates/first-class-tool-starter/" },
285+
{ name: "Tool Template V2", prefix: "tools/templates-v2/" },
284286
{ name: "Workspace V2", prefix: "tools/workspace-v2/" },
285287
{ name: "Workspace Manager", prefix: "tools/workspace-manager/" }
286288
];

tests/playwright/PreviewGeneratorV2Baseline.spec.mjs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ async function openPaletteManager(page) {
123123
async function openToolTemplate(page, query = "") {
124124
const server = await startRepoServer();
125125
await coverageReporter.start(page);
126-
await page.goto(`${server.baseUrl}/tools/templates/first-class-tool-starter/index.html${query}`, { waitUntil: "networkidle" });
126+
await page.goto(`${server.baseUrl}/tools/templates-v2/index.html${query}`, { waitUntil: "networkidle" });
127127
return server;
128128
}
129129

@@ -451,7 +451,7 @@ test.describe("Preview Generator V2 baseline", () => {
451451
}
452452
});
453453

454-
test("launches first-class tool starter template with runtime-valid controls", async ({ page }) => {
454+
test("launches Tool Template V2 with runtime-valid controls", async ({ page }) => {
455455
const server = await openToolTemplate(page);
456456
const pageErrors = [];
457457

@@ -460,11 +460,12 @@ test.describe("Preview Generator V2 baseline", () => {
460460
});
461461

462462
try {
463-
await expect(page.locator("body.tools-platform-tool-page[data-tool-id='first-class-tool-starter']")).toBeVisible();
464-
await expect(page.locator('link[href="../../../src/engine/theme/main.css"]')).toHaveCount(1);
465-
await expect(page.locator('link[href="../../../src/engine/theme/accordionV2/accordionV2.css"]')).toHaveCount(1);
463+
await expect(page.locator("body.tools-platform-tool-page[data-tool-id='tool-template-v2']")).toBeVisible();
464+
await expect(page.locator('link[href="../../src/engine/theme/main.css"]')).toHaveCount(1);
465+
await expect(page.locator('link[href="../../src/engine/theme/accordionV2/accordionV2.css"]')).toHaveCount(1);
466466
await expect(page.locator("#shared-theme-header")).toBeAttached();
467-
await expect(page.locator("[data-tool-starter-header]")).toContainText("First-Class Tool Starter");
467+
await expect(page.locator("[data-tool-starter-header]")).toContainText("First-Class Tool Starter V2");
468+
await expect(page.locator("[data-tool-starter-header]")).toContainText("First-Class Tools Surface V2");
468469
await expect(page.locator("[data-tool-starter-summary]")).toHaveAttribute("data-tools-platform-summary-active", "1");
469470
await expect(page.locator(".tool-starter__tool__menu")).toBeVisible();
470471
await expect(page.locator(".tool-starter__tool__menu")).toHaveAttribute("aria-label", "Tool actions");
@@ -526,7 +527,7 @@ test.describe("Preview Generator V2 baseline", () => {
526527
}
527528
});
528529

529-
test("launches first-class tool starter template in workspace nav mode", async ({ page }) => {
530+
test("launches Tool Template V2 in workspace nav mode", async ({ page }) => {
530531
const server = await openToolTemplate(page, "?launch=workspace");
531532
const pageErrors = [];
532533

tests/tools/RuntimeAssetLookupConsolidation.test.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ export async function run() {
5252
gameId: "TemplateGame",
5353
runtimeAssetSources: {
5454
"vector.template.player": {
55-
file: "tools/templates/vector-native-arcade/assets/data/vectors/template-player.vector.json",
56-
path: "tools/templates/vector-native-arcade/assets/data/vectors/template-player.vector.json",
55+
file: "tools/templates-v2/vector-native-arcade/assets/data/vectors/template-player.vector.json",
56+
path: "tools/templates-v2/vector-native-arcade/assets/data/vectors/template-player.vector.json",
5757
kind: "vector"
5858
}
5959
},
6060
missingBindingBehavior: "static"
6161
});
6262

6363
const fallbackResolved = fallbackLookup.resolvePackagedAsset({ id: "vector.template.player", type: "vector" });
64-
assert.equal(fallbackResolved.file, "tools/templates/vector-native-arcade/assets/data/vectors/template-player.vector.json");
64+
assert.equal(fallbackResolved.file, "tools/templates-v2/vector-native-arcade/assets/data/vectors/template-player.vector.json");
6565
assert.equal(fallbackLookup.binding.domains.vectors.length, 0);
6666
assert.equal(fallbackLookup.getErrors().some((entry) => entry.code === "RUNTIME_BINDING_REJECTED"), true);
6767
const fallbackDebug = fallbackLookup.getDebugState();

tests/tools/VectorNativeTemplate.test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { buildVectorNativeTemplate, createVectorNativeTemplateDefinition, summar
33

44
export async function run() {
55
const definition = createVectorNativeTemplateDefinition();
6-
assert.equal(definition.templatePath, "tools/templates/vector-native-arcade/");
6+
assert.equal(definition.templatePath, "tools/templates-v2/vector-native-arcade/");
77
assert.equal(definition.registry.sprites.length, 0);
88
assert.equal(definition.registry.vectors.length, 5);
99

0 commit comments

Comments
 (0)