From d472bd479ecf02debaec3e6bf0af2a80556e2958 Mon Sep 17 00:00:00 2001 From: Shintaro Jokagi Date: Tue, 3 Jun 2025 10:57:43 +1200 Subject: [PATCH] feat(turbo): integrate Turbo for task management and update CI pipeline to use Turbo commands --- .github/workflows/ci-pipeline.yml | 19 ++++++--- .gitignore | 4 +- package.json | 5 ++- pnpm-lock.yaml | 64 +++++++++++++++++++++++++++++++ turbo.json | 40 +++++++++++++++++++ 5 files changed, 123 insertions(+), 9 deletions(-) create mode 100644 turbo.json diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 5d9da7d..27aa822 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -23,6 +23,7 @@ jobs: uses: actions/cache@v4 with: path: | + .turbo node_modules key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} - name: Verify pnpm installation @@ -47,10 +48,11 @@ jobs: uses: actions/cache@v4 with: path: | + .turbo node_modules key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} - name: Run Eslint check - run: pnpm run lint + run: turbo run lint prettier: runs-on: ubuntu-latest @@ -67,10 +69,11 @@ jobs: uses: actions/cache@v4 with: path: | + .turbo node_modules key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} - name: Run Prettier check - run: pnpm run format:check + run: turbo run format cspell: runs-on: ubuntu-latest @@ -87,10 +90,11 @@ jobs: uses: actions/cache@v4 with: path: | + .turbo node_modules key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} - name: Run cspell check - run: pnpm run spell + run: turbo run spell vitest: runs-on: ubuntu-latest @@ -107,10 +111,11 @@ jobs: uses: actions/cache@v4 with: path: | + .turbo node_modules key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} - name: Run Vitest tests - run: pnpm vitest run + run: turbo vitest run build: runs-on: ubuntu-latest @@ -127,10 +132,11 @@ jobs: uses: actions/cache@v4 with: path: | + .turbo node_modules key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} - name: Build project - run: pnpm run build + run: turbo run build - name: Upload build output uses: actions/upload-artifact@v4 with: @@ -155,6 +161,7 @@ jobs: uses: actions/cache@v4 with: path: | + .turbo node_modules key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} - name: Install dependencies @@ -167,4 +174,4 @@ jobs: name: build path: dist - name: Run Playwright tests - run: pnpm run test:playwright + run: turbo run test:playwright diff --git a/.gitignore b/.gitignore index 5323fa6..ccf48a6 100644 --- a/.gitignore +++ b/.gitignore @@ -32,4 +32,6 @@ npm-debug.log* /coverage # cache -.eslintcache \ No newline at end of file +.eslintcache +# Turborepo +.turbo diff --git a/package.json b/package.json index fa8f945..2ad7313 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,8 @@ "lint": "eslint . --max-warnings=0 --cache", "lint:fix": "eslint . --fix", "spell": "cspell \"src/**/*.{ts,tsx,js,jsx,astro,md,json,yml,yaml}\"", - "format": "prettier --write .", - "format:check": "prettier --check . --cache", + "format": "prettier . --check --cache", + "format:fix": "prettier . --write --cache --list-different", "commitlint": "commitlint --edit", "test": "vitest run", "test:coverage": "vitest --coverage", @@ -91,6 +91,7 @@ "prettier": "3.5.3", "prettier-plugin-astro": "0.14.1", "prettier-plugin-tailwindcss": "^0.6.11", + "turbo": "^2.5.4", "typescript-eslint": "8.33.0", "vite-tsconfig-paths": "5.1.4", "vitest": "3.1.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 17fdf12..426ce18 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -201,6 +201,9 @@ importers: prettier-plugin-tailwindcss: specifier: ^0.6.11 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: specifier: 8.33.0 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: 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: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} @@ -9949,6 +9986,33 @@ snapshots: 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: dependencies: prelude-ls: 1.2.1 diff --git a/turbo.json b/turbo.json new file mode 100644 index 0000000..058731d --- /dev/null +++ b/turbo.json @@ -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" +}