From cc55b312b6dc95522645002806d63f32c33d1956 Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Thu, 16 Jun 2022 08:53:52 -0400 Subject: [PATCH 01/24] sitemap readme skeleton + first sections --- packages/integrations/tailwind/README.md | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/packages/integrations/tailwind/README.md b/packages/integrations/tailwind/README.md index ae5bc8458428..01737a7d2bc7 100644 --- a/packages/integrations/tailwind/README.md +++ b/packages/integrations/tailwind/README.md @@ -142,24 +142,8 @@ export default { ## Examples - -- The [Astro Tailwind Starter](https://github.com/withastro/astro/tree/latest/examples/with-tailwindcss?on=github) gets you up and running with a base for your project that uses Tailwind for styling -- Astro's homepage uses Tailwind. Check out its [Tailwind configuration file](https://github.com/withastro/astro.build/blob/main/tailwind.config.js) or an [example component](https://github.com/withastro/astro.build/blob/main/src/components/integrations/IntegrationCard.astro) -- The [Astro Ink](https://github.com/one-aalam/astro-ink), [Sarissa Blog](https://github.com/iozcelik/SarissaBlogAstroStarter), and [Creek](https://github.com/robertguss/Astro-Theme-Creek) themes use Tailwind for styling -- [Browse Astro Tailwind projects on GitHub](https://github.com/search?q=%22%40astrojs%2Ftailwind%22+filename%3Apackage.json&type=Code) for more examples! - + ## Troubleshooting -- If your installation doesn't seem to be working, make sure to restart the dev server. -- If you edit and save a file and don't see your site update accordingly, try refreshing the page. -- If you edit and save a file and don't see your site update accordingly, try refreshing the page. -- If refreshing the page doesn't update your preview, or if a new installation doesn't seem to be working, then restart the dev server. - -For help, check out the `#support-threads` channel on [Discord](https://astro.build/chat). Our friendly Support Squad members are here to help! - -You can also check our [Astro Integration Documentation][astro-integration] for more on integrations. - -[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/ -[astro-ui-frameworks]: https://docs.astro.build/en/core-concepts/framework-components/#using-framework-components ## Contributing From 05db64c9a53af5ae1ff5d716b34982e41ace51ae Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Thu, 16 Jun 2022 08:58:00 -0400 Subject: [PATCH 02/24] Revert "sitemap readme skeleton + first sections" This reverts commit cc55b312b6dc95522645002806d63f32c33d1956. --- packages/integrations/tailwind/README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/integrations/tailwind/README.md b/packages/integrations/tailwind/README.md index 01737a7d2bc7..ae5bc8458428 100644 --- a/packages/integrations/tailwind/README.md +++ b/packages/integrations/tailwind/README.md @@ -142,8 +142,24 @@ export default { ## Examples - + +- The [Astro Tailwind Starter](https://github.com/withastro/astro/tree/latest/examples/with-tailwindcss?on=github) gets you up and running with a base for your project that uses Tailwind for styling +- Astro's homepage uses Tailwind. Check out its [Tailwind configuration file](https://github.com/withastro/astro.build/blob/main/tailwind.config.js) or an [example component](https://github.com/withastro/astro.build/blob/main/src/components/integrations/IntegrationCard.astro) +- The [Astro Ink](https://github.com/one-aalam/astro-ink), [Sarissa Blog](https://github.com/iozcelik/SarissaBlogAstroStarter), and [Creek](https://github.com/robertguss/Astro-Theme-Creek) themes use Tailwind for styling +- [Browse Astro Tailwind projects on GitHub](https://github.com/search?q=%22%40astrojs%2Ftailwind%22+filename%3Apackage.json&type=Code) for more examples! + ## Troubleshooting +- If your installation doesn't seem to be working, make sure to restart the dev server. +- If you edit and save a file and don't see your site update accordingly, try refreshing the page. +- If you edit and save a file and don't see your site update accordingly, try refreshing the page. +- If refreshing the page doesn't update your preview, or if a new installation doesn't seem to be working, then restart the dev server. + +For help, check out the `#support-threads` channel on [Discord](https://astro.build/chat). Our friendly Support Squad members are here to help! + +You can also check our [Astro Integration Documentation][astro-integration] for more on integrations. + +[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/ +[astro-ui-frameworks]: https://docs.astro.build/en/core-concepts/framework-components/#using-framework-components ## Contributing From 5fa43e959cd07419b24d85e2a2204bf10a1dedcb Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Thu, 16 Jun 2022 08:59:10 -0400 Subject: [PATCH 03/24] sitemap readme skeleton + first sections --- packages/integrations/sitemap/README.md | 140 ++++++++++++++---------- 1 file changed, 80 insertions(+), 60 deletions(-) diff --git a/packages/integrations/sitemap/README.md b/packages/integrations/sitemap/README.md index 9d84cae195d2..67b2ff769a3f 100644 --- a/packages/integrations/sitemap/README.md +++ b/packages/integrations/sitemap/README.md @@ -2,114 +2,134 @@ This **[Astro integration][astro-integration]** generates a sitemap for your Astro project. -Sitemaps outline all of the pages, videos, and files on your site. Search engines like Google read this file to crawl your site more efficiently. [See Google's own advice on sitemaps](https://developers.google.com/search/docs/advanced/sitemaps/overview) to learn more. -## Installation - -There are two ways to add integrations to your project. Let's try the most convenient option first! +- [Why Astro Sitemap](#why-astro-sitemap) +- [Installation](#installation) +- [Usage](#usage) +- [Configuration](#configuration) +- [Examples](#examples) +- [Troubleshooting](#troubleshooting) +- [Contributing](#contributing) +- [Changelog](#changelog) -### (experimental) `astro add` command +## Why Astro Sitemap -Astro includes a CLI tool for adding first party integrations: `astro add`. This command will: -1. (Optionally) Install all necessary dependencies and peer dependencies -2. (Also optionally) Update your `astro.config.*` file to apply this integration +A Sitemap is an XML file that outlines all of the pages, videos, and files on your site. Search engines like Google read this file to crawl your site more efficiently. [See Google's own advice on sitemaps](https://developers.google.com/search/docs/advanced/sitemaps/overview) to learn more. -To install `@astrojs/sitemap`, run the following from your project directory and follow the prompts: +A sitemap file is recommended for large multi-page sites. If you don't use a sitemap, most search engines will still be able to list your site's pages, but a sitemap is a great way to ensure that your site is as search engine friendly as possible. -```sh -# Using NPM -npx astro add sitemap -# Using Yarn -yarn astro add sitemap -# Using PNPM -pnpx astro add sitemap -``` +With Astro Sitemap, you don't have to worry about creating this file: build your Astro site how you normally would, and the Astro Sitemap integration will crawl your routes and create the sitemap file. -If you run into any hiccups, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. - -### Install dependencies manually - -First, install the `@astrojs/sitemap` integration like so: +## Installation -``` +
+ Quick Install +
+ +The experimental `astro add` command-line tool automates the installation for you. Run one of the following commands in a new terminal window. (If you aren't sure which package manager you're using, run the first command.) Then, follow the prompts, and type "y" in the terminal (meaning "yes") for each one. + + ```sh + # Using NPM + npx astro add sitemap + # Using Yarn + yarn astro add sitemap + # Using PNPM + pnpx astro add sitemap + ``` + +Then, restart the dev server by typing `CTRL-C` and then `npm run astro dev` in the terminal window that was running Astro. + +Because this command is new, it might not properly set things up. If that happens, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. +
+ +
+ Manual Install + +
+ +First, install the `@astrojs/sitemap` package using your package manager. If you're using npm or aren't sure, run this in the terminal: +```sh npm install @astrojs/sitemap ``` - Then, apply this integration to your `astro.config.*` file using the `integrations` property: __astro.config.mjs__ ```js +import { defineConfig } from 'astro/config'; import sitemap from '@astrojs/sitemap'; -export default { +export default defineConfig({ // ... integrations: [sitemap()], -} +}) ``` + +Then, restart the dev server. +
-## Getting started +## Usage -`@astrojs/sitemap` requires a deployment / site URL for generation. Add your site's URL under your `astro.config.*` using the `site` property: +`@astrojs/sitemap` requires a deployment / site URL for generation. Add your site's URL under your `astro.config.*` using the `site` property. This must begin with `http:` or `https:`. __astro.config.mjs__ ```js +import { defineConfig } from 'astro/config'; import sitemap from '@astrojs/sitemap'; -export default { +export default defineConfig({ // ... site: 'https://stargazers.club', integrations: [sitemap()], -} +}) ``` +Note that unlike other configuration options, `site` is set in the root `defineConfig` object, rather than inside the `sitemap()` call. + Now, [build your site for production](https://docs.astro.build/en/reference/cli-reference/#astro-build) via the `astro build` command. You should find your sitemap under `dist/sitemap.xml`! -You can also check our [Astro Integration Documentation][astro-integration] for more on integrations. +> **Warning** +> If you forget to add a `site`, you'll get a friendly warning when you build, and the `sitemap.xml` file won't be generated. ## Configuration -### filter +To configure this integration, pass an object to the `sitemap()` function call in `astro.config.mjs`. -All pages are included in your sitemap by default. By adding a custom `filter`, you can filter included pages by URL. +__astro.config.mjs__ +```js +... +export default defineConfig({ + integrations: [sitemap({ + filter: ... + })] +}); +``` + +
+ filter + +
+ + All pages are included in your sitemap by default. By adding a custom `filter` function, you can filter included pages by URL. __astro.config.mjs__ ```js -import sitemap from '@astrojs/sitemap'; - -export default { - site: 'https://stargazers.club', - integrations: [ +... sitemap({ filter: (page) => page !== 'https://stargazers.club/secret-vip-lounge' }), - ], -} ``` -The `page` function parameter is the full URL of your rendered page, including your `site` domain. Return `true` to include a page in your sitemap, and `false` to remove it. +The function will be called for every page on your site. The `page` function parameter is the full URL of the page currently under considering, including your `site` domain. Return `true` to include the page in your sitemap, and `false` to leave it out. + +
-### canonicalURL +## Examples -If present, we use the `site` config option as the base for all sitemap URLs. Use `canonicalURL` to override this. +## Troubleshooting -__astro.config.mjs__ - -```js -import sitemap from '@astrojs/sitemap'; - -export default { - site: 'https://stargazers.club', - integrations: [ - sitemap({ - // https://astronaut.party will be used for all sitemap URLs instead - canonicalURL: 'https://astronaut.party', - }), - ], -} -``` +## Contributing -[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/ -[astro-ui-frameworks]: https://docs.astro.build/en/core-concepts/framework-components/#using-framework-components +## Changelog From a19667fef27f36b155050ffc13182723903a0659 Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Thu, 16 Jun 2022 11:14:58 -0400 Subject: [PATCH 04/24] remove canonicalURL option from sitemap --- packages/integrations/sitemap/src/index.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/packages/integrations/sitemap/src/index.ts b/packages/integrations/sitemap/src/index.ts index 169eeb788701..e28306fd5602 100644 --- a/packages/integrations/sitemap/src/index.ts +++ b/packages/integrations/sitemap/src/index.ts @@ -26,12 +26,6 @@ type SitemapOptions = * ``` */ customPages?: Array; - - /** - * If present, we use the `site` config option as the base for all sitemap URLs - * Use `canonicalURL` to override this - */ - canonicalURL?: string; } | undefined; @@ -51,7 +45,6 @@ function generateSitemap(pages: string[]) { export default function createPlugin({ filter, customPages, - canonicalURL, }: SitemapOptions = {}): AstroIntegration { let config: AstroConfig; return { @@ -62,14 +55,11 @@ export default function createPlugin({ }, 'astro:build:done': async ({ pages, dir }) => { let finalSiteUrl: URL; - if (canonicalURL) { - finalSiteUrl = new URL(canonicalURL); - finalSiteUrl.pathname += finalSiteUrl.pathname.endsWith('/') ? '' : '/'; // normalizes the final url since it's provided by user - } else if (config.site) { + if (config.site) { finalSiteUrl = new URL(config.base, config.site); } else { console.warn( - 'The Sitemap integration requires either the `site` astro.config option or `canonicalURL` integration option. Skipping.' + 'The Sitemap integration requires either the `site` astro.config option. Skipping.' ); return; } From 2d28492ce27bb9abf171f8329d6b4d590e91c80e Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Thu, 16 Jun 2022 11:21:00 -0400 Subject: [PATCH 05/24] add customPages option to readme --- packages/integrations/sitemap/README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/integrations/sitemap/README.md b/packages/integrations/sitemap/README.md index 67b2ff769a3f..82d13d4687ca 100644 --- a/packages/integrations/sitemap/README.md +++ b/packages/integrations/sitemap/README.md @@ -126,6 +126,24 @@ The function will be called for every page on your site. The `page` function par +
+ customPages + +
+ + In some cases, a page might be part of your deployed site but not part of your Astro project. + If you'd like to include a page in your sitemap that _isn't_ created by Astro, you can use this option. + +__astro.config.mjs__ + +```js +... + sitemap({ + customPages: ['https://stargazers.club/external-page', 'https://stargazers.club/external-page2'] + }), +``` +
+ ## Examples ## Troubleshooting From dc08a2c445bc58279e585f04bf9b9866c37b3d55 Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Thu, 16 Jun 2022 15:03:10 -0400 Subject: [PATCH 06/24] sitemap examples --- packages/integrations/sitemap/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/integrations/sitemap/README.md b/packages/integrations/sitemap/README.md index 82d13d4687ca..49860b6a0245 100644 --- a/packages/integrations/sitemap/README.md +++ b/packages/integrations/sitemap/README.md @@ -1,6 +1,6 @@ # @astrojs/sitemap 🗺 -This **[Astro integration][astro-integration]** generates a sitemap for your Astro project. +This Astro integration generates a sitemap based on your routes when you build your Astro project. - [Why Astro Sitemap](#why-astro-sitemap) @@ -145,9 +145,14 @@ __astro.config.mjs__ ## Examples +- The official Astro website uses Astro Sitemap to generate [its sitemap](https://astro.build/sitemap.xml). +- The [https://github.com/withastro/astro/tree/latest/examples/integrations-playground?on=github](integrations playground template) comes with Astro Sitemap installed. Try adding a route and building the project! +- [Browse projects with Astro Sitemap on GitHub](https://github.com/search?q=%22@astrojs/sitemap%22+filename:package.json&type=Code) for more examples! ## Troubleshooting ## Contributing +This package is maintained by Astro's Core team. You're welcome to submit an issue or PR! + ## Changelog From 512d9815092cd483882aeb3c69ea5137e61e1097 Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Fri, 17 Jun 2022 14:04:33 -0400 Subject: [PATCH 07/24] partytown --- packages/integrations/partytown/README.md | 152 +++++++++++++++------- packages/integrations/sitemap/README.md | 2 +- 2 files changed, 109 insertions(+), 45 deletions(-) diff --git a/packages/integrations/partytown/README.md b/packages/integrations/partytown/README.md index 2c10f6af31e3..144c5ddbf9ec 100644 --- a/packages/integrations/partytown/README.md +++ b/packages/integrations/partytown/README.md @@ -2,55 +2,75 @@ This **[Astro integration][astro-integration]** enables [Partytown](https://partytown.builder.io/) in your Astro project. -Partytown is a lazy-loaded library to help relocate resource intensive scripts into a [web worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API), and off of the [main thread](https://developer.mozilla.org/en-US/docs/Glossary/Main_thread). - -## Installation - -There are two ways to add integrations to your project. Let's try the most convenient option first! -### (experimental) `astro add` command +- [Why Astro Partytown](#why-astro-partytown) +- [Installation](#installation) +- [Usage](#usage) +- [Configuration](#configuration) +- [Examples](#examples) +- [Troubleshooting](#troubleshooting) +- [Contributing](#contributing) +- [Changelog](#changelog) -Astro includes a CLI tool for adding first party integrations: `astro add`. This command will: -1. (Optionally) Install all necessary dependencies and peer dependencies -2. (Also optionally) Update your `astro.config.*` file to apply this integration +## Why Astro Partytown -To install `@astrojs/partytown`, run the following from your project directory and follow the prompts: - -```sh -# Using NPM -npx astro add partytown -# Using Yarn -yarn astro add partytown -# Using PNPM -pnpx astro add partytown -``` +Partytown is a lazy-loaded library to help relocate resource intensive scripts into a [web worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API), and off of the [main thread](https://developer.mozilla.org/en-US/docs/Glossary/Main_thread). -If you run into any hiccups, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. +If you're using third-party scripts for things like analytics or ads, Partytown is a great way to make sure that they don't slow down your site. -### Install dependencies manually +The Astro Partytown integration installs Partytown for you and makes sure it's enabled on all of your pages. -First, install the `@astrojs/partytown` integration like so: +## Installation -``` +
+ Quick Install +
+ +The experimental `astro add` command-line tool automates the installation for you. Run one of the following commands in a new terminal window. (If you aren't sure which package manager you're using, run the first command.) Then, follow the prompts, and type "y" in the terminal (meaning "yes") for each one. + + ```sh + # Using NPM + npx astro add partytown + # Using Yarn + yarn astro add partytown + # Using PNPM + pnpx astro add partytown + ``` + +Then, restart the dev server by typing `CTRL-C` and then `npm run astro dev` in the terminal window that was running Astro. + +Because this command is new, it might not properly set things up. If that happens, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. +
+ +
+ Manual Install + +
+ +First, install the `@astrojs/partytown` package using your package manager. If you're using npm or aren't sure, run this in the terminal: +```sh npm install @astrojs/partytown ``` - Then, apply this integration to your `astro.config.*` file using the `integrations` property: __astro.config.mjs__ ```js -import partytown from '@astrojs/partytown'; +import { defineConfig } from 'astro/config'; +import partytown from '@astrojs/sitemap'; -export default { +export default defineConfig({ // ... integrations: [partytown()], -} +}) ``` + +Then, restart the dev server. +
-## Getting started +## Usage -Partytown should be ready-to-use with zero config. If you have an existing 3rd party script on your site, try adding the `type="text/partytown"` attribute: +Partytown should be ready to go with zero config. If you have an existing 3rd party script on your site, try adding the `type="text/partytown"` attribute: ```diff - @@ -61,37 +81,81 @@ If you open the "Network" tab from [your browser's dev tools](https://developer. ## Configuration -### config.debug +To configure this integration, pass a 'config' object to the `partytown()` function call in `astro.config.mjs`. + +__astro.config.mjs__ +```js +... +export default defineConfig({ + integrations: [partytown({ + config: { + //options go here + } + })] +}); +``` + +This mirrors the [Partytown config object](https://partytown.builder.io/configuration), but only `debug` and `forward` are exposed by this integration. + +
+ config.debug + +
+ + Partytown ships with a `debug` mode; enable or disable it by passing `true` or `false` to `config.debug`. If [`debug` mode](https://partytown.builder.io/debugging) is enabled, it will output detailed logs to the browser console. -You can set debug mode using this integration's `config.debug` option. If `config.debug` is unset, it will fall back to `true` if the command is `dev`. + If this option isn't set, `debug` mode will be on by default in [dev](https://docs.astro.build/en/reference/cli-reference/#astro-dev) or [preview](https://docs.astro.build/en/reference/cli-reference/#astro-preview) mode. + +__astro.config.mjs__ ```js -// astro.config.mjs -export default { +export default defineConfig({ integrations: [partytown({ // Example: Disable debug mode. config: { debug: false }, - })], -} + +}) ``` +
+ +
+ config.forward + +
+ + Third-party scripts typically add variables to the `window` object so that you can communicate with them throughout your site. But when a script is loaded in a web-worker, it doesn't have access to that global `window` object. -### config.forward + To solve this, Partytown can "patch" variables to the global window object and forward them to the appropriate script. -Because we’re moving third-party scripts to a web worker, the main thread needs to know which variables to patch on window, and when these services are called, the data is correctly forwarded to the web worker. You can to set it on the `config.forward` option. + You can specify these variables on the `config.forward` option. [Read more in Partytown's documentation.](https://partytown.builder.io/forwarding-events) + + +__astro.config.mjs__ ```js -// astro.config.mjs -export default { +export default defineConfig ({ integrations: [partytown({ // Example: Add dataLayer.push as a forwarding-event. - config: { forward: ["dataLayer.push"] }, + config: { + forward: ["dataLayer.push"] + }, })], -} +}) ``` +
+ +## Examples + +- The [integrations playground template](https://github.com/withastro/astro/tree/latest/examples/integrations-playground?on=github) comes with Astro Partytown installed, with a demo script that shows how Partytown moves intensive operations off of the main thread. + +- [Browse projects with Astro Partytown on GitHub](https://github.com/search?q=%22@astrojs/partytown%22+filename:package.json&type=Code) for more examples! + +## Troubleshooting + +## Contributing -## Read more +This package is maintained by Astro's Core team. You're welcome to submit an issue or PR! -[Head to the Partytown docs](https://partytown.builder.io/configuration) for configuration options and more usage examples. You can also check our [Astro Integration Documentation][astro-integration] for more on integrations. +## Changelog [astro-integration]: https://docs.astro.build/en/guides/integrations-guide/ -[astro-ui-frameworks]: https://docs.astro.build/en/core-concepts/framework-components/#using-framework-components diff --git a/packages/integrations/sitemap/README.md b/packages/integrations/sitemap/README.md index 49860b6a0245..0db18f9b687b 100644 --- a/packages/integrations/sitemap/README.md +++ b/packages/integrations/sitemap/README.md @@ -1,6 +1,6 @@ # @astrojs/sitemap 🗺 -This Astro integration generates a sitemap based on your routes when you build your Astro project. +This **[Astro integration][astro-integration]** generates a sitemap based on your routes when you build your Astro project. - [Why Astro Sitemap](#why-astro-sitemap) From 6ddb4b37e0625c15961bed2835938ca733b4183a Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Tue, 21 Jun 2022 12:22:53 -0400 Subject: [PATCH 08/24] deno run command --- packages/integrations/deno/readme.md | 132 ++++++++++++++++++------ packages/integrations/sitemap/README.md | 2 + 2 files changed, 105 insertions(+), 29 deletions(-) diff --git a/packages/integrations/deno/readme.md b/packages/integrations/deno/readme.md index 4b3dc959fa8d..50a16bd85321 100644 --- a/packages/integrations/deno/readme.md +++ b/packages/integrations/deno/readme.md @@ -1,66 +1,140 @@ -# @astrojs/deno +# @astrojs/deno 🦖 -A server-side rendering adapter for use with Deno targets. Write your code in Astro/Node and deploy to Deno servers. +This adapter allows Astro to deploy your site to Deno targets. -In your astro.config.mjs use: +- [Why Astro Deno](#why-astro-partytown) +- [Installation](#installation) +- [Usage](#usage) +- [Configuration](#configuration) +- [Examples](#examples) +- [Troubleshooting](#troubleshooting) +- [Contributing](#contributing) +- [Changelog](#changelog) + + +## Why Astro Deno + +If you're using Astro as a static site builder—its behavior out of the box—you don't need an adapter. + +If you wish to [use server-side rendering (SSR)](https://docs.astro.build/en/guides/server-side-rendering/), Astro requires an adapter that matches your deployment runtime. + +[Deno](https://deno.land/) is a runtime similar to Node, but with an API that's more similar to the browser's API. This adapter provides access to Deno's API and creates a script to run your project on a Deno server. + +## Installation + +First, install the `@astrojs/deno` package using your package manager. If you're using npm or aren't sure, run this in the terminal: +```sh +npm install @astrojs/deno +``` + +Then, install this adapter in your `astro.config.*` file using the `adapter` property: + +__astro.config.mjs__ ```js import { defineConfig } from 'astro/config'; import deno from '@astrojs/deno'; export default defineConfig({ + // ... adapter: deno() -}); +}) ``` + + + +## Usage -After performing a build there will be a `dist/server/entry.mjs` module. You can start a server simply by importing this module: +After [performing a build](https://docs.astro.build/en/guides/deploy/#building-the-app) there will be a `dist/server/entry.mjs` module. You can start a server by importing this module in your Deno app: ```js import './dist/entry.mjs'; ``` -## API +See the `start` option below for how you can have more control over starting the Astro server. -### Adapter options +You can also run the script directly using deno: +``` +deno run --allow-net --allow-read ./dist/server/entry.mjs +``` -This adapter automatically starts a server when it is imported. You can configure this through options: +## Configuration + +To configure this adapter, pass an object to the `deno()` function call in `astro.config.mjs`. + +__astro.config.mjs__ ```js import { defineConfig } from 'astro/config'; import deno from '@astrojs/deno'; export default defineConfig({ adapter: deno({ - start: false + //options go here }) }); ``` -If disabling start you need to write your own web server and use `handle` to render requests: +
+ start + +
-```ts -import { serve } from "https://deno.land/std@0.132.0/http/server.ts"; -import { handle } from './dist/entry.mjs'; + This adapter automatically starts a server when it is imported. You can turn this off with the `start` option: -serve((req: Request) => { - // Check the request, maybe do static file handling here. + ```js + import { defineConfig } from 'astro/config'; + import deno from '@astrojs/deno'; - return handle(req); -}); -``` + export default defineConfig({ + adapter: deno({ + start: false + }) + }); + ``` ----- + If you disable this, you need to write your own Deno web server. Imports and call `handle` from the generated entry script to render requests: -You an also pass in a port/hostname to use: + ```ts + import { serve } from "https://deno.land/std@0.132.0/http/server.ts"; + import { handle } from './dist/entry.mjs'; -```js -import { defineConfig } from 'astro/config'; -import deno from '@astrojs/deno'; + serve((req: Request) => { + // Check the request, maybe do static file handling here. -export default defineConfig({ - adapter: deno({ - port: 8081, - hostname: 'myhost' - }) -}); + return handle(req); + }); + ``` +
+ +
+ port and hostname + +
+ + You can set the port (default: `8085`) and hostname (default: `0.0.0.0`) for the deno server to use. If `start` is false, this has no effect; your own server must configure the port and hostname. + + ```js + import { defineConfig } from 'astro/config'; + import deno from '@astrojs/deno'; + + export default defineConfig({ + adapter: deno({ + port: 8081, + hostname: 'myhost' + }) + }); ``` +
+ +## Examples + +## Troubleshooting + +## Contributing + +This package is maintained by Astro's Core team. You're welcome to submit an issue or PR! + +## Changelog + +[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/ diff --git a/packages/integrations/sitemap/README.md b/packages/integrations/sitemap/README.md index 0db18f9b687b..8679b6816b38 100644 --- a/packages/integrations/sitemap/README.md +++ b/packages/integrations/sitemap/README.md @@ -156,3 +156,5 @@ __astro.config.mjs__ This package is maintained by Astro's Core team. You're welcome to submit an issue or PR! ## Changelog + +[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/ \ No newline at end of file From bfc341338189560b8171ca587486406e626f7ffd Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Tue, 21 Jun 2022 13:13:39 -0400 Subject: [PATCH 09/24] reference deno example --- packages/integrations/deno/readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/integrations/deno/readme.md b/packages/integrations/deno/readme.md index 50a16bd85321..d8b02bbee940 100644 --- a/packages/integrations/deno/readme.md +++ b/packages/integrations/deno/readme.md @@ -129,6 +129,8 @@ export default defineConfig({ ## Examples +The [Astro Deno](https://github.com/withastro/astro/tree/main/examples/deno) example includes a `preview:deno` command that runs the entry script directly. Run `npm run build` then `npm run preview:deno` to run the production deno server. + ## Troubleshooting ## Contributing From 1b3018cb8e3a8a9916b4e659bc6f08f98810fb46 Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Tue, 21 Jun 2022 13:43:35 -0400 Subject: [PATCH 10/24] node readme --- packages/integrations/node/readme.md | 73 +++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 8 deletions(-) diff --git a/packages/integrations/node/readme.md b/packages/integrations/node/readme.md index ffd4b6ffaf34..9bcaceef04b7 100644 --- a/packages/integrations/node/readme.md +++ b/packages/integrations/node/readme.md @@ -1,19 +1,56 @@ -# @astrojs/node +# @astrojs/deno 🦖 -An experimental server-side rendering adapter for use with Node.js servers. +This adapter allows Astro to deploy your site to Node targets. -In your astro.config.mjs use: +- [Why Astro Deno](#why-astro-partytown) +- [Installation](#installation) +- [Usage](#usage) +- [Configuration](#configuration) +- [Examples](#examples) +- [Troubleshooting](#troubleshooting) +- [Contributing](#contributing) +- [Changelog](#changelog) + +## Why Astro Deno + +If you're using Astro as a static site builder—its behavior out of the box—you don't need an adapter. + +If you wish to [use server-side rendering (SSR)](https://docs.astro.build/en/guides/server-side-rendering/), Astro requires an adapter that matches your deployment runtime. + +[Node](https://deno.land/) is a JavaScript runtime for server-side code. This adapter provides access to Node's API and creates a script to run your project on a Node server. + +## Installation + +First, install the `@astrojs/node` package using your package manager. If you're using npm or aren't sure, run this in the terminal: +```sh +npm install @astrojs/node +``` + +Then, install this adapter in your `astro.config.*` file using the `adapter` property: + +__astro.config.mjs__ ```js import { defineConfig } from 'astro/config'; -import nodejs from '@astrojs/node'; +import deno from '@astrojs/node'; export default defineConfig({ - adapter: nodejs() + // ... + adapter: node() }) ``` + + + +## Usage + +After [performing a build](https://docs.astro.build/en/guides/deploy/#building-the-app) there will be a `dist/server/entry.mjs` module that exposes a `handler` function. This works like a [middleware](https://expressjs.com/en/guide/using-middleware.html) function: it can handle incoming requests and respond accordingly. + + +### Using a middleware framework +You can use this `handler` with any framework that supports the Node `request` and `response` objects. -After performing a build there will be a `dist/server/entry.mjs` module that works like a middleware function. You can use with any framework that supports the Node `request` and `response` objects. For example, with Express you can do: +For example, with Express: ```js import express from 'express'; @@ -25,9 +62,10 @@ app.use(ssrHandler); app.listen(8080); ``` -# Using `http` -This adapter does not require you use Express and can work with even the `http` and `https` modules. The adapter does following the Expression convention of calling a function when either +### Using `http` + +This output script does not require you use Express and can work with even the built-in `http` and `https` node modules. The handler does follow the convention calling an error function when either - A route is not found for the request. - There was an error rendering. @@ -52,3 +90,22 @@ http.createServer(function(req, res) { }); }).listen(8080); ``` + + + + +## Configuration + +This adapter does not expose any configuration options. + +## Examples + +## Troubleshooting + +## Contributing + +This package is maintained by Astro's Core team. You're welcome to submit an issue or PR! + +## Changelog + +[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/ From 46bca5416e9d3fffd86e13a99cd4e504cf4e05d3 Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Wed, 22 Jun 2022 09:16:52 -0400 Subject: [PATCH 11/24] netlify & vercel readmes --- packages/integrations/deno/readme.md | 6 +- packages/integrations/netlify/README.md | 85 +++++++++++++++++++++---- packages/integrations/node/readme.md | 13 ++-- packages/integrations/vercel/README.md | 78 +++++++++++++++++------ 4 files changed, 136 insertions(+), 46 deletions(-) diff --git a/packages/integrations/deno/readme.md b/packages/integrations/deno/readme.md index d8b02bbee940..292953c8d961 100644 --- a/packages/integrations/deno/readme.md +++ b/packages/integrations/deno/readme.md @@ -1,8 +1,8 @@ # @astrojs/deno 🦖 -This adapter allows Astro to deploy your site to Deno targets. +This adapter allows Astro to deploy your SSR site to Deno targets. -- [Why Astro Deno](#why-astro-partytown) +- [Why Astro Deno](#why-astro-deno) - [Installation](#installation) - [Usage](#usage) - [Configuration](#configuration) @@ -41,8 +41,6 @@ export default defineConfig({ }) ``` - - ## Usage After [performing a build](https://docs.astro.build/en/guides/deploy/#building-the-app) there will be a `dist/server/entry.mjs` module. You can start a server by importing this module in your Deno app: diff --git a/packages/integrations/netlify/README.md b/packages/integrations/netlify/README.md index b0daeadefeeb..13fdb52d46b9 100644 --- a/packages/integrations/netlify/README.md +++ b/packages/integrations/netlify/README.md @@ -1,8 +1,36 @@ # @astrojs/netlify -Deploy your server-side rendered (SSR) Astro app to [Netlify](https://www.netlify.com/). +This adapter allows Astro to deploy your SSR site to [Netlify](https://www.netlify.com/). -Use this adapter in your Astro configuration file, alongside a valid deployment URL: +- [Why Astro Netlify](#why-astro-netlify) +- [Installation](#installation) +- [Usage](#usage) +- [Configuration](#configuration) +- [Examples](#examples) +- [Troubleshooting](#troubleshooting) +- [Contributing](#contributing) +- [Changelog](#changelog) + + +## Why Astro Netlify + +If you're using Astro as a static site builder—its behavior out of the box—you don't need an adapter. + +If you wish to [use server-side rendering (SSR)](https://docs.astro.build/en/guides/server-side-rendering/), Astro requires an adapter that matches your deployment runtime. + +[Netlify](https://www.netlify.com/) is a deployment platform that allows you to host your site by connecting directly to your GitHub repository. This adapter enhances the Astro build process to prepare your project for deployment through Netlify. + + +## Installation + +First, install the `@astrojs/netlify` package using your package manager. If you're using npm or aren't sure, run this in the terminal: +```sh +npm install @astrojs/netlify +``` + +Then, install this adapter in your `astro.config.*` file using the `adapter` property. Note: there are two different adapters, one for Netlify Functions and one for Edge Functions. See [Edge Functions](#edge-functions) below on importing the latter. + +__astro.config.mjs__ ```js import { defineConfig } from 'astro/config'; @@ -13,15 +41,7 @@ export default defineConfig({ }); ``` -After you build your site the `netlify/` folder will contain [Netlify Functions](https://docs.netlify.com/functions/overview/) in the `netlify/functions/` folder. - -Now you can deploy! - -```shell -netlify deploy --build -``` - -## Edge Functions +### Edge Functions Netlify has two serverless platforms, Netlify Functions and Netlify Edge Functions. With Edge Functions your code is distributed closer to your users, lowering latency. You can use Edge Functions by changing the import in your astro configuration file: @@ -34,12 +54,31 @@ export default defineConfig({ adapter: netlify(), }); ``` +## Usage + +[Read the full deployment guide here.](https://docs.astro.build/en/guides/deploy/vercel) + +After [performing a build](https://docs.astro.build/en/guides/deploy/#building-the-app) the `netlify/` folder will contain [Netlify Functions](https://docs.netlify.com/functions/overview/) in the `netlify/functions/` folder. + +Now you can deploy. Install the [Netlify CLI](https://docs.netlify.com/cli/get-started/) and run: + +```shell +netlify deploy --build +``` + +The [Netlify Blog post on Astro](https://www.netlify.com/blog/how-to-deploy-astro/) and the [Netlify Documentation](https://docs.netlify.com/integrations/frameworks/astro/) provide more information on how to use this integration to deploy to Netlify. + ## Configuration -### dist +To configure this adapter, pass an object to the `netlify()` function call in `astro.config.mjs` - there's only one possible configuration option: + +
+ dist + +
-We build to a `dist` directory at the base of your project. To change this, use the `dist` option: +We build to the `dist` directory at the base of your project. To change this, use the `dist` option: ```js import { defineConfig } from 'astro/config'; @@ -56,5 +95,23 @@ And then point to the dist in your `netlify.toml`: ```toml [functions] - directory = "dist/functions" +directory = "dist/functions" ``` + +
+ +## Examples + +- The [Astro Netlify Edge Starter](https://github.com/sarahetter/astro-netlify-edge-starter) provides an example and a guide in the README. + +- [Browse Astro Netlify projects on GitHub](https://github.com/search?q=%22%40astrojs%2Fnetlify%22+filename%3Apackage.json&type=Code) for more examples! + +## Troubleshooting + +## Contributing + +This package is maintained by Astro's Core team. You're welcome to submit an issue or PR! + +## Changelog + +[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/ diff --git a/packages/integrations/node/readme.md b/packages/integrations/node/readme.md index 9bcaceef04b7..fa241bec434f 100644 --- a/packages/integrations/node/readme.md +++ b/packages/integrations/node/readme.md @@ -1,8 +1,8 @@ -# @astrojs/deno 🦖 +# @astrojs/node 🔲 -This adapter allows Astro to deploy your site to Node targets. +This adapter allows Astro to deploy your SSR site to Node targets. -- [Why Astro Deno](#why-astro-partytown) +- [Why Astro Node](#why-astro-node) - [Installation](#installation) - [Usage](#usage) - [Configuration](#configuration) @@ -11,13 +11,13 @@ This adapter allows Astro to deploy your site to Node targets. - [Contributing](#contributing) - [Changelog](#changelog) -## Why Astro Deno +## Why Astro Node If you're using Astro as a static site builder—its behavior out of the box—you don't need an adapter. If you wish to [use server-side rendering (SSR)](https://docs.astro.build/en/guides/server-side-rendering/), Astro requires an adapter that matches your deployment runtime. -[Node](https://deno.land/) is a JavaScript runtime for server-side code. This adapter provides access to Node's API and creates a script to run your project on a Node server. +[Node](https://nodejs.org/en/) is a JavaScript runtime for server-side code. Frameworks like [Express](https://expressjs.com/) are built on top of it and make it easier to write server applications in Node. This adapter provides access to Node's API and creates a script to run your Astro project that can be utilized in Node applications. ## Installation @@ -39,8 +39,6 @@ export default defineConfig({ adapter: node() }) ``` - - ## Usage @@ -93,7 +91,6 @@ http.createServer(function(req, res) { - ## Configuration This adapter does not expose any configuration options. diff --git a/packages/integrations/vercel/README.md b/packages/integrations/vercel/README.md index 3545774cfe46..26f484af3bd9 100644 --- a/packages/integrations/vercel/README.md +++ b/packages/integrations/vercel/README.md @@ -1,8 +1,34 @@ # @astrojs/vercel -Deploy your server-side rendered (SSR) Astro app to [Vercel](https://www.vercel.com/). +This adapter allows Astro to deploy your SSR site to [Vercel](https://www.vercel.com/). -Use this integration in your Astro configuration file: +- [Why Astro Vercel](#why-astro-vercel) +- [Installation](#installation) +- [Usage](#usage) +- [Configuration](#configuration) +- [Examples](#examples) +- [Troubleshooting](#troubleshooting) +- [Contributing](#contributing) +- [Changelog](#changelog) + +## Why Astro Vercel + +If you're using Astro as a static site builder—its behavior out of the box—you don't need an adapter. + +If you wish to [use server-side rendering (SSR)](https://docs.astro.build/en/guides/server-side-rendering/), Astro requires an adapter that matches your deployment runtime. + +[Vercel](https://www.netlify.com/) is a deployment platform that allows you to host your site by connecting directly to your GitHub repository. This adapter enhances the Astro build process to prepare your project for deployment through Vercel. + +## Installation + +First, install the `@astrojs/vercel` package using your package manager. If you're using npm or aren't sure, run this in the terminal: +```sh +npm install @astrojs/vercel +``` + +Then, install this adapter in your `astro.config.*` file using the `adapter` property (note the import from `@astrojs/vercel/serverless` - see [targets](#targets)). + + __astro.config.mjs__ ```js import { defineConfig } from 'astro/config'; @@ -13,9 +39,27 @@ export default defineConfig({ }); ``` -When you build your project, Astro will know to use the `.vercel/output` folder format that Vercel expects. +### Targets + +You can deploy to different targes: + +- `edge`: SSR inside a [Edge function](https://vercel.com/docs/concepts/functions/edge-functions). +- `serverless`: SSR inside a [Node.js function](https://vercel.com/docs/concepts/functions/serverless-functions). +- `static`: generates a static website following Vercel's output formats, redirects, etc. + +> **Note**: deploying to the Edge has [its limitations](https://vercel.com/docs/concepts/functions/edge-functions#known-limitations) — they can't be more than 1 MB in size and they don't support native Node.js APIs, among others. + +You can change where to target by changing the import: + +```js +import vercel from '@astrojs/vercel/edge'; +import vercel from '@astrojs/vercel/serverless'; +import vercel from '@astrojs/vercel/static'; +``` + +## Usage -## Deploying +[Read the full deployment guide here.](https://docs.astro.build/en/guides/deploy/vercel) You can deploy by CLI (`vercel deploy`) or by connecting your new repo in the [Vercel Dashboard](https://vercel.com/). Alternatively, you can create a production build locally: @@ -24,8 +68,6 @@ ENABLE_VC_BUILD=1 astro build vercel deploy --prebuilt ``` -## Requirements - **Vercel's [Build Output API](https://vercel.com/docs/build-output-api/v3) must be enabled.** You must enable it yourself by setting the environment variable: `ENABLE_VC_BUILD=1`. ```js @@ -41,24 +83,20 @@ vercel deploy --prebuilt [Learn more about setting enviroment variables in Vercel](https://vercel.com/docs/concepts/projects/environment-variables). -## Targets +## Configuration -You can deploy to different targes: +This adapter does not expose any configuration options. -- `edge`: SSR inside a [Edge function](https://vercel.com/docs/concepts/functions/edge-functions). -- `serverless`: SSR inside a [Node.js function](https://vercel.com/docs/concepts/functions/serverless-functions). -- `static`: generates a static website following Vercel's output formats, redirects, etc. +## Examples -> **Note**: deploying to the Edge has [its limitations](https://vercel.com/docs/concepts/functions/edge-functions#known-limitations) — they can't be more than 1 MB in size and they don't support native Node.js APIs, among others. +## Troubleshooting -You can change where to target by changing the import: +**A few known complex packages (example: [puppeteer](https://github.com/puppeteer/puppeteer)) do not support bundling and therefore will not work properly with this adapter.** By default, Vercel doesn't include npm installed files & packages from your project's `./node_modules` folder. To address this, the `@astrojs/vercel` adapter automatically bundles your final build output using `esbuild`. -```js -import vercel from '@astrojs/vercel/edge'; -import vercel from '@astrojs/vercel/serverless'; -import vercel from '@astrojs/vercel/static'; -``` +## Contributing -## Limitations +This package is maintained by Astro's Core team. You're welcome to submit an issue or PR! -**A few known complex packages (example: [puppeteer](https://github.com/puppeteer/puppeteer)) do not support bundling and therefore will not work properly with this adapter.** By default, Vercel doesn't include npm installed files & packages from your project's `./node_modules` folder. To address this, the `@astrojs/vercel` adapter automatically bundles your final build output using `esbuild`. +## Changelog + +[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/ From b52cc364f3ee9bea0377dfdb9b5c966e38379f0c Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Wed, 22 Jun 2022 09:18:00 -0400 Subject: [PATCH 12/24] note that telemetry is installed --- packages/telemetry/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/telemetry/README.md b/packages/telemetry/README.md index 9c0999e1af2e..a9d18aad06b1 100644 --- a/packages/telemetry/README.md +++ b/packages/telemetry/README.md @@ -1,6 +1,6 @@ # Astro Telemetry -This package is used to collect anonymous telemetry data within the Astro CLI. Telemetry data does not contain any personal identifying information and can be disabled via: +This package is used to collect anonymous telemetry data within the Astro CLI. It is installed by default. Telemetry data does not contain any personal identifying information and can be disabled via: ```shell astro telemetry disable From 95aa662014cb55d497e3af3109a9e475f873d20b Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Wed, 22 Jun 2022 09:22:47 -0400 Subject: [PATCH 13/24] telemetry is *enabled*, not installed --- packages/telemetry/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/telemetry/README.md b/packages/telemetry/README.md index a9d18aad06b1..6adc8b96f465 100644 --- a/packages/telemetry/README.md +++ b/packages/telemetry/README.md @@ -1,6 +1,6 @@ # Astro Telemetry -This package is used to collect anonymous telemetry data within the Astro CLI. It is installed by default. Telemetry data does not contain any personal identifying information and can be disabled via: +This package is used to collect anonymous telemetry data within the Astro CLI. It is enabled by default. Telemetry data does not contain any personal identifying information and can be disabled via: ```shell astro telemetry disable From 6f3267be7c6bc185cb91172e559926b3a9133c01 Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Thu, 23 Jun 2022 12:47:17 -0400 Subject: [PATCH 14/24] Update packages/integrations/vercel/README.md Co-authored-by: Chris Swithinbank --- packages/integrations/vercel/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integrations/vercel/README.md b/packages/integrations/vercel/README.md index 26f484af3bd9..f18d2a7c3c1e 100644 --- a/packages/integrations/vercel/README.md +++ b/packages/integrations/vercel/README.md @@ -59,7 +59,7 @@ import vercel from '@astrojs/vercel/static'; ## Usage -[Read the full deployment guide here.](https://docs.astro.build/en/guides/deploy/vercel) +📚 **[Read the full deployment guide here.](https://docs.astro.build/en/guides/deploy/vercel)** You can deploy by CLI (`vercel deploy`) or by connecting your new repo in the [Vercel Dashboard](https://vercel.com/). Alternatively, you can create a production build locally: From 127665eb8ada8d04a730ae9ac7af2ac225533202 Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Fri, 24 Jun 2022 08:45:11 -0400 Subject: [PATCH 15/24] Update packages/integrations/vercel/README.md Co-authored-by: Chris Swithinbank --- packages/integrations/vercel/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integrations/vercel/README.md b/packages/integrations/vercel/README.md index f18d2a7c3c1e..be4a2f8c975e 100644 --- a/packages/integrations/vercel/README.md +++ b/packages/integrations/vercel/README.md @@ -43,7 +43,7 @@ export default defineConfig({ You can deploy to different targes: -- `edge`: SSR inside a [Edge function](https://vercel.com/docs/concepts/functions/edge-functions). +- `edge`: SSR inside an [Edge function](https://vercel.com/docs/concepts/functions/edge-functions). - `serverless`: SSR inside a [Node.js function](https://vercel.com/docs/concepts/functions/serverless-functions). - `static`: generates a static website following Vercel's output formats, redirects, etc. From 6fd03b625949fcfa68b8a126db9f0764568f683e Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Wed, 29 Jun 2022 09:45:09 -0400 Subject: [PATCH 16/24] readme -> README --- packages/integrations/deno/readme.md | 1 - packages/integrations/node/readme.md | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/integrations/deno/readme.md b/packages/integrations/deno/readme.md index 292953c8d961..bd587ce54700 100644 --- a/packages/integrations/deno/readme.md +++ b/packages/integrations/deno/readme.md @@ -11,7 +11,6 @@ This adapter allows Astro to deploy your SSR site to Deno targets. - [Contributing](#contributing) - [Changelog](#changelog) - ## Why Astro Deno If you're using Astro as a static site builder—its behavior out of the box—you don't need an adapter. diff --git a/packages/integrations/node/readme.md b/packages/integrations/node/readme.md index fa241bec434f..ad8629e1ad82 100644 --- a/packages/integrations/node/readme.md +++ b/packages/integrations/node/readme.md @@ -9,7 +9,8 @@ This adapter allows Astro to deploy your SSR site to Node targets. - [Examples](#examples) - [Troubleshooting](#troubleshooting) - [Contributing](#contributing) -- [Changelog](#changelog) +- [Changelog](#changelog) + ## Why Astro Node From d5c00d3b5d594060d1af2912bce6b7cce6acffdd Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Wed, 29 Jun 2022 09:45:59 -0400 Subject: [PATCH 17/24] Update packages/integrations/deno/readme.md Co-authored-by: Chris Swithinbank --- packages/integrations/deno/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integrations/deno/readme.md b/packages/integrations/deno/readme.md index bd587ce54700..ac974f15a2f7 100644 --- a/packages/integrations/deno/readme.md +++ b/packages/integrations/deno/readme.md @@ -37,7 +37,7 @@ import deno from '@astrojs/deno'; export default defineConfig({ // ... adapter: deno() -}) +}); ``` ## Usage From 6afea3631088f112bb23d694ba01447dbc69a36e Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Wed, 29 Jun 2022 09:46:07 -0400 Subject: [PATCH 18/24] Update packages/integrations/deno/readme.md Co-authored-by: Chris Swithinbank --- packages/integrations/deno/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integrations/deno/readme.md b/packages/integrations/deno/readme.md index ac974f15a2f7..f2c65ddf46f6 100644 --- a/packages/integrations/deno/readme.md +++ b/packages/integrations/deno/readme.md @@ -52,7 +52,7 @@ See the `start` option below for how you can have more control over starting the You can also run the script directly using deno: ``` -deno run --allow-net --allow-read ./dist/server/entry.mjs +deno run --allow-net --allow-read --allow-env ./dist/server/entry.mjs ``` From 163e806ca4a93d30a6892161eaf0e3122c761b12 Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Wed, 29 Jun 2022 09:51:24 -0400 Subject: [PATCH 19/24] qualify they --- packages/integrations/vercel/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integrations/vercel/README.md b/packages/integrations/vercel/README.md index be4a2f8c975e..dd7d0679dec6 100644 --- a/packages/integrations/vercel/README.md +++ b/packages/integrations/vercel/README.md @@ -47,7 +47,7 @@ You can deploy to different targes: - `serverless`: SSR inside a [Node.js function](https://vercel.com/docs/concepts/functions/serverless-functions). - `static`: generates a static website following Vercel's output formats, redirects, etc. -> **Note**: deploying to the Edge has [its limitations](https://vercel.com/docs/concepts/functions/edge-functions#known-limitations) — they can't be more than 1 MB in size and they don't support native Node.js APIs, among others. +> **Note**: deploying to the Edge has [its limitations](https://vercel.com/docs/concepts/functions/edge-functions#known-limitations). An edge function can't be more than 1 MB in size and they don't support native Node.js APIs, among others. You can change where to target by changing the import: From a44e692a926efa0aa7919830dff206bfa1d19174 Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Wed, 29 Jun 2022 09:52:29 -0400 Subject: [PATCH 20/24] Update packages/integrations/sitemap/README.md Co-authored-by: Chris Swithinbank --- packages/integrations/sitemap/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integrations/sitemap/README.md b/packages/integrations/sitemap/README.md index 8679b6816b38..a6c41c520b35 100644 --- a/packages/integrations/sitemap/README.md +++ b/packages/integrations/sitemap/README.md @@ -146,7 +146,7 @@ __astro.config.mjs__ ## Examples - The official Astro website uses Astro Sitemap to generate [its sitemap](https://astro.build/sitemap.xml). -- The [https://github.com/withastro/astro/tree/latest/examples/integrations-playground?on=github](integrations playground template) comes with Astro Sitemap installed. Try adding a route and building the project! +- The [integrations playground template](https://github.com/withastro/astro/tree/latest/examples/integrations-playground?on=github) comes with Astro Sitemap installed. Try adding a route and building the project! - [Browse projects with Astro Sitemap on GitHub](https://github.com/search?q=%22@astrojs/sitemap%22+filename:package.json&type=Code) for more examples! ## Troubleshooting From 7661291152f6ac1609f4c756bba43bfa91c5be72 Mon Sep 17 00:00:00 2001 From: delucis Date: Wed, 29 Jun 2022 18:19:59 +0200 Subject: [PATCH 21/24] Uppercase README names --- packages/integrations/deno/{readme.md => README.md} | 0 packages/integrations/node/{readme.md => README.md} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename packages/integrations/deno/{readme.md => README.md} (100%) rename packages/integrations/node/{readme.md => README.md} (100%) diff --git a/packages/integrations/deno/readme.md b/packages/integrations/deno/README.md similarity index 100% rename from packages/integrations/deno/readme.md rename to packages/integrations/deno/README.md diff --git a/packages/integrations/node/readme.md b/packages/integrations/node/README.md similarity index 100% rename from packages/integrations/node/readme.md rename to packages/integrations/node/README.md From fd9cb9d89670f94557e88acbfdc6ee91eccacaf2 Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Wed, 29 Jun 2022 11:27:44 -0500 Subject: [PATCH 22/24] Update packages/integrations/partytown/README.md Co-authored-by: Chris Swithinbank --- packages/integrations/partytown/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integrations/partytown/README.md b/packages/integrations/partytown/README.md index 144c5ddbf9ec..88c244aad4b0 100644 --- a/packages/integrations/partytown/README.md +++ b/packages/integrations/partytown/README.md @@ -127,7 +127,7 @@ export default defineConfig({ To solve this, Partytown can "patch" variables to the global window object and forward them to the appropriate script. - You can specify these variables on the `config.forward` option. [Read more in Partytown's documentation.](https://partytown.builder.io/forwarding-events) + You can specify which variables to forward with the `config.forward` option. [Read more in Partytown's documentation.](https://partytown.builder.io/forwarding-events) __astro.config.mjs__ From 4edf920f379891cf21ad92b4a99ca1fe60bfc1fc Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Wed, 29 Jun 2022 11:37:39 -0500 Subject: [PATCH 23/24] imports -> import typo --- packages/integrations/deno/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integrations/deno/README.md b/packages/integrations/deno/README.md index f2c65ddf46f6..d0ce1e8f2728 100644 --- a/packages/integrations/deno/README.md +++ b/packages/integrations/deno/README.md @@ -90,7 +90,7 @@ export default defineConfig({ }); ``` - If you disable this, you need to write your own Deno web server. Imports and call `handle` from the generated entry script to render requests: + If you disable this, you need to write your own Deno web server. Import and call `handle` from the generated entry script to render requests: ```ts import { serve } from "https://deno.land/std@0.132.0/http/server.ts"; From 077baaa31c6ae3c80dffb95afa4dee95c9c69e82 Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Wed, 29 Jun 2022 11:51:14 -0500 Subject: [PATCH 24/24] update changeset --- .changeset/yellow-cameras-ring.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .changeset/yellow-cameras-ring.md diff --git a/.changeset/yellow-cameras-ring.md b/.changeset/yellow-cameras-ring.md new file mode 100644 index 000000000000..65d3a69aed2b --- /dev/null +++ b/.changeset/yellow-cameras-ring.md @@ -0,0 +1,11 @@ +--- +'@astrojs/deno': patch +'@astrojs/netlify': patch +'@astrojs/node': patch +'@astrojs/partytown': patch +'@astrojs/sitemap': patch +'@astrojs/vercel': patch +'@astrojs/telemetry': patch +--- + +Update READMEs