Skip to content

Commit

Permalink
Simplify nx task graph (#1333)
Browse files Browse the repository at this point in the history
* Remove dead dependency: `^pipeline`

* Rename `genfile` -> `gen-file`

* Remove `build-webpack` dependency on `^build`

* Remove `serve` dependency on `webpack`

* Add `serve` dependencies

* update serve target

---------

Co-authored-by: frzyc <[email protected]>
  • Loading branch information
lantua and frzyc authored Nov 12, 2023
1 parent 5333ea4 commit 8bf0b9c
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion apps/frontend/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"hmr": false
}
},
"dependsOn": ["build-webpack"]
"dependsOn": ["^gen-file"]
},
"lint": {},
"test": {}
Expand Down
3 changes: 2 additions & 1 deletion apps/gi-frontend/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"buildTarget": "gi-frontend:build-vite:production",
"hmr": false
}
}
},
"dependsOn": ["^gen-file"]
},
"preview": {
"executor": "@nx/vite:preview-server",
Expand Down
3 changes: 2 additions & 1 deletion apps/sr-frontend/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"buildTarget": "sr-frontend:build-vite:production",
"hmr": false
}
}
},
"dependsOn": ["^gen-file"]
},
"preview": {
"executor": "@nx/vite:preview-server",
Expand Down
2 changes: 1 addition & 1 deletion libs/dm/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
]
},
"genfile": {},
"gen-file": {},
"build": {},
"build-ts": {
"options": {
Expand Down
2 changes: 1 addition & 1 deletion libs/gi-assets/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"projectType": "library",
"tags": [],
"targets": {
"genfile": {
"gen-file": {
"executor": "@genshin-optimizer/gi-assets:gen-assets",
"outputs": ["{workspaceRoot}/${projectRoot}/src/gen/**/*"]
},
Expand Down
2 changes: 1 addition & 1 deletion libs/gi-dm-localization/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"sourceRoot": "libs/gi-dm-localization/src",
"projectType": "application",
"targets": {
"genfile": {
"gen-file": {
"executor": "@genshin-optimizer/gi-dm-localization:gen-locale",
"outputs": ["{projectRoot}/assets/locales"]
},
Expand Down
2 changes: 1 addition & 1 deletion libs/gi-localization/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"sourceRoot": "libs/gi-localization/src",
"projectType": "library",
"targets": {
"genfile": {
"gen-file": {
"executor": "@genshin-optimizer/gi-localization:gen-locale",
"outputs": [
"{projectRoot}/Translated",
Expand Down
2 changes: 1 addition & 1 deletion libs/gi-stats/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"sourceRoot": "libs/gi-stats/src",
"projectType": "library",
"targets": {
"genfile": {
"gen-file": {
"executor": "@genshin-optimizer/gi-stats:gen-stats",
"outputs": [
"{projectRoot}/Data/**/*",
Expand Down
2 changes: 1 addition & 1 deletion libs/silly-wisher-names/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"sourceRoot": "libs/silly-wisher-names/src",
"projectType": "library",
"targets": {
"genfile": {
"gen-file": {
"executor": "@genshin-optimizer/silly-wisher-names:gen-assets",
"outputs": ["{projectRoot}/assets/locales", "{projectRoot}/Translated"]
},
Expand Down
2 changes: 1 addition & 1 deletion libs/sr-assets/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"projectType": "library",
"tags": [],
"targets": {
"genfile": {
"gen-file": {
"executor": "@genshin-optimizer/sr-assets:gen-assets",
"outputs": ["{workspaceRoot}/${projectRoot}/src/gen/**/*"]
},
Expand Down
2 changes: 1 addition & 1 deletion libs/sr-dm/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
]
},
"genfile": {},
"gen-file": {},
"build": {},
"build-ts": {
"options": {
Expand Down
2 changes: 1 addition & 1 deletion libs/sr-stats/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"sourceRoot": "libs/sr-stats/src",
"projectType": "library",
"targets": {
"genfile": {
"gen-file": {
"executor": "@genshin-optimizer/sr-stats:gen-stats",
"outputs": [
"{projectRoot}/Data/**/*",
Expand Down
16 changes: 8 additions & 8 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"options": {
"cacheableOperations": [
"load-dm",
"genfile",
"gen-file",
"build",
"build-webpack",
"build-vite",
Expand All @@ -24,9 +24,9 @@
"executor": "@genshin-optimizer/plugin:sync-repo",
"outputs": ["{workspaceRoot}/{options.outputPath}.hash"]
},
"genfile": {
"gen-file": {
"executor": "nx:noop",
"dependsOn": ["load-dm", "^genfile"],
"dependsOn": ["load-dm", "^gen-file"],
"inputs": ["production", "^production"]
},
"build": {
Expand All @@ -35,7 +35,7 @@
"inputs": ["production", "^production"]
},
"build-webpack": {
"dependsOn": ["genfile", "^genfile", "^build", "^pipeline"],
"dependsOn": ["gen-file", "^gen-file"],
"inputs": ["production", "^production"]
},
"build-vite": {
Expand All @@ -53,7 +53,7 @@
"mode": "production"
}
},
"dependsOn": ["genfile", "^genfile", "^build", "^pipeline"],
"dependsOn": ["gen-file", "^gen-file", "^build"],
"inputs": ["production", "^production"]
},
"build-ts": {
Expand All @@ -64,7 +64,7 @@
"main": "{projectRoot}/src/index.ts",
"tsConfig": "{projectRoot}/tsconfig.lib.json"
},
"dependsOn": ["genfile", "^genfile", "^build", "^pipeline"],
"dependsOn": ["gen-file", "^gen-file", "^build"],
"inputs": ["production", "^production"]
},
"e2e": {
Expand All @@ -78,7 +78,7 @@
"fix": true
},
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
"dependsOn": ["genfile", "^genfile", "^pipeline"]
"dependsOn": ["gen-file", "^gen-file"]
},
"test": {
"executor": "@nx/jest:jest",
Expand All @@ -89,7 +89,7 @@
"reportsDirectory": "{workspaceRoot}/coverage/{projectRoot}",
"passWithNoTests": true
},
"dependsOn": ["genfile", "^genfile", "^pipeline"],
"dependsOn": ["gen-file", "^gen-file"],
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
},
"publish": {
Expand Down

0 comments on commit 8bf0b9c

Please sign in to comment.