Merge pull request #652 from zen-browser/feat/turbo

feat(turbo): integrate Turbo for task management and update CI pipeline to use Turbo commands
This commit is contained in:
Shintaro Jokagi 2025-06-03 11:31:23 +12:00 committed by GitHub
commit ad471b8d00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 144 additions and 18 deletions

View file

@ -23,8 +23,11 @@ jobs:
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: | path: |
.turbo
node_modules node_modules
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Verify pnpm installation - name: Verify pnpm installation
run: pnpm --version run: pnpm --version
- name: Install dependencies - name: Install dependencies
@ -47,10 +50,13 @@ jobs:
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: | path: |
.turbo
node_modules node_modules
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Run Eslint check - name: Run Eslint check
run: pnpm run lint run: pnpm exec turbo run lint
prettier: prettier:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -67,10 +73,13 @@ jobs:
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: | path: |
.turbo
node_modules node_modules
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Run Prettier check - name: Run Prettier check
run: pnpm run format:check run: pnpm exec turbo run format
cspell: cspell:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -87,10 +96,13 @@ jobs:
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: | path: |
.turbo
node_modules node_modules
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Run cspell check - name: Run cspell check
run: pnpm run spell run: pnpm exec turbo run spell
vitest: vitest:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -107,10 +119,13 @@ jobs:
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: | path: |
.turbo
node_modules node_modules
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Run Vitest tests - name: Run Vitest tests
run: pnpm vitest run run: pnpm exec turbo test
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -127,10 +142,13 @@ jobs:
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: | path: |
.turbo
node_modules node_modules
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Build project - name: Build project
run: pnpm run build run: pnpm exec turbo run build
- name: Upload build output - name: Upload build output
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
@ -155,10 +173,11 @@ jobs:
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: | path: |
.turbo
node_modules node_modules
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} key: ${{ runner.os }}-turbo-${{ github.sha }}
- name: Install dependencies restore-keys: |
run: pnpm install --frozen-lockfile ${{ runner.os }}-turbo-
- name: Install Playwright Browsers - name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps run: pnpm exec playwright install --with-deps
- name: Download build output - name: Download build output
@ -167,4 +186,4 @@ jobs:
name: build name: build
path: dist path: dist
- name: Run Playwright tests - name: Run Playwright tests
run: pnpm run test:playwright run: pnpm exec turbo run test:playwright

4
.gitignore vendored
View file

@ -32,4 +32,6 @@ npm-debug.log*
/coverage /coverage
# cache # cache
.eslintcache .eslintcache
# Turborepo
.turbo

View file

@ -16,8 +16,8 @@
"lint": "eslint . --max-warnings=0 --cache", "lint": "eslint . --max-warnings=0 --cache",
"lint:fix": "eslint . --fix", "lint:fix": "eslint . --fix",
"spell": "cspell \"src/**/*.{ts,tsx,js,jsx,astro,md,json,yml,yaml}\"", "spell": "cspell \"src/**/*.{ts,tsx,js,jsx,astro,md,json,yml,yaml}\"",
"format": "prettier --write .", "format": "prettier . --check --cache",
"format:check": "prettier --check . --cache", "format:fix": "prettier . --write --cache --list-different",
"commitlint": "commitlint --edit", "commitlint": "commitlint --edit",
"test": "vitest run", "test": "vitest run",
"test:coverage": "vitest --coverage", "test:coverage": "vitest --coverage",
@ -91,6 +91,7 @@
"prettier": "3.5.3", "prettier": "3.5.3",
"prettier-plugin-astro": "0.14.1", "prettier-plugin-astro": "0.14.1",
"prettier-plugin-tailwindcss": "^0.6.11", "prettier-plugin-tailwindcss": "^0.6.11",
"turbo": "^2.5.4",
"typescript-eslint": "8.33.0", "typescript-eslint": "8.33.0",
"vite-tsconfig-paths": "5.1.4", "vite-tsconfig-paths": "5.1.4",
"vitest": "3.1.3", "vitest": "3.1.3",

64
pnpm-lock.yaml generated
View file

