Skip to content

Commit 9d609d9

Browse files
webfilteredarjansingh
authored andcommitted
Extract registry types into workspace package (#5840)
## Summary Extracts ComfyUI registry types into a dedicated workspace package for better modularity. ## Changes - **What**: Created `@comfyorg/registry-types` package to house generated type definitions - **Breaking**: None - maintains backward compatibility through re-exports at original path - **Dependencies**: Added `@comfyorg/registry-types` as workspace dependency ## Review Focus Is this the right granularity for package extraction, or should registry types be part of a larger shared package? PR split into two tiny diffs: - [Part one](https://github.com/Comfy-Org/ComfyUI_frontend/pull/5840/files/f8d3d2fa014aa4215e99d3ea93c1ebcabd6246d6) - [Part two](https://github.com/Comfy-Org/ComfyUI_frontend/pull/5840/files/f8d3d2fa014aa4215e99d3ea93c1ebcabd6246d6..c48ca843366c86a5d2214c036dcd9b24128a970a) ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5840-Extract-registry-types-into-workspace-package-27c6d73d365081dbb824d680ce739316) by [Unito](https://www.unito.io)
1 parent aa1afc8 commit 9d609d9

File tree

11 files changed

+19520
-19484
lines changed

11 files changed

+19520
-19484
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
*.yaml text eol=lf
1313

1414
# Generated files
15-
src/types/comfyRegistryTypes.ts linguist-generated=true
15+
packages/registry-types/src/comfyRegistryTypes.ts linguist-generated=true
1616
src/workbench/extensions/manager/types/generatedManagerTypes.ts linguist-generated=true

.github/workflows/update-registry-types.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,30 +68,31 @@ jobs:
6868
- name: Generate API types
6969
run: |
7070
echo "Generating TypeScript types from comfy-api@${{ steps.api-info.outputs.commit }}..."
71-
pnpm dlx openapi-typescript ./comfy-api/openapi.yml --output ./src/types/comfyRegistryTypes.ts
71+
mkdir -p ./packages/registry-types/src
72+
pnpm dlx openapi-typescript ./comfy-api/openapi.yml --output ./packages/registry-types/src/comfyRegistryTypes.ts
7273
7374
- name: Validate generated types
7475
run: |
75-
if [ ! -f ./src/types/comfyRegistryTypes.ts ]; then
76+
if [ ! -f ./packages/registry-types/src/comfyRegistryTypes.ts ]; then
7677
echo "Error: Types file was not generated."
7778
exit 1
7879
fi
7980
8081
# Check if file is not empty
81-
if [ ! -s ./src/types/comfyRegistryTypes.ts ]; then
82+
if [ ! -s ./packages/registry-types/src/comfyRegistryTypes.ts ]; then
8283
echo "Error: Generated types file is empty."
8384
exit 1
8485
fi
8586
8687
- name: Lint generated types
8788
run: |
8889
echo "Linting generated Comfy Registry API types..."
89-
pnpm lint:fix:no-cache -- ./src/types/comfyRegistryTypes.ts
90+
pnpm lint:fix:no-cache -- ./packages/registry-types/src/comfyRegistryTypes.ts
9091
9192
- name: Check for changes
9293
id: check-changes
9394
run: |
94-
if [[ -z $(git status --porcelain ./src/types/comfyRegistryTypes.ts) ]]; then
95+
if [[ -z $(git status --porcelain ./packages/registry-types/src/comfyRegistryTypes.ts) ]]; then
9596
echo "No changes to Comfy Registry API types detected."
9697
echo "changed=false" >> $GITHUB_OUTPUT
9798
exit 0
@@ -121,4 +122,4 @@ jobs:
121122
labels: CNR
122123
delete-branch: true
123124
add-paths: |
124-
src/types/comfyRegistryTypes.ts
125+
packages/registry-types/src/comfyRegistryTypes.ts

.prettierignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
src/types/comfyRegistryTypes.ts
2-
src/types/generatedManagerTypes.ts
1+
packages/registry-types/src/comfyRegistryTypes.ts
2+
src/types/generatedManagerTypes.ts

eslint.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default defineConfig([
1818
'src/scripts/*',
1919
'src/extensions/core/*',
2020
'src/types/vue-shim.d.ts',
21-
'src/types/comfyRegistryTypes.ts',
21+
'packages/registry-types/src/comfyRegistryTypes.ts',
2222
'src/types/generatedManagerTypes.ts',
2323
'**/vite.config.*.timestamp*',
2424
'**/vitest.config.*.timestamp*',

knip.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ const config: KnipConfig = {
1818
'packages/design-system': {
1919
entry: ['src/**/*.ts'],
2020
project: ['src/**/*.{js,ts}', '*.{js,ts,mts}']
21+
},
22+
'packages/registry-types': {
23+
entry: ['src/comfyRegistryTypes.ts'],
24+
project: ['src/**/*.{js,ts}']
2125
}
2226
},
2327
ignoreBinaries: ['python3'],
@@ -34,7 +38,7 @@ const config: KnipConfig = {
3438
ignore: [
3539
// Auto generated manager types
3640
'src/workbench/extensions/manager/types/generatedManagerTypes.ts',
37-
'src/types/comfyRegistryTypes.ts',
41+
'packages/registry-types/src/comfyRegistryTypes.ts',
3842
// Used by a custom node (that should move off of this)
3943
'src/scripts/ui/components/splitButton.ts'
4044
],

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
108108
"@comfyorg/comfyui-electron-types": "0.4.73-0",
109109
"@comfyorg/design-system": "workspace:*",
110+
"@comfyorg/registry-types": "workspace:*",
110111
"@comfyorg/tailwind-utils": "workspace:*",
111112
"@iconify/json": "^2.2.380",
112113
"@primeuix/forms": "0.0.2",
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "@comfyorg/registry-types",
3+
"version": "1.0.0",
4+
"description": "Comfy Registry API TypeScript types",
5+
"packageManager": "[email protected]",
6+
"type": "module",
7+
"exports": {
8+
".": "./src/comfyRegistryTypes.ts"
9+
},
10+
"nx": {
11+
"tags": [
12+
"scope:shared",
13+
"type:types"
14+
]
15+
}
16+
}

0 commit comments

Comments
 (0)