Skip to content

Commit d0eee73

Browse files
authored
nx: Initialize nx (#5235)
* nx: Initialize nx https://nx.dev/getting-started/adding-to-existing * fix: Migrator ordering issue for vitest scripts * nit: trailing newline * deps: Updated select dependencies to fix Storybook with pnpm * fix: Add explicit knip entry point for current workspace ...since it's not inferred from the script now.
1 parent f3d9f4c commit d0eee73

File tree

9 files changed

+3739
-1958
lines changed

9 files changed

+3739
-1958
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,12 @@ vite.config.mts.timestamp-*.mjs
7676
*storybook.log
7777
storybook-static
7878

79+
80+
81+
82+
.nx/cache
83+
.nx/workspace-data
84+
.cursor/rules/nx-rules.mdc
85+
.github/instructions/nx.instructions.md
86+
vite.config.*.timestamp*
87+
vitest.config.*.timestamp*

eslint.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ export default [
1717
'src/scripts/*',
1818
'src/extensions/core/*',
1919
'src/types/vue-shim.d.ts',
20-
// Generated files that don't need linting
2120
'src/types/comfyRegistryTypes.ts',
22-
'src/types/generatedManagerTypes.ts'
21+
'src/types/generatedManagerTypes.ts',
22+
'**/vite.config.*.timestamp*',
23+
'**/vitest.config.*.timestamp*'
2324
]
2425
},
2526
{

knip.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const config: KnipConfig = {
7474
// Workspace configuration for monorepo-like structure
7575
workspaces: {
7676
'.': {
77-
entry: ['src/main.ts']
77+
entry: ['src/main.ts', 'playwright.i18n.config.ts']
7878
}
7979
}
8080
}

nx.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"$schema": "./node_modules/nx/schemas/nx-schema.json",
3+
"plugins": [
4+
{
5+
"plugin": "@nx/eslint/plugin",
6+
"options": {
7+
"targetName": "lint"
8+
}
9+
},
10+
{
11+
"plugin": "@nx/storybook/plugin",
12+
"options": {
13+
"serveStorybookTargetName": "storybook",
14+
"buildStorybookTargetName": "build-storybook",
15+
"testStorybookTargetName": "test-storybook",
16+
"staticStorybookTargetName": "static-storybook"
17+
}
18+
},
19+
{
20+
"plugin": "@nx/vite/plugin",
21+
"options": {
22+
"buildTargetName": "build",
23+
"testTargetName": "test",
24+
"serveTargetName": "serve",
25+
"devTargetName": "dev",
26+
"previewTargetName": "preview",
27+
"serveStaticTargetName": "serve-static",
28+
"typecheckTargetName": "typecheck",
29+
"buildDepsTargetName": "build-deps",
30+
"watchDepsTargetName": "watch-deps"
31+
}
32+
},
33+
{
34+
"plugin": "@nx/playwright/plugin",
35+
"options": {
36+
"targetName": "e2e"
37+
}
38+
}
39+
]
40+
}

