Skip to content

Commit 037ad11

Browse files
authored
Merge branch 'main' into add/sevalla-deployment-guide
2 parents 125c375 + 3157a8a commit 037ad11

14 files changed

Lines changed: 665 additions & 22 deletions

File tree

public/_headers

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/*
2+
cache-control: max-age=60
3+
cache-control: public
14
/_astro/*
25
cache-control: max-age=31536000
36
cache-control: immutable

src/content/docs/en/contribute.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Visit [Astro's GitHub profile](https://github.com/withastro) to find the reposit
2727

2828
- The [Astro compiler](https://github.com/withastro/compiler), written in Go, distributed as WASM.
2929

30-
- Astro's [language tools](https://github.com/withastro/language-tools), the editor tooling required for the Astro language (`.astro` files).
30+
- Astro's [language tools](https://github.com/withastro/astro/tree/main/packages/language-tools), the editor tooling required for the Astro language (`.astro` files).
3131

3232
- [Starlight](https://github.com/withastro/starlight), Astro's official documentation framework.
3333

src/content/docs/es/reference/errors/unknown-vite-error.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ Vite encontró un error desconocido mientras renderizaba tu proyecto. Desafortun
1515
Si puedes reproducir de forma confiable este error, nos gustaría que [abrieras una issue](https://astro.build/issues/)
1616

1717
**Ver también:**
18-
- [Guía de solución de problemas de Vite](https://vite.dev/guide/troubleshooting.html)
18+
- [Guía de solución de problemas de Vite](https://es.vite.dev/guide/troubleshooting)

src/content/docs/fr/reference/error-reference.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ La référence suivante est une liste complète des erreurs que vous pouvez renc
4545
- [**InvalidImageService**](/fr/reference/errors/invalid-image-service/)<br/>Erreur lors du chargement du service d'image.
4646
- [**MissingImageDimension**](/fr/reference/errors/missing-image-dimension/)<br/>Dimensions de l'image manquantes
4747
- [**FailedToFetchRemoteImageDimensions**](/fr/reference/errors/failed-to-fetch-remote-image-dimensions/)<br/>Échec de la récupération des dimensions de l'image distante
48+
- [**RemoteImageNotAllowed**](/fr/reference/errors/remote-image-not-allowed/)<br/>L'image distante n'est pas autorisée
4849
- [**UnsupportedImageFormat**](/fr/reference/errors/unsupported-image-format/)<br/>Format d'image non pris en charge
4950
- [**UnsupportedImageConversion**](/fr/reference/errors/unsupported-image-conversion/)<br/>Conversion d'image non prise en charge.
5051
- [**PrerenderDynamicEndpointPathCollide**](/fr/reference/errors/prerender-dynamic-endpoint-path-collide/)<br/>Le point de terminaison dynamique généré entre en collision avec une autre route.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: L'image distante n'est pas autorisée
3+
i18nReady: true
4+
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5+
---
6+
7+
> Remote image `IMAGE_URL` is not allowed by your image configuration.
8+
9+
## Qu'est-ce qui a mal tourné ?
10+
L'URL de l'image distante ne correspond pas aux paramètres `image.domains` ou `image.remotePatterns` que vous avez configurés.
Lines changed: 293 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,293 @@
1+
---
2+
title: インテグレーションの追加
3+
description: Astroプロジェクトにインテグレーションを追加する方法を学びます。
4+
sidebar:
5+
label: インテグレーションの概要
6+
i18nReady: true
7+
---
8+
9+
import IntegrationsNav from '~/components/IntegrationsNav.astro';
10+
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro';
11+
import { Steps } from '@astrojs/starlight/components';
12+
13+
14+
**Astroのインテグレーション**により、わずか数行のコードでプロジェクトに新たな機能や動作を追加できます。公式のインテグレーションだけでなく、[コミュニティが作成したもの](#その他のインテグレーションを探す)を使用したり、[独自にカスタムインテグレーションを作成する](#独自のインテグレーションを作成する)ことも可能です。
15+
16+
インテグレーションにより以下のようなことができます。
17+
18+
- [レンダラー](/ja/guides/framework-components/)により、React、Vue、Svelte、Solidなど人気のUIフレームワークを使用する。
19+
- [SSRアダプター](/ja/guides/on-demand-rendering/)により、オンデマンドレンダリングを有効にする。
20+
- MDXやPartytownなどのツールをわずか数行のコードで組み込む。
21+
- サイトマップの自動生成など、プロジェクトに新しい機能を追加する。
22+
- ビルドプロセスや開発サーバーなどにフックするカスタムコードを記述する。
23+
24+
:::tip[インテグレーションディレクトリ]
25+
[インテグレーションディレクトリ](https://astro.build/integrations/)では、数百もの公式・コミュニティインテグレーションを閲覧・検索できます。認証、アナリティクス、パフォーマンス、SEO、アクセシビリティ、UI、開発者ツールなど、あなたのAstroプロジェクトに追加したいパッケージを見つけましょう。
26+
:::
27+
28+
## 公式インテグレーション
29+
30+
以下のインテグレーションはAstroによってメンテナンスされています。
31+
32+
<IntegrationsNav />
33+
34+
## インテグレーションの自動セットアップ
35+
36+
Astroには、公式インテグレーションのセットアップを自動化する`astro add`コマンドがあります。いくつかのコミュニティプラグインもこのコマンドで追加できます。`astro add`がサポートされているかどうかは、各インテグレーションのドキュメントを確認してください。サポートされていない場合は[手動でインストール](#手動インストール)する必要があります。
37+
38+
お好みのパッケージマネージャーで`astro add`コマンドを実行すると、自動インテグレーションウィザードが設定ファイルを更新し、必要な依存関係をインストールします。
39+
40+
<PackageManagerTabs>
41+
<Fragment slot="npm">
42+
```shell
43+
npx astro add react
44+
```
45+
</Fragment>
46+
<Fragment slot="pnpm">
47+
```shell
48+
pnpm astro add react
49+
```
50+
</Fragment>
51+
<Fragment slot="yarn">
52+
```shell
53+
yarn astro add react
54+
```
55+
</Fragment>
56+
</PackageManagerTabs>
57+
58+
同時に複数のインテグレーションを追加することも可能です!
59+
60+
<PackageManagerTabs>
61+
<Fragment slot="npm">
62+
```shell
63+
npx astro add react sitemap partytown
64+
```
65+
</Fragment>
66+
<Fragment slot="pnpm">
67+
```shell
68+
pnpm astro add react sitemap partytown
69+
```
70+
</Fragment>
71+
<Fragment slot="yarn">
72+
```shell
73+
yarn astro add react sitemap partytown
74+
```
75+
</Fragment>
76+
</PackageManagerTabs>
77+
78+
:::note[インテグレーションの依存関係の扱い]
79+
インテグレーションの追加後に`Cannot find package '[package-name]'`のような警告が表示された場合、パッケージマネージャーが[peer dependencies](https://nodejs.org/en/blog/npm/peer-dependencies/)をインストールしていない可能性があります。不足しているパッケージをインストールするには、以下のコマンドを実行してください。
80+
81+
<PackageManagerTabs>
82+
<Fragment slot="npm">
83+
```shell
84+
npm install [package-name]
85+
```
86+
</Fragment>
87+
<Fragment slot="pnpm">
88+
```shell
89+
pnpm add [package-name]
90+
```
91+
</Fragment>
92+
<Fragment slot="yarn">
93+
```shell
94+
yarn add [package-name]
95+
```
96+
</Fragment>
97+
</PackageManagerTabs>
98+
:::
99+
100+
### 手動インストール
101+
102+
Astroのインテグレーションは、常に`astro.config.mjs`ファイルの`integrations`プロパティを通じて追加します。
103+
104+
Astroプロジェクトにインテグレーションをインポートするには、主に3つの方法があります。
105+
106+
1. [npmパッケージのインテグレーションをインストール](#npmパッケージのインストール)する。
107+
2. プロジェクト内のローカルファイルから独自のインテグレーションをインポートする。
108+
3. 設定ファイルに直接インラインで記述する。
109+
110+
```js
111+
// astro.config.mjs
112+
import { defineConfig } from 'astro/config';
113+
import installedIntegration from '@astrojs/vue';
114+
import localIntegration from './my-integration.js';
115+
116+
export default defineConfig({
117+
integrations: [
118+
// 1. インストール済みのnpmパッケージからインポート
119+
installedIntegration(),
120+
// 2. ローカルのJSファイルからインポート
121+
localIntegration(),
122+
// 3. インラインオブジェクト
123+
{name: 'namespace:id', hooks: { /* ... */ }},
124+
]
125+
});
126+
```
127+
128+
インテグレーションの記述方法については、[インテグレーションAPI](/ja/reference/integrations-reference/)リファレンスを確認してください。
129+
130+
#### NPMパッケージのインストール
131+
132+
パッケージマネージャーを使用してNPMパッケージのインテグレーションをインストールし、`astro.config.mjs`を手動で更新します。
133+
134+
たとえば、`@astrojs/sitemap`インテグレーションをインストールするには次のようにします。
135+
136+
<Steps>
137+
1. お好みのパッケージマネージャーを使用して、プロジェクトの依存関係にインテグレーションをインストールします。
138+
139+
<PackageManagerTabs>
140+
<Fragment slot="npm">
141+
```shell
142+
npm install @astrojs/sitemap
143+
```
144+
</Fragment>
145+
<Fragment slot="pnpm">
146+
```shell
147+
pnpm add @astrojs/sitemap
148+
```
149+
</Fragment>
150+
<Fragment slot="yarn">
151+
```shell
152+
yarn add @astrojs/sitemap
153+
```
154+
</Fragment>
155+
</PackageManagerTabs>
156+
157+
2. `astro.config.mjs`ファイルにインテグレーションをインポートし、その他の設定オプションとともに`integrations[]`配列に追加します。
158+
159+
```js title="astro.config.mjs" ins={2} ins="sitemap()"
160+
import { defineConfig } from 'astro/config';
161+
import sitemap from '@astrojs/sitemap';
162+
163+
export default defineConfig({
164+
// ...
165+
integrations: [sitemap()],
166+
// ...
167+
});
168+
```
169+
170+
インテグレーションによって設定項目が異なる場合があります。各インテグレーションのドキュメントを確認し、必要な設定オプションを`astro.config.mjs`で適用してください。
171+
</Steps>
172+
173+
### カスタムオプション
174+
175+
インテグレーションは、ほぼ常にファクトリ関数として作成され、実際のインテグレーションオブジェクトを返します。これにより、ファクトリ関数に引数やオプションを渡して、プロジェクトに合わせたカスタマイズが可能です。
176+
177+
```js
178+
integrations: [
179+
// 例: 関数の引数でインテグレーションをカスタマイズ
180+
sitemap({filter: true})
181+
]
182+
```
183+
184+
### インテグレーションの切り替え
185+
186+
falsyなインテグレーションは無視されるため、`undefined`や真偽値を気にすることなく、インテグレーションのオン・オフを切り替えられます。
187+
188+
```js
189+
integrations: [
190+
// 例: Windowsではサイトマップのビルドをスキップ
191+
process.platform !== 'win32' && sitemap()
192+
]
193+
```
194+
195+
## インテグレーションの更新
196+
197+
すべての公式インテグレーションを一度に更新するには、`@astrojs/upgrade`コマンドを実行します。これにより、Astroとすべての公式インテグレーションが最新バージョンに更新されます。
198+
199+
### 自動アップグレード
200+
201+
<PackageManagerTabs>
202+
<Fragment slot="npm">
203+
```shell
204+
# Astroと公式インテグレーションを最新バージョンにアップグレード
205+
npx @astrojs/upgrade
206+
```
207+
</Fragment>
208+
<Fragment slot="pnpm">
209+
```shell
210+
# Astroと公式インテグレーションを最新バージョンにアップグレード
211+
pnpm dlx @astrojs/upgrade
212+
```
213+
</Fragment>
214+
<Fragment slot="yarn">
215+
```shell
216+
# Astroと公式インテグレーションを最新バージョンにアップグレード
217+
yarn dlx @astrojs/upgrade
218+
```
219+
</Fragment>
220+
</PackageManagerTabs>
221+
222+
### 手動アップグレード
223+
224+
1つ以上のインテグレーションを手動でアップグレードするには、パッケージマネージャーに応じたコマンドを使用します。
225+
226+
<PackageManagerTabs>
227+
<Fragment slot="npm">
228+
```shell
229+
# 例: ReactとPartytownのインテグレーションをアップグレード
230+
npm install @astrojs/react@latest @astrojs/partytown@latest
231+
```
232+
</Fragment>
233+
<Fragment slot="pnpm">
234+
```shell
235+
# 例: ReactとPartytownのインテグレーションをアップグレード
236+
pnpm add @astrojs/react@latest @astrojs/partytown@latest
237+
```
238+
</Fragment>
239+
<Fragment slot="yarn">
240+
```shell
241+
# 例: ReactとPartytownのインテグレーションをアップグレード
242+
yarn add @astrojs/react@latest @astrojs/partytown@latest
243+
```
244+
</Fragment>
245+
</PackageManagerTabs>
246+
247+
## インテグレーションの削除
248+
249+
<Steps>
250+
1. インテグレーションを削除するには、まずプロジェクトからインテグレーションをアンインストールします。
251+
252+
<PackageManagerTabs>
253+
<Fragment slot="npm">
254+
```shell
255+
npm uninstall @astrojs/react
256+
```
257+
</Fragment>
258+
<Fragment slot="pnpm">
259+
```shell
260+
pnpm remove @astrojs/react
261+
```
262+
</Fragment>
263+
<Fragment slot="yarn">
264+
```shell
265+
yarn remove @astrojs/react
266+
```
267+
</Fragment>
268+
</PackageManagerTabs>
269+
270+
2. 次に、`astro.config.*`ファイルからインテグレーションを削除します。
271+
272+
```js title="astro.config.mjs" del={3,7}
273+
import { defineConfig } from 'astro/config';
274+
275+
import react from '@astrojs/react';
276+
277+
export default defineConfig({
278+
integrations: [
279+
react()
280+
]
281+
});
282+
```
283+
</Steps>
284+
285+
## その他のインテグレーションを探す
286+
287+
コミュニティによって開発された多くのインテグレーションを[Astroインテグレーションディレクトリ](https://astro.build/integrations/)で見つけることができます。詳しい使い方や設定方法については、各リンク先を参照してください。
288+
289+
## 独自のインテグレーションを作成する
290+
291+
AstroのインテグレーションAPIはRollupやViteに影響を受けており、RollupやViteのプラグインを書いたことがある人にとって馴染みやすい設計になっています。
292+
293+
インテグレーションでできることやその作成方法については、[インテグレーションAPI](/ja/reference/integrations-reference/)リファレンスを確認してください。

src/content/docs/ja/reference/errors/client-address-not-available.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/
1111
使用しているアダプターは、`Astro.clientAddress`をサポートしていません。
1212

1313
**以下も参照してください:**
14-
- [公式インテグレーション](/ja/guides/integrations-guide/#official-integrations)
14+
- [公式インテグレーション](/ja/guides/integrations-guide/#公式インテグレーション)
1515
- [Astro.clientAddress](/ja/reference/api-reference/#clientaddress)
1616

1717

src/content/docs/ja/reference/errors/no-matching-renderer.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ JSXとTSXファイルには、[@astrojs/react](/ja/guides/integrations-guide/rea
1414

1515
**以下も参照してください:**
1616
- [フレームワークコンポーネント](/ja/guides/framework-components/)
17-
- [UIフレームワーク](/ja/guides/integrations-guide/#official-integrations)
17+
- [UIフレームワーク](/ja/guides/integrations-guide/#公式インテグレーション)
1818

1919

0 commit comments

Comments
 (0)