Skip to content

feat(comfyui-plugin): evaluate porting comfyui-node-scaffold (3,045 lines) to cargo-generate #2224

Description

@laurigates

The larger of the two hand-rolled Python template engines. Gated on the foundry pilot paying off (#2223) — deliberately second, and worth abandoning if the pilot's answer is negative.

Why it was not the pilot

foundryvtt-module-scaffold (piloted) comfyui-node-scaffold (this)
Generator size 1,279 lines 3,045 lines
Variants 3 (basic/app/libwrapper) 4 (frontend/backend/gesture/shim)
Extra axis none --widgets — presence/absence emits a structurally different src/index.ts (widget-intercept vs standalone-modal)
Existing tests none 3 (test-finishing-pass.sh, test-shim-variant.sh, test-standalone-variant.sh)

The --widgets switch is the interesting part: it is not an additive variant like foundry's, it swaps the entry point's whole shape. [conditional] handles it (4 variants × modal-shape is still a small matrix), but it is a genuinely harder mapping than anything the pilot exercised.

The payoff, if it holds

Same as the pilot's thesis: the emitted TypeScript becomes real files tsc and biome can check, instead of Python string literals nothing can. That argument is stronger here — this generator emits more TS, and scaffold.py already carries a print_finishing_pass_audit precisely because parts of its output cannot be verified mechanically (see #1877).

What to preserve

  1. The three existing tests are the contract, not optional extras. comfy pack scaffold omits the finishing pass (icon, banner, screenshots, renovate) #1877 exists because a CI-green pack shipped with Icon = "" and a bare README TODO; test-finishing-pass.sh is what stops that recurring. Any port keeps it passing or replaces it with something at least as strong.
  2. The finishing-pass audit — the port must still print it, or move its checks into the template where they become structural. This is the better outcome if reachable: an emitted icon.svg in a template is a real file, not a generated string.
  3. A parity test first, same shape as test-template-parity.sh, including the all-non-default half. That half caught two hardcoded fields in the foundry pilot that a defaults-only run passed over.

Costs specific to this pack

  • ComfyUI pack authors are Python/TypeScript people; requiring cargo-generate is a bigger ask than it was for the foundry repos. Weigh this before starting, not after.
  • plugin-compliance-check.sh pins several comfyui-node-scaffold body tokens (the finishing-pass file map, non-empty Icon/Banner, print_finishing_pass_audit) — the port must keep them satisfied or move them in the same commit.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions