Files
ComfyUI_frontend/tsconfig.json
Glary-Bot 72ac6773a1 feat(validation): split topology validation from link repair into publishable nx package
Extract workflow zod schemas, link topology validator, and link repair
into a new `@comfyorg/workflow-validation` package under `packages/`.
The package has zero litegraph coupling — it operates on plain
serialised JSON shapes — so it can be consumed by Node.js CI scripts
and a future backend validator.

Behaviour changes:

- Replace the four `'Error. Expected node to match patched data.'`
  invariant throws in the link fixer with `LinkRepairAbortedError`,
  which carries a structured `TopologyError` describing the offending
  `[linkId, src, srcSlot, tgt, tgtSlot]`.
- Add a pure `validateLinkTopology(graph)` that walks the link table
  and reports out-of-bounds slots, missing nodes, and endpoint
  mismatches as a structured `TopologyError[]`. This catches the
  seedance-style breakage (links targeting slots that don't exist on
  the node) which the schema cannot detect.
- Surface topology errors via toast when `Comfy.Validation.Workflows`
  is enabled, instead of swallowing them with `console.error`.
  Unrepairable workflows raise an `error` toast with structured
  details and `useWorkflowValidation` returns `null` so the caller
  falls back to the original graph.

Migration is via tsconfig + vite path aliases mirroring the existing
`@/utils/formatUtil` precedent, so the 76 importers of
`workflowSchema` and the lone importer of `linkFixer` continue to
compile without changes.

Adds `release-npm-workflow-validation.yaml`, a `workflow_dispatch`
publisher mirroring the existing `release-npm-types` pattern, so a
follow-up PR on Comfy-Org/workflow_templates can pin the published
package for per-template topology CI.
2026-05-02 04:41:56 +00:00

61 lines
1.7 KiB
JSON

{
"compilerOptions": {
"target": "ES2023",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2023", "ES2023.Array", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
"incremental": true,
"sourceMap": true,
"esModuleInterop": true,
"moduleResolution": "bundler",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"resolveJsonModule": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"allowJs": true,
"verbatimModuleSyntax": true,
"paths": {
"@/*": ["./src/*"],
"@e2e/*": ["./browser_tests/*"],
"@/utils/formatUtil": [
"./packages/shared-frontend-utils/src/formatUtil.ts"
],
"@/utils/networkUtil": [
"./packages/shared-frontend-utils/src/networkUtil.ts"
],
"@/utils/linkFixer": ["./packages/workflow-validation/src/linkRepair.ts"],
"@/platform/workflow/validation/schemas/workflowSchema": [
"./packages/workflow-validation/src/workflowSchema.ts"
]
},
"typeRoots": ["src/types", "node_modules/@types", "./node_modules"],
"types": [
"vitest/globals",
"@webgpu/types",
"@testing-library/jest-dom/vitest"
],
"outDir": "./dist",
"rootDir": "./"
},
"include": [
".storybook/**/*",
"eslint.config.ts",
"global.d.ts",
"knip.config.ts",
"lint-staged.config.ts",
"src/**/*.vue",
"src/**/*",
"src/types/**/*.d.ts",
"playwright.config.ts",
"playwright.i18n.config.ts",
"vite.config.mts",
"vitest.config.ts"
// "vitest.setup.ts",
]
}