Merge branch 'main' into add-Minification

This commit is contained in:
wulinsheng123 2023-04-29 07:30:14 +08:00 committed by GitHub
commit 5e1970bf29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
124 changed files with 777 additions and 664 deletions

View file

@ -6,7 +6,6 @@
"access": "public", "access": "public",
"baseBranch": "main", "baseBranch": "main",
"updateInternalDependencies": "patch", "updateInternalDependencies": "patch",
"ignore": ["@example/*", "@test/*"],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": { "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true "onlyUpdatePeerDependentsWhenOutOfRange": true
} }

View file

@ -0,0 +1,6 @@
---
'@astrojs/telemetry': patch
'@astrojs/webapi': patch
---
Upgrade undici to v5.22.0

View file

@ -1,5 +0,0 @@
---
'@astrojs/rss': minor
---
Added extra elements to the RSS items, including categories and enclosure

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Update `experimental.assets`'s `image.service` configuration to allow for a config option in addition to an entrypoint

View file

@ -0,0 +1,5 @@
---
"@astrojs/cloudflare": patch
---
Fix missing code language in Cloudflare README

View file

@ -0,0 +1,6 @@
---
'@astrojs/tailwind': patch
'@astrojs/svelte': patch
---
Update dependencies

View file

@ -49,9 +49,6 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: pnpm install 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 # Lint autofix cannot run on forks, so just skip those! See https://github.com/wearerequired/lint-action/issues/13
- name: Lint (External) - name: Lint (External)
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != github.repository_owner }} 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 - name: Format Check
run: pnpm run format --check run: pnpm run format --check
# Build primes out build caches for Turbo # Build primes out Turbo build cache and pnpm cache
build: build:
name: "Build: ${{ matrix.os }}" name: "Build: ${{ matrix.os }}"
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
timeout-minutes: 3 timeout-minutes: 3
strategy: strategy:
matrix: matrix:
OS: [ubuntu-latest] OS: [ubuntu-latest, windows-latest]
NODE_VERSION: [16] NODE_VERSION: [16]
fail-fast: true fail-fast: true
steps: 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 - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -105,7 +107,9 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: pnpm install run: pnpm install
# Only build in ubuntu as windows can share the build cache
- name: Build Packages - name: Build Packages
if: ${{ matrix.os == 'ubuntu-latest' }}
run: pnpm run build run: pnpm run build
test: test:
@ -126,6 +130,9 @@ jobs:
env: env:
NODE_VERSION: ${{ matrix.NODE_VERSION }} NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps: steps:
- name: Disable git crlf
run: git config --global core.autocrlf false
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -165,6 +172,9 @@ jobs:
env: env:
NODE_VERSION: ${{ matrix.NODE_VERSION }} NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps: steps:
- name: Disable git crlf
run: git config --global core.autocrlf false
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -198,6 +208,9 @@ jobs:
env: env:
NODE_VERSION: ${{ matrix.NODE_VERSION }} NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps: steps:
- name: Disable git crlf
run: git config --global core.autocrlf false
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -219,10 +232,18 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: pnpm install --no-frozen-lockfile 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 - name: Build Packages
run: pnpm run build run: pnpm run build
- name: Remove docs translations except for English and Korean
run: find smoke/docs/src/content/docs ! -name 'en' ! -name 'ko' -type d -mindepth 1 -maxdepth 1 -exec rm -rf {} +
- name: Test - name: Test
run: pnpm run test:smoke run: pnpm run test:smoke
env: env:
SKIP_OG: 1 SKIP_OG: true
PUBLIC_TWO_LANG: true

3
.gitignore vendored
View file

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

23
.prettierrc.cjs Normal file
View file

@ -0,0 +1,23 @@
module.exports = {
printWidth: 100,
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5',
useTabs: true,
plugins: ['./node_modules/prettier-plugin-astro'],
overrides: [
{
files: ['.*', '*.json', '*.md', '*.toml', '*.yml'],
options: {
useTabs: false,
},
},
{
files: ['**/*.astro'],
options: {
parser: 'astro',
},
},
],
};

View file

@ -1,32 +0,0 @@
// Heads up: This file should be renamed to `.cjs`, however if we did that, changesets wouldn't be able to load it
module.exports = {
printWidth: 100,
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5',
useTabs: true,
plugins: ['./node_modules/prettier-plugin-astro'],
overrides: [
{
// Changesets run Prettier using our configuration, however it uses a very old version of Prettier that does
// not support our plugin and it ends up doing more harm than good. As such, we'll disable our plugin for changelogs
files: ['CHANGELOG.md'],
options: {
plugins: [],
},
},
{
files: ['.*', '*.json', '*.md', '*.toml', '*.yml'],
options: {
useTabs: false,
},
},
{
files: ['**/*.astro'],
options: {
parser: 'astro',
},
},
],
};

View file

@ -27,7 +27,7 @@
"server-destroy": "^1.0.1" "server-destroy": "^1.0.1"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "workspace:^2.0.18" "astro": "workspace:^2.3.2"
}, },
"devDependencies": { "devDependencies": {
"@types/server-destroy": "^1.0.1", "@types/server-destroy": "^1.0.1",

View file

@ -11,6 +11,6 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1" "astro": "^2.3.2"
} }
} }

View file

@ -11,9 +11,9 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1", "astro": "^2.3.2",
"@astrojs/mdx": "^0.19.0", "@astrojs/mdx": "^0.19.0",
"@astrojs/rss": "^2.3.2", "@astrojs/rss": "^2.4.0",
"@astrojs/sitemap": "^1.2.2" "@astrojs/sitemap": "^1.2.2"
} }
} }

View file

