Add shared automation and WebUI editing primitives

This commit is contained in:
2026-07-31 02:48:56 +02:00
parent f0898fcdee
commit 5b55f59a92
42 changed files with 3788 additions and 554 deletions
+81 -1
View File
@@ -63,6 +63,69 @@ function availableWebModuleSpecifiers(): string[] {
return configuredWebModulePackages().filter(packageInstalled);
}
function deferredVendorChunk(id: string): string | undefined {
const normalized = id.replaceAll("\\", "/");
if (!normalized.includes("/node_modules/")) return undefined;
if (
normalized.includes("/@tiptap/core/")
|| normalized.includes("/@tiptap/react/")
) {
return "rich-text-core";
}
if (normalized.includes("/@tiptap/")) {
return "rich-text-extensions";
}
if (
normalized.includes("/prosemirror-")
|| normalized.includes("/linkifyjs/")
|| normalized.includes("/orderedmap/")
|| normalized.includes("/rope-sequence/")
) {
return "rich-text-engine";
}
if (normalized.includes("/bpmn-js-properties-panel/")) {
return "bpmn-properties-provider";
}
if (normalized.includes("/@bpmn-io/properties-panel/")) {
return "bpmn-properties-ui";
}
if (normalized.includes("/@codemirror/view/")) {
return "bpmn-expression-view";
}
if (normalized.includes("/@codemirror/state/")) {
return "bpmn-expression-state";
}
if (normalized.includes("/@codemirror/language/")) {
return "bpmn-expression-language";
}
if (normalized.includes("/@codemirror/")) {
return "bpmn-expression-tools";
}
if (normalized.includes("/@lezer/")) {
return "bpmn-expression-parser";
}
if (
normalized.includes("/@bpmn-io/feel-editor/")
|| normalized.includes("/@bpmn-io/feelers-editor/")
) {
return "bpmn-expression-editors";
}
if (normalized.includes("/focus-trap/")) {
return "bpmn-properties-focus";
}
if (normalized.includes("/bpmn-js/")) return "bpmn-modeler";
if (normalized.includes("/diagram-js/")) return "bpmn-diagram-engine";
if (
normalized.includes("/bpmn-moddle/")
|| normalized.includes("/moddle/")
|| normalized.includes("/moddle-xml/")
|| normalized.includes("/saxen/")
) {
return "bpmn-xml";
}
return undefined;
}
function govoplanInstalledModulesPlugin(): Plugin {
const specifierByModuleVirtualId = new Map(
availableWebModuleSpecifiers().map((specifier) => [
@@ -113,21 +176,38 @@ export default defineConfig({
},
build: {
manifest: true,
rollupOptions: {
output: {
manualChunks: deferredVendorChunk,
// Keep dependencies of deferred BPMN packages in their lazy graph. The
// legacy Rollup behavior merged those dependencies into manual chunks
// and hoisted the properties-panel runtime into the application entry.
onlyExplicitManualChunks: true
}
},
chunkSizeWarningLimit: 500
},
resolve: {
preserveSymlinks: false,
dedupe: [
"@tiptap/core",
"@tiptap/pm",
"@tiptap/react",
"@xyflow/react",
"@bpmn-io/properties-panel",
"bpmn-js",
"bpmn-js-properties-panel",
"bpmn-moddle",
"lucide-react",
"react",
"react-dom",
"react-router-dom",
"react-router",
"read-excel-file"
],
alias: [
{ find: "@govoplan/core-webui/app", replacement: fileURLToPath(new URL("./src/app.ts", import.meta.url)) },
{ find: "@govoplan/core-webui/definition-graph", replacement: fileURLToPath(new URL("./src/definitionGraph.ts", import.meta.url)) },
{ find: "@govoplan/core-webui/wysiwyg", replacement: fileURLToPath(new URL("./src/wysiwyg.ts", import.meta.url)) },
{ find: "@govoplan/core-webui", replacement: fileURLToPath(new URL("./src/index.ts", import.meta.url)) }
]
},