@@ -5,15 +5,68 @@ Create a new branch
5
5
$ git checkout -b my-branch
6
6
Switched to a new branch ' my-branch'
7
7
8
- Edit a file that affects `my-app`
9
- $ echo " foo" >> apps/ my-app/ index . js
8
+ Ensure that nothing is affected
9
+ $ $ {TURBO} ls -- affected
10
+ WARNING ls command is experimental and may change in the future
11
+ 0 no packages (npm)
12
+
13
+
14
+ Create a new file that affects `my-app`
15
+ $ echo " foo" > apps/ my-app/ new . js
16
+
17
+ Validate that we only run `my-app# build` with change not committed
18
+ $ $ {TURBO} run build -- affected -- log-order grouped
19
+ \xe2\x80\xa2 Packages in scope: my-app (esc)
20
+ \xe2\x80\xa2 Running build in 1 packages (esc)
21
+ \xe2\x80\xa2 Remote caching disabled (esc)
22
+ my-app: build: cache miss, executing 1 b83c3b24476ec9c
23
+ my-app: build:
24
+ my-app: build: > build
25
+ my-app: build: > echo building
26
+ my-app: build:
27
+ my-app: build: building
28
+
29
+ Tasks: 1 successful, 1 total
30
+ Cached: 0 cached , 1 total
31
+ Time: \s* [\.0 -9]+ m? s (re )
32
+
33
+
34
+
35
+ Do the same thing with the `ls` command
36
+ $ $ {TURBO} ls -- affected
37
+ WARNING ls command is experimental and may change in the future
38
+ 1 package (npm)
39
+
40
+ my-app apps[\/ \\]my-app (re )
41
+
42
+
43
+
44
+ Do the same thing with the `query` command
45
+ $ $ {TURBO} query " query { affectedPackages { name } } "
46
+ WARNING query command is experimental and may change in the future
47
+ {
48
+ " data" : {
49
+ " affectedPackages" : [
50
+ {
51
+ " name" : " my-app"
52
+ }
53
+ ]
54
+ }
55
+ }
56
+
57
+
58
+ Remove the new file
59
+ $ rm apps/ my-app/ new . js
60
+
61
+ Add field to `apps/ my-app/ package. json`
62
+ $ jq ' . += {"description": "foo"}' apps/ my-app/ package. json > apps/ my-app/ package. json. new
10
63
11
64
Validate that we only run `my-app# build` with change not committed
12
65
$ $ {TURBO} run build -- affected -- log-order grouped
13
66
\xe2\x80\xa2 Packages in scope: my-app (esc)
14
67
\xe2\x80\xa2 Running build in 1 packages (esc)
15
68
\xe2\x80\xa2 Remote caching disabled (esc)
16
- my-app: build: cache miss, executing 97 b34acb6e848096
69
+ my-app: build: cache miss, executing 3e9 d077cf0ab92e5
17
70
my-app: build:
18
71
my-app: build: > build
19
72
my-app: build: > echo building
@@ -55,7 +108,7 @@ Validate that we only run `my-app#build` with change committed
55
108
\xe2\x80\xa2 Packages in scope: my-app (esc)
56
109
\xe2\x80\xa2 Running build in 1 packages (esc)
57
110
\xe2\x80\xa2 Remote caching disabled (esc)
58
- my-app: build: cache hit, replaying logs 97 b34acb6e848096
111
+ my-app: build: cache hit, replaying logs 3e9 d077cf0ab92e5
59
112
my-app: build:
60
113
my-app: build: > build
61
114
my-app: build: > echo building
@@ -159,7 +212,7 @@ Run the build and expect only `my-app` to be affected, since between
159
212
\xe2\x80\xa2 Packages in scope: my-app (esc)
160
213
\xe2\x80\xa2 Running build in 1 packages (esc)
161
214
\xe2\x80\xa2 Remote caching disabled (esc)
162
- my-app: build: cache hit, replaying logs 97 b34acb6e848096
215
+ my-app: build: cache hit, replaying logs 3e9 d077cf0ab92e5
163
216
my-app: build:
164
217
my-app: build: > build
165
218
my-app: build: > echo building
@@ -205,7 +258,7 @@ Now try running `--affected` again, we should run all tasks
205
258
\xe2\x80\xa2 Packages in scope: // , another, my-app, util (esc)
206
259
\xe2\x80\xa2 Running build in 4 packages (esc)
207
260
\xe2\x80\xa2 Remote caching disabled (esc)
208
- my-app: build: cache hit, replaying logs 97 b34acb6e848096
261
+ my-app: build: cache hit, replaying logs 3e9 d077cf0ab92e5
209
262
my-app: build:
210
263
my-app: build: > build
211
264
my-app: build: > echo building
0 commit comments