@ -15,7 +15,7 @@
], ],
"scripts": {}, "scripts": {},
"devDependencies": { "devDependencies": {
"astro": "^2.3.1" "astro": "^2.3.2"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "^2.0.0-beta.0" "astro": "^2.0.0-beta.0"

View file

@ -10,7 +10,7 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1" "astro": "^2.3.2"
}, },
"devDependencies": { "devDependencies": {
"@astrojs/deno": "^4.1.0" "@astrojs/deno": "^4.1.0"

View file

@ -11,7 +11,7 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1", "astro": "^2.3.2",
"preact": "^10.7.3", "preact": "^10.7.3",
"react": "^18.1.0", "react": "^18.1.0",
"react-dom": "^18.1.0", "react-dom": "^18.1.0",

View file

@ -11,7 +11,7 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1", "astro": "^2.3.2",
"alpinejs": "^3.10.2", "alpinejs": "^3.10.2",
"@astrojs/alpinejs": "^0.2.1", "@astrojs/alpinejs": "^0.2.1",
"@types/alpinejs": "^3.7.0" "@types/alpinejs": "^3.7.0"

View file

@ -11,7 +11,7 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1", "astro": "^2.3.2",
"lit": "^2.7.0", "lit": "^2.7.0",
"@astrojs/lit": "^2.0.1", "@astrojs/lit": "^2.0.1",
"@webcomponents/template-shadowroot": "^0.2.1" "@webcomponents/template-shadowroot": "^0.2.1"

View file

@ -11,7 +11,7 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1", "astro": "^2.3.2",
"preact": "^10.7.3", "preact": "^10.7.3",
"react": "^18.1.0", "react": "^18.1.0",
"react-dom": "^18.1.0", "react-dom": "^18.1.0",

View file

@ -11,7 +11,7 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1", "astro": "^2.3.2",
"preact": "^10.7.3", "preact": "^10.7.3",
"@astrojs/preact": "^2.1.0", "@astrojs/preact": "^2.1.0",
"@preact/signals": "^1.1.0" "@preact/signals": "^1.1.0"

View file

@ -11,7 +11,7 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1", "astro": "^2.3.2",
"react": "^18.1.0", "react": "^18.1.0",
"react-dom": "^18.1.0", "react-dom": "^18.1.0",
"@astrojs/react": "^2.1.1", "@astrojs/react": "^2.1.1",

View file

@ -11,7 +11,7 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1", "astro": "^2.3.2",
"solid-js": "^1.4.3", "solid-js": "^1.4.3",
"@astrojs/solid-js": "^2.1.0" "@astrojs/solid-js": "^2.1.0"
} }

View file

@ -13,6 +13,6 @@
"dependencies": { "dependencies": {
"svelte": "^3.48.0", "svelte": "^3.48.0",
"@astrojs/svelte": "^2.1.0", "@astrojs/svelte": "^2.1.0",
"astro": "^2.3.1" "astro": "^2.3.2"
} }
} }

View file

@ -11,7 +11,7 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1", "astro": "^2.3.2",
"vue": "^3.2.37", "vue": "^3.2.37",
"@astrojs/vue": "^2.1.1" "@astrojs/vue": "^2.1.1"
} }

View file

@ -12,6 +12,6 @@
}, },
"dependencies": { "dependencies": {
"@astrojs/node": "^5.1.1", "@astrojs/node": "^5.1.1",
"astro": "^2.3.1" "astro": "^2.3.2"
} }
} }

View file

@ -15,7 +15,7 @@
], ],
"scripts": {}, "scripts": {},
"devDependencies": { "devDependencies": {
"astro": "^2.3.1" "astro": "^2.3.2"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "^2.0.0-beta.0" "astro": "^2.0.0-beta.0"

View file

@ -11,6 +11,6 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1" "astro": "^2.3.2"
} }
} }

View file

@ -11,6 +11,6 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1" "astro": "^2.3.2"
} }
} }

View file

@ -11,6 +11,6 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1" "astro": "^2.3.2"
} }
} }

View file

@ -12,7 +12,7 @@
"server": "node dist/server/entry.mjs" "server": "node dist/server/entry.mjs"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1", "astro": "^2.3.2",
"svelte": "^3.48.0", "svelte": "^3.48.0",
"@astrojs/svelte": "^2.1.0", "@astrojs/svelte": "^2.1.0",
"@astrojs/node": "^5.1.1", "@astrojs/node": "^5.1.1",

View file

@ -12,7 +12,7 @@
}, },
"dependencies": { "dependencies": {
"@astrojs/markdoc": "^0.1.1", "@astrojs/markdoc": "^0.1.1",
"astro": "^2.3.1", "astro": "^2.3.2",
"kleur": "^4.1.5" "kleur": "^4.1.5"
} }
} }

View file

@ -11,7 +11,7 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1", "astro": "^2.3.2",
"@astrojs/markdown-remark": "^2.1.4", "@astrojs/markdown-remark": "^2.1.4",
"hast-util-select": "5.0.1", "hast-util-select": "5.0.1",
"rehype-autolink-headings": "^6.1.1", "rehype-autolink-headings": "^6.1.1",

View file

@ -11,6 +11,6 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1" "astro": "^2.3.2"
} }
} }

View file

@ -11,7 +11,7 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1", "astro": "^2.3.2",
"preact": "^10.6.5", "preact": "^10.6.5",
"@astrojs/preact": "^2.1.0", "@astrojs/preact": "^2.1.0",
"@astrojs/mdx": "^0.19.0" "@astrojs/mdx": "^0.19.0"

View file

@ -11,7 +11,7 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1", "astro": "^2.3.2",
"preact": "^10.7.3", "preact": "^10.7.3",
"@astrojs/preact": "^2.1.0", "@astrojs/preact": "^2.1.0",
"nanostores": "^0.5.12", "nanostores": "^0.5.12",

View file

@ -14,10 +14,10 @@
"@astrojs/mdx": "^0.19.0", "@astrojs/mdx": "^0.19.0",
"@astrojs/tailwind": "^3.1.1", "@astrojs/tailwind": "^3.1.1",
"@types/canvas-confetti": "^1.4.3", "@types/canvas-confetti": "^1.4.3",
"astro": "^2.3.1", "astro": "^2.3.2",
"autoprefixer": "^10.4.7", "autoprefixer": "^10.4.14",
"canvas-confetti": "^1.5.1", "canvas-confetti": "^1.5.1",
"postcss": "^8.4.14", "postcss": "^8.4.23",
"tailwindcss": "^3.0.24" "tailwindcss": "^3.3.2"
} }
} }

