Upgrade turbo (#6911)

This commit is contained in:
Bjorn Lu 2023-04-27 11:39:15 +08:00 committed by GitHub
parent 4ea716e569
commit ec5f6a07ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 119 additions and 146 deletions

View file

@ -49,9 +49,6 @@ jobs:
- name: Install dependencies
run: pnpm install
- name: Status
run: git status
# Lint autofix cannot run on forks, so just skip those! See https://github.com/wearerequired/lint-action/issues/13
- name: Lint (External)
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != github.repository_owner }}
@ -79,17 +76,22 @@ jobs:
- name: Format Check
run: pnpm run format --check
# Build primes out build caches for Turbo
# Build primes out Turbo build cache and pnpm cache
build:
name: "Build: ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
timeout-minutes: 3
strategy:
matrix:
OS: [ubuntu-latest]
OS: [ubuntu-latest, windows-latest]
NODE_VERSION: [16]
fail-fast: true
steps:
# Disable crlf so all OS can share the same Turbo cache
# https://github.com/actions/checkout/issues/135
- name: Disable git crlf
run: git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@v3
@ -105,7 +107,9 @@ jobs:
- name: Install dependencies
run: pnpm install
# Only build in ubuntu as windows can share the build cache
- name: Build Packages
if: ${{ matrix.os == 'ubuntu-latest' }}
run: pnpm run build
test:
@ -126,6 +130,9 @@ jobs:
env:
NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps:
- name: Disable git crlf
run: git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@v3
@ -165,6 +172,9 @@ jobs:
env:
NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps:
- name: Disable git crlf
run: git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@v3
@ -198,6 +208,9 @@ jobs:
env:
NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps:
- name: Disable git crlf
run: git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@v3
@ -219,6 +232,10 @@ jobs:
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
# Reset lockfile changes so that Turbo can reuse the old build cache
- name: Reset lockfile changes
run: git reset --hard
- name: Build Packages
run: pnpm run build

3
.gitignore vendored
View file

@ -30,4 +30,7 @@ packages/integrations/**/.netlify/
# ignore content collection generated files
packages/**/test/**/fixtures/**/.astro/
packages/**/test/**/fixtures/**/env.d.ts
packages/**/e2e/**/fixtures/**/.astro/
packages/**/e2e/**/fixtures/**/env.d.ts
examples/**/.astro/
examples/**/env.d.ts

View file

@ -8,19 +8,21 @@
},
"scripts": {
"release": "pnpm run build && changeset publish",
"build": "turbo run build --output-logs=new-only --no-deps --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
"build:ci": "turbo run build:ci --output-logs=new-only --no-deps --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
"build": "turbo run build --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
"build:ci": "turbo run build:ci --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
"build:examples": "turbo run build --filter=\"@example/*\"",
"dev": "turbo run dev --no-deps --no-cache --parallel --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
"dev": "turbo run dev --parallel --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
"format": "pnpm run format:code",
"format:ci": "pnpm run format:imports && pnpm run format:code",
"format:code": "prettier -w . --cache --plugin-search-dir=.",
"format:imports": "organize-imports-cli ./packages/*/tsconfig.json ./packages/*/*/tsconfig.json",
"test": "turbo run test --output-logs=new-only --concurrency=1 --filter=astro --filter=create-astro --filter=\"@astrojs/*\"",
"test": "turbo run test --concurrency=1 --filter=astro --filter=create-astro --filter=\"@astrojs/*\"",
"test:match": "cd packages/astro && pnpm run test:match",
"test:smoke": "turbo run build --filter=\"@example/*\" --filter=\"docs\" --output-logs=new-only --concurrency=1",
"test:smoke": "pnpm test:smoke:example && pnpm test:smoke:docs",
"test:smoke:example": "turbo run build --concurrency=100% --filter=\"@example/*\"",
"test:smoke:docs": "turbo run build --filter=docs",
"test:check-examples": "node ./scripts/smoke/check.js",
"test:vite-ci": "turbo run test --filter=astro --output-logs=new-only --no-deps --concurrency=1",
"test:vite-ci": "turbo run test --filter=astro",
"test:e2e": "cd packages/astro && pnpm playwright install && pnpm run test:e2e",
"test:e2e:match": "cd packages/astro && pnpm playwright install && pnpm run test:e2e:match",
"benchmark": "astro-benchmark",
@ -28,17 +30,6 @@
"version": "changeset version && pnpm install --no-frozen-lockfile && pnpm run format",
"preinstall": "npx only-allow pnpm"
},
"workspaces": [
"packages/markdown/*",
"packages/integrations/*",
"packages/*",
"examples/*",
"examples/component/demo",
"scripts",
"packages/astro/test/fixtures/component-library-shared",
"packages/astro/test/fixtures/custom-elements/my-component-lib",
"packages/astro/test/fixtures/static build/pkg"
],
"engines": {
"node": ">=16.12.0",
"pnpm": ">=8.2.0"
@ -99,7 +90,7 @@
"prettier-plugin-astro": "^0.8.0",
"pretty-bytes": "^6.0.0",
"tiny-glob": "^0.2.9",
"turbo": "1.2.5",
"turbo": "^1.9.3",
"typescript": "~5.0.2"
}
}

