From 8bf0b9c086c01a5ec2586d6431f4bcfe14ed1a5b Mon Sep 17 00:00:00 2001 From: lantua <16190491+lantua@users.noreply.github.com> Date: Sun, 12 Nov 2023 00:26:53 -0500 Subject: [PATCH] Simplify nx task graph (#1333) * 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 --- apps/frontend/project.json | 2 +- apps/gi-frontend/project.json | 3 ++- apps/sr-frontend/project.json | 3 ++- libs/dm/project.json | 2 +- libs/gi-assets/project.json | 2 +- libs/gi-dm-localization/project.json | 2 +- libs/gi-localization/project.json | 2 +- libs/gi-stats/project.json | 2 +- libs/silly-wisher-names/project.json | 2 +- libs/sr-assets/project.json | 2 +- libs/sr-dm/project.json | 2 +- libs/sr-stats/project.json | 2 +- nx.json | 16 ++++++++-------- 13 files changed, 22 insertions(+), 20 deletions(-) diff --git a/apps/frontend/project.json b/apps/frontend/project.json index 379f6cdb30..f1828d14a5 100644 --- a/apps/frontend/project.json +++ b/apps/frontend/project.json @@ -86,7 +86,7 @@ "hmr": false } }, - "dependsOn": ["build-webpack"] + "dependsOn": ["^gen-file"] }, "lint": {}, "test": {} diff --git a/apps/gi-frontend/project.json b/apps/gi-frontend/project.json index e31ac72e06..ca3642340e 100644 --- a/apps/gi-frontend/project.json +++ b/apps/gi-frontend/project.json @@ -21,7 +21,8 @@ "buildTarget": "gi-frontend:build-vite:production", "hmr": false } - } + }, + "dependsOn": ["^gen-file"] }, "preview": { "executor": "@nx/vite:preview-server", diff --git a/apps/sr-frontend/project.json b/apps/sr-frontend/project.json index c52656283e..82eaff1c67 100644 --- a/apps/sr-frontend/project.json +++ b/apps/sr-frontend/project.json @@ -22,7 +22,8 @@ "buildTarget": "sr-frontend:build-vite:production", "hmr": false } - } + }, + "dependsOn": ["^gen-file"] }, "preview": { "executor": "@nx/vite:preview-server", diff --git a/libs/dm/project.json b/libs/dm/project.json index 4e0a2057df..585fad7ffe 100644 --- a/libs/dm/project.json +++ b/libs/dm/project.json @@ -15,7 +15,7 @@ } ] }, - "genfile": {}, + "gen-file": {}, "build": {}, "build-ts": { "options": { diff --git a/libs/gi-assets/project.json b/libs/gi-assets/project.json index 153dcb4307..4972cbd43c 100644 --- a/libs/gi-assets/project.json +++ b/libs/gi-assets/project.json @@ -5,7 +5,7 @@ "projectType": "library", "tags": [], "targets": { - "genfile": { + "gen-file": { "executor": "@genshin-optimizer/gi-assets:gen-assets", "outputs": ["{workspaceRoot}/${projectRoot}/src/gen/**/*"] }, diff --git a/libs/gi-dm-localization/project.json b/libs/gi-dm-localization/project.json index f54cbc3ddd..06751511c0 100644 --- a/libs/gi-dm-localization/project.json +++ b/libs/gi-dm-localization/project.json @@ -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"] }, diff --git a/libs/gi-localization/project.json b/libs/gi-localization/project.json index f64a2e3d66..4111778ba5 100644 --- a/libs/gi-localization/project.json +++ b/libs/gi-localization/project.json @@ -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", diff --git a/libs/gi-stats/project.json b/libs/gi-stats/project.json index c10b632c83..fecf76a01f 100644 --- a/libs/gi-stats/project.json +++ b/libs/gi-stats/project.json @@ -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/**/*", diff --git a/libs/silly-wisher-names/project.json b/libs/silly-wisher-names/project.json index d405f3531a..65d8cce66b 100644 --- a/libs/silly-wisher-names/project.json +++ b/libs/silly-wisher-names/project.json @@ -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"] }, diff --git a/libs/sr-assets/project.json b/libs/sr-assets/project.json index 546f67b4cb..595f5190bb 100644 --- a/libs/sr-assets/project.json +++ b/libs/sr-assets/project.json @@ -5,7 +5,7 @@ "projectType": "library", "tags": [], "targets": { - "genfile": { + "gen-file": { "executor": "@genshin-optimizer/sr-assets:gen-assets", "outputs": ["{workspaceRoot}/${projectRoot}/src/gen/**/*"] }, diff --git a/libs/sr-dm/project.json b/libs/sr-dm/project.json index 6ac64e65e1..3d15ad97e6 100644 --- a/libs/sr-dm/project.json +++ b/libs/sr-dm/project.json @@ -15,7 +15,7 @@ } ] }, - "genfile": {}, + "gen-file": {}, "build": {}, "build-ts": { "options": { diff --git a/libs/sr-stats/project.json b/libs/sr-stats/project.json index 0a7f835dd1..c970698c84 100644 --- a/libs/sr-stats/project.json +++ b/libs/sr-stats/project.json @@ -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/**/*", diff --git a/nx.json b/nx.json index 4f0df3b7ed..e1f586fe79 100644 --- a/nx.json +++ b/nx.json @@ -7,7 +7,7 @@ "options": { "cacheableOperations": [ "load-dm", - "genfile", + "gen-file", "build", "build-webpack", "build-vite", @@ -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": { @@ -35,7 +35,7 @@ "inputs": ["production", "^production"] }, "build-webpack": { - "dependsOn": ["genfile", "^genfile", "^build", "^pipeline"], + "dependsOn": ["gen-file", "^gen-file"], "inputs": ["production", "^production"] }, "build-vite": { @@ -53,7 +53,7 @@ "mode": "production" } }, - "dependsOn": ["genfile", "^genfile", "^build", "^pipeline"], + "dependsOn": ["gen-file", "^gen-file", "^build"], "inputs": ["production", "^production"] }, "build-ts": { @@ -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": { @@ -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", @@ -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": {