@@ -61,13 +61,21 @@ Do the same thing with the `query` command
6161 }
6262
6363Also with `affectedFiles` in `turbo query`
64- $ $ {TURBO} query " query { affectedFiles(base : \" main\" , head: \" HEAD\" ) { items { path } } }"
64+ $ $ {TURBO} query " query { affectedFiles { items { path, affectedPackages { items { name } } } } } "
65+ WARNING query command is experimental and may change in the future
6566 {
6667 " data" : {
6768 " affectedFiles" : {
6869 " items" : [
6970 {
70- " path" : " apps/my-app/new.js"
71+ " path" : " apps/my-app/new.js" ,
72+ " affectedPackages" : {
73+ " items" : [
74+ {
75+ " name" : " my-app"
76+ }
77+ ]
78+ }
7179 }
7280 ]
7381 }
@@ -156,13 +164,21 @@ Do the same thing with the `query` command
156164 }
157165
158166Also with `affectedFiles` in `turbo query`
159- $ $ {TURBO} query " query { affectedFiles(base : \" main\" , head: \" HEAD\" ) { items { path } } }"
167+ $ $ {TURBO} query " query { affectedFiles { items { path, affectedPackages { items { name } } } } } "
168+ WARNING query command is experimental and may change in the future
160169 {
161170 " data" : {
162171 " affectedFiles" : {
163172 " items" : [
164173 {
165- " path" : " apps/my-app/package.json"
174+ " path" : " apps/my-app/package.json" ,
175+ " affectedPackages" : {
176+ " items" : [
177+ {
178+ " name" : " my-app"
179+ }
180+ ]
181+ }
166182 }
167183 ]
168184 }
@@ -244,6 +260,17 @@ Do the same thing with the `query` command
244260 }
245261 }
246262
263+ Also with `affectedFiles` in `turbo query`
264+ $ $ {TURBO} query " query { affectedFiles(base : \" HEAD\" ) { items { path, affectedPackages { items { name } } } } }"
265+ WARNING query command is experimental and may change in the future
266+ {
267+ " data" : {
268+ " affectedFiles" : {
269+ " items" : []
270+ }
271+ }
272+ }
273+
247274Override the SCM head to be main, so nothing runs
248275 $ TURBO_SCM_HEAD= " main" $ {TURBO} run build -- affected -- log-order grouped
249276 \xe2\x80\xa2 Packages in scope: (esc)
@@ -275,6 +302,17 @@ Do the same thing with the `query` command
275302 }
276303 }
277304
305+ Also with `affectedFiles` in `turbo query`
306+ $ $ {TURBO} query " query { affectedFiles(head: \" main\" ) { items { path, affectedPackages { items { name } } } } }"
307+ WARNING query command is experimental and may change in the future
308+ {
309+ " data" : {
310+ " affectedFiles" : {
311+ " items" : []
312+ }
313+ }
314+ }
315+
278316Now add a commit to `main` so the merge base is different from `main`
279317 $ git checkout main -- quiet
280318 $ echo " foo" >> packages/ util/ index . js
@@ -324,6 +362,28 @@ Do the same thing with the `query` command
324362 }
325363 }
326364
365+ Also with `affectedFiles` in `turbo query`
366+ $ $ {TURBO} query " query { affectedFiles { items { path, affectedPackages { items { name } } } } } "
367+ WARNING query command is experimental and may change in the future
368+ {
369+ " data" : {
370+ " affectedFiles" : {
371+ " items" : [
372+ {
373+ " path" : " apps/my-app/package.json" ,
374+ " affectedPackages" : {
375+ " items" : [
376+ {
377+ " name" : " my-app"
378+ }
379+ ]
380+ }
381+ }
382+ ]
383+ }
384+ }
385+ }
386+
327387Now do some magic to change the repo to be shallow
328388 $ SHALLOW= $ (git rev-parse -- show-toplevel)/. git/ shallow
329389 $ git rev-parse HEAD > " $ SHALLOW"
0 commit comments