@martinffx/atelier 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/LICENSE +21 -0
- package/README.md +285 -0
- package/agents/architect.md +38 -0
- package/agents/oracle.md +40 -0
- package/agents/recon.md +39 -0
- package/dist/atelier.js +33082 -0
- package/package.json +44 -0
- package/skills/code-conventional-commit/SKILL.md +134 -0
- package/skills/code-conventional-commit/evals/evals.json +23 -0
- package/skills/code-conventional-commit/workspace/iteration-1/eval-0/with_skill/outputs/commit-message.txt +4 -0
- package/skills/code-conventional-commit/workspace/iteration-1/eval-0/with_skill/outputs/eval_metadata.json +6 -0
- package/skills/code-conventional-commit/workspace/iteration-1/eval-1/with_skill/outputs/eval_metadata.json +6 -0
- package/skills/code-conventional-commit/workspace/iteration-1/eval-1/with_skill/outputs/validation-result.txt +16 -0
- package/skills/code-conventional-commit/workspace/iteration-1/eval-2/with_skill/outputs/commit-message.txt +8 -0
- package/skills/code-conventional-commit/workspace/iteration-1/eval-2/with_skill/outputs/eval_metadata.json +6 -0
- package/skills/code-conventional-commit/workspace/iteration-1/report.html +1325 -0
- package/skills/code-debug/SKILL.md +271 -0
- package/skills/code-debug/references/language-tools.md +139 -0
- package/skills/code-debug/references/techniques.md +117 -0
- package/skills/code-docs/SKILL.md +171 -0
- package/skills/code-docs/references/api-docs.md +116 -0
- package/skills/code-docs/references/changelog.md +64 -0
- package/skills/code-docs/references/readme-structure.md +94 -0
- package/skills/code-git-worktrees/SKILL.md +218 -0
- package/skills/code-perf/SKILL.md +163 -0
- package/skills/code-perf/references/common-bottlenecks.md +124 -0
- package/skills/code-perf/references/optimization-patterns.md +167 -0
- package/skills/code-perf/references/profiling-tools.md +126 -0
- package/skills/code-review/SKILL.md +78 -0
- package/skills/code-review/references/output.md +200 -0
- package/skills/code-review/references/reviewers.md +719 -0
- package/skills/code-review/references/rq.md +357 -0
- package/skills/code-review/references/rs.md +30 -0
- package/skills/code-security/SKILL.md +183 -0
- package/skills/code-security/references/owasp-top-10.md +129 -0
- package/skills/code-security/references/security-tools.md +102 -0
- package/skills/code-security/references/vulnerability-patterns.md +129 -0
- package/skills/code-stacked-commit/SKILL.md +155 -0
- package/skills/code-subagents/SKILL.md +184 -0
- package/skills/code-subagents/references/code-quality-reviewer-prompt.md +48 -0
- package/skills/code-subagents/references/implementor-prompt.md +79 -0
- package/skills/code-subagents/references/spec-reviewer-prompt.md +62 -0
- package/skills/oracle-architect/SKILL.md +246 -0
- package/skills/oracle-architect/references/api-design.md +345 -0
- package/skills/oracle-architect/references/data-modeling.md +318 -0
- package/skills/oracle-architect/references/ddd-patterns.md +247 -0
- package/skills/oracle-challenge/SKILL.md +126 -0
- package/skills/oracle-testing/SKILL.md +237 -0
- package/skills/oracle-testing/references/anti-patterns.md +618 -0
- package/skills/oracle-testing/references/boundaries.md +579 -0
- package/skills/oracle-testing/references/core-testing.md +691 -0
- package/skills/oracle-testing/references/edge-testing.md +794 -0
- package/skills/oracle-testing/references/stub-driven-tdd.md +322 -0
- package/skills/oracle-thinkdeep/SKILL.md +164 -0
- package/skills/python-architecture/SKILL.md +148 -0
- package/skills/python-architecture/references/data-modeling.md +558 -0
- package/skills/python-architecture/references/ddd.md +569 -0
- package/skills/python-architecture/references/functional-core.md +337 -0
- package/skills/python-build-tools/SKILL.md +153 -0
- package/skills/python-build-tools/references/basedpyright.md +321 -0
- package/skills/python-build-tools/references/ruff.md +225 -0
- package/skills/python-build-tools/references/uv.md +257 -0
- package/skills/python-fastapi/SKILL.md +184 -0
- package/skills/python-fastapi/references/api-design.md +563 -0
- package/skills/python-fastapi/references/dependencies.md +479 -0
- package/skills/python-fastapi/references/middleware.md +475 -0
- package/skills/python-fastapi/references/validation.md +497 -0
- package/skills/python-modern-python/SKILL.md +201 -0
- package/skills/python-modern-python/references/async.md +76 -0
- package/skills/python-modern-python/references/pattern-matching.md +89 -0
- package/skills/python-modern-python/references/typing.md +96 -0
- package/skills/python-monorepo/SKILL.md +146 -0
- package/skills/python-monorepo/references/docker.md +515 -0
- package/skills/python-monorepo/references/namespace-packages.md +426 -0
- package/skills/python-monorepo/references/workspace-config.md +341 -0
- package/skills/python-sqlalchemy/SKILL.md +119 -0
- package/skills/python-sqlalchemy/references/async.md +51 -0
- package/skills/python-sqlalchemy/references/models.md +67 -0
- package/skills/python-sqlalchemy/references/queries.md +57 -0
- package/skills/python-temporal/SKILL.md +128 -0
- package/skills/python-temporal/references/patterns.md +87 -0
- package/skills/python-temporal/references/testing.md +54 -0
- package/skills/python-testing/SKILL.md +161 -0
- package/skills/python-testing/references/boundaries.md +449 -0
- package/skills/python-testing/references/mocking.md +449 -0
- package/skills/python-testing/references/pytest.md +524 -0
- package/skills/spec-brainstorm/SKILL.md +325 -0
- package/skills/spec-finish/SKILL.md +159 -0
- package/skills/spec-implement/SKILL.md +296 -0
- package/skills/spec-orchestrator/SKILL.md +156 -0
- package/skills/spec-plan/SKILL.md +248 -0
- package/skills/typescript-api-design/SKILL.md +396 -0
- package/skills/typescript-api-design/references/error-responses.md +469 -0
- package/skills/typescript-build-tools/SKILL.md +447 -0
- package/skills/typescript-build-tools/references/biome.md +436 -0
- package/skills/typescript-build-tools/references/bun.md +432 -0
- package/skills/typescript-build-tools/references/turborepo.md +426 -0
- package/skills/typescript-build-tools/references/vitest.md +518 -0
- package/skills/typescript-drizzle-orm/SKILL.md +398 -0
- package/skills/typescript-drizzle-orm/references/cloudflare.md +392 -0
- package/skills/typescript-drizzle-orm/references/entity-pattern.md +412 -0
- package/skills/typescript-drizzle-orm/references/postgresql.md +191 -0
- package/skills/typescript-drizzle-orm/references/repository-pattern.md +479 -0
- package/skills/typescript-drizzle-orm/references/sqlite.md +291 -0
- package/skills/typescript-dynamodb-toolbox/SKILL.md +370 -0
- package/skills/typescript-dynamodb-toolbox/references/entity-layer.md +574 -0
- package/skills/typescript-dynamodb-toolbox/references/error-handling.md +495 -0
- package/skills/typescript-dynamodb-toolbox/references/modeling.md +332 -0
- package/skills/typescript-dynamodb-toolbox/references/repository-layer.md +631 -0
- package/skills/typescript-dynamodb-toolbox/references/testing.md +718 -0
- package/skills/typescript-dynamodb-toolbox/references/transactions.md +423 -0
- package/skills/typescript-effect-ts/SKILL.md +341 -0
- package/skills/typescript-effect-ts/references/core.md +412 -0
- package/skills/typescript-effect-ts/references/error-handling.md +468 -0
- package/skills/typescript-effect-ts/references/resources.md +476 -0
- package/skills/typescript-effect-ts/references/schema.md +536 -0
- package/skills/typescript-effect-ts/references/services.md +461 -0
- package/skills/typescript-fastify/SKILL.md +405 -0
- package/skills/typescript-fastify/references/plugins.md +329 -0
- package/skills/typescript-fastify/references/typeid.md +315 -0
- package/skills/typescript-functional-patterns/SKILL.md +402 -0
- package/skills/typescript-functional-patterns/references/adts.md +497 -0
- package/skills/typescript-functional-patterns/references/branded-types.md +542 -0
- package/skills/typescript-functional-patterns/references/migration-guide.md +695 -0
- package/skills/typescript-functional-patterns/references/option-result.md +585 -0
- package/skills/typescript-testing/SKILL.md +353 -0
- package/skills/typescript-testing/references/mocking.md +675 -0
- package/skills/typescript-testing/references/msw.md +852 -0
- package/skills/typescript-testing/references/snapshot-testing.md +774 -0
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
# Turborepo Monorepo Orchestration
|
|
2
|
+
|
|
3
|
+
Patterns for configuring Turborepo to orchestrate TypeScript monorepo builds, tests, and development.
|
|
4
|
+
|
|
5
|
+
## Basic Setup
|
|
6
|
+
|
|
7
|
+
### Root package.json
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"name": "my-monorepo",
|
|
12
|
+
"private": true,
|
|
13
|
+
"workspaces": ["apps/*", "packages/*"],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"dev": "turbo dev",
|
|
16
|
+
"build": "turbo build",
|
|
17
|
+
"typecheck": "turbo typecheck",
|
|
18
|
+
"test": "turbo test",
|
|
19
|
+
"lint": "turbo lint",
|
|
20
|
+
"check": "turbo typecheck lint test"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"turbo": "^2.0.0"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### turbo.json
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"$schema": "https://turbo.build/schema.json",
|
|
33
|
+
"tasks": {
|
|
34
|
+
"build": {
|
|
35
|
+
"dependsOn": ["^build"],
|
|
36
|
+
"outputs": ["dist/**"]
|
|
37
|
+
},
|
|
38
|
+
"typecheck": {
|
|
39
|
+
"dependsOn": ["^typecheck"]
|
|
40
|
+
},
|
|
41
|
+
"lint": {},
|
|
42
|
+
"test": {
|
|
43
|
+
"dependsOn": ["^build"]
|
|
44
|
+
},
|
|
45
|
+
"dev": {
|
|
46
|
+
"cache": false,
|
|
47
|
+
"persistent": true
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Task Configuration
|
|
54
|
+
|
|
55
|
+
### dependsOn
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"tasks": {
|
|
60
|
+
"build": {
|
|
61
|
+
"dependsOn": ["^build"] // Run build in dependencies first
|
|
62
|
+
},
|
|
63
|
+
"test": {
|
|
64
|
+
"dependsOn": ["build"] // Run build in same package first
|
|
65
|
+
},
|
|
66
|
+
"deploy": {
|
|
67
|
+
"dependsOn": ["build", "test", "lint"] // Run all in same package
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
- `^task` - Run task in dependencies (topological order)
|
|
74
|
+
- `task` - Run task in same package before this task
|
|
75
|
+
|
|
76
|
+
### outputs
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"tasks": {
|
|
81
|
+
"build": {
|
|
82
|
+
"outputs": ["dist/**", ".next/**", "!.next/cache/**"]
|
|
83
|
+
},
|
|
84
|
+
"typecheck": {
|
|
85
|
+
"outputs": [] // No outputs to cache
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### inputs
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"tasks": {
|
|
96
|
+
"test": {
|
|
97
|
+
"inputs": ["src/**/*.ts", "test/**/*.ts", "vitest.config.ts"]
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Environment Variables
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"tasks": {
|
|
108
|
+
"build": {
|
|
109
|
+
"env": ["NODE_ENV", "API_URL"],
|
|
110
|
+
"passThroughEnv": ["CI", "VERCEL"]
|
|
111
|
+
},
|
|
112
|
+
"test": {
|
|
113
|
+
"env": ["DATABASE_URL", "TEST_DATABASE_URL"]
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Workspace Structure
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
my-monorepo/
|
|
123
|
+
├── package.json
|
|
124
|
+
├── turbo.json
|
|
125
|
+
├── biome.json
|
|
126
|
+
├── apps/
|
|
127
|
+
│ ├── api/
|
|
128
|
+
│ │ ├── package.json
|
|
129
|
+
│ │ ├── tsconfig.json
|
|
130
|
+
│ │ ├── vitest.config.ts
|
|
131
|
+
│ │ └── src/
|
|
132
|
+
│ └── web/
|
|
133
|
+
│ ├── package.json
|
|
134
|
+
│ ├── tsconfig.json
|
|
135
|
+
│ ├── vitest.config.ts
|
|
136
|
+
│ └── src/
|
|
137
|
+
└── packages/
|
|
138
|
+
├── config-biome/
|
|
139
|
+
│ ├── package.json
|
|
140
|
+
│ └── biome.json
|
|
141
|
+
├── config-typescript/
|
|
142
|
+
│ ├── package.json
|
|
143
|
+
│ └── tsconfig.base.json
|
|
144
|
+
└── shared/
|
|
145
|
+
├── package.json
|
|
146
|
+
├── tsconfig.json
|
|
147
|
+
└── src/
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Package Dependencies
|
|
151
|
+
|
|
152
|
+
```json
|
|
153
|
+
// apps/api/package.json
|
|
154
|
+
{
|
|
155
|
+
"name": "@myorg/api",
|
|
156
|
+
"dependencies": {
|
|
157
|
+
"@myorg/shared": "workspace:*"
|
|
158
|
+
},
|
|
159
|
+
"devDependencies": {
|
|
160
|
+
"@myorg/config-biome": "workspace:*",
|
|
161
|
+
"@myorg/config-typescript": "workspace:*"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Package Scripts
|
|
167
|
+
|
|
168
|
+
### apps/api/package.json
|
|
169
|
+
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"name": "@myorg/api",
|
|
173
|
+
"scripts": {
|
|
174
|
+
"dev": "bun run --watch src/index.ts",
|
|
175
|
+
"build": "bun build ./src/index.ts --outdir ./dist --target bun",
|
|
176
|
+
"typecheck": "tsgo --noEmit",
|
|
177
|
+
"lint": "biome check .",
|
|
178
|
+
"test": "vitest run"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### packages/shared/package.json
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"name": "@myorg/shared",
|
|
188
|
+
"main": "./src/index.ts",
|
|
189
|
+
"types": "./src/index.ts",
|
|
190
|
+
"scripts": {
|
|
191
|
+
"typecheck": "tsgo --noEmit",
|
|
192
|
+
"lint": "biome check .",
|
|
193
|
+
"test": "vitest run"
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Remote Caching
|
|
199
|
+
|
|
200
|
+
### Vercel Remote Cache
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
# Login to Vercel
|
|
204
|
+
npx turbo login
|
|
205
|
+
|
|
206
|
+
# Link to Vercel project
|
|
207
|
+
npx turbo link
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### GitHub Actions with Remote Cache
|
|
211
|
+
|
|
212
|
+
```yaml
|
|
213
|
+
name: CI
|
|
214
|
+
|
|
215
|
+
on:
|
|
216
|
+
push:
|
|
217
|
+
branches: [main]
|
|
218
|
+
pull_request:
|
|
219
|
+
|
|
220
|
+
env:
|
|
221
|
+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
222
|
+
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
|
|
223
|
+
|
|
224
|
+
jobs:
|
|
225
|
+
check:
|
|
226
|
+
runs-on: ubuntu-latest
|
|
227
|
+
steps:
|
|
228
|
+
- uses: actions/checkout@v4
|
|
229
|
+
|
|
230
|
+
- uses: oven-sh/setup-bun@v2
|
|
231
|
+
|
|
232
|
+
- run: bun install --frozen-lockfile
|
|
233
|
+
|
|
234
|
+
- run: bun run check
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Self-Hosted Remote Cache
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
# Use turbo with custom remote cache endpoint
|
|
241
|
+
turbo build --api="https://cache.example.com" --token="xxx"
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Add to `turbo.json`:
|
|
245
|
+
|
|
246
|
+
```json
|
|
247
|
+
{
|
|
248
|
+
"$schema": "https://turbo.build/schema.json",
|
|
249
|
+
"remoteCache": {
|
|
250
|
+
"signature": true
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
## Filtering
|
|
256
|
+
|
|
257
|
+
### Run in Specific Package
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# Run build only in api
|
|
261
|
+
turbo build --filter=@myorg/api
|
|
262
|
+
|
|
263
|
+
# Run build in api and its dependencies
|
|
264
|
+
turbo build --filter=@myorg/api...
|
|
265
|
+
|
|
266
|
+
# Run build in api and packages that depend on it
|
|
267
|
+
turbo build --filter=...@myorg/api
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### Run Based on Changes
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
# Run test only in packages changed since main
|
|
274
|
+
turbo test --filter=[main]
|
|
275
|
+
|
|
276
|
+
# Run test in changed packages and their dependents
|
|
277
|
+
turbo test --filter=...[main]
|
|
278
|
+
|
|
279
|
+
# Run test in changed packages and their dependencies
|
|
280
|
+
turbo test --filter=...[main]...
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Run by Directory
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
# Run all tasks in apps/
|
|
287
|
+
turbo build --filter=./apps/*
|
|
288
|
+
|
|
289
|
+
# Run all tasks in packages/
|
|
290
|
+
turbo typecheck --filter=./packages/*
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
## Development Mode
|
|
294
|
+
|
|
295
|
+
### turbo.json
|
|
296
|
+
|
|
297
|
+
```json
|
|
298
|
+
{
|
|
299
|
+
"tasks": {
|
|
300
|
+
"dev": {
|
|
301
|
+
"cache": false,
|
|
302
|
+
"persistent": true,
|
|
303
|
+
"dependsOn": ["^build"]
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### Running Dev
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
# Run dev in all packages that have it
|
|
313
|
+
turbo dev
|
|
314
|
+
|
|
315
|
+
# Run dev in specific packages
|
|
316
|
+
turbo dev --filter=@myorg/api --filter=@myorg/web
|
|
317
|
+
|
|
318
|
+
# Run dev with specific concurrency
|
|
319
|
+
turbo dev --concurrency=2
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
## Package-Specific Configuration
|
|
323
|
+
|
|
324
|
+
### Per-Package Task Config
|
|
325
|
+
|
|
326
|
+
```json
|
|
327
|
+
// turbo.json
|
|
328
|
+
{
|
|
329
|
+
"tasks": {
|
|
330
|
+
"test": {
|
|
331
|
+
"dependsOn": ["^build"]
|
|
332
|
+
},
|
|
333
|
+
"@myorg/api#test": {
|
|
334
|
+
"dependsOn": ["^build"],
|
|
335
|
+
"env": ["DATABASE_URL"]
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
## CI Optimization
|
|
342
|
+
|
|
343
|
+
### Parallel Execution
|
|
344
|
+
|
|
345
|
+
```yaml
|
|
346
|
+
jobs:
|
|
347
|
+
check:
|
|
348
|
+
runs-on: ubuntu-latest
|
|
349
|
+
steps:
|
|
350
|
+
- uses: actions/checkout@v4
|
|
351
|
+
- uses: oven-sh/setup-bun@v2
|
|
352
|
+
- run: bun install --frozen-lockfile
|
|
353
|
+
|
|
354
|
+
# Run typecheck and lint in parallel (no dependencies)
|
|
355
|
+
- run: turbo typecheck lint
|
|
356
|
+
|
|
357
|
+
# Then run tests (may depend on build)
|
|
358
|
+
- run: turbo test
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
### Cache Artifacts
|
|
362
|
+
|
|
363
|
+
```yaml
|
|
364
|
+
jobs:
|
|
365
|
+
build:
|
|
366
|
+
runs-on: ubuntu-latest
|
|
367
|
+
steps:
|
|
368
|
+
- uses: actions/checkout@v4
|
|
369
|
+
|
|
370
|
+
- uses: actions/cache@v4
|
|
371
|
+
with:
|
|
372
|
+
path: .turbo
|
|
373
|
+
key: turbo-${{ github.sha }}
|
|
374
|
+
restore-keys: turbo-
|
|
375
|
+
|
|
376
|
+
- uses: oven-sh/setup-bun@v2
|
|
377
|
+
- run: bun install --frozen-lockfile
|
|
378
|
+
- run: turbo build
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
## Troubleshooting
|
|
382
|
+
|
|
383
|
+
### See Task Graph
|
|
384
|
+
|
|
385
|
+
```bash
|
|
386
|
+
# Print task graph
|
|
387
|
+
turbo build --dry-run
|
|
388
|
+
|
|
389
|
+
# Print as JSON
|
|
390
|
+
turbo build --dry-run=json
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
### Debug Cache
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
# See why cache was missed
|
|
397
|
+
turbo build --verbosity=2
|
|
398
|
+
|
|
399
|
+
# Force cache miss
|
|
400
|
+
turbo build --force
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### Clean Cache
|
|
404
|
+
|
|
405
|
+
```bash
|
|
406
|
+
# Clean local cache
|
|
407
|
+
rm -rf .turbo
|
|
408
|
+
|
|
409
|
+
# Clean all caches
|
|
410
|
+
turbo prune
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
## Best Practices
|
|
414
|
+
|
|
415
|
+
1. **Use `^` prefix** for tasks that depend on dependencies being built first
|
|
416
|
+
2. **Specify outputs** for cacheable tasks (build, generate)
|
|
417
|
+
3. **Don't cache dev** - set `cache: false` for development tasks
|
|
418
|
+
4. **Use remote caching** in CI - speeds up PR checks significantly
|
|
419
|
+
5. **Filter by changes** - `--filter=[main]` to only run affected packages
|
|
420
|
+
6. **Set env vars** explicitly - list all env vars that affect task output
|
|
421
|
+
7. **Use workspace:\*** for internal dependencies
|
|
422
|
+
8. **Keep shared packages small** - reduces rebuild scope
|
|
423
|
+
9. **Run typecheck and lint in parallel** - no dependencies between them
|
|
424
|
+
10. **Use persistent mode** for dev servers that should keep running
|
|
425
|
+
11. **Cache artifacts in CI** - store `.turbo` directory for faster builds
|
|
426
|
+
12. **Use Turbo token** for remote caching - significantly faster PR checks
|