From 39b1b7426875c6702e848944e85a304280646589 Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Tue, 22 Oct 2024 16:28:39 +0200 Subject: [PATCH 01/14] chore: Update Turbo --- package.json | 2 +- pnpm-lock.yaml | 58 +++++++++++++++++++++++++------------------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index 670dbec2b..a9cd0b9d7 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "conventional-changelog-conventionalcommits": "^7.0.0", "execa": "^9.2.0", "rollup": "^4.18.0", - "turbo": "^2.0.4" + "turbo": "^2.2.3" }, "packageManager": "pnpm@9.11.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 11450f746..558dd8318 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,8 +51,8 @@ importers: specifier: ^4.18.0 version: 4.24.0 turbo: - specifier: ^2.0.4 - version: 2.1.3 + specifier: ^2.2.3 + version: 2.2.3 docs: dependencies: @@ -13416,41 +13416,41 @@ packages: resolution: {integrity: sha512-GwIJau9XaA8nLVbUXsN3IlFi7WmQ48gBUrl3FTkkL/XLu/POhBzfmX9hd33FNMX1qAsfl6ozO1iMmW9NC8YniA==} engines: {node: ^16.14.0 || >=18.0.0} - turbo-darwin-64@2.1.3: - resolution: {integrity: sha512-ouJOm0g0YyoBuhmikEujVCBGo3Zr0lbSOWFIsQtWUTItC88F2w2byhjtsYGPXQwMlTbXwmoBU2lOCfWNkeEwHQ==} + turbo-darwin-64@2.2.3: + resolution: {integrity: sha512-Rcm10CuMKQGcdIBS3R/9PMeuYnv6beYIHqfZFeKWVYEWH69sauj4INs83zKMTUiZJ3/hWGZ4jet9AOwhsssLyg==} cpu: [x64] os: [darwin] - turbo-darwin-arm64@2.1.3: - resolution: {integrity: sha512-j2FOJsK4LAOtHQlb3Oom0yWB/Vi0nF1ljInr311mVzHoFAJRZtfW2fRvdZRb/lBUwjSp8be58qWHzANIcrA0OA==} + turbo-darwin-arm64@2.2.3: + resolution: {integrity: sha512-+EIMHkuLFqUdJYsA3roj66t9+9IciCajgj+DVek+QezEdOJKcRxlvDOS2BUaeN8kEzVSsNiAGnoysFWYw4K0HA==} cpu: [arm64] os: [darwin] - turbo-linux-64@2.1.3: - resolution: {integrity: sha512-ubRHkI1gSel7H7wsmxKK8C9UlLWqg/2dkCC88LFupaK6TKgvBKqDqA0Z1M9C/escK0Jsle2k0H8bybV9OYIl4Q==} + turbo-linux-64@2.2.3: + resolution: {integrity: sha512-UBhJCYnqtaeOBQLmLo8BAisWbc9v9daL9G8upLR+XGj6vuN/Nz6qUAhverN4Pyej1g4Nt1BhROnj6GLOPYyqxQ==} cpu: [x64] os: [linux] - turbo-linux-arm64@2.1.3: - resolution: {integrity: sha512-LffUL+e5wv7BtD6DgnM2kKOlDkMo2eRjhbAjVnrCD3wi2ug0tl6NDzajnHHjtaMyOnIf4AvzSKdLWsBxafGBQA==} + turbo-linux-arm64@2.2.3: + resolution: {integrity: sha512-hJYT9dN06XCQ3jBka/EWvvAETnHRs3xuO/rb5bESmDfG+d9yQjeTMlhRXKrr4eyIMt6cLDt1LBfyi+6CQ+VAwQ==} cpu: [arm64] os: [linux] turbo-stream@2.4.0: resolution: {integrity: sha512-FHncC10WpBd2eOmGwpmQsWLDoK4cqsA/UT/GqNoaKOQnT8uzhtCbg3EoUDMvqpOSAI0S26mr0rkjzbOO6S3v1g==} - turbo-windows-64@2.1.3: - resolution: {integrity: sha512-S9SvcZZoaq5jKr6kA6eF7/xgQhVn8Vh7PVy5lono9zybvhyL4eY++y2PaLToIgL8G9IcbLmgOC73ExNjFBg9XQ==} + turbo-windows-64@2.2.3: + resolution: {integrity: sha512-NPrjacrZypMBF31b4HE4ROg4P3nhMBPHKS5WTpMwf7wydZ8uvdEHpESVNMOtqhlp857zbnKYgP+yJF30H3N2dQ==} cpu: [x64] os: [win32] - turbo-windows-arm64@2.1.3: - resolution: {integrity: sha512-twlEo8lRrGbrR6T/ZklUIquW3IlFCEtywklgVA81aIrSBm56+GEVpSrHhIlsx1hiYeSNrs+GpDwZGe+V7fvEVQ==} + turbo-windows-arm64@2.2.3: + resolution: {integrity: sha512-fnNrYBCqn6zgKPKLHu4sOkihBI/+0oYFr075duRxqUZ+1aLWTAGfHZLgjVeLh3zR37CVzuerGIPWAEkNhkWEIw==} cpu: [arm64] os: [win32] - turbo@2.1.3: - resolution: {integrity: sha512-lY0yj2GH2a2a3NExZ3rGe+rHUVeFE2aXuRAue57n+08E7Z7N7YCmynju0kPC1grAQzERmoLpKrmzmWd+PNiADw==} + turbo@2.2.3: + resolution: {integrity: sha512-5lDvSqIxCYJ/BAd6rQGK/AzFRhBkbu4JHVMLmGh/hCb7U3CqSnr5Tjwfy9vc+/5wG2DJ6wttgAaA7MoCgvBKZQ==} hasBin: true twoslash-protocol@0.2.12: @@ -30939,34 +30939,34 @@ snapshots: transitivePeerDependencies: - supports-color - turbo-darwin-64@2.1.3: + turbo-darwin-64@2.2.3: optional: true - turbo-darwin-arm64@2.1.3: + turbo-darwin-arm64@2.2.3: optional: true - turbo-linux-64@2.1.3: + turbo-linux-64@2.2.3: optional: true - turbo-linux-arm64@2.1.3: + turbo-linux-arm64@2.2.3: optional: true turbo-stream@2.4.0: {} - turbo-windows-64@2.1.3: + turbo-windows-64@2.2.3: optional: true - turbo-windows-arm64@2.1.3: + turbo-windows-arm64@2.2.3: optional: true - turbo@2.1.3: + turbo@2.2.3: optionalDependencies: - turbo-darwin-64: 2.1.3 - turbo-darwin-arm64: 2.1.3 - turbo-linux-64: 2.1.3 - turbo-linux-arm64: 2.1.3 - turbo-windows-64: 2.1.3 - turbo-windows-arm64: 2.1.3 + turbo-darwin-64: 2.2.3 + turbo-darwin-arm64: 2.2.3 + turbo-linux-64: 2.2.3 + turbo-linux-arm64: 2.2.3 + turbo-windows-64: 2.2.3 + turbo-windows-arm64: 2.2.3 twoslash-protocol@0.2.12: {} From 350e9cbdd4958d17f5f98d467e3a0fad32ea0d8a Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Wed, 23 Oct 2024 08:26:27 +0200 Subject: [PATCH 02/14] simplify turbo outputs --- .gitignore | 1 + turbo.json | 9 +-------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 7003450e5..1bbd03821 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ node_modules/ dist/ .next/ tsconfig.tsbuildinfo +.turbo diff --git a/turbo.json b/turbo.json index 46ed57a92..b7e4fab32 100644 --- a/turbo.json +++ b/turbo.json @@ -3,14 +3,7 @@ "tasks": { "build": { "dependsOn": ["^build"], - "outputs": [ - "dist/**/*.ts", - "dist/**/*.tsx", - "dist/**/*.mjs", - "dist/**/*.js", - ".next/**", - "!.next/cache/**" - ] + "outputs": ["dist/**", ".next/**", "!.next/cache/**", "build/**"] }, "test": { "dependsOn": ["build"] From c82f19285d2c0aa62a6207285be210223b3e55dd Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Wed, 23 Oct 2024 15:28:16 +0200 Subject: [PATCH 03/14] prod deployment --- turbo.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/turbo.json b/turbo.json index b7e4fab32..4c738f1c3 100644 --- a/turbo.json +++ b/turbo.json @@ -5,12 +5,12 @@ "dependsOn": ["^build"], "outputs": ["dist/**", ".next/**", "!.next/cache/**", "build/**"] }, + "lint": {}, "test": { "dependsOn": ["build"] }, "size": { "dependsOn": ["build"] - }, - "lint": {} + } } } From a14cec5749e724e30dd876cf83fe5d722084a684 Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Wed, 23 Oct 2024 15:43:14 +0200 Subject: [PATCH 04/14] more parallelization? --- .github/workflows/main.yml | 5 +---- package.json | 4 ---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 658c0a2ec..6fa7ecf89 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,7 +29,4 @@ jobs: # Setting up playwright in one example is sufficient - run: pnpm --filter example-app-router-playground exec playwright install --with-deps - - run: pnpm run build - - run: pnpm run lint - - run: pnpm run test - - run: pnpm run size + - run: pnpm turbo run lint build test size diff --git a/package.json b/package.json index a9cd0b9d7..dc2b908d9 100644 --- a/package.json +++ b/package.json @@ -2,11 +2,7 @@ "name": "root", "private": true, "scripts": { - "build": "turbo run build --env-mode=loose", - "test": "turbo run test --concurrency 1 --env-mode=loose", - "lint": "turbo run lint --env-mode=loose", "postinstall": "turbo run build --filter './packages/**' --env-mode=loose", - "size": "turbo run size --env-mode=loose", "publish": "lerna publish" }, "devDependencies": { From 9ed0e951c9be141cac8440bf53147d32236387ef Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Wed, 23 Oct 2024 15:49:04 +0200 Subject: [PATCH 05/14] lint depends on build --- turbo.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/turbo.json b/turbo.json index 4c738f1c3..49eabfe80 100644 --- a/turbo.json +++ b/turbo.json @@ -5,7 +5,9 @@ "dependsOn": ["^build"], "outputs": ["dist/**", ".next/**", "!.next/cache/**", "build/**"] }, - "lint": {}, + "lint": { + "dependsOn": ["^build"] + }, "test": { "dependsOn": ["build"] }, From a06ab0ec77615971cad71f7e0f554163c5f0e141 Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Wed, 23 Oct 2024 16:00:12 +0200 Subject: [PATCH 06/14] only affected --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6fa7ecf89..197711e50 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,4 +29,4 @@ jobs: # Setting up playwright in one example is sufficient - run: pnpm --filter example-app-router-playground exec playwright install --with-deps - - run: pnpm turbo run lint build test size + - run: pnpm turbo run lint build test size --affected From 37795af621b4a88a36f7cd993c50a77e0e0bf5db Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Wed, 23 Oct 2024 16:05:10 +0200 Subject: [PATCH 07/14] increase fetch depth --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 197711e50..980f89c65 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,6 +13,9 @@ jobs: TURBO_TEAM: ${{ vars.TURBO_TEAM }} steps: - uses: actions/checkout@v4 + with: + # For Turborepo + fetch-depth: 2 - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: From 8ba95e4dc7de7c374e0a7980880fa72d5b663e98 Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Wed, 23 Oct 2024 16:14:18 +0200 Subject: [PATCH 08/14] decrease fetch depth? --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 980f89c65..314a0ee37 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,8 +14,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - # For Turborepo - fetch-depth: 2 + fetch-depth: 0 # For Turborepo - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: From 187dfe8a207d6286272a97d0606104dd2cbdbe9f Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Wed, 23 Oct 2024 16:33:47 +0200 Subject: [PATCH 09/14] remove unused params --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dc2b908d9..777f4558e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "root", "private": true, "scripts": { - "postinstall": "turbo run build --filter './packages/**' --env-mode=loose", + "postinstall": "turbo run build --filter './packages/**'", "publish": "lerna publish" }, "devDependencies": { From 87be605717402b5b8334b377243722e6c9808e11 Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Wed, 23 Oct 2024 16:59:54 +0200 Subject: [PATCH 10/14] try to re-enable playwright caching --- .github/workflows/main.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 314a0ee37..1374b7c5f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,16 @@ jobs: path: ${{ github.workspace }}/examples/*/.next/cache key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }} - # Setting up playwright in one example is sufficient - - run: pnpm --filter example-app-router-playground exec playwright install --with-deps + # Playwright (incl. caching) + - id: playwright-version + run: echo "PLAYWRIGHT_VERSION=$(pnpm --filter example-app-router exec playwright --version | awk '{print $2}')" >> $GITHUB_ENV + - uses: actions/cache@v4 + id: playwright-cache + with: + path: | + ~/.cache/ms-playwright + key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }} + - run: pnpm --filter example-app-router exec playwright install --with-deps + if: steps.playwright-cache.outputs.cache-hit != 'true' - run: pnpm turbo run lint build test size --affected From c2a6391ea66bbd6213eb0d8b25ce762fac552026 Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Wed, 23 Oct 2024 17:05:23 +0200 Subject: [PATCH 11/14] try to fix pw version --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1374b7c5f..43d696313 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,13 +30,13 @@ jobs: # Playwright (incl. caching) - id: playwright-version - run: echo "PLAYWRIGHT_VERSION=$(pnpm --filter example-app-router exec playwright --version | awk '{print $2}')" >> $GITHUB_ENV + run: echo "::set-output name=version::$(pnpm --filter example-app-router exec playwright --version | awk '{print $2}')" - uses: actions/cache@v4 id: playwright-cache with: path: | ~/.cache/ms-playwright - key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }} + key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }} - run: pnpm --filter example-app-router exec playwright install --with-deps if: steps.playwright-cache.outputs.cache-hit != 'true' From 055828356b362e86e9d8c13872de3a5cd6443d94 Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Wed, 23 Oct 2024 17:08:10 +0200 Subject: [PATCH 12/14] use modern output --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 43d696313..c2fa5b8d9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,7 @@ jobs: # Playwright (incl. caching) - id: playwright-version - run: echo "::set-output name=version::$(pnpm --filter example-app-router exec playwright --version | awk '{print $2}')" + run: echo "version=$(pnpm --filter example-app-router exec playwright --version | awk '{print $2}') >> $GITHUB_OUTPUT" - uses: actions/cache@v4 id: playwright-cache with: From 18e17577f6d393578b05c794514de3aaeb9ca801 Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Wed, 23 Oct 2024 17:11:48 +0200 Subject: [PATCH 13/14] attempt to fix output --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c2fa5b8d9..234f323de 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,9 @@ jobs: # Playwright (incl. caching) - id: playwright-version - run: echo "version=$(pnpm --filter example-app-router exec playwright --version | awk '{print $2}') >> $GITHUB_OUTPUT" + run: | + version=$(pnpm --filter example-app-router exec playwright --version | awk '{print $2}') + echo "version=$version" >> "$GITHUB_OUTPUT" - uses: actions/cache@v4 id: playwright-cache with: From de9aff24a7ec7203f36980f5255c8275d5341565 Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Wed, 23 Oct 2024 17:27:28 +0200 Subject: [PATCH 14/14] restore nextjs cache for docs too --- .github/workflows/main.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 234f323de..d3f2d73f4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,6 +12,7 @@ jobs: TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} TURBO_TEAM: ${{ vars.TURBO_TEAM }} steps: + # General setup - uses: actions/checkout@v4 with: fetch-depth: 0 # For Turborepo @@ -25,7 +26,9 @@ jobs: # Next.js caching - uses: actions/cache@v4 with: - path: ${{ github.workspace }}/examples/*/.next/cache + path: | + ${{ github.workspace }}/examples/*/.next/cache + ${{ github.workspace }}/docs/.next/cache key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }} # Playwright (incl. caching) @@ -36,10 +39,10 @@ jobs: - uses: actions/cache@v4 id: playwright-cache with: - path: | - ~/.cache/ms-playwright + path: ~/.cache/ms-playwright key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }} - run: pnpm --filter example-app-router exec playwright install --with-deps if: steps.playwright-cache.outputs.cache-hit != 'true' + # Main tasks - run: pnpm turbo run lint build test size --affected