diff --git a/.changeset/cyan-paws-fry.md b/.changeset/cyan-paws-fry.md deleted file mode 100644 index df2585ecb9299..0000000000000 --- a/.changeset/cyan-paws-fry.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -'astro': minor -'@astrojs/node': minor ---- - -# Adapter support for `astro preview` - -Adapters are now about to support the `astro preview` command via a new integration option. The Node.js adapter `@astrojs/node` is the first of the built-in adapters to gain support for this. What this means is that if you are using `@astrojs/node` you can new preview your SSR app by running: - -```shell -npm run preview -``` - -## Adapter API - -We will be updating the other first party Astro adapters to support preview over time. Adapters can opt-in to this feature by providing the `previewEntrypoint` via the `setAdapter` function in `astro:config:done` hook. The Node.js adapter's code looks like this: - -```diff -export default function() { - return { - name: '@astrojs/node', - hooks: { - 'astro:config:done': ({ setAdapter, config }) => { - setAdapter({ - name: '@astrojs/node', - serverEntrypoint: '@astrojs/node/server.js', -+ previewEntrypoint: '@astrojs/node/preview.js', - exports: ['handler'], - }); - - // more here - } - } - }; -} -``` - -The `previewEntrypoint` is a module in the adapter's package that is a Node.js script. This script is run when `astro preview` is run and is charged with starting up the built server. See the Node.js implementation in `@astrojs/node` to see how that is implemented. diff --git a/.changeset/early-pillows-deliver.md b/.changeset/early-pillows-deliver.md deleted file mode 100644 index 745ff35f07b0e..0000000000000 --- a/.changeset/early-pillows-deliver.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/svelte': patch ---- - -Allow class to be passed into Svelte islands diff --git a/.changeset/fifty-ads-march.md b/.changeset/fifty-ads-march.md deleted file mode 100644 index d06e8fc36cc27..0000000000000 --- a/.changeset/fifty-ads-march.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -'astro': minor ---- - -## New properties for API routes - -In API routes, you can now get the `site`, `generator`, `url`, `clientAddress`, `props`, and `redirect` fields on the APIContext, which is the first parameter passed to an API route. This was done to make the APIContext more closely align with the `Astro` global in .astro pages. - -For example, here's how you might use the `clientAddress`, which is the user's IP address, to selectively allow users. - -```js -export function post({ clientAddress, request, redirect }) { - if(!allowList.has(clientAddress)) { - return redirect('/not-allowed'); - } -} -``` - -Check out the docs for more information on the newly available fields: https://docs.astro.build/en/core-concepts/endpoints/#server-endpoints-api-routes diff --git a/.changeset/giant-news-speak.md b/.changeset/giant-news-speak.md deleted file mode 100644 index f0fb38d64b2e1..0000000000000 --- a/.changeset/giant-news-speak.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -'astro': minor ---- - -Added support for updating TypeScript settings automatically when using `astro add` - -The `astro add` command will now automatically update your `tsconfig.json` with the proper TypeScript settings needed for the chosen frameworks. - -For instance, typing `astro add solid` will update your `tsconfig.json` with the following settings, per [Solid's TypeScript guide](https://www.solidjs.com/guides/typescript): - -```json -{ - "compilerOptions": { - "jsx": "preserve", - "jsxImportSource": "solid-js" - } -} -``` diff --git a/.changeset/metal-pumas-walk.md b/.changeset/metal-pumas-walk.md deleted file mode 100644 index a6b15a07f3efc..0000000000000 --- a/.changeset/metal-pumas-walk.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -'@astrojs/node': major ---- - -# Standalone mode for the Node.js adapter - -New in `@astrojs/node` is support for __standalone mode__. With standalone mode you can start your production server without needing to write any server JavaScript yourself. The server starts simply by running the script like so: - -```shell -node ./dist/server/entry.mjs -``` - -To enable standalone mode, set the new `mode` to `'standalone'` option in your Astro config: - -```js -import { defineConfig } from 'astro/config'; -import nodejs from '@astrojs/node'; - -export default defineConfig({ - output: 'server', - adapter: nodejs({ - mode: 'standalone' - }) -}); -``` - -See the @astrojs/node documentation to learn all of the options available in standalone mode. - -## Breaking change - -This is a semver major change because the new `mode` option is required. Existing @astrojs/node users who are using their own HTTP server framework such as Express can upgrade by setting the `mode` option to `'middleware'` in order to build to a middleware mode, which is the same behavior and API as before. - -```js -import { defineConfig } from 'astro/config'; -import nodejs from '@astrojs/node'; - -export default defineConfig({ - output: 'server', - adapter: nodejs({ - mode: 'middleware' - }) -}); -``` diff --git a/.changeset/new-hotels-unite.md b/.changeset/new-hotels-unite.md deleted file mode 100644 index 8febc2d47edaa..0000000000000 --- a/.changeset/new-hotels-unite.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'astro': minor ---- - -- Added `isRestart` and `addWatchFile` to integration step `isRestart`. -- Restart dev server automatically when tsconfig changes. diff --git a/.changeset/selfish-foxes-bake.md b/.changeset/selfish-foxes-bake.md deleted file mode 100644 index 9e253388ac915..0000000000000 --- a/.changeset/selfish-foxes-bake.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -'astro': minor ---- - -## Support passing a custom status code for Astro.redirect - -New in this minor is the ability to pass a status code to `Astro.redirect`. By default it uses `302` but now you can pass another code as the second argument: - -```astro ---- -// This page was moved -return Astro.redirect('/posts/new-post-name', 301); ---- -``` diff --git a/.changeset/serious-icons-dream.md b/.changeset/serious-icons-dream.md deleted file mode 100644 index 968f8a4b451eb..0000000000000 --- a/.changeset/serious-icons-dream.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Skip JSX tagging for export statements with source diff --git a/.changeset/sixty-ladybugs-return.md b/.changeset/sixty-ladybugs-return.md deleted file mode 100644 index 0f8282dc59da2..0000000000000 --- a/.changeset/sixty-ladybugs-return.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Upgrade Astro compiler to 0.27.1 diff --git a/.changeset/stupid-points-refuse.md b/.changeset/stupid-points-refuse.md deleted file mode 100644 index e79106541cbfd..0000000000000 --- a/.changeset/stupid-points-refuse.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -'astro': minor -'@astrojs/cloudflare': minor -'@astrojs/deno': minor -'@astrojs/image': minor -'@astrojs/netlify': minor -'@astrojs/node': minor -'@astrojs/vercel': minor ---- - -# New build configuration - -The ability to customize SSR build configuration more granularly is now available in Astro. You can now customize the output folder for `server` (the server code for SSR), `client` (your client-side JavaScript and assets), and `serverEntry` (the name of the entrypoint server module). Here are the defaults: - -```js -import { defineConfig } from 'astro/config'; - -export default defineConfig({ - output: 'server', - build: { - server: './dist/server/', - client: './dist/client/', - serverEntry: 'entry.mjs', - } -}); -``` - -These new configuration options are only supported in SSR mode and are ignored when building to SSG (a static site). - -## Integration hook change - -The integration hook `astro:build:start` includes a param `buildConfig` which includes all of these same options. You can continue to use this param in Astro 1.x, but it is deprecated in favor of the new `build.config` options. All of the built-in adapters have been updated to the new format. If you have an integration that depends on this param we suggest upgrading to do this instead: - -```js -export default function myIntegration() { - return { - name: 'my-integration', - hooks: { - 'astro:config:setup': ({ updateConfig }) => { - updateConfig({ - build: { - server: '...' - } - }); - } - } - } -} -``` diff --git a/.changeset/ten-candles-relate.md b/.changeset/ten-candles-relate.md deleted file mode 100644 index 402e46a1cdee0..0000000000000 --- a/.changeset/ten-candles-relate.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@astrojs/tailwind': minor ---- - -## HMR on config file changes - -New in this release is the ability for config changes to automatically reflect via HMR. Now when you edit your `tsconfig.json` or `tailwind.config.js` configs, the changes will reload automatically without the need to restart your dev server. diff --git a/.changeset/ten-phones-drop.md b/.changeset/ten-phones-drop.md deleted file mode 100644 index 4233ec43300a3..0000000000000 --- a/.changeset/ten-phones-drop.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/solid-js': minor ---- - -Auto ssr.noExternal solidjs dependencies diff --git a/.changeset/thin-parents-breathe.md b/.changeset/thin-parents-breathe.md deleted file mode 100644 index 2867ab3b62f7c..0000000000000 --- a/.changeset/thin-parents-breathe.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Support strict dependency install for libraries with JSX diff --git a/.changeset/witty-sheep-wave.md b/.changeset/witty-sheep-wave.md deleted file mode 100644 index cac7841e46596..0000000000000 --- a/.changeset/witty-sheep-wave.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'astro': patch ---- - -Update Astro.cookies.set types to allow booleans and numbers - -Note that booleans and numbers were already allowed, they just were not allowed by the type definitions. diff --git a/examples/basics/package.json b/examples/basics/package.json index 0317758cacfe0..0a5b48aaaa686 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.4.7" + "astro": "^1.5.0" } } diff --git a/examples/blog/package.json b/examples/blog/package.json index 722b1a2fe74ad..6baaa6746c367 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.4.7", + "astro": "^1.5.0", "@astrojs/mdx": "^0.11.4", "@astrojs/rss": "^1.0.2", "@astrojs/sitemap": "^1.0.0" diff --git a/examples/component/package.json b/examples/component/package.json index 1070651476111..4fd6e320d0834 100644 --- a/examples/component/package.json +++ b/examples/component/package.json @@ -15,9 +15,9 @@ ], "scripts": {}, "devDependencies": { - "astro": "^1.4.7" + "astro": "^1.5.0" }, "peerDependencies": { - "astro": "^1.4.7" + "astro": "^1.5.0" } } diff --git a/examples/deno/package.json b/examples/deno/package.json index bd3af4dba2a9a..b5171bfe123ef 100644 --- a/examples/deno/package.json +++ b/examples/deno/package.json @@ -10,9 +10,9 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.4.7" + "astro": "^1.5.0" }, "devDependencies": { - "@astrojs/deno": "^1.1.0" + "@astrojs/deno": "^1.2.0" } } diff --git a/examples/docs/package.json b/examples/docs/package.json index d84a96527e27f..34ea9c03d4388 100644 --- a/examples/docs/package.json +++ b/examples/docs/package.json @@ -12,7 +12,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.4.7", + "astro": "^1.5.0", "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 b22c9c637010f..581f3b6637feb 100644 --- a/examples/framework-alpine/package.json +++ b/examples/framework-alpine/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.4.7", + "astro": "^1.5.0", "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 b0742ff94ee23..160dcd4d2cda6 100644 --- a/examples/framework-lit/package.json +++ b/examples/framework-lit/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.4.7", + "astro": "^1.5.0", "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 9adb7a9e154ab..4b25ab7bd9e14 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.4.7", + "astro": "^1.5.0", "preact": "^10.7.3", "react": "^18.1.0", "react-dom": "^18.1.0", @@ -20,8 +20,8 @@ "vue": "^3.2.37", "@astrojs/preact": "^1.2.0", "@astrojs/react": "^1.2.0", - "@astrojs/solid-js": "^1.1.1", - "@astrojs/svelte": "^1.0.1", + "@astrojs/solid-js": "^1.2.0", + "@astrojs/svelte": "^1.0.2", "@astrojs/vue": "^1.1.0" } } diff --git a/examples/framework-preact/package.json b/examples/framework-preact/package.json index 6460bff844f67..6a94916a3bd09 100644 --- a/examples/framework-preact/package.json +++ b/examples/framework-preact/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.4.7", + "astro": "^1.5.0", "preact": "^10.7.3", "@astrojs/preact": "^1.2.0", "@preact/signals": "^1.1.0" diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json index 44cb415ba088f..88bdd9917607b 100644 --- a/examples/framework-react/package.json +++ b/examples/framework-react/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.4.7", + "astro": "^1.5.0", "react": "^18.1.0", "react-dom": "^18.1.0", "@astrojs/react": "^1.2.0", diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json index 9ba2cf652e031..2c19e901596bb 100644 --- a/examples/framework-solid/package.json +++ b/examples/framework-solid/package.json @@ -11,8 +11,8 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.4.7", + "astro": "^1.5.0", "solid-js": "^1.4.3", - "@astrojs/solid-js": "^1.1.1" + "@astrojs/solid-js": "^1.2.0" } } diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json index 020a1d13541b3..1a5fc2cc55cd7 100644 --- a/examples/framework-svelte/package.json +++ b/examples/framework-svelte/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "svelte": "^3.48.0", - "@astrojs/svelte": "^1.0.1", - "astro": "^1.4.7" + "@astrojs/svelte": "^1.0.2", + "astro": "^1.5.0" } } diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json index a27c9c40792b7..779ddf150a849 100644 --- a/examples/framework-vue/package.json +++ b/examples/framework-vue/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.4.7", + "astro": "^1.5.0", "vue": "^3.2.37", "@astrojs/vue": "^1.1.0" } diff --git a/examples/integration/package.json b/examples/integration/package.json index 8beb4f8660e75..3dfd744ca77dc 100644 --- a/examples/integration/package.json +++ b/examples/integration/package.json @@ -15,9 +15,9 @@ ], "scripts": {}, "devDependencies": { - "astro": "^1.4.7" + "astro": "^1.5.0" }, "peerDependencies": { - "astro": "^1.4.7" + "astro": "^1.5.0" } } diff --git a/examples/minimal/package.json b/examples/minimal/package.json index 4cc8bb39b5147..d184053a454e4 100644 --- a/examples/minimal/package.json +++ b/examples/minimal/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.4.7" + "astro": "^1.5.0" } } diff --git a/examples/non-html-pages/package.json b/examples/non-html-pages/package.json index 3dd1d08898265..703c90365fe63 100644 --- a/examples/non-html-pages/package.json +++ b/examples/non-html-pages/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.4.7" + "astro": "^1.5.0" } } diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json index dd6ac8137e0ed..7cd4cafe65639 100644 --- a/examples/portfolio/package.json +++ b/examples/portfolio/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.4.7" + "astro": "^1.5.0" } } diff --git a/examples/ssr/astro.config.mjs b/examples/ssr/astro.config.mjs index 2ff8bbaf55b54..b79949397d947 100644 --- a/examples/ssr/astro.config.mjs +++ b/examples/ssr/astro.config.mjs @@ -6,7 +6,7 @@ import node from '@astrojs/node'; export default defineConfig({ output: 'server', adapter: node({ - mode: 'standalone' + mode: 'standalone', }), integrations: [svelte()], }); diff --git a/examples/ssr/package.json b/examples/ssr/package.json index bbc19e2bd2b66..e792eb3ae337a 100644 --- a/examples/ssr/package.json +++ b/examples/ssr/package.json @@ -13,10 +13,10 @@ }, "devDependencies": {}, "dependencies": { - "astro": "^1.4.7", + "astro": "^1.5.0", "svelte": "^3.48.0", - "@astrojs/svelte": "^1.0.1", - "@astrojs/node": "^1.1.0", + "@astrojs/svelte": "^1.0.2", + "@astrojs/node": "^2.0.0", "concurrently": "^7.2.1", "lightcookie": "^1.0.25", "unocss": "^0.15.6", diff --git a/examples/with-markdown-plugins/package.json b/examples/with-markdown-plugins/package.json index abb6fe575a67f..12acd79c92d73 100644 --- a/examples/with-markdown-plugins/package.json +++ b/examples/with-markdown-plugins/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.4.7", + "astro": "^1.5.0", "@astrojs/markdown-remark": "^1.1.3", "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 e899f3874a0c6..2413062dee02f 100644 --- a/examples/with-markdown-shiki/package.json +++ b/examples/with-markdown-shiki/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.4.7" + "astro": "^1.5.0" } } diff --git a/examples/with-mdx/package.json b/examples/with-mdx/package.json index be6fba5237c94..1a7157ac114c6 100644 --- a/examples/with-mdx/package.json +++ b/examples/with-mdx/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.4.7", + "astro": "^1.5.0", "preact": "^10.6.5", "@astrojs/preact": "^1.2.0", "@astrojs/mdx": "^0.11.4" diff --git a/examples/with-nanostores/package.json b/examples/with-nanostores/package.json index a25ad90bb0c4d..c17a816c65e5a 100644 --- a/examples/with-nanostores/package.json +++ b/examples/with-nanostores/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.4.7", + "astro": "^1.5.0", "preact": "^10.7.3", "@astrojs/preact": "^1.2.0", "nanostores": "^0.5.12", diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json index 4ffa967517531..26095362ef8ba 100644 --- a/examples/with-tailwindcss/package.json +++ b/examples/with-tailwindcss/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/tailwind": "^2.0.2", + "@astrojs/tailwind": "^2.1.0", "@types/canvas-confetti": "^1.4.3", - "astro": "^1.4.7", + "astro": "^1.5.0", "autoprefixer": "^10.4.7", "canvas-confetti": "^1.5.1", "postcss": "^8.4.14", diff --git a/examples/with-vite-plugin-pwa/package.json b/examples/with-vite-plugin-pwa/package.json index 5ed93e41d6802..0b52021486978 100644 --- a/examples/with-vite-plugin-pwa/package.json +++ b/examples/with-vite-plugin-pwa/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^1.4.7", + "astro": "^1.5.0", "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 778e86b415166..f78c36630d934 100644 --- a/examples/with-vitest/package.json +++ b/examples/with-vitest/package.json @@ -12,7 +12,7 @@ "test": "vitest" }, "dependencies": { - "astro": "^1.4.7", + "astro": "^1.5.0", "vitest": "^0.20.3" } } diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index 9bf98dcf3dfc1..8d531f11d4071 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -1,5 +1,141 @@ # astro +## 1.5.0 + +### Minor Changes + +- [#5056](https://github.com/withastro/astro/pull/5056) [`e55af8a23`](https://github.com/withastro/astro/commit/e55af8a23233b6335f45b7a04b9d026990fb616c) Thanks [@matthewp](https://github.com/matthewp)! - # Adapter support for `astro preview` + + Adapters are now about to support the `astro preview` command via a new integration option. The Node.js adapter `@astrojs/node` is the first of the built-in adapters to gain support for this. What this means is that if you are using `@astrojs/node` you can new preview your SSR app by running: + + ```shell + npm run preview + ``` + + ## Adapter API + + We will be updating the other first party Astro adapters to support preview over time. Adapters can opt-in to this feature by providing the `previewEntrypoint` via the `setAdapter` function in `astro:config:done` hook. The Node.js adapter's code looks like this: + + ```diff + export default function() { + return { + name: '@astrojs/node', + hooks: { + 'astro:config:done': ({ setAdapter, config }) => { + setAdapter({ + name: '@astrojs/node', + serverEntrypoint: '@astrojs/node/server.js', + + previewEntrypoint: '@astrojs/node/preview.js', + exports: ['handler'], + }); + + // more here + } + } + }; + } + ``` + + The `previewEntrypoint` is a module in the adapter's package that is a Node.js script. This script is run when `astro preview` is run and is charged with starting up the built server. See the Node.js implementation in `@astrojs/node` to see how that is implemented. + +- [#4986](https://github.com/withastro/astro/pull/4986) [`ebd364e39`](https://github.com/withastro/astro/commit/ebd364e392035b379dd00b8f2f15a4cc09ee88e6) Thanks [@bluwy](https://github.com/bluwy)! - ## New properties for API routes + + In API routes, you can now get the `site`, `generator`, `url`, `clientAddress`, `props`, and `redirect` fields on the APIContext, which is the first parameter passed to an API route. This was done to make the APIContext more closely align with the `Astro` global in .astro pages. + + For example, here's how you might use the `clientAddress`, which is the user's IP address, to selectively allow users. + + ```js + export function post({ clientAddress, request, redirect }) { + if (!allowList.has(clientAddress)) { + return redirect('/not-allowed'); + } + } + ``` + + Check out the docs for more information on the newly available fields: https://docs.astro.build/en/core-concepts/endpoints/#server-endpoints-api-routes + +- [#4959](https://github.com/withastro/astro/pull/4959) [`0ea6187f9`](https://github.com/withastro/astro/commit/0ea6187f95f68d1a3ed98ef4d660e71206883bac) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Added support for updating TypeScript settings automatically when using `astro add` + + The `astro add` command will now automatically update your `tsconfig.json` with the proper TypeScript settings needed for the chosen frameworks. + + For instance, typing `astro add solid` will update your `tsconfig.json` with the following settings, per [Solid's TypeScript guide](https://www.solidjs.com/guides/typescript): + + ```json + { + "compilerOptions": { + "jsx": "preserve", + "jsxImportSource": "solid-js" + } + } + ``` + +- [#4947](https://github.com/withastro/astro/pull/4947) [`a5e3ecc80`](https://github.com/withastro/astro/commit/a5e3ecc8039c1e115ce5597362e18cd35d04e40b) Thanks [@JuanM04](https://github.com/JuanM04)! - - Added `isRestart` and `addWatchFile` to integration step `isRestart`. + + - Restart dev server automatically when tsconfig changes. + +- [#4986](https://github.com/withastro/astro/pull/4986) [`ebd364e39`](https://github.com/withastro/astro/commit/ebd364e392035b379dd00b8f2f15a4cc09ee88e6) Thanks [@bluwy](https://github.com/bluwy)! - ## Support passing a custom status code for Astro.redirect + + New in this minor is the ability to pass a status code to `Astro.redirect`. By default it uses `302` but now you can pass another code as the second argument: + + ```astro + --- + // This page was moved + return Astro.redirect('/posts/new-post-name', 301); + --- + ``` + +- [#5056](https://github.com/withastro/astro/pull/5056) [`e55af8a23`](https://github.com/withastro/astro/commit/e55af8a23233b6335f45b7a04b9d026990fb616c) Thanks [@matthewp](https://github.com/matthewp)! - # New build configuration + + The ability to customize SSR build configuration more granularly is now available in Astro. You can now customize the output folder for `server` (the server code for SSR), `client` (your client-side JavaScript and assets), and `serverEntry` (the name of the entrypoint server module). Here are the defaults: + + ```js + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + output: 'server', + build: { + server: './dist/server/', + client: './dist/client/', + serverEntry: 'entry.mjs', + }, + }); + ``` + + These new configuration options are only supported in SSR mode and are ignored when building to SSG (a static site). + + ## Integration hook change + + The integration hook `astro:build:start` includes a param `buildConfig` which includes all of these same options. You can continue to use this param in Astro 1.x, but it is deprecated in favor of the new `build.config` options. All of the built-in adapters have been updated to the new format. If you have an integration that depends on this param we suggest upgrading to do this instead: + + ```js + export default function myIntegration() { + return { + name: 'my-integration', + hooks: { + 'astro:config:setup': ({ updateConfig }) => { + updateConfig({ + build: { + server: '...', + }, + }); + }, + }, + }; + } + ``` + +### Patch Changes + +- [#5057](https://github.com/withastro/astro/pull/5057) [`baf88ee9e`](https://github.com/withastro/astro/commit/baf88ee9e5e692a94981d7a696fbdcb4cd8ab2a6) Thanks [@bluwy](https://github.com/bluwy)! - Skip JSX tagging for export statements with source + +- [#5044](https://github.com/withastro/astro/pull/5044) [`44ea0c6d9`](https://github.com/withastro/astro/commit/44ea0c6d941a26a3c38fc6dc045a8a25215d154a) Thanks [@JuanM04](https://github.com/JuanM04)! - Upgrade Astro compiler to 0.27.1 + +- [#5059](https://github.com/withastro/astro/pull/5059) [`f7fcdfe62`](https://github.com/withastro/astro/commit/f7fcdfe6210b3cf08cad92c49b64adf169b9e744) Thanks [@bluwy](https://github.com/bluwy)! - Support strict dependency install for libraries with JSX + +- [#5047](https://github.com/withastro/astro/pull/5047) [`1e2799243`](https://github.com/withastro/astro/commit/1e27992437aa0371b8550acb3e3f79e62721a506) Thanks [@matthewp](https://github.com/matthewp)! - Update Astro.cookies.set types to allow booleans and numbers + + Note that booleans and numbers were already allowed, they just were not allowed by the type definitions. + ## 1.4.7 ### Patch Changes diff --git a/packages/astro/package.json b/packages/astro/package.json index 16a9a004de70f..805f92ac19a8f 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -1,6 +1,6 @@ { "name": "astro", - "version": "1.4.7", + "version": "1.5.0", "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/@types/astro.ts b/packages/astro/src/@types/astro.ts index 7157de666411f..6fd80b1d8344d 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -544,9 +544,9 @@ export interface AstroUserConfig { * @description * Controls the output directory of your client-side CSS and JavaScript when `output: 'server'` only. * `outDir` controls where the code is built to. - * + * * This value is relative to the `outDir`. - * + * * ```js * { * output: 'server', @@ -564,9 +564,9 @@ export interface AstroUserConfig { * @default `'./dist/server'` * @description * Controls the output directory of server JavaScript when building to SSR. - * + * * This value is relative to the `outDir`. - * + * * ```js * { * build: { @@ -585,10 +585,10 @@ export interface AstroUserConfig { * Specifies the file name of the server entrypoint when building to SSR. * This entrypoint is usually dependent on which host you are deploying to and * will be set by your adapter for you. - * + * * Note that it is recommended that this file ends with `.mjs` so that the runtime * detects that the file is a JavaScript module. - * + * * ```js * { * build: { @@ -1422,7 +1422,9 @@ export interface PreviewServerParams { port: number; } -export type CreatePreviewServer = (params: PreviewServerParams) => PreviewServer | Promise; +export type CreatePreviewServer = ( + params: PreviewServerParams +) => PreviewServer | Promise; export interface PreviewModule { default: CreatePreviewServer; diff --git a/packages/astro/src/core/config/config.ts b/packages/astro/src/core/config/config.ts index d939c6e877f0f..840971e566fac 100644 --- a/packages/astro/src/core/config/config.ts +++ b/packages/astro/src/core/config/config.ts @@ -346,7 +346,7 @@ function mergeConfigRecursively( merged[key] = [...arraify(existing ?? []), ...arraify(value ?? [])]; continue; } - if(isURL(existing) && isURL(value)) { + if (isURL(existing) && isURL(value)) { merged[key] = value; continue; } diff --git a/packages/astro/src/core/config/schema.ts b/packages/astro/src/core/config/schema.ts index 3c390c6508976..794c756cec36a 100644 --- a/packages/astro/src/core/config/schema.ts +++ b/packages/astro/src/core/config/schema.ts @@ -21,7 +21,7 @@ const ASTRO_CONFIG_DEFAULTS: AstroUserConfig & any = { format: 'directory', client: './dist/client/', server: './dist/server/', - serverEntry: 'entry.mjs' + serverEntry: 'entry.mjs', }, server: { host: false, @@ -112,10 +112,7 @@ export const AstroConfigSchema = z.object({ .optional() .default(ASTRO_CONFIG_DEFAULTS.build.server) .transform((val) => new URL(val)), - serverEntry: z - .string() - .optional() - .default(ASTRO_CONFIG_DEFAULTS.build.serverEntry), + serverEntry: z.string().optional().default(ASTRO_CONFIG_DEFAULTS.build.serverEntry), }) .optional() .default({}), @@ -252,28 +249,26 @@ export function createRelativeSchema(cmd: string, fileProtocolRoot: URL) { .string() .default(ASTRO_CONFIG_DEFAULTS.outDir) .transform((val) => new URL(appendForwardSlash(val), fileProtocolRoot)), - build: z.object({ - format: z - .union([z.literal('file'), z.literal('directory')]) + build: z + .object({ + format: z + .union([z.literal('file'), z.literal('directory')]) + .optional() + .default(ASTRO_CONFIG_DEFAULTS.build.format), + client: z + .string() + .optional() + .default(ASTRO_CONFIG_DEFAULTS.build.client) + .transform((val) => new URL(val, fileProtocolRoot)), + server: z + .string() + .optional() + .default(ASTRO_CONFIG_DEFAULTS.build.server) + .transform((val) => new URL(val, fileProtocolRoot)), + serverEntry: z.string().optional().default(ASTRO_CONFIG_DEFAULTS.build.serverEntry), + }) .optional() - .default(ASTRO_CONFIG_DEFAULTS.build.format), - client: z - .string() - .optional() - .default(ASTRO_CONFIG_DEFAULTS.build.client) - .transform(val => new URL(val, fileProtocolRoot)), - server: z - .string() - .optional() - .default(ASTRO_CONFIG_DEFAULTS.build.server) - .transform(val => new URL(val, fileProtocolRoot)), - serverEntry: z - .string() - .optional() - .default(ASTRO_CONFIG_DEFAULTS.build.serverEntry), - }) - .optional() - .default({}), + .default({}), server: z.preprocess( // preprocess (val) => @@ -306,13 +301,19 @@ export function createRelativeSchema(cmd: string, fileProtocolRoot: URL) { }) .optional() .default({}), - }).transform(config => { + }).transform((config) => { // If the user changed outDir but not build.server, build.config, adjust so those // are relative to the outDir, as is the expected default. - if(!config.build.server.toString().startsWith(config.outDir.toString()) && config.build.server.toString().endsWith('dist/server/')) { + if ( + !config.build.server.toString().startsWith(config.outDir.toString()) && + config.build.server.toString().endsWith('dist/server/') + ) { config.build.server = new URL('./dist/server/', config.outDir); } - if(!config.build.client.toString().startsWith(config.outDir.toString()) && config.build.client.toString().endsWith('dist/client/')) { + if ( + !config.build.client.toString().startsWith(config.outDir.toString()) && + config.build.client.toString().endsWith('dist/client/') + ) { config.build.client = new URL('./dist/client/', config.outDir); } return config; diff --git a/packages/astro/src/core/preview/index.ts b/packages/astro/src/core/preview/index.ts index ab244b14cc4d4..95fa5cedc2feb 100644 --- a/packages/astro/src/core/preview/index.ts +++ b/packages/astro/src/core/preview/index.ts @@ -42,7 +42,7 @@ export default async function preview( const previewEntrypoint = require.resolve(settings.adapter.previewEntrypoint); const previewModule = (await import(previewEntrypoint)) as Partial; - if(typeof previewModule.default !== 'function') { + if (typeof previewModule.default !== 'function') { throw new Error(`[preview] ${settings.adapter.name} cannot preview your app.`); } @@ -51,7 +51,7 @@ export default async function preview( client: settings.config.build.client, serverEntrypoint: new URL(settings.config.build.serverEntry, settings.config.build.server), host, - port + port, }); return server; diff --git a/packages/astro/src/integrations/index.ts b/packages/astro/src/integrations/index.ts index 7e333dbf92612..7e826d48d9f21 100644 --- a/packages/astro/src/integrations/index.ts +++ b/packages/astro/src/integrations/index.ts @@ -212,7 +212,10 @@ export async function runHookBuildStart({ buildConfig: BuildConfig; logging: LogOptions; }) { - function warnDeprecated(integration: AstroIntegration, prop: 'server' | 'client' | 'serverEntry') { + function warnDeprecated( + integration: AstroIntegration, + prop: 'server' | 'client' | 'serverEntry' + ) { let value: any = Reflect.get(buildConfig, prop); Object.defineProperty(buildConfig, prop, { enumerable: true, @@ -221,18 +224,23 @@ export async function runHookBuildStart({ }, set(newValue) { value = newValue; - warn(logging, 'astro:build:start', `Your adapter ${bold(integration.name)} is using a deprecated API, buildConfig. ${bold(prop)} config should be set via config.build.${prop} instead.`); - } + warn( + logging, + 'astro:build:start', + `Your adapter ${bold(integration.name)} is using a deprecated API, buildConfig. ${bold( + prop + )} config should be set via config.build.${prop} instead.` + ); + }, }); return () => { Object.defineProperty(buildConfig, prop, { enumerable: true, - value + value, }); - } + }; } - for (const integration of config.integrations) { if (integration?.hooks?.['astro:build:start']) { const undoClientWarning = warnDeprecated(integration, 'client'); diff --git a/packages/integrations/cloudflare/CHANGELOG.md b/packages/integrations/cloudflare/CHANGELOG.md index 6eb0368ced608..19c246cdfbdb0 100644 --- a/packages/integrations/cloudflare/CHANGELOG.md +++ b/packages/integrations/cloudflare/CHANGELOG.md @@ -1,5 +1,49 @@ # @astrojs/cloudflare +## 3.1.0 + +### Minor Changes + +- [#5056](https://github.com/withastro/astro/pull/5056) [`e55af8a23`](https://github.com/withastro/astro/commit/e55af8a23233b6335f45b7a04b9d026990fb616c) Thanks [@matthewp](https://github.com/matthewp)! - # New build configuration + + The ability to customize SSR build configuration more granularly is now available in Astro. You can now customize the output folder for `server` (the server code for SSR), `client` (your client-side JavaScript and assets), and `serverEntry` (the name of the entrypoint server module). Here are the defaults: + + ```js + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + output: 'server', + build: { + server: './dist/server/', + client: './dist/client/', + serverEntry: 'entry.mjs', + }, + }); + ``` + + These new configuration options are only supported in SSR mode and are ignored when building to SSG (a static site). + + ## Integration hook change + + The integration hook `astro:build:start` includes a param `buildConfig` which includes all of these same options. You can continue to use this param in Astro 1.x, but it is deprecated in favor of the new `build.config` options. All of the built-in adapters have been updated to the new format. If you have an integration that depends on this param we suggest upgrading to do this instead: + + ```js + export default function myIntegration() { + return { + name: 'my-integration', + hooks: { + 'astro:config:setup': ({ updateConfig }) => { + updateConfig({ + build: { + server: '...', + }, + }); + }, + }, + }; + } + ``` + ## 3.0.0 ### Major Changes diff --git a/packages/integrations/cloudflare/package.json b/packages/integrations/cloudflare/package.json index 94834b609c0e0..b33216c090637 100644 --- a/packages/integrations/cloudflare/package.json +++ b/packages/integrations/cloudflare/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/cloudflare", "description": "Deploy your site to cloudflare pages functions", - "version": "3.0.0", + "version": "3.1.0", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/cloudflare/src/index.ts b/packages/integrations/cloudflare/src/index.ts index 9cf6412b8f27e..44112e8be15cc 100644 --- a/packages/integrations/cloudflare/src/index.ts +++ b/packages/integrations/cloudflare/src/index.ts @@ -48,7 +48,7 @@ export default function createIntegration(args?: Options): AstroIntegration { client: new URL('./static/', config.outDir), server: new URL('./', config.outDir), serverEntry: '_worker.js', - } + }, }); }, 'astro:config:done': ({ setAdapter, config }) => { @@ -83,7 +83,7 @@ export default function createIntegration(args?: Options): AstroIntegration { }, 'astro:build:start': ({ buildConfig }) => { // Backwards compat - if(needsBuildConfig) { + if (needsBuildConfig) { buildConfig.client = new URL('./static/', _config.outDir); buildConfig.server = new URL('./', _config.outDir); buildConfig.serverEntry = '_worker.js'; diff --git a/packages/integrations/deno/CHANGELOG.md b/packages/integrations/deno/CHANGELOG.md index a096145168d13..d6d4e93e06e4e 100644 --- a/packages/integrations/deno/CHANGELOG.md +++ b/packages/integrations/deno/CHANGELOG.md @@ -1,5 +1,49 @@ # @astrojs/node +## 1.2.0 + +### Minor Changes + +- [#5056](https://github.com/withastro/astro/pull/5056) [`e55af8a23`](https://github.com/withastro/astro/commit/e55af8a23233b6335f45b7a04b9d026990fb616c) Thanks [@matthewp](https://github.com/matthewp)! - # New build configuration + + The ability to customize SSR build configuration more granularly is now available in Astro. You can now customize the output folder for `server` (the server code for SSR), `client` (your client-side JavaScript and assets), and `serverEntry` (the name of the entrypoint server module). Here are the defaults: + + ```js + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + output: 'server', + build: { + server: './dist/server/', + client: './dist/client/', + serverEntry: 'entry.mjs', + }, + }); + ``` + + These new configuration options are only supported in SSR mode and are ignored when building to SSG (a static site). + + ## Integration hook change + + The integration hook `astro:build:start` includes a param `buildConfig` which includes all of these same options. You can continue to use this param in Astro 1.x, but it is deprecated in favor of the new `build.config` options. All of the built-in adapters have been updated to the new format. If you have an integration that depends on this param we suggest upgrading to do this instead: + + ```js + export default function myIntegration() { + return { + name: 'my-integration', + hooks: { + 'astro:config:setup': ({ updateConfig }) => { + updateConfig({ + build: { + server: '...', + }, + }); + }, + }, + }; + } + ``` + ## 1.1.0 ### Minor Changes diff --git a/packages/integrations/deno/package.json b/packages/integrations/deno/package.json index 4b2752e7d83b5..cedf5f813ce28 100644 --- a/packages/integrations/deno/package.json +++ b/packages/integrations/deno/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/deno", "description": "Deploy your site to a Deno server", - "version": "1.1.0", + "version": "1.2.0", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/deno/src/index.ts b/packages/integrations/deno/src/index.ts index 9b003271057f9..968bec24af92b 100644 --- a/packages/integrations/deno/src/index.ts +++ b/packages/integrations/deno/src/index.ts @@ -49,7 +49,7 @@ export default function createIntegration(args?: Options): AstroIntegration { }, 'astro:build:start': ({ buildConfig }) => { // Backwards compat - if(needsBuildConfig) { + if (needsBuildConfig) { _buildConfig = buildConfig; } }, diff --git a/packages/integrations/image/CHANGELOG.md b/packages/integrations/image/CHANGELOG.md index 224725a4abe6e..467a5a4290757 100644 --- a/packages/integrations/image/CHANGELOG.md +++ b/packages/integrations/image/CHANGELOG.md @@ -1,5 +1,49 @@ # @astrojs/image +## 0.10.0 + +### Minor Changes + +- [#5056](https://github.com/withastro/astro/pull/5056) [`e55af8a23`](https://github.com/withastro/astro/commit/e55af8a23233b6335f45b7a04b9d026990fb616c) Thanks [@matthewp](https://github.com/matthewp)! - # New build configuration + + The ability to customize SSR build configuration more granularly is now available in Astro. You can now customize the output folder for `server` (the server code for SSR), `client` (your client-side JavaScript and assets), and `serverEntry` (the name of the entrypoint server module). Here are the defaults: + + ```js + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + output: 'server', + build: { + server: './dist/server/', + client: './dist/client/', + serverEntry: 'entry.mjs', + }, + }); + ``` + + These new configuration options are only supported in SSR mode and are ignored when building to SSG (a static site). + + ## Integration hook change + + The integration hook `astro:build:start` includes a param `buildConfig` which includes all of these same options. You can continue to use this param in Astro 1.x, but it is deprecated in favor of the new `build.config` options. All of the built-in adapters have been updated to the new format. If you have an integration that depends on this param we suggest upgrading to do this instead: + + ```js + export default function myIntegration() { + return { + name: 'my-integration', + hooks: { + 'astro:config:setup': ({ updateConfig }) => { + updateConfig({ + build: { + server: '...', + }, + }); + }, + }, + }; + } + ``` + ## 0.9.3 ### Patch Changes diff --git a/packages/integrations/image/package.json b/packages/integrations/image/package.json index 202bd427be71c..293a985e29a4f 100644 --- a/packages/integrations/image/package.json +++ b/packages/integrations/image/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/image", "description": "Load and transform images in your Astro site.", - "version": "0.9.3", + "version": "0.10.0", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/image/src/index.ts b/packages/integrations/image/src/index.ts index 46b14b6b8cf75..24e70a35d9828 100644 --- a/packages/integrations/image/src/index.ts +++ b/packages/integrations/image/src/index.ts @@ -100,7 +100,7 @@ export default function integration(options: IntegrationOptions = {}): AstroInte }, 'astro:build:start': ({ buildConfig }) => { // Backwards compat - if(needsBuildConfig) { + if (needsBuildConfig) { _buildConfig = buildConfig; } }, diff --git a/packages/integrations/netlify/CHANGELOG.md b/packages/integrations/netlify/CHANGELOG.md index adc4116cb092e..7e5fccff39373 100644 --- a/packages/integrations/netlify/CHANGELOG.md +++ b/packages/integrations/netlify/CHANGELOG.md @@ -1,5 +1,49 @@ # @astrojs/netlify +## 1.2.0 + +### Minor Changes + +- [#5056](https://github.com/withastro/astro/pull/5056) [`e55af8a23`](https://github.com/withastro/astro/commit/e55af8a23233b6335f45b7a04b9d026990fb616c) Thanks [@matthewp](https://github.com/matthewp)! - # New build configuration + + The ability to customize SSR build configuration more granularly is now available in Astro. You can now customize the output folder for `server` (the server code for SSR), `client` (your client-side JavaScript and assets), and `serverEntry` (the name of the entrypoint server module). Here are the defaults: + + ```js + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + output: 'server', + build: { + server: './dist/server/', + client: './dist/client/', + serverEntry: 'entry.mjs', + }, + }); + ``` + + These new configuration options are only supported in SSR mode and are ignored when building to SSG (a static site). + + ## Integration hook change + + The integration hook `astro:build:start` includes a param `buildConfig` which includes all of these same options. You can continue to use this param in Astro 1.x, but it is deprecated in favor of the new `build.config` options. All of the built-in adapters have been updated to the new format. If you have an integration that depends on this param we suggest upgrading to do this instead: + + ```js + export default function myIntegration() { + return { + name: 'my-integration', + hooks: { + 'astro:config:setup': ({ updateConfig }) => { + updateConfig({ + build: { + server: '...', + }, + }); + }, + }, + }; + } + ``` + ## 1.1.0 ### Minor Changes diff --git a/packages/integrations/netlify/package.json b/packages/integrations/netlify/package.json index 4e30dca2ddebe..12d4e566cb562 100644 --- a/packages/integrations/netlify/package.json +++ b/packages/integrations/netlify/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/netlify", "description": "Deploy your site to Netlify", - "version": "1.1.0", + "version": "1.2.0", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/netlify/src/integration-edge-functions.ts b/packages/integrations/netlify/src/integration-edge-functions.ts index b69667dde716e..f9e5f449d00ad 100644 --- a/packages/integrations/netlify/src/integration-edge-functions.ts +++ b/packages/integrations/netlify/src/integration-edge-functions.ts @@ -157,7 +157,7 @@ export function netlifyEdgeFunctions({ dist }: NetlifyEdgeFunctionsOptions = {}) } }, 'astro:build:start': ({ buildConfig }) => { - if(needsBuildConfig) { + if (needsBuildConfig) { buildConfig.client = _config.outDir; buildConfig.server = new URL('./.netlify/edge-functions/', _config.root); buildConfig.serverEntry = 'entry.js'; diff --git a/packages/integrations/netlify/src/integration-functions.ts b/packages/integrations/netlify/src/integration-functions.ts index 025250bc104e7..e1d6de42046fe 100644 --- a/packages/integrations/netlify/src/integration-functions.ts +++ b/packages/integrations/netlify/src/integration-functions.ts @@ -34,7 +34,7 @@ function netlifyFunctions({ build: { client: outDir, server: new URL('./.netlify/functions-internal/', config.root), - } + }, }); }, 'astro:config:done': ({ config, setAdapter }) => { @@ -50,7 +50,7 @@ function netlifyFunctions({ } }, 'astro:build:start': ({ buildConfig }) => { - if(needsBuildConfig) { + if (needsBuildConfig) { buildConfig.client = _config.outDir; buildConfig.server = new URL('./.netlify/functions-internal/', _config.root); entryFile = buildConfig.serverEntry.replace(/\.m?js/, ''); diff --git a/packages/integrations/node/CHANGELOG.md b/packages/integrations/node/CHANGELOG.md index 045b370e78f55..f6e6a46f9a6e6 100644 --- a/packages/integrations/node/CHANGELOG.md +++ b/packages/integrations/node/CHANGELOG.md @@ -1,5 +1,125 @@ # @astrojs/node +## 2.0.0 + +### Major Changes + +- [#5056](https://github.com/withastro/astro/pull/5056) [`e55af8a23`](https://github.com/withastro/astro/commit/e55af8a23233b6335f45b7a04b9d026990fb616c) Thanks [@matthewp](https://github.com/matthewp)! - # Standalone mode for the Node.js adapter + + New in `@astrojs/node` is support for **standalone mode**. With standalone mode you can start your production server without needing to write any server JavaScript yourself. The server starts simply by running the script like so: + + ```shell + node ./dist/server/entry.mjs + ``` + + To enable standalone mode, set the new `mode` to `'standalone'` option in your Astro config: + + ```js + import { defineConfig } from 'astro/config'; + import nodejs from '@astrojs/node'; + + export default defineConfig({ + output: 'server', + adapter: nodejs({ + mode: 'standalone', + }), + }); + ``` + + See the @astrojs/node documentation to learn all of the options available in standalone mode. + + ## Breaking change + + This is a semver major change because the new `mode` option is required. Existing @astrojs/node users who are using their own HTTP server framework such as Express can upgrade by setting the `mode` option to `'middleware'` in order to build to a middleware mode, which is the same behavior and API as before. + + ```js + import { defineConfig } from 'astro/config'; + import nodejs from '@astrojs/node'; + + export default defineConfig({ + output: 'server', + adapter: nodejs({ + mode: 'middleware', + }), + }); + ``` + +### Minor Changes + +- [#5056](https://github.com/withastro/astro/pull/5056) [`e55af8a23`](https://github.com/withastro/astro/commit/e55af8a23233b6335f45b7a04b9d026990fb616c) Thanks [@matthewp](https://github.com/matthewp)! - # Adapter support for `astro preview` + + Adapters are now about to support the `astro preview` command via a new integration option. The Node.js adapter `@astrojs/node` is the first of the built-in adapters to gain support for this. What this means is that if you are using `@astrojs/node` you can new preview your SSR app by running: + + ```shell + npm run preview + ``` + + ## Adapter API + + We will be updating the other first party Astro adapters to support preview over time. Adapters can opt-in to this feature by providing the `previewEntrypoint` via the `setAdapter` function in `astro:config:done` hook. The Node.js adapter's code looks like this: + + ```diff + export default function() { + return { + name: '@astrojs/node', + hooks: { + 'astro:config:done': ({ setAdapter, config }) => { + setAdapter({ + name: '@astrojs/node', + serverEntrypoint: '@astrojs/node/server.js', + + previewEntrypoint: '@astrojs/node/preview.js', + exports: ['handler'], + }); + + // more here + } + } + }; + } + ``` + + The `previewEntrypoint` is a module in the adapter's package that is a Node.js script. This script is run when `astro preview` is run and is charged with starting up the built server. See the Node.js implementation in `@astrojs/node` to see how that is implemented. + +- [#5056](https://github.com/withastro/astro/pull/5056) [`e55af8a23`](https://github.com/withastro/astro/commit/e55af8a23233b6335f45b7a04b9d026990fb616c) Thanks [@matthewp](https://github.com/matthewp)! - # New build configuration + + The ability to customize SSR build configuration more granularly is now available in Astro. You can now customize the output folder for `server` (the server code for SSR), `client` (your client-side JavaScript and assets), and `serverEntry` (the name of the entrypoint server module). Here are the defaults: + + ```js + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + output: 'server', + build: { + server: './dist/server/', + client: './dist/client/', + serverEntry: 'entry.mjs', + }, + }); + ``` + + These new configuration options are only supported in SSR mode and are ignored when building to SSG (a static site). + + ## Integration hook change + + The integration hook `astro:build:start` includes a param `buildConfig` which includes all of these same options. You can continue to use this param in Astro 1.x, but it is deprecated in favor of the new `build.config` options. All of the built-in adapters have been updated to the new format. If you have an integration that depends on this param we suggest upgrading to do this instead: + + ```js + export default function myIntegration() { + return { + name: 'my-integration', + hooks: { + 'astro:config:setup': ({ updateConfig }) => { + updateConfig({ + build: { + server: '...', + }, + }); + }, + }, + }; + } + ``` + ## 1.1.0 ### Minor Changes diff --git a/packages/integrations/node/package.json b/packages/integrations/node/package.json index 77a027cd95e2d..92857ffa09bda 100644 --- a/packages/integrations/node/package.json +++ b/packages/integrations/node/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/node", "description": "Deploy your site to a Node.js server", - "version": "1.1.0", + "version": "2.0.0", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/node/src/http-server.ts b/packages/integrations/node/src/http-server.ts index 34192c5f9f21c..9a04a39be5313 100644 --- a/packages/integrations/node/src/http-server.ts +++ b/packages/integrations/node/src/http-server.ts @@ -10,9 +10,12 @@ interface CreateServerOptions { host: string | undefined; } -export function createServer({ client, port, host }: CreateServerOptions, handler: http.RequestListener) { +export function createServer( + { client, port, host }: CreateServerOptions, + handler: http.RequestListener +) { const listener: http.RequestListener = (req, res) => { - if(req.url) { + if (req.url) { const fileURL = new URL('.' + req.url, client); const stream = send(req, fileURLToPath(fileURL), { @@ -21,8 +24,8 @@ export function createServer({ client, port, host }: CreateServerOptions, handle let forwardError = false; - stream.on('error', err => { - if(forwardError) { + stream.on('error', (err) => { + if (forwardError) { // eslint-disable-next-line no-console console.error(err.toString()); res.writeHead(500); @@ -42,14 +45,18 @@ export function createServer({ client, port, host }: CreateServerOptions, handle } }; - let httpServer: http.Server | - https.Server; - - if(process.env.SERVER_CERT_PATH && process.env.SERVER_KEY_PATH) { - httpServer = https.createServer({ - key: fs.readFileSync(process.env.SERVER_KEY_PATH), - cert: fs.readFileSync(process.env.SERVER_CERT_PATH), - }, listener); + let httpServer: + | http.Server + | https.Server; + + if (process.env.SERVER_CERT_PATH && process.env.SERVER_KEY_PATH) { + httpServer = https.createServer( + { + key: fs.readFileSync(process.env.SERVER_KEY_PATH), + cert: fs.readFileSync(process.env.SERVER_CERT_PATH), + }, + listener + ); } else { httpServer = http.createServer(listener); } diff --git a/packages/integrations/node/src/index.ts b/packages/integrations/node/src/index.ts index 80dfacdab507a..095f0b6b02e0f 100644 --- a/packages/integrations/node/src/index.ts +++ b/packages/integrations/node/src/index.ts @@ -7,13 +7,13 @@ export function getAdapter(options: Options): AstroAdapter { serverEntrypoint: '@astrojs/node/server.js', previewEntrypoint: '@astrojs/node/preview.js', exports: ['handler'], - args: options + args: options, }; } export default function createIntegration(userOptions: UserOptions): AstroIntegration { - if(!userOptions?.mode) { - throw new Error(`[@astrojs/node] Setting the 'mode' option is required.`) + if (!userOptions?.mode) { + throw new Error(`[@astrojs/node] Setting the 'mode' option is required.`); } let needsBuildConfig = false; @@ -38,11 +38,11 @@ export default function createIntegration(userOptions: UserOptions): AstroIntegr }, 'astro:build:start': ({ buildConfig }) => { // Backwards compat - if(needsBuildConfig) { + if (needsBuildConfig) { _options.client = buildConfig.client.toString(); _options.server = buildConfig.server.toString(); } - } + }, }, }; } diff --git a/packages/integrations/node/src/middleware.ts b/packages/integrations/node/src/middleware.ts index 772461f2af977..a1058399d6c91 100644 --- a/packages/integrations/node/src/middleware.ts +++ b/packages/integrations/node/src/middleware.ts @@ -2,8 +2,12 @@ import type { NodeApp } from 'astro/app/node'; import type { IncomingMessage, ServerResponse } from 'http'; import type { Readable } from 'stream'; -export default function(app: NodeApp) { - return async function(req: IncomingMessage, res: ServerResponse, next?: (err?: unknown) => void) { +export default function (app: NodeApp) { + return async function ( + req: IncomingMessage, + res: ServerResponse, + next?: (err?: unknown) => void + ) { try { const route = app.match(req); diff --git a/packages/integrations/node/src/preview.ts b/packages/integrations/node/src/preview.ts index 33c2f18e2622f..54b3e61909e47 100644 --- a/packages/integrations/node/src/preview.ts +++ b/packages/integrations/node/src/preview.ts @@ -4,25 +4,24 @@ import http from 'http'; import { fileURLToPath } from 'url'; import { createServer } from './http-server.js'; -const preview: CreatePreviewServer = async function({ - client, - serverEntrypoint, - host, - port, -}) { +const preview: CreatePreviewServer = async function ({ client, serverEntrypoint, host, port }) { type ServerModule = ReturnType; type MaybeServerModule = Partial; let ssrHandler: ServerModule['handler']; try { process.env.ASTRO_NODE_AUTOSTART = 'disabled'; const ssrModule: MaybeServerModule = await import(serverEntrypoint.toString()); - if(typeof ssrModule.handler === 'function') { + if (typeof ssrModule.handler === 'function') { ssrHandler = ssrModule.handler; } else { - throw new Error(`The server entrypoint doesn't have a handler. Are you sure this is the right file?`); + throw new Error( + `The server entrypoint doesn't have a handler. Are you sure this is the right file?` + ); } - } catch(_err) { - throw new Error(`The server entrypoint ${fileURLToPath} does not exist. Have you ran a build yet?`); + } catch (_err) { + throw new Error( + `The server entrypoint ${fileURLToPath} does not exist. Have you ran a build yet?` + ); } const handler: http.RequestListener = (req, res) => { @@ -37,18 +36,19 @@ const preview: CreatePreviewServer = async function({ }); }; - const server = createServer({ - client, - port, - host, - }, handler); + const server = createServer( + { + client, + port, + host, + }, + handler + ); // eslint-disable-next-line no-console console.log(`Preview server listening on http://${host}:${port}`); return server; -} - -export { - preview as default }; + +export { preview as default }; diff --git a/packages/integrations/node/src/server.ts b/packages/integrations/node/src/server.ts index 202e66b7e9339..07527115fa816 100644 --- a/packages/integrations/node/src/server.ts +++ b/packages/integrations/node/src/server.ts @@ -12,12 +12,12 @@ polyfill(globalThis, { export function createExports(manifest: SSRManifest) { const app = new NodeApp(manifest); return { - handler: middleware(app) + handler: middleware(app), }; } export function start(manifest: SSRManifest, options: Options) { - if(options.mode !== 'standalone' || process.env.ASTRO_NODE_AUTOSTART === 'disabled') { + if (options.mode !== 'standalone' || process.env.ASTRO_NODE_AUTOSTART === 'disabled') { return; } diff --git a/packages/integrations/node/src/standalone.ts b/packages/integrations/node/src/standalone.ts index 8fef96ed50ca0..88963c0600e8f 100644 --- a/packages/integrations/node/src/standalone.ts +++ b/packages/integrations/node/src/standalone.ts @@ -9,7 +9,7 @@ function resolvePaths(options: Options) { const clientURLRaw = new URL(options.client); const serverURLRaw = new URL(options.server); const rel = path.relative(fileURLToPath(serverURLRaw), fileURLToPath(clientURLRaw)); - + const serverEntryURL = new URL(import.meta.url); const clientURL = new URL(appendForwardSlash(rel), serverEntryURL); @@ -35,16 +35,19 @@ export function getResolvedHostForHttpServer(host: string | boolean) { } export default function startServer(app: NodeApp, options: Options) { - const port = process.env.PORT ? Number(process.env.port) : (options.port ?? 8080); + const port = process.env.PORT ? Number(process.env.port) : options.port ?? 8080; const { client } = resolvePaths(options); const handler = middleware(app); const host = getResolvedHostForHttpServer(options.host); - const server = createServer({ - client, - port, - host, - }, handler); + const server = createServer( + { + client, + port, + host, + }, + handler + ); // eslint-disable-next-line no-console console.log(`Server listening on http://${host}:${port}`); diff --git a/packages/integrations/node/src/types.ts b/packages/integrations/node/src/types.ts index aaf3be9425801..2a9ecc2a1ade8 100644 --- a/packages/integrations/node/src/types.ts +++ b/packages/integrations/node/src/types.ts @@ -1,12 +1,11 @@ - export interface UserOptions { /** * Specifies the mode that the adapter builds to. - * + * * - 'middleware' - Build to middleware, to be used within another Node.js server, such as Express. * - 'standalone' - Build to a standalone server. The server starts up just by running the built script. */ - mode: 'middleware' | 'standalone'; + mode: 'middleware' | 'standalone'; } export interface Options extends UserOptions { diff --git a/packages/integrations/solid/CHANGELOG.md b/packages/integrations/solid/CHANGELOG.md index 123c84b2939c9..575298726dbfe 100644 --- a/packages/integrations/solid/CHANGELOG.md +++ b/packages/integrations/solid/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/solid-js +## 1.2.0 + +### Minor Changes + +- [#5059](https://github.com/withastro/astro/pull/5059) [`f7fcdfe62`](https://github.com/withastro/astro/commit/f7fcdfe6210b3cf08cad92c49b64adf169b9e744) Thanks [@bluwy](https://github.com/bluwy)! - Auto ssr.noExternal solidjs dependencies + ## 1.1.1 ### Patch Changes diff --git a/packages/integrations/solid/package.json b/packages/integrations/solid/package.json index edb58cbae1f0e..b9bff301ecc91 100644 --- a/packages/integrations/solid/package.json +++ b/packages/integrations/solid/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/solid-js", - "version": "1.1.1", + "version": "1.2.0", "description": "Use Solid components within Astro", "type": "module", "types": "./dist/index.d.ts", diff --git a/packages/integrations/svelte/CHANGELOG.md b/packages/integrations/svelte/CHANGELOG.md index 60f1056d44526..216816067c115 100644 --- a/packages/integrations/svelte/CHANGELOG.md +++ b/packages/integrations/svelte/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/svelte +## 1.0.2 + +### Patch Changes + +- [#5045](https://github.com/withastro/astro/pull/5045) [`0f2a88ba5`](https://github.com/withastro/astro/commit/0f2a88ba5c19318854be12cc81609f2dbc5012f7) Thanks [@matthewp](https://github.com/matthewp)! - Allow class to be passed into Svelte islands + ## 1.0.1 ### Patch Changes diff --git a/packages/integrations/svelte/package.json b/packages/integrations/svelte/package.json index bed9faa2d3b3a..a4ad25e54b8d8 100644 --- a/packages/integrations/svelte/package.json +++ b/packages/integrations/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/svelte", - "version": "1.0.1", + "version": "1.0.2", "description": "Use Svelte components within Astro", "type": "module", "types": "./dist/index.d.ts", diff --git a/packages/integrations/tailwind/CHANGELOG.md b/packages/integrations/tailwind/CHANGELOG.md index e43b6365ae9aa..35c944506f59f 100644 --- a/packages/integrations/tailwind/CHANGELOG.md +++ b/packages/integrations/tailwind/CHANGELOG.md @@ -1,5 +1,13 @@ # @astrojs/tailwind +## 2.1.0 + +### Minor Changes + +- [#4947](https://github.com/withastro/astro/pull/4947) [`a5e3ecc80`](https://github.com/withastro/astro/commit/a5e3ecc8039c1e115ce5597362e18cd35d04e40b) Thanks [@JuanM04](https://github.com/JuanM04)! - ## HMR on config file changes + + New in this release is the ability for config changes to automatically reflect via HMR. Now when you edit your `tsconfig.json` or `tailwind.config.js` configs, the changes will reload automatically without the need to restart your dev server. + ## 2.0.2 ### Patch Changes diff --git a/packages/integrations/tailwind/package.json b/packages/integrations/tailwind/package.json index 46833acd37474..22ec6482c895b 100644 --- a/packages/integrations/tailwind/package.json +++ b/packages/integrations/tailwind/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/tailwind", "description": "Tailwind + Astro Integrations", - "version": "2.0.2", + "version": "2.1.0", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/vercel/CHANGELOG.md b/packages/integrations/vercel/CHANGELOG.md index 5722af5a59766..0a950e72a6e94 100644 --- a/packages/integrations/vercel/CHANGELOG.md +++ b/packages/integrations/vercel/CHANGELOG.md @@ -1,5 +1,49 @@ # @astrojs/vercel +## 2.2.0 + +### Minor Changes + +- [#5056](https://github.com/withastro/astro/pull/5056) [`e55af8a23`](https://github.com/withastro/astro/commit/e55af8a23233b6335f45b7a04b9d026990fb616c) Thanks [@matthewp](https://github.com/matthewp)! - # New build configuration + + The ability to customize SSR build configuration more granularly is now available in Astro. You can now customize the output folder for `server` (the server code for SSR), `client` (your client-side JavaScript and assets), and `serverEntry` (the name of the entrypoint server module). Here are the defaults: + + ```js + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + output: 'server', + build: { + server: './dist/server/', + client: './dist/client/', + serverEntry: 'entry.mjs', + }, + }); + ``` + + These new configuration options are only supported in SSR mode and are ignored when building to SSG (a static site). + + ## Integration hook change + + The integration hook `astro:build:start` includes a param `buildConfig` which includes all of these same options. You can continue to use this param in Astro 1.x, but it is deprecated in favor of the new `build.config` options. All of the built-in adapters have been updated to the new format. If you have an integration that depends on this param we suggest upgrading to do this instead: + + ```js + export default function myIntegration() { + return { + name: 'my-integration', + hooks: { + 'astro:config:setup': ({ updateConfig }) => { + updateConfig({ + build: { + server: '...', + }, + }); + }, + }, + }; + } + ``` + ## 2.1.1 ### Patch Changes diff --git a/packages/integrations/vercel/package.json b/packages/integrations/vercel/package.json index df1315635cfbc..b0c7bc469fbf7 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": "2.1.1", + "version": "2.2.0", "type": "module", "author": "withastro", "license": "MIT", diff --git a/packages/integrations/vercel/src/edge/adapter.ts b/packages/integrations/vercel/src/edge/adapter.ts index ecd13e1f83fb5..018ab703260f6 100644 --- a/packages/integrations/vercel/src/edge/adapter.ts +++ b/packages/integrations/vercel/src/edge/adapter.ts @@ -31,7 +31,7 @@ export default function vercelEdge(): AstroIntegration { serverEntry: 'entry.mjs', client: new URL('./static/', outDir), server: new URL('./functions/render.func/', config.outDir), - } + }, }); }, 'astro:config:done': ({ setAdapter, config }) => { @@ -41,7 +41,7 @@ export default function vercelEdge(): AstroIntegration { functionFolder = config.build.server; }, 'astro:build:start': ({ buildConfig }) => { - if(needsBuildConfig) { + if (needsBuildConfig) { buildConfig.client = new URL('./static/', _config.outDir); serverEntry = buildConfig.serverEntry = 'entry.mjs'; functionFolder = buildConfig.server = new URL('./functions/render.func/', _config.outDir); diff --git a/packages/integrations/vercel/src/serverless/adapter.ts b/packages/integrations/vercel/src/serverless/adapter.ts index dfc0367ae4200..5b65c331efe76 100644 --- a/packages/integrations/vercel/src/serverless/adapter.ts +++ b/packages/integrations/vercel/src/serverless/adapter.ts @@ -33,7 +33,7 @@ export default function vercelEdge(): AstroIntegration { serverEntry: 'entry.js', client: new URL('./static/', outDir), server: new URL('./dist/', config.root), - } + }, }); }, 'astro:config:done': ({ setAdapter, config }) => { @@ -51,7 +51,7 @@ export default function vercelEdge(): AstroIntegration { } }, 'astro:build:start': ({ buildConfig }) => { - if(needsBuildConfig) { + if (needsBuildConfig) { buildConfig.client = new URL('./static/', _config.outDir); buildTempFolder = buildConfig.server = new URL('./dist/', _config.root); serverEntry = buildConfig.serverEntry = 'entry.js'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 08306839a31b5..95f2436d5f0a4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -61,7 +61,7 @@ importers: examples/basics: specifiers: - astro: ^1.4.7 + astro: ^1.5.0 dependencies: astro: link:../../packages/astro @@ -70,7 +70,7 @@ importers: '@astrojs/mdx': ^0.11.4 '@astrojs/rss': ^1.0.2 '@astrojs/sitemap': ^1.0.0 - astro: ^1.4.7 + astro: ^1.5.0 dependencies: '@astrojs/mdx': link:../../packages/integrations/mdx '@astrojs/rss': link:../../packages/astro-rss @@ -79,14 +79,14 @@ importers: examples/component: specifiers: - astro: ^1.4.7 + astro: ^1.5.0 devDependencies: astro: link:../../packages/astro examples/deno: specifiers: - '@astrojs/deno': ^1.1.0 - astro: ^1.4.7 + '@astrojs/deno': ^1.2.0 + astro: ^1.5.0 dependencies: astro: link:../../packages/astro devDependencies: @@ -102,7 +102,7 @@ importers: '@types/node': ^18.0.0 '@types/react': ^17.0.45 '@types/react-dom': ^18.0.0 - astro: ^1.4.7 + astro: ^1.5.0 preact: ^10.7.3 react: ^18.1.0 react-dom: ^18.1.0 @@ -125,7 +125,7 @@ importers: '@astrojs/alpinejs': ^0.1.2 '@types/alpinejs': ^3.7.0 alpinejs: ^3.10.2 - astro: ^1.4.7 + astro: ^1.5.0 dependencies: '@astrojs/alpinejs': link:../../packages/integrations/alpinejs '@types/alpinejs': 3.7.0 @@ -136,7 +136,7 @@ importers: specifiers: '@astrojs/lit': ^1.0.0 '@webcomponents/template-shadowroot': ^0.1.0 - astro: ^1.4.7 + astro: ^1.5.0 lit: ^2.2.5 dependencies: '@astrojs/lit': link:../../packages/integrations/lit @@ -148,10 +148,10 @@ importers: specifiers: '@astrojs/preact': ^1.2.0 '@astrojs/react': ^1.2.0 - '@astrojs/solid-js': ^1.1.1 - '@astrojs/svelte': ^1.0.1 + '@astrojs/solid-js': ^1.2.0 + '@astrojs/svelte': ^1.0.2 '@astrojs/vue': ^1.1.0 - astro: ^1.4.7 + astro: ^1.5.0 preact: ^10.7.3 react: ^18.1.0 react-dom: ^18.1.0 @@ -176,7 +176,7 @@ importers: specifiers: '@astrojs/preact': ^1.2.0 '@preact/signals': ^1.1.0 - astro: ^1.4.7 + astro: ^1.5.0 preact: ^10.7.3 dependencies: '@astrojs/preact': link:../../packages/integrations/preact @@ -189,7 +189,7 @@ importers: '@astrojs/react': ^1.2.0 '@types/react': ^18.0.10 '@types/react-dom': ^18.0.5 - astro: ^1.4.7 + astro: ^1.5.0 react: ^18.1.0 react-dom: ^18.1.0 dependencies: @@ -202,8 +202,8 @@ importers: examples/framework-solid: specifiers: - '@astrojs/solid-js': ^1.1.1 - astro: ^1.4.7 + '@astrojs/solid-js': ^1.2.0 + astro: ^1.5.0 solid-js: ^1.4.3 dependencies: '@astrojs/solid-js': link:../../packages/integrations/solid @@ -212,8 +212,8 @@ importers: examples/framework-svelte: specifiers: - '@astrojs/svelte': ^1.0.1 - astro: ^1.4.7 + '@astrojs/svelte': ^1.0.2 + astro: ^1.5.0 svelte: ^3.48.0 dependencies: '@astrojs/svelte': link:../../packages/integrations/svelte @@ -223,7 +223,7 @@ importers: examples/framework-vue: specifiers: '@astrojs/vue': ^1.1.0 - astro: ^1.4.7 + astro: ^1.5.0 vue: ^3.2.37 dependencies: '@astrojs/vue': link:../../packages/integrations/vue @@ -232,33 +232,33 @@ importers: examples/integration: specifiers: - astro: ^1.4.7 + astro: ^1.5.0 devDependencies: astro: link:../../packages/astro examples/minimal: specifiers: - astro: ^1.4.7 + astro: ^1.5.0 dependencies: astro: link:../../packages/astro examples/non-html-pages: specifiers: - astro: ^1.4.7 + astro: ^1.5.0 dependencies: astro: link:../../packages/astro examples/portfolio: specifiers: - astro: ^1.4.7 + astro: ^1.5.0 dependencies: astro: link:../../packages/astro examples/ssr: specifiers: - '@astrojs/node': ^1.1.0 - '@astrojs/svelte': ^1.0.1 - astro: ^1.4.7 + '@astrojs/node': ^2.0.0 + '@astrojs/svelte': ^1.0.2 + astro: ^1.5.0 concurrently: ^7.2.1 lightcookie: ^1.0.25 svelte: ^3.48.0 @@ -277,7 +277,7 @@ importers: examples/with-markdown-plugins: specifiers: '@astrojs/markdown-remark': ^1.1.3 - astro: ^1.4.7 + astro: ^1.5.0 hast-util-select: 5.0.1 rehype-autolink-headings: ^6.1.1 rehype-slug: ^5.0.1 @@ -294,7 +294,7 @@ importers: examples/with-markdown-shiki: specifiers: - astro: ^1.4.7 + astro: ^1.5.0 dependencies: astro: link:../../packages/astro @@ -302,7 +302,7 @@ importers: specifiers: '@astrojs/mdx': ^0.11.4 '@astrojs/preact': ^1.2.0 - astro: ^1.4.7 + astro: ^1.5.0 preact: ^10.6.5 dependencies: '@astrojs/mdx': link:../../packages/integrations/mdx @@ -314,7 +314,7 @@ importers: specifiers: '@astrojs/preact': ^1.2.0 '@nanostores/preact': ^0.1.3 - astro: ^1.4.7 + astro: ^1.5.0 nanostores: ^0.5.12 preact: ^10.7.3 dependencies: @@ -326,9 +326,9 @@ importers: examples/with-tailwindcss: specifiers: - '@astrojs/tailwind': ^2.0.2 + '@astrojs/tailwind': ^2.1.0 '@types/canvas-confetti': ^1.4.3 - astro: ^1.4.7 + astro: ^1.5.0 autoprefixer: ^10.4.7 canvas-confetti: ^1.5.1 postcss: ^8.4.14 @@ -344,7 +344,7 @@ importers: examples/with-vite-plugin-pwa: specifiers: - astro: ^1.4.7 + astro: ^1.5.0 vite-plugin-pwa: 0.11.11 workbox-window: ^6.5.3 dependencies: @@ -354,7 +354,7 @@ importers: examples/with-vitest: specifiers: - astro: ^1.4.7 + astro: ^1.5.0 vitest: ^0.20.3 dependencies: astro: link:../../packages/astro @@ -2164,7 +2164,7 @@ importers: '@astrojs/node': ^1.1.0 astro: workspace:* dependencies: - '@astrojs/node': link:../../../../integrations/node + '@astrojs/node': 1.1.0 astro: link:../../.. packages/astro/test/fixtures/ssr-api-route-custom-404: @@ -2924,7 +2924,7 @@ importers: node-mocks-http: ^1.11.0 send: ^0.18.0 dependencies: - '@astrojs/webapi': 1.1.0 + '@astrojs/webapi': link:../../webapi send: 0.18.0 devDependencies: '@types/send': 0.17.1 @@ -3789,6 +3789,12 @@ packages: vfile-message: 3.1.2 dev: false + /@astrojs/node/1.1.0: + resolution: {integrity: sha512-4KkCEFYtmTUSvU49UZSJD/VQfD/oKzf0ld8COjFW1pxfquBgvevLxRVpYLRanZB20L3c8/xyyQpDq7zMSMqQrg==} + dependencies: + '@astrojs/webapi': 1.1.0 + dev: false + /@astrojs/webapi/1.1.0: resolution: {integrity: sha512-yLSksFKv9kRbI3WWPuRvbBjS+J5ZNmZHacJ6Io8XQleKIHHHcw7RoNcrLK0s+9iwVPhqMYIzja6HJuvnO93oFw==} dependencies: @@ -17258,7 +17264,6 @@ packages: resolve: 1.22.1 strip-bom: 4.0.0 type-fest: 3.0.0 - dev: false /tsconfig/7.0.0: resolution: {integrity: sha512-vZXmzPrL+EmC4T/4rVlT2jNVMWCi/O4DIiSj3UHg1OE5kCKbk4mfrXc6dZksLgRM/TZlKnousKH9bbTazUWRRw==} @@ -17486,7 +17491,6 @@ packages: /type-fest/3.0.0: resolution: {integrity: sha512-MINvUN5ug9u+0hJDzSZNSnuKXI8M4F5Yvb6SQZ2CYqe7SgKXKOosEcU5R7tRgo85I6eAVBbkVF7TCvB4AUK2xQ==} engines: {node: '>=14.16'} - dev: false /type-is/1.6.18: resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==}