View file

@ -11,7 +11,7 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1", "astro": "^2.3.2",
"vite-plugin-pwa": "0.11.11", "vite-plugin-pwa": "0.11.11",
"workbox-window": "^6.5.3" "workbox-window": "^6.5.3"
} }

View file

@ -12,7 +12,7 @@
"test": "vitest" "test": "vitest"
}, },
"dependencies": { "dependencies": {
"astro": "^2.3.1", "astro": "^2.3.2",
"vitest": "^0.20.3" "vitest": "^0.20.3"
} }
} }

View file

@ -8,19 +8,21 @@
}, },
"scripts": { "scripts": {
"release": "pnpm run build && changeset publish", "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": "turbo run build --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:ci": "turbo run build:ci --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
"build:examples": "turbo run build --filter=\"@example/*\"", "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": "pnpm run format:code",
"format:ci": "pnpm run format:imports && pnpm run format:code", "format:ci": "pnpm run format:imports && pnpm run format:code",
"format:code": "prettier -w . --cache --plugin-search-dir=.", "format:code": "prettier -w . --cache --plugin-search-dir=.",
"format:imports": "organize-imports-cli ./packages/*/tsconfig.json ./packages/*/*/tsconfig.json", "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: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: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": "cd packages/astro && pnpm playwright install && pnpm run test:e2e",
"test:e2e:match": "cd packages/astro && pnpm playwright install && pnpm run test:e2e:match", "test:e2e:match": "cd packages/astro && pnpm playwright install && pnpm run test:e2e:match",
"benchmark": "astro-benchmark", "benchmark": "astro-benchmark",
@ -31,13 +33,7 @@
"workspaces": [ "workspaces": [
"packages/markdown/*", "packages/markdown/*",
"packages/integrations/*", "packages/integrations/*",
"packages/*", "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": { "engines": {
"node": ">=16.12.0", "node": ">=16.12.0",
@ -72,7 +68,7 @@
] ]
}, },
"patchedDependencies": { "patchedDependencies": {
"@changesets/cli@2.23.0": "patches/@changesets__cli@2.23.0.patch" "@changesets/cli@2.26.1": "patches/@changesets__cli@2.26.1.patch"
} }
}, },
"dependencies": { "dependencies": {
@ -80,26 +76,22 @@
"astro-benchmark": "workspace:*" "astro-benchmark": "workspace:*"
}, },
"devDependencies": { "devDependencies": {
"@changesets/changelog-github": "0.4.4", "@changesets/changelog-github": "0.4.8",
"@changesets/cli": "2.23.0", "@changesets/cli": "2.26.1",
"@octokit/action": "^3.18.1",
"@types/node": "^18.7.21", "@types/node": "^18.7.21",
"@typescript-eslint/eslint-plugin": "^5.58.0", "@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0", "@typescript-eslint/parser": "^5.58.0",
"del": "^7.0.0",
"esbuild": "^0.17.12", "esbuild": "^0.17.12",
"eslint": "^8.38.0", "eslint": "^8.38.0",
"eslint-config-prettier": "^8.8.0", "eslint-config-prettier": "^8.8.0",
"eslint-plugin-no-only-tests": "^2.6.0", "eslint-plugin-no-only-tests": "^2.6.0",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"execa": "^6.1.0",
"only-allow": "^1.1.1", "only-allow": "^1.1.1",
"organize-imports-cli": "^0.10.0", "organize-imports-cli": "^0.10.0",
"prettier": "^2.8.7", "prettier": "^2.8.7",
"prettier-plugin-astro": "^0.8.0", "prettier-plugin-astro": "^0.8.0",
"pretty-bytes": "^6.0.0",
"tiny-glob": "^0.2.9", "tiny-glob": "^0.2.9",
"turbo": "1.2.5", "turbo": "^1.9.3",
"typescript": "~5.0.2" "typescript": "~5.0.2"
} }
} }

View file

