Skip to content

Commit 2cd3252

Browse files
Coly010FrozenPandaz
authored andcommitted
feat(js): infer continuous for watch-deps task (#29976)
## Current Behavior The `@nx/js` plugin exposes a helper to generate `build-deps` and `watch-deps` tasks for inference plugins. It does not currently infer `continuous` for the `watch-deps` task. ## Expected Behavior Ensure `watch-deps` is infered with `continuous: true`
1 parent 229cf28 commit 2cd3252

File tree

12 files changed

+21
-0
lines changed

12 files changed

+21
-0
lines changed

packages/js/src/plugins/typescript/plugin.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2893,6 +2893,7 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
28932893
},
28942894
"watch-deps": {
28952895
"command": "npx nx watch --projects my-lib --includeDependentProjects -- npx nx build-deps my-lib",
2896+
"continuous": true,
28962897
"dependsOn": [
28972898
"build-deps",
28982899
],
@@ -3047,6 +3048,7 @@ describe(`Plugin: ${PLUGIN_NAME}`, () => {
30473048
},
30483049
"watch-deps": {
30493050
"command": "npx nx watch --projects my-lib --includeDependentProjects -- npx nx build-deps my-lib",
3051+
"continuous": true,
30503052
"dependsOn": [
30513053
"build-deps",
30523054
],

packages/js/src/plugins/typescript/util.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export function addBuildAndWatchDepsTargets(
4747
dependsOn: ['^build'],
4848
};
4949
targets[options.watchDepsTargetName ?? 'watch-deps'] = {
50+
continuous: true,
5051
dependsOn: [buildDepsTargetName],
5152
command: `${pmc.exec} nx watch --projects ${projectName} --includeDependentProjects -- ${pmc.exec} nx ${buildDepsTargetName} ${projectName}`,
5253
};

packages/next/src/plugins/__snapshots__/plugin.spec.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ exports[`@nx/next/plugin integrated projects should create nodes 1`] = `
6464
},
6565
"watch-deps": {
6666
"command": "npx nx watch --projects my-app --includeDependentProjects -- npx nx build-deps my-app",
67+
"continuous": true,
6768
"dependsOn": [
6869
"build-deps",
6970
],
@@ -140,6 +141,7 @@ exports[`@nx/next/plugin root projects should create nodes 1`] = `
140141
},
141142
"watch-deps": {
142143
"command": "npx nx watch --projects next --includeDependentProjects -- npx nx build-deps next",
144+
"continuous": true,
143145
"dependsOn": [
144146
"build-deps",
145147
],

packages/nuxt/src/plugins/__snapshots__/plugin.spec.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ exports[`@nx/nuxt/plugin not root project should create nodes 1`] = `
7474
},
7575
"watch-deps": {
7676
"command": "npx nx watch --projects my-app --includeDependentProjects -- npx nx build-deps my-app",
77+
"continuous": true,
7778
"dependsOn": [
7879
"build-deps",
7980
],
@@ -158,6 +159,7 @@ exports[`@nx/nuxt/plugin root project should create nodes 1`] = `
158159
},
159160
"watch-deps": {
160161
"command": "npx nx watch --projects nuxt --includeDependentProjects -- npx nx build-deps nuxt",
162+
"continuous": true,
161163
"dependsOn": [
162164
"build-deps",
163165
],

packages/remix/src/plugins/__snapshots__/plugin.spec.ts.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ exports[`@nx/remix/plugin Remix Classic Compiler non-root project should create
107107
},
108108
"watch-deps": {
109109
"command": "npx nx watch --projects my-app --includeDependentProjects -- npx nx build-deps my-app",
110+
"continuous": true,
110111
"dependsOn": [
111112
"build-deps",
112113
],
@@ -226,6 +227,7 @@ exports[`@nx/remix/plugin Remix Classic Compiler non-root project should infer w
226227
},
227228
"watch-deps": {
228229
"command": "npx nx watch --projects my-app --includeDependentProjects -- npx nx build-deps my-app",
230+
"continuous": true,
229231
"dependsOn": [
230232
"build-deps",
231233
],
@@ -452,6 +454,7 @@ exports[`@nx/remix/plugin Remix Vite Compiler non-root project should create nod
452454
},
453455
"watch-deps": {
454456
"command": "npx nx watch --projects my-app --includeDependentProjects -- npx nx build-deps my-app",
457+
"continuous": true,
455458
"dependsOn": [
456459
"build-deps",
457460
],

packages/rollup/src/plugins/__snapshots__/plugin.spec.ts.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ exports[`@nx/rollup/plugin non-root project should create nodes 1`] = `
5454
},
5555
"watch-deps": {
5656
"command": "npx nx watch --projects mylib --includeDependentProjects -- npx nx build-deps mylib",
57+
"continuous": true,
5758
"dependsOn": [
5859
"build-deps",
5960
],
@@ -120,6 +121,7 @@ exports[`@nx/rollup/plugin non-root project should create nodes 2`] = `
120121
},
121122
"watch-deps": {
122123
"command": "npx nx watch --projects mylib --includeDependentProjects -- npx nx build-deps mylib",
124+
"continuous": true,
123125
"dependsOn": [
124126
"build-deps",
125127
],
@@ -185,6 +187,7 @@ exports[`@nx/rollup/plugin root project should create nodes 1`] = `
185187
},
186188
"watch-deps": {
187189
"command": "npx nx watch --projects mylib --includeDependentProjects -- npx nx build-deps mylib",
190+
"continuous": true,
188191
"dependsOn": [
189192
"build-deps",
190193
],
@@ -250,6 +253,7 @@ exports[`@nx/rollup/plugin root project should create nodes 2`] = `
250253
},
251254
"watch-deps": {
252255
"command": "npx nx watch --projects mylib --includeDependentProjects -- npx nx build-deps mylib",
256+
"continuous": true,
253257
"dependsOn": [
254258
"build-deps",
255259
],

packages/rsbuild/src/plugins/plugin.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ describe('@nx/rsbuild', () => {
144144
},
145145
"watch-deps": {
146146
"command": "npx nx watch --projects my-app --includeDependentProjects -- npx nx build-deps my-app",
147+
"continuous": true,
147148
"dependsOn": [
148149
"build-deps",
149150
],

packages/vite/src/plugins/__snapshots__/plugin-vitest.spec.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ exports[`@nx/vite/plugin root project should create nodes 1`] = `
8484
},
8585
"watch-deps": {
8686
"command": "npx nx watch --projects vite --includeDependentProjects -- npx nx build-deps vite",
87+
"continuous": true,
8788
"dependsOn": [
8889
"build-deps",
8990
],

packages/vite/src/plugins/__snapshots__/plugin-with-test.spec.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ exports[`@nx/vite/plugin with test node root project should create nodes - with
8484
},
8585
"watch-deps": {
8686
"command": "npx nx watch --projects vite --includeDependentProjects -- npx nx build-deps vite",
87+
"continuous": true,
8788
"dependsOn": [
8889
"build-deps",
8990
],

packages/vite/src/plugins/__snapshots__/plugin.spec.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ exports[`@nx/vite/plugin Library mode should exclude serve and preview targets w
5555
},
5656
"watch-deps": {
5757
"command": "npx nx watch --projects my-lib --includeDependentProjects -- npx nx build-deps my-lib",
58+
"continuous": true,
5859
"dependsOn": [
5960
"build-deps",
6061
],
@@ -193,6 +194,7 @@ exports[`@nx/vite/plugin not root project should create nodes 1`] = `
193194
},
194195
"watch-deps": {
195196
"command": "npx nx watch --projects my-app --includeDependentProjects -- npx nx build-deps my-app",
197+
"continuous": true,
196198
"dependsOn": [
197199
"build-deps",
198200
],

0 commit comments

Comments
 (0)