推进 INI 面板 launch manifest version schema
This commit is contained in:
68
text12.txt
68
text12.txt
@@ -1273,3 +1273,71 @@ host_wasm_opfs_browser_smokes=ok
|
||||
manifest version 字段(例如 `manifestVersion: 1`),由 focused Node gate、launch browser smoke
|
||||
和 docs gate 共同校验,便于后续外部 shell 做兼容性判断;仍保持只读,不新增控制按钮,不解析
|
||||
G-code。
|
||||
|
||||
十六、2026-06-15 继续执行记录:INI panel launch manifest version schema
|
||||
|
||||
本轮按“第一原则:加快实质性推进”继续推进 SDK/API surface,为 launch API manifest 增加
|
||||
stable schema helper 和 `manifestVersion: 1`,便于外部 shell 在消费 launch methods、entries、
|
||||
target pages、control-page API methods 与 persistence capabilities 前进行兼容性判断。
|
||||
|
||||
完成内容:
|
||||
|
||||
- `wasm-port/runtime/ui/ini-panel/ui-shell.js` 新增 `createIniPanelLaunchApiSchema()`;
|
||||
- `createIniPanelLaunchApiManifest()` 新增 `manifestVersion: 1`;
|
||||
- schema 固定描述:
|
||||
- `apiName`
|
||||
- `manifestVersion`
|
||||
- `fields`
|
||||
- `verify_ini_panel_launch_api_manifest.mjs` 覆盖 schema shape、manifest version 和
|
||||
shell view-model version;
|
||||
- `ini_panel_launch_smoke.html` 在真实 launch iframe 中校验 `manifestVersion`;
|
||||
- `verify_ini_panel_ui_shell.mjs` 覆盖 shell view-model 的 manifest version;
|
||||
- `verify_ini_panel_entry_docs.mjs` 与 `docs/panel-entry.md` 记录并校验
|
||||
`createIniPanelLaunchApiSchema()` 和 `manifestVersion`;
|
||||
- 未新增控制按钮;
|
||||
- 未解析 G-code;
|
||||
- 未解释 canonical events;
|
||||
- 未改变 OPFS/session persistence、LinuxCNC interpreter、tool、parameter、planner 或
|
||||
LinuxCNC-owned runtime semantics。
|
||||
|
||||
验证已通过:
|
||||
|
||||
```bash
|
||||
git diff --check
|
||||
wasm-port/tests/ui/node/verify_ini_panel_launch_api_manifest.sh
|
||||
wasm-port/tests/ui/node/verify_ini_panel_ui_shell.sh
|
||||
wasm-port/tests/ui/node/verify_ini_panel_entry_docs.sh
|
||||
wasm-port/tests/ui/node/verify_ui_node_smokes.sh
|
||||
SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 wasm-port/tests/browser/verify_ini_panel_browser.sh
|
||||
wasm-port/tools/verify_vendor_sync.sh
|
||||
wasm-port/tools/verify_no_standalone_cnc_semantics.sh
|
||||
SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_interp_wasm.sh
|
||||
SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_sim_configs_inventory_wasm.sh
|
||||
wasm-port/tests/host/verify_host_smokes.sh
|
||||
```
|
||||
|
||||
关键输出:
|
||||
|
||||
```text
|
||||
ini_panel_launch_api_manifest_node_smoke=ok
|
||||
ini_panel_ui_shell_node_smoke=ok
|
||||
ini_panel_entry_docs_node_smoke=ok
|
||||
ui_node_smokes=ok
|
||||
browser_ini_opfs_smoke=ok
|
||||
browser_ini_control_page_smoke=ok
|
||||
browser_ini_launch_smoke=ok
|
||||
vendor sync up to date
|
||||
standalone CNC semantics guard complete
|
||||
interp_wasm_node_smoke=ok
|
||||
sim_configs_wasm_node_inventory_executed=28
|
||||
sim_configs_wasm_node_inventory_passed=28
|
||||
sim_configs_wasm_node_inventory_skipped=131
|
||||
sim_configs_wasm_node_inventory_unexpected_fail=0
|
||||
host_wasm_opfs_browser_smokes=ok
|
||||
```
|
||||
|
||||
下一步建议:
|
||||
|
||||
继续推进 browser/UI workflow。下一批建议把 launch manifest 的 schema/version 信息暴露到
|
||||
`linuxCncIniPanelLaunchApi` 的独立 `getLaunchApiSchema()` 方法,并由 browser launch smoke 与
|
||||
focused Node gate 双向校验;仍保持只读,不新增控制按钮,不解析 G-code。
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
INI_PANEL_ENTRIES,
|
||||
createControlPageBrowserApiMethods,
|
||||
createIniPanelLaunchApiManifest,
|
||||
createIniPanelLaunchApiSchema,
|
||||
createIniPanelLauncherLinkViewModel,
|
||||
createIniPanelShellControlPageContract,
|
||||
createIniPanelShellViewModel,
|
||||
@@ -87,6 +88,8 @@ Use `createIniPanelLaunchApiManifest()` or
|
||||
single read-only description of launch methods, visible entries, target pages,
|
||||
the control-page browser API methods, and OPFS/session persistence capabilities
|
||||
for machine files, session snapshots, and read-only status.
|
||||
Use `createIniPanelLaunchApiSchema()` or `manifestVersion` when an outer shell
|
||||
needs to check launch manifest compatibility before consuming these fields.
|
||||
|
||||
The control-page refresh workflow lives in
|
||||
`runtime/ui/ini-panel/control-page-refresh-workflow.js`. Use
|
||||
|
||||
@@ -61,9 +61,27 @@ export function createIniPanelLauncherLinkViewModel(entries = getVisibleIniPanel
|
||||
}));
|
||||
}
|
||||
|
||||
export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntries()) {
|
||||
export function createIniPanelLaunchApiSchema() {
|
||||
return {
|
||||
apiName: "ini-panel-launch",
|
||||
manifestVersion: 1,
|
||||
fields: [
|
||||
"apiName",
|
||||
"manifestVersion",
|
||||
"methods",
|
||||
"visibleEntries",
|
||||
"targetPages",
|
||||
"controlPageApiMethods",
|
||||
"persistenceCapabilities",
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntries()) {
|
||||
const schema = createIniPanelLaunchApiSchema();
|
||||
return {
|
||||
apiName: schema.apiName,
|
||||
manifestVersion: schema.manifestVersion,
|
||||
methods: [
|
||||
"getLaunchApiManifest",
|
||||
"getLauncherLinks",
|
||||
|
||||
@@ -74,6 +74,11 @@
|
||||
"ini-panel-launch",
|
||||
"launch API manifest name",
|
||||
);
|
||||
assertEqual(
|
||||
launchApiManifest.manifestVersion,
|
||||
1,
|
||||
"launch API manifest version",
|
||||
);
|
||||
assertEqual(
|
||||
launchApiManifest.methods.join(","),
|
||||
"getLaunchApiManifest,getLauncherLinks,getControlPageApiMethods",
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
createControlPageSessionLoadState,
|
||||
createControlPageBrowserApiMethods,
|
||||
createIniPanelLaunchApiManifest,
|
||||
createIniPanelLaunchApiSchema,
|
||||
createIniPanelLauncherLinkViewModel,
|
||||
createIniPanelShellControlPageContract,
|
||||
createIniPanelShellViewModel,
|
||||
@@ -41,6 +42,7 @@ const requiredShellExports = [
|
||||
"createControlPageBrowserApiMethods",
|
||||
"createControlPageSessionLoadState",
|
||||
"createIniPanelLaunchApiManifest",
|
||||
"createIniPanelLaunchApiSchema",
|
||||
"createIniPanelLauncherLinkViewModel",
|
||||
"createIniPanelShellControlPageContract",
|
||||
"createIniPanelShellViewModel",
|
||||
@@ -99,6 +101,7 @@ assert.deepEqual(
|
||||
assert.deepEqual(createIniPanelShellViewModel().pages, getVisibleIniPanelEntries());
|
||||
assert.deepEqual(createIniPanelShellViewModel().launcherLinks, createIniPanelLauncherLinkViewModel());
|
||||
assert.deepEqual(createIniPanelShellViewModel().launchApiManifest, createIniPanelLaunchApiManifest());
|
||||
assert.equal(createIniPanelShellViewModel().launchApiManifest.manifestVersion, createIniPanelLaunchApiSchema().manifestVersion);
|
||||
assert.deepEqual(
|
||||
createIniPanelShellViewModel().controlPage.contract,
|
||||
createIniPanelShellControlPageContract(),
|
||||
@@ -131,6 +134,7 @@ assert.equal(createIniPanelShellViewModel().controlPage.readStatus, readMachineS
|
||||
assert.equal(createIniPanelShellViewModel().controlPage.refresh, refreshMachineSessionControlPage);
|
||||
assert.equal(typeof createIniPanelShellViewModel().controlPage.renderView, "function");
|
||||
assert.match(shellText, /\bexport function createControlPageBrowserApiMethods\b/);
|
||||
assert.match(shellText, /\bexport function createIniPanelLaunchApiSchema\b/);
|
||||
assert.match(shellText, /\bexport function createIniPanelLaunchApiManifest\b/);
|
||||
assert.match(controlPageText, /\bgetControlPageApiMethods\b/);
|
||||
assert.match(launchText, /\blinuxCncIniPanelLaunchApi\b/);
|
||||
@@ -143,6 +147,7 @@ assert.match(docText, /\blinuxCncIniPanelControlPageApi\.getControlPageApiMethod
|
||||
assert.match(docText, /\blinuxCncIniPanelControlPageApi\.getControlPageContract\b/);
|
||||
assert.match(docText, /\blinuxCncIniPanelControlPageApi\.readControlPageStatus\b/);
|
||||
assert.match(docText, /\bcreateIniPanelLaunchApiManifest\b/);
|
||||
assert.match(docText, /\bcreateIniPanelLaunchApiSchema\b/);
|
||||
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getLaunchApiManifest\b/);
|
||||
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getControlPageApiMethods\b/);
|
||||
assert.match(docText, /\bOPFS\/session persistence capabilities\b/);
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
INI_PANEL_ENTRIES,
|
||||
createControlPageBrowserApiMethods,
|
||||
createIniPanelLaunchApiManifest,
|
||||
createIniPanelLaunchApiSchema,
|
||||
createIniPanelShellViewModel,
|
||||
getVisibleIniPanelEntries,
|
||||
} from "../../../runtime/ui/ini-panel/ui-shell.js";
|
||||
@@ -17,9 +18,25 @@ const launchText = readFileSync(resolve(root, "runtime/ui/ini-panel/launch.html"
|
||||
const shellText = readFileSync(resolve(root, "runtime/ui/ini-panel/ui-shell.js"), "utf8");
|
||||
|
||||
const manifest = createIniPanelLaunchApiManifest();
|
||||
const schema = createIniPanelLaunchApiSchema();
|
||||
|
||||
assert.deepEqual(schema, {
|
||||
apiName: "ini-panel-launch",
|
||||
manifestVersion: 1,
|
||||
fields: [
|
||||
"apiName",
|
||||
"manifestVersion",
|
||||
"methods",
|
||||
"visibleEntries",
|
||||
"targetPages",
|
||||
"controlPageApiMethods",
|
||||
"persistenceCapabilities",
|
||||
],
|
||||
});
|
||||
|
||||
assert.deepEqual(manifest, {
|
||||
apiName: "ini-panel-launch",
|
||||
manifestVersion: 1,
|
||||
methods: [
|
||||
"getLaunchApiManifest",
|
||||
"getLauncherLinks",
|
||||
@@ -68,6 +85,7 @@ assert.deepEqual(manifest, {
|
||||
});
|
||||
|
||||
assert.deepEqual(createIniPanelShellViewModel().launchApiManifest, manifest);
|
||||
assert.equal(createIniPanelShellViewModel().launchApiManifest.manifestVersion, schema.manifestVersion);
|
||||
assert.deepEqual(getVisibleIniPanelEntries(), INI_PANEL_ENTRIES);
|
||||
|
||||
manifest.visibleEntries[0].title = "changed";
|
||||
@@ -101,6 +119,7 @@ assert.deepEqual(customManifest.targetPages, [
|
||||
]);
|
||||
|
||||
assert.match(shellText, /\bexport function createIniPanelLaunchApiManifest\b/);
|
||||
assert.match(shellText, /\bexport function createIniPanelLaunchApiSchema\b/);
|
||||
assert.match(launchText, /\bgetLaunchApiManifest\b/);
|
||||
assert.match(launchText, /\blinuxCncIniPanelLaunchApi\b/);
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
controlPageStatusText,
|
||||
createControlPageBrowserApiMethods,
|
||||
createIniPanelLaunchApiManifest,
|
||||
createIniPanelLaunchApiSchema,
|
||||
createIniPanelLauncherLinkViewModel,
|
||||
createIniPanelShellControlPageContract,
|
||||
createIniPanelShellViewModel,
|
||||
@@ -48,6 +49,7 @@ assert.equal(typeof createMachineSessionReadonlyStatus, "function");
|
||||
assert.equal(typeof createMachineSessionReadonlyStatusApiManifest, "function");
|
||||
assert.equal(typeof createControlPageBrowserApiMethods, "function");
|
||||
assert.equal(typeof createIniPanelLaunchApiManifest, "function");
|
||||
assert.equal(typeof createIniPanelLaunchApiSchema, "function");
|
||||
assert.equal(typeof createIniPanelShellControlPageContract, "function");
|
||||
assert.equal(typeof loadMachineSessionForControlPageWorkflow, "function");
|
||||
assert.equal(typeof readMachineSessionReadonlyStatus, "function");
|
||||
@@ -90,6 +92,7 @@ assert.deepEqual(shellViewModel.pages, [
|
||||
]);
|
||||
assert.deepEqual(shellViewModel.launcherLinks, createIniPanelLauncherLinkViewModel());
|
||||
assert.deepEqual(shellViewModel.launchApiManifest, createIniPanelLaunchApiManifest());
|
||||
assert.equal(shellViewModel.launchApiManifest.manifestVersion, createIniPanelLaunchApiSchema().manifestVersion);
|
||||
assert.deepEqual(shellViewModel.controlPage.browserApiMethods, createControlPageBrowserApiMethods());
|
||||
assert.equal(shellViewModel.controlPage.createController, createMachineSessionControlPageController);
|
||||
assert.deepEqual(shellViewModel.controlPage.contract, createIniPanelShellControlPageContract());
|
||||
|
||||
Reference in New Issue
Block a user