Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More integration README fixes #3885

Merged
merged 8 commits into from
Jul 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .changeset/calm-balloons-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
'@astrojs/cloudflare': patch
'@astrojs/deno': patch
'@astrojs/image': patch
'@astrojs/mdx': patch
'@astrojs/netlify': patch
'@astrojs/node': patch
'@astrojs/partytown': patch
'@astrojs/preact': patch
'@astrojs/prefetch': patch
'@astrojs/react': patch
'@astrojs/sitemap': patch
'@astrojs/solid-js': patch
'@astrojs/svelte': patch
'@astrojs/tailwind': patch
'@astrojs/vercel': patch
'@astrojs/vue': patch
---

Integration README fixes
2 changes: 1 addition & 1 deletion packages/integrations/cloudflare/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

An SSR adapter for use with Cloudflare Pages Functions targets. Write your code in Astro/Node and deploy to Cloudflare Pages.

In your astro.config.mjs use:
In your `astro.config.mjs` use:

```js
import { defineConfig } from 'astro/config';
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"astro-adapter"
],
"bugs": "https://github.com/withastro/astro/issues",
"homepage": "https://astro.build",
"homepage": "https://docs.astro.build/en/guides/integrations-guide/cloudflare/",
"exports": {
".": "./dist/index.js",
"./server.js": "./dist/server.js",
Expand Down
19 changes: 12 additions & 7 deletions packages/integrations/deno/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ If you wish to [use server-side rendering (SSR)](https://docs.astro.build/en/gui
## 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__
__`astro.config.mjs`__

```js
import { defineConfig } from 'astro/config';
Expand All @@ -51,7 +52,8 @@ import './dist/entry.mjs';
See the `start` option below for how you can have more control over starting the Astro server.

