From 5b6173fd031b7e85974cbadd39de7fa199075e44 Mon Sep 17 00:00:00 2001 From: Erika <3019731+Princesseuh@users.noreply.github.com> Date: Mon, 12 Sep 2022 11:55:06 -0300 Subject: [PATCH 01/15] Add an error message for improperly configured renderers (#4705) * Add error messages for wrongly configured renderers * Add changeset --- .changeset/fuzzy-rats-remain.md | 5 +++++ packages/astro/src/integrations/index.ts | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 .changeset/fuzzy-rats-remain.md diff --git a/.changeset/fuzzy-rats-remain.md b/.changeset/fuzzy-rats-remain.md new file mode 100644 index 000000000..601d2483b --- /dev/null +++ b/.changeset/fuzzy-rats-remain.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Properly show an error message when a renderer is not properly configured diff --git a/packages/astro/src/integrations/index.ts b/packages/astro/src/integrations/index.ts index ba9cac2c8..68d2a23ae 100644 --- a/packages/astro/src/integrations/index.ts +++ b/packages/astro/src/integrations/index.ts @@ -66,6 +66,14 @@ export async function runHookConfigSetup({ config: updatedConfig, command, addRenderer(renderer: AstroRenderer) { + if (!renderer.name) { + throw new Error(`Integration ${bold(integration.name)} has an unnamed renderer.`); + } + + if (!renderer.serverEntrypoint) { + throw new Error(`Renderer ${bold(renderer.name)} does not provide a serverEntrypoint.`); + } + updatedConfig._ctx.renderers.push(renderer); }, injectScript: (stage, content) => { From 562147a5b4a4d7e9bcf50191e386bcca25112f0a Mon Sep 17 00:00:00 2001 From: "Fred K. Bot" <108291165+fredkbot@users.noreply.github.com> Date: Mon, 12 Sep 2022 08:31:58 -0700 Subject: [PATCH 02/15] [ci] update lockfile (#4711) Co-authored-by: FredKSchott --- pnpm-lock.yaml | 402 +++++++++++++++++++++++++------------------------ 1 file changed, 203 insertions(+), 199 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 836f848b8..fcb3c2d20 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -37,14 +37,14 @@ importers: '@changesets/changelog-github': 0.4.4 '@changesets/cli': 2.23.0_kcozqtpxuwjzskw6zg5royevn4 '@octokit/action': 3.18.1 - '@typescript-eslint/eslint-plugin': 5.36.2_kou65mzxaniwtkb2mhvaghdcyi - '@typescript-eslint/parser': 5.36.2_sorwav4hsh5vncerguqybud76i + '@typescript-eslint/eslint-plugin': 5.36.2_ymvve5pmriizw6sqldrdyt3llu + '@typescript-eslint/parser': 5.36.2_4brgkhw6cq4me3drk3kxrpb2mm del: 6.1.1 esbuild: 0.14.54 - eslint: 8.23.0 - eslint-config-prettier: 8.5.0_eslint@8.23.0 + eslint: 8.23.1 + eslint-config-prettier: 8.5.0_eslint@8.23.1 eslint-plugin-no-only-tests: 2.6.0 - eslint-plugin-prettier: 4.2.1_tgumt6uwl2md3n6uqnggd6wvce + eslint-plugin-prettier: 4.2.1_cabrci5exjdaojcvd6xoxgeowu execa: 6.1.0 organize-imports-cli: 0.10.0 prettier: 2.7.1 @@ -102,7 +102,7 @@ importers: '@types/react': 17.0.49 '@types/react-dom': 18.0.6 astro: link:../../packages/astro - preact: 10.10.6 + preact: 10.11.0 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 @@ -151,7 +151,7 @@ importers: '@astrojs/svelte': link:../../packages/integrations/svelte '@astrojs/vue': link:../../packages/integrations/vue astro: link:../../packages/astro - preact: 10.10.6 + preact: 10.11.0 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 solid-js: 1.5.4 @@ -166,7 +166,7 @@ importers: dependencies: '@astrojs/preact': link:../../packages/integrations/preact astro: link:../../packages/astro - preact: 10.10.6 + preact: 10.11.0 examples/framework-react: specifiers: @@ -178,7 +178,7 @@ importers: react-dom: ^18.1.0 dependencies: '@astrojs/react': link:../../packages/integrations/react - '@types/react': 18.0.18 + '@types/react': 18.0.19 '@types/react-dom': 18.0.6 astro: link:../../packages/astro react: 18.2.0 @@ -286,7 +286,7 @@ importers: '@astrojs/mdx': link:../../packages/integrations/mdx '@astrojs/preact': link:../../packages/integrations/preact astro: link:../../packages/astro - preact: 10.10.6 + preact: 10.11.0 examples/with-nanostores: specifiers: @@ -297,10 +297,10 @@ importers: preact: ^10.7.3 dependencies: '@astrojs/preact': link:../../packages/integrations/preact - '@nanostores/preact': 0.1.3_sjll44dhi63q3s6wepldehyzyi + '@nanostores/preact': 0.1.3_wyz6kgcab5rxpkhqcycsg2kmqm astro: link:../../packages/astro nanostores: 0.5.13 - preact: 10.10.6 + preact: 10.11.0 examples/with-tailwindcss: specifiers: @@ -313,7 +313,7 @@ importers: dependencies: '@astrojs/tailwind': link:../../packages/integrations/tailwind astro: link:../../packages/astro - autoprefixer: 10.4.8_postcss@8.4.16 + autoprefixer: 10.4.9_postcss@8.4.16 canvas-confetti: 1.5.1 postcss: 8.4.16 tailwindcss: 3.1.8_postcss@8.4.16 @@ -438,7 +438,7 @@ importers: '@types/html-escaper': 3.0.0 '@types/yargs-parser': 21.0.0 boxen: 6.2.1 - ci-info: 3.3.2 + ci-info: 3.4.0 common-ancestor-path: 1.0.1 debug: 4.3.4 diff: 5.1.0 @@ -477,7 +477,7 @@ importers: vfile: 5.3.5 vite: 3.0.9_sass@1.54.9 yargs-parser: 21.1.1 - zod: 3.19.0 + zod: 3.19.1 devDependencies: '@playwright/test': 1.25.2 '@types/babel__generator': 7.6.4 @@ -560,7 +560,7 @@ importers: svelte: ^3.48.0 vue: ^3.2.37 dependencies: - preact: 10.10.6 + preact: 10.11.0 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 solid-js: 1.5.4 @@ -590,7 +590,7 @@ importers: react: ^18.1.0 react-dom: ^18.1.0 dependencies: - '@adobe/react-spectrum': 3.21.1_biqbaboplfbrettd7655fr4n2y + '@adobe/react-spectrum': 3.21.2_biqbaboplfbrettd7655fr4n2y '@astrojs/react': link:../../../../integrations/react astro: link:../../.. react: 18.2.0 @@ -670,7 +670,7 @@ importers: dependencies: '@webcomponents/template-shadowroot': 0.1.0 lit: 2.3.1 - preact: 10.10.6 + preact: 10.11.0 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 solid-js: 1.5.4 @@ -692,7 +692,7 @@ importers: astro: workspace:* preact: ^10.7.3 dependencies: - preact: 10.10.6 + preact: 10.11.0 devDependencies: '@astrojs/mdx': link:../../../../integrations/mdx '@astrojs/preact': link:../../../../integrations/preact @@ -713,7 +713,7 @@ importers: svelte: ^3.48.0 vue: ^3.2.37 dependencies: - preact: 10.10.6 + preact: 10.11.0 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 solid-js: 1.5.4 @@ -742,7 +742,7 @@ importers: svelte: ^3.48.0 vue: ^3.2.37 dependencies: - preact: 10.10.6 + preact: 10.11.0 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 solid-js: 1.5.4 @@ -771,7 +771,7 @@ importers: svelte: ^3.48.0 vue: ^3.2.37 dependencies: - preact: 10.10.6 + preact: 10.11.0 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 solid-js: 1.5.4 @@ -800,7 +800,7 @@ importers: svelte: ^3.48.0 vue: ^3.2.37 dependencies: - preact: 10.10.6 + preact: 10.11.0 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 solid-js: 1.5.4 @@ -829,7 +829,7 @@ importers: svelte: ^3.48.0 vue: ^3.2.37 dependencies: - preact: 10.10.6 + preact: 10.11.0 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 solid-js: 1.5.4 @@ -858,7 +858,7 @@ importers: svelte: ^3.48.0 vue: ^3.2.36 dependencies: - preact: 10.10.6 + preact: 10.11.0 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 solid-js: 1.5.4 @@ -899,7 +899,7 @@ importers: dependencies: '@astrojs/preact': link:../../../../integrations/preact astro: link:../../.. - preact: 10.10.6 + preact: 10.11.0 packages/astro/e2e/fixtures/preact-component: specifiers: @@ -911,7 +911,7 @@ importers: '@astrojs/mdx': link:../../../../integrations/mdx '@astrojs/preact': link:../../../../integrations/preact astro: link:../../.. - preact: 10.10.6 + preact: 10.11.0 packages/astro/e2e/fixtures/react-component: specifiers: @@ -1597,7 +1597,7 @@ importers: svelte: ^3.48.0 vue: ^3.2.36 dependencies: - preact: 10.10.6 + preact: 10.11.0 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 solid-js: 1.5.4 @@ -1703,7 +1703,7 @@ importers: '@astrojs/svelte': link:../../../../integrations/svelte '@astrojs/vue': link:../../../../integrations/vue astro: link:../../.. - autoprefixer: 10.4.8_postcss@8.4.16 + autoprefixer: 10.4.9_postcss@8.4.16 postcss: 8.4.16 devDependencies: postcss-preset-env: 7.8.1_postcss@8.4.16 @@ -1718,7 +1718,7 @@ importers: '@astrojs/preact': link:../../../../integrations/preact '@test/react-lib': link:packages/react-lib astro: link:../../.. - preact: 10.10.6 + preact: 10.11.0 packages/astro/test/fixtures/preact-compat-component/packages/react-lib: specifiers: @@ -2035,7 +2035,7 @@ importers: '@astrojs/mdx': link:../../../../integrations/mdx '@astrojs/tailwind': link:../../../../integrations/tailwind astro: link:../../.. - autoprefixer: 10.4.8_postcss@8.4.16 + autoprefixer: 10.4.9_postcss@8.4.16 postcss: 8.4.16 tailwindcss: 3.1.8_postcss@8.4.16 @@ -2523,11 +2523,11 @@ 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.3_preact@10.10.6 + preact-render-to-string: 5.2.4_preact@10.11.0 devDependencies: astro: link:../../astro astro-scripts: link:../../../scripts - preact: 10.10.6 + preact: 10.11.0 packages/integrations/prefetch: specifiers: @@ -2586,7 +2586,7 @@ importers: zod: ^3.17.3 dependencies: sitemap: 7.1.1 - zod: 3.19.0 + zod: 3.19.1 devDependencies: astro: link:../../astro astro-scripts: link:../../../scripts @@ -2644,7 +2644,7 @@ importers: tailwindcss: ^3.0.24 dependencies: '@proload/core': 0.3.3 - autoprefixer: 10.4.8_postcss@8.4.16 + autoprefixer: 10.4.9_postcss@8.4.16 postcss: 8.4.16 tailwindcss: 3.1.8_postcss@8.4.16 devDependencies: @@ -2884,7 +2884,7 @@ importers: node-fetch: ^3.2.5 which-pm-runs: ^1.1.0 dependencies: - ci-info: 3.3.2 + ci-info: 3.4.0 debug: 4.3.4 dlv: 1.1.3 dset: 3.1.2 @@ -2999,8 +2999,8 @@ packages: react-dom: 18.2.0_react@18.2.0 dev: false - /@adobe/react-spectrum/3.21.1_biqbaboplfbrettd7655fr4n2y: - resolution: {integrity: sha512-qPWAcq1pXfyXJY+wy7UE4XbtGjSgsDcvv373mC3zo/dbEIZLhZy0+fT5H7J+03ucupREXSMBfQrrW6vvbNc0dw==} + /@adobe/react-spectrum/3.21.2_biqbaboplfbrettd7655fr4n2y: + resolution: {integrity: sha512-jY9yXqWSgciBx4vy+rRugje/baZLG9u8oDMmcnzICGIDUs1V6LJCmKRxymcN7jcNH3+XpGaH95AtIKwfzistEw==} peerDependencies: react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 @@ -3044,7 +3044,7 @@ packages: '@react-spectrum/slider': 3.2.1_d3gwqomfnldt4r5nc27dmvnsce '@react-spectrum/statuslight': 3.4.1_d3gwqomfnldt4r5nc27dmvnsce '@react-spectrum/switch': 3.3.1_vq3pvykbfgerr5rtx4n53bcbxy - '@react-spectrum/table': 3.3.1_vq3pvykbfgerr5rtx4n53bcbxy + '@react-spectrum/table': 3.3.2_vq3pvykbfgerr5rtx4n53bcbxy '@react-spectrum/tabs': 3.3.1_vq3pvykbfgerr5rtx4n53bcbxy '@react-spectrum/text': 3.3.1_d3gwqomfnldt4r5nc27dmvnsce '@react-spectrum/textfield': 3.7.0_vq3pvykbfgerr5rtx4n53bcbxy @@ -5133,8 +5133,8 @@ packages: dev: false optional: true - /@eslint/eslintrc/1.3.1: - resolution: {integrity: sha512-OhSY22oQQdw3zgPOOwdoj01l/Dzl1Z+xyUP33tkSN+aqyEhymJCcPHyXt+ylW8FSe0TfRC2VG+ROQOapD0aZSQ==} + /@eslint/eslintrc/1.3.2: + resolution: {integrity: sha512-AXYd23w1S/bv3fTs3Lz0vjiYemS08jWkI3hYyS9I1ry+0f+Yjs1wm+sU0BS8qDOPrBIkp4qHYC16I8uVtpLajQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 @@ -5231,7 +5231,7 @@ packages: '@antfu/utils': 0.5.2 '@iconify/types': 1.1.0 debug: 4.3.4 - kolorist: 1.5.1 + kolorist: 1.6.0 local-pkg: 0.4.2 transitivePeerDependencies: - supports-color @@ -5415,32 +5415,32 @@ packages: - supports-color dev: false - /@miniflare/cache/2.8.1: - resolution: {integrity: sha512-7b+x6TB2Jee+G0wdlW/w0GW5UpNM7e1PxDkrn2Xw1wnTLgGNTUXqPPcVNgughrszlMfvXez+PQpm3yAQ32HPmg==} + /@miniflare/cache/2.8.2: + resolution: {integrity: sha512-YaFOsXKmlNLk5xDJfyDCMsRaoZLFLPqHAiEsZBZTcCl3FlZbG2GUIvcMlfkO4OKb1nCjtr9OxFgtIdW6DEuboA==} engines: {node: '>=16.13'} dependencies: - '@miniflare/core': 2.8.1 - '@miniflare/shared': 2.8.1 + '@miniflare/core': 2.8.2 + '@miniflare/shared': 2.8.2 http-cache-semantics: 4.1.0 undici: 5.9.1 dev: true - /@miniflare/cli-parser/2.8.1: - resolution: {integrity: sha512-3pt3DlsV3BsA8/JcbZpN1vLq1CMrbpV5NBBpopzY0zlhjbjhjD0cbeVkXB7iODQmdSyIskotiie7OJtvQUPmDw==} + /@miniflare/cli-parser/2.8.2: + resolution: {integrity: sha512-qa//FhLiJpQpTngq6tCJMZqc1CjhJQV4AwKWaIp85XiVbpbN/cTzZ6PUyoYLTZ6g6dL4j+136o2bb+2XSMxVHw==} engines: {node: '>=16.13'} dependencies: - '@miniflare/shared': 2.8.1 + '@miniflare/shared': 2.8.2 kleur: 4.1.5 dev: true - /@miniflare/core/2.8.1: - resolution: {integrity: sha512-7x32lo4p3dtPAMAYvt+yiUPdtUt2hbYP2JvE7d1pasNWl4mFtgbfEQxRp1jcSFlFcatJszTsR4CAtlDP6n0Esg==} + /@miniflare/core/2.8.2: + resolution: {integrity: sha512-a9Ecyf4xALcvphQhK3qA+mtUApUrUbwcxCexXvvgVsPrQtMCOIjJ2qs7+RKrC+krCy2O8Eq/8eq2hYh4y/HOKQ==} engines: {node: '>=16.13'} dependencies: '@iarna/toml': 2.2.5 - '@miniflare/queues': 2.8.1 - '@miniflare/shared': 2.8.1 - '@miniflare/watcher': 2.8.1 + '@miniflare/queues': 2.8.2 + '@miniflare/shared': 2.8.2 + '@miniflare/watcher': 2.8.2 busboy: 1.6.0 dotenv: 10.0.0 kleur: 4.1.5 @@ -5449,33 +5449,33 @@ packages: urlpattern-polyfill: 4.0.3 dev: true - /@miniflare/durable-objects/2.8.1: - resolution: {integrity: sha512-qdBKjQssugMMtS+5g2qMvkJ37rnK37Vhlp6+I5w6g5CLEkA6hxpgWX7T7p/c5i0aBr/oT/RPsiumkXWkwzBceA==} + /@miniflare/durable-objects/2.8.2: + resolution: {integrity: sha512-jKcnb6lfgVZKfTPom2d0yPiaVAuDJLyr4itzb3nqJNH5Ld2iKJv77iSGOEOv8Wb78YEEFU8PQZvvrAC/TmN6tQ==} engines: {node: '>=16.13'} dependencies: - '@miniflare/core': 2.8.1 - '@miniflare/shared': 2.8.1 - '@miniflare/storage-memory': 2.8.1 + '@miniflare/core': 2.8.2 + '@miniflare/shared': 2.8.2 + '@miniflare/storage-memory': 2.8.2 undici: 5.9.1 dev: true - /@miniflare/html-rewriter/2.8.1: - resolution: {integrity: sha512-TkoK8jB06uwXyYTSEarmXG/FnnD90Q4FCwN9dtixlQVyGUBiVI3/KRxsXDApCJhinQRthdh4tQOMb3K2KsVd1Q==} + /@miniflare/html-rewriter/2.8.2: + resolution: {integrity: sha512-xxrLO7XMpiaWi6HSIqvAxmD5z6RRHWENkWuWjQqaqC6E6qheN+d0ZeZshyP2SRbJUw9wfFUj5zkKTva5sovzbw==} engines: {node: '>=16.13'} dependencies: - '@miniflare/core': 2.8.1 - '@miniflare/shared': 2.8.1 + '@miniflare/core': 2.8.2 + '@miniflare/shared': 2.8.2 html-rewriter-wasm: 0.4.1 undici: 5.9.1 dev: true - /@miniflare/http-server/2.8.1: - resolution: {integrity: sha512-Xp5h37G10zVDN13Nqv3RsfCI89UqGLf5YTlQ7Wj2JZi9Oz4+fWShzZCzKjtpefrPAyV0w9hPnI3088rjypUKXQ==} + /@miniflare/http-server/2.8.2: + resolution: {integrity: sha512-hrTRHHz+LWe7cLkP8Xg4hM3YRH7kI4ngOYozkEz1OC69SLBnxfT8xLkUkvz+fdJ3vquF+dpHyVQAa0dpvJShGA==} engines: {node: '>=16.13'} dependencies: - '@miniflare/core': 2.8.1 - '@miniflare/shared': 2.8.1 - '@miniflare/web-sockets': 2.8.1 + '@miniflare/core': 2.8.2 + '@miniflare/shared': 2.8.2 + '@miniflare/web-sockets': 2.8.2 kleur: 4.1.5 selfsigned: 2.1.1 undici: 5.9.1 @@ -5486,89 +5486,89 @@ packages: - utf-8-validate dev: true - /@miniflare/kv/2.8.1: - resolution: {integrity: sha512-UQkWNqNkCohMceqHwismvxUDk99+e8YAxhWBQBuHm8L1L236aID5rGVaAodlzwWFXiEwlDsqEYWXyX0x8NYGlw==} + /@miniflare/kv/2.8.2: + resolution: {integrity: sha512-radkyE6FtLGAoumf8S1VnPHAbgiP1DOzGnBnBVferMDkd86/3P8hre1a+C9PUTgt6e6KgLq4AKEFDwRJHc1MFw==} engines: {node: '>=16.13'} dependencies: - '@miniflare/shared': 2.8.1 + '@miniflare/shared': 2.8.2 dev: true - /@miniflare/queues/2.8.1: - resolution: {integrity: sha512-+VPogDWD9CnauNw5C1z8lwxBH0FX/qlPI6BGLQGXS4czPqio1py4AwZXZ4wymh7jMIn853+nExKeeZDmyl2J6Q==} + /@miniflare/queues/2.8.2: + resolution: {integrity: sha512-WYlK5L7ukdcL86DdB/BsJhnX7jcLNzyYdcn5vPQbCnDyaK1Lz9lm1RCrtCz7qwJjTrq5z453pczm0ELTxa5n9g==} engines: {node: '>=16.7'} dependencies: - '@miniflare/shared': 2.8.1 + '@miniflare/shared': 2.8.2 dev: true - /@miniflare/r2/2.8.1: - resolution: {integrity: sha512-5MMciySrss1Beh2IKNRGLmbg7do0fjvItWJcShYuyFLUXbu6WONWkhLcMP0VOAJCKs8QoPpk+ghBHODT0dybAQ==} + /@miniflare/r2/2.8.2: + resolution: {integrity: sha512-cdqq1dcgfiTlCf3wjQjrhZuRb0vJImLwYSALVEAA/4leVhwNY9ABHIn71y29Nf4bUdv2YKVSfTuV0m0CRGmOqA==} engines: {node: '>=16.13'} dependencies: - '@miniflare/shared': 2.8.1 + '@miniflare/shared': 2.8.2 undici: 5.9.1 dev: true - /@miniflare/runner-vm/2.8.1: - resolution: {integrity: sha512-oQjJdT/3k1Lq8TymAcPaWor7ik+qSjznNb8G+1GwNz5F3qT5fH8ccdmNgtqTwHTq12+U3VrmXD5c5HR7UcWaCg==} + /@miniflare/runner-vm/2.8.2: + resolution: {integrity: sha512-l9V/MedhH1Dc/xIEPEpXW57Y649lcTCYorwqnHPca3didiw75O8jI2g6MvuVlodmbimpg2WtwI7/2ac0WFZfWQ==} engines: {node: '>=16.13'} dependencies: - '@miniflare/shared': 2.8.1 + '@miniflare/shared': 2.8.2 dev: true - /@miniflare/scheduler/2.8.1: - resolution: {integrity: sha512-evhZtZMJJHalKDaqzlAaHTgLSDyj3A1mbJB3oHZQ3XLG9ufNSEPveDorLTppi0yYjGz9ju+duX/GPXlky35InQ==} + /@miniflare/scheduler/2.8.2: + resolution: {integrity: sha512-vhtyPky+1Phq4Arul3mpzRWJuqJex2YgkPnf9MLA977dcxptRBOzGIxwVPzaUTtko4mHwwzEyl15diT/BXkPJA==} engines: {node: '>=16.13'} dependencies: - '@miniflare/core': 2.8.1 - '@miniflare/shared': 2.8.1 + '@miniflare/core': 2.8.2 + '@miniflare/shared': 2.8.2 cron-schedule: 3.0.6 dev: true - /@miniflare/shared/2.8.1: - resolution: {integrity: sha512-FzTMDdE1CBdfd0gJeRlT0qZHTHjul2tzPyzohRLZqy+FEeCp5ONtvjFfFUQdu8MUJTdEumaU28Dyov3vMTLT/Q==} + /@miniflare/shared/2.8.2: + resolution: {integrity: sha512-cjuLIeTAlqcb1POrK4nLa8Bt79SfzbglUr/w78xRAUUoOdB0Lsm3HnEERzD1o0lO2G/Q9F+VDAp2QyglPFV61A==} engines: {node: '>=16.13'} dependencies: kleur: 4.1.5 picomatch: 2.3.1 dev: true - /@miniflare/sites/2.8.1: - resolution: {integrity: sha512-28OivP5IawW5IeDAGiKpmWx9HjLzEfsU7GItnlPGLz74Lx9K99dYYU7Z2PqGjV9QhXiz5qWSD7sGKc4EdvCcrw==} + /@miniflare/sites/2.8.2: + resolution: {integrity: sha512-zdzg8gm/I4bcUIQ4Yo9WqvTQJN+yOnpPqbQ/nKKd6tebrX4k+sw9wTTGl42MjQ4NN5XfNy3xFERo21i1jLgziA==} engines: {node: '>=16.13'} dependencies: - '@miniflare/kv': 2.8.1 - '@miniflare/shared': 2.8.1 - '@miniflare/storage-file': 2.8.1 + '@miniflare/kv': 2.8.2 + '@miniflare/shared': 2.8.2 + '@miniflare/storage-file': 2.8.2 dev: true - /@miniflare/storage-file/2.8.1: - resolution: {integrity: sha512-39xNWssHvQQKtuAq/gc4aXBQ1koyy2peoYHN5iFIhuOFmnzQpBKJFlEjRIGNBq6yEefqTYzZa4NKwil4Qt3fZw==} + /@miniflare/storage-file/2.8.2: + resolution: {integrity: sha512-M5f+vDVjkghix1sCGQy+apiokTBoOU/V7pBaIsHZTnD/58S6/T2s7glD12Dwfr+u1cCjWxEJx+jaXYIBAKbmQQ==} engines: {node: '>=16.13'} dependencies: - '@miniflare/shared': 2.8.1 - '@miniflare/storage-memory': 2.8.1 + '@miniflare/shared': 2.8.2 + '@miniflare/storage-memory': 2.8.2 dev: true - /@miniflare/storage-memory/2.8.1: - resolution: {integrity: sha512-JHqaLN5B0BAo9KrZd4J+Jsk7gKijN8UZk8QOnlWCE8MHBOnjQKHcKFAU2oR3FZmUsMXj6BTkG4ZbfmWT9WFLWg==} + /@miniflare/storage-memory/2.8.2: + resolution: {integrity: sha512-9OclkkWBbJwo6WJEz2QCbHsvMt+qraq/xIbuFOByytAcyjomp1gm1ZUaKZ5VkkqMXMgdQ1E+6wTq2iA1p+YRcg==} engines: {node: '>=16.13'} dependencies: - '@miniflare/shared': 2.8.1 + '@miniflare/shared': 2.8.2 dev: true - /@miniflare/watcher/2.8.1: - resolution: {integrity: sha512-tQNwNiSqKGtuJXLFiz50cqBbfuF6sro9WhNlphDn48lXM13s/HKJ8thJSL/i0rwpv5zyyJENm4teDe+4dddrfA==} + /@miniflare/watcher/2.8.2: + resolution: {integrity: sha512-2+awQITWkUGb9GlpzVmYwoe+qiSibni7C6gVDnkxorBRoecwUAzjFRF09QjdEn40+q7peNdE0ui1oWjZMgOaHg==} engines: {node: '>=16.13'} dependencies: - '@miniflare/shared': 2.8.1 + '@miniflare/shared': 2.8.2 dev: true - /@miniflare/web-sockets/2.8.1: - resolution: {integrity: sha512-Tdzr1OPjzod+JCCnCgNoyGCc3rFIVgoMF6gVBvv/9Aqdi1+ZXxb7tBf4W8rr85IJtVdTpS6mpBwS07P5vDttxA==} + /@miniflare/web-sockets/2.8.2: + resolution: {integrity: sha512-oW9vG7zImwZZ/OKuAI4CEMtVqYVQqWe9MoO47VoxmB/WMMdaXJArx+k8xcJJJL7tcHVtbwBHsypJf69DOtrCmg==} engines: {node: '>=16.13'} dependencies: - '@miniflare/core': 2.8.1 - '@miniflare/shared': 2.8.1 + '@miniflare/core': 2.8.2 + '@miniflare/shared': 2.8.2 undici: 5.9.1 ws: 8.8.1 transitivePeerDependencies: @@ -5576,7 +5576,7 @@ packages: - utf-8-validate dev: true - /@nanostores/preact/0.1.3_sjll44dhi63q3s6wepldehyzyi: + /@nanostores/preact/0.1.3_wyz6kgcab5rxpkhqcycsg2kmqm: resolution: {integrity: sha512-uiX1ned0LrzASot+sPUjyJzr8Js3pX075omazgsSdLf0zPp4ss8xwTiuNh5FSKigTSQEVqZFiS+W8CnHIrX62A==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} peerDependencies: @@ -5584,7 +5584,7 @@ packages: preact: '>=10.0.0' dependencies: nanostores: 0.5.13 - preact: 10.10.6 + preact: 10.11.0 dev: false /@netlify/edge-handler-types/0.34.1: @@ -5649,7 +5649,7 @@ packages: resolution: {integrity: sha512-/USkK4cioY209wXRpund6HZzHo9GmjakpV9ycOkpMcMxMk7QVcVFVyCMtzvXYiHsB2crgDgrtNYSELYFBXhhaA==} engines: {node: '>= 14'} dependencies: - '@octokit/types': 7.3.0 + '@octokit/types': 7.3.1 dev: true /@octokit/core/3.6.0: @@ -5688,8 +5688,8 @@ packages: resolution: {integrity: sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==} dev: true - /@octokit/openapi-types/13.9.0: - resolution: {integrity: sha512-MOYjRyLIM0zzNb9RfEwVK6HLIc2nIF2OMVtMqiNOGbX0SHrQvQbI6X1K16ktmaHr8WUBv+eeul8cD9mz4rNiWQ==} + /@octokit/openapi-types/13.9.1: + resolution: {integrity: sha512-98zOxAAR8MDHjXI2xGKgn/qkZLwfcNjHka0baniuEpN1fCv3kDJeh5qc0mBwim5y31eaPaYer9QikzwOkQq3wQ==} dev: true /@octokit/plugin-paginate-rest/2.21.3_@octokit+core@3.6.0: @@ -5738,10 +5738,10 @@ packages: '@octokit/openapi-types': 12.11.0 dev: true - /@octokit/types/7.3.0: - resolution: {integrity: sha512-7Ar22AVxsJBYZuPkGQwFQybGt2YjuP6j6Z36bPntIYy3R9qSowB55mXOsb16hc0UqtJkYBrRMVXKlaX1OHsh1g==} + /@octokit/types/7.3.1: + resolution: {integrity: sha512-Vefohn8pHGFYWbSc6du0wXMK/Pmy6h0H4lttBw5WqquEuxjdXwyYX07CeZpJDkzSzpdKxBoWRNuDJGTE+FvtqA==} dependencies: - '@octokit/openapi-types': 13.9.0 + '@octokit/openapi-types': 13.9.1 dev: true /@pkgr/utils/2.3.1: @@ -5908,7 +5908,7 @@ packages: '@react-aria/utils': 3.13.3_react@18.2.0 '@react-stately/collections': 3.4.3_react@18.2.0 '@react-stately/combobox': 3.2.1_react@18.2.0 - '@react-stately/layout': 3.7.0_react@18.2.0 + '@react-stately/layout': 3.7.1_react@18.2.0 '@react-types/button': 3.6.1_react@18.2.0 '@react-types/combobox': 3.5.3_react@18.2.0 '@react-types/shared': 3.14.1_react@18.2.0 @@ -7108,7 +7108,7 @@ packages: '@react-spectrum/text': 3.3.1_d3gwqomfnldt4r5nc27dmvnsce '@react-spectrum/utils': 3.7.3_react@18.2.0 '@react-stately/collections': 3.4.3_react@18.2.0 - '@react-stately/layout': 3.7.0_react@18.2.0 + '@react-stately/layout': 3.7.1_react@18.2.0 '@react-stately/list': 3.5.3_react@18.2.0 '@react-stately/virtualizer': 3.3.0_react@18.2.0 '@react-types/grid': 3.1.3_react@18.2.0 @@ -7146,7 +7146,7 @@ packages: '@react-spectrum/text': 3.3.1_d3gwqomfnldt4r5nc27dmvnsce '@react-spectrum/utils': 3.7.3_react@18.2.0 '@react-stately/collections': 3.4.3_react@18.2.0 - '@react-stately/layout': 3.7.0_react@18.2.0 + '@react-stately/layout': 3.7.1_react@18.2.0 '@react-stately/list': 3.5.3_react@18.2.0 '@react-stately/virtualizer': 3.3.0_react@18.2.0 '@react-types/listbox': 3.3.3_react@18.2.0 @@ -7472,8 +7472,8 @@ packages: - react-dom dev: false - /@react-spectrum/table/3.3.1_vq3pvykbfgerr5rtx4n53bcbxy: - resolution: {integrity: sha512-iJaUIh0iPViqRdVd70e8PkMr7XA2HF8kSqTAlkJeNyvO5h3XtXTLXJhkhKM5mCSeHGENxxScAik/JJkHsjyWug==} + /@react-spectrum/table/3.3.2_vq3pvykbfgerr5rtx4n53bcbxy: + resolution: {integrity: sha512-41vbtsx4Ah/aiHXVa4gDGAOToyjAXgXCG7FPjormaf1J6DVrsK7sZaGdNG4ziNwjgfQUc6nXMmnDpAqgn9NhYg==} peerDependencies: '@react-spectrum/provider': ^3.0.0 react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 @@ -7503,7 +7503,7 @@ packages: '@react-spectrum/utils': 3.7.3_react@18.2.0 '@react-stately/collections': 3.4.3_react@18.2.0 '@react-stately/grid': 3.3.1_react@18.2.0 - '@react-stately/layout': 3.7.0_react@18.2.0 + '@react-stately/layout': 3.7.1_react@18.2.0 '@react-stately/table': 3.4.0_react@18.2.0 '@react-stately/virtualizer': 3.3.0_react@18.2.0 '@react-types/grid': 3.1.3_react@18.2.0 @@ -7840,8 +7840,8 @@ packages: react: 18.2.0 dev: false - /@react-stately/layout/3.7.0_react@18.2.0: - resolution: {integrity: sha512-8jUIpsgcKmpvSTUxpXTi7pvkPg6IR4hNQb5VQaOAuzuQRPAfafl7OmIKFggUeeiUgBie/6O7CWXgy/jcORnq8A==} + /@react-stately/layout/3.7.1_react@18.2.0: + resolution: {integrity: sha512-lJpvRryEwatfKaI3ZoUtWMhEIBFAR/w8v0GeD68+LOixSgr/ROB7nCrsbHt8IYzB/olmPa/PwAolf+Yhiu5UxQ==} peerDependencies: react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 peerDependenciesMeta: @@ -8954,7 +8954,7 @@ packages: /@types/is-ci/3.0.0: resolution: {integrity: sha512-Q0Op0hdWbYd1iahB+IFNQcWXFq4O0Q5MwQP7uN0souuQ4rPg1vEYcnIOfr1gY+M+6rc8FGoRaBO1mOOvL29sEQ==} dependencies: - ci-info: 3.3.2 + ci-info: 3.4.0 dev: true /@types/json-schema/7.0.11: @@ -9076,8 +9076,8 @@ packages: '@types/scheduler': 0.16.2 csstype: 3.1.0 - /@types/react/18.0.18: - resolution: {integrity: sha512-6hI08umYs6NaiHFEEGioXnxJ+oEhY3eRz8VCUaudZmGdtvPviCJB8mgaMxaDWAdPSYd4eFavrPk2QIolwbLYrg==} + /@types/react/18.0.19: + resolution: {integrity: sha512-BDc3Q+4Q3zsn7k9xZrKfjWyJsSlEDMs38gD1qp2eDazLCdcPqAT+vq1ND+Z8AGel/UiwzNUk8ptpywgNQcJ1MQ==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.2 @@ -9161,7 +9161,7 @@ packages: /@types/yargs-parser/21.0.0: resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} - /@typescript-eslint/eslint-plugin/5.36.2_kou65mzxaniwtkb2mhvaghdcyi: + /@typescript-eslint/eslint-plugin/5.36.2_ymvve5pmriizw6sqldrdyt3llu: resolution: {integrity: sha512-OwwR8LRwSnI98tdc2z7mJYgY60gf7I9ZfGjN5EjCwwns9bdTuQfAXcsjSB2wSQ/TVNYSGKf4kzVXbNGaZvwiXw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -9172,12 +9172,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.36.2_sorwav4hsh5vncerguqybud76i + '@typescript-eslint/parser': 5.36.2_4brgkhw6cq4me3drk3kxrpb2mm '@typescript-eslint/scope-manager': 5.36.2 - '@typescript-eslint/type-utils': 5.36.2_sorwav4hsh5vncerguqybud76i - '@typescript-eslint/utils': 5.36.2_sorwav4hsh5vncerguqybud76i + '@typescript-eslint/type-utils': 5.36.2_4brgkhw6cq4me3drk3kxrpb2mm + '@typescript-eslint/utils': 5.36.2_4brgkhw6cq4me3drk3kxrpb2mm debug: 4.3.4 - eslint: 8.23.0 + eslint: 8.23.1 functional-red-black-tree: 1.0.1 ignore: 5.2.0 regexpp: 3.2.0 @@ -9188,7 +9188,7 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.36.2_sorwav4hsh5vncerguqybud76i: + /@typescript-eslint/parser/5.36.2_4brgkhw6cq4me3drk3kxrpb2mm: resolution: {integrity: sha512-qS/Kb0yzy8sR0idFspI9Z6+t7mqk/oRjnAYfewG+VN73opAUvmYL3oPIMmgOX6CnQS6gmVIXGshlb5RY/R22pA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -9202,7 +9202,7 @@ packages: '@typescript-eslint/types': 5.36.2 '@typescript-eslint/typescript-estree': 5.36.2_typescript@4.7.4 debug: 4.3.4 - eslint: 8.23.0 + eslint: 8.23.1 typescript: 4.7.4 transitivePeerDependencies: - supports-color @@ -9216,7 +9216,7 @@ packages: '@typescript-eslint/visitor-keys': 5.36.2 dev: true - /@typescript-eslint/type-utils/5.36.2_sorwav4hsh5vncerguqybud76i: + /@typescript-eslint/type-utils/5.36.2_4brgkhw6cq4me3drk3kxrpb2mm: resolution: {integrity: sha512-rPQtS5rfijUWLouhy6UmyNquKDPhQjKsaKH0WnY6hl/07lasj8gPaH2UD8xWkePn6SC+jW2i9c2DZVDnL+Dokw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -9227,9 +9227,9 @@ packages: optional: true dependencies: '@typescript-eslint/typescript-estree': 5.36.2_typescript@4.7.4 - '@typescript-eslint/utils': 5.36.2_sorwav4hsh5vncerguqybud76i + '@typescript-eslint/utils': 5.36.2_4brgkhw6cq4me3drk3kxrpb2mm debug: 4.3.4 - eslint: 8.23.0 + eslint: 8.23.1 tsutils: 3.21.0_typescript@4.7.4 typescript: 4.7.4 transitivePeerDependencies: @@ -9262,7 +9262,7 @@ packages: - supports-color dev: true - /@typescript-eslint/utils/5.36.2_sorwav4hsh5vncerguqybud76i: + /@typescript-eslint/utils/5.36.2_4brgkhw6cq4me3drk3kxrpb2mm: resolution: {integrity: sha512-uNcopWonEITX96v9pefk9DC1bWMdkweeSsewJ6GeC7L6j2t0SJywisgkr9wUTtXk90fi2Eljj90HSHm3OGdGRg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -9272,9 +9272,9 @@ packages: '@typescript-eslint/scope-manager': 5.36.2 '@typescript-eslint/types': 5.36.2 '@typescript-eslint/typescript-estree': 5.36.2_typescript@4.7.4 - eslint: 8.23.0 + eslint: 8.23.1 eslint-scope: 5.1.1 - eslint-utils: 3.0.0_eslint@8.23.0 + eslint-utils: 3.0.0_eslint@8.23.1 transitivePeerDependencies: - supports-color - typescript @@ -9705,8 +9705,8 @@ packages: dependencies: color-convert: 2.0.1 - /ansi-styles/6.1.0: - resolution: {integrity: sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ==} + /ansi-styles/6.1.1: + resolution: {integrity: sha512-qDOv24WjnYuL+wbwHdlsYZFy+cgPtrYw0Tn7GLORicQp9BkQLzrgI3Pm4VyR9ERZ41YTn7KlMPuL1n05WdZvmg==} engines: {node: '>=12'} dev: false @@ -9827,15 +9827,15 @@ packages: engines: {node: '>= 4.0.0'} dev: false - /autoprefixer/10.4.8_postcss@8.4.16: - resolution: {integrity: sha512-75Jr6Q/XpTqEf6D2ltS5uMewJIx5irCU1oBYJrWjFenq/m12WRRrz6g15L1EIoYvPLXTbEry7rDOwrcYNj77xw==} + /autoprefixer/10.4.9_postcss@8.4.16: + resolution: {integrity: sha512-Uu67eduPEmOeA0vyJby5ghu1AAELCCNSsLAjK+lz6kYzNM5sqnBO36MqfsjhPjQF/BaJM5U/UuFYyl7PavY/wQ==} engines: {node: ^10 || ^12 || >=14} hasBin: true peerDependencies: postcss: ^8.1.0 dependencies: browserslist: 4.21.3 - caniuse-lite: 1.0.30001393 + caniuse-lite: 1.0.30001397 fraction.js: 4.2.0 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -10033,8 +10033,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001393 - electron-to-chromium: 1.4.246 + caniuse-lite: 1.0.30001397 + electron-to-chromium: 1.4.247 node-releases: 2.0.6 update-browserslist-db: 1.0.7_browserslist@4.21.3 @@ -10114,8 +10114,8 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} - /caniuse-lite/1.0.30001393: - resolution: {integrity: sha512-N/od11RX+Gsk+1qY/jbPa0R6zJupEa0lxeBG598EbrtblxVCTJsQwbRBm6+V+rxpc5lHKdsXb9RY83cZIPLseA==} + /caniuse-lite/1.0.30001397: + resolution: {integrity: sha512-SW9N2TbCdLf0eiNDRrrQXx2sOkaakNZbCjgNpPyMJJbiOrU5QzMIrXOVMRM1myBXTD5iTkdrtU/EguCrBocHlA==} /canvas-confetti/1.5.1: resolution: {integrity: sha512-Ncz+oZJP6OvY7ti4E1slxVlyAV/3g7H7oQtcCDXgwGgARxPnwYY9PW5Oe+I8uvspYNtuHviAdgA0LfcKFWJfpg==} @@ -10236,8 +10236,8 @@ packages: engines: {node: '>=10'} dev: false - /ci-info/3.3.2: - resolution: {integrity: sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==} + /ci-info/3.4.0: + resolution: {integrity: sha512-t5QdPT5jq3o262DOQ8zA6E1tlH2upmUc4Hlvrbx1pGYJuiiHl7O7rvVNI+l8HTVhd/q3Qc9vqimkNk5yiXsAug==} /clean-stack/2.2.0: resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} @@ -10851,8 +10851,8 @@ packages: jake: 10.8.5 dev: false - /electron-to-chromium/1.4.246: - resolution: {integrity: sha512-/wFCHUE+Hocqr/LlVGsuKLIw4P2lBWwFIDcNMDpJGzyIysQV4aycpoOitAs32FT94EHKnNqDR/CVZJFbXEufJA==} + /electron-to-chromium/1.4.247: + resolution: {integrity: sha512-FLs6R4FQE+1JHM0hh3sfdxnYjKvJpHZyhQDjc2qFq/xFvmmRt/TATNToZhrcGUFzpF2XjeiuozrA8lI0PZmYYw==} /emmet/2.3.6: resolution: {integrity: sha512-pLS4PBPDdxuUAmw7Me7+TcHbykTsBKN/S9XJbUOMFQrNv9MoshzyMFK/R57JBm94/6HSL4vHnDeEmxlC82NQ4A==} @@ -10910,7 +10910,7 @@ packages: has-property-descriptors: 1.0.0 has-symbols: 1.0.3 internal-slot: 1.0.3 - is-callable: 1.2.4 + is-callable: 1.2.5 is-negative-zero: 2.0.2 is-regex: 1.1.4 is-shared-array-buffer: 1.0.2 @@ -10938,7 +10938,7 @@ packages: resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} engines: {node: '>= 0.4'} dependencies: - is-callable: 1.2.4 + is-callable: 1.2.5 is-date-object: 1.0.5 is-symbol: 1.0.4 @@ -11582,13 +11582,13 @@ packages: source-map: 0.6.1 dev: true - /eslint-config-prettier/8.5.0_eslint@8.23.0: + /eslint-config-prettier/8.5.0_eslint@8.23.1: resolution: {integrity: sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.23.0 + eslint: 8.23.1 dev: true /eslint-plugin-no-only-tests/2.6.0: @@ -11596,7 +11596,7 @@ packages: engines: {node: '>=4.0.0'} dev: true - /eslint-plugin-prettier/4.2.1_tgumt6uwl2md3n6uqnggd6wvce: + /eslint-plugin-prettier/4.2.1_cabrci5exjdaojcvd6xoxgeowu: resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -11607,8 +11607,8 @@ packages: eslint-config-prettier: optional: true dependencies: - eslint: 8.23.0 - eslint-config-prettier: 8.5.0_eslint@8.23.0 + eslint: 8.23.1 + eslint-config-prettier: 8.5.0_eslint@8.23.1 prettier: 2.7.1 prettier-linter-helpers: 1.0.0 dev: true @@ -11629,13 +11629,13 @@ packages: estraverse: 5.3.0 dev: true - /eslint-utils/3.0.0_eslint@8.23.0: + /eslint-utils/3.0.0_eslint@8.23.1: resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} peerDependencies: eslint: '>=5' dependencies: - eslint: 8.23.0 + eslint: 8.23.1 eslint-visitor-keys: 2.1.0 dev: true @@ -11649,12 +11649,12 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint/8.23.0: - resolution: {integrity: sha512-pBG/XOn0MsJcKcTRLr27S5HpzQo4kLr+HjLQIyK4EiCsijDl/TB+h5uEuJU6bQ8Edvwz1XWOjpaP2qgnXGpTcA==} + /eslint/8.23.1: + resolution: {integrity: sha512-w7C1IXCc6fNqjpuYd0yPlcTKKmHlHHktRkzmBPZ+7cvNBQuiNjx0xaMTjAJGCafJhQkrFJooREv0CtrVzmHwqg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint/eslintrc': 1.3.1 + '@eslint/eslintrc': 1.3.2 '@humanwhocodes/config-array': 0.10.4 '@humanwhocodes/gitignore-to-minimatch': 1.0.2 '@humanwhocodes/module-importer': 1.0.1 @@ -11665,7 +11665,7 @@ packages: doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.1.1 - eslint-utils: 3.0.0_eslint@8.23.0 + eslint-utils: 3.0.0_eslint@8.23.1 eslint-visitor-keys: 3.3.0 espree: 9.4.0 esquery: 1.4.0 @@ -11673,7 +11673,6 @@ packages: fast-deep-equal: 3.1.3 file-entry-cache: 6.0.1 find-up: 5.0.0 - functional-red-black-tree: 1.0.1 glob-parent: 6.0.2 globals: 13.17.0 globby: 11.1.0 @@ -11682,6 +11681,7 @@ packages: import-fresh: 3.3.0 imurmurhash: 0.1.4 is-glob: 4.0.3 + js-sdsl: 4.1.4 js-yaml: 4.1.0 json-stable-stringify-without-jsonify: 1.0.1 levn: 0.4.1 @@ -12735,15 +12735,15 @@ packages: builtin-modules: 3.3.0 dev: true - /is-callable/1.2.4: - resolution: {integrity: sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==} + /is-callable/1.2.5: + resolution: {integrity: sha512-ZIWRujF6MvYGkEuHMYtFRkL2wAtFw89EHfKlXrkPkjQZZRWeh9L1q3SV13NIfHnqxugjLvAOkEHx9mb1zcMnEw==} engines: {node: '>= 0.4'} /is-ci/3.0.1: resolution: {integrity: sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==} hasBin: true dependencies: - ci-info: 3.3.2 + ci-info: 3.4.0 dev: true /is-core-module/2.10.0: @@ -12974,6 +12974,10 @@ packages: hasBin: true dev: false + /js-sdsl/4.1.4: + resolution: {integrity: sha512-Y2/yD55y5jteOAmY50JbUZYwk3CP3wnLPEZnlR1w9oKhITrBEtAxwuWKebFf8hMrPMgbYwFoWK/lH2sBkErELw==} + dev: true + /js-tokens/4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -13072,8 +13076,8 @@ packages: resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} engines: {node: '>=6'} - /kolorist/1.5.1: - resolution: {integrity: sha512-lxpCM3HTvquGxKGzHeknB/sUjuVoUElLlfYnXZT73K8geR9jQbroGlSCFBax9/0mpGoD3kzcMLnOlGQPJJNyqQ==} + /kolorist/1.6.0: + resolution: {integrity: sha512-dLkz37Ab97HWMx9KTes3Tbi3D1ln9fCAy2zr2YVExJasDRPGRaKcoE4fycWNtnCAJfjFqe0cnY+f8KT2JePEXQ==} dev: false /leven/3.1.0: @@ -13929,12 +13933,12 @@ packages: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} - /miniflare/2.8.1: - resolution: {integrity: sha512-Icp9SMl/GwrdcQYSVU0HZ8insZeEG0K3QUXP+a1FKQ6UvoRcP5gw3c0OTcZaoZErOnE6YFh7xO7cuE1KSOWRFA==} + /miniflare/2.8.2: + resolution: {integrity: sha512-t9/QeSSsUFuqafLVAPlmWmoG+egfJ99xtoOWw1C9Wt6nlXz9ox3y1TfAw06YUPp4xVHcQnHQcir7aL4QvRPgfw==} engines: {node: '>=16.13'} hasBin: true peerDependencies: - '@miniflare/storage-redis': 2.8.1 + '@miniflare/storage-redis': 2.8.2 cron-schedule: ^3.0.4 ioredis: ^4.27.9 peerDependenciesMeta: @@ -13945,22 +13949,22 @@ packages: ioredis: optional: true dependencies: - '@miniflare/cache': 2.8.1 - '@miniflare/cli-parser': 2.8.1 - '@miniflare/core': 2.8.1 - '@miniflare/durable-objects': 2.8.1 - '@miniflare/html-rewriter': 2.8.1 - '@miniflare/http-server': 2.8.1 - '@miniflare/kv': 2.8.1 - '@miniflare/queues': 2.8.1 - '@miniflare/r2': 2.8.1 - '@miniflare/runner-vm': 2.8.1 - '@miniflare/scheduler': 2.8.1 - '@miniflare/shared': 2.8.1 - '@miniflare/sites': 2.8.1 - '@miniflare/storage-file': 2.8.1 - '@miniflare/storage-memory': 2.8.1 - '@miniflare/web-sockets': 2.8.1 + '@miniflare/cache': 2.8.2 + '@miniflare/cli-parser': 2.8.2 + '@miniflare/core': 2.8.2 + '@miniflare/durable-objects': 2.8.2 + '@miniflare/html-rewriter': 2.8.2 + '@miniflare/http-server': 2.8.2 + '@miniflare/kv': 2.8.2 + '@miniflare/queues': 2.8.2 + '@miniflare/r2': 2.8.2 + '@miniflare/runner-vm': 2.8.2 + '@miniflare/scheduler': 2.8.2 + '@miniflare/shared': 2.8.2 + '@miniflare/sites': 2.8.2 + '@miniflare/storage-file': 2.8.2 + '@miniflare/storage-memory': 2.8.2 + '@miniflare/web-sockets': 2.8.2 kleur: 4.1.5 semiver: 1.1.0 source-map-support: 0.5.21 @@ -15027,7 +15031,7 @@ packages: '@csstools/postcss-text-decoration-shorthand': 1.0.0_postcss@8.4.16 '@csstools/postcss-trigonometric-functions': 1.0.2_postcss@8.4.16 '@csstools/postcss-unset-value': 1.0.2_postcss@8.4.16 - autoprefixer: 10.4.8_postcss@8.4.16 + autoprefixer: 10.4.9_postcss@8.4.16 browserslist: 4.21.3 css-blank-pseudo: 3.0.3_postcss@8.4.16 css-has-pseudo: 3.0.4_postcss@8.4.16 @@ -15111,17 +15115,17 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 - /preact-render-to-string/5.2.3_preact@10.10.6: - resolution: {integrity: sha512-aPDxUn5o3GhWdtJtW0svRC2SS/l8D9MAgo2+AWml+BhDImb27ALf04Q2d+AHqUUOc6RdSXFIBVa2gxzgMKgtZA==} + /preact-render-to-string/5.2.4_preact@10.11.0: + resolution: {integrity: sha512-iIPHb3BXUQ3Za6KNhkjN/waq11Oh+QWWtAgN3id3LrL+cszH3DYh8TxJPNQ6Aogsbu4JsqdJLBZltwPFpG6N6w==} peerDependencies: preact: '>=10' dependencies: - preact: 10.10.6 + preact: 10.11.0 pretty-format: 3.8.0 dev: false - /preact/10.10.6: - resolution: {integrity: sha512-w0mCL5vICUAZrh1DuHEdOWBjxdO62lvcO++jbzr8UhhYcTbFkpegLH9XX+7MadjTl/y0feoqwQ/zAnzkc/EGog==} + /preact/10.11.0: + resolution: {integrity: sha512-Fk6+vB2kb6mSJfDgODq0YDhMfl0HNtK5+Uc9QqECO4nlyPAQwCI+BKyWO//idA7ikV7o+0Fm6LQmNuQi1wXI1w==} /preact/10.6.6: resolution: {integrity: sha512-dgxpTFV2vs4vizwKohYKkk7g7rmp1wOOcfd4Tz3IB3Wi+ivZzsn/SpeKJhRENSE+n8sUfsAl4S3HiCVT923ABw==} @@ -17576,7 +17580,7 @@ packages: /wide-align/1.1.5: resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} dependencies: - string-width: 4.2.3 + string-width: 1.0.2 dev: false /widest-line/4.0.1: @@ -17752,7 +17756,7 @@ packages: blake3-wasm: 2.1.5 chokidar: 3.5.3 esbuild: 0.14.51 - miniflare: 2.8.1 + miniflare: 2.8.2 nanoid: 3.3.4 path-to-regexp: 6.2.1 selfsigned: 2.1.1 @@ -17789,7 +17793,7 @@ packages: resolution: {integrity: sha512-QFF+ufAqhoYHvoHdajT/Po7KoXVBPXS2bgjIam5isfWJPfIOnQZ50JtUiVvCv/sjgacf3yRrt2ZKUZ/V4itN4g==} engines: {node: '>=12'} dependencies: - ansi-styles: 6.1.0 + ansi-styles: 6.1.1 string-width: 5.1.2 strip-ansi: 7.0.1 dev: false @@ -17941,8 +17945,8 @@ packages: stack-trace: 0.0.10 dev: true - /zod/3.19.0: - resolution: {integrity: sha512-Yw0qvUsCNGBe5YacikdMt5gVYeUuaEFVDIHKMfElrGSaBhwR3CQK6vOzgfAJOjTdGIhEeoaj8GtT+NDZrepZbw==} + /zod/3.19.1: + resolution: {integrity: sha512-LYjZsEDhCdYET9ikFu6dVPGp2YH9DegXjdJToSzD9rO6fy4qiRYFoyEYwps88OseJlPyl2NOe2iJuhEhL7IpEA==} dev: false /zwitch/2.0.2: From 0dba3b6f3fbd013f922fd11b9d6d977d165a512a Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Mon, 12 Sep 2022 14:40:31 -0400 Subject: [PATCH 03/15] Make error handling more resilient in the dev server (#4723) * Make error handling more resilient in the dev server * Better approach * Add a changeset --- .changeset/orange-cycles-serve.md | 5 +++ packages/astro/src/core/errors.ts | 23 ++++++++----- .../src/vite-plugin-astro-server/index.ts | 2 +- packages/astro/test/error-bad-js.test.js | 34 +++++++++++++++++++ .../fixtures/error-bad-js/astro.config.mjs | 3 ++ .../test/fixtures/error-bad-js/package.json | 15 ++++++++ .../test/fixtures/error-bad-js/src/env.d.ts | 1 + .../error-bad-js/src/pages/index.astro | 16 +++++++++ .../fixtures/error-bad-js/src/something.js | 1 + pnpm-lock.yaml | 6 ++++ 10 files changed, 96 insertions(+), 10 deletions(-) create mode 100644 .changeset/orange-cycles-serve.md create mode 100644 packages/astro/test/error-bad-js.test.js create mode 100644 packages/astro/test/fixtures/error-bad-js/astro.config.mjs create mode 100644 packages/astro/test/fixtures/error-bad-js/package.json create mode 100644 packages/astro/test/fixtures/error-bad-js/src/env.d.ts create mode 100644 packages/astro/test/fixtures/error-bad-js/src/pages/index.astro create mode 100644 packages/astro/test/fixtures/error-bad-js/src/something.js diff --git a/.changeset/orange-cycles-serve.md b/.changeset/orange-cycles-serve.md new file mode 100644 index 000000000..123593116 --- /dev/null +++ b/.changeset/orange-cycles-serve.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Makes the dev server more resilient to crashes diff --git a/packages/astro/src/core/errors.ts b/packages/astro/src/core/errors.ts index d96fbe885..9b2c7c174 100644 --- a/packages/astro/src/core/errors.ts +++ b/packages/astro/src/core/errors.ts @@ -48,7 +48,10 @@ export function cleanErrorStack(stack: string) { export function fixViteErrorMessage(_err: unknown, server?: ViteDevServer, filePath?: URL) { const err = createSafeError(_err); // Vite will give you better stacktraces, using sourcemaps. - server?.ssrFixStacktrace(err); + try { + server?.ssrFixStacktrace(err); + } catch {} + // Fix: Astro.glob() compiles to import.meta.glob() by the time Vite sees it, // so we need to update this error message in case it originally came from Astro.glob(). if (err.message === 'import.meta.glob() can only accept string literals.') { @@ -57,14 +60,16 @@ export function fixViteErrorMessage(_err: unknown, server?: ViteDevServer, fileP if (filePath && /failed to load module for ssr:/.test(err.message)) { const importName = err.message.split('for ssr:').at(1)?.trim(); if (importName) { - const content = fs.readFileSync(fileURLToPath(filePath)).toString(); - const lns = content.split('\n'); - const line = lns.findIndex((ln) => ln.includes(importName)); - if (line == -1) return err; - const column = lns[line]?.indexOf(importName); - if (!(err as any).id) { - (err as any).id = `${fileURLToPath(filePath)}:${line + 1}:${column + 1}`; - } + try { + const content = fs.readFileSync(fileURLToPath(filePath)).toString(); + const lns = content.split('\n'); + const line = lns.findIndex((ln) => ln.includes(importName)); + if (line == -1) return err; + const column = lns[line]?.indexOf(importName); + if (!(err as any).id) { + (err as any).id = `${fileURLToPath(filePath)}:${line + 1}:${column + 1}`; + } + } catch {} } } return err; diff --git a/packages/astro/src/vite-plugin-astro-server/index.ts b/packages/astro/src/vite-plugin-astro-server/index.ts index 5a550ec18..05f2b893a 100644 --- a/packages/astro/src/vite-plugin-astro-server/index.ts +++ b/packages/astro/src/vite-plugin-astro-server/index.ts @@ -348,7 +348,7 @@ async function handleRequest( return await writeSSRResult(result, res); } } catch (_err) { - const err = fixViteErrorMessage(createSafeError(_err), viteServer, filePath); + const err = fixViteErrorMessage(_err, viteServer, filePath); const errorWithMetadata = collectErrorMetadata(err); error(logging, null, msg.formatErrorMessage(errorWithMetadata)); handle500Response(viteServer, origin, req, res, errorWithMetadata); diff --git a/packages/astro/test/error-bad-js.test.js b/packages/astro/test/error-bad-js.test.js new file mode 100644 index 000000000..0f4c12e6d --- /dev/null +++ b/packages/astro/test/error-bad-js.test.js @@ -0,0 +1,34 @@ +import { expect } from 'chai'; +import * as cheerio from 'cheerio'; +import { loadFixture } from './test-utils.js'; + +describe('Errors in JavaScript', () => { + /** @type {import('./test-utils').Fixture} */ + let fixture; + + /** @type {import('./test-utils').DevServer} */ + let devServer; + + before(async () => { + fixture = await loadFixture({ + root: './fixtures/error-bad-js', + }); + devServer = await fixture.startDevServer(); + }); + + after(async() => { + await devServer.stop(); + }); + + it('Does not crash the dev server', async () => { + let res = await fixture.fetch('/'); + let html = await res.text(); + + expect(html).to.include('ReferenceError'); + + res = await fixture.fetch('/'); + await res.text(); + + expect(html).to.include('ReferenceError'); + }); +}); diff --git a/packages/astro/test/fixtures/error-bad-js/astro.config.mjs b/packages/astro/test/fixtures/error-bad-js/astro.config.mjs new file mode 100644 index 000000000..86dbfb924 --- /dev/null +++ b/packages/astro/test/fixtures/error-bad-js/astro.config.mjs @@ -0,0 +1,3 @@ +import { defineConfig } from 'astro/config'; + +export default defineConfig({}); diff --git a/packages/astro/test/fixtures/error-bad-js/package.json b/packages/astro/test/fixtures/error-bad-js/package.json new file mode 100644 index 000000000..6b7af585e --- /dev/null +++ b/packages/astro/test/fixtures/error-bad-js/package.json @@ -0,0 +1,15 @@ +{ + "name": "@test/error-bad-js", + "version": "0.0.1", + "private": true, + "scripts": { + "dev": "astro dev", + "start": "astro dev", + "build": "astro build", + "preview": "astro preview", + "astro": "astro" + }, + "dependencies": { + "astro": "workspace:*" + } +} diff --git a/packages/astro/test/fixtures/error-bad-js/src/env.d.ts b/packages/astro/test/fixtures/error-bad-js/src/env.d.ts new file mode 100644 index 000000000..f964fe0cf --- /dev/null +++ b/packages/astro/test/fixtures/error-bad-js/src/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/packages/astro/test/fixtures/error-bad-js/src/pages/index.astro b/packages/astro/test/fixtures/error-bad-js/src/pages/index.astro new file mode 100644 index 000000000..1fbac6699 --- /dev/null +++ b/packages/astro/test/fixtures/error-bad-js/src/pages/index.astro @@ -0,0 +1,16 @@ +--- +import something from '../something.js'; +--- + + + + + + + + Astro + + +

Astro

+ + diff --git a/packages/astro/test/fixtures/error-bad-js/src/something.js b/packages/astro/test/fixtures/error-bad-js/src/something.js new file mode 100644 index 000000000..13a1c6352 --- /dev/null +++ b/packages/astro/test/fixtures/error-bad-js/src/something.js @@ -0,0 +1 @@ +export var foo = bar; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fcb3c2d20..854833fcd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1492,6 +1492,12 @@ importers: '@astrojs/preact': link:../../../../integrations/preact astro: link:../../.. + packages/astro/test/fixtures/error-bad-js: + specifiers: + astro: workspace:* + dependencies: + astro: link:../../.. + packages/astro/test/fixtures/fetch: specifiers: '@astrojs/preact': workspace:* From 16113c3ae2ebff96136ebd31958fc5eb4369ee0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Seery?= Date: Mon, 12 Sep 2022 15:40:48 -0300 Subject: [PATCH 04/15] [vercel] Use Edge Functions instead of Edge Middlewares (#4713) * Don't use middleware * changeset * breaking change --- .changeset/polite-beds-happen.md | 5 +++++ packages/integrations/vercel/src/edge/adapter.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/polite-beds-happen.md diff --git a/.changeset/polite-beds-happen.md b/.changeset/polite-beds-happen.md new file mode 100644 index 000000000..81d637cae --- /dev/null +++ b/.changeset/polite-beds-happen.md @@ -0,0 +1,5 @@ +--- +'@astrojs/vercel': major +--- + +Use Edge Functions instead of Edge Middlewares diff --git a/packages/integrations/vercel/src/edge/adapter.ts b/packages/integrations/vercel/src/edge/adapter.ts index 14dac655d..72001be99 100644 --- a/packages/integrations/vercel/src/edge/adapter.ts +++ b/packages/integrations/vercel/src/edge/adapter.ts @@ -68,7 +68,7 @@ export default function vercelEdge(): AstroIntegration { routes: [ ...getRedirects(routes, _config), { handle: 'filesystem' }, - { src: '/.*', middlewarePath: 'render' }, + { src: '/.*', dest: 'render' }, ], }); }, From d614be49004bf4ca6d60dd7fecbcd3eb14310dd6 Mon Sep 17 00:00:00 2001 From: matthewp Date: Mon, 12 Sep 2022 18:43:54 +0000 Subject: [PATCH 05/15] [ci] format --- packages/astro/src/core/errors.ts | 2 +- packages/astro/src/vite-plugin-astro-server/index.ts | 2 +- packages/astro/test/error-bad-js.test.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/astro/src/core/errors.ts b/packages/astro/src/core/errors.ts index 9b2c7c174..06940276b 100644 --- a/packages/astro/src/core/errors.ts +++ b/packages/astro/src/core/errors.ts @@ -51,7 +51,7 @@ export function fixViteErrorMessage(_err: unknown, server?: ViteDevServer, fileP try { server?.ssrFixStacktrace(err); } catch {} - + // Fix: Astro.glob() compiles to import.meta.glob() by the time Vite sees it, // so we need to update this error message in case it originally came from Astro.glob(). if (err.message === 'import.meta.glob() can only accept string literals.') { diff --git a/packages/astro/src/vite-plugin-astro-server/index.ts b/packages/astro/src/vite-plugin-astro-server/index.ts index 05f2b893a..5d46d463c 100644 --- a/packages/astro/src/vite-plugin-astro-server/index.ts +++ b/packages/astro/src/vite-plugin-astro-server/index.ts @@ -20,7 +20,7 @@ import { preload, ssr } from '../core/render/dev/index.js'; import { RouteCache } from '../core/render/route-cache.js'; import { createRequest } from '../core/request.js'; import { createRouteManifest, matchAllRoutes } from '../core/routing/index.js'; -import { createSafeError, resolvePages } from '../core/util.js'; +import { resolvePages } from '../core/util.js'; import notFoundTemplate, { subpathNotUsedTemplate } from '../template/4xx.js'; interface AstroPluginOptions { diff --git a/packages/astro/test/error-bad-js.test.js b/packages/astro/test/error-bad-js.test.js index 0f4c12e6d..4315add2c 100644 --- a/packages/astro/test/error-bad-js.test.js +++ b/packages/astro/test/error-bad-js.test.js @@ -16,14 +16,14 @@ describe('Errors in JavaScript', () => { devServer = await fixture.startDevServer(); }); - after(async() => { + after(async () => { await devServer.stop(); }); it('Does not crash the dev server', async () => { let res = await fixture.fetch('/'); let html = await res.text(); - + expect(html).to.include('ReferenceError'); res = await fixture.fetch('/'); From 6e1d62fe222e45b763b2b60b377b07e431950d54 Mon Sep 17 00:00:00 2001 From: Ben Holmes Date: Mon, 12 Sep 2022 15:05:57 -0400 Subject: [PATCH 06/15] [RSS] Fix failure when globbing index route (#4701) * fix: [rss] throw on undefined urls only * test: "" url, passing glob outside pages/ * chore: changeset --- .changeset/blue-seals-warn.md | 5 ++++ packages/astro-rss/src/index.ts | 2 +- packages/astro-rss/test/rss.test.js | 45 +++++++++++++++++++++++++++-- 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 .changeset/blue-seals-warn.md diff --git a/.changeset/blue-seals-warn.md b/.changeset/blue-seals-warn.md new file mode 100644 index 000000000..1204481ee --- /dev/null +++ b/.changeset/blue-seals-warn.md @@ -0,0 +1,5 @@ +--- +'@astrojs/rss': patch +--- + +Fix globs for homepage route diff --git a/packages/astro-rss/src/index.ts b/packages/astro-rss/src/index.ts index 20d509f14..feb4d258c 100644 --- a/packages/astro-rss/src/index.ts +++ b/packages/astro-rss/src/index.ts @@ -56,7 +56,7 @@ function mapGlobResult(items: GlobResult): Promise { return Promise.all( Object.values(items).map(async (getInfo) => { const { url, frontmatter } = await getInfo(); - if (!Boolean(url)) { + if (url === undefined || url === null) { throw new Error( `[RSS] When passing an import.meta.glob result directly, you can only glob ".md" files within /pages! Consider mapping the result to an array of RSSFeedItems. See the RSS docs for usage examples: https://docs.astro.build/en/guides/rss/#2-list-of-rss-feed-objects` ); diff --git a/packages/astro-rss/test/rss.test.js b/packages/astro-rss/test/rss.test.js index 08d56fa92..5c33905a5 100644 --- a/packages/astro-rss/test/rss.test.js +++ b/packages/astro-rss/test/rss.test.js @@ -17,7 +17,8 @@ const phpFeedItem = { }; const web1FeedItem = { - link: '/web1', + // Should support empty string as a URL (possible for homepage route) + link: '', title: 'Web 1.0', pubDate: '1997-05-03', description: @@ -26,7 +27,7 @@ const web1FeedItem = { // note: I spent 30 minutes looking for a nice node-based snapshot tool // ...and I gave up. Enjoy big strings! -const validXmlResult = `<![CDATA[My RSS feed]]>https://example.com/<![CDATA[Remember PHP?]]>https://example.com/php/https://example.com/php/Tue, 03 May 1994 00:00:00 GMT<![CDATA[Web 1.0]]>https://example.com/web1/https://example.com/web1/Sat, 03 May 1997 00:00:00 GMT`; +const validXmlResult = `<![CDATA[My RSS feed]]>https://example.com/<![CDATA[Remember PHP?]]>https://example.com/php/https://example.com/php/Tue, 03 May 1994 00:00:00 GMT<![CDATA[Web 1.0]]>https://example.com/https://example.com/Sat, 03 May 1997 00:00:00 GMT`; describe('rss', () => { it('should generate on valid RSSFeedItem array', async () => { @@ -160,5 +161,45 @@ describe('rss', () => { chai.expect(err.message).to.contain('Required field [link] is missing'); } }); + + it('should provide a good error message when passing glob result form outside pages/', async () => { + const globResult = { + './posts/php.md': () => + new Promise((resolve) => + resolve({ + // "undefined" when outside pages/ + url: undefined, + frontmatter: { + title: phpFeedItem.title, + pubDate: phpFeedItem.pubDate, + description: phpFeedItem.description, + }, + }) + ), + './posts/nested/web1.md': () => + new Promise((resolve) => + resolve({ + url: undefined, + frontmatter: { + title: web1FeedItem.title, + pubDate: web1FeedItem.pubDate, + description: web1FeedItem.description, + }, + }) + ), + }; + + try { + await rss({ + title: 'Your Website Title', + description: 'Your Website Description', + site: 'https://astro-demo', + items: globResult, + }); + chai.expect(false).to.equal(true, 'Should have errored'); + } catch (err) { + chai.expect(err.message).to.contain('you can only glob ".md" files within /pages'); + } + }); }); }); From 56e225b41a309bfe20dc41e2988b9883fe5cfb13 Mon Sep 17 00:00:00 2001 From: "Fred K. Bot" <108291165+fredkbot@users.noreply.github.com> Date: Mon, 12 Sep 2022 12:08:39 -0700 Subject: [PATCH 07/15] [ci] release (#4707) Co-authored-by: github-actions[bot] --- .changeset/blue-seals-warn.md | 5 -- .changeset/fuzzy-rats-remain.md | 5 -- .changeset/green-pillows-hammer.md | 5 -- .changeset/orange-cycles-serve.md | 5 -- .changeset/polite-beds-happen.md | 5 -- examples/basics/package.json | 2 +- examples/blog/package.json | 4 +- examples/component/package.json | 4 +- examples/docs/package.json | 2 +- examples/framework-alpine/package.json | 2 +- 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-rss/CHANGELOG.md | 6 +++ packages/astro-rss/package.json | 2 +- packages/astro/CHANGELOG.md | 8 ++++ packages/astro/package.json | 2 +- packages/integrations/vercel/CHANGELOG.md | 6 +++ packages/integrations/vercel/package.json | 2 +- packages/integrations/vue/CHANGELOG.md | 6 +++ packages/integrations/vue/package.json | 2 +- pnpm-lock.yaml | 52 ++++++++++----------- 37 files changed, 83 insertions(+), 82 deletions(-) delete mode 100644 .changeset/blue-seals-warn.md delete mode 100644 .changeset/fuzzy-rats-remain.md delete mode 100644 .changeset/green-pillows-hammer.md delete mode 100644 .changeset/orange-cycles-serve.md delete mode 100644 .changeset/polite-beds-happen.md diff --git a/.changeset/blue-seals-warn.md b/.changeset/blue-seals-warn.md deleted file mode 100644 index 1204481ee..000000000 --- a/.changeset/blue-seals-warn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/rss': patch ---- - -Fix globs for homepage route diff --git a/.changeset/fuzzy-rats-remain.md b/.changeset/fuzzy-rats-remain.md deleted file mode 100644 index 601d2483b..000000000 --- a/.changeset/fuzzy-rats-remain.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Properly show an error message when a renderer is not properly configured diff --git a/.changeset/green-pillows-hammer.md b/.changeset/green-pillows-hammer.md deleted file mode 100644 index ca3bef981..000000000 --- a/.changeset/green-pillows-hammer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/vue': patch ---- - -Fix Vue `script setup` with other renderers applied diff --git a/.changeset/orange-cycles-serve.md b/.changeset/orange-cycles-serve.md deleted file mode 100644 index 123593116..000000000 --- a/.changeset/orange-cycles-serve.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Makes the dev server more resilient to crashes diff --git a/.changeset/polite-beds-happen.md b/.changeset/polite-beds-happen.md deleted file mode 100644 index 81d637cae..000000000 --- a/.changeset/polite-beds-happen.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/vercel': major ---- - -Use Edge Functions instead of Edge Middlewares diff --git a/examples/basics/package.json b/examples/basics/package.json index d1ea84594..d1a965d98 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -10,6 +10,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.2.1" + "astro": "^1.2.2" } } diff --git a/examples/blog/package.json b/examples/blog/package.json index aed49334d..c7996fdc9 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -10,9 +10,9 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.2.1", + "astro": "^1.2.2", "@astrojs/mdx": "^0.11.1", - "@astrojs/rss": "^1.0.0", + "@astrojs/rss": "^1.0.1", "@astrojs/sitemap": "^1.0.0" } } diff --git a/examples/component/package.json b/examples/component/package.json index fd70c4293..6aa63083e 100644 --- a/examples/component/package.json +++ b/examples/component/package.json @@ -15,9 +15,9 @@ ], "scripts": {}, "devDependencies": { - "astro": "^1.2.1" + "astro": "^1.2.2" }, "peerDependencies": { - "astro": "^1.2.1" + "astro": "^1.2.2" } } diff --git a/examples/docs/package.json b/examples/docs/package.json index 1632052d3..9c43721ce 100644 --- a/examples/docs/package.json +++ b/examples/docs/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.2.1", + "astro": "^1.2.2", "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 15d4931eb..4d410c7ab 100644 --- a/examples/framework-alpine/package.json +++ b/examples/framework-alpine/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.2.1", + "astro": "^1.2.2", "alpinejs": "^3.10.2", "@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 d46f1d96a..a1137897d 100644 --- a/examples/framework-lit/package.json +++ b/examples/framework-lit/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.2.1", + "astro": "^1.2.2", "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 8b23093b2..5b486a746 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.2.1", + "astro": "^1.2.2", "preact": "^10.7.3", "react": "^18.1.0", "react-dom": "^18.1.0", @@ -21,6 +21,6 @@ "@astrojs/react": "^1.1.2", "@astrojs/solid-js": "^1.1.0", "@astrojs/svelte": "^1.0.0", - "@astrojs/vue": "^1.0.1" + "@astrojs/vue": "^1.0.2" } } diff --git a/examples/framework-preact/package.json b/examples/framework-preact/package.json index 5f3f9338b..3c3617dee 100644 --- a/examples/framework-preact/package.json +++ b/examples/framework-preact/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.2.1", + "astro": "^1.2.2", "preact": "^10.7.3", "@astrojs/preact": "^1.1.0" } diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json index 18805c079..d57aa2a3a 100644 --- a/examples/framework-react/package.json +++ b/examples/framework-react/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.2.1", + "astro": "^1.2.2", "react": "^18.1.0", "react-dom": "^18.1.0", "@astrojs/react": "^1.1.2", diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json index a7cbdad9b..ea28a6d2e 100644 --- a/examples/framework-solid/package.json +++ b/examples/framework-solid/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.2.1", + "astro": "^1.2.2", "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 86422d9a1..384f7f47b 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.2.1" + "astro": "^1.2.2" } } diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json index d0eceaf0e..e24e31040 100644 --- a/examples/framework-vue/package.json +++ b/examples/framework-vue/package.json @@ -10,8 +10,8 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.2.1", + "astro": "^1.2.2", "vue": "^3.2.37", - "@astrojs/vue": "^1.0.1" + "@astrojs/vue": "^1.0.2" } } diff --git a/examples/minimal/package.json b/examples/minimal/package.json index 904f4f60b..6ff0cf07c 100644 --- a/examples/minimal/package.json +++ b/examples/minimal/package.json @@ -10,6 +10,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.2.1" + "astro": "^1.2.2" } } diff --git a/examples/non-html-pages/package.json b/examples/non-html-pages/package.json index 9d4a244f7..b163918bc 100644 --- a/examples/non-html-pages/package.json +++ b/examples/non-html-pages/package.json @@ -10,6 +10,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.2.1" + "astro": "^1.2.2" } } diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json index 12f47762c..29d48b1b5 100644 --- a/examples/portfolio/package.json +++ b/examples/portfolio/package.json @@ -10,6 +10,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.2.1" + "astro": "^1.2.2" } } diff --git a/examples/ssr/package.json b/examples/ssr/package.json index 74087dcfc..2c82596b9 100644 --- a/examples/ssr/package.json +++ b/examples/ssr/package.json @@ -12,7 +12,7 @@ }, "devDependencies": {}, "dependencies": { - "astro": "^1.2.1", + "astro": "^1.2.2", "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 0039219ae..a48398075 100644 --- a/examples/with-markdown-plugins/package.json +++ b/examples/with-markdown-plugins/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.2.1", + "astro": "^1.2.2", "@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 c4ae2e551..09e16b135 100644 --- a/examples/with-markdown-shiki/package.json +++ b/examples/with-markdown-shiki/package.json @@ -10,6 +10,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.2.1" + "astro": "^1.2.2" } } diff --git a/examples/with-mdx/package.json b/examples/with-mdx/package.json index b507f7dcd..7f81724dc 100644 --- a/examples/with-mdx/package.json +++ b/examples/with-mdx/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.2.1", + "astro": "^1.2.2", "preact": "^10.6.5", "@astrojs/preact": "^1.1.0", "@astrojs/mdx": "^0.11.1" diff --git a/examples/with-nanostores/package.json b/examples/with-nanostores/package.json index d99d027ad..3531af87f 100644 --- a/examples/with-nanostores/package.json +++ b/examples/with-nanostores/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.2.1", + "astro": "^1.2.2", "preact": "^10.7.3", "@astrojs/preact": "^1.1.0", "nanostores": "^0.5.12", diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json index 13738f090..fae43e7e2 100644 --- a/examples/with-tailwindcss/package.json +++ b/examples/with-tailwindcss/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.2.1", + "astro": "^1.2.2", "@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 0014742b8..68b85453a 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.2.1", + "astro": "^1.2.2", "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 494abf392..67d2d8274 100644 --- a/examples/with-vitest/package.json +++ b/examples/with-vitest/package.json @@ -12,7 +12,7 @@ "test": "vitest" }, "dependencies": { - "astro": "^1.2.1", + "astro": "^1.2.2", "vitest": "^0.20.3" } } diff --git a/packages/astro-rss/CHANGELOG.md b/packages/astro-rss/CHANGELOG.md index 8a63c896a..9c0990095 100644 --- a/packages/astro-rss/CHANGELOG.md +++ b/packages/astro-rss/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/rss +## 1.0.1 + +### Patch Changes + +- [#4701](https://github.com/withastro/astro/pull/4701) [`6e1d62fe2`](https://github.com/withastro/astro/commit/6e1d62fe222e45b763b2b60b377b07e431950d54) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Fix globs for homepage route + ## 1.0.0 ### Major Changes diff --git a/packages/astro-rss/package.json b/packages/astro-rss/package.json index dbf50908a..1b61354af 100644 --- a/packages/astro-rss/package.json +++ b/packages/astro-rss/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/rss", "description": "Add RSS feeds to your Astro projects", - "version": "1.0.0", + "version": "1.0.1", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index 0d8781cab..a9f49e976 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -1,5 +1,13 @@ # astro +## 1.2.2 + +### Patch Changes + +- [#4705](https://github.com/withastro/astro/pull/4705) [`5b6173fd0`](https://github.com/withastro/astro/commit/5b6173fd031b7e85974cbadd39de7fa199075e44) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Properly show an error message when a renderer is not properly configured + +- [#4723](https://github.com/withastro/astro/pull/4723) [`0dba3b6f3`](https://github.com/withastro/astro/commit/0dba3b6f3fbd013f922fd11b9d6d977d165a512a) Thanks [@matthewp](https://github.com/matthewp)! - Makes the dev server more resilient to crashes + ## 1.2.1 ### Patch Changes diff --git a/packages/astro/package.json b/packages/astro/package.json index 8d3158788..0097002ab 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -1,6 +1,6 @@ { "name": "astro", - "version": "1.2.1", + "version": "1.2.2", "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/vercel/CHANGELOG.md b/packages/integrations/vercel/CHANGELOG.md index 4f1d6d295..0035b796f 100644 --- a/packages/integrations/vercel/CHANGELOG.md +++ b/packages/integrations/vercel/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/vercel +## 2.0.0 + +### Major Changes + +- [#4713](https://github.com/withastro/astro/pull/4713) [`16113c3ae`](https://github.com/withastro/astro/commit/16113c3ae2ebff96136ebd31958fc5eb4369ee0d) Thanks [@JuanM04](https://github.com/JuanM04)! - Use Edge Functions instead of Edge Middlewares + ## 1.0.2 ### Patch Changes diff --git a/packages/integrations/vercel/package.json b/packages/integrations/vercel/package.json index bf25943eb..399f0310f 100644 --- a/packages/integrations/vercel/package.json +++ b/packages/integrations/vercel/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/vercel", "description": "Deploy your site to Vercel", - "version": "1.0.2", + "version": "2.0.0", "type": "module", "author": "withastro", "license": "MIT", diff --git a/packages/integrations/vue/CHANGELOG.md b/packages/integrations/vue/CHANGELOG.md index d896d668c..ab1f293db 100644 --- a/packages/integrations/vue/CHANGELOG.md +++ b/packages/integrations/vue/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/vue +## 1.0.2 + +### Patch Changes + +- [#4706](https://github.com/withastro/astro/pull/4706) [`b0ee81d0a`](https://github.com/withastro/astro/commit/b0ee81d0a70d8301530c321b670ab784c9bc00a2) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Fix Vue `script setup` with other renderers applied + ## 1.0.1 ### Patch Changes diff --git a/packages/integrations/vue/package.json b/packages/integrations/vue/package.json index 9e4879c46..283f029f4 100644 --- a/packages/integrations/vue/package.json +++ b/packages/integrations/vue/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/vue", - "version": "1.0.1", + "version": "1.0.2", "description": "Use Vue components within Astro", "type": "module", "types": "./dist/index.d.ts", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 854833fcd..33ac78bde 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,16 +56,16 @@ importers: examples/basics: specifiers: - astro: ^1.2.1 + astro: ^1.2.2 dependencies: astro: link:../../packages/astro examples/blog: specifiers: '@astrojs/mdx': ^0.11.1 - '@astrojs/rss': ^1.0.0 + '@astrojs/rss': ^1.0.1 '@astrojs/sitemap': ^1.0.0 - astro: ^1.2.1 + astro: ^1.2.2 dependencies: '@astrojs/mdx': link:../../packages/integrations/mdx '@astrojs/rss': link:../../packages/astro-rss @@ -74,7 +74,7 @@ importers: examples/component: specifiers: - astro: ^1.2.1 + astro: ^1.2.2 devDependencies: astro: link:../../packages/astro @@ -88,7 +88,7 @@ importers: '@types/node': ^18.0.0 '@types/react': ^17.0.45 '@types/react-dom': ^18.0.0 - astro: ^1.2.1 + astro: ^1.2.2 preact: ^10.7.3 react: ^18.1.0 react-dom: ^18.1.0 @@ -111,7 +111,7 @@ importers: '@astrojs/alpinejs': ^0.1.2 '@types/alpinejs': ^3.7.0 alpinejs: ^3.10.2 - astro: ^1.2.1 + astro: ^1.2.2 dependencies: '@astrojs/alpinejs': link:../../packages/integrations/alpinejs '@types/alpinejs': 3.7.0 @@ -122,7 +122,7 @@ importers: specifiers: '@astrojs/lit': ^1.0.0 '@webcomponents/template-shadowroot': ^0.1.0 - astro: ^1.2.1 + astro: ^1.2.2 lit: ^2.2.5 dependencies: '@astrojs/lit': link:../../packages/integrations/lit @@ -136,8 +136,8 @@ importers: '@astrojs/react': ^1.1.2 '@astrojs/solid-js': ^1.1.0 '@astrojs/svelte': ^1.0.0 - '@astrojs/vue': ^1.0.1 - astro: ^1.2.1 + '@astrojs/vue': ^1.0.2 + astro: ^1.2.2 preact: ^10.7.3 react: ^18.1.0 react-dom: ^18.1.0 @@ -161,7 +161,7 @@ importers: examples/framework-preact: specifiers: '@astrojs/preact': ^1.1.0 - astro: ^1.2.1 + astro: ^1.2.2 preact: ^10.7.3 dependencies: '@astrojs/preact': link:../../packages/integrations/preact @@ -173,7 +173,7 @@ importers: '@astrojs/react': ^1.1.2 '@types/react': ^18.0.10 '@types/react-dom': ^18.0.5 - astro: ^1.2.1 + astro: ^1.2.2 react: ^18.1.0 react-dom: ^18.1.0 dependencies: @@ -187,7 +187,7 @@ importers: examples/framework-solid: specifiers: '@astrojs/solid-js': ^1.1.0 - astro: ^1.2.1 + astro: ^1.2.2 solid-js: ^1.4.3 dependencies: '@astrojs/solid-js': link:../../packages/integrations/solid @@ -197,7 +197,7 @@ importers: examples/framework-svelte: specifiers: '@astrojs/svelte': ^1.0.0 - astro: ^1.2.1 + astro: ^1.2.2 svelte: ^3.48.0 dependencies: '@astrojs/svelte': link:../../packages/integrations/svelte @@ -206,8 +206,8 @@ importers: examples/framework-vue: specifiers: - '@astrojs/vue': ^1.0.1 - astro: ^1.2.1 + '@astrojs/vue': ^1.0.2 + astro: ^1.2.2 vue: ^3.2.37 dependencies: '@astrojs/vue': link:../../packages/integrations/vue @@ -216,19 +216,19 @@ importers: examples/minimal: specifiers: - astro: ^1.2.1 + astro: ^1.2.2 dependencies: astro: link:../../packages/astro examples/non-html-pages: specifiers: - astro: ^1.2.1 + astro: ^1.2.2 dependencies: astro: link:../../packages/astro examples/portfolio: specifiers: - astro: ^1.2.1 + astro: ^1.2.2 dependencies: astro: link:../../packages/astro @@ -236,7 +236,7 @@ importers: specifiers: '@astrojs/node': ^1.0.1 '@astrojs/svelte': ^1.0.0 - astro: ^1.2.1 + astro: ^1.2.2 concurrently: ^7.2.1 lightcookie: ^1.0.25 svelte: ^3.48.0 @@ -255,7 +255,7 @@ importers: examples/with-markdown-plugins: specifiers: '@astrojs/markdown-remark': ^1.1.0 - astro: ^1.2.1 + astro: ^1.2.2 hast-util-select: 5.0.1 rehype-autolink-headings: ^6.1.1 rehype-slug: ^5.0.1 @@ -272,7 +272,7 @@ importers: examples/with-markdown-shiki: specifiers: - astro: ^1.2.1 + astro: ^1.2.2 dependencies: astro: link:../../packages/astro @@ -280,7 +280,7 @@ importers: specifiers: '@astrojs/mdx': ^0.11.1 '@astrojs/preact': ^1.1.0 - astro: ^1.2.1 + astro: ^1.2.2 preact: ^10.6.5 dependencies: '@astrojs/mdx': link:../../packages/integrations/mdx @@ -292,7 +292,7 @@ importers: specifiers: '@astrojs/preact': ^1.1.0 '@nanostores/preact': ^0.1.3 - astro: ^1.2.1 + astro: ^1.2.2 nanostores: ^0.5.12 preact: ^10.7.3 dependencies: @@ -305,7 +305,7 @@ importers: examples/with-tailwindcss: specifiers: '@astrojs/tailwind': ^1.0.0 - astro: ^1.2.1 + astro: ^1.2.2 autoprefixer: ^10.4.7 canvas-confetti: ^1.5.1 postcss: ^8.4.14 @@ -320,7 +320,7 @@ importers: examples/with-vite-plugin-pwa: specifiers: - astro: ^1.2.1 + astro: ^1.2.2 vite-plugin-pwa: 0.11.11 workbox-window: ^6.5.3 dependencies: @@ -330,7 +330,7 @@ importers: examples/with-vitest: specifiers: - astro: ^1.2.1 + astro: ^1.2.2 vitest: ^0.20.3 dependencies: astro: link:../../packages/astro From 6efafa4b0e392563d5375ec62ac6e3ac8372ec61 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Mon, 12 Sep 2022 16:35:39 -0400 Subject: [PATCH 08/15] Use import order to sort CSS in prod (#4724) * Use import order to sort CSS in prod * Adding a changeset * Pass through the parent id * Update remaining test --- .changeset/many-tables-brush.md | 5 +++++ packages/astro/src/core/build/graph.ts | 12 +++++----- packages/astro/src/core/build/internal.ts | 22 ++++++++++++++----- packages/astro/src/core/build/types.ts | 2 +- .../astro/src/core/build/vite-plugin-css.ts | 21 ++++++++++++------ packages/astro/test/css-order.test.js | 21 +++++++++++++++--- .../test/fixtures/css-order/astro.config.mjs | 14 ++++++++++++ .../fixtures/css-order/src/pages/three.astro | 14 ++++++++++++ .../fixtures/css-order/src/styles/base.css | 3 +++ 9 files changed, 93 insertions(+), 21 deletions(-) create mode 100644 .changeset/many-tables-brush.md create mode 100644 packages/astro/test/fixtures/css-order/astro.config.mjs create mode 100644 packages/astro/test/fixtures/css-order/src/pages/three.astro create mode 100644 packages/astro/test/fixtures/css-order/src/styles/base.css diff --git a/.changeset/many-tables-brush.md b/.changeset/many-tables-brush.md new file mode 100644 index 000000000..45337df3e --- /dev/null +++ b/.changeset/many-tables-brush.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Use import order to sort CSS in the build diff --git a/packages/astro/src/core/build/graph.ts b/packages/astro/src/core/build/graph.ts index 8db52a1c9..e55361d75 100644 --- a/packages/astro/src/core/build/graph.ts +++ b/packages/astro/src/core/build/graph.ts @@ -7,19 +7,21 @@ export function* walkParentInfos( id: string, ctx: { getModuleInfo: GetModuleInfo }, depth = 0, - seen = new Set() -): Generator<[ModuleInfo, number], void, unknown> { + seen = new Set(), + childId = '', +): Generator<[ModuleInfo, number, number], void, unknown> { seen.add(id); const info = ctx.getModuleInfo(id); if (info) { - yield [info, depth]; + let order = childId ? info.importedIds.indexOf(childId) : 0; + yield [info, depth, order]; } const importers = (info?.importers || []).concat(info?.dynamicImporters || []); for (const imp of importers) { if (seen.has(imp)) { continue; } - yield* walkParentInfos(imp, ctx, ++depth, seen); + yield* walkParentInfos(imp, ctx, ++depth, seen, id); } } @@ -34,7 +36,7 @@ export function moduleIsTopLevelPage(info: ModuleInfo): boolean { export function* getTopLevelPages( id: string, ctx: { getModuleInfo: GetModuleInfo } -): Generator<[ModuleInfo, number], void, unknown> { +): Generator<[ModuleInfo, number, number], void, unknown> { for (const res of walkParentInfos(id, ctx)) { if (moduleIsTopLevelPage(res[0])) { yield res; diff --git a/packages/astro/src/core/build/internal.ts b/packages/astro/src/core/build/internal.ts index 7d8485fe5..ae1c48361 100644 --- a/packages/astro/src/core/build/internal.ts +++ b/packages/astro/src/core/build/internal.ts @@ -191,14 +191,26 @@ export function sortedCSS(pageData: PageBuildData) { return Array.from(pageData.css) .sort((a, b) => { let depthA = a[1].depth, - depthB = b[1].depth; + depthB = b[1].depth, + orderA = a[1].order, + orderB = b[1].order; - if (depthA === -1) { - return -1; - } else if (depthB === -1) { + if(orderA === -1 && orderB >= 0) { return 1; + } else if(orderB === -1 && orderA >= 0) { + return -1; + } else if(orderA > orderB) { + return 1; + } else if(orderA < orderB) { + return -1; } else { - return depthA > depthB ? -1 : 1; + if (depthA === -1) { + return -1; + } else if (depthB === -1) { + return 1; + } else { + return depthA > depthB ? -1 : 1; + } } }) .map(([id]) => id); diff --git a/packages/astro/src/core/build/types.ts b/packages/astro/src/core/build/types.ts index 90da4b0ef..42a4b0716 100644 --- a/packages/astro/src/core/build/types.ts +++ b/packages/astro/src/core/build/types.ts @@ -18,7 +18,7 @@ export interface PageBuildData { component: ComponentPath; route: RouteData; moduleSpecifier: string; - css: Map; + css: Map; hoistedScript: { type: 'inline' | 'external'; value: string } | undefined; } export type AllPagesData = Record; diff --git a/packages/astro/src/core/build/vite-plugin-css.ts b/packages/astro/src/core/build/vite-plugin-css.ts index 28e88cf65..202bd5319 100644 --- a/packages/astro/src/core/build/vite-plugin-css.ts +++ b/packages/astro/src/core/build/vite-plugin-css.ts @@ -110,7 +110,7 @@ export function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin[] importedCss: Set; }; - const appendCSSToPage = (pageData: PageBuildData, meta: ViteMetadata, depth: number) => { + const appendCSSToPage = (pageData: PageBuildData, meta: ViteMetadata, depth: number, order: number) => { for (const importedCssImport of meta.importedCss) { // CSS is prioritized based on depth. Shared CSS has a higher depth due to being imported by multiple pages. // Depth info is used when sorting the links on the page. @@ -120,8 +120,15 @@ export function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin[] if (depth < cssInfo.depth) { cssInfo.depth = depth; } + + // Update the order, preferring the lowest order we have. + if(cssInfo.order === -1) { + cssInfo.order = order; + } else if(order < cssInfo.order && order > -1) { + cssInfo.order = order; + } } else { - pageData?.css.set(importedCssImport, { depth }); + pageData?.css.set(importedCssImport, { depth, order }); } } }; @@ -161,7 +168,7 @@ export function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin[] for (const id of Object.keys(c.modules)) { for (const pageData of getParentClientOnlys(id, this)) { for (const importedCssImport of meta.importedCss) { - pageData.css.set(importedCssImport, { depth: -1 }); + pageData.css.set(importedCssImport, { depth: -1, order: -1 }); } } } @@ -169,12 +176,12 @@ export function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin[] // For this CSS chunk, walk parents until you find a page. Add the CSS to that page. for (const id of Object.keys(c.modules)) { - for (const [pageInfo, depth] of walkParentInfos(id, this)) { + for (const [pageInfo, depth, order] of walkParentInfos(id, this)) { if (moduleIsTopLevelPage(pageInfo)) { const pageViteID = pageInfo.id; const pageData = getPageDataByViteID(internals, pageViteID); if (pageData) { - appendCSSToPage(pageData, meta, depth); + appendCSSToPage(pageData, meta, depth, order); } } else if ( options.target === 'client' && @@ -184,7 +191,7 @@ export function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin[] internals, pageInfo.id )) { - appendCSSToPage(pageData, meta, -1); + appendCSSToPage(pageData, meta, -1, order); } } } @@ -211,7 +218,7 @@ export function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin[] ); if (cssChunk) { for (const pageData of eachPageData(internals)) { - pageData.css.set(cssChunk.fileName, { depth: -1 }); + pageData.css.set(cssChunk.fileName, { depth: -1, order: -1 }); } } } diff --git a/packages/astro/test/css-order.test.js b/packages/astro/test/css-order.test.js index 02db6b449..944452e93 100644 --- a/packages/astro/test/css-order.test.js +++ b/packages/astro/test/css-order.test.js @@ -86,10 +86,25 @@ describe('CSS production ordering', () => { getLinks(html).map((href) => getLinkContent(fixture, href)) ); - expect(content).to.have.a.lengthOf(2, 'there are 2 stylesheets'); - const [, last] = content; + expect(content).to.have.a.lengthOf(3, 'there are 3 stylesheets'); + const [,found] = content; - expect(last.css).to.match(/#00f/); + expect(found.css).to.match(/#00f/); + }); + + it('CSS injected by injectScript comes first because of import order', async () => { + let oneHtml = await fixture.readFile('/one/index.html'); + let twoHtml = await fixture.readFile('/two/index.html'); + let threeHtml = await fixture.readFile('/three/index.html'); + + for(const html of [oneHtml, twoHtml, threeHtml]) { + const content = await Promise.all( + getLinks(html).map((href) => getLinkContent(fixture, href)) + ); + + const [first] = content; + expect(first.css).to.include('green', 'Came from the injected script'); + } }); }); }); diff --git a/packages/astro/test/fixtures/css-order/astro.config.mjs b/packages/astro/test/fixtures/css-order/astro.config.mjs new file mode 100644 index 000000000..b53e3c0ee --- /dev/null +++ b/packages/astro/test/fixtures/css-order/astro.config.mjs @@ -0,0 +1,14 @@ +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + integrations: [ + { + name: 'test-integration', + hooks: { + 'astro:config:setup'({ injectScript }) { + injectScript('page-ssr', `import '/src/styles/base.css';`); + } + } + } + ] +}); diff --git a/packages/astro/test/fixtures/css-order/src/pages/three.astro b/packages/astro/test/fixtures/css-order/src/pages/three.astro new file mode 100644 index 000000000..30289168a --- /dev/null +++ b/packages/astro/test/fixtures/css-order/src/pages/three.astro @@ -0,0 +1,14 @@ + + + Testing + + + +

Testing

+ + diff --git a/packages/astro/test/fixtures/css-order/src/styles/base.css b/packages/astro/test/fixtures/css-order/src/styles/base.css new file mode 100644 index 000000000..828bff206 --- /dev/null +++ b/packages/astro/test/fixtures/css-order/src/styles/base.css @@ -0,0 +1,3 @@ +body { + background: green; +} From 8903edee88819501026994ab078ef5072dcd7b5d Mon Sep 17 00:00:00 2001 From: matthewp Date: Mon, 12 Sep 2022 20:37:25 +0000 Subject: [PATCH 09/15] [ci] format --- packages/astro/src/core/build/graph.ts | 2 +- packages/astro/src/core/build/internal.ts | 8 ++++---- packages/astro/src/core/build/types.ts | 2 +- .../astro/src/core/build/vite-plugin-css.ts | 17 +++++++++++------ packages/astro/test/css-order.test.js | 6 +++--- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/packages/astro/src/core/build/graph.ts b/packages/astro/src/core/build/graph.ts index e55361d75..819d76589 100644 --- a/packages/astro/src/core/build/graph.ts +++ b/packages/astro/src/core/build/graph.ts @@ -8,7 +8,7 @@ export function* walkParentInfos( ctx: { getModuleInfo: GetModuleInfo }, depth = 0, seen = new Set(), - childId = '', + childId = '' ): Generator<[ModuleInfo, number, number], void, unknown> { seen.add(id); const info = ctx.getModuleInfo(id); diff --git a/packages/astro/src/core/build/internal.ts b/packages/astro/src/core/build/internal.ts index ae1c48361..6d3cc9f36 100644 --- a/packages/astro/src/core/build/internal.ts +++ b/packages/astro/src/core/build/internal.ts @@ -195,13 +195,13 @@ export function sortedCSS(pageData: PageBuildData) { orderA = a[1].order, orderB = b[1].order; - if(orderA === -1 && orderB >= 0) { + if (orderA === -1 && orderB >= 0) { return 1; - } else if(orderB === -1 && orderA >= 0) { + } else if (orderB === -1 && orderA >= 0) { return -1; - } else if(orderA > orderB) { + } else if (orderA > orderB) { return 1; - } else if(orderA < orderB) { + } else if (orderA < orderB) { return -1; } else { if (depthA === -1) { diff --git a/packages/astro/src/core/build/types.ts b/packages/astro/src/core/build/types.ts index 42a4b0716..480af85d0 100644 --- a/packages/astro/src/core/build/types.ts +++ b/packages/astro/src/core/build/types.ts @@ -18,7 +18,7 @@ export interface PageBuildData { component: ComponentPath; route: RouteData; moduleSpecifier: string; - css: Map; + css: Map; hoistedScript: { type: 'inline' | 'external'; value: string } | undefined; } export type AllPagesData = Record; diff --git a/packages/astro/src/core/build/vite-plugin-css.ts b/packages/astro/src/core/build/vite-plugin-css.ts index 202bd5319..4d77f6f15 100644 --- a/packages/astro/src/core/build/vite-plugin-css.ts +++ b/packages/astro/src/core/build/vite-plugin-css.ts @@ -110,7 +110,12 @@ export function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin[] importedCss: Set; }; - const appendCSSToPage = (pageData: PageBuildData, meta: ViteMetadata, depth: number, order: number) => { + const appendCSSToPage = ( + pageData: PageBuildData, + meta: ViteMetadata, + depth: number, + order: number + ) => { for (const importedCssImport of meta.importedCss) { // CSS is prioritized based on depth. Shared CSS has a higher depth due to being imported by multiple pages. // Depth info is used when sorting the links on the page. @@ -122,11 +127,11 @@ export function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin[] } // Update the order, preferring the lowest order we have. - if(cssInfo.order === -1) { - cssInfo.order = order; - } else if(order < cssInfo.order && order > -1) { - cssInfo.order = order; - } + if (cssInfo.order === -1) { + cssInfo.order = order; + } else if (order < cssInfo.order && order > -1) { + cssInfo.order = order; + } } else { pageData?.css.set(importedCssImport, { depth, order }); } diff --git a/packages/astro/test/css-order.test.js b/packages/astro/test/css-order.test.js index 944452e93..fbcd580dd 100644 --- a/packages/astro/test/css-order.test.js +++ b/packages/astro/test/css-order.test.js @@ -87,7 +87,7 @@ describe('CSS production ordering', () => { ); expect(content).to.have.a.lengthOf(3, 'there are 3 stylesheets'); - const [,found] = content; + const [, found] = content; expect(found.css).to.match(/#00f/); }); @@ -97,11 +97,11 @@ describe('CSS production ordering', () => { let twoHtml = await fixture.readFile('/two/index.html'); let threeHtml = await fixture.readFile('/three/index.html'); - for(const html of [oneHtml, twoHtml, threeHtml]) { + for (const html of [oneHtml, twoHtml, threeHtml]) { const content = await Promise.all( getLinks(html).map((href) => getLinkContent(fixture, href)) ); - + const [first] = content; expect(first.css).to.include('green', 'Came from the injected script'); } From c58d962dfa8c2cb4520cf0a4750462f3755136c0 Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Mon, 12 Sep 2022 14:21:20 -0700 Subject: [PATCH 10/15] Add a new preview release action (#4483) * add a new preview release action * Update snapshot-release.yml (#4485) * small fixes * Update snapshot-release.yml Co-authored-by: Mayank <9084735+mayank99@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- .github/workflows/snapshot-release.yml | 95 ++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/snapshot-release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fcd08fb87..e3f348c0f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: CI +name: Release on: push: diff --git a/.github/workflows/snapshot-release.yml b/.github/workflows/snapshot-release.yml new file mode 100644 index 000000000..0468b2d8f --- /dev/null +++ b/.github/workflows/snapshot-release.yml @@ -0,0 +1,95 @@ +name: Create a Snapshot Release + +on: + issue_comment: + types: [created] + +defaults: + run: + shell: bash + +env: + TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} + TURBO_TEAM: ${{ secrets.TURBO_TEAM }} + FORCE_COLOR: true + +jobs: + snapshot-release: + name: Create a snapshot release of a pull request + if: ${{ github.repository_owner == 'withastro' && github.event.issue.pull_request && startsWith(github.event.comment.body, '!preview') }} + runs-on: ubuntu-latest + steps: + - name: "Check if user has admin access (only admins can publish snapshot releases)." + uses: "lannonbr/repo-permission-check-action@2.0.0" + with: + permission: "admin" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.inputs.ref }} + + - name: Setup PNPM + uses: pnpm/action-setup@v2.2.1 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install + + - name: Build Packages + run: pnpm run build + + - name: Extract the snapshot name from comment body + id: getSnapshotName + uses: actions/github-script@v6 + env: + MESSAGE: ${{ steps.changesets.outputs.publish }} + with: + script: | + const splitComment = github.event.comment.body.split(' '); + splitComment.length !== 2 && (github.rest.issues.createComment({ + issue_number: process.env.ISSUE_NUMBER, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Invalid comment format. Expected: "!preview "', + }) || exit 1); + return splitComment[1].trim(); + result-encoding: string + + - name: Get result + run: echo "${{steps.set-result.outputs.result}}" + + - name: Bump Package Versions + id: changesets + run: npx changeset version --snapshot ${{ steps.getSnapshotName.outputs.result }} + env: + # Needs access to run the script + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +# - name: Publish Release +# id: publish +# run: pnpm run release --tag next--${{ steps.getSnapshotName.outputs.result }} +# env: +# # Needs access to publish to npm +# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Pull Request Notification + uses: actions/github-script@v6 + env: + ISSUE_NUMBER: ${{ github.event.issue.number }} + MESSAGE: ${{ steps.changesets.outputs.publish }} + with: + script: | + console.log(process.env.ISSUE_NUMBER, process.env.MESSAGE); + github.rest.issues.createComment({ + issue_number: process.env.ISSUE_NUMBER, + owner: context.repo.owner, + repo: context.repo.repo, + body: '```\n' + process.env.MESSAGE + '\n```', + }) From 8031ef8039ac698f78200400336ee0f08fd7e037 Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Mon, 12 Sep 2022 14:25:01 -0700 Subject: [PATCH 11/15] Update snapshot-release.yml --- .github/workflows/snapshot-release.yml | 34 +++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/snapshot-release.yml b/.github/workflows/snapshot-release.yml index 0468b2d8f..6f2cd130f 100644 --- a/.github/workflows/snapshot-release.yml +++ b/.github/workflows/snapshot-release.yml @@ -26,6 +26,23 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Extract the snapshot name from comment body + id: getSnapshotName + uses: actions/github-script@v6 + env: + ISSUE_NUMBER: ${{ github.event.issue.number }} + with: + script: | + const splitComment = github.event.comment.body.split(' '); + splitComment.length !== 2 && (github.rest.issues.createComment({ + issue_number: process.env.ISSUE_NUMBER, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Invalid comment format. Expected: "!preview "', + }) || exit 1); + return splitComment[1].trim(); + result-encoding: string + - uses: actions/checkout@v3 with: ref: ${{ github.event.inputs.ref }} @@ -45,23 +62,6 @@ jobs: - name: Build Packages run: pnpm run build - - name: Extract the snapshot name from comment body - id: getSnapshotName - uses: actions/github-script@v6 - env: - MESSAGE: ${{ steps.changesets.outputs.publish }} - with: - script: | - const splitComment = github.event.comment.body.split(' '); - splitComment.length !== 2 && (github.rest.issues.createComment({ - issue_number: process.env.ISSUE_NUMBER, - owner: context.repo.owner, - repo: context.repo.repo, - body: 'Invalid comment format. Expected: "!preview "', - }) || exit 1); - return splitComment[1].trim(); - result-encoding: string - - name: Get result run: echo "${{steps.set-result.outputs.result}}" From 05778251dbdf13ca44d86a1fb5d2a6e3897a4186 Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Mon, 12 Sep 2022 14:30:58 -0700 Subject: [PATCH 12/15] Update snapshot-release.yml --- .github/workflows/snapshot-release.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/snapshot-release.yml b/.github/workflows/snapshot-release.yml index 6f2cd130f..eaf20ff59 100644 --- a/.github/workflows/snapshot-release.yml +++ b/.github/workflows/snapshot-release.yml @@ -29,17 +29,15 @@ jobs: - name: Extract the snapshot name from comment body id: getSnapshotName uses: actions/github-script@v6 - env: - ISSUE_NUMBER: ${{ github.event.issue.number }} with: script: | const splitComment = github.event.comment.body.split(' '); splitComment.length !== 2 && (github.rest.issues.createComment({ - issue_number: process.env.ISSUE_NUMBER, + issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: 'Invalid comment format. Expected: "!preview "', - }) || exit 1); + }) || core.setFailed('Invalid comment format. Expected: "!preview "')); return splitComment[1].trim(); result-encoding: string @@ -82,13 +80,12 @@ jobs: - name: Pull Request Notification uses: actions/github-script@v6 env: - ISSUE_NUMBER: ${{ github.event.issue.number }} MESSAGE: ${{ steps.changesets.outputs.publish }} with: script: | - console.log(process.env.ISSUE_NUMBER, process.env.MESSAGE); + console.log(process.env.MESSAGE); github.rest.issues.createComment({ - issue_number: process.env.ISSUE_NUMBER, + issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: '```\n' + process.env.MESSAGE + '\n```', From 9558e2c810ed8aede9ad1ec6b79704b044180254 Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Mon, 12 Sep 2022 14:34:50 -0700 Subject: [PATCH 13/15] Update snapshot-release.yml --- .github/workflows/snapshot-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/snapshot-release.yml b/.github/workflows/snapshot-release.yml index eaf20ff59..02ac27af1 100644 --- a/.github/workflows/snapshot-release.yml +++ b/.github/workflows/snapshot-release.yml @@ -31,7 +31,7 @@ jobs: uses: actions/github-script@v6 with: script: | - const splitComment = github.event.comment.body.split(' '); + const splitComment = context.payload.comment.body.split(' '); splitComment.length !== 2 && (github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, From 49006da07720c137b658f260d3f540fafae90de0 Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Mon, 12 Sep 2022 14:43:45 -0700 Subject: [PATCH 14/15] Update snapshot-release.yml --- .github/workflows/snapshot-release.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/snapshot-release.yml b/.github/workflows/snapshot-release.yml index 02ac27af1..ade8d24d6 100644 --- a/.github/workflows/snapshot-release.yml +++ b/.github/workflows/snapshot-release.yml @@ -60,19 +60,16 @@ jobs: - name: Build Packages run: pnpm run build - - name: Get result - run: echo "${{steps.set-result.outputs.result}}" - - name: Bump Package Versions id: changesets - run: npx changeset version --snapshot ${{ steps.getSnapshotName.outputs.result }} + run: echo "::set-output name=result::$(npx changeset version --snapshot ${{ steps.getSnapshotName.outputs.result }})" env: # Needs access to run the script GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # - name: Publish Release # id: publish -# run: pnpm run release --tag next--${{ steps.getSnapshotName.outputs.result }} +# run: echo "::set-output name=result::$(pnpm run release --tag next--${{ steps.getSnapshotName.outputs.result }})" # env: # # Needs access to publish to npm # NPM_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -80,7 +77,7 @@ jobs: - name: Pull Request Notification uses: actions/github-script@v6 env: - MESSAGE: ${{ steps.changesets.outputs.publish }} + MESSAGE: ${{ steps.changesets.outputs.result }} with: script: | console.log(process.env.MESSAGE); From 4bc70f3545ab950da306de9c5417a08a7532fa28 Mon Sep 17 00:00:00 2001 From: Ben Holmes Date: Mon, 12 Sep 2022 19:33:44 -0400 Subject: [PATCH 15/15] Fix route validation for Netlify Edge (#4722) * fix: serialize route pattern for Netlify edge Co-authored-by: Jackie Macharia * chore: changeset --- .changeset/dull-flowers-prove.md | 5 +++++ .../integrations/netlify/src/integration-edge-functions.ts | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/dull-flowers-prove.md diff --git a/.changeset/dull-flowers-prove.md b/.changeset/dull-flowers-prove.md new file mode 100644 index 000000000..8a0e05299 --- /dev/null +++ b/.changeset/dull-flowers-prove.md @@ -0,0 +1,5 @@ +--- +'@astrojs/netlify': patch +--- + +Fix route validation failures on Netlify Edge diff --git a/packages/integrations/netlify/src/integration-edge-functions.ts b/packages/integrations/netlify/src/integration-edge-functions.ts index 72ab6fb19..11a18beb9 100644 --- a/packages/integrations/netlify/src/integration-edge-functions.ts +++ b/packages/integrations/netlify/src/integration-edge-functions.ts @@ -53,7 +53,10 @@ async function createEdgeManifest(routes: RouteData[], entryFile: string, dir: U } else { functions.push({ function: entryFile, - pattern: route.pattern.toString(), + // Make route pattern serializable to match expected + // Netlify Edge validation format. Mirrors Netlify's own edge bundler: + // https://github.com/netlify/edge-bundler/blob/main/src/manifest.ts#L34 + pattern: route.pattern.source.replace(/\\\//g, '/').toString(), }); } }