@ -1,5 +1,11 @@
# @astrojs/rss # @astrojs/rss
## 2.4.0
### Minor Changes
- [#6707](https://github.com/withastro/astro/pull/6707) [`4ea716e56`](https://github.com/withastro/astro/commit/4ea716e5692d23361e9301330ce52733b3d05b01) Thanks [@philnash](https://github.com/philnash)! - Added extra elements to the RSS items, including categories and enclosure
## 2.3.2 ## 2.3.2
### Patch Changes ### Patch Changes

View file

@ -1,7 +1,7 @@
{ {
"name": "@astrojs/rss", "name": "@astrojs/rss",
"description": "Add RSS feeds to your Astro projects", "description": "Add RSS feeds to your Astro projects",
"version": "2.3.2", "version": "2.4.0",
"type": "module", "type": "module",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
"author": "withastro", "author": "withastro",

View file

@ -1,5 +1,11 @@
# astro # astro
## 2.3.2
### Patch Changes
- [#6920](https://github.com/withastro/astro/pull/6920) [`b89042553`](https://github.com/withastro/astro/commit/b89042553ec45d5f6bc71747e0f3470ba969e679) Thanks [@bluwy](https://github.com/bluwy)! - Fix tsconfig alias baseUrl handling for "." and ".." imports
## 2.3.1 ## 2.3.1
### Patch Changes ### Patch Changes

View file

@ -5,8 +5,8 @@
"dependencies": { "dependencies": {
"@astrojs/tailwind": "workspace:*", "@astrojs/tailwind": "workspace:*",
"astro": "workspace:*", "astro": "workspace:*",
"autoprefixer": "^10.4.7", "autoprefixer": "^10.4.14",
"postcss": "^8.4.14", "postcss": "^8.4.23",
"tailwindcss": "^3.0.24" "tailwindcss": "^3.3.2"
} }
} }

View file

@ -1,6 +1,6 @@
{ {
"name": "astro", "name": "astro",
"version": "2.3.1", "version": "2.3.2",
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.", "description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
"type": "module", "type": "module",
"author": "withastro", "author": "withastro",
@ -198,7 +198,7 @@
"sass": "^1.52.2", "sass": "^1.52.2",
"sharp": "^0.31.3", "sharp": "^0.31.3",
"srcset-parse": "^1.1.0", "srcset-parse": "^1.1.0",
"undici": "^5.20.0", "undici": "^5.22.0",
"unified": "^10.1.2" "unified": "^10.1.2"
}, },
"peerDependencies": { "peerDependencies": {

View file

@ -2,6 +2,7 @@
"name": "@test/performance", "name": "@test/performance",
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"private": true,
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"benchmark": "node ./content-benchmark.mjs" "benchmark": "node ./content-benchmark.mjs"

View file

@ -335,6 +335,12 @@ export interface ViteUserConfig extends vite.UserConfig {
ssr?: vite.SSROptions; ssr?: vite.SSROptions;
} }
export interface ImageServiceConfig {
// eslint-disable-next-line @typescript-eslint/ban-types
entrypoint: 'astro/assets/services/sharp' | 'astro/assets/services/squoosh' | (string & {});
config?: Record<string, any>;
}
/** /**
* Astro User Config * Astro User Config
* Docs: https://docs.astro.build/reference/configuration-reference/ * Docs: https://docs.astro.build/reference/configuration-reference/
@ -763,26 +769,26 @@ export interface AstroUserConfig {
/** /**
* @docs * @docs
* @name image.service (Experimental) * @name image.service (Experimental)
* @type {'astro/assets/services/sharp' | 'astro/assets/services/squoosh' | string} * @type {{entrypoint: 'astro/assets/services/sharp' | 'astro/assets/services/squoosh' | string, config: Record<string, any>}}
* @default `'astro/assets/services/squoosh'` * @default `{entrypoint: 'astro/assets/services/squoosh', config?: {}}`
* @version 2.1.0 * @version 2.1.0
* @description * @description
* Set which image service is used for Astros experimental assets support. * Set which image service is used for Astros experimental assets support.
* *
* The value should be a module specifier for the image service to use: * The value should be an object with an entrypoint for the image service to use and optionally, a config object to pass to the service.
* either one of Astros two built-in services, or a third-party implementation. *
* The service entrypoint can be either one of the included services, or a third-party package.
* *
* ```js * ```js
* { * {
* image: { * image: {
* // Example: Enable the Sharp-based image service * // Example: Enable the Sharp-based image service
* service: 'astro/assets/services/sharp', * service: { entrypoint: 'astro/assets/services/sharp' },
* }, * },
* } * }
* ``` * ```
*/ */
// eslint-disable-next-line @typescript-eslint/ban-types service: ImageServiceConfig;
service: 'astro/assets/services/sharp' | 'astro/assets/services/squoosh' | (string & {});
}; };
/** /**

View file

@ -4,6 +4,8 @@ import { isRemotePath } from '../core/path.js';
import { getConfiguredImageService } from './internal.js'; import { getConfiguredImageService } from './internal.js';
import { isLocalService } from './services/service.js'; import { isLocalService } from './services/service.js';
import { etag } from './utils/etag.js'; import { etag } from './utils/etag.js';
// @ts-expect-error
import { imageServiceConfig } from 'astro:assets';
async function loadRemoteImage(src: URL) { async function loadRemoteImage(src: URL) {
try { try {
@ -31,7 +33,7 @@ export const get: APIRoute = async ({ request }) => {
} }
const url = new URL(request.url); const url = new URL(request.url);
const transform = await imageService.parseURL(url); const transform = await imageService.parseURL(url, imageServiceConfig);
if (!transform || !transform.src) { if (!transform || !transform.src) {
throw new Error('Incorrect transform returned by `parseURL`'); throw new Error('Incorrect transform returned by `parseURL`');
@ -49,7 +51,11 @@ export const get: APIRoute = async ({ request }) => {
return new Response('Not Found', { status: 404 }); return new Response('Not Found', { status: 404 });
} }
const { data, format } = await imageService.transform(inputBuffer, transform); const { data, format } = await imageService.transform(
inputBuffer,
transform,
imageServiceConfig
);
return new Response(data, { return new Response(data, {
status: 200, status: 200,

View file

@ -1,5 +1,21 @@
import type { ImageServiceConfig } from '../@types/astro.js';
export { getConfiguredImageService, getImage } from './internal.js'; export { getConfiguredImageService, getImage } from './internal.js';
export { baseService, isLocalService } from './services/service.js'; export { baseService, isLocalService } from './services/service.js';
export { type LocalImageProps, type RemoteImageProps } from './types.js'; export { type LocalImageProps, type RemoteImageProps } from './types.js';
export { emitESMImage } from './utils/emitAsset.js'; export { emitESMImage } from './utils/emitAsset.js';
export { imageMetadata } from './utils/metadata.js'; export { imageMetadata } from './utils/metadata.js';
export function sharpImageService(): ImageServiceConfig {
return {
entrypoint: 'astro/assets/services/sharp',
config: {},
};
}
export function squooshImageService(): ImageServiceConfig {
return {
entrypoint: 'astro/assets/services/squoosh',
config: {},
};
}

View file

@ -45,7 +45,10 @@ export async function getConfiguredImageService(): Promise<ImageService> {
* *
* This is functionally equivalent to using the `<Image />` component, as the component calls this function internally. * This is functionally equivalent to using the `<Image />` component, as the component calls this function internally.
*/ */
export async function getImage(options: ImageTransform): Promise<GetImageResult> { export async function getImage(
options: ImageTransform,
serviceConfig: Record<string, any>
): Promise<GetImageResult> {
if (!options || typeof options !== 'object') { if (!options || typeof options !== 'object') {
throw new AstroError({ throw new AstroError({
...AstroErrorData.ExpectedImageOptions, ...AstroErrorData.ExpectedImageOptions,
@ -54,9 +57,11 @@ export async function getImage(options: ImageTransform): Promise<GetImageResult>
} }
const service = await getConfiguredImageService(); const service = await getConfiguredImageService();
const validatedOptions = service.validateOptions ? service.validateOptions(options) : options; const validatedOptions = service.validateOptions
? service.validateOptions(options, serviceConfig)
: options;
let imageURL = service.getURL(validatedOptions); let imageURL = service.getURL(validatedOptions, serviceConfig);
// In build and for local services, we need to collect the requested parameters so we can generate the final images // In build and for local services, we need to collect the requested parameters so we can generate the final images
if (isLocalService(service) && globalThis.astroAsset.addStaticImage) { if (isLocalService(service) && globalThis.astroAsset.addStaticImage) {
@ -68,7 +73,9 @@ export async function getImage(options: ImageTransform): Promise<GetImageResult>
options: validatedOptions, options: validatedOptions,
src: imageURL, src: imageURL,
attributes: attributes:
service.getHTMLAttributes !== undefined ? service.getHTMLAttributes(validatedOptions) : {}, service.getHTMLAttributes !== undefined
? service.getHTMLAttributes(validatedOptions, serviceConfig)
: {},
}; };
} }
@ -121,7 +128,11 @@ export async function generateImage(
serverRoot serverRoot
) )
); );
const resultData = await imageService.transform(fileData, { ...options, src: originalImagePath }); const resultData = await imageService.transform(
fileData,
{ ...options, src: originalImagePath },
buildOpts.settings.config.image.service.config
);
const finalFileURL = new URL('.' + filepath, clientRoot); const finalFileURL = new URL('.' + filepath, clientRoot);
const finalFolderURL = new URL('./', finalFileURL); const finalFolderURL = new URL('./', finalFileURL);

View file

@ -31,14 +31,17 @@ interface SharedServiceProps {
* For external services, this should point to the URL your images are coming from, for instance, `/_vercel/image` * For external services, this should point to the URL your images are coming from, for instance, `/_vercel/image`
* *
*/ */
getURL: (options: ImageTransform) => string; getURL: (options: ImageTransform, serviceConfig: Record<string, any>) => string;
/** /**
* Return any additional HTML attributes separate from `src` that your service requires to show the image properly. * Return any additional HTML attributes separate from `src` that your service requires to show the image properly.
* *
* For example, you might want to return the `width` and `height` to avoid CLS, or a particular `class` or `style`. * For example, you might want to return the `width` and `height` to avoid CLS, or a particular `class` or `style`.
* In most cases, you'll want to return directly what your user supplied you, minus the attributes that were used to generate the image. * In most cases, you'll want to return directly what your user supplied you, minus the attributes that were used to generate the image.
*/ */
getHTMLAttributes?: (options: ImageTransform) => Record<string, any>; getHTMLAttributes?: (
options: ImageTransform,
serviceConfig: Record<string, any>
) => Record<string, any>;
/** /**
* Validate and return the options passed by the user. * Validate and return the options passed by the user.
* *
@ -47,7 +50,7 @@ interface SharedServiceProps {
* *
* This method should returns options, and can be used to set defaults (ex: a default output format to be used if the user didn't specify one.) * This method should returns options, and can be used to set defaults (ex: a default output format to be used if the user didn't specify one.)
*/ */
validateOptions?: (options: ImageTransform) => ImageTransform; validateOptions?: (options: ImageTransform, serviceConfig: Record<string, any>) => ImageTransform;
} }
export type ExternalImageService = SharedServiceProps; export type ExternalImageService = SharedServiceProps;
@ -63,14 +66,15 @@ export interface LocalImageService extends SharedServiceProps {
* *
* In most cases, this will get query parameters using, for example, `params.get('width')` and return those. * In most cases, this will get query parameters using, for example, `params.get('width')` and return those.
*/ */
parseURL: (url: URL) => LocalImageTransform | undefined; parseURL: (url: URL, serviceConfig: Record<string, any>) => LocalImageTransform | undefined;
/** /**
* Performs the image transformations on the input image and returns both the binary data and * Performs the image transformations on the input image and returns both the binary data and
* final image format of the optimized image. * final image format of the optimized image.
*/ */
transform: ( transform: (
inputBuffer: Buffer, inputBuffer: Buffer,
transform: LocalImageTransform transform: LocalImageTransform,
serviceConfig: Record<string, any>
) => Promise<{ data: Buffer; format: ImageOutputFormat }>; ) => Promise<{ data: Buffer; format: ImageOutputFormat }>;
} }

