Skip to content

Commit 70bab30

Browse files
authored
🌪️ Add turbo (#30)
1 parent c1d3f8d commit 70bab30

File tree

10 files changed

+144
-27
lines changed

10 files changed

+144
-27
lines changed

.github/workflows/primary.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ jobs:
1717
- uses: actions/checkout@v4
1818

1919
- uses: pnpm/action-setup@v4
20-
with:
21-
version: 9
2220

2321
- uses: actions/setup-node@v4
2422
with:
@@ -32,7 +30,7 @@ jobs:
3230
- run: pnpm install --frozen-lockfile
3331

3432
# Typecheck codegen scripts (before format/lint possibly change line numbers)
35-
- run: pnpm --filter scripts typecheck
33+
- run: pnpm --filter @oxa/scripts typecheck
3634

3735
# On push: auto-fix formatting and linting (will be committed)
3836
- run: pnpm format
@@ -49,22 +47,13 @@ jobs:
4947
- name: Generate types
5048
run: pnpm codegen all
5149

52-
# Typecheck generated code (TypeScript via tsc, Python via ty, Rust via cargo)
53-
# Note: oxa-types-ts uses build (not typecheck) to produce dist/*.d.ts for @oxa/core
54-
- run: pnpm build
55-
working-directory: packages/oxa-types-ts
50+
# Typecheck generated code (Python and Rust - TypeScript handled by turbo build)
5651
- run: uv run ty check src/
5752
working-directory: packages/oxa-types-py
5853
- run: cargo check
5954
working-directory: packages/oxa-types-rs
6055

61-
# Build and test @oxa/core
62-
- run: pnpm --filter @oxa/core typecheck
63-
- run: pnpm --filter @oxa/core build
64-
- run: pnpm --filter @oxa/core test
65-
66-
# Build oxa (copy bundled CLI)
67-
- run: pnpm --filter oxa build
56+
- run: pnpm test
6857

6958
- name: Commit changes
7059
if: github.event_name == 'push'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Node.js
22
node_modules
33
dist
4+
.turbo
45

56
# Python
67
__pycache__

CONTRIBUTING.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,15 @@ pnpm codegen docs # Generate MyST documentation
6969
### Building
7070

7171
```bash
72-
# Build all packages
72+
# Build all packages (uses Turborepo for caching and parallel execution)
7373
pnpm build
74+
75+
# Clean all packages
76+
pnpm clean
7477
```
7578

79+
**Note:** This project uses [Turborepo](https://turbo.build/) for build orchestration. Turborepo provides intelligent caching and parallel task execution across the monorepo, significantly speeding up builds and tests.
80+
7681
## Documentation
7782

7883
The documentation uses [MyST](https://mystmd.org) and requires the automated codegen tool to run. To start the documentation use `npm install -g mystmd` and run `myst start` in the `docs/` folder. The online documentation is hosted using Curvenote under https://oxa.dev

package.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,29 @@
66
"engines": {
77
"node": ">=22"
88
},
9+
"workspaces": [
10+
"packages/*",
11+
"scripts"
12+
],
913
"scripts": {
1014
"codegen": "tsx scripts/codegen.ts",
11-
"format": "prettier --write .",
12-
"format:check": "prettier --check .",
13-
"lint": "eslint .",
14-
"lint:fix": "eslint --fix .",
15-
"build": "pnpm -r build",
16-
"test": "pnpm -r test"
15+
"format": "turbo format",
16+
"format:check": "turbo format:check",
17+
"lint": "turbo lint",
18+
"lint:fix": "turbo lint:fix",
19+
"build": "turbo build",
20+
"test": "turbo test",
21+
"clean": "turbo clean"
1722
},
1823
"devDependencies": {
1924
"@eslint/js": "^9.39.2",
2025
"eslint": "^9.39.2",
2126
"prettier": "^3.7.4",
2227
"tsx": "^4.21.0",
28+
"turbo": "^2.0.0",
2329
"typescript": "^5.9.3",
2430
"typescript-eslint": "^8.50.0",
2531
"vitest": "^4.0.16"
26-
}
32+
},
33+
"packageManager": "pnpm@9.0.0"
2734
}

packages/oxa-core/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919
"build": "tsc && cp ../../schema/schema.json dist/ && pnpm run build:bundle",
2020
"build:bundle": "esbuild src/cli.ts --bundle --platform=node --target=node22 --format=cjs --outfile=dist/cli.bundle.cjs --banner:js='#!/usr/bin/env node' --log-override:empty-import-meta=silent",
2121
"test": "vitest run",
22-
"typecheck": "tsc --noEmit"
22+
"typecheck": "tsc --noEmit",
23+
"clean": "rm -rf dist",
24+
"format": "prettier --write \"src/**/*.ts\"",
25+
"format:check": "prettier --check \"src/**/*.ts\"",
26+
"lint": "eslint .",
27+
"lint:fix": "eslint --fix ."
2328
},
2429
"dependencies": {
2530
"oxa-types": "workspace:*",

packages/oxa-types-ts/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@
1414
],
1515
"scripts": {
1616
"typecheck": "tsc --noEmit",
17-
"build": "tsc"
17+
"build": "tsc",
18+
"clean": "rm -rf dist",
19+
"format": "prettier --write \"src/**/*.ts\"",
20+
"format:check": "prettier --check \"src/**/*.ts\"",
21+
"lint": "eslint .",
22+
"lint:fix": "eslint --fix ."
1823
},
1924
"keywords": [
2025
"oxa",

packages/oxa/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"dist"
1111
],
1212
"scripts": {
13-
"build": "rm -rf dist && mkdir -p dist && cp ../oxa-core/dist/cli.bundle.cjs dist/cli.cjs && cp ../oxa-core/dist/schema.json dist/"
13+
"build": "rm -rf dist && mkdir -p dist && cp ../oxa-core/dist/cli.bundle.cjs dist/cli.cjs && cp ../oxa-core/dist/schema.json dist/",
14+
"clean": "rm -rf dist"
1415
},
1516
"keywords": [
1617
"oxa",
@@ -24,6 +25,9 @@
2425
"url": "git+https://github.com/oxa-dev/oxa.git",
2526
"directory": "packages/oxa"
2627
},
28+
"devDependencies": {
29+
"@oxa/core": "workspace:*"
30+
},
2731
"engines": {
2832
"node": ">=22"
2933
}

pnpm-lock.yaml

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

scripts/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
"private": true,
44
"type": "module",
55
"scripts": {
6-
"typecheck": "tsc --noEmit"
6+
"typecheck": "tsc --noEmit",
7+
"test": "pnpm run typecheck",
8+
"format": "prettier --write \"*.ts\" \"lib/**/*.ts\"",
9+
"format:check": "prettier --check \"*.ts\" \"lib/**/*.ts\"",
10+
"lint": "eslint .",
11+
"lint:fix": "eslint --fix ."
712
},
813
"dependencies": {
914
"ajv": "^8.17.1",

turbo.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "https://turborepo.org/schema.json",
3+
"tasks": {
4+
"build": {
5+
"dependsOn": ["^build"],
6+
"outputs": ["dist/**", ".next/**", "api/**", "public/build/**"]
7+
},
8+
"clean": {
9+
"outputs": []
10+
},
11+
"format": {
12+
"outputs": []
13+
},
14+
"format:check": {
15+
"outputs": []
16+
},
17+
"lint": {
18+
"outputs": []
19+
},
20+
"lint:fix": {
21+
"outputs": []
22+
},
23+
"test": {
24+
"dependsOn": ["build"],
25+
"outputs": []
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)