Skip to content

Commit cf66f3d

Browse files
committed
WIP 8285d
1 parent 53015c0 commit cf66f3d

File tree

5 files changed

+63
-23
lines changed

5 files changed

+63
-23
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "https://turbo.build/schema.json",
3+
"globalDependencies": ["$TURBO_ROOT$/root-file.js"],
4+
"pipeline": {
5+
"build": {
6+
"outputs": []
7+
}
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "https://turbo.build/schema.json",
3+
"pipeline": {
4+
"build": {
5+
"inputs": ["$TURBO_ROOT$/root-file.js"],
6+
"outputs": ["$TURBO_ROOT$/packages/pkg-a/dist/root-file.js"]
7+
}
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://turbo.build/schema.json",
3+
"pipeline": {
4+
"build": {
5+
"outputs": ["$TURBO_ROOT$/root-output.js"]
6+
}
7+
}
8+
}

turborepo-tests/integration/tests/run-caching/excluded-inputs/excluded-inputs.t

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Running build for my-app succeeds
99
\xe2\x80\xa2 Packages in scope: my-app (esc)
1010
\xe2\x80\xa2 Running build in 1 packages (esc)
1111
\xe2\x80\xa2 Remote caching disabled (esc)
12-
my-app:build: cache miss, executing e228bd94fd46352c
12+
my-app:build: cache miss, executing *hash* (glob)
1313
my-app:build:
1414
my-app:build: > build
1515
my-app:build: > echo building
@@ -21,13 +21,14 @@ Running build for my-app succeeds
2121
Time:\s*[\.0-9]+m?s (re)
2222

2323
WARNING no output files found for task my-app#build. Please check your `outputs` key in `turbo.json`
24-
Update exluded file and try again
24+
25+
Update excluded file and try again
2526
$ echo "new excluded value" > apps/my-app/excluded.txt
2627
$ ${TURBO} run build --filter=my-app
2728
\xe2\x80\xa2 Packages in scope: my-app (esc)
2829
\xe2\x80\xa2 Running build in 1 packages (esc)
2930
\xe2\x80\xa2 Remote caching disabled (esc)
30-
my-app:build: cache hit, replaying logs e228bd94fd46352c
31+
my-app:build: cache hit, replaying logs *hash* (glob)
3132
my-app:build:
3233
my-app:build: > build
3334
my-app:build: > echo building

turborepo-tests/integration/tests/turbo-root-syntax.t

+33-20
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,36 @@ Setup
22
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh
33

44
Test using $TURBO_ROOT$ in inputs and outputs
5+
$ mkdir -p fixtures/turbo_root_inputs_outputs/packages/pkg-a/dist
56
$ cd fixtures/turbo_root_inputs_outputs
7+
$ echo 'console.log("root file");' > root-file.js
8+
$ cp ${TESTDIR}/turbo.json ./turbo.json
9+
$ git add . && git commit -m "Initial commit" --quiet
10+
611
$ ${TURBO} build --output-logs=hash-only
7-
Packages in scope: pkg-a
8-
Running build in 1 packages
9-
Remote caching disabled
12+
\xe2\x80\xa2 Packages in scope: pkg-a (esc)
13+
\xe2\x80\xa2 Running build in 1 packages (esc)
14+
\xe2\x80\xa2 Remote caching disabled (esc)
1015
pkg-a:build: cache miss, executing *hash* (glob)
1116

1217
Tasks: 1 successful, 1 total
1318
Cached: 0 cached, 1 total
14-
Time: * (glob)
19+
Time: *ms (glob)
1520

1621
$ test -f packages/pkg-a/dist/root-file.js
1722
$ cat packages/pkg-a/dist/root-file.js
1823
console.log("root file");
1924
$ rm packages/pkg-a/dist/root-file.js
2025

2126
$ ${TURBO} build --output-logs=hash-only
22-
Packages in scope: pkg-a
23-
Running build in 1 packages
24-
Remote caching disabled
27+
\xe2\x80\xa2 Packages in scope: pkg-a (esc)
28+
\xe2\x80\xa2 Running build in 1 packages (esc)
29+
\xe2\x80\xa2 Remote caching disabled (esc)
2530
pkg-a:build: cache hit, replaying output *hash* (glob)
2631

2732
Tasks: 1 successful, 1 total
2833
Cached: 1 cached, 1 total
29-
Time: * (glob)
34+
Time: *ms (glob)
3035

3136
$ test -f packages/pkg-a/dist/root-file.js
3237
$ cat packages/pkg-a/dist/root-file.js
@@ -35,51 +40,59 @@ Test using $TURBO_ROOT$ in inputs and outputs
3540
$ echo "console.log('modified');" > root-file.js
3641

3742
$ ${TURBO} build --output-logs=hash-only
38-
Packages in scope: pkg-a
39-
Running build in 1 packages
40-
Remote caching disabled
43+
\xe2\x80\xa2 Packages in scope: pkg-a (esc)
44+
\xe2\x80\xa2 Running build in 1 packages (esc)
45+
\xe2\x80\xa2 Remote caching disabled (esc)
4146
pkg-a:build: cache miss, executing *hash* (glob)
4247

4348
Tasks: 1 successful, 1 total
4449
Cached: 0 cached, 1 total
45-
Time: * (glob)
50+
Time: *ms (glob)
4651

4752
$ cat packages/pkg-a/dist/root-file.js
4853
console.log('modified');
4954

5055
Test using $TURBO_ROOT$ in outputs only
5156
$ cd ../turbo_root_outputs_only
57+
$ mkdir -p .
58+
$ cp ${TESTDIR}/turbo.json ./turbo.json
59+
$ git add . && git commit -m "Initial commit" --quiet
60+
5261
$ ${TURBO} build --output-logs=hash-only
53-
Packages in scope: turbo_root_outputs_only
54-
Running build in 1 packages
55-
Remote caching disabled
62+
\xe2\x80\xa2 Packages in scope: turbo_root_outputs_only (esc)
63+
\xe2\x80\xa2 Running build in 1 packages (esc)
64+
\xe2\x80\xa2 Remote caching disabled (esc)
5665
turbo_root_outputs_only:build: cache miss, executing *hash* (glob)
5766

5867
Tasks: 1 successful, 1 total
5968
Cached: 0 cached, 1 total
60-
Time: * (glob)
69+
Time: *ms (glob)
6170

6271
$ test -f root-output.js
6372
$ cat root-output.js
6473
root output
6574
$ rm root-output.js
6675

6776
$ ${TURBO} build --output-logs=hash-only
68-
Packages in scope: turbo_root_outputs_only
69-
Running build in 1 packages
70-
Remote caching disabled
77+
\xe2\x80\xa2 Packages in scope: turbo_root_outputs_only (esc)
78+
\xe2\x80\xa2 Running build in 1 packages (esc)
79+
\xe2\x80\xa2 Remote caching disabled (esc)
7180
turbo_root_outputs_only:build: cache hit, replaying output *hash* (glob)
7281

7382
Tasks: 1 successful, 1 total
7483
Cached: 1 cached, 1 total
75-
Time: * (glob)
84+
Time: *ms (glob)
7685

7786
$ test -f root-output.js
7887
$ cat root-output.js
7988
root output
8089

8190
Test error when using $TURBO_ROOT$ in globalDependencies
8291
$ cd ../turbo_root_global_deps_error
92+
$ mkdir -p .
93+
$ cp ${TESTDIR}/turbo.json ./turbo.json
94+
$ git add . && git commit -m "Initial commit" --quiet
95+
8396
$ ${TURBO} build --output-logs=hash-only
8497
ERROR: $TURBO_ROOT$ syntax is not allowed in globalDependencies
8598
[1]

0 commit comments

Comments
 (0)