From 481e0d1d8ae313714cfbc14e82f6dd248232ee33 Mon Sep 17 00:00:00 2001 From: "Fred K. Bot" <108291165+fredkbot@users.noreply.github.com> Date: Tue, 6 Sep 2022 12:40:15 -0700 Subject: [PATCH 01/18] [ci] release (#4620) Co-authored-by: github-actions[bot] --- .changeset/fifty-avocados-lay.md | 5 -- .changeset/little-boats-happen.md | 5 -- .changeset/rich-dolphins-teach.md | 5 -- .changeset/seven-zoos-lie.md | 5 -- .changeset/slimy-fireants-carry.md | 5 -- .changeset/smooth-hats-smell.md | 5 -- .changeset/three-owls-help.md | 5 -- examples/basics/package.json | 2 +- examples/blog/package.json | 2 +- examples/component/demo/package.json | 2 +- examples/component/package.json | 2 +- examples/docs/package.json | 2 +- examples/framework-alpine/package.json | 4 +- examples/framework-lit/package.json | 2 +- examples/framework-multiple/package.json | 4 +- examples/framework-preact/package.json | 2 +- examples/framework-react/package.json | 2 +- examples/framework-solid/package.json | 2 +- examples/framework-svelte/package.json | 2 +- examples/framework-vue/package.json | 4 +- examples/minimal/package.json | 2 +- examples/non-html-pages/package.json | 2 +- examples/portfolio/package.json | 2 +- examples/ssr/package.json | 2 +- examples/with-markdown-plugins/package.json | 2 +- examples/with-markdown-shiki/package.json | 2 +- examples/with-mdx/package.json | 2 +- examples/with-nanostores/package.json | 2 +- examples/with-tailwindcss/package.json | 2 +- examples/with-vite-plugin-pwa/package.json | 2 +- examples/with-vitest/package.json | 2 +- packages/astro/CHANGELOG.md | 12 ++++ packages/astro/package.json | 2 +- packages/integrations/alpinejs/CHANGELOG.md | 6 ++ packages/integrations/alpinejs/package.json | 2 +- packages/integrations/image/CHANGELOG.md | 6 ++ packages/integrations/image/package.json | 2 +- packages/integrations/vue/CHANGELOG.md | 6 ++ packages/integrations/vue/package.json | 2 +- pnpm-lock.yaml | 62 +++++++++------------ 40 files changed, 88 insertions(+), 101 deletions(-) delete mode 100644 .changeset/fifty-avocados-lay.md delete mode 100644 .changeset/little-boats-happen.md delete mode 100644 .changeset/rich-dolphins-teach.md delete mode 100644 .changeset/seven-zoos-lie.md delete mode 100644 .changeset/slimy-fireants-carry.md delete mode 100644 .changeset/smooth-hats-smell.md delete mode 100644 .changeset/three-owls-help.md diff --git a/.changeset/fifty-avocados-lay.md b/.changeset/fifty-avocados-lay.md deleted file mode 100644 index eaf9f2e32..000000000 --- a/.changeset/fifty-avocados-lay.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"astro": patch ---- - -Improve third-party Astro package support diff --git a/.changeset/little-boats-happen.md b/.changeset/little-boats-happen.md deleted file mode 100644 index ba970324b..000000000 --- a/.changeset/little-boats-happen.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/vue': patch ---- - -Mark vueperslides as a default noExternal diff --git a/.changeset/rich-dolphins-teach.md b/.changeset/rich-dolphins-teach.md deleted file mode 100644 index a9bbf7de9..000000000 --- a/.changeset/rich-dolphins-teach.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/image': patch ---- - -Parallelize image transforms diff --git a/.changeset/seven-zoos-lie.md b/.changeset/seven-zoos-lie.md deleted file mode 100644 index b19de1b05..000000000 --- a/.changeset/seven-zoos-lie.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Remove regression when there is duplicate client/server CSS diff --git a/.changeset/slimy-fireants-carry.md b/.changeset/slimy-fireants-carry.md deleted file mode 100644 index 7f972759a..000000000 --- a/.changeset/slimy-fireants-carry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Correctly escape paths in file names diff --git a/.changeset/smooth-hats-smell.md b/.changeset/smooth-hats-smell.md deleted file mode 100644 index cac2f8bef..000000000 --- a/.changeset/smooth-hats-smell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Ensure SSR module is loaded before testing if it's CSS in dev diff --git a/.changeset/three-owls-help.md b/.changeset/three-owls-help.md deleted file mode 100644 index 9fe2ded0f..000000000 --- a/.changeset/three-owls-help.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/alpinejs': patch ---- - -Update homepage link diff --git a/examples/basics/package.json b/examples/basics/package.json index d4d44b91f..2820756ba 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -10,6 +10,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.1.5" + "astro": "^1.1.6" } } diff --git a/examples/blog/package.json b/examples/blog/package.json index 0ccc1d178..141c81ab8 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.1.5", + "astro": "^1.1.6", "@astrojs/mdx": "^0.11.1", "@astrojs/rss": "^1.0.0", "@astrojs/sitemap": "^1.0.0" diff --git a/examples/component/demo/package.json b/examples/component/demo/package.json index 118b218b7..80a5480be 100644 --- a/examples/component/demo/package.json +++ b/examples/component/demo/package.json @@ -11,6 +11,6 @@ }, "devDependencies": { "@example/my-component": "workspace:*", - "astro": "^1.1.5" + "astro": "^1.1.6" } } diff --git a/examples/component/package.json b/examples/component/package.json index f8fb37630..35958f0b0 100644 --- a/examples/component/package.json +++ b/examples/component/package.json @@ -8,6 +8,6 @@ "serve": "astro --root demo preview" }, "dependencies": { - "astro": "^1.1.5" + "astro": "^1.1.6" } } diff --git a/examples/docs/package.json b/examples/docs/package.json index 0c0add7dc..d951800be 100644 --- a/examples/docs/package.json +++ b/examples/docs/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.1.5", + "astro": "^1.1.6", "preact": "^10.7.3", "react": "^18.1.0", "react-dom": "^18.1.0", diff --git a/examples/framework-alpine/package.json b/examples/framework-alpine/package.json index f5f2f3071..8f4fe38c0 100644 --- a/examples/framework-alpine/package.json +++ b/examples/framework-alpine/package.json @@ -10,9 +10,9 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.1.5", + "astro": "^1.1.6", "alpinejs": "^3.10.2", - "@astrojs/alpinejs": "^0.1.1", + "@astrojs/alpinejs": "^0.1.2", "@types/alpinejs": "^3.7.0" } } diff --git a/examples/framework-lit/package.json b/examples/framework-lit/package.json index aa9cdae26..bd3db1cd9 100644 --- a/examples/framework-lit/package.json +++ b/examples/framework-lit/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.1.5", + "astro": "^1.1.6", "lit": "^2.2.5", "@astrojs/lit": "^1.0.0", "@webcomponents/template-shadowroot": "^0.1.0" diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json index edab8d742..49467a2b0 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.1.5", + "astro": "^1.1.6", "preact": "^10.7.3", "react": "^18.1.0", "react-dom": "^18.1.0", @@ -21,6 +21,6 @@ "@astrojs/react": "^1.1.0", "@astrojs/solid-js": "^1.1.0", "@astrojs/svelte": "^1.0.0", - "@astrojs/vue": "^1.0.0" + "@astrojs/vue": "^1.0.1" } } diff --git a/examples/framework-preact/package.json b/examples/framework-preact/package.json index 9fe5859b4..3442809f8 100644 --- a/examples/framework-preact/package.json +++ b/examples/framework-preact/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.1.5", + "astro": "^1.1.6", "preact": "^10.7.3", "@astrojs/preact": "^1.0.2" } diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json index cccfbf0ce..98182f911 100644 --- a/examples/framework-react/package.json +++ b/examples/framework-react/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.1.5", + "astro": "^1.1.6", "react": "^18.1.0", "react-dom": "^18.1.0", "@astrojs/react": "^1.1.0", diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json index 40484e92f..0efc31906 100644 --- a/examples/framework-solid/package.json +++ b/examples/framework-solid/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.1.5", + "astro": "^1.1.6", "solid-js": "^1.4.3", "@astrojs/solid-js": "^1.1.0" } diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json index 9b64aba73..467785540 100644 --- a/examples/framework-svelte/package.json +++ b/examples/framework-svelte/package.json @@ -12,6 +12,6 @@ "dependencies": { "svelte": "^3.48.0", "@astrojs/svelte": "^1.0.0", - "astro": "^1.1.5" + "astro": "^1.1.6" } } diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json index ca8b3b075..6e139cbec 100644 --- a/examples/framework-vue/package.json +++ b/examples/framework-vue/package.json @@ -10,8 +10,8 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.1.5", + "astro": "^1.1.6", "vue": "^3.2.37", - "@astrojs/vue": "^1.0.0" + "@astrojs/vue": "^1.0.1" } } diff --git a/examples/minimal/package.json b/examples/minimal/package.json index 115162510..62de8b1cd 100644 --- a/examples/minimal/package.json +++ b/examples/minimal/package.json @@ -10,6 +10,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.1.5" + "astro": "^1.1.6" } } diff --git a/examples/non-html-pages/package.json b/examples/non-html-pages/package.json index 1c02146f9..7a84da998 100644 --- a/examples/non-html-pages/package.json +++ b/examples/non-html-pages/package.json @@ -10,6 +10,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.1.5" + "astro": "^1.1.6" } } diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json index a1c002dc7..b184de383 100644 --- a/examples/portfolio/package.json +++ b/examples/portfolio/package.json @@ -10,6 +10,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.1.5" + "astro": "^1.1.6" } } diff --git a/examples/ssr/package.json b/examples/ssr/package.json index b9d96f4c7..f122ed1e5 100644 --- a/examples/ssr/package.json +++ b/examples/ssr/package.json @@ -12,7 +12,7 @@ }, "devDependencies": {}, "dependencies": { - "astro": "^1.1.5", + "astro": "^1.1.6", "svelte": "^3.48.0", "@astrojs/svelte": "^1.0.0", "@astrojs/node": "^1.0.1", diff --git a/examples/with-markdown-plugins/package.json b/examples/with-markdown-plugins/package.json index eca0da00b..378683c19 100644 --- a/examples/with-markdown-plugins/package.json +++ b/examples/with-markdown-plugins/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.1.5", + "astro": "^1.1.6", "@astrojs/markdown-remark": "^1.1.0", "hast-util-select": "5.0.1", "rehype-autolink-headings": "^6.1.1", diff --git a/examples/with-markdown-shiki/package.json b/examples/with-markdown-shiki/package.json index 860e310c6..eabf835b0 100644 --- a/examples/with-markdown-shiki/package.json +++ b/examples/with-markdown-shiki/package.json @@ -10,6 +10,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.1.5" + "astro": "^1.1.6" } } diff --git a/examples/with-mdx/package.json b/examples/with-mdx/package.json index 94b99ee43..fe71432c5 100644 --- a/examples/with-mdx/package.json +++ b/examples/with-mdx/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.1.5", + "astro": "^1.1.6", "preact": "^10.6.5", "@astrojs/preact": "^1.0.2", "@astrojs/mdx": "^0.11.1" diff --git a/examples/with-nanostores/package.json b/examples/with-nanostores/package.json index 6391fca67..550a4fa9f 100644 --- a/examples/with-nanostores/package.json +++ b/examples/with-nanostores/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.1.5", + "astro": "^1.1.6", "preact": "^10.7.3", "@astrojs/preact": "^1.0.2", "nanostores": "^0.5.12", diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json index f44677545..e7fe0a909 100644 --- a/examples/with-tailwindcss/package.json +++ b/examples/with-tailwindcss/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.1.5", + "astro": "^1.1.6", "@astrojs/tailwind": "^1.0.0", "autoprefixer": "^10.4.7", "canvas-confetti": "^1.5.1", diff --git a/examples/with-vite-plugin-pwa/package.json b/examples/with-vite-plugin-pwa/package.json index c2a3d1745..ddc48bb85 100644 --- a/examples/with-vite-plugin-pwa/package.json +++ b/examples/with-vite-plugin-pwa/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.1.5", + "astro": "^1.1.6", "vite-plugin-pwa": "0.11.11", "workbox-window": "^6.5.3" } diff --git a/examples/with-vitest/package.json b/examples/with-vitest/package.json index ba93c3bc9..5071f2db5 100644 --- a/examples/with-vitest/package.json +++ b/examples/with-vitest/package.json @@ -12,7 +12,7 @@ "test": "vitest" }, "dependencies": { - "astro": "^1.1.5", + "astro": "^1.1.6", "vitest": "^0.20.3" } } diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index fdaea4381..27ee31f29 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -1,5 +1,17 @@ # astro +## 1.1.6 + +### Patch Changes + +- [#4623](https://github.com/withastro/astro/pull/4623) [`eb1862b4e`](https://github.com/withastro/astro/commit/eb1862b4e68b399eecc7267ea9e0bee36983b0cb) Thanks [@delucis](https://github.com/delucis)! - Improve third-party Astro package support + +- [#4643](https://github.com/withastro/astro/pull/4643) [`307b7b97c`](https://github.com/withastro/astro/commit/307b7b97ce79d076ceb4fdc25fd28a27077deb34) Thanks [@matthewp](https://github.com/matthewp)! - Remove regression when there is duplicate client/server CSS + +- [#4584](https://github.com/withastro/astro/pull/4584) [`29a5fdc15`](https://github.com/withastro/astro/commit/29a5fdc1535fc389035d8107025f7490bfa976ed) Thanks [@bluwy](https://github.com/bluwy)! - Correctly escape paths in file names + +- [#4621](https://github.com/withastro/astro/pull/4621) [`0068afb87`](https://github.com/withastro/astro/commit/0068afb876342ae76154e552dfc5bb6832b665ed) Thanks [@AllanChain](https://github.com/AllanChain)! - Ensure SSR module is loaded before testing if it's CSS in dev + ## 1.1.5 ### Patch Changes diff --git a/packages/astro/package.json b/packages/astro/package.json index 6ec238651..c42b8c9e9 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -1,6 +1,6 @@ { "name": "astro", - "version": "1.1.5", + "version": "1.1.6", "description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.", "type": "module", "author": "withastro", diff --git a/packages/integrations/alpinejs/CHANGELOG.md b/packages/integrations/alpinejs/CHANGELOG.md index dc46c6a1b..b28097914 100644 --- a/packages/integrations/alpinejs/CHANGELOG.md +++ b/packages/integrations/alpinejs/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/alpinejs +## 0.1.2 + +### Patch Changes + +- [#4622](https://github.com/withastro/astro/pull/4622) [`63cd9d89e`](https://github.com/withastro/astro/commit/63cd9d89e8b83ce5e39cdae84a8342e28d1940cc) Thanks [@mohammed-elhaouari](https://github.com/mohammed-elhaouari)! - Update homepage link + ## 0.1.1 ### Patch Changes diff --git a/packages/integrations/alpinejs/package.json b/packages/integrations/alpinejs/package.json index b19ca0359..44f924e6a 100644 --- a/packages/integrations/alpinejs/package.json +++ b/packages/integrations/alpinejs/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/alpinejs", "description": "The official Alpine.js integration for Astro.", - "version": "0.1.1", + "version": "0.1.2", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/image/CHANGELOG.md b/packages/integrations/image/CHANGELOG.md index e88f9b4a2..6b55539d2 100644 --- a/packages/integrations/image/CHANGELOG.md +++ b/packages/integrations/image/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/image +## 0.5.1 + +### Patch Changes + +- [#4626](https://github.com/withastro/astro/pull/4626) [`494c2b835`](https://github.com/withastro/astro/commit/494c2b8353d1975d840c5acaf70cb513b99c58e5) Thanks [@altano](https://github.com/altano)! - Parallelize image transforms + ## 0.5.0 ### Minor Changes diff --git a/packages/integrations/image/package.json b/packages/integrations/image/package.json index fb1aaa67b..6ed535695 100644 --- a/packages/integrations/image/package.json +++ b/packages/integrations/image/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/image", "description": "Load and transform images in your Astro site.", - "version": "0.5.0", + "version": "0.5.1", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/vue/CHANGELOG.md b/packages/integrations/vue/CHANGELOG.md index 7dba68ad0..d896d668c 100644 --- a/packages/integrations/vue/CHANGELOG.md +++ b/packages/integrations/vue/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/vue +## 1.0.1 + +### Patch Changes + +- [#4639](https://github.com/withastro/astro/pull/4639) [`f08ca005e`](https://github.com/withastro/astro/commit/f08ca005e28cc7d279535680d5b44495877aa7b6) Thanks [@matthewp](https://github.com/matthewp)! - Mark vueperslides as a default noExternal + ## 1.0.0 ### Major Changes diff --git a/packages/integrations/vue/package.json b/packages/integrations/vue/package.json index fc9e56d4f..9e4879c46 100644 --- a/packages/integrations/vue/package.json +++ b/packages/integrations/vue/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/vue", - "version": "1.0.0", + "version": "1.0.1", "description": "Use Vue components within Astro", "type": "module", "types": "./dist/index.d.ts", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a48d94cd4..546ed4114 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,7 +56,7 @@ importers: examples/basics: specifiers: - astro: ^1.1.5 + astro: ^1.1.6 dependencies: astro: link:../../packages/astro @@ -65,7 +65,7 @@ importers: '@astrojs/mdx': ^0.11.1 '@astrojs/rss': ^1.0.0 '@astrojs/sitemap': ^1.0.0 - astro: ^1.1.5 + astro: ^1.1.6 dependencies: '@astrojs/mdx': link:../../packages/integrations/mdx '@astrojs/rss': link:../../packages/astro-rss @@ -74,14 +74,14 @@ importers: examples/component: specifiers: - astro: ^1.1.5 + astro: ^1.1.6 dependencies: astro: link:../../packages/astro examples/component/demo: specifiers: '@example/my-component': workspace:* - astro: ^1.1.5 + astro: ^1.1.6 devDependencies: '@example/my-component': link:../packages/my-component astro: link:../../../packages/astro @@ -99,7 +99,7 @@ importers: '@types/node': ^18.0.0 '@types/react': ^17.0.45 '@types/react-dom': ^18.0.0 - astro: ^1.1.5 + astro: ^1.1.6 preact: ^10.7.3 react: ^18.1.0 react-dom: ^18.1.0 @@ -119,10 +119,10 @@ importers: examples/framework-alpine: specifiers: - '@astrojs/alpinejs': ^0.1.1 + '@astrojs/alpinejs': ^0.1.2 '@types/alpinejs': ^3.7.0 alpinejs: ^3.10.2 - astro: ^1.1.5 + astro: ^1.1.6 dependencies: '@astrojs/alpinejs': link:../../packages/integrations/alpinejs '@types/alpinejs': 3.7.0 @@ -133,7 +133,7 @@ importers: specifiers: '@astrojs/lit': ^1.0.0 '@webcomponents/template-shadowroot': ^0.1.0 - astro: ^1.1.5 + astro: ^1.1.6 lit: ^2.2.5 dependencies: '@astrojs/lit': link:../../packages/integrations/lit @@ -147,8 +147,8 @@ importers: '@astrojs/react': ^1.1.0 '@astrojs/solid-js': ^1.1.0 '@astrojs/svelte': ^1.0.0 - '@astrojs/vue': ^1.0.0 - astro: ^1.1.5 + '@astrojs/vue': ^1.0.1 + astro: ^1.1.6 preact: ^10.7.3 react: ^18.1.0 react-dom: ^18.1.0 @@ -172,7 +172,7 @@ importers: examples/framework-preact: specifiers: '@astrojs/preact': ^1.0.2 - astro: ^1.1.5 + astro: ^1.1.6 preact: ^10.7.3 dependencies: '@astrojs/preact': link:../../packages/integrations/preact @@ -184,7 +184,7 @@ importers: '@astrojs/react': ^1.1.0 '@types/react': ^18.0.10 '@types/react-dom': ^18.0.5 - astro: ^1.1.5 + astro: ^1.1.6 react: ^18.1.0 react-dom: ^18.1.0 dependencies: @@ -198,7 +198,7 @@ importers: examples/framework-solid: specifiers: '@astrojs/solid-js': ^1.1.0 - astro: ^1.1.5 + astro: ^1.1.6 solid-js: ^1.4.3 dependencies: '@astrojs/solid-js': link:../../packages/integrations/solid @@ -208,7 +208,7 @@ importers: examples/framework-svelte: specifiers: '@astrojs/svelte': ^1.0.0 - astro: ^1.1.5 + astro: ^1.1.6 svelte: ^3.48.0 dependencies: '@astrojs/svelte': link:../../packages/integrations/svelte @@ -217,8 +217,8 @@ importers: examples/framework-vue: specifiers: - '@astrojs/vue': ^1.0.0 - astro: ^1.1.5 + '@astrojs/vue': ^1.0.1 + astro: ^1.1.6 vue: ^3.2.37 dependencies: '@astrojs/vue': link:../../packages/integrations/vue @@ -227,19 +227,19 @@ importers: examples/minimal: specifiers: - astro: ^1.1.5 + astro: ^1.1.6 dependencies: astro: link:../../packages/astro examples/non-html-pages: specifiers: - astro: ^1.1.5 + astro: ^1.1.6 dependencies: astro: link:../../packages/astro examples/portfolio: specifiers: - astro: ^1.1.5 + astro: ^1.1.6 dependencies: astro: link:../../packages/astro @@ -247,7 +247,7 @@ importers: specifiers: '@astrojs/node': ^1.0.1 '@astrojs/svelte': ^1.0.0 - astro: ^1.1.5 + astro: ^1.1.6 concurrently: ^7.2.1 lightcookie: ^1.0.25 svelte: ^3.48.0 @@ -266,7 +266,7 @@ importers: examples/with-markdown-plugins: specifiers: '@astrojs/markdown-remark': ^1.1.0 - astro: ^1.1.5 + astro: ^1.1.6 hast-util-select: 5.0.1 rehype-autolink-headings: ^6.1.1 rehype-slug: ^5.0.1 @@ -283,7 +283,7 @@ importers: examples/with-markdown-shiki: specifiers: - astro: ^1.1.5 + astro: ^1.1.6 dependencies: astro: link:../../packages/astro @@ -291,7 +291,7 @@ importers: specifiers: '@astrojs/mdx': ^0.11.1 '@astrojs/preact': ^1.0.2 - astro: ^1.1.5 + astro: ^1.1.6 preact: ^10.6.5 dependencies: '@astrojs/mdx': link:../../packages/integrations/mdx @@ -303,7 +303,7 @@ importers: specifiers: '@astrojs/preact': ^1.0.2 '@nanostores/preact': ^0.1.3 - astro: ^1.1.5 + astro: ^1.1.6 nanostores: ^0.5.12 preact: ^10.7.3 dependencies: @@ -316,7 +316,7 @@ importers: examples/with-tailwindcss: specifiers: '@astrojs/tailwind': ^1.0.0 - astro: ^1.1.5 + astro: ^1.1.6 autoprefixer: ^10.4.7 canvas-confetti: ^1.5.1 postcss: ^8.4.14 @@ -331,7 +331,7 @@ importers: examples/with-vite-plugin-pwa: specifiers: - astro: ^1.1.5 + astro: ^1.1.6 vite-plugin-pwa: 0.11.11 workbox-window: ^6.5.3 dependencies: @@ -341,7 +341,7 @@ importers: examples/with-vitest: specifiers: - astro: ^1.1.5 + astro: ^1.1.6 vitest: ^0.20.3 dependencies: astro: link:../../packages/astro @@ -972,14 +972,6 @@ importers: '@astrojs/tailwind': link:../../../../integrations/tailwind astro: link:../../.. - packages/astro/e2e/fixtures/third-party-astro: - specifiers: - astro: workspace:* - astro-embed: ^0.1.1 - dependencies: - astro: link:../../.. - astro-embed: 0.1.1_astro@packages+astro - packages/astro/e2e/fixtures/ts-resolution: specifiers: '@astrojs/react': workspace:* From d693e365ca1b281b227b54485fd672e2107bec72 Mon Sep 17 00:00:00 2001 From: Tibor Schiemann <6137925+hippotastic@users.noreply.github.com> Date: Wed, 7 Sep 2022 12:08:58 +0200 Subject: [PATCH 02/18] Integrations: Fix NPM instructions to use `npx astro add` again (#4653) * Fix install instructions to use `npx astro` again * Replace joyful hiccups with regular issues :) --- packages/integrations/alpinejs/README.md | 6 ++++-- packages/integrations/image/README.md | 8 ++++---- packages/integrations/lit/README.md | 6 ++++-- packages/integrations/mdx/README.md | 6 +++--- packages/integrations/partytown/README.md | 8 ++++---- packages/integrations/preact/README.md | 6 +++--- packages/integrations/prefetch/README.md | 8 ++++---- packages/integrations/react/README.md | 6 ++++-- packages/integrations/sitemap/README.md | 8 ++++---- packages/integrations/solid/README.md | 6 ++++-- packages/integrations/svelte/README.md | 6 ++++-- packages/integrations/tailwind/README.md | 8 ++++---- packages/integrations/turbolinks/README.md | 6 ++++-- packages/integrations/vue/README.md | 6 ++++-- 14 files changed, 54 insertions(+), 40 deletions(-) diff --git a/packages/integrations/alpinejs/README.md b/packages/integrations/alpinejs/README.md index 3d43b3e25..9eaf45382 100644 --- a/packages/integrations/alpinejs/README.md +++ b/packages/integrations/alpinejs/README.md @@ -18,14 +18,16 @@ The `astro add` command-line tool automates the installation for you. Run one of ```sh # Using NPM -npm run astro add alpinejs +npx astro add alpinejs # Using Yarn yarn astro add alpinejs # Using PNPM pnpm astro add alpinejs ``` -Finally, in the terminal window running Astro, press `CTRL+C` and then type `npm run astro dev` to restart the dev server. +Finally, in the terminal window running Astro, press `CTRL+C` and then restart the dev server. + +If you run into any issues, [feel free to report them to us on GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. ### Manual Install diff --git a/packages/integrations/image/README.md b/packages/integrations/image/README.md index 394db59de..2ecc81364 100644 --- a/packages/integrations/image/README.md +++ b/packages/integrations/image/README.md @@ -29,16 +29,16 @@ The `astro add` command-line tool automates the installation for you. Run one of ```sh # Using NPM -npm run astro add image +npx astro add image # Using Yarn yarn astro add image # Using PNPM pnpm astro add image ``` -Then, restart the dev server by typing `CTRL-C` and then `npm run astro dev` in the terminal window that was running Astro. - -Because this command is new, it might not properly set things up. If that happens, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. +Finally, in the terminal window running Astro, press `CTRL+C` and then restart the dev server. + +If you run into any issues, [feel free to report them to us on GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. ### Manual Install diff --git a/packages/integrations/lit/README.md b/packages/integrations/lit/README.md index 50b9c34fc..97b836bc0 100644 --- a/packages/integrations/lit/README.md +++ b/packages/integrations/lit/README.md @@ -16,14 +16,16 @@ To install `@astrojs/lit`, run the following from your project directory and fol ```sh # Using NPM -npm run astro add lit +npx astro add lit # Using Yarn yarn astro add lit # Using PNPM pnpm astro add lit ``` -If you run into any hiccups, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. +Finally, in the terminal window running Astro, press `CTRL+C` and then restart the dev server. + +If you run into any issues, [feel free to report them to us on GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. ### Install dependencies manually diff --git a/packages/integrations/mdx/README.md b/packages/integrations/mdx/README.md index e559223d5..2ce12d9cd 100644 --- a/packages/integrations/mdx/README.md +++ b/packages/integrations/mdx/README.md @@ -26,16 +26,16 @@ The `astro add` command-line tool automates the installation for you. Run one of ```sh # Using NPM -npm run astro add mdx +npx astro add mdx # Using Yarn yarn astro add mdx # Using PNPM pnpm astro add mdx ``` -Then, restart the dev server by typing `CTRL-C` and then `npm run astro dev` in the terminal window that was running Astro. +Finally, in the terminal window running Astro, press `CTRL+C` and then restart the dev server. -Because this command is new, it might not properly set things up. If that happens, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. +If you run into any issues, [feel free to report them to us on GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. ### Manual Install diff --git a/packages/integrations/partytown/README.md b/packages/integrations/partytown/README.md index b89538bd9..6ff8dd200 100644 --- a/packages/integrations/partytown/README.md +++ b/packages/integrations/partytown/README.md @@ -28,16 +28,16 @@ The `astro add` command-line tool automates the installation for you. Run one of ```sh # Using NPM -npm run astro add partytown +npx astro add partytown # Using Yarn yarn astro add partytown # Using PNPM pnpm astro add partytown ``` -Then, restart the dev server by typing `CTRL-C` and then `npm run astro dev` in the terminal window that was running Astro. - -Because this command is new, it might not properly set things up. If that happens, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. +Finally, in the terminal window running Astro, press `CTRL+C` and then restart the dev server. + +If you run into any issues, [feel free to report them to us on GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. ### Manual Install diff --git a/packages/integrations/preact/README.md b/packages/integrations/preact/README.md index bca45007d..2a8779737 100644 --- a/packages/integrations/preact/README.md +++ b/packages/integrations/preact/README.md @@ -28,16 +28,16 @@ The `astro add` command-line tool automates the installation for you. Run one of ```sh # Using NPM -npm run astro add preact +npx astro add preact # Using Yarn yarn astro add preact # Using PNPM pnpm astro add preact ``` -Then, restart the dev server by typing `CTRL-C` and then `npm run astro dev` in the terminal window that was running Astro. +Finally, in the terminal window running Astro, press `CTRL+C` and then restart the dev server. -Because this command is new, it might not properly set things up. If that happens, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. +If you run into any issues, [feel free to report them to us on GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. ### Manual Install diff --git a/packages/integrations/prefetch/README.md b/packages/integrations/prefetch/README.md index c1299cf5a..e3ae6e72a 100644 --- a/packages/integrations/prefetch/README.md +++ b/packages/integrations/prefetch/README.md @@ -22,16 +22,16 @@ The `astro add` command-line tool automates the installation for you. Run one of ```sh # Using NPM -npm run astro add prefetch +npx astro add prefetch # Using Yarn yarn astro add prefetch # Using PNPM pnpm astro add prefetch ``` -Then, restart the dev server by typing `CTRL-C` and then `npm run astro dev` in the terminal window that was running Astro. - -Because this command is new, it might not properly set things up. If that happens, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. +Finally, in the terminal window running Astro, press `CTRL+C` and then restart the dev server. + +If you run into any issues, [feel free to report them to us on GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. ### Manual Install diff --git a/packages/integrations/react/README.md b/packages/integrations/react/README.md index cda193b9f..1e502b6c0 100644 --- a/packages/integrations/react/README.md +++ b/packages/integrations/react/README.md @@ -16,14 +16,16 @@ To install `@astrojs/react`, run the following from your project directory and f ```sh # Using NPM -npm run astro add react +npx astro add react # Using Yarn yarn astro add react # Using PNPM pnpm astro add react ``` -If you run into any hiccups, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. +Finally, in the terminal window running Astro, press `CTRL+C` and then restart the dev server. + +If you run into any issues, [feel free to report them to us on GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. ### Install dependencies manually diff --git a/packages/integrations/sitemap/README.md b/packages/integrations/sitemap/README.md index 8482225a3..58a3cc1d6 100644 --- a/packages/integrations/sitemap/README.md +++ b/packages/integrations/sitemap/README.md @@ -28,16 +28,16 @@ The `astro add` command-line tool automates the installation for you. Run one of ```sh # Using NPM -npm run astro add sitemap +npx astro add sitemap # Using Yarn yarn astro add sitemap # Using PNPM pnpm astro add sitemap ``` -Then, restart the dev server by typing `CTRL-C` and then `npm run astro dev` in the terminal window that was running Astro. - -Because this command is new, it might not properly set things up. If that happens, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. +Finally, in the terminal window running Astro, press `CTRL+C` and then restart the dev server. + +If you run into any issues, [feel free to report them to us on GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. ### Manual Install diff --git a/packages/integrations/solid/README.md b/packages/integrations/solid/README.md index fb700117c..5afe62c11 100644 --- a/packages/integrations/solid/README.md +++ b/packages/integrations/solid/README.md @@ -16,14 +16,16 @@ To install `@astrojs/solid-js`, run the following from your project directory an ```sh # Using NPM -npm run astro add solid +npx astro add solid # Using Yarn yarn astro add solid # Using PNPM pnpm astro add solid ``` -If you run into any hiccups, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. +Finally, in the terminal window running Astro, press `CTRL+C` and then restart the dev server. + +If you run into any issues, [feel free to report them to us on GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. ### Install dependencies manually diff --git a/packages/integrations/svelte/README.md b/packages/integrations/svelte/README.md index 0bc5ebdd1..8acd41a6f 100644 --- a/packages/integrations/svelte/README.md +++ b/packages/integrations/svelte/README.md @@ -16,14 +16,16 @@ To install `@astrojs/svelte`, run the following from your project directory and ```sh # Using NPM -npm run astro add svelte +npx astro add svelte # Using Yarn yarn astro add svelte # Using PNPM pnpm astro add svelte ``` -If you run into any hiccups, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. +Finally, in the terminal window running Astro, press `CTRL+C` and then restart the dev server. + +If you run into any issues, [feel free to report them to us on GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. ### Install dependencies manually diff --git a/packages/integrations/tailwind/README.md b/packages/integrations/tailwind/README.md index fb6a5ec76..df1002038 100644 --- a/packages/integrations/tailwind/README.md +++ b/packages/integrations/tailwind/README.md @@ -31,16 +31,16 @@ The `astro add` command-line tool automates the installation for you. Run one of ```sh # Using NPM -npm run astro add tailwind +npx astro add tailwind # Using Yarn yarn astro add tailwind # Using PNPM pnpm astro add tailwind ``` -Then, restart the dev server by typing `CTRL-C` and then `npm run astro dev` in the terminal window that was running Astro. - -Because this command is new, it might not properly set things up. If that happens, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. +Finally, in the terminal window running Astro, press `CTRL+C` and then restart the dev server. + +If you run into any issues, [feel free to report them to us on GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. ### Manual Install diff --git a/packages/integrations/turbolinks/README.md b/packages/integrations/turbolinks/README.md index 8c14dd2f6..15ece4721 100644 --- a/packages/integrations/turbolinks/README.md +++ b/packages/integrations/turbolinks/README.md @@ -26,14 +26,16 @@ To install `@astrojs/turbolinks`, run the following from your project directory ```sh # Using NPM -npm run astro add turbolinks +npx astro add turbolinks # Using Yarn yarn astro add turbolinks # Using PNPM pnpm astro add turbolinks ``` -If you run into any hiccups, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. +Finally, in the terminal window running Astro, press `CTRL+C` and then restart the dev server. + +If you run into any issues, [feel free to report them to us on GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. ### Install dependencies manually diff --git a/packages/integrations/vue/README.md b/packages/integrations/vue/README.md index c5fa4a536..66b320629 100644 --- a/packages/integrations/vue/README.md +++ b/packages/integrations/vue/README.md @@ -16,14 +16,16 @@ To install `@astrojs/vue`, run the following from your project directory and fol ```sh # Using NPM -npm run astro add vue +npx astro add vue # Using Yarn yarn astro add vue # Using PNPM pnpm astro add vue ``` -If you run into any hiccups, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. +Finally, in the terminal window running Astro, press `CTRL+C` and then restart the dev server. + +If you run into any issues, [feel free to report them to us on GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. ### Install dependencies manually From 6d845c353d5688f30787c4361f86c605fb638dd9 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Wed, 7 Sep 2022 08:29:54 -0400 Subject: [PATCH 03/18] Upgrade minimum compiler version (#4656) * Upgrade minimum compiler version * Add changeset * Update lockfile --- .changeset/nice-cameras-hug.md | 5 +++++ packages/astro/package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 3 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 .changeset/nice-cameras-hug.md diff --git a/.changeset/nice-cameras-hug.md b/.changeset/nice-cameras-hug.md new file mode 100644 index 000000000..11d4cecd1 --- /dev/null +++ b/.changeset/nice-cameras-hug.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix bug with using `assert` as import identifier diff --git a/packages/astro/package.json b/packages/astro/package.json index c42b8c9e9..ae085735e 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -94,7 +94,7 @@ "test:e2e:match": "playwright test -g" }, "dependencies": { - "@astrojs/compiler": "^0.23.4", + "@astrojs/compiler": "^0.23.5", "@astrojs/language-server": "^0.23.0", "@astrojs/markdown-remark": "^1.1.1", "@astrojs/telemetry": "^1.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 546ed4114..2f4c35903 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -349,7 +349,7 @@ importers: packages/astro: specifiers: - '@astrojs/compiler': ^0.23.4 + '@astrojs/compiler': ^0.23.5 '@astrojs/language-server': ^0.23.0 '@astrojs/markdown-remark': ^1.1.1 '@astrojs/telemetry': ^1.0.0 @@ -432,7 +432,7 @@ importers: yargs-parser: ^21.0.1 zod: ^3.17.3 dependencies: - '@astrojs/compiler': 0.23.4 + '@astrojs/compiler': 0.23.5 '@astrojs/language-server': 0.23.3 '@astrojs/markdown-remark': link:../markdown/remark '@astrojs/telemetry': link:../telemetry @@ -3219,8 +3219,8 @@ packages: resolution: {integrity: sha512-8nvyxZTfCXLyRmYfTttpJT6EPhfBRg0/q4J/Jj3/pNPLzp+vs05ZdktsY6QxAREaOMAnNEtSqcrB4S5DsXOfRg==} dev: true - /@astrojs/compiler/0.23.4: - resolution: {integrity: sha512-vNZIa5Tf5nOqBEGJvM6xyYBnGcz4MAp+bBPnyVI0UYRjsIWlP7RgMdCpRV0OOh5kgh00BoAypGv27kcoJCMVfA==} + /@astrojs/compiler/0.23.5: + resolution: {integrity: sha512-vBMPy9ok4iLapSyCCT1qsZ9dK7LkVFl9mObtLEmWiec9myGHS9h2kQY2xzPeFNJiWXUf9O6tSyQpQTy5As/p3g==} dev: false /@astrojs/language-server/0.23.3: @@ -15152,7 +15152,7 @@ packages: resolution: {integrity: sha512-g4uJ/7k1rJeIWBifeBgTqzgV5gmMTG+lOmOvUZvtIh1R91aqa+yYMzbysIlsJKRaRyWefejrOpvpIuEePBDAyw==} engines: {node: ^14.15.0 || >=16.0.0, npm: '>=6.14.0'} dependencies: - '@astrojs/compiler': 0.23.4 + '@astrojs/compiler': 0.23.5 prettier: 2.7.1 sass-formatter: 0.7.5 synckit: 0.7.3 From db70afdcd5b7d6b39c9953e88dbdadc5e3a93175 Mon Sep 17 00:00:00 2001 From: Tony Sullivan Date: Wed, 7 Sep 2022 13:56:07 +0000 Subject: [PATCH 04/18] [@astrojs/image] Fixes a regression in remote image filenames (#4649) * fixes a bug in filename creation for remote images without a file extension * chore: add changeset --- .changeset/swift-wolves-argue.md | 5 +++ .../integrations/image/components/Image.astro | 2 +- .../integrations/image/src/lib/get-picture.ts | 2 +- .../integrations/image/src/utils/paths.ts | 7 ++-- .../basic-image/src/pages/index.astro | 2 ++ .../basic-picture/src/pages/index.astro | 4 ++- .../integrations/image/test/image-ssg.test.js | 33 +++++++++++++++++++ .../image/test/image-ssr-build.test.js | 20 +++++++++++ .../image/test/image-ssr-dev.test.js | 22 +++++++++++++ .../image/test/picture-ssg.test.js | 14 ++++++++ .../image/test/picture-ssr-build.test.js | 22 +++++++++++++ .../image/test/picture-ssr-dev.test.js | 26 +++++++++++++++ 12 files changed, 153 insertions(+), 6 deletions(-) create mode 100644 .changeset/swift-wolves-argue.md diff --git a/.changeset/swift-wolves-argue.md b/.changeset/swift-wolves-argue.md new file mode 100644 index 000000000..af8bff1fb --- /dev/null +++ b/.changeset/swift-wolves-argue.md @@ -0,0 +1,5 @@ +--- +'@astrojs/image': patch +--- + +Fixes a bug related to filenames for remote images in SSG builds diff --git a/packages/integrations/image/components/Image.astro b/packages/integrations/image/components/Image.astro index 1777fffab..578db702d 100644 --- a/packages/integrations/image/components/Image.astro +++ b/packages/integrations/image/components/Image.astro @@ -17,7 +17,7 @@ interface RemoteImageProps extends TransformOptions, astroHTML.JSX.ImgHTMLAttrib src: string; /** Defines an alternative text description of the image. Set to an empty string (alt="") if the image is not a key part of the content (it's decoration or a tracking pixel). */ alt: string; - format: OutputFormat; + format?: OutputFormat; width: number; height: number; } diff --git a/packages/integrations/image/src/lib/get-picture.ts b/packages/integrations/image/src/lib/get-picture.ts index 652afb49d..6895891f0 100644 --- a/packages/integrations/image/src/lib/get-picture.ts +++ b/packages/integrations/image/src/lib/get-picture.ts @@ -36,7 +36,7 @@ async function resolveFormats({ src, formats }: GetPictureParams) { unique.add(extname(metadata.src).replace('.', '') as OutputFormat); } - return [...unique]; + return Array.from(unique).filter(Boolean); } export async function getPicture(params: GetPictureParams): Promise { diff --git a/packages/integrations/image/src/utils/paths.ts b/packages/integrations/image/src/utils/paths.ts index cf62ba0cf..2f4109062 100644 --- a/packages/integrations/image/src/utils/paths.ts +++ b/packages/integrations/image/src/utils/paths.ts @@ -14,7 +14,7 @@ function extname(src: string, format?: OutputFormat) { const index = src.lastIndexOf('.'); if (index <= 0) { - return undefined; + return ''; } return src.substring(index); @@ -38,11 +38,12 @@ export function propsToFilename(transform: TransformOptions) { // strip off the querystring first, then remove the file extension let filename = removeQueryString(transform.src); filename = basename(filename); + const ext = extname(filename); filename = removeExtname(filename); - const ext = transform.format || extname(transform.src)?.substring(1); + const outputExt = transform.format ? `.${transform.format}` : ext - return `/${filename}_${shorthash(JSON.stringify(transform))}.${ext}`; + return `/${filename}_${shorthash(JSON.stringify(transform))}${outputExt}`; } export function appendForwardSlash(path: string) { diff --git a/packages/integrations/image/test/fixtures/basic-image/src/pages/index.astro b/packages/integrations/image/test/fixtures/basic-image/src/pages/index.astro index 6b203591b..02d33b1c8 100644 --- a/packages/integrations/image/test/fixtures/basic-image/src/pages/index.astro +++ b/packages/integrations/image/test/fixtures/basic-image/src/pages/index.astro @@ -20,5 +20,7 @@ import { Image } from '@astrojs/image/components'; inline
query +
+ ipsum diff --git a/packages/integrations/image/test/fixtures/basic-picture/src/pages/index.astro b/packages/integrations/image/test/fixtures/basic-picture/src/pages/index.astro index 68db37012..0ab9d211d 100644 --- a/packages/integrations/image/test/fixtures/basic-picture/src/pages/index.astro +++ b/packages/integrations/image/test/fixtures/basic-picture/src/pages/index.astro @@ -12,8 +12,10 @@ import { Picture } from '@astrojs/image/components';

- +
+
+ diff --git a/packages/integrations/image/test/image-ssg.test.js b/packages/integrations/image/test/image-ssg.test.js index 04d62125d..386dc9b07 100644 --- a/packages/integrations/image/test/image-ssg.test.js +++ b/packages/integrations/image/test/image-ssg.test.js @@ -50,6 +50,16 @@ describe('SSG images - dev', function () { href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png', }, }, + { + title: 'Remote without file extension', + id: '#ipsum', + url: '/_image', + query: { + w: '200', + h: '300', + href: 'https://picsum.photos/200/300' + } + }, { title: 'Public images', id: '#hero', @@ -120,6 +130,17 @@ describe('SSG images with subpath - dev', function () { href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png', }, }, + + { + title: 'Remote without file extension', + id: '#ipsum', + url: '/_image', + query: { + w: '200', + h: '300', + href: 'https://picsum.photos/200/300' + } + }, { title: 'Public images', id: '#hero', @@ -189,6 +210,12 @@ describe('SSG images - build', function () { regex: /^\/googlelogo_color_272x92dp_\w{4,10}.webp/, size: { width: 544, height: 184, type: 'webp' }, }, + { + title: 'Remote without file extension', + id: '#ipsum', + regex: /^\/300_\w{4,10}/, + size: { width: 200, height: 300, type: 'jpg' }, + }, { title: 'Public images', id: '#hero', @@ -253,6 +280,12 @@ describe('SSG images with subpath - build', function () { regex: /^\/docs\/googlelogo_color_272x92dp_\w{4,10}.webp/, size: { width: 544, height: 184, type: 'webp' }, }, + { + title: 'Remote without file extension', + id: '#ipsum', + regex: /^\/docs\/300_\w{4,10}/, + size: { width: 200, height: 300, type: 'jpg' }, + }, { title: 'Public images', id: '#hero', diff --git a/packages/integrations/image/test/image-ssr-build.test.js b/packages/integrations/image/test/image-ssr-build.test.js index d3b05a44b..8a0f2529f 100644 --- a/packages/integrations/image/test/image-ssr-build.test.js +++ b/packages/integrations/image/test/image-ssr-build.test.js @@ -45,6 +45,16 @@ describe('SSR images - build', async function () { href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png', }, }, + { + title: 'Remote without file extension', + id: '#ipsum', + url: '/_image', + query: { + w: '200', + h: '300', + href: 'https://picsum.photos/200/300', + }, + }, { title: 'Remote images with search', id: '#query', @@ -139,6 +149,16 @@ describe('SSR images with subpath - build', function () { href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png', }, }, + { + title: 'Remote without file extension', + id: '#ipsum', + url: '/_image', + query: { + w: '200', + h: '300', + href: 'https://picsum.photos/200/300', + }, + }, { title: 'Remote images with search', id: '#query', diff --git a/packages/integrations/image/test/image-ssr-dev.test.js b/packages/integrations/image/test/image-ssr-dev.test.js index a280268d0..2251bf071 100644 --- a/packages/integrations/image/test/image-ssr-dev.test.js +++ b/packages/integrations/image/test/image-ssr-dev.test.js @@ -58,6 +58,17 @@ describe('SSR images - dev', function () { }, contentType: 'image/webp', }, + { + title: 'Remote wihtout file extension', + id: '#ipsum', + url: '/_image', + query: { + w: '200', + h: '300', + href: 'https://picsum.photos/200/300', + }, + contentType: 'image/jpeg', + }, { title: 'Public images', id: '#hero', @@ -149,6 +160,17 @@ describe('SSR images with subpath - dev', function () { }, contentType: 'image/webp', }, + { + title: 'Remote wihtout file extension', + id: '#ipsum', + url: '/_image', + query: { + w: '200', + h: '300', + href: 'https://picsum.photos/200/300', + }, + contentType: 'image/jpeg', + }, { title: 'Public images', id: '#hero', diff --git a/packages/integrations/image/test/picture-ssg.test.js b/packages/integrations/image/test/picture-ssg.test.js index 2a7f86c21..5ecf08800 100644 --- a/packages/integrations/image/test/picture-ssg.test.js +++ b/packages/integrations/image/test/picture-ssg.test.js @@ -200,6 +200,13 @@ describe('SSG pictures - build', function () { size: { width: 544, height: 184, type: 'png' }, alt: 'Google logo', }, + { + title: 'Remote without file extension', + id: '#ipsum', + regex: /^\/300_\w{4,10}/, + size: { width: 200, height: 300, type: 'jpg' }, + alt: 'ipsum', + }, { title: 'Public images', id: '#hero', @@ -288,6 +295,13 @@ describe('SSG pictures with subpath - build', function () { size: { width: 544, height: 184, type: 'png' }, alt: 'Google logo', }, + { + title: 'Remote without file extension', + id: '#ipsum', + regex: /^\/docs\/300_\w{4,10}/, + size: { width: 200, height: 300, type: 'jpg' }, + alt: 'ipsum', + }, { title: 'Public images', id: '#hero', diff --git a/packages/integrations/image/test/picture-ssr-build.test.js b/packages/integrations/image/test/picture-ssr-build.test.js index 15e884aad..ff6c8440e 100644 --- a/packages/integrations/image/test/picture-ssr-build.test.js +++ b/packages/integrations/image/test/picture-ssr-build.test.js @@ -42,6 +42,17 @@ describe('SSR pictures - build', function () { }, alt: 'Google logo', }, + { + title: 'Remote without file extension', + id: '#ipsum', + url: '/_image', + query: { + w: '200', + h: '300', + href: 'https://picsum.photos/200/300', + }, + alt: 'ipsum', + }, { title: 'Public images', id: '#hero', @@ -122,6 +133,17 @@ describe('SSR pictures with subpath - build', function () { }, alt: 'Google logo', }, + { + title: 'Remote without file extension', + id: '#ipsum', + url: '/_image', + query: { + w: '200', + h: '300', + href: 'https://picsum.photos/200/300', + }, + alt: 'ipsum', + }, { title: 'Public images', id: '#hero', diff --git a/packages/integrations/image/test/picture-ssr-dev.test.js b/packages/integrations/image/test/picture-ssr-dev.test.js index ac1d3e638..fa465384d 100644 --- a/packages/integrations/image/test/picture-ssr-dev.test.js +++ b/packages/integrations/image/test/picture-ssr-dev.test.js @@ -54,6 +54,19 @@ describe('SSR pictures - dev', function () { contentType: 'image/png', alt: 'Google logo', }, + { + title: 'Remote without file extension', + id: '#ipsum', + url: '/_image', + query: { + f: 'jpg', + w: '200', + h: '300', + href: 'https://picsum.photos/200/300', + }, + contentType: 'image/jpeg', + alt: 'ipsum', + }, { title: 'Public images', id: '#hero', @@ -148,6 +161,19 @@ describe('SSR pictures with subpath - dev', function () { contentType: 'image/png', alt: 'Google logo', }, + { + title: 'Remote without file extension', + id: '#ipsum', + url: '/_image', + query: { + f: 'jpg', + w: '200', + h: '300', + href: 'https://picsum.photos/200/300', + }, + contentType: 'image/jpeg', + alt: 'ipsum', + },, { title: 'Public images', id: '#hero', From c080438b89beb0084f3fbfe99cf588a51cd721d9 Mon Sep 17 00:00:00 2001 From: tony-sull Date: Wed, 7 Sep 2022 13:57:52 +0000 Subject: [PATCH 05/18] [ci] format --- packages/integrations/image/src/utils/paths.ts | 2 +- packages/integrations/image/test/image-ssg.test.js | 8 ++++---- packages/integrations/image/test/picture-ssr-dev.test.js | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/integrations/image/src/utils/paths.ts b/packages/integrations/image/src/utils/paths.ts index 2f4109062..1f691f35a 100644 --- a/packages/integrations/image/src/utils/paths.ts +++ b/packages/integrations/image/src/utils/paths.ts @@ -41,7 +41,7 @@ export function propsToFilename(transform: TransformOptions) { const ext = extname(filename); filename = removeExtname(filename); - const outputExt = transform.format ? `.${transform.format}` : ext + const outputExt = transform.format ? `.${transform.format}` : ext; return `/${filename}_${shorthash(JSON.stringify(transform))}${outputExt}`; } diff --git a/packages/integrations/image/test/image-ssg.test.js b/packages/integrations/image/test/image-ssg.test.js index 386dc9b07..104624925 100644 --- a/packages/integrations/image/test/image-ssg.test.js +++ b/packages/integrations/image/test/image-ssg.test.js @@ -57,8 +57,8 @@ describe('SSG images - dev', function () { query: { w: '200', h: '300', - href: 'https://picsum.photos/200/300' - } + href: 'https://picsum.photos/200/300', + }, }, { title: 'Public images', @@ -138,8 +138,8 @@ describe('SSG images with subpath - dev', function () { query: { w: '200', h: '300', - href: 'https://picsum.photos/200/300' - } + href: 'https://picsum.photos/200/300', + }, }, { title: 'Public images', diff --git a/packages/integrations/image/test/picture-ssr-dev.test.js b/packages/integrations/image/test/picture-ssr-dev.test.js index fa465384d..e7e57628e 100644 --- a/packages/integrations/image/test/picture-ssr-dev.test.js +++ b/packages/integrations/image/test/picture-ssr-dev.test.js @@ -173,7 +173,8 @@ describe('SSR pictures with subpath - dev', function () { }, contentType: 'image/jpeg', alt: 'ipsum', - },, + }, + , { title: 'Public images', id: '#hero', From 6ca0c5839fba22c931a2ce92e282d4e5396ba510 Mon Sep 17 00:00:00 2001 From: "Fred K. Bot" <108291165+fredkbot@users.noreply.github.com> Date: Wed, 7 Sep 2022 09:23:53 -0700 Subject: [PATCH 06/18] [ci] update lockfile (#4655) Co-authored-by: FredKSchott --- pnpm-lock.yaml | 241 ++++++++++++++++++++++++------------------------- 1 file changed, 120 insertions(+), 121 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2f4c35903..2c7935ffe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -108,9 +108,9 @@ importers: '@astrojs/preact': link:../../packages/integrations/preact '@astrojs/react': link:../../packages/integrations/react '@docsearch/css': 3.2.1 - '@docsearch/react': 3.2.1_h2q7ltx4sqgye5xvrbnj7n2sfm + '@docsearch/react': 3.2.1_kdydlnxq43jbqimy6lw2whzu34 '@types/node': 18.7.15 - '@types/react': 17.0.48 + '@types/react': 17.0.49 '@types/react-dom': 18.0.6 astro: link:../../packages/astro preact: 10.10.6 @@ -189,7 +189,7 @@ importers: react-dom: ^18.1.0 dependencies: '@astrojs/react': link:../../packages/integrations/react - '@types/react': 18.0.17 + '@types/react': 18.0.18 '@types/react-dom': 18.0.6 astro: link:../../packages/astro react: 18.2.0 @@ -257,7 +257,7 @@ importers: '@astrojs/node': link:../../packages/integrations/node '@astrojs/svelte': link:../../packages/integrations/svelte astro: link:../../packages/astro - concurrently: 7.3.0 + concurrently: 7.4.0 lightcookie: 1.0.25 svelte: 3.50.0 unocss: 0.15.6 @@ -483,11 +483,11 @@ importers: tsconfig-resolver: 3.0.1 unist-util-visit: 4.1.1 vfile: 5.3.4 - vite: 3.0.9_sass@1.54.6 + vite: 3.0.9_sass@1.54.8 yargs-parser: 21.1.1 zod: 3.19.0 devDependencies: - '@playwright/test': 1.25.1 + '@playwright/test': 1.25.2 '@types/babel__core': 7.1.19 '@types/babel__generator': 7.6.4 '@types/babel__traverse': 7.18.1 @@ -513,7 +513,7 @@ importers: chai: 4.3.6 cheerio: 1.0.0-rc.12 mocha: 9.2.2 - sass: 1.54.6 + sass: 1.54.8 srcset-parse: 1.1.0 packages/astro-prism: @@ -605,7 +605,7 @@ importers: sass: ^1.52.2 dependencies: astro: link:../../.. - sass: 1.54.6 + sass: 1.54.8 packages/astro/e2e/fixtures/errors: specifiers: @@ -1696,7 +1696,7 @@ importers: autoprefixer: 10.4.8_postcss@8.4.16 postcss: 8.4.16 devDependencies: - postcss-preset-env: 7.8.0_postcss@8.4.16 + postcss-preset-env: 7.8.1_postcss@8.4.16 packages/astro/test/fixtures/preact-compat-component: specifiers: @@ -2143,7 +2143,7 @@ importers: devDependencies: astro: link:../../astro astro-scripts: link:../../../scripts - wrangler: 2.0.28 + wrangler: 2.0.29 packages/integrations/cloudflare/test/fixtures/basics: specifiers: @@ -2294,7 +2294,7 @@ importers: astro: link:../../astro astro-scripts: link:../../../scripts cheerio: 1.0.0-rc.12 - sass: 1.54.6 + sass: 1.54.8 packages/integrations/mdx: specifiers: @@ -2493,7 +2493,7 @@ importers: '@babel/core': 7.19.0 '@babel/plugin-transform-react-jsx': 7.19.0_@babel+core@7.19.0 babel-plugin-module-resolver: 4.1.0 - preact-render-to-string: 5.2.2_preact@10.10.6 + preact-render-to-string: 5.2.3_preact@10.10.6 devDependencies: astro: link:../../astro astro-scripts: link:../../../scripts @@ -2516,7 +2516,7 @@ importers: '@types/mocha': 9.1.1 astro: link:../../astro astro-scripts: link:../../../scripts - playwright: 1.25.1 + playwright: 1.25.2 packages/integrations/prefetch/test/fixtures/basic-prefetch: specifiers: @@ -2540,7 +2540,7 @@ importers: '@babel/core': 7.19.0 '@babel/plugin-transform-react-jsx': 7.19.0_@babel+core@7.19.0 devDependencies: - '@types/react': 17.0.48 + '@types/react': 17.0.49 '@types/react-dom': 17.0.17 astro: link:../../astro astro-scripts: link:../../../scripts @@ -2895,10 +2895,10 @@ importers: dependencies: node-fetch: 3.2.10 devDependencies: - '@rollup/plugin-alias': 3.1.9_rollup@2.78.1 - '@rollup/plugin-inject': 4.0.4_rollup@2.78.1 - '@rollup/plugin-node-resolve': 13.3.0_rollup@2.78.1 - '@rollup/plugin-typescript': 8.5.0_5zsqiitiqqdgwm4iemtywlnhku + '@rollup/plugin-alias': 3.1.9_rollup@2.79.0 + '@rollup/plugin-inject': 4.0.4_rollup@2.79.0 + '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.0 + '@rollup/plugin-typescript': 8.5.0_ppxule2mhlgb6ds3e4gxjflaqy '@types/chai': 4.3.3 '@types/mocha': 9.1.1 '@types/node': 14.18.27 @@ -2910,8 +2910,8 @@ importers: formdata-polyfill: 4.0.10 magic-string: 0.25.9 mocha: 9.2.2 - rollup: 2.78.1 - rollup-plugin-terser: 7.0.2_rollup@2.78.1 + rollup: 2.79.0 + rollup-plugin-terser: 7.0.2_rollup@2.79.0 tslib: 2.4.0 typescript: 4.7.4 urlpattern-polyfill: 1.0.0-rc5 @@ -3229,14 +3229,14 @@ packages: dependencies: '@vscode/emmet-helper': 2.8.4 prettier: 2.7.1 - prettier-plugin-astro: 0.5.3 + prettier-plugin-astro: 0.5.4 source-map: 0.7.4 typescript: 4.6.4 vscode-css-languageservice: 6.1.0 vscode-html-languageservice: 5.0.1 vscode-languageserver: 8.0.2 vscode-languageserver-protocol: 3.17.2 - vscode-languageserver-textdocument: 1.0.5 + vscode-languageserver-textdocument: 1.0.7 vscode-languageserver-types: 3.17.2 vscode-uri: 3.0.3 dev: false @@ -4864,8 +4864,8 @@ packages: mime: 3.0.0 dev: true - /@csstools/postcss-cascade-layers/1.0.5_postcss@8.4.16: - resolution: {integrity: sha512-Id/9wBT7FkgFzdEpiEWrsVd4ltDxN0rI0QS0SChbeQiSuux3z21SJCRLu6h2cvCEUmaRi+VD0mHFj+GJD4GFnw==} + /@csstools/postcss-cascade-layers/1.0.6_postcss@8.4.16: + resolution: {integrity: sha512-ei4Vh4AJwTCXTNj7uzwduoZDO7nLPksQ0TI7OzUlyFq4P4Uhu6hU7R4AlLimDP/s6D3PQdHmRL4f7UOy370UHA==} engines: {node: ^12 || ^14 || >=16} peerDependencies: postcss: ^8.2 @@ -5023,7 +5023,7 @@ packages: resolution: {integrity: sha512-gaP6TxxwQC+K8D6TRx5WULUWKrcbzECOPA2KCVMuI+6C7dNiGUk5yXXzVhc5sld79XKYLnO9DRTI4mjXDYkh+g==} dev: false - /@docsearch/react/3.2.1_h2q7ltx4sqgye5xvrbnj7n2sfm: + /@docsearch/react/3.2.1_kdydlnxq43jbqimy6lw2whzu34: resolution: {integrity: sha512-EzTQ/y82s14IQC5XVestiK/kFFMe2aagoYFuTAIfIb/e+4FU7kSMKonRtLwsCiLQHmjvNQq+HO+33giJ5YVtaQ==} peerDependencies: '@types/react': '>= 16.8.0 < 19.0.0' @@ -5040,7 +5040,7 @@ packages: '@algolia/autocomplete-core': 1.7.1 '@algolia/autocomplete-preset-algolia': 1.7.1_qs6lk5nhygj2o3hj4sf6xnr724 '@docsearch/css': 3.2.1 - '@types/react': 17.0.48 + '@types/react': 17.0.49 algoliasearch: 4.14.2 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 @@ -5323,8 +5323,8 @@ packages: read-yaml-file: 1.1.0 dev: true - /@mapbox/node-pre-gyp/1.0.9: - resolution: {integrity: sha512-aDF3S3rK9Q2gey/WAttUlISduDItz5BU3306M9Eyv6/oS40aMprnopshtlKTykxRNIBEZuRMaZAnbrQ4QtKGyw==} + /@mapbox/node-pre-gyp/1.0.10: + resolution: {integrity: sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==} hasBin: true dependencies: detect-libc: 2.0.1 @@ -5442,7 +5442,7 @@ packages: '@miniflare/shared': 2.7.1 '@miniflare/web-sockets': 2.7.1 kleur: 4.1.5 - selfsigned: 2.0.1 + selfsigned: 2.1.1 undici: 5.9.1 ws: 8.8.1 youch: 2.2.2 @@ -5607,7 +5607,7 @@ packages: resolution: {integrity: sha512-/USkK4cioY209wXRpund6HZzHo9GmjakpV9ycOkpMcMxMk7QVcVFVyCMtzvXYiHsB2crgDgrtNYSELYFBXhhaA==} engines: {node: '>= 14'} dependencies: - '@octokit/types': 7.1.1 + '@octokit/types': 7.2.0 dev: true /@octokit/core/3.6.0: @@ -5696,8 +5696,8 @@ packages: '@octokit/openapi-types': 12.11.0 dev: true - /@octokit/types/7.1.1: - resolution: {integrity: sha512-Dx6cNTORyVaKY0Yeb9MbHksk79L8GXsihbG6PtWqTpkyA2TY1qBWE26EQXVG3dHwY9Femdd/WEeRUEiD0+H3TQ==} + /@octokit/types/7.2.0: + resolution: {integrity: sha512-pYQ/a1U6mHptwhGyp6SvsiM4bWP2s3V95olUeTxas85D/2kN78yN5C8cGN+P4LwJSWUqIEyvq0Qn2WUn6NQRjw==} dependencies: '@octokit/openapi-types': 13.8.0 dev: true @@ -5713,13 +5713,13 @@ packages: tiny-glob: 0.2.9 tslib: 2.4.0 - /@playwright/test/1.25.1: - resolution: {integrity: sha512-IJ4X0yOakXtwkhbnNzKkaIgXe6df7u3H3FnuhI9Jqh+CdO0e/lYQlDLYiyI9cnXK8E7UAppAWP+VqAv6VX7HQg==} + /@playwright/test/1.25.2: + resolution: {integrity: sha512-6qPznIR4Fw02OMbqXUPMG6bFFg1hDVNEdihKy0t9K0dmRbus1DyP5Q5XFQhGwEHQkLG5hrSfBuu9CW/foqhQHQ==} engines: {node: '>=14'} hasBin: true dependencies: '@types/node': 18.7.15 - playwright-core: 1.25.1 + playwright-core: 1.25.2 dev: true /@polka/url/1.0.0-next.21: @@ -8558,7 +8558,7 @@ packages: react: 18.2.0 dev: false - /@rollup/plugin-alias/3.1.9_rollup@2.78.1: + /@rollup/plugin-alias/3.1.9_rollup@2.79.0: resolution: {integrity: sha512-QI5fsEvm9bDzt32k39wpOwZhVzRcL5ydcffUHMyLVaVaLeC70I8TJZ17F1z1eMoLu4E/UOcH9BWVkKpIKdrfiw==} engines: {node: '>=8.0.0'} peerDependencies: @@ -8567,11 +8567,11 @@ packages: rollup: optional: true dependencies: - rollup: 2.78.1 + rollup: 2.79.0 slash: 3.0.0 dev: true - /@rollup/plugin-babel/5.3.1_o3fvycpalvsydbhpdgqv4wrrry: + /@rollup/plugin-babel/5.3.1_b6woseefyuugm6lsnk4tw7iz2e: resolution: {integrity: sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==} engines: {node: '>= 10.0.0'} peerDependencies: @@ -8588,11 +8588,11 @@ packages: dependencies: '@babel/core': 7.19.0 '@babel/helper-module-imports': 7.18.6 - '@rollup/pluginutils': 3.1.0_rollup@2.78.1 - rollup: 2.78.1 + '@rollup/pluginutils': 3.1.0_rollup@2.79.0 + rollup: 2.79.0 dev: false - /@rollup/plugin-inject/4.0.4_rollup@2.78.1: + /@rollup/plugin-inject/4.0.4_rollup@2.79.0: resolution: {integrity: sha512-4pbcU4J/nS+zuHk+c+OL3WtmEQhqxlZ9uqfjQMQDOHOPld7PsCd8k5LWs8h5wjwJN7MgnAn768F2sDxEP4eNFQ==} peerDependencies: rollup: ^1.20.0 || ^2.0.0 @@ -8600,13 +8600,13 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.78.1 + '@rollup/pluginutils': 3.1.0_rollup@2.79.0 estree-walker: 2.0.2 magic-string: 0.25.9 - rollup: 2.78.1 + rollup: 2.79.0 dev: true - /@rollup/plugin-node-resolve/11.2.1_rollup@2.78.1: + /@rollup/plugin-node-resolve/11.2.1_rollup@2.79.0: resolution: {integrity: sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg==} engines: {node: '>= 10.0.0'} peerDependencies: @@ -8615,16 +8615,16 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.78.1 + '@rollup/pluginutils': 3.1.0_rollup@2.79.0 '@types/resolve': 1.17.1 builtin-modules: 3.3.0 deepmerge: 4.2.2 is-module: 1.0.0 resolve: 1.22.1 - rollup: 2.78.1 + rollup: 2.79.0 dev: false - /@rollup/plugin-node-resolve/13.3.0_rollup@2.78.1: + /@rollup/plugin-node-resolve/13.3.0_rollup@2.79.0: resolution: {integrity: sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==} engines: {node: '>= 10.0.0'} peerDependencies: @@ -8633,16 +8633,16 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.78.1 + '@rollup/pluginutils': 3.1.0_rollup@2.79.0 '@types/resolve': 1.17.1 deepmerge: 4.2.2 is-builtin-module: 3.2.0 is-module: 1.0.0 resolve: 1.22.1 - rollup: 2.78.1 + rollup: 2.79.0 dev: true - /@rollup/plugin-replace/2.4.2_rollup@2.78.1: + /@rollup/plugin-replace/2.4.2_rollup@2.79.0: resolution: {integrity: sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg==} peerDependencies: rollup: ^1.20.0 || ^2.0.0 @@ -8650,12 +8650,12 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.78.1 + '@rollup/pluginutils': 3.1.0_rollup@2.79.0 magic-string: 0.25.9 - rollup: 2.78.1 + rollup: 2.79.0 dev: false - /@rollup/plugin-typescript/8.5.0_5zsqiitiqqdgwm4iemtywlnhku: + /@rollup/plugin-typescript/8.5.0_ppxule2mhlgb6ds3e4gxjflaqy: resolution: {integrity: sha512-wMv1/scv0m/rXx21wD2IsBbJFba8wGF3ErJIr6IKRfRj49S85Lszbxb4DCo8iILpluTjk2GAAu9CoZt4G3ppgQ==} engines: {node: '>=8.0.0'} peerDependencies: @@ -8668,14 +8668,14 @@ packages: tslib: optional: true dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.78.1 + '@rollup/pluginutils': 3.1.0_rollup@2.79.0 resolve: 1.22.1 - rollup: 2.78.1 + rollup: 2.79.0 tslib: 2.4.0 typescript: 4.7.4 dev: true - /@rollup/pluginutils/3.1.0_rollup@2.78.1: + /@rollup/pluginutils/3.1.0_rollup@2.79.0: resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} engines: {node: '>= 8.0.0'} peerDependencies: @@ -8687,7 +8687,7 @@ packages: '@types/estree': 0.0.39 estree-walker: 1.0.1 picomatch: 2.3.1 - rollup: 2.78.1 + rollup: 2.79.0 /@rollup/pluginutils/4.2.1: resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} @@ -8895,10 +8895,10 @@ packages: resolution: {integrity: sha512-J/rMZa7RqiH/rT29TEVZO4nBoDP9XJOjnbbIofg7GQKs4JIduEO3WLpte+6WeUz/TcrXKlY+bM7FYrp8yFB+3g==} dev: true - /@types/glob/7.2.0: - resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} + /@types/glob/8.0.0: + resolution: {integrity: sha512-l6NQsDDyQUVeoTynNpC9uRvCUint/gSUXQA2euwmTuWGvPY5LSDUu6tkCtJB2SvGQlJQzLaKqcGZP4//7EDveA==} dependencies: - '@types/minimatch': 5.1.1 + '@types/minimatch': 5.1.2 '@types/node': 18.7.15 dev: true @@ -8946,8 +8946,8 @@ packages: resolution: {integrity: sha512-Jus9s4CDbqwocc5pOAnh8ShfrnMcPHuJYzVcSUU7lrh8Ni5HuIqX3oilL86p3dlTrk0LzHRCgA/GQ7uNCw6l2Q==} dev: true - /@types/minimatch/5.1.1: - resolution: {integrity: sha512-v55NF6Dz0wrj14Rn8iEABTWrhYRmgkJYuokduunSiq++t3hZ9VZ6dvcDt+850Pm5sGJZk8RaHzkFCXPxVINZ+g==} + /@types/minimatch/5.1.2: + resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} dev: true /@types/minimist/1.2.2: @@ -9020,24 +9020,24 @@ packages: /@types/react-dom/17.0.17: resolution: {integrity: sha512-VjnqEmqGnasQKV0CWLevqMTXBYG9GbwuE6x3VetERLh0cq2LTptFE73MrQi2S7GkKXCf2GgwItB/melLnxfnsg==} dependencies: - '@types/react': 17.0.48 + '@types/react': 17.0.49 dev: true /@types/react-dom/18.0.6: resolution: {integrity: sha512-/5OFZgfIPSwy+YuIBP/FgJnQnsxhZhjjrnxudMddeblOouIodEQ75X14Rr4wGSG/bknL+Omy9iWlLo1u/9GzAA==} dependencies: - '@types/react': 18.0.17 + '@types/react': 17.0.49 dev: false - /@types/react/17.0.48: - resolution: {integrity: sha512-zJ6IYlJ8cYYxiJfUaZOQee4lh99mFihBoqkOSEGV+dFi9leROW6+PgstzQ+w3gWTnUfskALtQPGHK6dYmPj+2A==} + /@types/react/17.0.49: + resolution: {integrity: sha512-CCBPMZaPhcKkYUTqFs/hOWqKjPxhTEmnZWjlHHgIMop67DsXywf9B5Os9Hz8KSacjNOgIdnZVJamwl232uxoPg==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.2 csstype: 3.1.0 - /@types/react/18.0.17: - resolution: {integrity: sha512-38ETy4tL+rn4uQQi7mB81G7V1g0u2ryquNmsVIOKUAEIDK+3CUjZ6rSRpdvS99dNBnkLFL83qfmtLacGOTIhwQ==} + /@types/react/18.0.18: + resolution: {integrity: sha512-6hI08umYs6NaiHFEEGioXnxJ+oEhY3eRz8VCUaudZmGdtvPviCJB8mgaMxaDWAdPSYd4eFavrPk2QIolwbLYrg==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.2 @@ -9047,7 +9047,7 @@ packages: /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 18.7.15 + '@types/node': 14.18.27 /@types/resolve/1.20.2: resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} @@ -9055,7 +9055,7 @@ packages: /@types/rimraf/3.0.2: resolution: {integrity: sha512-F3OznnSLAUxFrCEu/L5PY8+ny8DtcFRjx7fZZ9bycvXRi3KPTRS9HOitGZwvPg0juRhXFWIeKX58cnX5YqLohQ==} dependencies: - '@types/glob': 7.2.0 + '@types/glob': 8.0.0 '@types/node': 18.7.15 dev: true @@ -9377,7 +9377,7 @@ packages: resolution: {integrity: sha512-Oxy4y5JDh7CMbaxEGjKKzHcnQ1gRQqtfp+x3xvOmZYixXHwaD2RMJDTzaPz0b2B3pgVbbPOHY87wffJPFDaoFg==} hasBin: true dependencies: - '@mapbox/node-pre-gyp': 1.0.9 + '@mapbox/node-pre-gyp': 1.0.10 acorn: 8.8.0 bindings: 1.5.0 estree-walker: 2.0.2 @@ -9412,7 +9412,7 @@ packages: dependencies: emmet: 2.3.6 jsonc-parser: 2.3.1 - vscode-languageserver-textdocument: 1.0.5 + vscode-languageserver-textdocument: 1.0.7 vscode-languageserver-types: 3.17.2 vscode-nls: 5.2.0 vscode-uri: 2.1.2 @@ -9809,8 +9809,8 @@ packages: object.assign: 4.1.4 dev: false - /babel-plugin-jsx-dom-expressions/0.34.5: - resolution: {integrity: sha512-2smF8V/kd490yWqucLnWT9vQXBvCAx8Kf0wi2HD5LtO5VeLOArjn75oaaYnlazcyR/sdmef6WEsFG5Lnh5o/eA==} + /babel-plugin-jsx-dom-expressions/0.34.7: + resolution: {integrity: sha512-jTxBhu/MQscWdOcLfqKAY8lIiRsv1ivrMQShlePoa4G8S2cFNb93HTWN4FFdp3SpILaibygFXWU3H+aHpoGH/w==} peerDependencies: '@babel/core': ^7.0.0 peerDependenciesMeta: @@ -9887,7 +9887,7 @@ packages: '@babel/core': optional: true dependencies: - babel-plugin-jsx-dom-expressions: 0.34.5 + babel-plugin-jsx-dom-expressions: 0.34.7 dev: false /bail/2.0.2: @@ -9995,7 +9995,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001390 - electron-to-chromium: 1.4.242 + electron-to-chromium: 1.4.243 node-releases: 2.0.6 update-browserslist-db: 1.0.7_browserslist@4.21.3 @@ -10326,8 +10326,8 @@ packages: /concat-map/0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - /concurrently/7.3.0: - resolution: {integrity: sha512-IiDwm+8DOcFEInca494A8V402tNTQlJaYq78RF2rijOrKEk/AOHTxhN4U1cp7GYKYX5Q6Ymh1dLTBlzIMN0ikA==} + /concurrently/7.4.0: + resolution: {integrity: sha512-M6AfrueDt/GEna/Vg9BqQ+93yuvzkSKmoTixnwEJkH0LlcGrRC2eCmjeG1tLLHIYfpYJABokqSGyMcXjm96AFA==} engines: {node: ^12.20.0 || ^14.13.0 || >=16.0.0} hasBin: true dependencies: @@ -10750,7 +10750,7 @@ packages: dependencies: domelementtype: 2.3.0 domhandler: 5.0.3 - entities: 4.3.1 + entities: 4.4.0 dev: true /domelementtype/2.3.0: @@ -10813,8 +10813,8 @@ packages: jake: 10.8.5 dev: false - /electron-to-chromium/1.4.242: - resolution: {integrity: sha512-nPdgMWtjjWGCtreW/2adkrB2jyHjClo9PtVhR6rW+oxa4E4Wom642Tn+5LslHP3XPL5MCpkn5/UEY60EXylNeQ==} + /electron-to-chromium/1.4.243: + resolution: {integrity: sha512-BgLD2gBX43OSXwlT01oYRRD5NIB4n3okTRxkzEAC6G0SZG4TTlyrWMjbOo0fajCwqwpRtMHXQNMjtRN6qpNtfw==} /emmet/2.3.6: resolution: {integrity: sha512-pLS4PBPDdxuUAmw7Me7+TcHbykTsBKN/S9XJbUOMFQrNv9MoshzyMFK/R57JBm94/6HSL4vHnDeEmxlC82NQ4A==} @@ -10843,11 +10843,6 @@ packages: ansi-colors: 4.1.3 dev: true - /entities/4.3.1: - resolution: {integrity: sha512-o4q/dYJlmyjP2zfnaWDUC6A3BQFmVTX+tZPezK7k0GLSU9QYCauscf5Y+qcEPzKL+EixVouYDgLQK5H9GrLpkg==} - engines: {node: '>=0.12'} - dev: true - /entities/4.4.0: resolution: {integrity: sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==} engines: {node: '>=0.12'} @@ -12501,7 +12496,7 @@ packages: domelementtype: 2.3.0 domhandler: 5.0.3 domutils: 3.0.1 - entities: 4.3.1 + entities: 4.4.0 dev: true /http-cache-semantics/4.1.0: @@ -14654,19 +14649,19 @@ packages: find-up: 3.0.0 dev: false - /playwright-core/1.25.1: - resolution: {integrity: sha512-lSvPCmA2n7LawD2Hw7gSCLScZ+vYRkhU8xH0AapMyzwN+ojoDqhkH/KIEUxwNu2PjPoE/fcE0wLAksdOhJ2O5g==} + /playwright-core/1.25.2: + resolution: {integrity: sha512-0yTbUE9lIddkEpLHL3u8PoCL+pWiZtj5A/j3U7YoNjcmKKDGBnCrgHJMzwd2J5vy6l28q4ki3JIuz7McLHhl1A==} engines: {node: '>=14'} hasBin: true dev: true - /playwright/1.25.1: - resolution: {integrity: sha512-kOlW7mllnQ70ALTwAor73q/FhdH9EEXLUqjdzqioYLcSVC4n4NBfDqeCikGuayFZrLECLkU6Hcbziy/szqTXSA==} + /playwright/1.25.2: + resolution: {integrity: sha512-RwMB5SFRV/8wSfK+tK8ycpqdzORvoqUNz9DUeRfSgZFrZej5uuBl9wFjWcc+OkXFEtaPmx1acAVGG7hA4IJ1kg==} engines: {node: '>=14'} hasBin: true requiresBuild: true dependencies: - playwright-core: 1.25.1 + playwright-core: 1.25.2 dev: true /postcss-attribute-case-insensitive/5.0.2_postcss@8.4.16: @@ -14973,13 +14968,13 @@ packages: postcss-value-parser: 4.2.0 dev: true - /postcss-preset-env/7.8.0_postcss@8.4.16: - resolution: {integrity: sha512-leqiqLOellpLKfbHkD06E04P6d9ZQ24mat6hu4NSqun7WG0UhspHR5Myiv/510qouCjoo4+YJtNOqg5xHaFnCA==} + /postcss-preset-env/7.8.1_postcss@8.4.16: + resolution: {integrity: sha512-8884CHxQaoN1i4iEK+JvzOe8emODb5R4p/0dw4yEdo7QM4RdUk2sBx0fnzFyJt8BLfZSCGeVkKZ4HC564waBpQ==} engines: {node: ^12 || ^14 || >=16} peerDependencies: postcss: ^8.2 dependencies: - '@csstools/postcss-cascade-layers': 1.0.5_postcss@8.4.16 + '@csstools/postcss-cascade-layers': 1.0.6_postcss@8.4.16 '@csstools/postcss-color-function': 1.1.1_postcss@8.4.16 '@csstools/postcss-font-format-keywords': 1.0.1_postcss@8.4.16 '@csstools/postcss-hwb-function': 1.0.2_postcss@8.4.16 @@ -15077,8 +15072,8 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 - /preact-render-to-string/5.2.2_preact@10.10.6: - resolution: {integrity: sha512-ZBPfzWmHjasQIzysj72VYJ6oa2bphpxNvzLRdRj/XGFKyeTBJIDmoiKJlBGfxzU4TYL2CjpAWmcFIXcV+HQEBg==} + /preact-render-to-string/5.2.3_preact@10.10.6: + resolution: {integrity: sha512-aPDxUn5o3GhWdtJtW0svRC2SS/l8D9MAgo2+AWml+BhDImb27ALf04Q2d+AHqUUOc6RdSXFIBVa2gxzgMKgtZA==} peerDependencies: preact: '>=10' dependencies: @@ -15148,8 +15143,8 @@ packages: synckit: 0.7.3 dev: true - /prettier-plugin-astro/0.5.3: - resolution: {integrity: sha512-g4uJ/7k1rJeIWBifeBgTqzgV5gmMTG+lOmOvUZvtIh1R91aqa+yYMzbysIlsJKRaRyWefejrOpvpIuEePBDAyw==} + /prettier-plugin-astro/0.5.4: + resolution: {integrity: sha512-ILs/WgUYtKBOn3Zh217/PwjCFtUWEKQjcCFJDevri0hGEBwEnnda9aqSLL0/nhCOmQn/UE7M9zLQvThu970ZHw==} engines: {node: ^14.15.0 || >=16.0.0, npm: '>=6.14.0'} dependencies: '@astrojs/compiler': 0.23.5 @@ -15755,7 +15750,7 @@ packages: rollup-plugin-inject: 3.0.2 dev: true - /rollup-plugin-terser/7.0.2_rollup@2.78.1: + /rollup-plugin-terser/7.0.2_rollup@2.79.0: resolution: {integrity: sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==} peerDependencies: rollup: ^2.0.0 @@ -15765,7 +15760,7 @@ packages: dependencies: '@babel/code-frame': 7.18.6 jest-worker: 26.6.2 - rollup: 2.78.1 + rollup: 2.79.0 serialize-javascript: 4.0.0 terser: 5.15.0 @@ -15788,6 +15783,14 @@ packages: hasBin: true optionalDependencies: fsevents: 2.3.2 + dev: false + + /rollup/2.79.0: + resolution: {integrity: sha512-x4KsrCgwQ7ZJPcFA/SUu6QVcYlO7uRLfLAy0DSA4NS2eG8japdbpM50ToH7z4iObodRYOJ0soneF0iaQRJ6zhA==} + engines: {node: '>=10.0.0'} + hasBin: true + optionalDependencies: + fsevents: 2.3.2 /run-parallel/1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} @@ -15833,8 +15836,8 @@ packages: dependencies: suf-log: 2.5.3 - /sass/1.54.6: - resolution: {integrity: sha512-DUqJjR2WxXBcZjRSZX5gCVyU+9fuC2qDfFzoKX9rV4rCOcec5mPtEafTcfsyL3YJuLONjWylBne+uXVh5rrmFw==} + /sass/1.54.8: + resolution: {integrity: sha512-ib4JhLRRgbg6QVy6bsv5uJxnJMTS2soVcCp9Y88Extyy13A8vV0G1fAwujOzmNkFQbR3LvedudAMbtuNRPbQww==} engines: {node: '>=12.0.0'} hasBin: true dependencies: @@ -15858,8 +15861,8 @@ packages: kind-of: 6.0.3 dev: false - /selfsigned/2.0.1: - resolution: {integrity: sha512-LmME957M1zOsUhG+67rAjKfiWFox3SBxE/yymatMZsAx+oMrJ0YQ8AToOnyCm7xbeg2ep37IHLxdu0o2MavQOQ==} + /selfsigned/2.1.1: + resolution: {integrity: sha512-GSL3aowiF7wa/WtSFwnUrludWFoNhftq8bUkH9pkzjpN2XSPOAYEgg6e0sS9s0rZwgJzJiQRPU18A6clnoW5wQ==} engines: {node: '>=10'} dependencies: node-forge: 1.3.1 @@ -17272,7 +17275,7 @@ packages: debug: 4.3.4 fast-glob: 3.2.11 pretty-bytes: 5.6.0 - rollup: 2.78.1 + rollup: 2.79.0 workbox-build: 6.5.4 workbox-window: 6.5.4 transitivePeerDependencies: @@ -17280,7 +17283,7 @@ packages: - supports-color dev: false - /vite/3.0.9_sass@1.54.6: + /vite/3.0.9_sass@1.54.8: resolution: {integrity: sha512-waYABTM+G6DBTCpYAxvevpG50UOlZuynR0ckTK5PawNVt7ebX6X7wNXHaGIO6wYYFXSM7/WcuFuO2QzhBB6aMw==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -17303,7 +17306,7 @@ packages: postcss: 8.4.16 resolve: 1.22.1 rollup: 2.77.3 - sass: 1.54.6 + sass: 1.54.8 optionalDependencies: fsevents: 2.3.2 dev: false @@ -17398,7 +17401,7 @@ packages: /vscode-html-languageservice/5.0.1: resolution: {integrity: sha512-OYsyn5HGAhxs0OIG+M0jc34WnftLtD67Wg7+TfrYwvf0waOkkr13zUqtdrVm2JPNQ6fJx+qnuM+vTbq7o1dCdQ==} dependencies: - vscode-languageserver-textdocument: 1.0.5 + vscode-languageserver-textdocument: 1.0.7 vscode-languageserver-types: 3.17.2 vscode-nls: 5.2.0 vscode-uri: 3.0.3 @@ -17416,10 +17419,6 @@ packages: vscode-languageserver-types: 3.17.2 dev: false - /vscode-languageserver-textdocument/1.0.5: - resolution: {integrity: sha512-1ah7zyQjKBudnMiHbZmxz5bYNM9KKZYz+5VQLj+yr8l+9w3g+WAhCkUkWbhMEdC5u0ub4Ndiye/fDyS8ghIKQg==} - dev: false - /vscode-languageserver-textdocument/1.0.7: resolution: {integrity: sha512-bFJH7UQxlXT8kKeyiyu41r22jCZXG8kuuVVA33OEJn1diWOZK5n8zBSPZFHVBOu8kXZ6h0LIRhf5UnCo61J4Hg==} dev: false @@ -17579,9 +17578,9 @@ packages: '@babel/core': 7.19.0 '@babel/preset-env': 7.19.0_@babel+core@7.19.0 '@babel/runtime': 7.19.0 - '@rollup/plugin-babel': 5.3.1_o3fvycpalvsydbhpdgqv4wrrry - '@rollup/plugin-node-resolve': 11.2.1_rollup@2.78.1 - '@rollup/plugin-replace': 2.4.2_rollup@2.78.1 + '@rollup/plugin-babel': 5.3.1_b6woseefyuugm6lsnk4tw7iz2e + '@rollup/plugin-node-resolve': 11.2.1_rollup@2.79.0 + '@rollup/plugin-replace': 2.4.2_rollup@2.79.0 '@surma/rollup-plugin-off-main-thread': 2.2.3 ajv: 8.11.0 common-tags: 1.8.2 @@ -17590,8 +17589,8 @@ packages: glob: 7.2.3 lodash: 4.17.21 pretty-bytes: 5.6.0 - rollup: 2.78.1 - rollup-plugin-terser: 7.0.2_rollup@2.78.1 + rollup: 2.79.0 + rollup-plugin-terser: 7.0.2_rollup@2.79.0 source-map: 0.8.0-beta.0 stringify-object: 3.3.0 strip-comments: 2.0.1 @@ -17708,8 +17707,8 @@ packages: resolution: {integrity: sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==} dev: true - /wrangler/2.0.28: - resolution: {integrity: sha512-BNN+xebKF8CnZGagirNXzPbU9GU1deawiH/ASDN4h5Bi1Kgm/HpUMZpkP1LoMjtveiiS7Pa53A6x00bm2JEFlQ==} + /wrangler/2.0.29: + resolution: {integrity: sha512-Z9W48pRpo87qO2WLMU24TFLL5Oq2WUwzqlwVDFrnSpBT+7GRrkAceepKU8V+aOXxLqyUaEzaSVHT3KVPyXh8KQ==} engines: {node: '>=16.13.0'} hasBin: true dependencies: @@ -17722,7 +17721,7 @@ packages: miniflare: 2.7.1 nanoid: 3.3.4 path-to-regexp: 6.2.1 - selfsigned: 2.0.1 + selfsigned: 2.1.1 source-map: 0.7.4 xxhash-wasm: 1.0.1 optionalDependencies: From 93c3aee01c95c60b1c7e8b7b7b2cc79ae6069bed Mon Sep 17 00:00:00 2001 From: Tony Sullivan Date: Wed, 7 Sep 2022 16:33:57 +0000 Subject: [PATCH 07/18] fixes an eslint error (#4659) --- packages/astro/src/core/create-vite.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/astro/src/core/create-vite.ts b/packages/astro/src/core/create-vite.ts index e93fd7fb9..8ee301344 100644 --- a/packages/astro/src/core/create-vite.ts +++ b/packages/astro/src/core/create-vite.ts @@ -243,7 +243,7 @@ class DependencyWalker { dir = parentDir; } - } catch (e) { + } catch { // Give up! Who knows where the `package.json` is… } } From e4348a4eb49466579204eb5f7fb8823736f467c0 Mon Sep 17 00:00:00 2001 From: Valentin Bersier Date: Wed, 7 Sep 2022 19:22:11 +0200 Subject: [PATCH 08/18] @astrojs/image: add a `background` option/prop to replace the alpha layer (#4642) * Added `background` option and prop. This optional color specifies which background to use when removing the alpha channel if the output format doesn't support transparency. * Modified existing tests * Fixed wrong dimensions in tests * Fixing a few instances of jpeg vs jpg * Added color checking * working on the tests * tests are now passing * Adding tests * Added tests for background color * no need to test with subpath * Added fixture * Renamed test fixture for background-color * skipping test until fixed * Typo * Working on tests * tests are passing * Updated readme and added changeset * Updated lockfile * Updated lockfile * Updated lockfile Co-authored-by: Tony Sullivan --- .changeset/eleven-baboons-try.md | 5 + packages/integrations/image/README.md | 54 +- .../image/components/Picture.astro | 4 +- .../integrations/image/src/lib/get-image.ts | 10 +- .../integrations/image/src/lib/get-picture.ts | 3 + .../image/src/loaders/colornames.ts | 290 +++ .../integrations/image/src/loaders/index.ts | 32 +- .../integrations/image/src/loaders/sharp.ts | 20 +- .../test/background-color-image-ssg.test.js | 116 ++ .../test/background-color-image-ssr.test.js | 98 + .../background-color-image/astro.config.mjs | 8 + .../background-color-image/package.json | 10 + .../background-color-image/public/favicon.ico | Bin 0 -> 4286 bytes .../background-color-image/server/server.mjs | 44 + .../src/assets/file-icon.png | Bin 0 -> 7746 bytes .../src/pages/index.astro | 21 + .../basic-image/src/pages/index.astro | 2 + .../basic-picture/src/pages/index.astro | 2 + .../fixtures/with-mdx/src/pages/index.mdx | 2 + .../integrations/image/test/image-ssg.test.js | 36 + .../image/test/image-ssr-build.test.js | 24 + .../image/test/image-ssr-dev.test.js | 26 + .../image/test/picture-ssg.test.js | 13 + .../image/test/picture-ssr-build.test.js | 26 + .../image/test/picture-ssr-dev.test.js | 14 + .../integrations/image/test/sharp.test.js | 7 + .../integrations/image/test/with-mdx.test.js | 6 + pnpm-lock.yaml | 1762 +++++++---------- 28 files changed, 1623 insertions(+), 1012 deletions(-) create mode 100644 .changeset/eleven-baboons-try.md create mode 100644 packages/integrations/image/src/loaders/colornames.ts create mode 100644 packages/integrations/image/test/background-color-image-ssg.test.js create mode 100644 packages/integrations/image/test/background-color-image-ssr.test.js create mode 100644 packages/integrations/image/test/fixtures/background-color-image/astro.config.mjs create mode 100644 packages/integrations/image/test/fixtures/background-color-image/package.json create mode 100644 packages/integrations/image/test/fixtures/background-color-image/public/favicon.ico create mode 100644 packages/integrations/image/test/fixtures/background-color-image/server/server.mjs create mode 100644 packages/integrations/image/test/fixtures/background-color-image/src/assets/file-icon.png create mode 100644 packages/integrations/image/test/fixtures/background-color-image/src/pages/index.astro diff --git a/.changeset/eleven-baboons-try.md b/.changeset/eleven-baboons-try.md new file mode 100644 index 000000000..f953ae10c --- /dev/null +++ b/.changeset/eleven-baboons-try.md @@ -0,0 +1,5 @@ +--- +'@astrojs/image': minor +--- + +Added a `background` option to specify a background color to replace transparent pixels (alpha layer). diff --git a/packages/integrations/image/README.md b/packages/integrations/image/README.md index 2ecc81364..fda9727e6 100644 --- a/packages/integrations/image/README.md +++ b/packages/integrations/image/README.md @@ -24,9 +24,9 @@ This integration provides `` and `` components as well as a ba ### Quick Install - + The `astro add` command-line tool automates the installation for you. Run one of the following commands in a new terminal window. (If you aren't sure which package manager you're using, run the first command.) Then, follow the prompts, and type "y" in the terminal (meaning "yes") for each one. - + ```sh # Using NPM npx astro add image @@ -35,13 +35,13 @@ yarn astro add image # Using PNPM pnpm astro add image ``` - + Finally, in the terminal window running Astro, press `CTRL+C` and then restart the dev server. If you run into any issues, [feel free to report them to us on GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. ### Manual Install - + First, install the `@astrojs/image` package using your package manager. If you're using npm or aren't sure, run this in the terminal: ```sh npm install @astrojs/image @@ -57,7 +57,7 @@ export default { // ... integrations: [image()], } -``` +``` Then, restart the dev server. ### Update `env.d.ts` @@ -190,6 +190,24 @@ A `string` can be provided in the form of `{width}:{height}`, ex: `16:9` or `3:4 A `number` can also be provided, useful when the aspect ratio is calculated at build time. This can be an inline number such as `1.777` or inlined as a JSX expression like `aspectRatio={16/9}`. +#### background + +

+ +**Type:** `ColorDefinition`
+**Default:** `undefined` +

+ +The background color to use for replacing the alpha channel with `sharp`'s `flatten` method. In case the output format +doesn't support transparency (i.e. `jpeg`), it's advisable to include a background color, otherwise black will be used +as default replacement for transparent pixels. + +The parameter accepts a `string` as value. + +The parameter can be a [named HTML color](https://www.w3schools.com/tags/ref_colornames.asp), a hexadecimal +color representation with 3 or 6 hexadecimal characters in the form `#123[abc]`, or an RGB definition in the form +`rgb(100,100,100)`. + ### ` #### src @@ -271,6 +289,24 @@ A `number` can also be provided, useful when the aspect ratio is calculated at b The output formats to be used in the optimized image. If not provided, `webp` and `avif` will be used in addition to the original image format. +#### background + +

+ +**Type:** `ColorDefinition`
+**Default:** `undefined` +

+ +The background color to use for replacing the alpha channel with `sharp`'s `flatten` method. In case the output format +doesn't support transparency (i.e. `jpeg`), it's advisable to include a background color, otherwise black will be used +as default replacement for transparent pixels. + +The parameter accepts a `string` as value. + +The parameter can be a [named HTML color](https://www.w3schools.com/tags/ref_colornames.asp), a hexadecimal +color representation with 3 or 6 hexadecimal characters in the form `#123[abc]`, or an RGB definition in the form +`rgb(100,100,100)`. + ### `getImage` This is the helper function used by the `` component to build `` attributes for the transformed image. This helper can be used directly for more complex use cases that aren't currently supported by the `` component. @@ -307,7 +343,7 @@ The integration can be configured to run with a different image service, either ### config.serviceEntryPoint - + The `serviceEntryPoint` should resolve to the image service installed from NPM. The default entry point is `@astrojs/image/sharp`, which resolves to the entry point exported from this integration's `package.json`. ```js @@ -342,7 +378,7 @@ export default { ## Examples ### Local images - + Image files in your project's `src` directory can be imported in frontmatter and passed directly to the `` component. All other properties are optional and will default to the original image file's properties if not provided. ```astro @@ -371,7 +407,7 @@ import heroImage from '../assets/hero.png'; Files in the `/public` directory are always served or copied as-is, with no processing. We recommend that local images are always kept in `src/` so that Astro can transform, optimize and bundle them. But if you absolutely must keep an image in `public/`, use its relative URL path as the image's `src=` attribute. It will be treated as a remote image, which requires an `aspectRatio` attribute. -Alternatively, you can import an image from your `public/` directory in your frontmatter and use a variable in your `src=` attribute. You cannot, however, import this directly inside the component as its `src` value. +Alternatively, you can import an image from your `public/` directory in your frontmatter and use a variable in your `src=` attribute. You cannot, however, import this directly inside the component as its `src` value. For example, use an image located at `public/social.png` in either static or SSR builds like so: @@ -386,7 +422,7 @@ import socialImage from '/social.png'; ``` ### Remote images - + Remote images can be transformed with the `` component. The `` component needs to know the final dimensions for the `` element to avoid content layout shifts. For remote images, this means you must either provide `width` and `height`, or one of the dimensions plus the required `aspectRatio`. ```astro diff --git a/packages/integrations/image/components/Picture.astro b/packages/integrations/image/components/Picture.astro index 7fe43d9db..e28f5bf40 100644 --- a/packages/integrations/image/components/Picture.astro +++ b/packages/integrations/image/components/Picture.astro @@ -27,6 +27,7 @@ interface RemoteImageProps widths: number[]; aspectRatio: TransformOptions['aspectRatio']; formats?: OutputFormat[]; + background: TransformOptions['background']; } export type Props = LocalImageProps | RemoteImageProps; @@ -37,6 +38,7 @@ const { sizes, widths, aspectRatio, + background, formats = ['avif', 'webp'], loading = 'lazy', decoding = 'async', @@ -47,7 +49,7 @@ if (alt === undefined || alt === null) { warnForMissingAlt(); } -const { image, sources } = await getPicture({ src, widths, formats, aspectRatio }); +const { image, sources } = await getPicture({ src, widths, formats, aspectRatio, background }); --- diff --git a/packages/integrations/image/src/lib/get-image.ts b/packages/integrations/image/src/lib/get-image.ts index 15a0d91db..856f9f8c6 100644 --- a/packages/integrations/image/src/lib/get-image.ts +++ b/packages/integrations/image/src/lib/get-image.ts @@ -1,5 +1,10 @@ /// -import type { ImageService, OutputFormat, TransformOptions } from '../loaders/index.js'; +import type { + ColorDefinition, + ImageService, + OutputFormat, + TransformOptions, +} from '../loaders/index.js'; import { isSSRService, parseAspectRatio } from '../loaders/index.js'; import sharp from '../loaders/sharp.js'; import { isRemoteImage } from '../utils/paths.js'; @@ -63,7 +68,7 @@ async function resolveTransform(input: GetImageTransform): Promise getSource(format))); diff --git a/packages/integrations/image/src/loaders/colornames.ts b/packages/integrations/image/src/loaders/colornames.ts new file mode 100644 index 000000000..806e55f31 --- /dev/null +++ b/packages/integrations/image/src/loaders/colornames.ts @@ -0,0 +1,290 @@ +export type NamedColor = + | 'aliceblue' + | 'antiquewhite' + | 'aqua' + | 'aquamarine' + | 'azure' + | 'beige' + | 'bisque' + | 'black' + | 'blanchedalmond' + | 'blue' + | 'blueviolet' + | 'brown' + | 'burlywood' + | 'cadetblue' + | 'chartreuse' + | 'chocolate' + | 'coral' + | 'cornflowerblue' + | 'cornsilk' + | 'crimson' + | 'cyan' + | 'darkblue' + | 'darkcyan' + | 'darkgoldenrod' + | 'darkgray' + | 'darkgreen' + | 'darkkhaki' + | 'darkmagenta' + | 'darkolivegreen' + | 'darkorange' + | 'darkorchid' + | 'darkred' + | 'darksalmon' + | 'darkseagreen' + | 'darkslateblue' + | 'darkslategray' + | 'darkturquoise' + | 'darkviolet' + | 'deeppink' + | 'deepskyblue' + | 'dimgray' + | 'dodgerblue' + | 'firebrick' + | 'floralwhite' + | 'forestgreen' + | 'fuchsia' + | 'gainsboro' + | 'ghostwhite' + | 'gold' + | 'goldenrod' + | 'gray' + | 'green' + | 'greenyellow' + | 'honeydew' + | 'hotpink' + | 'indianred' + | 'indigo' + | 'ivory' + | 'khaki' + | 'lavender' + | 'lavenderblush' + | 'lawngreen' + | 'lemonchiffon' + | 'lightblue' + | 'lightcoral' + | 'lightcyan' + | 'lightgoldenrodyellow' + | 'lightgray' + | 'lightgreen' + | 'lightpink' + | 'lightsalmon' + | 'lightsalmon' + | 'lightseagreen' + | 'lightskyblue' + | 'lightslategray' + | 'lightsteelblue' + | 'lightyellow' + | 'lime' + | 'limegreen' + | 'linen' + | 'magenta' + | 'maroon' + | 'mediumaquamarine' + | 'mediumblue' + | 'mediumorchid' + | 'mediumpurple' + | 'mediumseagreen' + | 'mediumslateblue' + | 'mediumslateblue' + | 'mediumspringgreen' + | 'mediumturquoise' + | 'mediumvioletred' + | 'midnightblue' + | 'mintcream' + | 'mistyrose' + | 'moccasin' + | 'navajowhite' + | 'navy' + | 'oldlace' + | 'olive' + | 'olivedrab' + | 'orange' + | 'orangered' + | 'orchid' + | 'palegoldenrod' + | 'palegreen' + | 'paleturquoise' + | 'palevioletred' + | 'papayawhip' + | 'peachpuff' + | 'peru' + | 'pink' + | 'plum' + | 'powderblue' + | 'purple' + | 'rebeccapurple' + | 'red' + | 'rosybrown' + | 'royalblue' + | 'saddlebrown' + | 'salmon' + | 'sandybrown' + | 'seagreen' + | 'seashell' + | 'sienna' + | 'silver' + | 'skyblue' + | 'slateblue' + | 'slategray' + | 'snow' + | 'springgreen' + | 'steelblue' + | 'tan' + | 'teal' + | 'thistle' + | 'tomato' + | 'turquoise' + | 'violet' + | 'wheat' + | 'white' + | 'whitesmoke' + | 'yellow' + | 'yellowgreen'; + +export const htmlColorNames: NamedColor[] = [ + 'aliceblue', + 'antiquewhite', + 'aqua', + 'aquamarine', + 'azure', + 'beige', + 'bisque', + 'black', + 'blanchedalmond', + 'blue', + 'blueviolet', + 'brown', + 'burlywood', + 'cadetblue', + 'chartreuse', + 'chocolate', + 'coral', + 'cornflowerblue', + 'cornsilk', + 'crimson', + 'cyan', + 'darkblue', + 'darkcyan', + 'darkgoldenrod', + 'darkgray', + 'darkgreen', + 'darkkhaki', + 'darkmagenta', + 'darkolivegreen', + 'darkorange', + 'darkorchid', + 'darkred', + 'darksalmon', + 'darkseagreen', + 'darkslateblue', + 'darkslategray', + 'darkturquoise', + 'darkviolet', + 'deeppink', + 'deepskyblue', + 'dimgray', + 'dodgerblue', + 'firebrick', + 'floralwhite', + 'forestgreen', + 'fuchsia', + 'gainsboro', + 'ghostwhite', + 'gold', + 'goldenrod', + 'gray', + 'green', + 'greenyellow', + 'honeydew', + 'hotpink', + 'indianred', + 'indigo', + 'ivory', + 'khaki', + 'lavender', + 'lavenderblush', + 'lawngreen', + 'lemonchiffon', + 'lightblue', + 'lightcoral', + 'lightcyan', + 'lightgoldenrodyellow', + 'lightgray', + 'lightgreen', + 'lightpink', + 'lightsalmon', + 'lightsalmon', + 'lightseagreen', + 'lightskyblue', + 'lightslategray', + 'lightsteelblue', + 'lightyellow', + 'lime', + 'limegreen', + 'linen', + 'magenta', + 'maroon', + 'mediumaquamarine', + 'mediumblue', + 'mediumorchid', + 'mediumpurple', + 'mediumseagreen', + 'mediumslateblue', + 'mediumslateblue', + 'mediumspringgreen', + 'mediumturquoise', + 'mediumvioletred', + 'midnightblue', + 'mintcream', + 'mistyrose', + 'moccasin', + 'navajowhite', + 'navy', + 'oldlace', + 'olive', + 'olivedrab', + 'orange', + 'orangered', + 'orchid', + 'palegoldenrod', + 'palegreen', + 'paleturquoise', + 'palevioletred', + 'papayawhip', + 'peachpuff', + 'peru', + 'pink', + 'plum', + 'powderblue', + 'purple', + 'rebeccapurple', + 'red', + 'rosybrown', + 'royalblue', + 'saddlebrown', + 'salmon', + 'sandybrown', + 'seagreen', + 'seashell', + 'sienna', + 'silver', + 'skyblue', + 'slateblue', + 'slategray', + 'snow', + 'springgreen', + 'steelblue', + 'tan', + 'teal', + 'thistle', + 'tomato', + 'turquoise', + 'violet', + 'wheat', + 'white', + 'whitesmoke', + 'yellow', + 'yellowgreen', +]; diff --git a/packages/integrations/image/src/loaders/index.ts b/packages/integrations/image/src/loaders/index.ts index 58a9924a8..c3ca5a59a 100644 --- a/packages/integrations/image/src/loaders/index.ts +++ b/packages/integrations/image/src/loaders/index.ts @@ -1,3 +1,5 @@ +import { type NamedColor, htmlColorNames } from './colornames.js'; + /// export type InputFormat = | 'heic' @@ -10,16 +12,35 @@ export type InputFormat = | 'webp' | 'gif'; -export type OutputFormat = 'avif' | 'jpeg' | 'png' | 'webp'; +export type OutputFormatSupportsAlpha = 'avif' | 'png' | 'webp'; +export type OutputFormat = OutputFormatSupportsAlpha | 'jpeg'; + +export type ColorDefinition = + | NamedColor + | `#${string}` + | `rgb(${number}, ${number}, ${number})` + | `rgb(${number},${number},${number})`; export function isOutputFormat(value: string): value is OutputFormat { return ['avif', 'jpeg', 'png', 'webp'].includes(value); } +export function isOutputFormatSupportsAlpha(value: string): value is OutputFormatSupportsAlpha { + return ['avif', 'png', 'webp'].includes(value); +} + export function isAspectRatioString(value: string): value is `${number}:${number}` { return /^\d*:\d*$/.test(value); } +export function isColor(value: string): value is ColorDefinition { + return ( + (htmlColorNames as string[]).includes(value.toLowerCase()) || + /^#[0-9a-f]{3}([0-9a-f]{3})?$/i.test(value) || + /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.test(value) + ); +} + export function parseAspectRatio(aspectRatio: TransformOptions['aspectRatio']) { if (!aspectRatio) { return undefined; @@ -75,6 +96,15 @@ export interface TransformOptions { * @example "16:9" - strings can be used in the format of `{ratioWidth}:{ratioHeight}`. */ aspectRatio?: number | `${number}:${number}`; + /** + * The background color to use when converting from a transparent image format to a + * non-transparent format. This is useful for converting PNGs to JPEGs. + * + * @example "white" - a named color + * @example "#ffffff" - a hex color + * @example "rgb(255, 255, 255)" - an rgb color + */ + background?: ColorDefinition; } export interface HostedImageService { diff --git a/packages/integrations/image/src/loaders/sharp.ts b/packages/integrations/image/src/loaders/sharp.ts index 4e7b3f104..dbb082dba 100644 --- a/packages/integrations/image/src/loaders/sharp.ts +++ b/packages/integrations/image/src/loaders/sharp.ts @@ -1,11 +1,11 @@ import sharp from 'sharp'; -import { isAspectRatioString, isOutputFormat } from '../loaders/index.js'; +import { isAspectRatioString, isColor, isOutputFormat } from '../loaders/index.js'; import type { OutputFormat, SSRImageService, TransformOptions } from './index.js'; class SharpService implements SSRImageService { async getImageAttributes(transform: TransformOptions) { // strip off the known attributes - const { width, height, src, format, quality, aspectRatio, ...rest } = transform; + const { width, height, src, format, quality, aspectRatio, background, ...rest } = transform; return { ...rest, @@ -37,6 +37,10 @@ class SharpService implements SSRImageService { searchParams.append('ar', transform.aspectRatio.toString()); } + if (transform.background) { + searchParams.append('bg', transform.background); + } + return { searchParams }; } @@ -72,6 +76,13 @@ class SharpService implements SSRImageService { } } + if (searchParams.has('bg')) { + const background = searchParams.get('bg')!; + if (isColor(background)) { + transform.background = background; + } + } + return transform; } @@ -87,6 +98,11 @@ class SharpService implements SSRImageService { sharpImage.resize(width, height); } + // remove alpha channel and replace with background color if requested + if (transform.background) { + sharpImage.flatten({ background: transform.background }); + } + if (transform.format) { sharpImage.toFormat(transform.format, { quality: transform.quality }); } diff --git a/packages/integrations/image/test/background-color-image-ssg.test.js b/packages/integrations/image/test/background-color-image-ssg.test.js new file mode 100644 index 000000000..3c488a3ff --- /dev/null +++ b/packages/integrations/image/test/background-color-image-ssg.test.js @@ -0,0 +1,116 @@ +import { expect } from 'chai'; +import * as cheerio from 'cheerio'; +import sharp from 'sharp'; +import { fileURLToPath } from 'url'; +import { loadFixture } from './test-utils.js'; + +describe('SSG image with background - dev', function () { + let fixture; + let devServer; + let $; + + before(async () => { + fixture = await loadFixture({ root: './fixtures/background-color-image/' }); + devServer = await fixture.startDevServer(); + const html = await fixture.fetch('/').then((res) => res.text()); + $ = cheerio.load(html); + }); + + after(async () => { + await devServer.stop(); + }); + + [ + { + title: 'Named color', + id: '#named', + bg: 'dimgray', + }, + { + title: 'Hex color', + id: '#hex', + bg: '#696969', + }, + { + title: 'Hex color short', + id: '#hex-short', + bg: '#666', + }, + { + title: 'RGB color', + id: '#rgb', + bg: 'rgb(105,105,105)', + }, + { + title: 'RGB color with spaces', + id: '#rgb-spaced', + bg: 'rgb(105, 105, 105)', + }, + ].forEach(({ title, id, bg }) => { + it(title, async () => { + const image = $(id); + const src = image.attr('src'); + const [_, params] = src.split('?'); + const searchParams = new URLSearchParams(params); + expect(searchParams.get('bg')).to.equal(bg); + }); + }); +}); + +describe('SSG image with background - build', function () { + let fixture; + let $; + let html; + + before(async () => { + fixture = await loadFixture({ root: './fixtures/background-color-image/' }); + await fixture.build(); + + html = await fixture.readFile('/index.html'); + $ = cheerio.load(html); + }); + + async function verifyImage(pathname, expectedBg) { + const url = new URL('./fixtures/background-color-image/dist/' + pathname, import.meta.url); + const dist = fileURLToPath(url); + const data = await sharp(dist).raw().toBuffer(); + // check that the first RGB pixel indeed has the requested background color + expect(data[0]).to.equal(expectedBg[0]); + expect(data[1]).to.equal(expectedBg[1]); + expect(data[2]).to.equal(expectedBg[2]); + } + + [ + { + title: 'Named color', + id: '#named', + bg: [105, 105, 105], + }, + { + title: 'Hex color', + id: '#hex', + bg: [105, 105, 105], + }, + { + title: 'Hex color short', + id: '#hex-short', + bg: [102, 102, 102], + }, + { + title: 'RGB color', + id: '#rgb', + bg: [105, 105, 105], + }, + { + title: 'RGB color with spaces', + id: '#rgb-spaced', + bg: [105, 105, 105], + }, + ].forEach(({ title, id, bg }) => { + it(title, async () => { + const image = $(id); + const src = image.attr('src'); + await verifyImage(src, bg); + }); + }); +}); diff --git a/packages/integrations/image/test/background-color-image-ssr.test.js b/packages/integrations/image/test/background-color-image-ssr.test.js new file mode 100644 index 000000000..ff4c208f8 --- /dev/null +++ b/packages/integrations/image/test/background-color-image-ssr.test.js @@ -0,0 +1,98 @@ +import { expect } from 'chai'; +import * as cheerio from 'cheerio'; +import { loadFixture } from './test-utils.js'; +import testAdapter from '../../../astro/test/test-adapter.js'; + +let fixture; + +describe('SSR image with background', function () { + before(async () => { + fixture = await loadFixture({ + root: './fixtures/background-color-image/', + adapter: testAdapter({ streaming: false }), + output: 'server', + }); + await fixture.build(); + }); + + [ + { + title: 'Named color', + id: '#named', + query: { + f: 'jpeg', + w: '256', + h: '256', + href: /^\/assets\/file-icon.\w{8}.png/, + bg: 'dimgray', + }, + }, + { + title: 'Hex color', + id: '#hex', + query: { + f: 'avif', + w: '256', + h: '256', + href: /^\/assets\/file-icon.\w{8}.png/, + bg: '#696969', + }, + }, + { + title: 'Hex color short', + id: '#hex-short', + query: { + f: 'png', + w: '256', + h: '256', + href: /^\/assets\/file-icon.\w{8}.png/, + bg: '#666', + }, + }, + { + title: 'RGB color', + id: '#rgb', + query: { + f: 'webp', + w: '256', + h: '256', + href: /^\/assets\/file-icon.\w{8}.png/, + bg: 'rgb(105,105,105)', + }, + }, + { + title: 'RGB color with spaces', + id: '#rgb-spaced', + query: { + f: 'jpeg', + w: '256', + h: '256', + href: /^\/assets\/file-icon.\w{8}.png/, + bg: 'rgb(105, 105, 105)', + }, + }, + ].forEach(({ title, id, query }) => { + it(title, async () => { + const app = await fixture.loadTestAdapterApp(); + + const request = new Request('http://example.com/'); + const response = await app.render(request); + const html = await response.text(); + const $ = cheerio.load(html); + + const image = $(id); + const src = image.attr('src'); + const [_, params] = src.split('?'); + + const searchParams = new URLSearchParams(params); + + for (const [key, value] of Object.entries(query)) { + if (typeof value === 'string') { + expect(searchParams.get(key)).to.equal(value); + } else { + expect(searchParams.get(key)).to.match(value); + } + } + }); + }); +}); diff --git a/packages/integrations/image/test/fixtures/background-color-image/astro.config.mjs b/packages/integrations/image/test/fixtures/background-color-image/astro.config.mjs new file mode 100644 index 000000000..7dafac3b6 --- /dev/null +++ b/packages/integrations/image/test/fixtures/background-color-image/astro.config.mjs @@ -0,0 +1,8 @@ +import { defineConfig } from 'astro/config'; +import image from '@astrojs/image'; + +// https://astro.build/config +export default defineConfig({ + site: 'http://localhost:3000', + integrations: [image({ logLevel: 'silent' })] +}); diff --git a/packages/integrations/image/test/fixtures/background-color-image/package.json b/packages/integrations/image/test/fixtures/background-color-image/package.json new file mode 100644 index 000000000..bca4ff178 --- /dev/null +++ b/packages/integrations/image/test/fixtures/background-color-image/package.json @@ -0,0 +1,10 @@ +{ + "name": "@test/background-color-image", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/image": "workspace:*", + "@astrojs/node": "workspace:*", + "astro": "workspace:*" + } +} diff --git a/packages/integrations/image/test/fixtures/background-color-image/public/favicon.ico b/packages/integrations/image/test/fixtures/background-color-image/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..578ad458b8906c08fbed84f42b045fea04db89d1 GIT binary patch literal 4286 zcmchZF=!M)6ox0}Fc8GdTHG!cdIY>nA!3n2f|wxIl0rn}Hl#=uf>?-!2r&jMEF^_k zh**lGut*gwBmoNv7AaB&2~nbzULg{WBhPQ{ZVzvF_HL8Cb&hv$_s#qN|IO^o>?+mA zuTW6tU%k~z<&{z+7$G%*nRsTcEO|90xy<-G5&JTt%CgZZCDT4%R?+{Vd^wh>P8_)} z`+dF$HQb9!>1o`Ivn;GInlCw{9T@Rt%q+d^T3Ke%cxkk;$v`{s^zCB9nHAv6w$Vbn z8fb<+eQTNM`;rf9#obfGnV#3+OQEUv4gU;{oA@zol%keY9-e>4W>p7AHmH~&!P7f7!Uj` zwgFeQ=<3G4O;mwWO`L!=R-=y3_~-DPjH3W^3f&jjCfC$o#|oGaahSL`_=f?$&Aa+W z2h8oZ+@?NUcjGW|aWJfbM*ZzxzmCPY`b~RobNrrj=rd`=)8-j`iSW64@0_b6?;GYk zNB+-fzOxlqZ?`y{OA$WigtZXa8)#p#=DPYxH=VeC_Q5q9Cv`mvW6*zU&Gnp1;oPM6 zaK_B3j(l^FyJgYeE9RrmDyhE7W2}}nW%ic#0v@i1E!yTey$W)U>fyd+!@2hWQ!Wa==NAtKoj`f3tp4y$Al`e;?)76?AjdaRR>|?&r)~3Git> zb1)a?uiv|R0_{m#A9c;7)eZ1y6l@yQ#oE*>(Z2fG-&&smPa2QTW>m*^K65^~`coP$ z8y5Y?iS<4Gz{Zg##$1mk)u-0;X|!xu^FCr;ce~X<&UWE&pBgqfYmEJTzpK9I%vr%b z3Ksd6qlPJLI%HFfeXK_^|BXiKZC>Ocu(Kk6hD3G-8usLzVG^q00Qh gz)s7ge@$ApxGu7=(6IGIk+uG&HTev01^#CH3$(Wk5&!@I literal 0 HcmV?d00001 diff --git a/packages/integrations/image/test/fixtures/background-color-image/server/server.mjs b/packages/integrations/image/test/fixtures/background-color-image/server/server.mjs new file mode 100644 index 000000000..d7a0a7a40 --- /dev/null +++ b/packages/integrations/image/test/fixtures/background-color-image/server/server.mjs @@ -0,0 +1,44 @@ +import { createServer } from 'http'; +import fs from 'fs'; +import mime from 'mime'; +import { handler as ssrHandler } from '../dist/server/entry.mjs'; + +const clientRoot = new URL('../dist/client/', import.meta.url); + +async function handle(req, res) { + ssrHandler(req, res, async (err) => { + if (err) { + res.writeHead(500); + res.end(err.stack); + return; + } + + let local = new URL('.' + req.url, clientRoot); + try { + const data = await fs.promises.readFile(local); + res.writeHead(200, { + 'Content-Type': mime.getType(req.url), + }); + res.end(data); + } catch { + res.writeHead(404); + res.end(); + } + }); +} + +const server = createServer((req, res) => { + handle(req, res).catch((err) => { + console.error(err); + res.writeHead(500, { + 'Content-Type': 'text/plain', + }); + res.end(err.toString()); + }); +}); + +server.listen(8085); +console.log('Serving at http://localhost:8085'); + +// Silence weird