diff options
author | 2024-08-30 13:12:25 -0700 | |
---|---|---|
committer | 2024-08-30 16:12:25 -0400 | |
commit | 534d3edff86115d1fc84f37666a74f35b32bae59 (patch) | |
tree | fa07335adf652c6dd8d03db8c102066d508e703c | |
parent | 01b48a466e9ab58a2ad3603a2e8ed787f550b031 (diff) | |
download | astro-534d3edff86115d1fc84f37666a74f35b32bae59.tar.gz astro-534d3edff86115d1fc84f37666a74f35b32bae59.tar.zst astro-534d3edff86115d1fc84f37666a74f35b32bae59.zip |
[ci] release (alpha) (#11853)astro@5.0.0-alpha.2
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
36 files changed, 200 insertions, 105 deletions
diff --git a/.changeset/pre.json b/.changeset/pre.json index 9e9ee0ffa..08d32c548 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -35,27 +35,22 @@ "blue-boats-relax", "chatty-teachers-sit", "eighty-boxes-applaud", - "fair-rats-fail", + "five-jars-hear", "healthy-ads-scream", "itchy-toys-march", - "long-months-burn", + "long-months-rule", "many-garlics-lick", - "mighty-trees-teach", "modern-bears-deny", - "new-pillows-kick", - "odd-donuts-impress", + "nasty-crabs-worry", + "neat-dots-hear", "perfect-fans-fly", "poor-frogs-dream", "quick-ads-exercise", "selfish-impalas-grin", + "sixty-masks-lie", "small-ties-sort", - "smart-comics-doubt", - "smooth-melons-cough", - "spicy-houses-fry", "spotty-garlics-cheat", "ten-students-repair", - "tiny-lamps-lick", - "weak-dancers-beam", - "weak-masks-do" + "twenty-cobras-push" ] } diff --git a/examples/basics/package.json b/examples/basics/package.json index a2ea00426..95c968663 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^5.0.0-alpha.1" + "astro": "^5.0.0-alpha.2" } } diff --git a/examples/blog/package.json b/examples/blog/package.json index d71b25773..a4ae001da 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -14,6 +14,6 @@ "@astrojs/mdx": "^4.0.0-alpha.1", "@astrojs/rss": "^4.0.7", "@astrojs/sitemap": "^3.1.6", - "astro": "^5.0.0-alpha.1" + "astro": "^5.0.0-alpha.2" } } diff --git a/examples/component/package.json b/examples/component/package.json index 95330b51d..514b0dcf0 100644 --- a/examples/component/package.json +++ b/examples/component/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^5.0.0-alpha.1" + "astro": "^5.0.0-alpha.2" }, "peerDependencies": { "astro": "^4.0.0" diff --git a/examples/container-with-vitest/package.json b/examples/container-with-vitest/package.json index 3c0bfef50..f8b34ebbe 100644 --- a/examples/container-with-vitest/package.json +++ b/examples/container-with-vitest/package.json @@ -12,7 +12,7 @@ "test": "vitest run" }, "dependencies": { - "astro": "^5.0.0-alpha.1", + "astro": "^5.0.0-alpha.2", "@astrojs/react": "^3.6.2", "react": "^18.3.1", "react-dom": "^18.3.1", diff --git a/examples/framework-alpine/package.json b/examples/framework-alpine/package.json index 3f708ecd2..d1395ec3d 100644 --- a/examples/framework-alpine/package.json +++ b/examples/framework-alpine/package.json @@ -14,6 +14,6 @@ "@astrojs/alpinejs": "^0.4.0", "@types/alpinejs": "^3.13.10", "alpinejs": "^3.14.1", - "astro": "^5.0.0-alpha.1" + "astro": "^5.0.0-alpha.2" } } diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json index 61c2fec76..e0fbab278 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -18,7 +18,7 @@ "@astrojs/vue": "^5.0.0-alpha.0", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", - "astro": "^5.0.0-alpha.1", + "astro": "^5.0.0-alpha.2", "preact": "^10.23.2", "react": "^18.3.1", "react-dom": "^18.3.1", diff --git a/examples/framework-preact/package.json b/examples/framework-preact/package.json index e345e7d72..dc337e4f5 100644 --- a/examples/framework-preact/package.json +++ b/examples/framework-preact/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/preact": "^3.5.2", "@preact/signals": "^1.3.0", - "astro": "^5.0.0-alpha.1", + "astro": "^5.0.0-alpha.2", "preact": "^10.23.2" } } diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json index c8a80cbdc..ff56a9151 100644 --- a/examples/framework-react/package.json +++ b/examples/framework-react/package.json @@ -14,7 +14,7 @@ "@astrojs/react": "^3.6.2", "@types/react": "^18.3.4", "@types/react-dom": "^18.3.0", - "astro": "^5.0.0-alpha.1", + "astro": "^5.0.0-alpha.2", "react": "^18.3.1", "react-dom": "^18.3.1" } diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json index 497e1c053..699883ded 100644 --- a/examples/framework-solid/package.json +++ b/examples/framework-solid/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/solid-js": "^4.4.1", - "astro": "^5.0.0-alpha.1", + "astro": "^5.0.0-alpha.2", "solid-js": "^1.8.21" } } diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json index 1b574a393..738d2c84f 100644 --- a/examples/framework-svelte/package.json +++ b/examples/framework-svelte/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/svelte": "^6.0.0-alpha.0", - "astro": "^5.0.0-alpha.1", + "astro": "^5.0.0-alpha.2", "svelte": "^4.2.18" } } diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json index a15c97ed9..44ff7e461 100644 --- a/examples/framework-vue/package.json +++ b/examples/framework-vue/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/vue": "^5.0.0-alpha.0", - "astro": "^5.0.0-alpha.1", + "astro": "^5.0.0-alpha.2", "vue": "^3.4.38" } } diff --git a/examples/hackernews/package.json b/examples/hackernews/package.json index 16c6db424..0d097bc57 100644 --- a/examples/hackernews/package.json +++ b/examples/hackernews/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/node": "^9.0.0-alpha.1", - "astro": "^5.0.0-alpha.1" + "astro": "^5.0.0-alpha.2" } } diff --git a/examples/integration/package.json b/examples/integration/package.json index 7932238e5..d2da2524e 100644 --- a/examples/integration/package.json +++ b/examples/integration/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^5.0.0-alpha.1" + "astro": "^5.0.0-alpha.2" }, "peerDependencies": { "astro": "^4.0.0" diff --git a/examples/middleware/package.json b/examples/middleware/package.json index 6cb2acf33..b4b6a0ef7 100644 --- a/examples/middleware/package.json +++ b/examples/middleware/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@astrojs/node": "^9.0.0-alpha.1", - "astro": "^5.0.0-alpha.1", + "astro": "^5.0.0-alpha.2", "html-minifier": "^4.0.0" }, "devDependencies": { diff --git a/examples/minimal/package.json b/examples/minimal/package.json index e139db2f6..b13f79680 100644 --- a/examples/minimal/package.json +++ b/examples/minimal/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^5.0.0-alpha.1" + "astro": "^5.0.0-alpha.2" } } diff --git a/examples/non-html-pages/package.json b/examples/non-html-pages/package.json index a56c8c1cc..13df70026 100644 --- a/examples/non-html-pages/package.json +++ b/examples/non-html-pages/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^5.0.0-alpha.1" + "astro": "^5.0.0-alpha.2" } } diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json index 0d1550845..39e5b8af3 100644 --- a/examples/portfolio/package.json +++ b/examples/portfolio/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^5.0.0-alpha.1" + "astro": "^5.0.0-alpha.2" } } diff --git a/examples/server-islands/package.json b/examples/server-islands/package.json index 7413e3bc0..13a0b9e99 100644 --- a/examples/server-islands/package.json +++ b/examples/server-islands/package.json @@ -17,7 +17,7 @@ "@tailwindcss/forms": "^0.5.7", "@types/react": "^18.3.4", "@types/react-dom": "^18.3.0", - "astro": "^5.0.0-alpha.1", + "astro": "^5.0.0-alpha.2", "postcss": "^8.4.41", "react": "^18.3.1", "react-dom": "^18.3.1", diff --git a/examples/ssr/package.json b/examples/ssr/package.json index ba422fa90..78c5c5891 100644 --- a/examples/ssr/package.json +++ b/examples/ssr/package.json @@ -14,7 +14,7 @@ "dependencies": { "@astrojs/node": "^9.0.0-alpha.1", "@astrojs/svelte": "^6.0.0-alpha.0", - "astro": "^5.0.0-alpha.1", + "astro": "^5.0.0-alpha.2", "svelte": "^4.2.18" } } diff --git a/examples/starlog/package.json b/examples/starlog/package.json index 45d298fac..ca29ad4b2 100644 --- a/examples/starlog/package.json +++ b/examples/starlog/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^5.0.0-alpha.1", + "astro": "^5.0.0-alpha.2", "sass": "^1.77.8", "sharp": "^0.33.3" } diff --git a/examples/toolbar-app/package.json b/examples/toolbar-app/package.json index a7976df55..005d8f533 100644 --- a/examples/toolbar-app/package.json +++ b/examples/toolbar-app/package.json @@ -15,6 +15,6 @@ "./app": "./dist/app.js" }, "devDependencies": { - "astro": "^5.0.0-alpha.1" + "astro": "^5.0.0-alpha.2" } } diff --git a/examples/view-transitions/package.json b/examples/view-transitions/package.json index 3a3b67d8e..2b5aace64 100644 --- a/examples/view-transitions/package.json +++ b/examples/view-transitions/package.json @@ -12,6 +12,6 @@ "devDependencies": { "@astrojs/tailwind": "^6.0.0-alpha.0", "@astrojs/node": "^9.0.0-alpha.1", - "astro": "^5.0.0-alpha.1" + "astro": "^5.0.0-alpha.2" } } diff --git a/examples/with-markdoc/package.json b/examples/with-markdoc/package.json index 36fdb3422..df24c8da8 100644 --- a/examples/with-markdoc/package.json +++ b/examples/with-markdoc/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/markdoc": "^1.0.0-alpha.0", - "astro": "^5.0.0-alpha.1" + "astro": "^5.0.0-alpha.2" } } diff --git a/examples/with-markdown-plugins/package.json b/examples/with-markdown-plugins/package.json index 528121e74..63df6fc91 100644 --- a/examples/with-markdown-plugins/package.json +++ b/examples/with-markdown-plugins/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/markdown-remark": "^6.0.0-alpha.0", - "astro": "^5.0.0-alpha.1", + "astro": "^5.0.0-alpha.2", "hast-util-select": "^6.0.2", "rehype-autolink-headings": "^7.1.0", "rehype-slug": "^6.0.0", diff --git a/examples/with-markdown-shiki/package.json b/examples/with-markdown-shiki/package.json index 978a76969..779117ef3 100644 --- a/examples/with-markdown-shiki/package.json +++ b/examples/with-markdown-shiki/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^5.0.0-alpha.1" + "astro": "^5.0.0-alpha.2" } } diff --git a/examples/with-mdx/package.json b/examples/with-mdx/package.json index 3e16ae7e0..6ab4d7668 100644 --- a/examples/with-mdx/package.json +++ b/examples/with-mdx/package.json @@ -12,8 +12,8 @@ }, "dependencies": { "@astrojs/mdx": "^4.0.0-alpha.1", - "@astrojs/preact": "^3.5.1", - "astro": "^5.0.0-alpha.1", + "@astrojs/preact": "^3.5.2", + "astro": "^5.0.0-alpha.2", "preact": "^10.23.2" } } diff --git a/examples/with-nanostores/package.json b/examples/with-nanostores/package.json index 078e9b4a2..a047aad32 100644 --- a/examples/with-nanostores/package.json +++ b/examples/with-nanostores/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/preact": "^3.5.2", "@nanostores/preact": "^0.5.2", - "astro": "^5.0.0-alpha.1", + "astro": "^5.0.0-alpha.2", "nanostores": "^0.11.2", "preact": "^10.23.2" } diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json index 368c7ca9f..e793ac5ae 100644 --- a/examples/with-tailwindcss/package.json +++ b/examples/with-tailwindcss/package.json @@ -14,7 +14,7 @@ "@astrojs/mdx": "^4.0.0-alpha.1", "@astrojs/tailwind": "^6.0.0-alpha.0", "@types/canvas-confetti": "^1.6.4", - "astro": "^5.0.0-alpha.1", + "astro": "^5.0.0-alpha.2", "autoprefixer": "^10.4.20", "canvas-confetti": "^1.9.3", "postcss": "^8.4.41", diff --git a/examples/with-vitest/package.json b/examples/with-vitest/package.json index c8462a1d2..c0ef3a81f 100644 --- a/examples/with-vitest/package.json +++ b/examples/with-vitest/package.json @@ -12,7 +12,7 @@ "test": "vitest" }, "dependencies": { - "astro": "^5.0.0-alpha.1", + "astro": "^5.0.0-alpha.2", "vitest": "^2.0.5" } } diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index fd8217ab5..f662bb51f 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -1,5 +1,95 @@ # astro +## 5.0.0-alpha.2 + +### Major Changes + +- [#11826](https://github.com/withastro/astro/pull/11826) [`7315050`](https://github.com/withastro/astro/commit/7315050fc1192fa72ae92aef92b920f63b46118f) Thanks [@matthewp](https://github.com/matthewp)! - Deprecate Astro.glob + + The `Astro.glob` function has been deprecated in favor of Content Collections and `import.meta.glob`. + + - If you want to query for markdown and MDX in your project, use Content Collections. + - If you want to query source files in your project, use `import.meta.glob`(https://vitejs.dev/guide/features.html#glob-import). + + Also consider using glob packages from npm, like [fast-glob](https://www.npmjs.com/package/fast-glob), especially if statically generating your site, as it is faster for most use-cases. + + The easiest path is to migrate to `import.meta.glob` like so: + + ```diff + - const posts = Astro.glob('./posts/*.md'); + + const posts = Object.values(import.meta.glob('./posts/*.md', { eager: true })); + ``` + +- [#11827](https://github.com/withastro/astro/pull/11827) [`a83e362`](https://github.com/withastro/astro/commit/a83e362ee41174501a433c210a24696784d7368f) Thanks [@matthewp](https://github.com/matthewp)! - Prevent usage of `astro:content` in the client + + Usage of `astro:content` in the client has always been discouraged because it leads to all of your content winding up in your client bundle, and can possibly leaks secrets. + + This formally makes doing so impossible, adding to the previous warning with errors. + + In the future Astro might add APIs for client-usage based on needs. + +- [#11253](https://github.com/withastro/astro/pull/11253) [`4e5cc5a`](https://github.com/withastro/astro/commit/4e5cc5aadd7d864bc5194ee67dc2ea74dbe80473) Thanks [@kevinzunigacuellar](https://github.com/kevinzunigacuellar)! - Changes the data returned for `page.url.current`, `page.url.next`, `page.url.prev`, `page.url.first` and `page.url.last` to include the value set for `base` in your Astro config. + + Previously, you had to manually prepend your configured value for `base` to the URL path. Now, Astro automatically includes your `base` value in `next` and `prev` URLs. + + If you are using the `paginate()` function for "previous" and "next" URLs, remove any existing `base` value as it is now added for you: + + ```diff + --- + export async function getStaticPaths({ paginate }) { + const astronautPages = [{ + astronaut: 'Neil Armstrong', + }, { + astronaut: 'Buzz Aldrin', + }, { + astronaut: 'Sally Ride', + }, { + astronaut: 'John Glenn', + }]; + return paginate(astronautPages, { pageSize: 1 }); + } + const { page } = Astro.props; + // `base: /'docs'` configured in `astro.config.mjs` + - const prev = "/docs" + page.url.prev; + + const prev = page.url.prev; + --- + <a id="prev" href={prev}>Back</a> + ``` + +### Minor Changes + +- [#11698](https://github.com/withastro/astro/pull/11698) [`05139ef`](https://github.com/withastro/astro/commit/05139ef8b46de96539cc1d08148489eaf3cfd837) Thanks [@ematipico](https://github.com/ematipico)! - Adds a new property to the globals `Astro` and `APIContext` called `routePattern`. The `routePattern` represents the current route (component) + that is being rendered by Astro. It's usually a path pattern will look like this: `blog/[slug]`: + + ```asto + --- + // src/pages/blog/[slug].astro + const route = Astro.routePattern; + console.log(route); // it will log "blog/[slug]" + --- + ``` + + ```js + // src/pages/index.js + + export const GET = (ctx) => { + console.log(ctx.routePattern); // it will log src/pages/index.js + return new Response.json({ loreum: 'ipsum' }); + }; + ``` + +### Patch Changes + +- [#11791](https://github.com/withastro/astro/pull/11791) [`9393243`](https://github.com/withastro/astro/commit/93932432e7239a1d31c68ea916945302286268e9) Thanks [@bluwy](https://github.com/bluwy)! - Updates Astro's default `<script>` rendering strategy and removes the `experimental.directRenderScript` option as this is now the default behavior: scripts are always rendered directly. This new strategy prevents scripts from being executed in pages where they are not used. + + Scripts will directly render as declared in Astro files (including existing features like TypeScript, importing `node_modules`, and deduplicating scripts). You can also now conditionally render scripts in your Astro file. + + However, this means scripts are no longer hoisted to the `<head>`, multiple scripts on a page are no longer bundled together, and the `<script>` tag may interfere with the CSS styling. + + As this is a potentially breaking change to your script behavior, please review your `<script>` tags and ensure that they behave as expected. + +- [#11767](https://github.com/withastro/astro/pull/11767) [`d1bd1a1`](https://github.com/withastro/astro/commit/d1bd1a11f7aca4d2141d1c4665f2db0440393d03) Thanks [@ascorbic](https://github.com/ascorbic)! - Refactors content layer sync to use a queue + ## 4.15.0 ### Minor Changes diff --git a/packages/astro/package.json b/packages/astro/package.json index 897917eba..25c62340e 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -1,6 +1,6 @@ { "name": "astro", - "version": "5.0.0-alpha.1", + "version": "5.0.0-alpha.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/astro/src/content/vite-plugin-content-virtual-mod.ts b/packages/astro/src/content/vite-plugin-content-virtual-mod.ts index 0ad253dd8..ad0b48723 100644 --- a/packages/astro/src/content/vite-plugin-content-virtual-mod.ts +++ b/packages/astro/src/content/vite-plugin-content-virtual-mod.ts @@ -254,20 +254,19 @@ export async function generateContentEntryFile({ } let virtualModContents: string; - if(isClient) { + if (isClient) { throw new AstroError({ ...AstroErrorData.ServerOnlyModule, message: AstroErrorData.ServerOnlyModule.message('astro:content'), }); } else { - virtualModContents = - nodeFs - .readFileSync(contentPaths.virtualModTemplate, 'utf-8') - .replace('@@CONTENT_DIR@@', relContentDir) - .replace("'@@CONTENT_ENTRY_GLOB_PATH@@'", contentEntryGlobResult) - .replace("'@@DATA_ENTRY_GLOB_PATH@@'", dataEntryGlobResult) - .replace("'@@RENDER_ENTRY_GLOB_PATH@@'", renderEntryGlobResult) - .replace('/* @@LOOKUP_MAP_ASSIGNMENT@@ */', `lookupMap = ${JSON.stringify(lookupMap)};`); + virtualModContents = nodeFs + .readFileSync(contentPaths.virtualModTemplate, 'utf-8') + .replace('@@CONTENT_DIR@@', relContentDir) + .replace("'@@CONTENT_ENTRY_GLOB_PATH@@'", contentEntryGlobResult) + .replace("'@@DATA_ENTRY_GLOB_PATH@@'", dataEntryGlobResult) + .replace("'@@RENDER_ENTRY_GLOB_PATH@@'", renderEntryGlobResult) + .replace('/* @@LOOKUP_MAP_ASSIGNMENT@@ */', `lookupMap = ${JSON.stringify(lookupMap)};`); } return virtualModContents; diff --git a/packages/astro/src/core/middleware/index.ts b/packages/astro/src/core/middleware/index.ts index 6364f8c9e..c8ce1f2c8 100644 --- a/packages/astro/src/core/middleware/index.ts +++ b/packages/astro/src/core/middleware/index.ts @@ -61,7 +61,7 @@ function createContext({ generator: `Astro v${ASTRO_VERSION}`, props: {}, rewrite, - routePattern: "", + routePattern: '', redirect(path, status) { return new Response(null, { status: status || 302, diff --git a/packages/astro/test/astro-global.test.js b/packages/astro/test/astro-global.test.js index 3b118f278..353de4a1f 100644 --- a/packages/astro/test/astro-global.test.js +++ b/packages/astro/test/astro-global.test.js @@ -46,17 +46,20 @@ describe('Astro Global', () => { false, ); }); - - it("Astro.route.pattern has the right value in pages and components", async () => { + + it('Astro.route.pattern has the right value in pages and components', async () => { let html = await fixture.fetch('/blog').then((res) => res.text()); let $ = cheerio.load(html); - assert.match($("#pattern").text(), /Astro route pattern: \//); - assert.match($("#pattern-middleware").text(), /Astro route pattern middleware: \//); + assert.match($('#pattern').text(), /Astro route pattern: \//); + assert.match($('#pattern-middleware').text(), /Astro route pattern middleware: \//); html = await fixture.fetch('/blog/omit-markdown-extensions/').then((res) => res.text()); $ = cheerio.load(html); - assert.match($("#pattern").text(), /Astro route pattern: \/omit-markdown-extensions/); - assert.match($("#pattern-middleware").text(), /Astro route pattern middleware: \/omit-markdown-extensions/); - }) + assert.match($('#pattern').text(), /Astro route pattern: \/omit-markdown-extensions/); + assert.match( + $('#pattern-middleware').text(), + /Astro route pattern middleware: \/omit-markdown-extensions/, + ); + }); }); describe('build', () => { @@ -93,23 +96,28 @@ describe('Astro Global', () => { assert.equal($('.post-url[href]').length, 8); }); - it("Astro.route.pattern has the right value in pages and components", async () => { + it('Astro.route.pattern has the right value in pages and components', async () => { let html = await fixture.readFile('/index.html'); let $ = cheerio.load(html); - assert.match($("#pattern").text(), /Astro route pattern: \//); - assert.match($("#pattern-middleware").text(), /Astro route pattern middleware: \//); + assert.match($('#pattern').text(), /Astro route pattern: \//); + assert.match($('#pattern-middleware').text(), /Astro route pattern middleware: \//); - html =await fixture.readFile('/omit-markdown-extensions/index.html'); + html = await fixture.readFile('/omit-markdown-extensions/index.html'); $ = cheerio.load(html); - assert.match($("#pattern").text(), /Astro route pattern: \/omit-markdown-extensions/); - assert.match($("#pattern-middleware").text(), /Astro route pattern middleware: \/omit-markdown-extensions/); + assert.match($('#pattern').text(), /Astro route pattern: \/omit-markdown-extensions/); + assert.match( + $('#pattern-middleware').text(), + /Astro route pattern middleware: \/omit-markdown-extensions/, + ); html = await fixture.readFile('/posts/1/index.html'); $ = cheerio.load(html); - assert.equal($("#pattern").text(), "Astro route pattern: /posts/[page]"); - assert.equal($("#pattern-middleware").text(), "Astro route pattern middleware: /posts/[page]"); - - }) + assert.equal($('#pattern').text(), 'Astro route pattern: /posts/[page]'); + assert.equal( + $('#pattern-middleware').text(), + 'Astro route pattern middleware: /posts/[page]', + ); + }); }); describe('app', () => { @@ -135,18 +143,21 @@ describe('Astro Global', () => { assert.equal($('#site').attr('href'), 'https://mysite.dev/subsite/'); }); - it("Astro.route.pattern has the right value in pages and components", async () => { + it('Astro.route.pattern has the right value in pages and components', async () => { let response = await app.render(new Request('https://example.com/')); let html = await response.text(); let $ = cheerio.load(html); - assert.match($("#pattern").text(), /Astro route pattern: \//); - assert.match($("#pattern-middleware").text(), /Astro route pattern middleware: \//); + assert.match($('#pattern').text(), /Astro route pattern: \//); + assert.match($('#pattern-middleware').text(), /Astro route pattern middleware: \//); response = await app.render(new Request('https://example.com/omit-markdown-extensions')); html = await response.text(); $ = cheerio.load(html); - assert.match($("#pattern").text(), /Astro route pattern: \/omit-markdown-extensions/); - assert.match($("#pattern-middleware").text(), /Astro route pattern middleware: \/omit-markdown-extensions/); - }) + assert.match($('#pattern').text(), /Astro route pattern: \/omit-markdown-extensions/); + assert.match( + $('#pattern-middleware').text(), + /Astro route pattern middleware: \/omit-markdown-extensions/, + ); + }); }); }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 10cc1d6b6..3994bd5e5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -116,7 +116,7 @@ importers: examples/basics: dependencies: astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro examples/blog: @@ -131,13 +131,13 @@ importers: specifier: ^3.1.6 version: link:../../packages/integrations/sitemap astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro examples/component: devDependencies: astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro examples/container-with-vitest: @@ -146,7 +146,7 @@ importers: specifier: ^3.6.2 version: link:../../packages/integrations/react astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro react: specifier: ^18.3.1 @@ -177,7 +177,7 @@ importers: specifier: ^3.14.1 version: 3.14.1 astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro examples/framework-multiple: @@ -204,7 +204,7 @@ importers: specifier: ^18.3.0 version: 18.3.0 astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro preact: specifier: ^10.23.2 @@ -234,7 +234,7 @@ importers: specifier: ^1.3.0 version: 1.3.0(preact@10.23.2) astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro preact: specifier: ^10.23.2 @@ -252,7 +252,7 @@ importers: specifier: ^18.3.0 version: 18.3.0 astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro react: specifier: ^18.3.1 @@ -267,7 +267,7 @@ importers: specifier: ^4.4.1 version: link:../../packages/integrations/solid astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro solid-js: specifier: ^1.8.21 @@ -279,7 +279,7 @@ importers: specifier: ^6.0.0-alpha.0 version: link:../../packages/integrations/svelte astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro svelte: specifier: ^4.2.18 @@ -291,7 +291,7 @@ importers: specifier: ^5.0.0-alpha.0 version: link:../../packages/integrations/vue astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro vue: specifier: ^3.4.38 @@ -303,13 +303,13 @@ importers: specifier: ^9.0.0-alpha.1 version: link:../../packages/integrations/node astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro examples/integration: devDependencies: astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro examples/middleware: @@ -318,7 +318,7 @@ importers: specifier: ^9.0.0-alpha.1 version: link:../../packages/integrations/node astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro html-minifier: specifier: ^4.0.0 @@ -331,19 +331,19 @@ importers: examples/minimal: dependencies: astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro examples/non-html-pages: dependencies: astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro examples/portfolio: dependencies: astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro examples/server-islands: @@ -370,7 +370,7 @@ importers: specifier: ^18.3.0 version: 18.3.0 astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro postcss: specifier: ^8.4.41 @@ -394,7 +394,7 @@ importers: specifier: ^6.0.0-alpha.0 version: link:../../packages/integrations/svelte astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro svelte: specifier: ^4.2.18 @@ -403,7 +403,7 @@ importers: examples/starlog: dependencies: astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro sass: specifier: ^1.77.8 @@ -415,7 +415,7 @@ importers: examples/toolbar-app: devDependencies: astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro examples/view-transitions: @@ -427,7 +427,7 @@ importers: specifier: ^6.0.0-alpha.0 version: link:../../packages/integrations/tailwind astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro examples/with-markdoc: @@ -436,7 +436,7 @@ importers: specifier: ^1.0.0-alpha.0 version: link:../../packages/integrations/markdoc astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro examples/with-markdown-plugins: @@ -445,7 +445,7 @@ importers: specifier: ^6.0.0-alpha.0 version: link:../../packages/markdown/remark astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro hast-util-select: specifier: ^6.0.2 @@ -466,7 +466,7 @@ importers: examples/with-markdown-shiki: dependencies: astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro examples/with-mdx: @@ -475,10 +475,10 @@ importers: specifier: ^4.0.0-alpha.1 version: link:../../packages/integrations/mdx '@astrojs/preact': - specifier: ^3.5.1 + specifier: ^3.5.2 version: link:../../packages/integrations/preact astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro preact: specifier: ^10.23.2 @@ -493,7 +493,7 @@ importers: specifier: ^0.5.2 version: 0.5.2(nanostores@0.11.3)(preact@10.23.2) astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro nanostores: specifier: ^0.11.2 @@ -514,7 +514,7 @@ importers: specifier: ^1.6.4 version: 1.6.4 astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro autoprefixer: specifier: ^10.4.20 @@ -532,7 +532,7 @@ importers: examples/with-vitest: dependencies: astro: - specifier: ^5.0.0-alpha.1 + specifier: ^5.0.0-alpha.2 version: link:../../packages/astro vitest: specifier: ^2.0.5 |