Skip to content

Commit 86509bd

Browse files
Merge pull request #4667 from Comfy-Org/bl-merge-lg-fe
Merge ComfyUI_frontend and litegraph.js
2 parents 88aa6e8 + b33f820 commit 86509bd

File tree

284 files changed

+45307
-381
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

284 files changed

+45307
-381
lines changed

.claude/commands/create-frontend-release.md

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -171,53 +171,7 @@ echo "Last stable release: $LAST_STABLE"
171171

172172
### Step 7: Analyze Dependency Updates
173173

174-
1. **Check for dependency version changes:**
175-
```bash
176-
# Compare package.json between versions to detect dependency updates
177-
PREV_PACKAGE_JSON=$(git show ${BASE_TAG}:package.json 2>/dev/null || echo '{}')
178-
CURRENT_PACKAGE_JSON=$(cat package.json)
179-
180-
# Extract litegraph versions
181-
PREV_LITEGRAPH=$(echo "$PREV_PACKAGE_JSON" | grep -o '"@comfyorg/litegraph": "[^"]*"' | grep -o '[0-9][^"]*' || echo "not found")
182-
CURRENT_LITEGRAPH=$(echo "$CURRENT_PACKAGE_JSON" | grep -o '"@comfyorg/litegraph": "[^"]*"' | grep -o '[0-9][^"]*' || echo "not found")
183-
184-
echo "Litegraph version change: ${PREV_LITEGRAPH}${CURRENT_LITEGRAPH}"
185-
```
186-
187-
2. **Generate litegraph changelog if version changed:**
188-
```bash
189-
if [ "$PREV_LITEGRAPH" != "$CURRENT_LITEGRAPH" ] && [ "$PREV_LITEGRAPH" != "not found" ]; then
190-
echo "📦 Fetching litegraph changes between v${PREV_LITEGRAPH} and v${CURRENT_LITEGRAPH}..."
191-
192-
# Clone or update litegraph repo for changelog analysis
193-
if [ ! -d ".temp-litegraph" ]; then
194-
git clone https://github.com/comfyanonymous/litegraph.js.git .temp-litegraph
195-
else
196-
cd .temp-litegraph && git fetch --all && cd ..
197-
fi
198-
199-
# Get litegraph changelog between versions
200-
LITEGRAPH_CHANGES=$(cd .temp-litegraph && git log v${PREV_LITEGRAPH}..v${CURRENT_LITEGRAPH} --oneline --no-merges 2>/dev/null || \
201-
git log --oneline --no-merges --since="$(git log -1 --format=%ci ${BASE_TAG})" --until="$(git log -1 --format=%ci HEAD)" 2>/dev/null || \
202-
echo "Unable to fetch litegraph changes")
203-
204-
# Categorize litegraph changes
205-
LITEGRAPH_FEATURES=$(echo "$LITEGRAPH_CHANGES" | grep -iE "(feat|feature|add)" || echo "")
206-
LITEGRAPH_FIXES=$(echo "$LITEGRAPH_CHANGES" | grep -iE "(fix|bug)" || echo "")
207-
LITEGRAPH_BREAKING=$(echo "$LITEGRAPH_CHANGES" | grep -iE "(break|breaking)" || echo "")
208-
LITEGRAPH_OTHER=$(echo "$LITEGRAPH_CHANGES" | grep -viE "(feat|feature|add|fix|bug|break|breaking)" || echo "")
209-
210-
# Clean up temp directory
211-
rm -rf .temp-litegraph
212-
213-
echo "✅ Litegraph changelog extracted"
214-
else
215-
echo "ℹ️ No litegraph version change detected"
216-
LITEGRAPH_CHANGES=""
217-
fi
218-
```
219-
220-
3. **Check other significant dependency updates:**
174+
1. **Check significant dependency updates:**
221175
```bash
222176
# Extract all dependency changes for major version bumps
223177
OTHER_DEP_CHANGES=""

.cursor/rules/unit-test.mdc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
description: Creating unit tests
3+
globs:
4+
alwaysApply: false
5+
---
6+
7+
# Creating unit tests
8+
9+
- This project uses `vitest` for unit testing
10+
- Tests are stored in the `test/` directory
11+
- Tests should be cross-platform compatible; able to run on Windows, macOS, and linux
12+
- e.g. the use of `path.resolve`, or `path.join` and `path.sep` to ensure that tests work the same on all platforms
13+
- Tests should be mocked properly
14+
- Mocks should be cleanly written and easy to understand
15+
- Mocks should be re-usable where possible
16+
17+
## Unit test style
18+
19+
- Prefer the use of `test.extend` over loose variables
20+
- To achieve this, import `test as baseTest` from `vitest`
21+
- Never use `it`; `test` should be used in place of this

.github/workflows/update-litegraph.yaml

Lines changed: 0 additions & 43 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -694,14 +694,7 @@ For detailed instructions on adding and using custom icons, see [src/assets/icon
694694

695695
### litegraph.js
696696

697-
This repo is using litegraph package hosted on <https://github.com/Comfy-Org/litegraph.js>. Any changes to litegraph should be submitted in that repo instead.
698-
699-
#### Test litegraph.js changes
700-
701-
- Run `npm link` in the local litegraph repo.
702-
- Run `npm link @comfyorg/litegraph` in this repo.
703-
704-
This will replace the litegraph package in this repo with the local litegraph repo.
697+
The litegraph library is now included as a git subtree in `src/lib/litegraph`. Any changes to litegraph should be made directly in this location.
705698

706699
### i18n
707700

browser_tests/fixtures/ComfyPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import type { LGraphNode } from '@comfyorg/litegraph'
21
import type { APIRequestContext, Locator, Page } from '@playwright/test'
32
import { expect } from '@playwright/test'
43
import { test as base } from '@playwright/test'
54
import dotenv from 'dotenv'
65
import * as fs from 'fs'
76

7+
import type { LGraphNode } from '../../src/lib/litegraph/src/litegraph'
88
import type { NodeId } from '../../src/schemas/comfyWorkflowSchema'
99
import type { KeyCombo } from '../../src/schemas/keyBindingSchema'
1010
import type { useWorkspaceStore } from '../../src/stores/workspaceStore'

package-lock.json

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
"@alloc/quick-lru": "^5.2.0",
7979
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
8080
"@comfyorg/comfyui-electron-types": "^0.4.43",
81-
"@comfyorg/litegraph": "^0.17.1",
8281
"@primevue/forms": "^4.2.5",
8382
"@primevue/themes": "^4.2.5",
8483
"@sentry/vue": "^8.48.0",

scripts/prepare-types.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ const typesPackage = {
1616
homepage: mainPackage.homepage,
1717
description: `TypeScript definitions for ${mainPackage.name}`,
1818
license: mainPackage.license,
19-
dependencies: {
20-
'@comfyorg/litegraph': mainPackage.dependencies['@comfyorg/litegraph']
21-
},
19+
dependencies: {},
2220
peerDependencies: {
2321
vue: mainPackage.dependencies.vue,
2422
zod: mainPackage.dependencies.zod

src/components/dialog/content/MissingCoreNodesMessage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@
4242
</template>
4343

4444
<script setup lang="ts">
45-
import type { LGraphNode } from '@comfyorg/litegraph'
4645
import { whenever } from '@vueuse/core'
4746
import Message from 'primevue/message'
4847
import { computed, ref } from 'vue'
4948
49+
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
5050
import { useSystemStatsStore } from '@/stores/systemStatsStore'
5151
import { compareVersions } from '@/utils/formatUtil'
5252

src/components/graph/GraphCanvas.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
</template>
5050

5151
<script setup lang="ts">
52-
import type { LGraphNode } from '@comfyorg/litegraph'
5352
import { useEventListener, whenever } from '@vueuse/core'
5453
import { computed, onMounted, ref, watch, watchEffect } from 'vue'
5554
@@ -78,6 +77,7 @@ import { useWorkflowAutoSave } from '@/composables/useWorkflowAutoSave'
7877
import { useWorkflowPersistence } from '@/composables/useWorkflowPersistence'
7978
import { CORE_SETTINGS } from '@/constants/coreSettings'
8079
import { i18n, t } from '@/i18n'
80+
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
8181
import { UnauthorizedError, api } from '@/scripts/api'
8282
import { app as comfyApp } from '@/scripts/app'
8383
import { ChangeTracker } from '@/scripts/changeTracker'

0 commit comments

Comments
 (0)