Skip to content

Commit 53015c0

Browse files
committed
WIP f6a2d
1 parent 09e649c commit 53015c0

File tree

10 files changed

+149
-74
lines changed

10 files changed

+149
-74
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "turbo_root_global_deps_error",
3+
"version": "1.0.0",
4+
"private": true,
5+
"workspaces": [
6+
"packages/*"
7+
],
8+
"scripts": {
9+
"build": "echo 'build'"
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "https://turbo.build/schema.json",
3+
"globalDependencies": ["$TURBO_ROOT$/some/path"],
4+
"pipeline": {
5+
"build": {
6+
"outputs": []
7+
}
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "turbo_root_inputs_outputs",
3+
"version": "1.0.0",
4+
"private": true,
5+
"workspaces": [
6+
"packages/*"
7+
]
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "pkg-a",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"build": "mkdir -p dist && cp ../../root-file.js dist/"
6+
}
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("root file");
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": ["dist/**"]
7+
}
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "turbo_root_outputs_only",
3+
"version": "1.0.0",
4+
"private": true,
5+
"workspaces": [
6+
"packages/*"
7+
],
8+
"scripts": {
9+
"build": "echo 'root output' > root-output.js"
10+
}
11+
}
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+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
Setup
2+
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh
3+
4+
Test using $TURBO_ROOT$ in inputs and outputs
5+
$ cd fixtures/turbo_root_inputs_outputs
6+
$ ${TURBO} build --output-logs=hash-only
7+
• Packages in scope: pkg-a
8+
• Running build in 1 packages
9+
• Remote caching disabled
10+
pkg-a:build: cache miss, executing *hash* (glob)
11+
12+
Tasks: 1 successful, 1 total
13+
Cached: 0 cached, 1 total
14+
Time: * (glob)
15+
16+
$ test -f packages/pkg-a/dist/root-file.js
17+
$ cat packages/pkg-a/dist/root-file.js
18+
console.log("root file");
19+
$ rm packages/pkg-a/dist/root-file.js
20+
21+
$ ${TURBO} build --output-logs=hash-only
22+
• Packages in scope: pkg-a
23+
• Running build in 1 packages
24+
• Remote caching disabled
25+
pkg-a:build: cache hit, replaying output *hash* (glob)
26+
27+
Tasks: 1 successful, 1 total
28+
Cached: 1 cached, 1 total
29+
Time: * (glob)
30+
31+
$ test -f packages/pkg-a/dist/root-file.js
32+
$ cat packages/pkg-a/dist/root-file.js
33+
console.log("root file");
34+
35+
$ echo "console.log('modified');" > root-file.js
36+
37+
$ ${TURBO} build --output-logs=hash-only
38+
• Packages in scope: pkg-a
39+
• Running build in 1 packages
40+
• Remote caching disabled
41+
pkg-a:build: cache miss, executing *hash* (glob)
42+
43+
Tasks: 1 successful, 1 total
44+
Cached: 0 cached, 1 total
45+
Time: * (glob)
46+
47+
$ cat packages/pkg-a/dist/root-file.js
48+
console.log('modified');
49+
50+
Test using $TURBO_ROOT$ in outputs only
51+
$ cd ../turbo_root_outputs_only
52+
$ ${TURBO} build --output-logs=hash-only
53+
• Packages in scope: turbo_root_outputs_only
54+
• Running build in 1 packages
55+
• Remote caching disabled
56+
turbo_root_outputs_only:build: cache miss, executing *hash* (glob)
57+
58+
Tasks: 1 successful, 1 total
59+
Cached: 0 cached, 1 total
60+
Time: * (glob)
61+
62+
$ test -f root-output.js
63+
$ cat root-output.js
64+
root output
65+
$ rm root-output.js
66+
67+
$ ${TURBO} build --output-logs=hash-only
68+
• Packages in scope: turbo_root_outputs_only
69+
• Running build in 1 packages
70+
• Remote caching disabled
71+
turbo_root_outputs_only:build: cache hit, replaying output *hash* (glob)
72+
73+
Tasks: 1 successful, 1 total
74+
Cached: 1 cached, 1 total
75+
Time: * (glob)
76+
77+
$ test -f root-output.js
78+
$ cat root-output.js
79+
root output
80+
81+
Test error when using $TURBO_ROOT$ in globalDependencies
82+
$ cd ../turbo_root_global_deps_error
83+
$ ${TURBO} build --output-logs=hash-only
84+
ERROR: $TURBO_ROOT$ syntax is not allowed in globalDependencies
85+
[1]

turborepo-tests/integration/tests/turbo_root_syntax.rs

-74
This file was deleted.

0 commit comments

Comments
 (0)