chore: add Turborepo for monorepo orchestration
- Add turbo devDependency and packageManager to root - Create turbo.json with build, test, lint pipeline - Add package.json to veza-backend-api, veza-chat-server, veza-stream-server - Extend workspaces to include Go and Rust services - Migrate CI to use turbo run for build, test, lint
This commit is contained in:
parent
7c7580be4d
commit
83a9a3537c
7 changed files with 204 additions and 48 deletions
73
.github/workflows/ci.yml
vendored
73
.github/workflows/ci.yml
vendored
|
|
@ -14,6 +14,12 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
|
|
@ -21,9 +27,7 @@ jobs:
|
|||
cache: true
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd veza-backend-api
|
||||
go mod download
|
||||
run: npm ci
|
||||
|
||||
- name: Run govulncheck
|
||||
run: |
|
||||
|
|
@ -37,20 +41,13 @@ jobs:
|
|||
go vet ./...
|
||||
|
||||
- name: Lint
|
||||
run: |
|
||||
cd veza-backend-api
|
||||
test -z "$(gofmt -l .)" || (echo "gofmt needed on:"; gofmt -l .; exit 1)
|
||||
run: npx turbo run lint --filter=veza-backend-api
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
cd veza-backend-api
|
||||
# Running tests excluding those that require DB connection for now
|
||||
go test -v ./internal/handlers/... ./internal/services/... -short
|
||||
run: npx turbo run test --filter=veza-backend-api
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cd veza-backend-api
|
||||
go build -v ./...
|
||||
run: npx turbo run build --filter=veza-backend-api
|
||||
|
||||
rust-services:
|
||||
name: Rust Services (Chat & Stream)
|
||||
|
|
@ -58,11 +55,20 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Set up Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Cache Cargo registry
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
|
|
@ -72,9 +78,6 @@ jobs:
|
|||
target
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Check Formatting
|
||||
run: cargo fmt --all -- --check
|
||||
|
||||
- name: Install cargo-audit
|
||||
run: cargo install cargo-audit
|
||||
|
||||
|
|
@ -88,26 +91,14 @@ jobs:
|
|||
cd veza-stream-server
|
||||
cargo audit
|
||||
|
||||
- name: Build Chat Server
|
||||
run: |
|
||||
cd veza-chat-server
|
||||
cargo check
|
||||
cargo build --verbose
|
||||
- name: Lint
|
||||
run: npx turbo run lint --filter=veza-chat-server --filter=veza-stream-server
|
||||
|
||||
- name: Build Stream Server
|
||||
run: |
|
||||
cd veza-stream-server
|
||||
cargo build --verbose
|
||||
- name: Build
|
||||
run: npx turbo run build --filter=veza-chat-server --filter=veza-stream-server
|
||||
|
||||
- name: Test Stream Server
|
||||
run: |
|
||||
cd veza-stream-server
|
||||
cargo test --verbose
|
||||
|
||||
- name: Test Chat Server
|
||||
run: |
|
||||
cd veza-chat-server
|
||||
cargo test --verbose
|
||||
- name: Test
|
||||
run: npx turbo run test --filter=veza-chat-server --filter=veza-stream-server
|
||||
|
||||
frontend:
|
||||
name: Frontend (Web)
|
||||
|
|
@ -147,9 +138,7 @@ jobs:
|
|||
# Cache keyed on openapi.yaml hash, so types regenerate when spec changes
|
||||
|
||||
- name: Lint
|
||||
run: |
|
||||
cd apps/web
|
||||
npm run lint --if-present
|
||||
run: npx turbo run lint --filter=veza-frontend
|
||||
|
||||
- name: Format Check
|
||||
run: |
|
||||
|
|
@ -161,10 +150,8 @@ jobs:
|
|||
cd apps/web
|
||||
npm run typecheck
|
||||
|
||||
- name: Unit Tests
|
||||
run: |
|
||||
cd apps/web
|
||||
npm run test -- --run
|
||||
- name: Test
|
||||
run: npx turbo run test --filter=veza-frontend -- --run
|
||||
|
||||
- name: Contrast Tests
|
||||
run: |
|
||||
|
|
@ -172,9 +159,7 @@ jobs:
|
|||
npm run test -- --run src/__tests__/contrast.test.ts
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cd apps/web
|
||||
npm run build
|
||||
run: npx turbo run build --filter=veza-frontend
|
||||
|
||||
e2e:
|
||||
name: E2E (Playwright)
|
||||
|
|
|
|||
125
package-lock.json
generated
125
package-lock.json
generated
|
|
@ -7,7 +7,10 @@
|
|||
"name": "veza-monorepo",
|
||||
"workspaces": [
|
||||
"apps/web",
|
||||
"packages/*"
|
||||
"packages/*",
|
||||
"veza-backend-api",
|
||||
"veza-chat-server",
|
||||
"veza-stream-server"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.1",
|
||||
|
|
@ -17,6 +20,7 @@
|
|||
"eslint-plugin-react": "^7.37.5",
|
||||
"globals": "^16.5.0",
|
||||
"prettier": "3.6.2",
|
||||
"turbo": "^2.3.0",
|
||||
"typescript": "^5.9.3",
|
||||
"typescript-eslint": "^8.46.3"
|
||||
}
|
||||
|
|
@ -19640,6 +19644,108 @@
|
|||
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
|
||||
"license": "0BSD"
|
||||
},
|
||||
"node_modules/turbo": {
|
||||
"version": "2.8.8",
|
||||
"resolved": "https://registry.npmjs.org/turbo/-/turbo-2.8.8.tgz",
|
||||
"integrity": "sha512-wP+axjWAKzYfZ7bghuggVST9bX4j5cn3NPMU9NPQqtwaUKL9n9JOnWWBIc9gdrEma1aViYR73EoPjDEpVq+liQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"turbo": "bin/turbo"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"turbo-darwin-64": "2.8.8",
|
||||
"turbo-darwin-arm64": "2.8.8",
|
||||
"turbo-linux-64": "2.8.8",
|
||||
"turbo-linux-arm64": "2.8.8",
|
||||
"turbo-windows-64": "2.8.8",
|
||||
"turbo-windows-arm64": "2.8.8"
|
||||
}
|
||||
},
|
||||
"node_modules/turbo-darwin-64": {
|
||||
"version": "2.8.8",
|
||||
"resolved": "https://registry.npmjs.org/turbo-darwin-64/-/turbo-darwin-64-2.8.8.tgz",
|
||||
"integrity": "sha512-7R/XRAleyNB8nIJuenRpS7EnmCM/kYFgcG1rW3F5DF57Nl4WyBO3DzxqwooRheuoXDD1UsJvDse0yRufgxjClA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
},
|
||||
"node_modules/turbo-darwin-arm64": {
|
||||
"version": "2.8.8",
|
||||
"resolved": "https://registry.npmjs.org/turbo-darwin-arm64/-/turbo-darwin-arm64-2.8.8.tgz",
|
||||
"integrity": "sha512-whpveO0w/dMcgQ0zFrzqK76mG2W+RBQ/pKIpW+sEvNr+T4UcYd2gZpfV2euehJLvdeFErWgW74dIt/MFfkG1bA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
},
|
||||
"node_modules/turbo-linux-64": {
|
||||
"version": "2.8.8",
|
||||
"resolved": "https://registry.npmjs.org/turbo-linux-64/-/turbo-linux-64-2.8.8.tgz",
|
||||
"integrity": "sha512-BISkcKk+5/Dh11q+YhdQIGONXmdlQ6LY0iQ+GBIK7QOBAJyJFKmKvUeAeMdWGXOa3sImz2oZ6u2StyR+0Y/VVA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/turbo-linux-arm64": {
|
||||
"version": "2.8.8",
|
||||
"resolved": "https://registry.npmjs.org/turbo-linux-arm64/-/turbo-linux-arm64-2.8.8.tgz",
|
||||
"integrity": "sha512-B+DQWWtM3O+AexFF4aYucT0MvvnQOW4n5y9LA5h3Zc3Lpj10yl9K4dEBzJvMVQ2jTkCRNAvA8q9G3EjqmGmGGA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/turbo-windows-64": {
|
||||
"version": "2.8.8",
|
||||
"resolved": "https://registry.npmjs.org/turbo-windows-64/-/turbo-windows-64-2.8.8.tgz",
|
||||
"integrity": "sha512-KP5TRVrmVnrxDyvERvQq7VXu+h5AiEiBwyr90YsRuYy/Z5zLz8hrNZXejTyUR17xmnuI+RbUSxrQlfmPnxiW1A==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
},
|
||||
"node_modules/turbo-windows-arm64": {
|
||||
"version": "2.8.8",
|
||||
"resolved": "https://registry.npmjs.org/turbo-windows-arm64/-/turbo-windows-arm64-2.8.8.tgz",
|
||||
"integrity": "sha512-X45sTOksR8iidk+PZUXpNcfEkOhGCTS2p2J8nSUExr1v7u3T4FixwplzliuWmG7QTPGJapAwItzHbi+d/9ckNQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
},
|
||||
"node_modules/tw-animate-css": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/tw-animate-css/-/tw-animate-css-1.4.0.tgz",
|
||||
|
|
@ -20194,10 +20300,22 @@
|
|||
"extsprintf": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/veza-backend-api": {
|
||||
"resolved": "veza-backend-api",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/veza-chat-server": {
|
||||
"resolved": "veza-chat-server",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/veza-frontend": {
|
||||
"resolved": "apps/web",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/veza-stream-server": {
|
||||
"resolved": "veza-stream-server",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "7.3.0",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-7.3.0.tgz",
|
||||
|
|
@ -21148,6 +21266,9 @@
|
|||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"veza-backend-api": {},
|
||||
"veza-chat-server": {},
|
||||
"veza-stream-server": {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
{
|
||||
"name": "veza-monorepo",
|
||||
"private": true,
|
||||
"workspaces": ["apps/web", "packages/*"],
|
||||
"packageManager": "npm@10.9.2",
|
||||
"workspaces": ["apps/web", "packages/*", "veza-backend-api", "veza-chat-server", "veza-stream-server"],
|
||||
"overrides": {
|
||||
"axios": ">=1.13.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"turbo": "^2.3.0",
|
||||
"@eslint/js": "^9.39.1",
|
||||
"@playwright/test": "^1.57.0",
|
||||
"@types/node": "^25.0.3",
|
||||
|
|
@ -17,6 +19,9 @@
|
|||
"typescript-eslint": "^8.46.3"
|
||||
},
|
||||
"scripts": {
|
||||
"prepare": "husky"
|
||||
"prepare": "husky",
|
||||
"build": "turbo run build",
|
||||
"test": "turbo run test",
|
||||
"lint": "turbo run lint"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
18
turbo.json
Normal file
18
turbo.json
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"$schema": "https://turbo.build/schema.json",
|
||||
"tasks": {
|
||||
"build": {
|
||||
"dependsOn": ["^build"],
|
||||
"outputs": ["dist/**", ".next/**", "!.next/cache/**"]
|
||||
},
|
||||
"test": {
|
||||
"dependsOn": [],
|
||||
"outputs": []
|
||||
},
|
||||
"lint": {
|
||||
"dependsOn": [],
|
||||
"outputs": []
|
||||
}
|
||||
},
|
||||
"globalDependencies": ["**/.env.*local"]
|
||||
}
|
||||
9
veza-backend-api/package.json
Normal file
9
veza-backend-api/package.json
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"name": "veza-backend-api",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "go build -v ./...",
|
||||
"test": "go test -v ./internal/handlers/... ./internal/services/... -short",
|
||||
"lint": "test -z \"$(gofmt -l .)\" || (echo 'gofmt needed on:'; gofmt -l .; exit 1)"
|
||||
}
|
||||
}
|
||||
9
veza-chat-server/package.json
Normal file
9
veza-chat-server/package.json
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"name": "veza-chat-server",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "cargo build --verbose",
|
||||
"test": "cargo test --verbose",
|
||||
"lint": "cargo fmt --all -- --check"
|
||||
}
|
||||
}
|
||||
9
veza-stream-server/package.json
Normal file
9
veza-stream-server/package.json
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"name": "veza-stream-server",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "cargo build --verbose",
|
||||
"test": "cargo test --verbose",
|
||||
"lint": "cargo fmt --all -- --check"
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue