推进 INI 面板 shell integration manifest
This commit is contained in:
@@ -17,6 +17,8 @@ import {
|
||||
createIniPanelLaunchApiSchema,
|
||||
createIniPanelLauncherLinkViewModel,
|
||||
createIniPanelShellControlPageContract,
|
||||
createIniPanelShellIntegrationManifest,
|
||||
createIniPanelShellIntegrationSchema,
|
||||
createIniPanelShellViewModel,
|
||||
getIniPanelEntryByHref,
|
||||
getVisibleIniPanelEntries,
|
||||
@@ -31,6 +33,7 @@ import {
|
||||
renderMachineSessionControlView,
|
||||
isSupportedIniPanelControlPageApiManifest,
|
||||
isSupportedIniPanelLaunchApiManifest,
|
||||
isSupportedIniPanelShellIntegrationManifest,
|
||||
} from "../runtime/ui/ini-panel/ui-shell.js";
|
||||
```
|
||||
|
||||
@@ -107,6 +110,14 @@ fields.
|
||||
Use `isSupportedIniPanelLaunchApiManifest()` or
|
||||
`linuxCncIniPanelLaunchApi.isSupportedLaunchApiManifest()` for a read-only
|
||||
compatibility predicate before using a launch manifest.
|
||||
Use `createIniPanelShellIntegrationSchema()`,
|
||||
`createIniPanelShellIntegrationManifest()`,
|
||||
`linuxCncIniPanelLaunchApi.getShellIntegrationSchema()`, or
|
||||
`linuxCncIniPanelLaunchApi.getShellIntegrationManifest()` when an outer shell
|
||||
needs one versioned read of pages, launcher links, launch API metadata,
|
||||
control-page API metadata, OPFS/session persistence capabilities, and current
|
||||
compatibility status. Use `isSupportedIniPanelShellIntegrationManifest()` when
|
||||
the outer shell needs to check that integration manifest before consuming it.
|
||||
|
||||
The control-page refresh workflow lives in
|
||||
`runtime/ui/ini-panel/control-page-refresh-workflow.js`. Use
|
||||
|
||||
@@ -94,6 +94,8 @@
|
||||
isSupportedLaunchApiManifest: isSupportedIniPanelLaunchApiManifest,
|
||||
getLaunchApiSchema: () => shellViewModel.launchApiSchema,
|
||||
getLaunchApiManifest: () => shellViewModel.launchApiManifest,
|
||||
getShellIntegrationSchema: () => shellViewModel.shellIntegrationSchema,
|
||||
getShellIntegrationManifest: () => shellViewModel.shellIntegrationManifest,
|
||||
getLauncherLinks: () => shellViewModel.launcherLinks,
|
||||
getControlPageApiMethods: () => shellViewModel.controlPage.browserApiMethods,
|
||||
};
|
||||
|
||||
@@ -123,6 +123,8 @@ export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntr
|
||||
"isSupportedLaunchApiManifest",
|
||||
"getLaunchApiSchema",
|
||||
"getLaunchApiManifest",
|
||||
"getShellIntegrationSchema",
|
||||
"getShellIntegrationManifest",
|
||||
"getLauncherLinks",
|
||||
"getControlPageApiMethods",
|
||||
],
|
||||
@@ -201,6 +203,68 @@ export function createControlPageBrowserApiManifest() {
|
||||
};
|
||||
}
|
||||
|
||||
export function createIniPanelShellIntegrationSchema() {
|
||||
return {
|
||||
apiName: "ini-panel-shell-integration",
|
||||
manifestVersion: 1,
|
||||
fields: [
|
||||
"apiName",
|
||||
"manifestVersion",
|
||||
"pages",
|
||||
"launcherLinks",
|
||||
"launchApiSchema",
|
||||
"launchApiManifest",
|
||||
"controlPageApiSchema",
|
||||
"controlPageApiManifest",
|
||||
"compatibility",
|
||||
"persistenceCapabilities",
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
export function isSupportedIniPanelShellIntegrationManifest(
|
||||
manifest,
|
||||
schema = createIniPanelShellIntegrationSchema(),
|
||||
) {
|
||||
if (!manifest || typeof manifest !== "object") {
|
||||
return false;
|
||||
}
|
||||
if (manifest.apiName !== schema.apiName || manifest.manifestVersion !== schema.manifestVersion) {
|
||||
return false;
|
||||
}
|
||||
return schema.fields.every((fieldName) => Object.hasOwn(manifest, fieldName));
|
||||
}
|
||||
|
||||
export function createIniPanelShellIntegrationManifest(entries = getVisibleIniPanelEntries()) {
|
||||
const schema = createIniPanelShellIntegrationSchema();
|
||||
const launchApiSchema = createIniPanelLaunchApiSchema();
|
||||
const launchApiManifest = createIniPanelLaunchApiManifest(entries);
|
||||
const controlPageApiSchema = createControlPageBrowserApiSchema();
|
||||
const controlPageApiManifest = createControlPageBrowserApiManifest();
|
||||
return {
|
||||
apiName: schema.apiName,
|
||||
manifestVersion: schema.manifestVersion,
|
||||
pages: entries.map(({ id, href, title }) => ({
|
||||
id,
|
||||
href,
|
||||
title,
|
||||
})),
|
||||
launcherLinks: createIniPanelLauncherLinkViewModel(entries),
|
||||
launchApiSchema,
|
||||
launchApiManifest,
|
||||
controlPageApiSchema,
|
||||
controlPageApiManifest,
|
||||
compatibility: {
|
||||
launchApiManifest: isSupportedIniPanelLaunchApiManifest(launchApiManifest, launchApiSchema),
|
||||
controlPageApiManifest: isSupportedIniPanelControlPageApiManifest(
|
||||
controlPageApiManifest,
|
||||
controlPageApiSchema,
|
||||
),
|
||||
},
|
||||
persistenceCapabilities: launchApiManifest.persistenceCapabilities,
|
||||
};
|
||||
}
|
||||
|
||||
export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries()) {
|
||||
return {
|
||||
pages: entries.map(({ id, href, title }) => ({
|
||||
@@ -209,8 +273,11 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
|
||||
title,
|
||||
})),
|
||||
launcherLinks: createIniPanelLauncherLinkViewModel(entries),
|
||||
shellIntegrationSchema: createIniPanelShellIntegrationSchema(),
|
||||
shellIntegrationManifest: createIniPanelShellIntegrationManifest(entries),
|
||||
launchApiSchema: createIniPanelLaunchApiSchema(),
|
||||
launchApiManifest: createIniPanelLaunchApiManifest(entries),
|
||||
isSupportedShellIntegrationManifest: isSupportedIniPanelShellIntegrationManifest,
|
||||
controlPage: {
|
||||
browserApiSchema: createControlPageBrowserApiSchema(),
|
||||
browserApiManifest: createControlPageBrowserApiManifest(),
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
createControlPageBrowserApiMethods,
|
||||
createIniPanelLaunchApiManifest,
|
||||
createIniPanelLauncherLinkViewModel,
|
||||
createIniPanelShellIntegrationManifest,
|
||||
createIniPanelShellViewModel,
|
||||
getIniPanelEntryByHref,
|
||||
getVisibleIniPanelEntries,
|
||||
@@ -69,6 +70,8 @@
|
||||
!launchApi?.isSupportedLaunchApiManifest ||
|
||||
!launchApi?.getLaunchApiSchema ||
|
||||
!launchApi?.getLaunchApiManifest ||
|
||||
!launchApi?.getShellIntegrationSchema ||
|
||||
!launchApi?.getShellIntegrationManifest ||
|
||||
!launchApi?.getLauncherLinks ||
|
||||
!launchApi?.getControlPageApiMethods
|
||||
) {
|
||||
@@ -108,9 +111,41 @@
|
||||
);
|
||||
assertEqual(
|
||||
launchApiManifest.methods.join(","),
|
||||
"isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getLauncherLinks,getControlPageApiMethods",
|
||||
"isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getLauncherLinks,getControlPageApiMethods",
|
||||
"launch API manifest methods",
|
||||
);
|
||||
const shellIntegrationSchema = launchApi.getShellIntegrationSchema();
|
||||
const shellIntegrationManifest = launchApi.getShellIntegrationManifest();
|
||||
assertEqual(
|
||||
shellIntegrationSchema.manifestVersion,
|
||||
1,
|
||||
"shell integration schema manifest version",
|
||||
);
|
||||
assertEqual(
|
||||
shellIntegrationManifest.apiName,
|
||||
"ini-panel-shell-integration",
|
||||
"shell integration manifest API name",
|
||||
);
|
||||
assertEqual(
|
||||
shellIntegrationManifest.compatibility.launchApiManifest,
|
||||
true,
|
||||
"shell integration launch compatibility",
|
||||
);
|
||||
assertEqual(
|
||||
shellIntegrationManifest.compatibility.controlPageApiManifest,
|
||||
true,
|
||||
"shell integration control-page compatibility",
|
||||
);
|
||||
assertEqual(
|
||||
shellIntegrationManifest.controlPageApiManifest.apiName,
|
||||
"ini-panel-control-page",
|
||||
"shell integration control-page manifest name",
|
||||
);
|
||||
assertEqual(
|
||||
JSON.stringify(shellIntegrationManifest),
|
||||
JSON.stringify(createIniPanelShellIntegrationManifest()),
|
||||
"shell integration manifest",
|
||||
);
|
||||
assertEqual(
|
||||
launchApiManifest.visibleEntries.length,
|
||||
2,
|
||||
|
||||
@@ -14,6 +14,8 @@ import {
|
||||
createIniPanelLaunchApiSchema,
|
||||
createIniPanelLauncherLinkViewModel,
|
||||
createIniPanelShellControlPageContract,
|
||||
createIniPanelShellIntegrationManifest,
|
||||
createIniPanelShellIntegrationSchema,
|
||||
createIniPanelShellViewModel,
|
||||
createMachineSessionReadonlyStatus,
|
||||
createMachineSessionReadonlyStatusApiManifest,
|
||||
@@ -23,6 +25,7 @@ import {
|
||||
getVisibleIniPanelEntries,
|
||||
isSupportedIniPanelControlPageApiManifest,
|
||||
isSupportedIniPanelLaunchApiManifest,
|
||||
isSupportedIniPanelShellIntegrationManifest,
|
||||
} from "../../../runtime/ui/ini-panel/ui-shell.js";
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
@@ -51,11 +54,14 @@ const requiredShellExports = [
|
||||
"createIniPanelLaunchApiSchema",
|
||||
"createIniPanelLauncherLinkViewModel",
|
||||
"createIniPanelShellControlPageContract",
|
||||
"createIniPanelShellIntegrationManifest",
|
||||
"createIniPanelShellIntegrationSchema",
|
||||
"createIniPanelShellViewModel",
|
||||
"getIniPanelEntryByHref",
|
||||
"getVisibleIniPanelEntries",
|
||||
"isSupportedIniPanelControlPageApiManifest",
|
||||
"isSupportedIniPanelLaunchApiManifest",
|
||||
"isSupportedIniPanelShellIntegrationManifest",
|
||||
"createMachineSessionControlPageController",
|
||||
"createMachineSessionReadonlyStatus",
|
||||
"createMachineSessionReadonlyStatusApiManifest",
|
||||
@@ -108,6 +114,15 @@ assert.deepEqual(
|
||||
);
|
||||
assert.deepEqual(createIniPanelShellViewModel().pages, getVisibleIniPanelEntries());
|
||||
assert.deepEqual(createIniPanelShellViewModel().launcherLinks, createIniPanelLauncherLinkViewModel());
|
||||
assert.deepEqual(
|
||||
createIniPanelShellViewModel().shellIntegrationSchema,
|
||||
createIniPanelShellIntegrationSchema(),
|
||||
);
|
||||
assert.deepEqual(
|
||||
createIniPanelShellViewModel().shellIntegrationManifest,
|
||||
createIniPanelShellIntegrationManifest(),
|
||||
);
|
||||
assert.equal(isSupportedIniPanelShellIntegrationManifest(createIniPanelShellViewModel().shellIntegrationManifest), true);
|
||||
assert.deepEqual(createIniPanelShellViewModel().launchApiSchema, createIniPanelLaunchApiSchema());
|
||||
assert.deepEqual(createIniPanelShellViewModel().launchApiManifest, createIniPanelLaunchApiManifest());
|
||||
assert.equal(isSupportedIniPanelLaunchApiManifest(createIniPanelShellViewModel().launchApiManifest), true);
|
||||
@@ -157,8 +172,11 @@ assert.match(shellText, /\bexport function createControlPageBrowserApiManifest\b
|
||||
assert.match(shellText, /\bexport function createControlPageBrowserApiSchema\b/);
|
||||
assert.match(shellText, /\bexport function createIniPanelLaunchApiSchema\b/);
|
||||
assert.match(shellText, /\bexport function createIniPanelLaunchApiManifest\b/);
|
||||
assert.match(shellText, /\bexport function createIniPanelShellIntegrationSchema\b/);
|
||||
assert.match(shellText, /\bexport function createIniPanelShellIntegrationManifest\b/);
|
||||
assert.match(shellText, /\bexport function isSupportedIniPanelControlPageApiManifest\b/);
|
||||
assert.match(shellText, /\bexport function isSupportedIniPanelLaunchApiManifest\b/);
|
||||
assert.match(shellText, /\bexport function isSupportedIniPanelShellIntegrationManifest\b/);
|
||||
assert.match(controlPageText, /\bisSupportedControlPageApiManifest\b/);
|
||||
assert.match(controlPageText, /\bgetControlPageApiSchema\b/);
|
||||
assert.match(controlPageText, /\bgetControlPageApiManifest\b/);
|
||||
@@ -167,6 +185,8 @@ assert.match(launchText, /\blinuxCncIniPanelLaunchApi\b/);
|
||||
assert.match(launchText, /\bisSupportedLaunchApiManifest\b/);
|
||||
assert.match(launchText, /\bgetLaunchApiSchema\b/);
|
||||
assert.match(launchText, /\bgetLaunchApiManifest\b/);
|
||||
assert.match(launchText, /\bgetShellIntegrationSchema\b/);
|
||||
assert.match(launchText, /\bgetShellIntegrationManifest\b/);
|
||||
assert.match(launchText, /\bgetControlPageApiMethods\b/);
|
||||
assert.match(controlPageText, /\bgetControlPageContract\b/);
|
||||
assert.match(controlPageText, /\breadControlPageStatus\b/);
|
||||
@@ -181,11 +201,16 @@ assert.match(docText, /\bcreateControlPageBrowserApiManifest\b/);
|
||||
assert.match(docText, /\bcreateControlPageBrowserApiSchema\b/);
|
||||
assert.match(docText, /\bcreateIniPanelLaunchApiManifest\b/);
|
||||
assert.match(docText, /\bcreateIniPanelLaunchApiSchema\b/);
|
||||
assert.match(docText, /\bcreateIniPanelShellIntegrationManifest\b/);
|
||||
assert.match(docText, /\bcreateIniPanelShellIntegrationSchema\b/);
|
||||
assert.match(docText, /\bisSupportedIniPanelControlPageApiManifest\b/);
|
||||
assert.match(docText, /\bisSupportedIniPanelLaunchApiManifest\b/);
|
||||
assert.match(docText, /\bisSupportedIniPanelShellIntegrationManifest\b/);
|
||||
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.isSupportedLaunchApiManifest\b/);
|
||||
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getLaunchApiSchema\b/);
|
||||
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getLaunchApiManifest\b/);
|
||||
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellIntegrationSchema\b/);
|
||||
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellIntegrationManifest\b/);
|
||||
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getControlPageApiMethods\b/);
|
||||
assert.match(docText, /\bOPFS\/session persistence capabilities\b/);
|
||||
assert.match(docText, /\bmachine files\b/);
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
createControlPageBrowserApiMethods,
|
||||
createIniPanelLaunchApiManifest,
|
||||
createIniPanelLaunchApiSchema,
|
||||
createIniPanelShellIntegrationManifest,
|
||||
createIniPanelShellViewModel,
|
||||
getVisibleIniPanelEntries,
|
||||
isSupportedIniPanelLaunchApiManifest,
|
||||
@@ -42,6 +43,8 @@ assert.deepEqual(manifest, {
|
||||
"isSupportedLaunchApiManifest",
|
||||
"getLaunchApiSchema",
|
||||
"getLaunchApiManifest",
|
||||
"getShellIntegrationSchema",
|
||||
"getShellIntegrationManifest",
|
||||
"getLauncherLinks",
|
||||
"getControlPageApiMethods",
|
||||
],
|
||||
@@ -89,6 +92,10 @@ assert.deepEqual(manifest, {
|
||||
|
||||
assert.deepEqual(createIniPanelShellViewModel().launchApiManifest, manifest);
|
||||
assert.deepEqual(createIniPanelShellViewModel().launchApiSchema, schema);
|
||||
assert.deepEqual(
|
||||
createIniPanelShellViewModel().shellIntegrationManifest,
|
||||
createIniPanelShellIntegrationManifest(),
|
||||
);
|
||||
assert.equal(createIniPanelShellViewModel().launchApiManifest.manifestVersion, schema.manifestVersion);
|
||||
assert.equal(isSupportedIniPanelLaunchApiManifest(manifest), true);
|
||||
assert.equal(isSupportedIniPanelLaunchApiManifest({ ...manifest, manifestVersion: 2 }), false);
|
||||
@@ -135,6 +142,8 @@ assert.match(shellText, /\bexport function isSupportedIniPanelLaunchApiManifest\
|
||||
assert.match(launchText, /\bisSupportedLaunchApiManifest\b/);
|
||||
assert.match(launchText, /\bgetLaunchApiSchema\b/);
|
||||
assert.match(launchText, /\bgetLaunchApiManifest\b/);
|
||||
assert.match(launchText, /\bgetShellIntegrationSchema\b/);
|
||||
assert.match(launchText, /\bgetShellIntegrationManifest\b/);
|
||||
assert.match(launchText, /\blinuxCncIniPanelLaunchApi\b/);
|
||||
|
||||
console.log("ini_panel_launch_api_manifest_node_smoke=ok");
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { dirname, resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
import {
|
||||
INI_PANEL_ENTRIES,
|
||||
createControlPageBrowserApiManifest,
|
||||
createControlPageBrowserApiSchema,
|
||||
createIniPanelLaunchApiManifest,
|
||||
createIniPanelLaunchApiSchema,
|
||||
createIniPanelLauncherLinkViewModel,
|
||||
createIniPanelShellIntegrationManifest,
|
||||
createIniPanelShellIntegrationSchema,
|
||||
getVisibleIniPanelEntries,
|
||||
isSupportedIniPanelShellIntegrationManifest,
|
||||
} from "../../../runtime/ui/ini-panel/ui-shell.js";
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const root = resolve(__dirname, "../../..");
|
||||
const shellText = readFileSync(resolve(root, "runtime/ui/ini-panel/ui-shell.js"), "utf8");
|
||||
const launchText = readFileSync(resolve(root, "runtime/ui/ini-panel/launch.html"), "utf8");
|
||||
const docText = readFileSync(resolve(root, "docs/panel-entry.md"), "utf8");
|
||||
|
||||
const schema = createIniPanelShellIntegrationSchema();
|
||||
const manifest = createIniPanelShellIntegrationManifest();
|
||||
|
||||
assert.deepEqual(schema, {
|
||||
apiName: "ini-panel-shell-integration",
|
||||
manifestVersion: 1,
|
||||
fields: [
|
||||
"apiName",
|
||||
"manifestVersion",
|
||||
"pages",
|
||||
"launcherLinks",
|
||||
"launchApiSchema",
|
||||
"launchApiManifest",
|
||||
"controlPageApiSchema",
|
||||
"controlPageApiManifest",
|
||||
"compatibility",
|
||||
"persistenceCapabilities",
|
||||
],
|
||||
});
|
||||
|
||||
assert.deepEqual(manifest, {
|
||||
apiName: "ini-panel-shell-integration",
|
||||
manifestVersion: 1,
|
||||
pages: getVisibleIniPanelEntries(),
|
||||
launcherLinks: createIniPanelLauncherLinkViewModel(),
|
||||
launchApiSchema: createIniPanelLaunchApiSchema(),
|
||||
launchApiManifest: createIniPanelLaunchApiManifest(),
|
||||
controlPageApiSchema: createControlPageBrowserApiSchema(),
|
||||
controlPageApiManifest: createControlPageBrowserApiManifest(),
|
||||
compatibility: {
|
||||
launchApiManifest: true,
|
||||
controlPageApiManifest: true,
|
||||
},
|
||||
persistenceCapabilities: createIniPanelLaunchApiManifest().persistenceCapabilities,
|
||||
});
|
||||
|
||||
assert.equal(isSupportedIniPanelShellIntegrationManifest(manifest), true);
|
||||
assert.equal(isSupportedIniPanelShellIntegrationManifest({ ...manifest, manifestVersion: 2 }), false);
|
||||
assert.equal(isSupportedIniPanelShellIntegrationManifest({ ...manifest, apiName: "other" }), false);
|
||||
const missingControlPageManifest = { ...manifest };
|
||||
delete missingControlPageManifest.controlPageApiManifest;
|
||||
assert.equal(isSupportedIniPanelShellIntegrationManifest(missingControlPageManifest), false);
|
||||
assert.equal(isSupportedIniPanelShellIntegrationManifest(null), false);
|
||||
|
||||
manifest.pages[0].title = "changed";
|
||||
manifest.launcherLinks[0].label = "changed";
|
||||
manifest.launchApiManifest.visibleEntries[0].title = "changed";
|
||||
manifest.controlPageApiManifest.methods.push("changedMethod");
|
||||
manifest.persistenceCapabilities[0].label = "changed";
|
||||
assert.equal(INI_PANEL_ENTRIES[0].title, "Open edit and run panel");
|
||||
assert.equal(createIniPanelShellIntegrationManifest().pages[0].title, "Open edit and run panel");
|
||||
assert.equal(createIniPanelShellIntegrationManifest().launcherLinks[0].label, "Open edit and run panel");
|
||||
assert.equal(
|
||||
createIniPanelShellIntegrationManifest().launchApiManifest.visibleEntries[0].title,
|
||||
"Open edit and run panel",
|
||||
);
|
||||
assert.equal(
|
||||
createIniPanelShellIntegrationManifest().controlPageApiManifest.methods.includes("changedMethod"),
|
||||
false,
|
||||
);
|
||||
assert.equal(
|
||||
createIniPanelShellIntegrationManifest().persistenceCapabilities[0].label,
|
||||
"Machine text files",
|
||||
);
|
||||
|
||||
const customManifest = createIniPanelShellIntegrationManifest([
|
||||
{
|
||||
id: "custom",
|
||||
href: "./custom.html",
|
||||
title: "Custom entry",
|
||||
},
|
||||
]);
|
||||
assert.deepEqual(customManifest.pages, [
|
||||
{
|
||||
id: "custom",
|
||||
href: "./custom.html",
|
||||
title: "Custom entry",
|
||||
},
|
||||
]);
|
||||
assert.deepEqual(customManifest.launcherLinks, [
|
||||
{
|
||||
entryId: "custom",
|
||||
href: "./custom.html",
|
||||
label: "Custom entry",
|
||||
},
|
||||
]);
|
||||
assert.deepEqual(customManifest.launchApiManifest.targetPages, [
|
||||
{
|
||||
entryId: "custom",
|
||||
href: "./custom.html",
|
||||
},
|
||||
]);
|
||||
|
||||
assert.match(shellText, /\bexport function createIniPanelShellIntegrationSchema\b/);
|
||||
assert.match(shellText, /\bexport function createIniPanelShellIntegrationManifest\b/);
|
||||
assert.match(shellText, /\bexport function isSupportedIniPanelShellIntegrationManifest\b/);
|
||||
assert.match(launchText, /\bgetShellIntegrationSchema\b/);
|
||||
assert.match(launchText, /\bgetShellIntegrationManifest\b/);
|
||||
assert.match(docText, /\bcreateIniPanelShellIntegrationManifest\b/);
|
||||
assert.match(docText, /\bisSupportedIniPanelShellIntegrationManifest\b/);
|
||||
assert.doesNotMatch(shellText, /\bparseGcode\b|\bcanonicalEvents\b|\btoolTable\b|\bplanner\b/);
|
||||
|
||||
console.log("ini_panel_shell_integration_manifest_node_smoke=ok");
|
||||
6
wasm-port/tests/ui/node/verify_ini_panel_shell_integration_manifest.sh
Executable file
6
wasm-port/tests/ui/node/verify_ini_panel_shell_integration_manifest.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)"
|
||||
|
||||
node "$ROOT_DIR/tests/ui/node/verify_ini_panel_shell_integration_manifest.mjs"
|
||||
@@ -10,6 +10,8 @@ import {
|
||||
createIniPanelLaunchApiSchema,
|
||||
createIniPanelLauncherLinkViewModel,
|
||||
createIniPanelShellControlPageContract,
|
||||
createIniPanelShellIntegrationManifest,
|
||||
createIniPanelShellIntegrationSchema,
|
||||
createIniPanelShellViewModel,
|
||||
createMachineSessionReadonlyStatus,
|
||||
createMachineSessionReadonlyStatusApiManifest,
|
||||
@@ -21,6 +23,7 @@ import {
|
||||
getVisibleIniPanelEntries,
|
||||
isSupportedIniPanelControlPageApiManifest,
|
||||
isSupportedIniPanelLaunchApiManifest,
|
||||
isSupportedIniPanelShellIntegrationManifest,
|
||||
loadMachineSessionForControlPageWorkflow,
|
||||
readMachineSessionReadonlyStatus,
|
||||
refreshMachineSessionControlPage,
|
||||
@@ -57,12 +60,15 @@ assert.equal(typeof createControlPageBrowserApiSchema, "function");
|
||||
assert.equal(typeof createIniPanelLaunchApiManifest, "function");
|
||||
assert.equal(typeof createIniPanelLaunchApiSchema, "function");
|
||||
assert.equal(typeof createIniPanelShellControlPageContract, "function");
|
||||
assert.equal(typeof createIniPanelShellIntegrationManifest, "function");
|
||||
assert.equal(typeof createIniPanelShellIntegrationSchema, "function");
|
||||
assert.equal(typeof loadMachineSessionForControlPageWorkflow, "function");
|
||||
assert.equal(typeof readMachineSessionReadonlyStatus, "function");
|
||||
assert.equal(typeof refreshMachineSessionControlPage, "function");
|
||||
assert.equal(typeof renderMachineSessionControlView, "function");
|
||||
assert.equal(typeof isSupportedIniPanelControlPageApiManifest, "function");
|
||||
assert.equal(typeof isSupportedIniPanelLaunchApiManifest, "function");
|
||||
assert.equal(typeof isSupportedIniPanelShellIntegrationManifest, "function");
|
||||
|
||||
const shellManifest = getIniPanelEntryManifest();
|
||||
shellManifest[0].title = "changed";
|
||||
@@ -99,6 +105,22 @@ assert.deepEqual(shellViewModel.pages, [
|
||||
},
|
||||
]);
|
||||
assert.deepEqual(shellViewModel.launcherLinks, createIniPanelLauncherLinkViewModel());
|
||||
assert.deepEqual(shellViewModel.shellIntegrationSchema, createIniPanelShellIntegrationSchema());
|
||||
assert.deepEqual(shellViewModel.shellIntegrationManifest, createIniPanelShellIntegrationManifest());
|
||||
assert.equal(
|
||||
isSupportedIniPanelShellIntegrationManifest(shellViewModel.shellIntegrationManifest),
|
||||
true,
|
||||
);
|
||||
assert.equal(
|
||||
shellViewModel.shellIntegrationManifest.manifestVersion,
|
||||
createIniPanelShellIntegrationSchema().manifestVersion,
|
||||
);
|
||||
assert.deepEqual(shellViewModel.shellIntegrationManifest.pages, shellViewModel.pages);
|
||||
assert.deepEqual(shellViewModel.shellIntegrationManifest.launcherLinks, shellViewModel.launcherLinks);
|
||||
assert.deepEqual(shellViewModel.shellIntegrationManifest.compatibility, {
|
||||
launchApiManifest: true,
|
||||
controlPageApiManifest: true,
|
||||
});
|
||||
assert.deepEqual(shellViewModel.launchApiSchema, createIniPanelLaunchApiSchema());
|
||||
assert.deepEqual(shellViewModel.launchApiManifest, createIniPanelLaunchApiManifest());
|
||||
assert.equal(isSupportedIniPanelLaunchApiManifest(shellViewModel.launchApiManifest), true);
|
||||
@@ -112,6 +134,7 @@ assert.equal(
|
||||
createControlPageBrowserApiSchema().manifestVersion,
|
||||
);
|
||||
assert.equal(shellViewModel.controlPage.createController, createMachineSessionControlPageController);
|
||||
assert.equal(shellViewModel.isSupportedShellIntegrationManifest, isSupportedIniPanelShellIntegrationManifest);
|
||||
assert.deepEqual(shellViewModel.controlPage.contract, createIniPanelShellControlPageContract());
|
||||
assert.equal(shellViewModel.controlPage.isSupportedBrowserApiManifest, isSupportedIniPanelControlPageApiManifest);
|
||||
assert.equal(shellViewModel.controlPage.loadSessionState, loadMachineSessionForControlPageWorkflow);
|
||||
|
||||
@@ -15,6 +15,7 @@ ROOT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)"
|
||||
"$ROOT_DIR/tests/ui/node/verify_ini_panel_readonly_status_api.sh"
|
||||
"$ROOT_DIR/tests/ui/node/verify_ini_panel_entry_manifest.sh"
|
||||
"$ROOT_DIR/tests/ui/node/verify_ini_panel_launch_api_manifest.sh"
|
||||
"$ROOT_DIR/tests/ui/node/verify_ini_panel_shell_integration_manifest.sh"
|
||||
"$ROOT_DIR/tests/ui/node/verify_ini_panel_ui_shell.sh"
|
||||
"$ROOT_DIR/tests/ui/node/verify_ini_panel_shell_control_page_contract.sh"
|
||||
"$ROOT_DIR/tests/ui/node/verify_ini_panel_entry_docs.sh"
|
||||
|
||||
Reference in New Issue
Block a user