You can also run the script directly using deno:
```

```sh
deno run --allow-net --allow-read --allow-env ./dist/server/entry.mjs
```

Expand All @@ -60,7 +62,8 @@ deno run --allow-net --allow-read --allow-env ./dist/server/entry.mjs

To configure this adapter, pass an object to the `deno()` function call in `astro.config.mjs`.

__astro.config.mjs__
__`astro.config.mjs`__

```js
import { defineConfig } from 'astro/config';
import deno from '@astrojs/deno';
Expand All @@ -74,8 +77,6 @@ export default defineConfig({

<details>
<summary><strong>start</strong></summary>

<br/>

This adapter automatically starts a server when it is imported. You can turn this off with the `start` option:

Expand Down Expand Up @@ -106,8 +107,6 @@ export default defineConfig({

<details>
<summary><strong>port</strong> and <strong>hostname</strong></summary>

<br/>

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.

Expand All @@ -130,10 +129,16 @@ The [Astro Deno](https://github.com/withastro/astro/tree/main/examples/deno) exa

## Troubleshooting

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.

## Contributing

This package is maintained by Astro's Core team. You're welcome to submit an issue or PR!

## Changelog

See [CHANGELOG.md](CHANGELOG.md) for a history of changes to this integration.

[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/
2 changes: 1 addition & 1 deletion packages/integrations/deno/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"astro-adapter"
],
"bugs": "https://github.com/withastro/astro/issues",
"homepage": "https://astro.build",
"homepage": "https://docs.astro.build/en/guides/integrations-guide/deno/",
"exports": {
".": "./dist/index.js",
"./server.js": "./dist/server.js",
Expand Down
17 changes: 3 additions & 14 deletions packages/integrations/image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ This integration provides `<Image />` and `<Picture>` components as well as a ba

<details>
<summary>Quick Install</summary>
<br/>

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.

Expand All @@ -44,15 +43,13 @@ Because this command is new, it might not properly set things up. If that happen
<details>
<summary>Manual Install</summary>

<br/>

First, install the `@astrojs/image` package using your package manager. If you're using npm or aren't sure, run this in the terminal:
```sh
npm install @astrojs/image
```
Then, apply this integration to your `astro.config.*` file using the `integrations` property:

__astro.config.mjs__
__`astro.config.mjs`__

```js
import image from '@astrojs/image';
Expand Down Expand Up @@ -81,8 +78,6 @@ There are currently no other configuration options for the `@astrojs/image` inte
<details>
<summary><strong>config.serviceEntryPoint</strong></summary>

<br/>

The `serviceEntryPoint` should resolve to the image service installed from NPM. The default entry point is `@astrojs/image/sharp`, which resolves to the entry point exported from this integration's `package.json`.

```js
Expand All @@ -103,8 +98,6 @@ export default {
<details>
<summary><strong>Local images</strong></summary>

<br/>

Image files in your project's `src` directory can be imported in frontmatter and passed directly to the `<Image />` component. All other properties are optional and will default to the original image file's properties if not provided.

```html
Expand Down Expand Up @@ -133,8 +126,6 @@ import heroImage from '../assets/hero.png';
<details>
<summary><strong>Remote images</strong></summary>

<br/>

Remote images can be transformed with the `<Image />` component. The `<Image />` component needs to know the final dimensions for the `<img />` element to avoid content layout shifts. For remote images, this means you must either provide `width` and `height`, or one of the dimensions plus the required `aspectRatio`.

```html
Expand All @@ -158,8 +149,6 @@ const imageUrl = 'https://www.google.com/images/branding/googlelogo/2x/googlelog
<details>
<summary><strong>Images in markdown</strong></summary>

<br/>

The `<Image />` component can also be used to optimize images in markdown pages. For local images imported from your project's `src` directory, use Astro's the `setup` frontmatter to import the image file.

```html
Expand All @@ -182,8 +171,6 @@ description: Just a Hello World Post!
<details>
<summary><strong>Responsive pictures</strong></summary>

<br />

The `<Picture />` component can be used to automatically build a `<picture>` with multiple sizes and formats. Check out [MDN](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images#art_direction) for a deep dive into responsive images and art direction.

By default, the picture will include formats for `avif` and `webp` in addition to the image's original format.
Expand Down Expand Up @@ -227,3 +214,5 @@ You can also check our [Astro Integration Documentation][astro-integration] for
This package is maintained by Astro's Core team. You're welcome to submit an issue or PR!

## Changelog

See [CHANGELOG.md](CHANGELOG.md) for a history of changes to this integration.
2 changes: 1 addition & 1 deletion packages/integrations/image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"image"
],
"bugs": "https://github.com/withastro/astro/issues",
"homepage": "https://astro.build",
"homepage": "https://docs.astro.build/en/guides/integrations-guide/image/",
"exports": {
".": {
"astro": "./components/index.js",
Expand Down
8 changes: 4 additions & 4 deletions packages/integrations/lit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If you run into any hiccups, [feel free to log an issue on our GitHub](https://g

First, install the `@astrojs/lit` integration like so:

```
```sh
delucis marked this conversation as resolved.
Show resolved Hide resolved
npm install @astrojs/lit
```

Expand All @@ -41,7 +41,7 @@ npm install lit @webcomponents/template-shadowroot

Now, apply this integration to your `astro.config.*` file using the `integrations` property:

__astro.config.mjs__
__`astro.config.mjs`__

```js
import lit from '@astrojs/lit';
Expand All @@ -63,7 +63,7 @@ However, there's a key difference with Lit _custom elements_ over conventional _

Astro needs to know which tag is associated with which component script. We expose this through exporting a `tagName` variable from the component script. It looks like this:

__src/components/my-element.js__
__`src/components/my-element.js`__

```js
import { LitElement, html } from 'lit';
Expand All @@ -83,7 +83,7 @@ customElements.define(tagName, MyElement);

In your Astro template import this component as a side-effect and use the element.

__src/pages/index.astro__
__`src/pages/index.astro`__

```astro
---
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"lit"
],
"bugs": "https://github.com/withastro/astro/issues",
"homepage": "https://astro.build",
"homepage": "https://docs.astro.build/en/guides/integrations-guide/lit/",
"exports": {
".": "./dist/index.js",
"./server.js": "./server.js",
Expand Down
6 changes: 2 additions & 4 deletions packages/integrations/mdx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Check out [“What is MDX?”](https://mdxjs.com/docs/what-is-mdx/), a deep-dive

<details>
<summary>Quick Install</summary>
<br/>

The `astro add` command-line tool automates the installation for you. Run one of the following commands in a new terminal window. (If you aren't sure which package manager you're using, run the first command.) Then, follow the prompts, and type "y" in the terminal (meaning "yes") for each one.

Expand All @@ -42,17 +41,16 @@ Because this command is new, it might not properly set things up. If that happen

<details>
<summary>Manual Install</summary>
<br/>

First, install the `@astrojs/mdx` package using your package manager. If you're using npm or aren't sure, run this in the terminal:

```
```sh
npm install @astrojs/mdx
```

Then, apply this integration to your `astro.config.*` file using the `integrations` property:

__astro.config.mjs__
__`astro.config.mjs`__

```js
import { defineConfig } from 'astro/config';
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"mdx"
],
"bugs": "https://github.com/withastro/astro/issues",
"homepage": "https://astro.build",
"homepage": "https://docs.astro.build/en/guides/integrations-guide/mdx/",
"exports": {
".": "./dist/index.js",
"./package.json": "./package.json"
Expand Down
20 changes: 12 additions & 8 deletions packages/integrations/netlify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ 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__
__`astro.config.mjs`__

```js
import { defineConfig } from 'astro/config';
Expand Down Expand Up @@ -62,7 +62,7 @@ After [performing a build](https://docs.astro.build/en/guides/deploy/#building-y

Now you can deploy. Install the [Netlify CLI](https://docs.netlify.com/cli/get-started/) and run:

```shell
```sh
netlify deploy --build
```

Expand All @@ -75,8 +75,6 @@ To configure this adapter, pass an object to the `netlify()` function call in `a

<details>
<summary><strong>dist</strong></summary>

<br/>

We build to the `dist` directory at the base of your project. To change this, use the `dist` option:

Expand Down Expand Up @@ -115,14 +113,14 @@ We check for common mime types for audio, image, and video files. To include spe
import fs from 'node:fs';

export function get() {
const buffer = fs.readFileSync('../image.jpg');
const buffer = fs.readFileSync('../image.jpg');

// Return the buffer directly, @astrojs/netlify will base64 encode the body
return new Response(buffer, {
status: 200,
headers: {
'content-type': 'image/jpeg'
}
headers: {
'content-type': 'image/jpeg'
}
});
}
```
Expand All @@ -136,11 +134,17 @@ export function get() {

## Troubleshooting

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.

## Contributing

This package is maintained by Astro's Core team. You're welcome to submit an issue or PR!

## Changelog

See [CHANGELOG.md](CHANGELOG.md) for a history of changes to this integration.

[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/

2 changes: 1 addition & 1 deletion packages/integrations/netlify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"astro-adapter"
],
"bugs": "https://github.com/withastro/astro/issues",
"homepage": "https://astro.build",
"homepage": "https://docs.astro.build/en/guides/integrations-guide/netlify/",
"exports": {
".": "./dist/index.js",
"./functions": "./dist/integration-functions.js",
Expand Down
Loading