Skip to content
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
9 changes: 8 additions & 1 deletion src/content/docs/ko/guides/integrations-guide/alpinejs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ githubIntegrationURL: 'https://github.com/withastro/astro/tree/main/packages/int
category: renderer
i18nReady: true
---
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro';
import Since from '~/components/Since.astro';

이 **[Astro 통합][astro-integration]은** 프로젝트에 [Alpine.js](https://alpinejs.dev/)를 추가하므로 페이지 어디에서나 Alpine.js를 사용할 수 있습니다.

Expand Down Expand Up @@ -96,6 +97,12 @@ export default defineConfig({

### `entrypoint`

<p>

**타입:** `string`<br />
<Since v="0.4.0" pkg="@astrojs/alpinejs" />
</p>

`entrypoint` 옵션을 루트 상대 가져오기 지정자 (예: `entrypoint: "/src/entrypoint"`)로 설정하여 Alpine을 확장할 수 있습니다.

이 파일의 기본 내보내기는 시작하기 전에 Alpine 인스턴스를 허용하는 함수여야 합니다. 이를 통해 고급 사용 사례에 맞게 사용자 정의 지시어, 플러그인, 기타 맞춤 설정을 사용할 수 있습니다.
Expand Down
31 changes: 26 additions & 5 deletions src/content/docs/ko/guides/integrations-guide/db.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ export default defineConfig({

### `columns`

<p>

**타입:** `ColumnsConfig`
</p>

테이블 열은 `columns` 객체를 사용하여 구성됩니다.

```ts
Expand Down Expand Up @@ -184,6 +189,11 @@ type UserTableInferInsert = {

### `indexes`

<p>

**타입:** `{ on: string | string[]; unique?: boolean | undefined; name?: string | undefined; }[]`
</p>

테이블 인덱스는 특정 열 또는 열 조합에 대한 조회 속도를 향상시키는 데 사용됩니다. `indexes` 속성은 인덱스를 생성할 열을 지정하는 구성 객체의 배열을 값으로 전달받습니다.

```ts title="db/config.ts" {9-11}
Expand All @@ -205,12 +215,17 @@ const Comment = defineTable({

각 인덱스에 대해 다음 구성 옵션을 사용할 수 있습니다.

- `on`: `string | string[]` - 인덱싱할 단일 열 또는 열 이름 배열입니다.
- `unique`: `boolean` - 인덱스가 생성된 열 전체에 고유한 값을 적용하려면 `true`로 설정합니다.
- `name`: `string` (선택 사항) - 고유 인덱스의 사용자 정의 이름입니다. 이는 색인화되는 테이블 및 열 이름을 기반으로 Astro에서 생성된 이름을 재정의합니다 (예: `Comment_authorId_published_idx`). 사용자 정의 이름은 전역적이므로 인덱스 이름이 테이블 간에 충돌하지 않는지 확인하세요.
- `on` - 인덱싱할 단일 열 또는 열 이름 배열입니다.
- `unique` (선택 사항) - 인덱스가 생성된 열 전체에 고유한 값을 적용하려면 `true`로 설정합니다.
- `name` (선택 사항) - 고유 인덱스의 사용자 정의 이름입니다. 이는 색인화되는 테이블 및 열 이름을 기반으로 Astro에서 생성된 이름을 재정의합니다 (예: `Comment_authorId_published_idx`). 사용자 정의 이름은 전역적이므로 인덱스 이름이 테이블 간에 충돌하지 않는지 확인하세요.

### `foreignKeys`

<p>

**타입:** `{ columns: string | string[]; references: () => Column | Column[]; }[]`
</p>

:::tip

`foreignKeys`는 여러 테이블 열을 연결하기 위한 고급 API입니다. 단일 열만 참조해야 하는 경우 [열 `references` 속성](#columns)을 사용하세요.
Expand Down Expand Up @@ -246,8 +261,8 @@ const Comment = defineTable({

각 외래 키 구성 객체는 다음 속성을 허용합니다.

- `columns`: `string[]` - 참조된 테이블과 관련된 열 이름의 배열입니다.
- `references`: `() => Column[]` - 참조된 테이블에서 열 배열을 반환하는 함수입니다.
- `columns` - 참조된 테이블과 관련된 단일 열 또는 열 이름의 배열입니다.
- `references` - 참조된 테이블에서 단일 열 또는 열 배열을 반환하는 함수입니다.

## Astro DB CLI 참조

Expand Down Expand Up @@ -288,6 +303,12 @@ Astro DB에는 로컬 및 libSQL 호환 데이터베이스와 상호 작용하

### `isDbError()`

<p>

**타입:** `(err: unknown) => boolean`<br />
<Since v="0.9.1" pkg="@astrojs/db" />
</p>

`isDbError()` 함수는 오류가 libSQL 데이터베이스 예외인지 확인합니다. 여기에는 참조 사용 시 외래 키 제약 조건 오류가 포함되거나 데이터 삽입 시 필드 누락이 포함될 수 있습니다. `isDbError()`를 try / catch 블록과 결합하여 애플리케이션의 데이터베이스 오류를 처리할 수 있습니다.

```ts title="src/pages/api/comment/[id].ts" "idDbError"
Expand Down
18 changes: 16 additions & 2 deletions src/content/docs/ko/guides/integrations-guide/markdoc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ githubIntegrationURL: 'https://github.com/withastro/astro/tree/main/packages/int
category: other
i18nReady: true
---
import { FileTree } from '@astrojs/starlight/components';
import { FileTree, Steps } from '@astrojs/starlight/components';
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro';
import { Steps } from '@astrojs/starlight/components';
import ReadMore from '~/components/ReadMore.astro';
import Since from '~/components/Since.astro';

이 **[Astro 통합][astro-integration]을** 통해 [Markdoc](https://markdoc.dev/)을 사용하여 컴포넌트, 페이지 및 콘텐츠 컬렉션 항목을 생성할 수 있습니다.

Expand Down Expand Up @@ -589,6 +589,13 @@ Astro Markdoc 통합은 `markdoc.config.js` 파일을 통해 사용할 수 없

### `allowHTML`

<p>

**타입:** `boolean`<br />
**기본값:** `false`<br />
<Since v="0.4.4" pkg="@astrojs/markdoc" />
</p>

Markdoc 태그 및 노드와 함께 HTML 마크업 작성을 활성화합니다.

기본적으로 Markdoc은 HTML 마크업을 의미 있는 콘텐츠로 인식하지 않습니다.
Expand All @@ -611,6 +618,13 @@ Markdoc 태그 및 노드와 함께 HTML 마크업 작성을 활성화합니다.

### `ignoreIndentation`

<p>

**타입:** `boolean`<br />
**기본값:** `false`<br />
<Since v="0.7.0" pkg="@astrojs/markdoc" />
</p>

기본적으로 공백 4개로 들여쓰기된 모든 콘텐츠는 코드 블록으로 처리됩니다. 불행하게도 이 동작은 복잡한 구조를 가진 문서의 가독성을 향상시키기 위해 임의 수준의 들여쓰기를 사용하기 어렵게 만듭니다.

Markdoc에서 중첩 태그를 사용할 때 깊이 수준이 명확하도록 태그 내부의 내용을 들여쓰는 것이 도움이 될 수 있습니다. 임의 들여쓰기를 지원하려면 들여쓰기 기반 코드 블록을 비활성화하고 들여쓰기 기반 코드 블록을 설명하는 몇 가지 다른 markdown-it 구문 분석 규칙을 수정해야 합니다. 이러한 변경 사항은 ignoreIndentation 옵션을 활성화하여 적용할 수 있습니다.
Expand Down
29 changes: 24 additions & 5 deletions src/content/docs/ko/guides/integrations-guide/mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,12 @@ MDX는 remark 및 rehype 플러그인을 문자열로 전달하는 것을 지원

### `extendMarkdownConfig`

* **타입:** `boolean`
* **기본값:** `true`
<p>

**타입:** `boolean`<br />
**기본값:** `true`<br />
<Since v="0.15.0" pkg="@astrojs/mdx" />
</p>

MDX는 기본적으로 [프로젝트의 기존 Markdown 구성](/ko/reference/configuration-reference/#markdown-옵션)을 확장합니다. 개별 옵션을 재정의하려면 MDX 구성에서 해당 옵션을 지정하면 됩니다.

Expand Down Expand Up @@ -328,13 +332,25 @@ export default defineConfig({

### `recmaPlugins`

<p>

**타입:** `PluggableList`<br />
**기본값:** `[]`<br />
<Since v="0.11.5" pkg="@astrojs/mdx" />
</p>

출력되는 [estree](https://github.com/estree/estree)를 직접 수정하는 플러그인입니다. 이는 MDX 파일에서 JavaScript 변수를 수정하거나 삽입하는 데 유용합니다.

[AST Explorer를 사용](https://astexplorer.net/)하여 estree 출력을 수행하고 [`estree-util-visit`](https://unifiedjs.com/explore/package/estree-util-visit/)를 사용하여 JavaScript 노드를 검색하는 것이 좋습니다.

### `optimize`

* **타입:** `boolean | { ignoreElementNames?: string[] }`
<p>

**타입:** `boolean | { ignoreElementNames?: string[] }`<br />
**기본값:** `false`<br />
<Since v="0.19.5" pkg="@astrojs/mdx" />
</p>

이는 내부 rehype 플러그인을 통해 더 빠른 빌드 및 렌더링을 위해 MDX 출력을 최적화하기 위한 선택적 구성 설정입니다. MDX 파일이 많고 빌드 속도가 느린 경우에 유용할 수 있습니다. 그러나 이 옵션은 일부 이스케이프 처리되지 않은 HTML을 생성할 수 있으므로 활성화한 후에도 사이트의 대화형 부분이 여전히 올바르게 작동하는지 확인하세요.

Expand All @@ -356,9 +372,12 @@ export default defineConfig({

#### `ignoreElementNames`

* **타입:** `string[]`
<p>

**타입:** `string[]`<br />
<Since v="3.0.0" pkg="@astrojs/mdx" />
</p>

<p><Since pkg="@astrojs/mdx" v="3.0.0" /></p>
이전에는 `customComponentNames`로 알려졌습니다.

MDX 최적화 프로그램이 [컴포넌트 prop을 통해 가져온 MDX 콘텐츠에 전달된 사용자 정의 컴포넌트](/ko/guides/integrations-guide/mdx/#가져온-mdx를-사용하는-사용자-정의-컴포넌트)와 같은 특정 요소 이름을 처리하지 못하도록 방지하는 `optimize`의 선택적 속성입니다.
Expand Down
50 changes: 37 additions & 13 deletions src/content/docs/ko/guides/integrations-guide/node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ githubIntegrationURL: 'https://github.com/withastro/astro/tree/main/packages/int
category: adapter
i18nReady: true
---

import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'
import Since from '~/components/Since.astro';
import { Tabs, TabItem } from '@astrojs/starlight/components';

이 어댑터를 사용하면 Astro가 [서버 아일랜드](/ko/guides/server-islands/), [액션](/ko/guides/actions/), [세션](/ko/guides/sessions/)을 포함하여 [요청 시 렌더링되는 라우트 및 기능](/ko/guides/on-demand-rendering/)을 Node 대상에 배포할 수 있습니다.

Expand Down Expand Up @@ -282,18 +282,6 @@ HOST=0.0.0.0 PORT=4321 node ./dist/server/entry.mjs
SERVER_KEY_PATH=./private/key.pem SERVER_CERT_PATH=./private/cert.pem node ./dist/server/entry.mjs
```

#### 런타임 환경 변수

빌드 프로세스가 실행될 때 환경 변수가 포함된 `.env` 파일이 존재하는 경우 이러한 값은 정적 웹 사이트를 생성할 때와 마찬가지로 출력에 하드 코딩됩니다.

빌드하는 동안 런타임 변수는 `.env` 파일에 없어야 하며 런타임에 예상되는 모든 환경 변수를 Astro에 제공해야 합니다. (`VARIABLE_1=placeholder astro build`) 이는 빌드된 애플리케이션이 실행될 때 실제 값을 사용할 수 있다는 신호를 Astro에 보냅니다. placeholder 값은 빌드 프로세스에서 무시되며 Astro는 런타임에 제공된 값을 사용합니다.

런타임 변수가 여러 개인 경우 `.env` 파일에서 별도의 파일 (예: `.env.runtime`)에 옮겨 저장하세요. 다음 명령을 사용하여 빌드를 시작합니다.

```sh
export $(cat .env.runtime) && astro build
```

#### 자산

standalone 모드에서는 `dist/client/` 폴더의 자산이 standalone 서버를 통해 제공됩니다. 이러한 자산을 CDN에 배포할 수 있으며, 이 경우 서버는 실제로 해당 자산을 제공하지 않습니다. 그러나 인트라넷 사이트와 같은 일부 경우에는 애플리케이션 서버에서 직접 정적 자산을 제공하는 것이 좋습니다.
Expand All @@ -309,3 +297,39 @@ Cache-Control: public, max-age=31536000, immutable
[Astro 세션 API](/ko/guides/sessions/)를 사용하면 요청 간에 사용자 데이터를 쉽게 저장할 수 있습니다. 이는 사용자 데이터 및 설정, 쇼핑 카트, 인증 자격 증명 등에 활용될 수 있습니다. 쿠키 저장소와 달리 데이터 크기에 제한이 없으며, 다른 기기에서도 복원할 수도 있습니다.

Node 어댑터를 사용하는 경우 Astro는 세션 스토리지를 위해 로컬 파일 시스템을 사용합니다. 다른 세션 스토리지 드라이버를 사용하려면 Astro 구성에서 지정할 수 있습니다. 자세한 내용은 [`session` 구성 참조](/ko/reference/configuration-reference/#sessiondriver)를 확인하세요.

## 환경 변수

런타임 시 [`astro:env`](/ko/guides/environment-variables/#타입-안전-환경-변수) 비밀 또는 `process.env`를 사용할 경우, Astro나 어댑터 모두 환경 변수를 자동으로 로드하지 않습니다.

일부 호스트는 빌드 및 런타임에 대시보드를 통해 구성한 환경 변수를 노출할 수도 있습니다. 특정 플랫폼에서 환경 변수를 설정하고 사용하는 방법은 호스트의 문서를 참조하세요.

자체 호스팅을 하는 경우에는 CLI 명령어나 구성 파일을 통해 환경 변수를 로드할 수 있습니다.

<Tabs>
<TabItem label="인라인">
```shell
DB_HOST=... DB_PASSWORD=... node ./dist/server/entry.mjs
```
</TabItem>
<TabItem label="dotenvx">
```shell
npx dotenvx run -- node ./dist/server/entry.mjs
```
</TabItem>
<TabItem label="Docker">
```docker title="Dockerfile"
FROM node:lts AS runtime
WORKDIR /app

COPY . .

RUN npm install
RUN npm run build

ENV DB_HOST=...
ENV DB_PASSWORD=...
CMD node ./dist/server/entry.mjs
```
</TabItem>
</Tabs>
13 changes: 6 additions & 7 deletions src/content/docs/ko/guides/integrations-guide/partytown.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ githubIntegrationURL: 'https://github.com/withastro/astro/tree/main/packages/int
category: other
i18nReady: true
---

import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro';

이 **[Astro 통합][astro-integration]은** Astro 프로젝트에서 [Partytown](https://partytown.qwik.dev/)을 활성화합니다.
Expand Down Expand Up @@ -108,27 +107,27 @@ export default defineConfig({
});
```

이는 [Partytown 구성 객체](https://partytown.qwik.dev/configuration)를 미러링합니다.
이는 [Partytown 구성 객체](https://partytown.qwik.dev/configuration/)를 반영하며, 모든 옵션은 `partytown.config`에서 설정할 수 있습니다. Astro 프로젝트에 대한 일반적인 구성 옵션은 이 페이지에 설명되어 있습니다.

### config.debug
### 디버깅 모드 활성화하기

Partytown에는 `debug` 모드가 포함되어 있습니다. `config.debug`에 `true` 또는 `false`를 전달하여 활성화하거나 비활성화합니다. [`debug` 모드](https://partytown.qwik.dev/debugging)가 활성화되면 브라우저 콘솔에 자세한 로그가 출력됩니다.

기본적으로 이 옵션을 설정하지 않으면 [dev](/ko/reference/cli-reference/#astro-dev) 모드나 [preview](/ko/reference/cli-reference/#astro-preview) 모드에서 디버그 모드가 켜집니다.
기본적으로 이 옵션을 설정하지 않으면 [dev](/ko/reference/cli-reference/#astro-dev) 모드나 [preview](/ko/reference/cli-reference/#astro-preview) 모드에서 디버깅 모드가 켜집니다.

```js title="astro.config.mjs" {6}
export default defineConfig({
// ...
integrations: [
partytown({
// 예: 디버그 모드를 비활성화합니다.
// 예: 디버깅 모드를 비활성화합니다.
config: { debug: false },
}),
],
});
```

### config.forward
### 변수 전달하기

타사 스크립트는 일반적으로 `window` 객체에 변수를 추가하므로 사이트 전체에서 해당 객체와 통신할 수 있습니다. 그러나 웹 워커에 스크립트가 로드되면 해당 전역 `window` 객체에 액세스할 수 없습니다.

Expand All @@ -150,7 +149,7 @@ export default defineConfig({
});
```

### config.resolveUrl
### 요청 프록시 처리하기

일부 타사 스크립트는 서비스 워커에서 실행되는 `config.resolveUrl()`을 통한 [프록시](https://partytown.qwik.dev/proxying-requests/)가 필요할 수 있습니다. 이 구성 옵션을 설정하여 특정 URL을 확인하고, 대신 프록시된 URL을 선택적으로 반환할 수 있습니다.

Expand Down
17 changes: 13 additions & 4 deletions src/content/docs/ko/guides/integrations-guide/preact.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ githubIntegrationURL: 'https://github.com/withastro/astro/tree/main/packages/int
category: renderer
i18nReady: true
---

import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'
import Since from '~/components/Since.astro';

Expand Down Expand Up @@ -133,7 +132,13 @@ Astro Preact 통합은 Preact 컴포넌트가 렌더링되는 방식을 처리

기본 사용의 경우 Preact 통합을 구성할 필요가 없습니다.

### compat
### `compat`

<p>

**타입:** `boolean`<br />
<Since pkg="@astrojs/preact" v="0.3.0" />
</p>

React의 대규모 라이브러리를 사용자의 웹 브라우저에 설치하거나 제공할 필요 없이 React 컴포넌트를 렌더링하기 위한 Preact의 호환성 레이어인 `preact/compat`를 활성화할 수 있습니다.

Expand Down Expand Up @@ -167,9 +172,13 @@ React 컴포넌트 라이브러리를 가져올 때 `react` 및 `react-dom` 종
현재 `compat` 옵션은 코드를 ESM으로 내보내는 React 라이브러리에서만 작동합니다. 빌드 시 오류가 발생하면 `astro.config.mjs` 파일의 `vite.ssr.noExternal: ['the-react-library']`에 라이브러리를 추가해 보세요.
:::

### devtools
### `devtools`

<p>

<p><Since pkg="@astrojs/preact" v="3.3.0" /></p>
**타입:** `boolean`<br />
<Since pkg="@astrojs/preact" v="3.3.0" />
</p>

`devtools: true`가 포함된 객체를 `preact()` 통합 구성에 전달하여 개발 모드에서 [Preact devtools](https://preactjs.github.io/preact-devtools/)를 활성화할 수 있습니다.

Expand Down
8 changes: 6 additions & 2 deletions src/content/docs/ko/guides/integrations-guide/solid-js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,13 @@ Astro에서 첫 번째 SolidJS 컴포넌트를 사용하려면 [UI 프레임워

## 구성

### devtools
### `devtools`

<p><Since pkg="@astrojs/solid-js" v="4.2.0" /></p>
<p>

**타입:** `boolean`<br />
<Since pkg="@astrojs/solid-js" v="4.2.0" />
</p>

`devtools: true`가 포함된 객체를 `solid()` 통합 구성에 전달하고 프로젝트 종속성에 `solid-devtools`를 추가하여 개발 모드에서 [Solid DevTools](https://github.com/thetarnav/solid-devtools)를 활성화할 수 있습니다.

Expand Down
Loading