package.json

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,46 @@
88
"description": "Official front-end implementation of ComfyUI",
99
"license": "GPL-3.0-only",
1010
"scripts": {
11-
"dev": "vite",
12-
"dev:electron": "vite --config vite.electron.config.mts",
13-
"build": "pnpm typecheck && vite build",
14-
"build:types": "vite build --config vite.types.config.mts && node scripts/prepare-types.js",
11+
"dev": "nx serve",
12+
"dev:electron": "nx serve --config vite.electron.config.mts",
13+
"build": "pnpm typecheck && nx build",
14+
"build:types": "nx build --config vite.types.config.mts && node scripts/prepare-types.js",
1515
"zipdist": "node scripts/zipdist.js",
1616
"typecheck": "vue-tsc --noEmit",
1717
"format": "prettier --write './**/*.{js,ts,tsx,vue,mts}' --cache",
1818
"format:check": "prettier --check './**/*.{js,ts,tsx,vue,mts}' --cache",
1919
"format:no-cache": "prettier --write './**/*.{js,ts,tsx,vue,mts}'",
2020
"format:check:no-cache": "prettier --check './**/*.{js,ts,tsx,vue,mts}'",
21-
"test:browser": "npx playwright test",
22-
"test:unit": "vitest run tests-ui/tests",
23-
"test:component": "vitest run src/components/",
21+
"test:browser": "npx nx e2e",
22+
"test:unit": "nx run test tests-ui/tests",
23+
"test:component": "nx run test src/components/",
2424
"preinstall": "npx only-allow pnpm",
2525
"prepare": "husky || true && git config blame.ignoreRevsFile .git-blame-ignore-revs || true",
26-
"preview": "vite preview",
26+
"preview": "nx preview",
2727
"lint": "eslint src --cache",
2828
"lint:fix": "eslint src --cache --fix",
2929
"lint:no-cache": "eslint src",
3030
"lint:fix:no-cache": "eslint src --fix",
3131
"knip": "knip --cache",
3232
"knip:no-cache": "knip",
3333
"locale": "lobe-i18n locale",
34-
"collect-i18n": "playwright test --config=playwright.i18n.config.ts",
34+
"collect-i18n": "nx e2e --config=playwright.i18n.config.ts",
3535
"json-schema": "tsx scripts/generate-json-schema.ts",
36-
"storybook": "storybook dev -p 6006",
37-
"build-storybook": "storybook build"
36+
"storybook": "nx storybook -p 6006",
37+
"build-storybook": "nx build-storybook"
3838
},
3939
"devDependencies": {
4040
"@eslint/js": "^9.8.0",
41-
"@executeautomation/playwright-mcp-server": "^1.0.5",
41+
"@executeautomation/playwright-mcp-server": "^1.0.6",
4242
"@iconify/json": "^2.2.245",
4343
"@iconify/tailwind": "^1.2.0",
4444
"@intlify/eslint-plugin-vue-i18n": "^3.2.0",
45-
"@lobehub/i18n-cli": "^1.20.0",
45+
"@lobehub/i18n-cli": "^1.25.1",
46+
"@nx/eslint": "21.4.1",
47+
"@nx/playwright": "21.4.1",
48+
"@nx/storybook": "21.4.1",
49+
"@nx/vite": "21.4.1",
50+
"@nx/web": "21.4.1",
4651
"@pinia/testing": "^0.1.5",
4752
"@playwright/test": "^1.52.0",
4853
"@storybook/addon-docs": "^9.1.1",
@@ -55,6 +60,7 @@
5560
"@types/semver": "^7.7.0",
5661
"@types/three": "^0.169.0",
5762
"@vitejs/plugin-vue": "^5.1.4",
63+
"@vitest/ui": "^3.0.0",
5864
"@vue/test-utils": "^2.4.6",
5965
"autoprefixer": "^10.4.19",
6066
"chalk": "^5.3.0",
@@ -70,14 +76,16 @@
7076
"happy-dom": "^15.11.0",
7177
"husky": "^9.0.11",
7278
"identity-obj-proxy": "^3.0.0",
73-
"ink": "^4.2.0",
79+
"ink": "^6.2.2",
80+
"jiti": "2.4.2",
7481
"knip": "^5.62.0",
7582
"lint-staged": "^15.2.7",
7683
"lucide-vue-next": "^0.540.0",
84+
"nx": "21.4.1",
7785
"postcss": "^8.4.39",
7886
"prettier": "^3.3.2",
79-
"react": "^18.3.1",
80-
"react-reconciler": "^0.29.2",
87+
"react": "^19.1.1",
88+
"react-reconciler": "^0.32.0",
8189
"storybook": "^9.1.1",
8290
"tailwindcss": "^3.4.4",
8391
"tsx": "^4.15.6",
@@ -90,7 +98,7 @@
9098
"vite-plugin-dts": "^4.3.0",
9199
"vite-plugin-html": "^3.2.2",
92100
"vite-plugin-vue-devtools": "^7.7.6",
93-
"vitest": "^2.0.0",
101+
"vitest": "^3.2.4",
94102
"vue-tsc": "^2.1.10",
95103
"zip-dir": "^2.0.0",
96104
"zod-to-json-schema": "^3.24.1"

0 commit comments

Comments
 (0)