mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-23 08:14:06 +00:00
Add comprehensive demo showing API changelog generation across two versions (v1.29.0 → v1.30.2): - Mock TypeScript definitions for both versions - Generated JSON snapshots showing structured API surface - Generated changelog with breaking changes, additions, and modifications - Detailed README explaining the system and benefits The demo showcases: ✨ Detection of breaking changes (queuePrompt → queuePromptAsync) ✨ Tracking of new additions (ExtensionMetadata interface, WorkflowId type) ✨ Identification of modifications (NodeDef enhancements, NodeStatus enum extensions) This demonstrates the automated system that will run on every release to document API changes for extension developers. Also exclude demo-snapshots directory from ESLint checking. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
API Changelog Generation Demo
This demo showcases the automated API changelog generation system comparing two versions of the ComfyUI Frontend public API.
Overview
The demo compares v1.29.0 → v1.30.2 to demonstrate:
- Breaking change detection
- API additions tracking
- Non-breaking modifications
- Human-readable changelog generation
Demo Files
Input Files
v1.29.0.d.ts- TypeScript definitions representing the v1.29.0 API surfacev1.30.2.d.ts- TypeScript definitions representing the v1.30.2 API surface
Generated Files
v1.29.0.json- Structured API snapshot from v1.29.0v1.30.2.json- Structured API snapshot from v1.30.2CHANGELOG-DEMO.md- Generated changelog comparing the two versions
Running the Demo
# Generate API snapshots
node scripts/snapshot-api.js demo-snapshots/v1.29.0.d.ts > demo-snapshots/v1.29.0.json
node scripts/snapshot-api.js demo-snapshots/v1.30.2.d.ts > demo-snapshots/v1.30.2.json
# Compare snapshots and generate changelog
node scripts/compare-api-snapshots.js \
demo-snapshots/v1.29.0.json \
demo-snapshots/v1.30.2.json \
1.29.0 \
1.30.2 \
> demo-snapshots/CHANGELOG-DEMO.md
Key Changes Detected
⚠️ Breaking Changes
ComfyApi.queuePrompt()removed- Replaced with
queuePromptAsync()which includes additional options - Extension developers need to update their code to use the new async method
- Replaced with
✨ New Additions
-
New Interface:
ExtensionMetadata- Provides metadata for extensions
- Fields:
id,name,version,description
-
New Type:
WorkflowId- Type alias for workflow identifiers
-
Enhanced
ComfyApiInterfacequeuePromptAsync()- Async queue with priority supportcancelPrompt()- Cancel queued promptsgetQueueStatus()- Query queue state
-
Extended
NodeDefInterfaceinput- Input specificationoutput- Output typesoutput_name- Output names
-
Enhanced
NodeStatusEnum- Added
ERRORstate - Added
COMPLETEDstate
- Added
-
Extended
WorkflowManagerClasscacheproperty for workflow cachingdeleteWorkflow()methodsearchWorkflows()method
🔄 Non-Breaking Modifications
WorkflowMetadataenhancements- Added optional
tagsfield - Added optional
thumbnailfield
- Added optional
Real-World Usage
In production, this system will:
- Automatic Triggering: Run after each NPM types release
- Version Detection: Automatically detect current and previous versions from git tags
- Build Integration: Build actual TypeScript types from the repository
- PR Creation: Generate draft pull requests with the changelog
- Human Review: Allow maintainers to review and enhance before merging
Benefits for Extension Developers
Clear Breaking Change Visibility
Extension developers can immediately see:
- What APIs were removed
- What signatures changed
- How to migrate their code
Migration Planning
With clear documentation of additions and changes, developers can:
- Plan updates around breaking changes
- Adopt new features when ready
- Understand version compatibility
Historical Reference
The cumulative docs/API-CHANGELOG.md provides:
- Complete API evolution history
- Context for design decisions
- Migration guides for major versions
Example Extension Migration
Before (v1.29.0)
// Old code using queuePrompt
const result = await api.queuePrompt(workflow);
console.log('Queued:', result.prompt_id);
After (v1.30.2)
// New code using queuePromptAsync with priority
const result = await api.queuePromptAsync(workflow, { priority: 1 });
console.log('Queued:', result.prompt_id, 'Position:', result.number);
Snapshot Structure
The JSON snapshots contain structured representations of:
{
"types": { /* Type aliases */ },
"interfaces": { /* Interface definitions with members */ },
"enums": { /* Enum values */ },
"functions": { /* Exported functions */ },
"classes": { /* Class definitions with methods */ },
"constants": { /* Exported constants */ }
}
Each entry includes:
- Name: Identifier
- Kind: Type of declaration
- Members/Methods: Properties and functions
- Types: Parameter and return types
- Visibility: Public/private/protected modifiers
- Optional: Whether parameters/properties are optional
Comparison Algorithm
The comparison script:
- Categorizes changes into breaking, additions, and modifications
- Detects breaking changes:
- Removed interfaces, classes, functions
- Removed methods or properties
- Changed method signatures
- Changed return types
- Removed enum values
- Tracks additions:
- New interfaces, classes, types
- New methods and properties
- New enum values
- Identifies modifications:
- Type changes
- Optionality changes
- Signature changes
Future Enhancements
Planned improvements include:
- LLM Enhancement: Use AI to generate better descriptions and migration guides
- Email Notifications: Alert developers on mailing list for major changes
- Release Notes Integration: Auto-include in GitHub releases
- Deprecation Tracking: Mark APIs as deprecated before removal
- Example Code: Generate migration code snippets automatically
Conclusion
This automated system ensures:
- ✅ Zero manual effort for changelog generation
- ✅ Consistent documentation format
- ✅ Clear breaking change visibility
- ✅ Historical API evolution tracking
- ✅ Better extension developer experience