View file

@ -38,7 +38,7 @@ export default function assets({
const adapterName = settings.config.adapter?.name; const adapterName = settings.config.adapter?.name;
if ( if (
['astro/assets/services/sharp', 'astro/assets/services/squoosh'].includes( ['astro/assets/services/sharp', 'astro/assets/services/squoosh'].includes(
settings.config.image.service settings.config.image.service.entrypoint
) && ) &&
adapterName && adapterName &&
UNSUPPORTED_ADAPTERS.has(adapterName) UNSUPPORTED_ADAPTERS.has(adapterName)
@ -70,7 +70,7 @@ export default function assets({
}, },
async resolveId(id) { async resolveId(id) {
if (id === VIRTUAL_SERVICE_ID) { if (id === VIRTUAL_SERVICE_ID) {
return await this.resolve(settings.config.image.service); return await this.resolve(settings.config.image.service.entrypoint);
} }
if (id === VIRTUAL_MODULE_ID) { if (id === VIRTUAL_MODULE_ID) {
return resolvedVirtualModuleId; return resolvedVirtualModuleId;
@ -79,8 +79,12 @@ export default function assets({
load(id) { load(id) {
if (id === resolvedVirtualModuleId) { if (id === resolvedVirtualModuleId) {
return ` return `
export { getImage, getConfiguredImageService, isLocalService } from "astro/assets"; export { getConfiguredImageService, isLocalService } from "astro/assets";
import { getImage as getImageInternal } from "astro/assets";
export { default as Image } from "astro/components/Image.astro"; export { default as Image } from "astro/components/Image.astro";
export const imageServiceConfig = ${JSON.stringify(settings.config.image.service.config)};
export const getImage = async (options) => await getImageInternal(options, imageServiceConfig);
`; `;
} }
}, },
@ -116,7 +120,10 @@ export default function assets({
} }
} }
const transform = await globalThis.astroAsset.imageService.parseURL(url); const transform = await globalThis.astroAsset.imageService.parseURL(
url,
settings.config.image.service.config
);
if (transform === undefined) { if (transform === undefined) {
error(logging, 'image', `Failed to parse transform for ${url}`); error(logging, 'image', `Failed to parse transform for ${url}`);
@ -127,7 +134,11 @@ export default function assets({
let format: string = meta.format; let format: string = meta.format;
if (transform) { if (transform) {
const result = await globalThis.astroAsset.imageService.transform(file, transform); const result = await globalThis.astroAsset.imageService.transform(
file,
transform,
settings.config.image.service.config
);
data = result.data; data = result.data;
format = result.format; format = result.format;
} }
@ -155,7 +166,7 @@ export default function assets({
>(); >();
} }
const hash = hashTransform(options, settings.config.image.service); const hash = hashTransform(options, settings.config.image.service.entrypoint);
let filePath: string; let filePath: string;
if (globalThis.astroAsset.staticImages.has(hash)) { if (globalThis.astroAsset.staticImages.has(hash)) {

View file

@ -125,14 +125,17 @@ export const AstroConfigSchema = z.object({
), ),
image: z image: z
.object({ .object({
service: z.union([ service: z.object({
z.literal('astro/assets/services/sharp'), entrypoint: z.union([
z.literal('astro/assets/services/squoosh'), z.literal('astro/assets/services/sharp'),
z.string(), z.literal('astro/assets/services/squoosh'),
]), z.string(),
]),
config: z.record(z.any()).default({}),
}),
}) })
.default({ .default({
service: 'astro/assets/services/squoosh', service: { entrypoint: 'astro/assets/services/squoosh', config: {} },
}), }),
markdown: z markdown: z
.object({ .object({

View file

@ -48,7 +48,7 @@ const getConfigAlias = (settings: AstroSettings): Alias[] | null => {
// - `baseUrl` changes the way non-relative specifiers are resolved // - `baseUrl` changes the way non-relative specifiers are resolved
// - if `baseUrl` exists then all non-relative specifiers are resolved relative to it // - if `baseUrl` exists then all non-relative specifiers are resolved relative to it
aliases.push({ aliases.push({
find: /^(?!\.*\/|\w:)(.+)$/, find: /^(?!\.*\/|\.*$|\w:)(.+)$/,
replacement: `${[...normalizePath(resolvedBaseUrl)] replacement: `${[...normalizePath(resolvedBaseUrl)]
.map((segment) => (segment === '$' ? '$$' : segment)) .map((segment) => (segment === '$' ? '$$' : segment))
.join('')}/$1`, .join('')}/$1`,

View file

@ -61,6 +61,7 @@ describe('Aliases with tsconfig.json', () => {
expect($('#foo').text()).to.equal('foo'); expect($('#foo').text()).to.equal('foo');
expect($('#constants-foo').text()).to.equal('foo'); expect($('#constants-foo').text()).to.equal('foo');
expect($('#constants-index').text()).to.equal('index');
}); });
it('can load namespace packages with @* paths', async () => { it('can load namespace packages with @* paths', async () => {
@ -107,6 +108,7 @@ describe('Aliases with tsconfig.json', () => {
expect($('#foo').text()).to.equal('foo'); expect($('#foo').text()).to.equal('foo');
expect($('#constants-foo').text()).to.equal('foo'); expect($('#constants-foo').text()).to.equal('foo');
expect($('#constants-index').text()).to.equal('index');
}); });
it('can load namespace packages with @* paths', async () => { it('can load namespace packages with @* paths', async () => {

View file

@ -620,7 +620,12 @@ describe('astro:image', () => {
assets: true, assets: true,
}, },
image: { image: {
service: fileURLToPath(new URL('./fixtures/core-image/service.mjs', import.meta.url)), service: {
entrypoint: fileURLToPath(
new URL('./fixtures/core-image/service.mjs', import.meta.url)
),
config: { foo: 'bar' },
},
}, },
}); });
devServer = await fixture.startDevServer(); devServer = await fixture.startDevServer();
@ -641,5 +646,13 @@ describe('astro:image', () => {
const $ = cheerio.load(html); const $ = cheerio.load(html);
expect($('img').attr('data-service')).to.equal('my-custom-service'); expect($('img').attr('data-service')).to.equal('my-custom-service');
}); });
it('gets service config', async () => {
const response = await fixture.fetch('/');
const html = await response.text();
const $ = cheerio.load(html);
expect($('#local img').attr('data-service-config')).to.equal('bar');
});
}); });
}); });

View file

@ -4,7 +4,7 @@ import Foo from 'src/components/Foo.astro';
import StyleComp from 'src/components/Style.astro'; import StyleComp from 'src/components/Style.astro';
import Alias from '@components/Alias.svelte'; import Alias from '@components/Alias.svelte';
import { namespace } from '@test/namespace-package' import { namespace } from '@test/namespace-package'
import { foo } from 'src/utils/constants'; import { foo, index } from 'src/utils/constants';
import '@styles/main.css'; import '@styles/main.css';
--- ---
<html lang="en"> <html lang="en">
@ -21,6 +21,7 @@ import '@styles/main.css';
<Alias client:load /> <Alias client:load />
<p id="namespace">{namespace}</p> <p id="namespace">{namespace}</p>
<p id="constants-foo">{foo}</p> <p id="constants-foo">{foo}</p>
<p id="constants-index">{index}</p>
<p id="style-red">style-red</p> <p id="style-red">style-red</p>
<p id="style-blue">style-blue</p> <p id="style-blue">style-blue</p>
</main> </main>

View file

@ -1 +1,3 @@
export * from '.'
export const foo = 'foo' export const foo = 'foo'

View file

@ -0,0 +1 @@
export const index = 'index'

View file

@ -1,4 +1,5 @@
{ {
"name": "@test/astro-client-only-pkg", "name": "@test/astro-client-only-pkg",
"main": "index.svelte" "main": "index.svelte",
"private": true
} }

View file

@ -1,5 +1,6 @@
{ {
"name": "@test/astro-slot-with-client", "name": "@test/astro-slot-with-client",
"private": true,
"dependencies": { "dependencies": {
"astro": "workspace:*", "astro": "workspace:*",
"@astrojs/preact": "workspace:*", "@astrojs/preact": "workspace:*",

View file

@ -1,5 +1,6 @@
{ {
"name": "@test/before-hydration", "name": "@test/before-hydration",
"private": true,
"dependencies": { "dependencies": {
"@astrojs/preact": "workspace:*", "@astrojs/preact": "workspace:*",
"astro": "workspace:*", "astro": "workspace:*",

View file

@ -1,5 +1,6 @@
{ {
"name": "@test/build-assets", "name": "@test/build-assets",
"private": true,
"dependencies": { "dependencies": {
"@astrojs/preact": "workspace:*", "@astrojs/preact": "workspace:*",
"astro": "workspace:*", "astro": "workspace:*",

View file

@ -7,8 +7,9 @@ const service = {
getURL(options) { getURL(options) {
return squoosh.getURL(options); return squoosh.getURL(options);
}, },
getHTMLAttributes(options) { getHTMLAttributes(options, serviceConfig) {
options['data-service'] = 'my-custom-service'; options['data-service'] = 'my-custom-service';
options['data-service-config'] = serviceConfig.foo;
return squoosh.getHTMLAttributes(options); return squoosh.getHTMLAttributes(options);
}, },
parseURL(url) { parseURL(url) {

View file

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

View file

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

View file

@ -6,7 +6,7 @@
font-style: normal; font-style: normal;
font-weight: 300; font-weight: 300;
font-display: swap; 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'); format('woff2');
} }

View file

@ -7,7 +7,7 @@
font-style: normal; font-style: normal;
font-weight: 300; font-weight: 300;
font-display: swap; 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'); format('woff2');
} }

View file

@ -1,5 +1,6 @@
{ {
"name": "@test/css-order-dynamic-import", "name": "@test/css-order-dynamic-import",
"private": true,
"dependencies": { "dependencies": {
"astro": "workspace:*" "astro": "workspace:*"
} }

View file

@ -1,5 +1,6 @@
{ {
"name": "@test/css-order-import", "name": "@test/css-order-import",
"private": true,
"dependencies": { "dependencies": {
"@astrojs/react": "workspace:*", "@astrojs/react": "workspace:*",
"astro": "workspace:*", "astro": "workspace:*",

View file

@ -1,5 +1,6 @@
{ {
"name": "@test/css-order-layout", "name": "@test/css-order-layout",
"private": true,
"dependencies": { "dependencies": {
"astro": "workspace:*" "astro": "workspace:*"
} }

View file

@ -1,5 +1,6 @@
{ {
"name": "@test/css-order", "name": "@test/css-order",
"private": true,
"dependencies": { "dependencies": {
"astro": "workspace:*" "astro": "workspace:*"
} }

View file

@ -1,5 +1,6 @@
{ {
"name": "@test/dont-delete-me", "name": "@test/dont-delete-me",
"private": true,
"dependencies": { "dependencies": {
"astro": "workspace:*" "astro": "workspace:*"
} }

View file

@ -1,5 +1,6 @@
{ {
"name": "@test/lazy-layout", "name": "@test/lazy-layout",
"private": true,
"dependencies": { "dependencies": {
"astro": "workspace:*" "astro": "workspace:*"
} }

View file

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

View file

@ -1,8 +1,9 @@
{ {
"name": "@test/multiple-renderers", "name": "@test/multiple-renderers",
"private": true,
"dependencies": { "dependencies": {
"astro": "workspace:*", "astro": "workspace:*",
"@astrojs/renderer-one": "file:./renderers/one", "@test/astro-renderer-one": "file:./renderers/one",
"@astrojs/renderer-two": "file:./renderers/two" "@test/astro-renderer-two": "file:./renderers/two"
} }
} }

View file

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

View file

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

View file

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

View file

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

View file

@ -7,8 +7,8 @@
"@astrojs/svelte": "workspace:*", "@astrojs/svelte": "workspace:*",
"@astrojs/vue": "workspace:*", "@astrojs/vue": "workspace:*",
"astro": "workspace:*", "astro": "workspace:*",
"autoprefixer": "^10.4.7", "autoprefixer": "^10.4.14",
"postcss": "^8.4.14", "postcss": "^8.4.23",
"solid-js": "^1.5.6", "solid-js": "^1.5.6",
"svelte": "^3.48.0", "svelte": "^3.48.0",
"vue": "^3.2.39" "vue": "^3.2.39"

View file

@ -1,5 +1,6 @@
{ {
"name": "@test/react-and-solid", "name": "@test/react-and-solid",
"private": true,
"dependencies": { "dependencies": {
"@astrojs/react": "workspace:*", "@astrojs/react": "workspace:*",
"@astrojs/solid-js": "workspace:*", "@astrojs/solid-js": "workspace:*",

View file

@ -1,5 +1,6 @@
{ {
"name": "@test/reexport-astro-containing-client-component", "name": "@test/reexport-astro-containing-client-component",
"private": true,
"dependencies": { "dependencies": {
"@astrojs/preact": "workspace:", "@astrojs/preact": "workspace:",
"astro": "workspace:", "astro": "workspace:",

View file

@ -1,6 +1,7 @@
{ {
"name": "@test/set-html", "name": "@test/set-html",
"version": "1.0.0", "version": "1.0.0",
"private": true,
"dependencies": { "dependencies": {
"astro": "workspace:*" "astro": "workspace:*"
} }

View file

@ -1,6 +1,7 @@
{ {
"name": "@test/static-build-ssr", "name": "@test/static-build-ssr",
"version": "0.0.0", "version": "0.0.0",
"private": true,
"dependencies": { "dependencies": {
"@astrojs/node": "workspace:*", "@astrojs/node": "workspace:*",
"@test/static-build-pkg": "workspace:*", "@test/static-build-pkg": "workspace:*",

View file

@ -1,6 +1,7 @@
{ {
"name": "@test/static-build", "name": "@test/static-build",
"version": "0.0.0", "version": "0.0.0",
"private": true,
"dependencies": { "dependencies": {
"@astrojs/preact": "workspace:*", "@astrojs/preact": "workspace:*",
"@test/static-build-pkg": "workspace:*", "@test/static-build-pkg": "workspace:*",

View file

@ -5,7 +5,7 @@
"dependencies": { "dependencies": {
"@astrojs/tailwind": "workspace:*", "@astrojs/tailwind": "workspace:*",
"astro": "workspace:*", "astro": "workspace:*",
"tailwindcss": "^3.2.4", "tailwindcss": "^3.3.2",
"postcss": ">=8.3.3 <9.0.0" "postcss": "^8.4.23"
} }
} }

View file

@ -6,8 +6,8 @@
"@astrojs/tailwind": "workspace:*", "@astrojs/tailwind": "workspace:*",
"@astrojs/mdx": "workspace:*", "@astrojs/mdx": "workspace:*",
"astro": "workspace:*", "astro": "workspace:*",
"autoprefixer": "^10.4.7", "autoprefixer": "^10.4.14",
"postcss": "^8.4.14", "postcss": "^8.4.23",
"tailwindcss": "^3.0.24" "tailwindcss": "^3.3.2"
} }
} }

View file

@ -1 +1,4 @@
{} {
"name": "@test/create-astro-not-empty",
"private": true
}

View file

@ -1,5 +1,14 @@
# @astrojs/cloudflare # @astrojs/cloudflare
## 6.2.3
### Patch Changes
- [#6222](https://github.com/withastro/astro/pull/6222) [`081b2402c`](https://github.com/withastro/astro/commit/081b2402cfb48b5eb8dbd02664d8af2f7c798edf) Thanks [@AirBorne04](https://github.com/AirBorne04)! - add option to compile unminified code
- Updated dependencies [[`b89042553`](https://github.com/withastro/astro/commit/b89042553ec45d5f6bc71747e0f3470ba969e679)]:
- astro@2.3.2
## 6.2.2 ## 6.2.2
### Patch Changes ### Patch Changes

View file

@ -108,10 +108,28 @@ By default, `@astrojs/cloudflare` will generate a `_routes.json` file that lists
## Troubleshooting ## Troubleshooting
For help, check out the `#support` channel on [Discord](https://astro.build/chat). Our friendly Support Squad members are here to help! For help, check out the `#support` channel on [Discord](https://astro.build/chat). Our friendly Support Squad members are here to help!
You can also check our [Astro Integration Documentation][astro-integration] for more on integrations. You can also check our [Astro Integration Documentation][astro-integration] for more on integrations.
### Meaningful error messages
Currently, errors during running your application in Wrangler are not very useful, due to the minification of your code. For better debugging, you can add `vite.build.minify = false` setting to your `astro.config.js`
```js
export default defineConfig({
adapter: cloudflare(),
output: 'server',
vite: {
build: {
minify: false
}
}
});
```
## Contributing ## Contributing
This package is maintained by Astro's Core team. You're welcome to submit an issue or PR! This package is maintained by Astro's Core team. You're welcome to submit an issue or PR!

View file

@ -1,7 +1,7 @@
{ {
"name": "@astrojs/cloudflare", "name": "@astrojs/cloudflare",
"description": "Deploy your site to Cloudflare Workers/Pages", "description": "Deploy your site to Cloudflare Workers/Pages",
"version": "6.2.2", "version": "6.2.3",
"type": "module", "type": "module",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
"author": "withastro", "author": "withastro",
@ -38,7 +38,7 @@
"tiny-glob": "^0.2.9" "tiny-glob": "^0.2.9"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "workspace:^2.3.1" "astro": "workspace:^2.3.2"
}, },
"devDependencies": { "devDependencies": {
"astro": "workspace:*", "astro": "workspace:*",

View file

@ -103,7 +103,7 @@ export default function createIntegration(args?: Options): AstroIntegration {
allowOverwrite: true, allowOverwrite: true,
format: 'esm', format: 'esm',
bundle: true, bundle: true,
minify: true, minify: _config.vite?.build?.minify !== false,
banner: { banner: {
js: SHIM, js: SHIM,
}, },

View file

@ -33,7 +33,7 @@
"esbuild": "^0.15.18" "esbuild": "^0.15.18"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "workspace:^2.3.1" "astro": "workspace:^2.3.2"
}, },
"devDependencies": { "devDependencies": {
"astro": "workspace:*", "astro": "workspace:*",

View file

@ -63,7 +63,7 @@
"vite": "^4.3.1" "vite": "^4.3.1"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "workspace:^2.3.1", "astro": "workspace:^2.3.2",
"sharp": ">=0.31.0" "sharp": ">=0.31.0"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {

View file

@ -41,7 +41,7 @@
"zod": "^3.17.3" "zod": "^3.17.3"
}, },
"peerDependencies": { "peerDependencies": {
"astro": "workspace:^2.3.1" "astro": "workspace:^2.3.2"
}, },
"devDependencies": { "devDependencies": {
"@types/chai": "^4.3.1", "@types/chai": "^4.3.1",

View file

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

View file

@ -1,6 +1,7 @@
{ {
"name": "@test/mdx-infinite-loop", "name": "@test/mdx-infinite-loop",
"type": "module", "type": "module",
"private": true,
"dependencies": { "dependencies": {
"@astrojs/mdx": "workspace:*", "@astrojs/mdx": "workspace:*",
"@astrojs/preact": "workspace:*", "@astrojs/preact": "workspace:*",

View file

@ -1,5 +1,6 @@
{ {
"name": "@test/mdx-namespace", "name": "@test/mdx-namespace",
"private": true,
"dependencies": { "dependencies": {
"@astrojs/mdx": "workspace:*", "@astrojs/mdx": "workspace:*",
"@astrojs/react": "workspace:*", "@astrojs/react": "workspace:*",

View file

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

View file

@ -1,5 +1,6 @@
{ {
"name": "@test/mdx-plus-react", "name": "@test/mdx-plus-react",
"private": true,
"dependencies": { "dependencies": {
"@astrojs/mdx": "workspace:*", "@astrojs/mdx": "workspace:*",
"@astrojs/react": "workspace:*", "@astrojs/react": "workspace:*",

Some files were not shown because too many files have changed in this diff Show more