Skip to content

Commit ebe1868

Browse files
authored
Merge pull request #9 from tuist/feature/turborepo-support
Add TurboRepo Remote Caching Support with Zero-Configuration Setup
2 parents 6243d3c + b16b781 commit ebe1868

File tree

19 files changed

+871
-94
lines changed

19 files changed

+871
-94
lines changed

.github/workflows/fabrik.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
if: runner.os == 'macOS'
8484
uses: maxim-lobanov/setup-xcode@v1
8585
with:
86-
xcode-version: latest-stable
86+
xcode-version: '16.0'
8787

8888
- name: Install Rust
8989
uses: dtolnay/rust-toolchain@stable
@@ -127,7 +127,7 @@ jobs:
127127
if: runner.os == 'macOS'
128128
uses: maxim-lobanov/setup-xcode@v1
129129
with:
130-
xcode-version: latest-stable
130+
xcode-version: '16.0'
131131

132132
- name: Install Rust
133133
uses: dtolnay/rust-toolchain@stable

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
/target
33
*.pdb
44

5+
# Fabrik cache
6+
.fabrik/
7+
58
# Release artifacts
69
/dist
710

docs/.vitepress/config.mts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ export default defineConfig({
4040
text: '<span class="sidebar-icon-text"><img src="/images/nx.svg" class="sidebar-icon" alt="Nx">Nx</span>',
4141
link: "/build-systems/nx",
4242
},
43+
{
44+
text: '<span class="sidebar-icon-text"><img src="/images/turborepo-icon.svg" class="sidebar-icon" alt="TurboRepo">TurboRepo</span>',
45+
link: "/build-systems/turborepo",
46+
},
4347
{
4448
text: '<span class="sidebar-icon-text"><img src="/images/xcode.png" class="sidebar-icon" alt="Xcode">Xcode</span>',
4549
link: "/build-systems/xcode",

docs/build-systems/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The guides below focus on **build system-specific** configuration and tips.
1717
- **[Gradle](./gradle)** - Java, Kotlin, Android projects
1818
- **[Bazel](./bazel)** - Multi-language monorepos *(coming soon)*
1919
- **[Nx](./nx)** - JavaScript/TypeScript monorepos *(coming soon)*
20-
- **TurboRepo** - JavaScript/TypeScript monorepos *(coming soon)*
20+
- **[TurboRepo](./turborepo)** - JavaScript/TypeScript monorepos
2121

2222
### Platform-Specific
2323

@@ -67,7 +67,9 @@ Fabrik exports these for different build tools:
6767
| `FABRIK_GRPC_URL` | Bazel, Buck2 | gRPC cache URL |
6868
| `GRADLE_BUILD_CACHE_URL` | Gradle | Gradle-specific cache URL |
6969
| `NX_SELF_HOSTED_REMOTE_CACHE_SERVER` | Nx | Nx-specific cache URL |
70-
| `TURBO_TOKEN` | TurboRepo | TurboRepo auth (future) |
70+
| `TURBO_API` | TurboRepo | TurboRepo cache server URL |
71+
| `TURBO_TOKEN` | TurboRepo | Auth token (auto-generated) |
72+
| `TURBO_TEAM` | TurboRepo | Team slug (auto-generated) |
7173
| `XCODE_CACHE_SERVER` | Xcode | Xcode cache URL |
7274

7375
## Example Configuration

docs/build-systems/turborepo.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# TurboRepo Integration
2+
3+
TurboRepo integration guide for Fabrik. This assumes you've already [completed the getting started guide](/getting-started).
4+
5+
## How It Works
6+
7+
Fabrik provides remote caching for TurboRepo via the v8 HTTP API. When you navigate to your project, Fabrik automatically exports:
8+
9+
- `TURBO_API` - Points to Fabrik's HTTP cache server
10+
- `TURBO_TOKEN` - Auto-generated for authentication
11+
- `TURBO_TEAM` - Auto-generated team identifier
12+
13+
TurboRepo automatically detects these environment variables and enables remote caching.
14+
15+
## Quick Start
16+
17+
```bash
18+
cd ~/my-turborepo-workspace
19+
turbo run build
20+
```
21+
22+
That's it! TurboRepo will automatically use Fabrik's cache via the environment variables.

docs/images/turborepo-icon.svg

Lines changed: 1 addition & 0 deletions
Loading

fixtures/turborepo/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
dist
3+
.turbo
4+
.npmrc

fixtures/turborepo/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "turborepo-fixture",
3+
"version": "1.0.0",
4+
"private": true,
5+
"packageManager": "npm@11.0.0",
6+
"workspaces": [
7+
"packages/*"
8+
],
9+
"devDependencies": {
10+
"turbo": "latest"
11+
}
12+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
// Create dist directory
5+
const distDir = path.join(__dirname, 'dist');
6+
if (!fs.existsSync(distDir)) {
7+
fs.mkdirSync(distDir, { recursive: true });
8+
}
9+
10+
// Generate some output
11+
const output = {
12+
message: 'Build complete!',
13+
timestamp: new Date().toISOString(),
14+
platform: process.platform,
15+
};
16+
17+
fs.writeFileSync(
18+
path.join(distDir, 'output.json'),
19+
JSON.stringify(output, null, 2)
20+
);
21+
22+
console.log('✅ Build complete!');
23+
console.log(' Output:', path.join(distDir, 'output.json'));
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "app",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"build": "node build.js"
6+
}
7+
}

0 commit comments

Comments
 (0)