View file

@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"@astrojs/test-font-awesome-package": "file:packages/font-awesome",
"@test/astro-font-awesome-package": "file:packages/font-awesome",
"astro": "workspace:*"
}
}

View file

@ -1,4 +1,4 @@
{
"name": "@astrojs/test-font-awesome-package",
"name": "@test/astro-font-awesome-package",
"version": "0.0.1"
}

View file

@ -6,7 +6,7 @@
font-style: normal;
font-weight: 300;
font-display: swap;
src: url('@astrojs/test-font-awesome-package/fontawesome-webfont.woff2')
src: url('@test/astro-font-awesome-package/fontawesome-webfont.woff2')
format('woff2');
}

View file

@ -7,7 +7,7 @@
font-style: normal;
font-weight: 300;
font-display: swap;
src: url('@astrojs/test-font-awesome-package/fontawesome-webfont2.woff2')
src: url('@test/astro-font-awesome-package/fontawesome-webfont2.woff2')
format('woff2');
}

View file

@ -1,5 +1,5 @@
import one from '@astrojs/renderer-one';
import two from '@astrojs/renderer-two';
import one from '@test/astro-renderer-one';
import two from '@test/astro-renderer-two';
export default {
integrations: [one(), two()]

View file

@ -2,7 +2,7 @@
"name": "@test/multiple-renderers",
"dependencies": {
"astro": "workspace:*",
"@astrojs/renderer-one": "file:./renderers/one",
"@astrojs/renderer-two": "file:./renderers/two"
"@test/astro-renderer-one": "file:./renderers/one",
"@test/astro-renderer-two": "file:./renderers/two"
}
}

View file

@ -7,7 +7,7 @@ export default function() {
addRenderer({
name: 'renderer-one',
clientEntrypoint: null,
serverEntrypoint: '@astrojs/renderer-one/server.mjs',
serverEntrypoint: '@test/astro-renderer-one/server.mjs',
});
}
}

View file

@ -1,5 +1,5 @@
{
"name": "@astrojs/renderer-one",
"name": "@test/astro-renderer-one",
"version": "1.0.0",
"main": "index.mjs"
}

View file

@ -7,7 +7,7 @@ export default function() {
addRenderer({
name: 'renderer-two',
clientEntrypoint: null,
serverEntrypoint: '@astrojs/renderer-two/server.mjs',
serverEntrypoint: '@test/astro-renderer-two/server.mjs',
});
}
}

View file

@ -1,5 +1,5 @@
{
"name": "@astrojs/renderer-two",
"name": "@test/astro-renderer-two",
"version": "1.0.0",
"main": "index.mjs"
}

View file

