-
Notifications
You must be signed in to change notification settings - Fork 2.5k
chore(nx-dev): use continuous tasks in nx-dev #31127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
4bd6321
e49175e
ce5a874
893a996
a8b2b97
16fcf32
0e88810
98d94ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,19 +5,8 @@ | |||||
"projectType": "application", | ||||||
"targets": { | ||||||
"build": { | ||||||
"dependsOn": [ | ||||||
{ | ||||||
"target": "build-base" | ||||||
} | ||||||
], | ||||||
"executor": "nx:run-commands", | ||||||
"options": { | ||||||
"commands": [ | ||||||
"nx run nx-dev:sitemap", | ||||||
"ts-node -P ./scripts/tsconfig.scripts.json ./scripts/documentation/internal-link-checker.ts" | ||||||
], | ||||||
"parallel": false | ||||||
}, | ||||||
"dependsOn": ["sitemap"], | ||||||
"command": "ts-node -P ./scripts/tsconfig.scripts.json ./scripts/documentation/internal-link-checker.ts", | ||||||
"inputs": [ | ||||||
"production", | ||||||
"^production", | ||||||
|
@@ -27,11 +16,9 @@ | |||||
"outputs": ["{workspaceRoot}/dist/nx-dev/nx-dev"] | ||||||
}, | ||||||
"sitemap": { | ||||||
"executor": "nx:run-commands", | ||||||
"outputs": ["{workspaceRoot}/dist/nx-dev/nx-dev/public"], | ||||||
"options": { | ||||||
"command": "pnpm next-sitemap --config ./nx-dev/nx-dev/next-sitemap.config.js" | ||||||
} | ||||||
"dependsOn": ["build-base"], | ||||||
"command": "pnpm next-sitemap --config ./nx-dev/nx-dev/next-sitemap.config.js" | ||||||
}, | ||||||
"generate-og-images": { | ||||||
"executor": "nx:run-commands", | ||||||
|
@@ -43,7 +30,7 @@ | |||||
"build-base": { | ||||||
"parallelism": false, | ||||||
"executor": "@nx/next:build", | ||||||
"dependsOn": ["copy-docs"], | ||||||
"dependsOn": ["copy-docs", "copy-tutorial"], | ||||||
"outputs": ["{options.outputPath}"], | ||||||
"options": { | ||||||
"root": "nx-dev/nx-dev", | ||||||
|
@@ -73,23 +60,21 @@ | |||||
"cwd": "nx-dev/nx-dev" | ||||||
} | ||||||
}, | ||||||
"serve-docs": { | ||||||
"executor": "nx:run-commands", | ||||||
"options": { | ||||||
"commands": [ | ||||||
"nx watch --projects=docs,tutorial -- nx run-many -t=copy-docs,copy-tutorial -p nx-dev", | ||||||
"nx run nx-dev:serve" | ||||||
], | ||||||
"parallel": true | ||||||
} | ||||||
"watch-docs": { | ||||||
"continuous": true, | ||||||
"command": "nx watch --projects=docs,tutorial -- nx run-many -t=copy-docs,copy-tutorial -p nx-dev" | ||||||
}, | ||||||
"start": { | ||||||
"dependsOn": ["build-base"], | ||||||
"continuous": true, | ||||||
"command": "nx run nx-dev:serve:production" | ||||||
}, | ||||||
"serve-docs": { | ||||||
"continuous": true, | ||||||
"command": "nx run nx-dev:serve" | ||||||
}, | ||||||
"serve": { | ||||||
"executor": "@nx/next:server", | ||||||
"dependsOn": ["copy-docs", "copy-tutorial"], | ||||||
"dependsOn": ["copy-docs", "copy-tutorial", "watch-docs"], | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Consider one of these alternatives:
This ensures both tasks can run simultaneously without blocking each other.
Suggested change
Spotted by Diamond |
||||||
"options": { | ||||||
"buildTarget": "nx-dev:build-base", | ||||||
"dev": true | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change introduces a circular dependency in the task execution flow. Currently:
build
depends onsitemap
sitemap
depends onbuild-base
This creates a cycle that differs from the original execution order where
build
depended onbuild-base
first, then ran the sitemap command.To maintain the original execution order while using the new continuous task format, consider changing the dependency to:
Then have the
sitemap
task run before the link checker command, or include both commands in sequence.Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.