diff --git a/.claude/commands/create-frontend-release.md b/.claude/commands/create-frontend-release.md index 91afe7de3..cce1664c6 100644 --- a/.claude/commands/create-frontend-release.md +++ b/.claude/commands/create-frontend-release.md @@ -171,53 +171,7 @@ echo "Last stable release: $LAST_STABLE" ### Step 7: Analyze Dependency Updates -1. **Check for dependency version changes:** - ```bash - # Compare package.json between versions to detect dependency updates - PREV_PACKAGE_JSON=$(git show ${BASE_TAG}:package.json 2>/dev/null || echo '{}') - CURRENT_PACKAGE_JSON=$(cat package.json) - - # Extract litegraph versions - PREV_LITEGRAPH=$(echo "$PREV_PACKAGE_JSON" | grep -o '"@comfyorg/litegraph": "[^"]*"' | grep -o '[0-9][^"]*' || echo "not found") - CURRENT_LITEGRAPH=$(echo "$CURRENT_PACKAGE_JSON" | grep -o '"@comfyorg/litegraph": "[^"]*"' | grep -o '[0-9][^"]*' || echo "not found") - - echo "Litegraph version change: ${PREV_LITEGRAPH} β†’ ${CURRENT_LITEGRAPH}" - ``` - -2. **Generate litegraph changelog if version changed:** - ```bash - if [ "$PREV_LITEGRAPH" != "$CURRENT_LITEGRAPH" ] && [ "$PREV_LITEGRAPH" != "not found" ]; then - echo "πŸ“¦ Fetching litegraph changes between v${PREV_LITEGRAPH} and v${CURRENT_LITEGRAPH}..." - - # Clone or update litegraph repo for changelog analysis - if [ ! -d ".temp-litegraph" ]; then - git clone https://github.com/comfyanonymous/litegraph.js.git .temp-litegraph - else - cd .temp-litegraph && git fetch --all && cd .. - fi - - # Get litegraph changelog between versions - LITEGRAPH_CHANGES=$(cd .temp-litegraph && git log v${PREV_LITEGRAPH}..v${CURRENT_LITEGRAPH} --oneline --no-merges 2>/dev/null || \ - git log --oneline --no-merges --since="$(git log -1 --format=%ci ${BASE_TAG})" --until="$(git log -1 --format=%ci HEAD)" 2>/dev/null || \ - echo "Unable to fetch litegraph changes") - - # Categorize litegraph changes - LITEGRAPH_FEATURES=$(echo "$LITEGRAPH_CHANGES" | grep -iE "(feat|feature|add)" || echo "") - LITEGRAPH_FIXES=$(echo "$LITEGRAPH_CHANGES" | grep -iE "(fix|bug)" || echo "") - LITEGRAPH_BREAKING=$(echo "$LITEGRAPH_CHANGES" | grep -iE "(break|breaking)" || echo "") - LITEGRAPH_OTHER=$(echo "$LITEGRAPH_CHANGES" | grep -viE "(feat|feature|add|fix|bug|break|breaking)" || echo "") - - # Clean up temp directory - rm -rf .temp-litegraph - - echo "βœ… Litegraph changelog extracted" - else - echo "ℹ️ No litegraph version change detected" - LITEGRAPH_CHANGES="" - fi - ``` - -3. **Check other significant dependency updates:** +1. **Check significant dependency updates:** ```bash # Extract all dependency changes for major version bumps OTHER_DEP_CHANGES="" diff --git a/.cursor/rules/unit-test.mdc b/.cursor/rules/unit-test.mdc new file mode 100644 index 000000000..2c6704f3e --- /dev/null +++ b/.cursor/rules/unit-test.mdc @@ -0,0 +1,21 @@ +--- +description: Creating unit tests +globs: +alwaysApply: false +--- + +# Creating unit tests + +- This project uses `vitest` for unit testing +- Tests are stored in the `test/` directory +- Tests should be cross-platform compatible; able to run on Windows, macOS, and linux + - e.g. the use of `path.resolve`, or `path.join` and `path.sep` to ensure that tests work the same on all platforms +- Tests should be mocked properly + - Mocks should be cleanly written and easy to understand + - Mocks should be re-usable where possible + +## Unit test style + +- Prefer the use of `test.extend` over loose variables + - To achieve this, import `test as baseTest` from `vitest` +- Never use `it`; `test` should be used in place of this \ No newline at end of file diff --git a/.github/workflows/update-litegraph.yaml b/.github/workflows/update-litegraph.yaml deleted file mode 100644 index bc77f3a55..000000000 --- a/.github/workflows/update-litegraph.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: Update Litegraph Dependency - -on: - workflow_dispatch: - -jobs: - update-litegraph: - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - - - name: Update litegraph - run: npm install @comfyorg/litegraph@latest - - - name: Get new version - id: get-version - run: | - NEW_VERSION=$(node -e "console.log(JSON.parse(require('fs').readFileSync('./package-lock.json')).packages['node_modules/@comfyorg/litegraph'].version)") - echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_OUTPUT - - - name: Create Pull Request - uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e - with: - token: ${{ secrets.PR_GH_TOKEN }} - commit-message: '[chore] Update litegraph to ${{ steps.get-version.outputs.NEW_VERSION }}' - title: '[chore] Update litegraph to ${{ steps.get-version.outputs.NEW_VERSION }}' - body: | - Automated update of litegraph to version ${{ steps.get-version.outputs.NEW_VERSION }}. - Ref: https://github.com/Comfy-Org/litegraph.js/releases/tag/v${{ steps.get-version.outputs.NEW_VERSION }} - branch: update-litegraph-${{ steps.get-version.outputs.NEW_VERSION }} - base: main - labels: | - dependencies diff --git a/README.md b/README.md index 89aa97687..32756e810 100644 --- a/README.md +++ b/README.md @@ -694,14 +694,7 @@ For detailed instructions on adding and using custom icons, see [src/assets/icon ### litegraph.js -This repo is using litegraph package hosted on . Any changes to litegraph should be submitted in that repo instead. - -#### Test litegraph.js changes - -- Run `npm link` in the local litegraph repo. -- Run `npm link @comfyorg/litegraph` in this repo. - -This will replace the litegraph package in this repo with the local litegraph repo. +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. ### i18n diff --git a/browser_tests/fixtures/ComfyPage.ts b/browser_tests/fixtures/ComfyPage.ts index 72445087f..6369d654c 100644 --- a/browser_tests/fixtures/ComfyPage.ts +++ b/browser_tests/fixtures/ComfyPage.ts @@ -1,10 +1,10 @@ -import type { LGraphNode } from '@comfyorg/litegraph' import type { APIRequestContext, Locator, Page } from '@playwright/test' import { expect } from '@playwright/test' import { test as base } from '@playwright/test' import dotenv from 'dotenv' import * as fs from 'fs' +import type { LGraphNode } from '../../src/lib/litegraph/src/litegraph' import type { NodeId } from '../../src/schemas/comfyWorkflowSchema' import type { KeyCombo } from '../../src/schemas/keyBindingSchema' import type { useWorkspaceStore } from '../../src/stores/workspaceStore' diff --git a/package-lock.json b/package-lock.json index 129f6f773..c303144c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,6 @@ "@alloc/quick-lru": "^5.2.0", "@atlaskit/pragmatic-drag-and-drop": "^1.3.1", "@comfyorg/comfyui-electron-types": "^0.4.43", - "@comfyorg/litegraph": "^0.17.1", "@primevue/forms": "^4.2.5", "@primevue/themes": "^4.2.5", "@sentry/vue": "^8.48.0", @@ -976,12 +975,6 @@ "integrity": "sha512-o6WFbYn9yAkGbkOwvhPF7pbKDvN0occZ21Tfyhya8CIsIqKpTHLft0aOqo4yhSh+kTxN16FYjsfrTH5Olk4WuA==", "license": "GPL-3.0-only" }, - "node_modules/@comfyorg/litegraph": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@comfyorg/litegraph/-/litegraph-0.17.1.tgz", - "integrity": "sha512-SaDDWFvoH1bCfibvZjtX0JoLvFTJw2MUOWzrjyeuWVs00JpxiJ1I5f6oH/AO8lJqKdASWBVPzpC9zPMG45w4IQ==", - "license": "MIT" - }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", diff --git a/package.json b/package.json index 6c98a80c5..417253a78 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,6 @@ "@alloc/quick-lru": "^5.2.0", "@atlaskit/pragmatic-drag-and-drop": "^1.3.1", "@comfyorg/comfyui-electron-types": "^0.4.43", - "@comfyorg/litegraph": "^0.17.1", "@primevue/forms": "^4.2.5", "@primevue/themes": "^4.2.5", "@sentry/vue": "^8.48.0", diff --git a/scripts/prepare-types.js b/scripts/prepare-types.js index 86890ed33..625579dad 100644 --- a/scripts/prepare-types.js +++ b/scripts/prepare-types.js @@ -16,9 +16,7 @@ const typesPackage = { homepage: mainPackage.homepage, description: `TypeScript definitions for ${mainPackage.name}`, license: mainPackage.license, - dependencies: { - '@comfyorg/litegraph': mainPackage.dependencies['@comfyorg/litegraph'] - }, + dependencies: {}, peerDependencies: { vue: mainPackage.dependencies.vue, zod: mainPackage.dependencies.zod diff --git a/src/components/dialog/content/MissingCoreNodesMessage.vue b/src/components/dialog/content/MissingCoreNodesMessage.vue index 40347061e..036f088b3 100644 --- a/src/components/dialog/content/MissingCoreNodesMessage.vue +++ b/src/components/dialog/content/MissingCoreNodesMessage.vue @@ -42,11 +42,11 @@