@ -201,6 +201,9 @@ importers:
prettier-plugin-tailwindcss: prettier-plugin-tailwindcss:
specifier: ^0.6.11 specifier: ^0.6.11
version: 0.6.12(prettier-plugin-astro@0.14.1)(prettier@3.5.3) version: 0.6.12(prettier-plugin-astro@0.14.1)(prettier@3.5.3)
turbo:
specifier: ^2.5.4
version: 2.5.4
typescript-eslint: typescript-eslint:
specifier: 8.33.0 specifier: 8.33.0
version: 8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.6.3) version: 8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.6.3)
@ -4465,6 +4468,40 @@ packages:
tslib@2.8.1: tslib@2.8.1:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
turbo-darwin-64@2.5.4:
resolution: {integrity: sha512-ah6YnH2dErojhFooxEzmvsoZQTMImaruZhFPfMKPBq8sb+hALRdvBNLqfc8NWlZq576FkfRZ/MSi4SHvVFT9PQ==}
cpu: [x64]
os: [darwin]
turbo-darwin-arm64@2.5.4:
resolution: {integrity: sha512-2+Nx6LAyuXw2MdXb7pxqle3MYignLvS7OwtsP9SgtSBaMlnNlxl9BovzqdYAgkUW3AsYiQMJ/wBRb7d+xemM5A==}
cpu: [arm64]
os: [darwin]
turbo-linux-64@2.5.4:
resolution: {integrity: sha512-5May2kjWbc8w4XxswGAl74GZ5eM4Gr6IiroqdLhXeXyfvWEdm2mFYCSWOzz0/z5cAgqyGidF1jt1qzUR8hTmOA==}
cpu: [x64]
os: [linux]
turbo-linux-arm64@2.5.4:
resolution: {integrity: sha512-/2yqFaS3TbfxV3P5yG2JUI79P7OUQKOUvAnx4MV9Bdz6jqHsHwc9WZPpO4QseQm+NvmgY6ICORnoVPODxGUiJg==}
cpu: [arm64]
os: [linux]
turbo-windows-64@2.5.4:
resolution: {integrity: sha512-EQUO4SmaCDhO6zYohxIjJpOKRN3wlfU7jMAj3CgcyTPvQR/UFLEKAYHqJOnJtymbQmiiM/ihX6c6W6Uq0yC7mA==}
cpu: [x64]
os: [win32]
turbo-windows-arm64@2.5.4:
resolution: {integrity: sha512-oQ8RrK1VS8lrxkLriotFq+PiF7iiGgkZtfLKF4DDKsmdbPo0O9R2mQxm7jHLuXraRCuIQDWMIw6dpcr7Iykf4A==}
cpu: [arm64]
os: [win32]
turbo@2.5.4:
resolution: {integrity: sha512-kc8ZibdRcuWUG1pbYSBFWqmIjynlD8Lp7IB6U3vIzvOv9VG+6Sp8bzyeBWE3Oi8XV5KsQrznyRTBPvrf99E4mA==}
hasBin: true
type-check@0.4.0: type-check@0.4.0:
resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
engines: {node: '>= 0.8.0'} engines: {node: '>= 0.8.0'}
@ -9949,6 +9986,33 @@ snapshots:
tslib@2.8.1: {} tslib@2.8.1: {}
turbo-darwin-64@2.5.4:
optional: true
turbo-darwin-arm64@2.5.4:
optional: true
turbo-linux-64@2.5.4:
optional: true
turbo-linux-arm64@2.5.4:
optional: true
turbo-windows-64@2.5.4:
optional: true
turbo-windows-arm64@2.5.4:
optional: true
turbo@2.5.4:
optionalDependencies:
turbo-darwin-64: 2.5.4
turbo-darwin-arm64: 2.5.4
turbo-linux-64: 2.5.4
turbo-linux-arm64: 2.5.4
turbo-windows-64: 2.5.4
turbo-windows-arm64: 2.5.4
type-check@0.4.0: type-check@0.4.0:
dependencies: dependencies:
prelude-ls: 1.2.1 prelude-ls: 1.2.1

40
turbo.json Normal file
View file

@ -0,0 +1,40 @@
{
"$schema": "https://turborepo.com/schema.json",
"tasks": {
"dev": {
"cache": false,
"persistent": true,
"outputs": []
},
"lint": {
"cache": true,
"inputs": ["**/*{ts,tsx,js,jsx,astro}"],
"outputs": []
},
"format": {
"cache": true,
"inputs": ["**/*.{ts,tsx,js,jsx,astro,json,yml,yaml}"],
"outputs": []
},
"build": {
"cache": true,
"outputs": ["dist/**"]
},
"test": {
"cache": true,
"inputs": ["**/*.{ts,tsx,js,jsx}"],
"outputs": []
},
"spell": {
"cache": true,
"inputs": ["src/**/*.{ts,tsx,js,jsx,astro,md,json,yml,yaml}"],
"outputs": []
},
"test:playwright": {
"cache": true,
"inputs": ["**/*.{ts,tsx,js,jsx}"],
"outputs": ["playwright-report/**", "test-results/**"]
}
},
"ui": "tui"
}