Skip to content

Commit

Permalink
Upgrade turbo (#6911)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Apr 27, 2023
1 parent 4ea716e commit ec5f6a0
Show file tree
Hide file tree
Showing 27 changed files with 115 additions and 142 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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

Expand All @@ -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:
Expand All @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
27 changes: 9 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,28 @@
},
"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",
"lint": "eslint --cache .",
"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"
Expand Down Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion packages/astro/test/fixtures/css-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:*"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "@astrojs/test-font-awesome-package",
"name": "@test/astro-font-awesome-package",
"version": "0.0.1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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()]
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/test/fixtures/multiple-renderers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@astrojs/renderer-one",
"name": "@test/astro-renderer-one",
"version": "1.0.0",
"main": "index.mjs"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@astrojs/renderer-two",
"name": "@test/astro-renderer-two",
"version": "1.0.0",
"main": "index.mjs"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@test/mdx-page",
"name": "@test/mdx-images",
"dependencies": {
"@astrojs/mdx": "workspace:*",
"astro": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@test/astro-markdown-component",
"name": "@test/astro-markdown-component-astro-markdown-component",
"version": "0.0.0",
"private": true,
"dependencies": {
Expand Down
Loading

0 comments on commit ec5f6a0

Please sign in to comment.