Files
DumiFlex-ComfyUI-Wildcard-P…/scripts/pack-release.mjs
T
DumiFlex 730721fa1a feat(registry): comfyignore + 21:9 banner + includes + collapsed changelog header
Five tightly-related changes to the registry-publishing path.

.comfyignore
  Drops dev-only + repo-plumbing files from the registry archive
  even though they stay in git: src/ (frontend source), tests/,
  .github/, .husky/, public/images/docs/ (doc screenshots used at
  SPA build time, baked into web/ anyway), vite + eslint + commitlint
  + semantic-release configs, scripts/, repo metadata (CHANGELOG,
  CONTRIBUTING, CODEOWNERS, CODE_OF_CONDUCT, SECURITY). Syntax is
  gitignore-style globs per the Registry spec.

[tool.comfy] in pyproject.toml
  - Banner: 21:9 svg at public/images/comfy-banner.svg served via
    raw.githubusercontent so the listing card on registry.comfy.org
    renders the project banner instead of an empty placeholder.
  - requires-comfyui = ">=0.3.36" — floor that introduces the V3
    io.* schema (io.Schema, io.ComfyNode, @comfytype, ComfyTypeIO)
    the entire wp_nodes/ tree uses. Older runtimes would fail at
    import; the Manager warns instead.
  - includes = ["js", "web"] — both build-output trees are
    gitignored, so without this the registry archive would ship
    without the canvas widgets (js/) or the manager SPA (web/).

public/images/comfy-banner.svg
  Standalone 1400×600 svg (≈2.33:1, matches 21:9). Left half: title +
  underline accent + tagline + module-kind badges (Wildcard / Fixed /
  Combine / Derivation / Constraint, kind-colored). Right half: WP
  Context → emits → resolved $vars → fills → Prompt Assembler flow.
  Faint canvas-grid background so it reads as "this lives in
  ComfyUI" at a glance.

scripts/pack-release.mjs
  Fixes the manager outDir literal: ships web/ (the actual vite
  outDir per vite.config.mts), not the stale web_dist/ name in the
  CLAUDE.md comment. Without this the github-release zip would
  ship without the SPA.

.releaserc.js — collapsed-changelog header / footer partials
  release-notes-generator's writerOpts now wraps the per-commit
  list in a <details> element with a fixed "Wildcard Pipeline
  <version>" + doc/discord/install/issues links header. GitHub
  renders <details> natively in release markdown — readers see the
  TL;DR + 5 useful links above the fold (well under GitHub's
  "Read more" character cutoff) and click to expand the full
  feat/fix/perf log. The header text is also the part most likely
  to stay useful weeks after the release.
2026-05-28 14:09:39 +03:00

104 lines
3.2 KiB
JavaScript

#!/usr/bin/env node
/**
* pack-release.mjs — bundle the deployable file set into a zip for a
* GitHub release asset. Called from `.releaserc.js` via the exec
* plugin's `prepareCmd`. The result lives at
* dist/ComfyUI-Wildcard-Pipeline-v<version>.zip
* and gets attached to the release by `@semantic-release/github`'s
* `assets` config.
*
* Contents — everything ComfyUI needs to drop into custom_nodes/:
* - __init__.py (extension entry)
* - pyproject.toml (engine package)
* - engine/ (pure-python engine)
* - wp_nodes/ (V3 node definitions)
* - wp_api/ (HTTP routes the SPA hits)
* - js/ (built extension chunk + lazy chunks)
* - web/ (built manager SPA)
* - public/ (favicons + doc images referenced by the SPA)
* - docs/help/ (per-node help markdown the canvas reads)
* - README.md
* - LICENSE
*
* Explicitly excluded — dev-only or noisy:
* - node_modules/, .venv/, __pycache__/
* - tests/, src/ (source tree — build output ships, not source)
* - .github/, .husky/, .vscode/
* - docs/superpowers/ (per-contributor specs, gitignored anyway)
* - any *.map sourcemap files
*
* Usage: node scripts/pack-release.mjs <version>
*/
import { mkdirSync, existsSync, statSync } from "node:fs";
import { join, relative } from "node:path";
import { spawnSync } from "node:child_process";
const version = process.argv[2];
if (!version) {
console.error("usage: pack-release.mjs <version>");
process.exit(1);
}
const root = process.cwd();
const distDir = join(root, "dist");
mkdirSync(distDir, { recursive: true });
const archiveName = `ComfyUI-Wildcard-Pipeline-v${version}.zip`;
const archivePath = join(distDir, archiveName);
// Ship list (top-level only — sub-tree walked recursively by zip CLI).
const SHIP_PATHS = [
"__init__.py",
"pyproject.toml",
"README.md",
"LICENSE",
"engine",
"wp_nodes",
"wp_api",
"js",
"web",
"public",
"docs/help",
];
// Sanity: every path must exist before zipping. If `js/` or `web/`
// is missing the release would ship a broken bundle — catch here so the
// release workflow fails fast rather than uploading a half-baked zip.
for (const p of SHIP_PATHS) {
if (!existsSync(join(root, p))) {
console.error(`pack-release: required path missing — ${p}`);
console.error("Did the build step run? Expected `pnpm build` to populate js/ + web/.");
process.exit(1);
}
}
// Use the host's `zip` CLI (always present on the ubuntu-latest runner
// semantic-release runs from). Exclusion patterns kill sourcemaps +
// any python bytecode that slipped into the tree.
const excludes = [
"*/__pycache__/*",
"*.pyc",
"*.map",
"*/node_modules/*",
"*/.pytest_cache/*",
];
const args = [
"-r",
"-q",
archivePath,
...SHIP_PATHS,
"-x",
...excludes,
];
const result = spawnSync("zip", args, { stdio: "inherit", cwd: root });
if (result.status !== 0) {
console.error(`pack-release: zip exited with status ${result.status}`);
process.exit(result.status ?? 1);
}
const bytes = statSync(archivePath).size;
const mb = (bytes / (1024 * 1024)).toFixed(2);
console.log(`pack-release: wrote ${relative(root, archivePath)} (${mb} MB)`);