-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathturbo.json
More file actions
119 lines (117 loc) · 4.83 KB
/
Copy pathturbo.json
File metadata and controls
119 lines (117 loc) · 4.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
{
"$schema": "https://turborepo.com/schema.json",
"globalDependencies": [
"pnpm-lock.yaml",
".tool-versions",
"prettier.config.ts",
"tsconfig.base.json"
],
// Every task name is the underscore-prefixed one the package already used for its real command (`_build` runs tsdown; the package's own `build` script is `turbo run _build`). Running the public names from here instead would make turbo invoke those wrapper scripts, which invoke turbo again -- the recursive-call case Turborepo's own docs warn against. The wrapper scripts stay in place and stay usable from inside a single package, but the root pipeline reaches straight past them to the leaf commands.
//
// Every task declares `^_build`, its dependencies' builds: a workspace sibling is a symlink whose dist/ exists only once its own build has run, and tsc, type-aware eslint, and vitest all resolve imports through it. With one package that edge is inert today; it is declared so the first sibling added is ordered correctly rather than racing.
//
// `_typecheck`, `_lint` and `_test:smoke` additionally depend on the package's OWN `_build`, which is not the same thing and is not optional here: test/smoke.test.ts and scripts/generate-json-schema.ts both import from ../dist/ by relative path, so tsc, eslint's typed rules, and the smoke suite itself all need this package's dist/ present before they run.
"tasks": {
"_build": {
"dependsOn": ["^_build"],
// scripts/** covers the JSON-schema generation step that runs as part of the build; package.json is an input because that generation reads it.
"inputs": ["src/**", "tsdown.config.ts", "scripts/**", "package.json"],
// schemas/** is the build's second output, alongside tsdown's dist/.
"outputs": ["dist/**", "schemas/**"]
},
"_typecheck": {
"dependsOn": ["^_build", "_build"],
"inputs": ["$TURBO_DEFAULT$", "tsconfig.json", "tsconfig.node.json"],
"outputs": []
},
// attw --pack inspects the package's own dist/ against its own package.json exports map, so it depends on this package's own `_build` rather than on `^_build` alone. It was previously a bare `pnpm exec attw --pack` step in ci.yml's Typecheck job, run after `pnpm typecheck` purely to reuse the dist/ that task had left behind; as a task it is cached and ordered like everything else.
"_typecheck:attw": {
"dependsOn": ["_build"],
"inputs": ["package.json"],
"outputs": []
},
"_lint": {
"dependsOn": ["^_build", "_build"],
"inputs": ["$TURBO_DEFAULT$", "eslint.config.ts"],
"outputs": [".eslintcache"]
},
"_test": {
"dependsOn": ["^_build"],
"inputs": ["src/**", "vitest.config.ts", "package.json"],
"outputs": []
},
"_test:coverage": {
"dependsOn": ["^_build"],
"inputs": ["src/**", "vitest.config.ts", "package.json"],
"outputs": ["coverage/**"]
},
"_test:integration": {
"dependsOn": ["^_build"],
"inputs": [
"src/**",
"package.json",
"vitest.config.ts",
"test/integration/**"
],
"outputs": []
},
"_test:smoke": {
"dependsOn": ["^_build", "_build"],
"inputs": [
"src/**",
"tsdown.config.ts",
"package.json",
"vitest.config.ts",
"test/smoke.test.ts"
],
// Deliberately empty rather than dist/**: dist/ is `_build`'s output, and two tasks claiming the same output directory means a cache replay of one can overwrite the other's. The smoke run itself produces nothing worth caching.
"outputs": []
},
"_test:workers": {
"dependsOn": ["^_build"],
"inputs": [
"src/**",
"package.json",
"vitest.config.ts",
"wrangler.jsonc",
"test/workers/**"
],
"outputs": []
},
"_prepush": {
"dependsOn": [
"_lint",
"_typecheck",
"_typecheck:attw",
"_test",
"_test:integration",
"_test:smoke",
"_test:workers"
],
"outputs": []
},
// The workspace root's own tooling files (eslint.config.ts, commitlint.config.ts, lint-staged.config.ts, release-workspace.config.ts) are held to the same lint and typecheck gates as package code. Registered as root tasks so `turbo run _lint` and `turbo run _typecheck` cover them without a separate command.
"//#_lint": {
"inputs": [
"eslint.config.ts",
"prettier.config.ts",
"commitlint.config.ts",
"lint-staged.config.ts",
"release-workspace.config.ts",
"tsconfig.json"
],
"outputs": [".eslintcache"]
},
"//#_typecheck": {
"inputs": [
"eslint.config.ts",
"prettier.config.ts",
"commitlint.config.ts",
"lint-staged.config.ts",
"release-workspace.config.ts",
"tsconfig.json"
],
"outputs": []
}
}
}