Repository navigation
[ext-api 2/4] pkg: @comfyorg/extension-api npm package - #12143
christian-byrne wants to merge 18 commits into
Conversation
|
Warning Review limit reachedNext included review available in 31 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (22)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🌐 Website E2ETip All tests passed.
|
🎨 Storybook: ✅ Built — View Storybook |
🎭 Playwright: 🕵🏻 0 passed, 0 failed📊 Browser Reports
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## ext-api/i-foundation-v2 #12143 +/- ##
===========================================================
- Coverage 59.49% 58.69% -0.81%
===========================================================
Files 1423 1418 -5
Lines 72910 72358 -552
Branches 20210 20038 -172
===========================================================
- Hits 43381 42470 -911
- Misses 29056 29413 +357
- Partials 473 475 +2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
📦 Bundle Size
⚡ Performance
|
…ODO (review #12143.A6) The widget name returned by createWidgetHandle (used by addWidget()) parses the trailing segment of the entity id ("widget:graphId:nodeId:name") via lastIndexOf(':') and an 'as unknown as string' cast. Make the temporary nature of this parse explicit (TODO #11939, real WidgetNameComponent), and document the missing-colon fallback (returns the full id rather than an empty string) as the defensive default.
…port (review #12143.M1+A9) The package barrel at packages/extension-api/src/index.ts duplicated the canonical surface in src/extension-api/index.ts. Two hand-maintained exports lists drift out of sync — Architect #4's removal of startExtensionSystem from the public surface, for example, only landed in the canonical barrel. Collapse the package barrel to a single 'export * from @/extension-api/index' re-export so the canonical file is the one source of truth. Future surface additions/removals flow through automatically; no risk of asymmetric export sets between the in-tree consumer (@/extension-api) and the npm package consumer (@comfyorg/extension-api).
knip flagged the new src/extension-api/* files and exports as unused because nothing internal consumes them — by design. They are the public API surface published by PKG2 (#12143). Changes: - knip.config.ts: add src/extension-api/index.ts as entry point (per AGENTS.md, this barrel is the explicit exception to the no-barrel-files-in-src rule because it IS the package entry). - knip.config.ts: ignore src/types/extensionV2.ts (deprecated stub, removed once PKG2 ships). - knip.config.ts: register `-publicAPI` tag. - Tag externally-consumed exports with @publicapi: - lifecycle.ts: defineNodeExtension/Extension/WidgetExtension declares + back-compat type re-exports - extension-api-service.ts: _setDispatchImplForTesting, NodeInstanceScope - worldInstance.ts: World Verifies the full lint-format CI matrix locally: pnpm lint ✅ pnpm stylelint (unaffected, CSS-only) pnpm format:check ✅ pnpm knip ✅
…ODO (review #12143.A6) The widget name returned by createWidgetHandle (used by addWidget()) parses the trailing segment of the entity id ("widget:graphId:nodeId:name") via lastIndexOf(':') and an 'as unknown as string' cast. Make the temporary nature of this parse explicit (TODO #11939, real WidgetNameComponent), and document the missing-colon fallback (returns the full id rather than an empty string) as the defensive default.
…port (review #12143.M1+A9) The package barrel at packages/extension-api/src/index.ts duplicated the canonical surface in src/extension-api/index.ts. Two hand-maintained exports lists drift out of sync — Architect #4's removal of startExtensionSystem from the public surface, for example, only landed in the canonical barrel. Collapse the package barrel to a single 'export * from @/extension-api/index' re-export so the canonical file is the one source of truth. Future surface additions/removals flow through automatically; no risk of asymmetric export sets between the in-tree consumer (@/extension-api) and the npm package consumer (@comfyorg/extension-api).
9426847 to
6c21106
Compare
…port (review #12143.M1+A9) The package barrel at packages/extension-api/src/index.ts duplicated the canonical surface in src/extension-api/index.ts. Two hand-maintained exports lists drift out of sync — Architect #4's removal of startExtensionSystem from the public surface, for example, only landed in the canonical barrel. Collapse the package barrel to a single 'export * from @/extension-api/index' re-export so the canonical file is the one source of truth. Future surface additions/removals flow through automatically; no risk of asymmetric export sets between the in-tree consumer (@/extension-api) and the npm package consumer (@comfyorg/extension-api).
oxlint flags console.log in packages/extension-api/scripts/build-docs.ts (intentional CLI progress output). The pre-commit lint-staged hook in ci-lint-format then aborts before the [automated] format commit can be pushed back, blocking the entire lint-and-format job. - Add file-level eslint-disable for no-console (CLI build script) - Whitelist build-docs.ts in eslint.config.ts allowDefaultProject so typed-lint does not error on the file outside the tsconfig project graph Discovered while rebasing #12143 onto the foundation-v2 knip fix (5b05f2b).
6c21106 to
db17622
Compare
Resolves CodeRabbit findings F-12143-1, F-12143-3, F-12143-7. Per D17-pkg2-build-strategy ADR: package now builds via Vite library mode + vite-plugin-dts, dropping the inconsistent rootDir restriction and the --emitDeclarationOnly flag. Vite resolves @/* aliases against the canonical surface in main app src/extension-api/, externalizes vue as a peer dep, and bundles to a single 3.95 kB build/index.js. vite-plugin-dts emits the per-file .d.ts closure under build/ with @/* imports rewritten to relative paths. The original tsc-only plan in #12143 was unworkable because tsc does not rewrite path aliases — emitted JS would have unresolvable @/... imports at runtime. Vite library mode is the smallest deviation that satisfies PKG3 acceptance ('emits BOTH .d.ts + .js') while preserving 'the barrel is the source of truth in main app src/extension-api/' intent in packages/extension-api/AGENTS.md. Verified: pnpm build emits build/index.js (3.95 kB) + build/.../*.d.ts tree node -e "import('./build/index.js')" returns real functions for defineNodeExtension, defineExtension, onNodeMounted, onNodeRemoved synthetic downstream consumer importing NodeHandle/WidgetHandle types and runtime fns type-checks under tsc --noEmit pnpm lint && pnpm format:check && pnpm knip pass Also adds packages/extension-api/vite.config.mts to the eslint allowDefaultProject list so the typed lint rules can resolve it. See decisions/D17-pkg2-build-strategy.md in the cross-repo workspace for the full options analysis (A: types-only — rejected; B: vendor sources — deferred to post-#11939; C: build from main app sources — chosen).
Resolves CodeRabbit findings F-12143-1, F-12143-3, F-12143-7. Per D17-pkg2-build-strategy ADR: package now builds via Vite library mode + vite-plugin-dts, dropping the inconsistent rootDir restriction and the --emitDeclarationOnly flag. Vite resolves @/* aliases against the canonical surface in main app src/extension-api/, externalizes vue as a peer dep, and bundles to a single 3.95 kB build/index.js. vite-plugin-dts emits the per-file .d.ts closure under build/ with @/* imports rewritten to relative paths. The original tsc-only plan in #12143 was unworkable because tsc does not rewrite path aliases — emitted JS would have unresolvable @/... imports at runtime. Vite library mode is the smallest deviation that satisfies PKG3 acceptance ('emits BOTH .d.ts + .js') while preserving 'the barrel is the source of truth in main app src/extension-api/' intent in packages/extension-api/AGENTS.md. Verified: pnpm build emits build/index.js (3.95 kB) + build/.../*.d.ts tree node -e "import('./build/index.js')" returns real functions for defineNodeExtension, defineExtension, onNodeMounted, onNodeRemoved synthetic downstream consumer importing NodeHandle/WidgetHandle types and runtime fns type-checks under tsc --noEmit pnpm lint && pnpm format:check && pnpm knip pass Also adds packages/extension-api/vite.config.mts to the eslint allowDefaultProject list so the typed lint rules can resolve it. See decisions/D17-pkg2-build-strategy.md in the cross-repo workspace for the full options analysis (A: types-only — rejected; B: vendor sources — deferred to post-#11939; C: build from main app sources — chosen).
49533ff to
dfaa7da
Compare
Folds the foundation-file edits that were previously living in PRs #12143 and #12144 into the foundation PR (#12142) so each downstream PR's diff contains only its own concerns. From #12143 (pkg): - src/extension-api/index.ts: drop startExtensionSystem from public barrel (it is the internal boot fn; app.ts imports directly from the service) - src/extension-api/types.ts: fix bad escape in widgetCreated JSDoc example - src/services/extension-api-service.ts: add @internal tag to startExtensionSystem; widen widget.on() Phase-A stub warnings; harden addWidget name parse with explanatory TODO - src/services/__tests__/scope-registry.test.ts: drop unused removedCb in no-dispose-on-subgraph-promotion test From #12144 (ext): - src/extension-api/lifecycle.ts: add JSDoc @example to defineWidgetExtension - src/extension-api/node.ts: hoist DOMWidgetOptions interface above NodeHandle - src/extension-api/shell.ts: clarify shell.ts is a re-export, not a move - src/services/extension-api-service.ts: more informative Phase-A stub warning text on node.on() (replaces pkg's terser version per ext review) These are pure refinements (JSDoc, dev-only warnings, structural tidying); no runtime behavior change. After this commit, rebasing pkg/ext onto the new foundation will drop the corresponding source-touching commits as empty no-ops and leave each PR scoped to its own concerns.
…port (review #12143.M1+A9) The package barrel at packages/extension-api/src/index.ts duplicated the canonical surface in src/extension-api/index.ts. Two hand-maintained exports lists drift out of sync — Architect #4's removal of startExtensionSystem from the public surface, for example, only landed in the canonical barrel. Collapse the package barrel to a single 'export * from @/extension-api/index' re-export so the canonical file is the one source of truth. Future surface additions/removals flow through automatically; no risk of asymmetric export sets between the in-tree consumer (@/extension-api) and the npm package consumer (@comfyorg/extension-api).
oxlint flags console.log in packages/extension-api/scripts/build-docs.ts (intentional CLI progress output). The pre-commit lint-staged hook in ci-lint-format then aborts before the [automated] format commit can be pushed back, blocking the entire lint-and-format job. - Add file-level eslint-disable for no-console (CLI build script) - Whitelist build-docs.ts in eslint.config.ts allowDefaultProject so typed-lint does not error on the file outside the tsconfig project graph Discovered while rebasing #12143 onto the foundation-v2 knip fix (5b05f2b).
dfaa7da to
102a369
Compare
Resolves CodeRabbit findings F-12143-1, F-12143-3, F-12143-7. Per D17-pkg2-build-strategy ADR: package now builds via Vite library mode + vite-plugin-dts, dropping the inconsistent rootDir restriction and the --emitDeclarationOnly flag. Vite resolves @/* aliases against the canonical surface in main app src/extension-api/, externalizes vue as a peer dep, and bundles to a single 3.95 kB build/index.js. vite-plugin-dts emits the per-file .d.ts closure under build/ with @/* imports rewritten to relative paths. The original tsc-only plan in #12143 was unworkable because tsc does not rewrite path aliases — emitted JS would have unresolvable @/... imports at runtime. Vite library mode is the smallest deviation that satisfies PKG3 acceptance ('emits BOTH .d.ts + .js') while preserving 'the barrel is the source of truth in main app src/extension-api/' intent in packages/extension-api/AGENTS.md. Verified: pnpm build emits build/index.js (3.95 kB) + build/.../*.d.ts tree node -e "import('./build/index.js')" returns real functions for defineNodeExtension, defineExtension, onNodeMounted, onNodeRemoved synthetic downstream consumer importing NodeHandle/WidgetHandle types and runtime fns type-checks under tsc --noEmit pnpm lint && pnpm format:check && pnpm knip pass Also adds packages/extension-api/vite.config.mts to the eslint allowDefaultProject list so the typed lint rules can resolve it. See decisions/D17-pkg2-build-strategy.md in the cross-repo workspace for the full options analysis (A: types-only — rejected; B: vendor sources — deferred to post-#11939; C: build from main app sources — chosen).
…port (review #12143.M1+A9) The package barrel at packages/extension-api/src/index.ts duplicated the canonical surface in src/extension-api/index.ts. Two hand-maintained exports lists drift out of sync — Architect #4's removal of startExtensionSystem from the public surface, for example, only landed in the canonical barrel. Collapse the package barrel to a single 'export * from @/extension-api/index' re-export so the canonical file is the one source of truth. Future surface additions/removals flow through automatically; no risk of asymmetric export sets between the in-tree consumer (@/extension-api) and the npm package consumer (@comfyorg/extension-api).
54d3dbd to
809a5c4
Compare
Wave-9 cascade — pkg
|
|
🧊 Phase A surface frozen — foundation The public API surface for this stack is now locked at foundation commit What's frozen
Re-open criteriaEither (1) a new ACCEPTED ADR with axiom-compliance verification, or (2) Phase B trigger (#11939 merges). Next up — Phase BKickoff tracking: #12394. Live frozen-surface dashboardhttps://comfyui-frontend-ecosystem.vercel.app (marker commit |
Restratified i-pkg. Adds the @comfyorg/extension-api npm package
(packages/extension-api/) — package.json, tsconfig.{json,build,docs},
typedoc.json, scripts/build-docs.ts, README, .npmignore — plus three
CI workflows (extension-api-typecheck.yml, extension-api-publish.yml,
ci-tests-extension-api.yaml) and the docgen helper script.
Modifies foundation's src/extension-api/index.ts and
src/services/extension-api-service.ts with the package-aware tweaks
required for npm consumption.
Lockfile regenerated to include packages/extension-api workspace deps.
Original (pre-restratify) branch tip backed up at
refs/backup/restratify-20260511/ext-api-i-pkg.
…port (review #12143.M1+A9) The package barrel at packages/extension-api/src/index.ts duplicated the canonical surface in src/extension-api/index.ts. Two hand-maintained exports lists drift out of sync — Architect #4's removal of startExtensionSystem from the public surface, for example, only landed in the canonical barrel. Collapse the package barrel to a single 'export * from @/extension-api/index' re-export so the canonical file is the one source of truth. Future surface additions/removals flow through automatically; no risk of asymmetric export sets between the in-tree consumer (@/extension-api) and the npm package consumer (@comfyorg/extension-api).
oxlint flags console.log in packages/extension-api/scripts/build-docs.ts (intentional CLI progress output). The pre-commit lint-staged hook in ci-lint-format then aborts before the [automated] format commit can be pushed back, blocking the entire lint-and-format job. - Add file-level eslint-disable for no-console (CLI build script) - Whitelist build-docs.ts in eslint.config.ts allowDefaultProject so typed-lint does not error on the file outside the tsconfig project graph Discovered while rebasing #12143 onto the foundation-v2 knip fix (5b05f2b).
…review F-12143-8/9/10) The dry_run input was declared as type: boolean but the default was the string 'true' and the conditional comparisons used '== "true"' / '== "false"'. GitHub Actions coerces typed boolean inputs to actual booleans, so the string comparisons would never match a workflow_dispatch invocation. - default: 'true' → default: true (match declared type) - inputs.dry_run == 'false' → !inputs.dry_run - inputs.dry_run == 'true' → inputs.dry_run Validated locally with actionlint (clean). Refs CodeRabbit findings F-12143-8, F-12143-9, F-12143-10 in research/reviews/coderabbit-batch-2026-05-12.md.
Resolves CodeRabbit findings F-12143-1, F-12143-3, F-12143-7. Per D17-pkg2-build-strategy ADR: package now builds via Vite library mode + vite-plugin-dts, dropping the inconsistent rootDir restriction and the --emitDeclarationOnly flag. Vite resolves @/* aliases against the canonical surface in main app src/extension-api/, externalizes vue as a peer dep, and bundles to a single 3.95 kB build/index.js. vite-plugin-dts emits the per-file .d.ts closure under build/ with @/* imports rewritten to relative paths. The original tsc-only plan in #12143 was unworkable because tsc does not rewrite path aliases — emitted JS would have unresolvable @/... imports at runtime. Vite library mode is the smallest deviation that satisfies PKG3 acceptance ('emits BOTH .d.ts + .js') while preserving 'the barrel is the source of truth in main app src/extension-api/' intent in packages/extension-api/AGENTS.md. Verified: pnpm build emits build/index.js (3.95 kB) + build/.../*.d.ts tree node -e "import('./build/index.js')" returns real functions for defineNodeExtension, defineExtension, onNodeMounted, onNodeRemoved synthetic downstream consumer importing NodeHandle/WidgetHandle types and runtime fns type-checks under tsc --noEmit pnpm lint && pnpm format:check && pnpm knip pass Also adds packages/extension-api/vite.config.mts to the eslint allowDefaultProject list so the typed lint rules can resolve it. See decisions/D17-pkg2-build-strategy.md in the cross-repo workspace for the full options analysis (A: types-only — rejected; B: vendor sources — deferred to post-#11939; C: build from main app sources — chosen).
- Remove build/ from .gitignore so types are visible in PR - Update vite config to use rollupTypes for bundled declarations - Update package.json types path to ./build/index.d.ts - Exclude packages/*/build/ from lint-staged - Include index.d.ts (37KB bundled types), index.js (2MB), index.js.map The bundled index.d.ts contains all public API types inline. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove index.js and index.js.map from git tracking. The .d.ts file is committed for npm package visibility and reviewer inspection, while JS files are generated at build time and don't need to be in version control. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updates bundled types after foundation renamed widgets() → getWidgets(). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update workflow actions to versions allowed in .pinact.yaml: - actions/setup-node@v4 → v6 - actions/github-script@v7 → v8 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The packages/extension-api/build/ directory contains TypeDoc/tsc-generated .d.ts snapshots committed for reviewability (per D17). These should not be format-checked since they're machine-generated. Adds packages/extension-api/build/** to oxfmt ignorePatterns so that 'pnpm format:check' passes cleanly post-restratify reconciliation. Part of RECONCILE-PKG (PR #12143).
…drop *EntityId from extensionV2 stub Cascade of D20 (decisions/D20-id-type-convergence.md) from foundation: - Rebuild packages/extension-api/build/index.d.ts via vite build so the published .d.ts ships the new id/equals surface and drops the three demoted brand re-exports. - src/types/extensionV2.ts: stop re-exporting NodeEntityId, WidgetEntityId, SlotEntityId — they are no longer in the @/extension-api barrel per D20. Use node.id/widget.id (string) and equals(other) for the public surface.
…P8.C) + D-widget-converge (W6.P3.C) cascade Regenerates packages/extension-api/build/index.d.ts to ship the merged foundation surface from the two cherry-picked commits: - df921f3 / a22682b — Hybrid C Readonly typing per D-immutability-enforcement (8 mutation-family accessors now readonly, getInputs/getOutputs renamed, widget.options + widget.serializeValue accessor-only). - 2f10235 / d76592e — DOMWidget ↔ Widget convergence via mount lifecycle per D-widget-converge / Axiom A12. New WidgetCleanup / WidgetMountContext / WidgetMountFn exports; DOMWidgetOptions and NodeHandle.addDOMWidget() removed. Verification: $ grep -c 'WidgetMountContext\|WidgetCleanup\|WidgetMountFn' build/index.d.ts 8 $ grep -c 'DOMWidgetOptions\|addDOMWidget' build/index.d.ts 0 +222/-53 lines net (build/index.d.ts).
…ascade
Picks up the canvas-units / escape-hatch / A13 JSDoc on NodeHandle.{getPosition,setPosition,getSize,setSize} from foundation fa3229b so the published .d.ts and the docgen pipeline see the policy text. No symbol changes.
…cation (wave-9)
Hand-patched packages/extension-api/build/index.d.ts to match the
foundation surface after A16 closure:
- Drop `isSerializeEnabled` / `setSerializeEnabled` from WidgetHandle
- Drop `WidgetBeforeSerializeEvent.context` 4-way discriminator
- Drop `WidgetBeforeSerializeEvent.skip()`
- Drop `on('propertyChange', handler)` overload
- Drop entire `WidgetPropertyChangeEvent` interface
- Drop `WidgetOptions.serialize?: boolean` key
- Update JSDoc on `WidgetBeforeSerializeEvent` / `options` / `serializeValue`
to reference A16 / drop transport-discriminator examples
`NodeBeforeSerializeEvent.context` is intentionally retained — the
node-level surface stays `@deprecated` + runtime-warned per ADR-0010
(not banned by D-widget-serialization-simplification).
Hand-edit pattern because pnpm build is blocked by Node 20 vs vite
requirement per AGENTS.md Rule 8. Surface verified to match foundation
HEAD e56187a.
Refs: decisions/D-widget-serialization-simplification.md, AXIOMS.md §A15+A16
…ave-10) Hand-patched mirror of foundation surface changes per AGENTS.md Rule 8 (Node 20 vs vite blocks `pnpm build` in this worktree): - Remove `NodeHandle.addWidget(...)` method declaration (A15 closure) - Scrub 5 JSDoc references to `node.addWidget(...)` across NodeHandle getWidgets doc, NodeBeforeSerialize migration example, defineWidget options doc, WidgetHandle name doc, WidgetHandle label doc, WidgetOptions doc - Add A15 / D-ban-runtime-addwidget cross-references Mirrors foundation commit `d5d5692928`.
Hand-patched mirror of foundation hygiene cleanup per AGENTS.md Rule 8 (Node 20 vs vite blocks `pnpm build` in this worktree): - Strip HR-style section dividers - Strip parenthetical decision archaeology ((per D5), (D-immutability-enforcement, Hybrid C), D-bootstrap-hooks (W6.P6.C), D-shell-ui-entrypoints (W6.P5.C), etc.) from per-export JSDoc — preserve AXIOMS.md §A1/A14/A15/A16/A12 refs and PHASE_A_EXCLUDED axiom blocks (functional content). - Strip "W6.P8.UNMIGRATABLE / D-input-output-shape" todo refs. - One stale `defineWidgetExtension` JSDoc example fixed (was already on foundation; rebase carried the fix through). Mirrors foundation commit `ee0537fdb5`. ADR: decisions/D-design-review-hygiene-cleanup.md Zero published-surface change (no types added/removed/renamed).
|
Drive-by from a downstream consumer ( 1. In "peerDependencies": {
"vue": "catalog:"
}And in cd packages/extension-api
npm publish --provenance --access publicnpm doesn't understand pnpm's catalog protocol; it'll publish the manifest verbatim with Two easy fixes:
2. These are non-load-bearing today but become annoying once published — npm shows "Unknown license" on the package page, GitHub doesn't show the license badge, and downstream tooling (Renovate, Dependabot, SCA scanners) starts to nag. Concretely: "license": "<the license you intend — see below>",
"repository": {
"type": "git",
"url": "https://github.com/Comfy-Org/ComfyUI_frontend.git",
"directory": "packages/extension-api"
},
"homepage": "https://docs.comfy.org/extension-api", // or similar
"bugs": "https://github.com/Comfy-Org/ComfyUI_frontend/issues"Worth being explicit about Thanks for the careful work on the stack — looking forward to consuming this. |
|
Retarget to Stack: What I did: retargeted base Reverted base back to Unblock: merge #12142 first, then retarget this PR to |
|
@coderabbitai review |
|
DrJKL
left a comment
There was a problem hiding this comment.
The package cannot build or ship from this head. The library entry traverses application modules and raw Vue SFCs without the Vue plugin, the advertised test job exits successfully after skipping its missing configuration, and the published export map names a JavaScript file absent from the packed artifact.
I fully reviewed the package boundary, export/build/typecheck/doc configs, and workflows against its stacked base, and sampled the generated declaration and API imports. Current main contains no packages/extension-api or src/extension-api; this package must also be reconciled with the dedicated-store and widget compatibility direction now recorded in ADRs 0008, 0016, and 0023.
Checks: install and changed-file format passed. pnpm --filter @comfyorg/extension-api build failed after reaching 46 .vue files; pnpm test:extension-api exited 0 with SKIP: vitest.extension-api.config.mts not found; typecheck failed with 16 extension-API errors; changed-file ESLint failed on the package entry; Knip failed on an inherited unused export. npm pack --dry-run contained build/index.d.ts but no build/index.js.
I concur with the existing downstream comment about publishing catalog: through npm and the missing package metadata; those findings are not duplicated inline.
| // package's own `src/index.ts` exists only as a documented entry | ||
| // point that re-exports the same surface, but we point Vite at the | ||
| // canonical file so dts paths line up cleanly with the JS bundle. | ||
| entry: resolve(surfaceRoot, 'index.ts'), |
There was a problem hiding this comment.
This entry imports the app-owned API tree rather than a package-owned leaf boundary. pnpm --filter @comfyorg/extension-api build follows that tree into 46 raw .vue files and fails because this library config has no Vue plugin. More importantly, the public package is coupled to application registrations. Give the package a buildable leaf entry that depends only on the intended public contract.
| "exports": { | ||
| ".": { | ||
| "types": "./build/index.d.ts", | ||
| "import": "./build/index.js", |
There was a problem hiding this comment.
The packed artifact has no build/index.js; npm pack --dry-run includes only the declaration, README, and manifest. This runtime export is therefore broken even before publication. The build must produce and pack the file named here.
| uses: ./.github/actions/setup-frontend | ||
|
|
||
| - name: Run extension-api test suite | ||
| run: pnpm test:extension-api |
There was a problem hiding this comment.
This job is green without running a test. On this head, pnpm test:extension-api prints SKIP: vitest.extension-api.config.mts not found and exits 0 because neither the config nor the stated test directory exists in this stack layer. A required test command must fail when its suite is absent.
| * | ||
| * @packageDocumentation | ||
| */ | ||
| export * from '@/extension-api/index' |
There was a problem hiding this comment.
Changed-file ESLint rejects this entry because it is outside the configured TypeScript project service. Include the package source in the lint/typecheck project instead of shipping an entry point the repository checks cannot analyze.
|
Superseded by benjcooley's #16691 ("feat(nodeApi): publish the custom-node API"), which republishes the node/widget/graph API surface this stack targeted ( Full context for agent readersThis PR is part of the Author verified: |
Summary
Publishable npm package for the Extension API v2. Generates
.d.tstype declarations and documentation for extension authors.Stacked on #12142.
What's Included
Package (
packages/extension-api/)package.json—@comfyorg/extension-apipackage configvite.config.mts— builds.d.ts+.jsbundle viavite-plugin-dtstsconfig.build.json— TypeScript config for declaration emittypedoc.json+scripts/build-docs.ts— API documentation generatorCI Workflows (
.github/workflows/)extension-api-typecheck.yml— validates types on PRextension-api-publish.yml— publishes to npm on releaseci-tests-extension-api.yaml— runs extension-api specific testsBuild Output
Test Plan
pnpm typecheckpassespnpm --filter @comfyorg/extension-api buildgenerates declarations