Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update Turbo to v2.2 #1449

Merged
merged 15 commits into from
Oct 23, 2024
27 changes: 20 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ jobs:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
# General setup
- uses: actions/checkout@v4
with:
fetch-depth: 0 # For Turborepo
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
Expand All @@ -23,13 +26,23 @@ 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') }}

# 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: |
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:
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'

- run: pnpm run build
- run: pnpm run lint
- run: pnpm run test
- run: pnpm run size
# Main tasks
- run: pnpm turbo run lint build test size --affected
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ node_modules/
dist/
.next/
tsconfig.tsbuildinfo
.turbo
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"postinstall": "turbo run build --filter './packages/**'",
"publish": "lerna publish"
},
"devDependencies": {
Expand All @@ -24,7 +20,7 @@
"conventional-changelog-conventionalcommits": "^7.0.0",
"execa": "^9.2.0",
"rollup": "^4.18.0",
"turbo": "^2.0.4"
"turbo": "^2.2.3"
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Been following the guide at https://vercel.com/docs/monorepos/remote-caching#enable-and-disable-remote-caching-for-your-team.

Step 1

"Remote Caching" is enabled for the "next-intl" team on Vercel.

Step 2

Running npx turbo login locally yields this error:

❯ npx turbo login

turbo 2.2.3

  × Error making HTTP request: error decoding response body: missing field `origin` at line 1
  │ column 258
  ├─▶ error decoding response body: missing field `origin` at line 1 column 258
  ╰─▶ missing field `origin` at line 1 column 258

Step 3

Running npx turbo link did work though.

Step 4

(skipped)

Step 5

Locally Turbo caching works as expected (was already the case before).


CI Config

  • TURBO_TEAM is set to next-intl in a GH Actions variable
  • TURBO_TOKEN is set in a GH Actions secret

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the most recent CI run: https://github.com/amannn/next-intl/actions/runs/11474295438/job/31929959155?pr=1449.

At the beginning of "Run pnpm run build" there are these entries:

Screenshot 2024-10-23 at 08 29 32

},
"packageManager": "[email protected]"
}
58 changes: 29 additions & 29 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 5 additions & 10 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,16 @@
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": [
"dist/**/*.ts",
"dist/**/*.tsx",
"dist/**/*.mjs",
"dist/**/*.js",
".next/**",
"!.next/cache/**"
]
"outputs": ["dist/**", ".next/**", "!.next/cache/**", "build/**"]
},
"lint": {
"dependsOn": ["^build"]
},
"test": {
"dependsOn": ["build"]
},
"size": {
"dependsOn": ["build"]
},
"lint": {}
}
}
}
Loading