@ -1,5 +1,5 @@
{
"name": "@test/mdx-page",
"name": "@test/mdx-images",
"dependencies": {
"@astrojs/mdx": "workspace:*",
"astro": "workspace:*",

View file

@ -1,5 +1,5 @@
{
"name": "@test/astro-markdown-component-plugins",
"name": "@test/astro-markdown-component-astro-markdown-component-plugins",
"version": "0.0.0",
"private": true,
"dependencies": {

View file

@ -1,5 +1,5 @@
{
"name": "@test/astro-markdown-skiki-langs",
"name": "@test/astro-markdown-component-astro-markdown-shiki-langs",
"version": "0.0.0",
"private": true,
"dependencies": {

View file

@ -1,5 +1,5 @@
{
"name": "@test/astro-markdown-skiki-normal",
"name": "@test/astro-markdown-component-astro-markdown-shiki-normal",
"version": "0.0.0",
"private": true,
"dependencies": {

View file

@ -1,5 +1,5 @@
{
"name": "@test/astro-markdown-component-shiki",
"name": "@test/astro-markdown-component-astro-markdown-component-shiki",
"version": "0.0.0",
"private": true,
"dependencies": {

View file

@ -1,5 +1,5 @@
{
"name": "@test/astro-markdown-skiki-themes-custom",
"name": "@test/astro-markdown-component-astro-markdown-shiki-themes-custom",
"version": "0.0.0",
"private": true,
"dependencies": {

View file

@ -1,5 +1,5 @@
{
"name": "@test/astro-markdown-skiki-themes-integrated",
"name": "@test/astro-markdown-component-astro-markdown-shiki-themes-integrated",
"version": "0.0.0",
"private": true,
"dependencies": {

View file

@ -1,5 +1,5 @@
{
"name": "@test/astro-markdown-skiki-wrap-false",
"name": "@test/astro-markdown-component-astro-markdown-shiki-wrap-false",
"version": "0.0.0",
"private": true,
"dependencies": {

View file

@ -1,5 +1,5 @@
{
"name": "@test/astro-markdown-skiki-wrap-null",
"name": "@test/astro-markdown-component-astro-markdown-shiki-wrap-null",
"version": "0.0.0",
"private": true,
"dependencies": {

View file

@ -1,5 +1,5 @@
{
"name": "@test/astro-markdown-skiki-wrap-true",
"name": "@test/astro-markdown-component-astro-markdown-shiki-wrap-true",
"version": "0.0.0",
"private": true,
"dependencies": {

View file

@ -1,5 +1,5 @@
{
"name": "@test/astro-markdown-component",
"name": "@test/astro-markdown-component-astro-markdown-component",
"version": "0.0.0",
"private": true,
"dependencies": {

View file

@ -79,8 +79,8 @@ importers:
specifier: ^0.2.9
version: 0.2.9
turbo:
specifier: 1.2.5
version: 1.2.5
specifier: ^1.9.3
version: 1.9.3
typescript:
specifier: ~5.0.2
version: 5.0.2
@ -2390,7 +2390,7 @@ importers:
packages/astro/test/fixtures/css-assets:
dependencies:
'@astrojs/test-font-awesome-package':
'@test/astro-font-awesome-package':
specifier: file:packages/font-awesome
version: file:packages/astro/test/fixtures/css-assets/packages/font-awesome
astro:
@ -2743,10 +2743,10 @@ importers:
packages/astro/test/fixtures/multiple-renderers:
dependencies:
'@astrojs/renderer-one':
'@test/astro-renderer-one':
specifier: file:./renderers/one
version: file:packages/astro/test/fixtures/multiple-renderers/renderers/one
'@astrojs/renderer-two':
'@test/astro-renderer-two':
specifier: file:./renderers/two
version: file:packages/astro/test/fixtures/multiple-renderers/renderers/two
astro:
@ -16742,119 +16742,65 @@ packages:
dependencies:
safe-buffer: 5.2.1
/turbo-darwin-64@1.2.5:
resolution: {integrity: sha512-AjMEF8hlA9vy1gXLHBruqgO42s0M0rKKZLQPM239wli5lKEprmxd8WMSjd9YmxRflS+/fwrXfjVl0QRhHjDIww==}
/turbo-darwin-64@1.9.3:
resolution: {integrity: sha512-0dFc2cWXl82kRE4Z+QqPHhbEFEpUZho1msHXHWbz5+PqLxn8FY0lEVOHkq5tgKNNEd5KnGyj33gC/bHhpZOk5g==}
cpu: [x64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/turbo-darwin-arm64@1.2.5:
resolution: {integrity: sha512-2kj4+X9XMGF9o398qVo4HDsaoPy2kcl77X+EYlq2bROoQlGXRrR7R+i/qMvLh4tLsSQAm5eOqEbFyvtMkxT/xg==}
/turbo-darwin-arm64@1.9.3:
resolution: {integrity: sha512-1cYbjqLBA2zYE1nbf/qVnEkrHa4PkJJbLo7hnuMuGM0bPzh4+AnTNe98gELhqI1mkTWBu/XAEeF5u6dgz0jLNA==}
cpu: [arm64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/turbo-freebsd-64@1.2.5:
resolution: {integrity: sha512-29eQUiS/Fky7O8E0YzGh3EETPvMKmMDkFjJn4XtRGO+iZfkIxlqKnAUpT+8kx3nQ/5dAAoTGHflyf4FNEZaCKA==}
cpu: [x64]
os: [freebsd]
requiresBuild: true
dev: true
optional: true
/turbo-freebsd-arm64@1.2.5:
resolution: {integrity: sha512-WRFmzgXqXurdRntPrEb7hcOM1Zfjse8OC/sH3V8R9QspYE+upZ42m9ePLt2n5N2shc4XLced/9VFdczx9549Tw==}
cpu: [arm64]
os: [freebsd]
requiresBuild: true
dev: true
optional: true
/turbo-linux-32@1.2.5:
resolution: {integrity: sha512-YBzKqXJEoORpPq7vwpNf9ovbVru9aQi7HD88fxYW1wvvuPdNx2ZAmjn8sEMZZPkndfOlf9fXgO3aXr0fjqUWMw==}
cpu: [ia32]
os: [linux]
requiresBuild: true
dev: true
optional: true
/turbo-linux-64@1.2.5:
resolution: {integrity: sha512-a85WEfOj4Cw0zd/wo1xoRmqW4kZHAz63nf+vWINyxZOK2H899TCUs+KJpgsacafU0fO36l1rsx2fdUDce/3Dww==}
/turbo-linux-64@1.9.3:
resolution: {integrity: sha512-UuBPFefawEwpuxh5pM9Jqq3q4C8M0vYxVYlB3qea/nHQ80pxYq7ZcaLGEpb10SGnr3oMUUs1zZvkXWDNKCJb8Q==}
cpu: [x64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/turbo-linux-arm64@1.2.5:
resolution: {integrity: sha512-ZtPQx9yw+iMT+sYPYcrtbCye7a/aj93gA2krir4MI+CDp69LuHLuZOOfc8u4JCxSJTbRLoYcwJrdfB9uBSddIQ==}
/turbo-linux-arm64@1.9.3:
resolution: {integrity: sha512-vUrNGa3hyDtRh9W0MkO+l1dzP8Co2gKnOVmlJQW0hdpOlWlIh22nHNGGlICg+xFa2f9j4PbQlWTsc22c019s8Q==}
cpu: [arm64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/turbo-linux-arm@1.2.5:
resolution: {integrity: sha512-JlLk5cGmj5yRwBQuPMH36w5ZJg0sBfi+dxBZTkJUV9XM9MRgNUs0MkNnjh9ogGvB4R08HY4ud6XcyRdoKLs9pA==}
cpu: [arm]
os: [linux]
requiresBuild: true
dev: true
optional: true
/turbo-linux-mips64le@1.2.5:
resolution: {integrity: sha512-3LLnEwKc5pf7MlUhwvq/ND2cx0f7v3LHK5587CVTQI9nnwgie42n5U168J7BPPPkIE0k0j4S1jeXU18DV3vWbA==}
cpu: [mips64el]
os: [linux]
requiresBuild: true
dev: true
optional: true
/turbo-linux-ppc64le@1.2.5:
resolution: {integrity: sha512-1k4lBCu2jdQNF3KXjPAbOER5/j37AdBqHnuHB6JuiOocm+v3WgEfkctkqLrgow3q1HLeb4me3wGXstV//6dzSg==}
cpu: [ppc64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/turbo-windows-32@1.2.5:
resolution: {integrity: sha512-XT2g/kZopqARjs39MNVP5XysrK2R0P9QVnrRdVY72zgswLvvcvDI6SM5SPX/SWF4iLU5OEUlpCaUz5dJLGMGUw==}
cpu: [ia32]
os: [win32]
requiresBuild: true
dev: true
optional: true
/turbo-windows-64@1.2.5:
resolution: {integrity: sha512-Ut097JJv9qy/8cpHANB7/BH0uh2IZbUeSSRudTl8tfMX8ZEdla/NpJd+omMV4CwPRrZAO6SyKiTfeHFOt/6NgQ==}
/turbo-windows-64@1.9.3:
resolution: {integrity: sha512-0BZ7YaHs6r+K4ksqWus1GKK3W45DuDqlmfjm/yuUbTEVc8szmMCs12vugU2Zi5GdrdJSYfoKfEJ/PeegSLIQGQ==}
cpu: [x64]
os: [win32]
requiresBuild: true
dev: true
optional: true
/turbo@1.2.5:
resolution: {integrity: sha512-KXk5BGCaiSSXhtorrLUILB3OTqZ/uruIi0ggb0jSp55ZDSS+G/4OANw7y5QuRjizCpjwunb47AAOox/2Zn2nbA==}
/turbo-windows-arm64@1.9.3:
resolution: {integrity: sha512-QJUYLSsxdXOsR1TquiOmLdAgtYcQ/RuSRpScGvnZb1hY0oLc7JWU0llkYB81wVtWs469y8H9O0cxbKwCZGR4RQ==}
cpu: [arm64]
os: [win32]
requiresBuild: true
dev: true
optional: true
/turbo@1.9.3:
resolution: {integrity: sha512-ID7mxmaLUPKG/hVkp+h0VuucB1U99RPCJD9cEuSEOdIPoSIuomcIClEJtKamUsdPLhLCud+BvapBNnhgh58Nzw==}
hasBin: true
requiresBuild: true
optionalDependencies:
turbo-darwin-64: 1.2.5
turbo-darwin-arm64: 1.2.5
turbo-freebsd-64: 1.2.5
turbo-freebsd-arm64: 1.2.5
turbo-linux-32: 1.2.5
turbo-linux-64: 1.2.5
turbo-linux-arm: 1.2.5
turbo-linux-arm64: 1.2.5
turbo-linux-mips64le: 1.2.5
turbo-linux-ppc64le: 1.2.5
turbo-windows-32: 1.2.5
turbo-windows-64: 1.2.5
turbo-darwin-64: 1.9.3
turbo-darwin-arm64: 1.9.3
turbo-linux-64: 1.9.3
turbo-linux-arm64: 1.9.3
turbo-windows-64: 1.9.3
turbo-windows-arm64: 1.9.3
dev: true
/turbolinks@5.2.0:
@ -18039,19 +17985,19 @@ packages:
file:packages/astro/test/fixtures/css-assets/packages/font-awesome:
resolution: {directory: packages/astro/test/fixtures/css-assets/packages/font-awesome, type: directory}
name: '@astrojs/test-font-awesome-package'
name: '@test/astro-font-awesome-package'
version: 0.0.1
dev: false
file:packages/astro/test/fixtures/multiple-renderers/renderers/one:
resolution: {directory: packages/astro/test/fixtures/multiple-renderers/renderers/one, type: directory}
name: '@astrojs/renderer-one'
name: '@test/astro-renderer-one'
version: 1.0.0
dev: false
file:packages/astro/test/fixtures/multiple-renderers/renderers/two:
resolution: {directory: packages/astro/test/fixtures/multiple-renderers/renderers/two, type: directory}
name: '@astrojs/renderer-two'
name: '@test/astro-renderer-two'
version: 1.0.0
dev: false

View file

@ -5,3 +5,5 @@ packages:
- 'scripts'
- 'benchmark'
- 'benchmark/packages/*'
# Below excludes are only for Turbo because it doesn't respect gitignore like pnpm does
- '!**/.vercel/**'

View file

@ -1,28 +1,42 @@
{
"$schema": "https://turborepo.org/schema.json",
"baseBranch": "origin/main",
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**/*", "!vendor/**", "mod.js", "mod.js.map"]
"inputs": [
"**/*",
"!test/**/*",
"!e2e/**/*",
"!performance/**/*",
"!.astro/**/*",
"!.cache/**/*",
"!mod.js",
"!mod.js.map"
],
"outputs": ["dist/**/*", "!vendor/**", "mod.js", "mod.js.map"],
"outputMode": "new-only"
},
"build:ci": {
"dependsOn": ["^build:ci"],
"outputs": ["dist/**/*", "!vendor/**", "mod.js", "mod.js.map"]
"inputs": [
"**/*",
"!test/**/*",
"!e2e/**/*",
"!performance/**/*",
"!.astro/**/*",
"!.cache/**/*",
"!mod.js",
"!mod.js.map"
],
"outputs": ["dist/**/*", "!vendor/**", "mod.js", "mod.js.map"],
"outputMode": "new-only"
},
"dev": {
"cache": false
},
"test": {
"outputs": [],
"dependsOn": ["$RUNNER_OS", "$NODE_VERSION"]
},
"benchmark": {
"dependsOn": ["^build"],
"outputs": []
},
"lint": {
"outputs": []
"env": ["RUNNER_OS", "NODE_VERSION"],
"outputMode": "new-only"
}
}
}