Skip to content

Commit 0630d78

Browse files
Use turbo as the build orchestrator (#4243)
Provide caching to only rebuild what was modified
1 parent 0b60125 commit 0630d78

6 files changed

Lines changed: 135 additions & 12 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,6 @@ packages/samples/test/output/azure/templates-contoso/setup.*
218218
.last-run.json
219219

220220
.pnpm-store/
221+
222+
# Turborepo
223+
.turbo

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
"type": "module",
66
"packageManager": "pnpm@10.30.2",
77
"scripts": {
8-
"run-all": "pnpm -r --filter=!. --filter=!./core/ --filter=!./core/packages/standalone",
9-
"run-azure-only": "pnpm -r --filter=!. --filter=\"!./core/**\"",
10-
"build": "pnpm run-all --workspace-concurrency=Infinity --aggregate-output --reporter=append-only build && pnpm check:eng",
8+
"run-all": "turbo --filter=!@typespec/monorepo",
9+
"run-azure-only": "turbo --filter=!{./core/**}",
10+
"build": "pnpm run-all build && pnpm check:eng",
1111
"deps": "tsx eng/scripts/sync-deps.ts",
1212
"check:eng": "tsc -p ./tsconfig.eng.json --noEmit",
1313
"change": "chronus",
14-
"clean": "pnpm run-all run clean",
14+
"clean": "pnpm run-all clean",
1515
"cspell": "cspell --no-progress .",
1616
"dogfood": "pnpm install && pnpm build && pnpm run-all dogfood",
1717
"format": "prettier --write .",
@@ -23,12 +23,12 @@
2323
"preinstall": "npx only-allow pnpm",
2424
"prepare-publish": "node ./eng/scripts/prepare-publish.js",
2525
"purge": "rimraf --glob \"packages/*/node_modules/\" --glob \"core/packages/*/node_modules/\"",
26-
"regen-docs": "pnpm run-all --parallel --aggregate-output --reporter=append-only run regen-docs",
27-
"regen-samples": "pnpm run-all run regen-samples",
26+
"regen-docs": "pnpm run-all regen-docs",
27+
"regen-samples": "pnpm run-all regen-samples",
2828
"test": "vitest run --config ./vitest.config.fast.ts",
2929
"test:ci": "vitest run --config ./vitest.config.fast.ts --coverage --reporter=junit --reporter=default",
30-
"test:e2e": "pnpm run-azure-only run test:e2e",
31-
"update-playground-versions": "pnpm run-all run update-playground-versions",
30+
"test:e2e": "pnpm run-azure-only test:e2e",
31+
"update-playground-versions": "pnpm run-all update-playground-versions",
3232
"watch": "tsc --build ./tsconfig.ws.json --watch",
3333
"sync-labels": "tsx ./core/eng/common/scripts/labels/sync-labels.ts --config ./eng/config/labels.ts",
3434
"validate-scenarios": "pnpm -r --filter=@azure-tools/azure-http-specs run validate-scenarios",
@@ -45,18 +45,19 @@
4545
"@pnpm/workspace.find-packages": "catalog:",
4646
"@types/node": "catalog:",
4747
"@vitest/coverage-v8": "catalog:",
48+
"@vitest/eslint-plugin": "catalog:",
4849
"cspell": "catalog:",
4950
"eslint": "catalog:",
5051
"eslint-plugin-import": "catalog:",
5152
"eslint-plugin-unicorn": "catalog:",
52-
"@vitest/eslint-plugin": "catalog:",
5353
"playwright": "catalog:",
5454
"prettier": "catalog:",
5555
"prettier-plugin-astro": "catalog:",
5656
"prettier-plugin-organize-imports": "catalog:",
5757
"prettier-plugin-sh": "catalog:",
5858
"rimraf": "catalog:",
5959
"tsx": "catalog:",
60+
"turbo": "catalog:",
6061
"typescript": "catalog:",
6162
"typescript-eslint": "catalog:",
6263
"vitest": "catalog:"

pnpm-lock.yaml

Lines changed: 69 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ catalog:
179179
tree-sitter-python: ^0.25.0
180180
tree-sitter-typescript: ^0.23.2
181181
tsx: ^4.21.0
182+
turbo: ^2.9.5
182183
typedoc: ^0.28.18
183184
typedoc-plugin-markdown: ^4.11.0
184185
typescript: ~6.0.2

turbo.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"$schema": "https://turbo.build/schema.json",
3+
"tasks": {
4+
"build": {
5+
"dependsOn": ["^build"],
6+
"inputs": ["src/**", "lib/**", "tsconfig*.json", "package.json", ".scripts/**"],
7+
"outputs": ["dist/**"]
8+
},
9+
"test": {
10+
"dependsOn": ["build"],
11+
"inputs": ["src/**", "test/**", "vitest.config.*", "package.json"],
12+
"outputs": []
13+
},
14+
"test:ci": {
15+
"dependsOn": ["build"],
16+
"inputs": ["src/**", "test/**", "vitest.config.*", "package.json"],
17+
"outputs": ["coverage/**"]
18+
},
19+
"lint": {
20+
"inputs": ["src/**", "test/**", "eslint.config.*", "package.json"],
21+
"outputs": []
22+
},
23+
"clean": {
24+
"cache": false
25+
},
26+
"regen-docs": {
27+
"dependsOn": ["build"],
28+
"cache": false
29+
},
30+
"regen-samples": {
31+
"dependsOn": ["build"],
32+
"cache": false
33+
},
34+
"watch": {
35+
"cache": false,
36+
"persistent": true
37+
},
38+
"dogfood": {
39+
"dependsOn": ["build"],
40+
"cache": false
41+
},
42+
"update-playground-versions": {
43+
"dependsOn": ["build"],
44+
"cache": false
45+
},
46+
"test:e2e": {
47+
"dependsOn": ["build"],
48+
"cache": false
49+
}
50+
}
51+
}

0 commit comments

Comments
 (0)