@intlayer/docs 7.5.9 → 7.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -2
- package/dist/cjs/generated/docs.entry.cjs +57 -0
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +57 -0
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/types/generated/docs.entry.d.ts +3 -0
- package/dist/types/generated/docs.entry.d.ts.map +1 -1
- package/docs/ar/cli/ci.md +137 -0
- package/docs/ar/cli/index.md +7 -1
- package/docs/ar/cli/list.md +39 -2
- package/docs/ar/cli/list_projects.md +131 -0
- package/docs/ar/cli/push.md +1 -1
- package/docs/ar/configuration.md +3 -3
- package/docs/ar/interest_of_intlayer.md +1 -1
- package/docs/ar/intlayer_CMS.md +25 -5
- package/docs/ar/intlayer_with_express.md +1 -0
- package/docs/ar/intlayer_with_fastify.md +516 -0
- package/docs/ar/readme.md +1 -1
- package/docs/de/cli/ci.md +137 -0
- package/docs/de/cli/index.md +7 -1
- package/docs/de/cli/list.md +39 -2
- package/docs/de/cli/list_projects.md +130 -0
- package/docs/de/cli/push.md +1 -1
- package/docs/de/configuration.md +3 -3
- package/docs/de/interest_of_intlayer.md +1 -1
- package/docs/de/intlayer_CMS.md +25 -5
- package/docs/de/intlayer_with_express.md +1 -0
- package/docs/de/intlayer_with_fastify.md +449 -0
- package/docs/de/readme.md +1 -1
- package/docs/en/cli/ci.md +137 -0
- package/docs/en/cli/index.md +14 -1
- package/docs/en/cli/list.md +39 -2
- package/docs/en/cli/list_projects.md +128 -0
- package/docs/en/cli/push.md +1 -1
- package/docs/en/configuration.md +3 -3
- package/docs/en/interest_of_intlayer.md +2 -2
- package/docs/en/intlayer_CMS.md +25 -5
- package/docs/en/intlayer_with_express.md +1 -0
- package/docs/en/intlayer_with_fastify.md +439 -0
- package/docs/en/readme.md +3 -1
- package/docs/en-GB/cli/ci.md +137 -0
- package/docs/en-GB/cli/index.md +7 -1
- package/docs/en-GB/cli/list.md +39 -2
- package/docs/en-GB/cli/list_projects.md +130 -0
- package/docs/en-GB/cli/push.md +1 -1
- package/docs/en-GB/configuration.md +3 -3
- package/docs/en-GB/interest_of_intlayer.md +1 -1
- package/docs/en-GB/intlayer_CMS.md +25 -5
- package/docs/en-GB/intlayer_with_express.md +1 -0
- package/docs/en-GB/intlayer_with_fastify.md +445 -0
- package/docs/en-GB/readme.md +3 -1
- package/docs/es/cli/ci.md +137 -0
- package/docs/es/cli/index.md +7 -1
- package/docs/es/cli/list.md +39 -2
- package/docs/es/cli/list_projects.md +130 -0
- package/docs/es/cli/push.md +1 -1
- package/docs/es/configuration.md +3 -3
- package/docs/es/interest_of_intlayer.md +1 -1
- package/docs/es/intlayer_CMS.md +25 -5
- package/docs/es/intlayer_with_express.md +1 -0
- package/docs/es/intlayer_with_fastify.md +480 -0
- package/docs/es/readme.md +1 -1
- package/docs/fr/cli/ci.md +137 -0
- package/docs/fr/cli/index.md +7 -1
- package/docs/fr/cli/list.md +39 -2
- package/docs/fr/cli/list_projects.md +131 -0
- package/docs/fr/cli/push.md +1 -1
- package/docs/fr/configuration.md +3 -3
- package/docs/fr/interest_of_intlayer.md +1 -1
- package/docs/fr/intlayer_CMS.md +25 -5
- package/docs/fr/intlayer_with_express.md +1 -0
- package/docs/fr/intlayer_with_fastify.md +439 -0
- package/docs/fr/readme.md +1 -1
- package/docs/hi/cli/ci.md +137 -0
- package/docs/hi/cli/index.md +7 -1
- package/docs/hi/cli/list.md +38 -1
- package/docs/hi/cli/list_projects.md +130 -0
- package/docs/hi/cli/push.md +1 -1
- package/docs/hi/configuration.md +3 -3
- package/docs/hi/interest_of_intlayer.md +1 -1
- package/docs/hi/intlayer_CMS.md +25 -5
- package/docs/hi/intlayer_with_express.md +1 -0
- package/docs/hi/intlayer_with_fastify.md +540 -0
- package/docs/hi/readme.md +1 -1
- package/docs/id/cli/ci.md +137 -0
- package/docs/id/cli/index.md +7 -1
- package/docs/id/cli/list.md +38 -1
- package/docs/id/cli/list_projects.md +128 -0
- package/docs/id/cli/push.md +1 -1
- package/docs/id/configuration.md +3 -3
- package/docs/id/interest_of_intlayer.md +1 -1
- package/docs/id/intlayer_CMS.md +25 -5
- package/docs/id/intlayer_with_express.md +1 -0
- package/docs/id/intlayer_with_fastify.md +470 -0
- package/docs/id/readme.md +1 -1
- package/docs/it/cli/ci.md +137 -0
- package/docs/it/cli/index.md +7 -1
- package/docs/it/cli/list.md +39 -2
- package/docs/it/cli/list_projects.md +130 -0
- package/docs/it/cli/push.md +1 -1
- package/docs/it/configuration.md +3 -3
- package/docs/it/interest_of_intlayer.md +1 -1
- package/docs/it/intlayer_CMS.md +25 -5
- package/docs/it/intlayer_with_express.md +1 -0
- package/docs/it/intlayer_with_fastify.md +445 -0
- package/docs/it/readme.md +1 -1
- package/docs/ja/cli/ci.md +137 -0
- package/docs/ja/cli/index.md +7 -1
- package/docs/ja/cli/list.md +38 -1
- package/docs/ja/cli/list_projects.md +136 -0
- package/docs/ja/cli/push.md +1 -1
- package/docs/ja/configuration.md +3 -3
- package/docs/ja/interest_of_intlayer.md +1 -1
- package/docs/ja/intlayer_CMS.md +25 -5
- package/docs/ja/intlayer_with_express.md +1 -0
- package/docs/ja/intlayer_with_fastify.md +516 -0
- package/docs/ja/readme.md +1 -1
- package/docs/ko/cli/ci.md +137 -0
- package/docs/ko/cli/index.md +7 -1
- package/docs/ko/cli/list.md +38 -1
- package/docs/ko/cli/list_projects.md +128 -0
- package/docs/ko/cli/push.md +1 -1
- package/docs/ko/configuration.md +3 -3
- package/docs/ko/interest_of_intlayer.md +1 -1
- package/docs/ko/intlayer_CMS.md +25 -5
- package/docs/ko/intlayer_with_express.md +1 -0
- package/docs/ko/intlayer_with_fastify.md +463 -0
- package/docs/ko/readme.md +1 -1
- package/docs/pl/cli/ci.md +137 -0
- package/docs/pl/cli/index.md +7 -1
- package/docs/pl/cli/list.md +39 -2
- package/docs/pl/cli/list_projects.md +130 -0
- package/docs/pl/cli/push.md +1 -1
- package/docs/pl/configuration.md +3 -3
- package/docs/pl/interest_of_intlayer.md +1 -1
- package/docs/pl/intlayer_CMS.md +25 -5
- package/docs/pl/intlayer_with_express.md +1 -0
- package/docs/pl/intlayer_with_fastify.md +457 -0
- package/docs/pl/readme.md +1 -1
- package/docs/pt/cli/ci.md +137 -0
- package/docs/pt/cli/index.md +7 -1
- package/docs/pt/cli/list.md +39 -2
- package/docs/pt/cli/list_projects.md +134 -0
- package/docs/pt/cli/push.md +1 -1
- package/docs/pt/configuration.md +3 -3
- package/docs/pt/interest_of_intlayer.md +1 -1
- package/docs/pt/intlayer_CMS.md +25 -5
- package/docs/pt/intlayer_with_express.md +1 -0
- package/docs/pt/intlayer_with_fastify.md +502 -0
- package/docs/pt/readme.md +1 -1
- package/docs/ru/cli/ci.md +137 -0
- package/docs/ru/cli/index.md +7 -1
- package/docs/ru/cli/list.md +39 -2
- package/docs/ru/cli/list_projects.md +130 -0
- package/docs/ru/cli/push.md +1 -1
- package/docs/ru/configuration.md +3 -3
- package/docs/ru/interest_of_intlayer.md +1 -1
- package/docs/ru/intlayer_CMS.md +25 -5
- package/docs/ru/intlayer_with_express.md +1 -0
- package/docs/ru/intlayer_with_fastify.md +468 -0
- package/docs/ru/readme.md +1 -1
- package/docs/tr/cli/ci.md +137 -0
- package/docs/tr/cli/index.md +7 -1
- package/docs/tr/cli/list.md +39 -2
- package/docs/tr/cli/list_projects.md +134 -0
- package/docs/tr/cli/push.md +1 -1
- package/docs/tr/configuration.md +3 -3
- package/docs/tr/interest_of_intlayer.md +1 -1
- package/docs/tr/intlayer_CMS.md +25 -5
- package/docs/tr/intlayer_with_express.md +1 -0
- package/docs/tr/intlayer_with_fastify.md +471 -0
- package/docs/tr/readme.md +1 -1
- package/docs/vi/cli/ci.md +137 -0
- package/docs/vi/cli/index.md +7 -1
- package/docs/vi/cli/list.md +38 -1
- package/docs/vi/cli/list_projects.md +130 -0
- package/docs/vi/cli/push.md +1 -1
- package/docs/vi/configuration.md +3 -3
- package/docs/vi/interest_of_intlayer.md +1 -1
- package/docs/vi/intlayer_CMS.md +25 -5
- package/docs/vi/intlayer_with_express.md +1 -0
- package/docs/vi/intlayer_with_fastify.md +490 -0
- package/docs/vi/readme.md +1 -1
- package/docs/zh/cli/ci.md +137 -0
- package/docs/zh/cli/index.md +7 -1
- package/docs/zh/cli/list.md +38 -1
- package/docs/zh/cli/list_projects.md +130 -0
- package/docs/zh/cli/push.md +1 -1
- package/docs/zh/configuration.md +3 -3
- package/docs/zh/interest_of_intlayer.md +1 -1
- package/docs/zh/intlayer_CMS.md +25 -5
- package/docs/zh/intlayer_with_express.md +1 -0
- package/docs/zh/intlayer_with_fastify.md +451 -0
- package/docs/zh/readme.md +1 -1
- package/package.json +6 -6
- package/src/generated/docs.entry.ts +57 -0
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2025-12-30
|
|
3
|
+
updatedAt: 2025-12-30
|
|
4
|
+
title: Fastifyバックエンドを翻訳する方法 – i18nガイド 2026
|
|
5
|
+
description: Fastifyバックエンドを多言語対応にする方法を解説します。国際化(i18n)と翻訳の手順に従ってください。
|
|
6
|
+
keywords:
|
|
7
|
+
- 国際化 (Internationalization)
|
|
8
|
+
- ドキュメント (Documentation)
|
|
9
|
+
- Intlayer
|
|
10
|
+
- Fastify
|
|
11
|
+
- JavaScript
|
|
12
|
+
- バックエンド (Backend)
|
|
13
|
+
slugs:
|
|
14
|
+
- doc
|
|
15
|
+
- environment
|
|
16
|
+
- fastify
|
|
17
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-fastify-template
|
|
18
|
+
history:
|
|
19
|
+
- version: 7.6.0
|
|
20
|
+
date: 2025-12-31
|
|
21
|
+
changes: initコマンドを追加
|
|
22
|
+
- version: 7.6.0
|
|
23
|
+
date: 2025-12-31
|
|
24
|
+
changes: 履歴を初期化
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# Intlayerを使ってFastifyバックエンドサイトを翻訳する | 国際化 (i18n)
|
|
28
|
+
|
|
29
|
+
`fastify-intlayer` は、Fastifyアプリケーション向けの強力な国際化(i18n)プラグインで、クライアントの設定に基づいてローカライズされたレスポンスを提供し、バックエンドサービスをグローバルに利用可能にすることを目的としています。
|
|
30
|
+
|
|
31
|
+
### 実用的なユースケース
|
|
32
|
+
|
|
33
|
+
- **ユーザーの言語でバックエンドエラーを表示する**: エラー発生時にユーザーの母国語でメッセージを表示することで理解が深まり、フラストレーションを軽減します。これは、トーストやモーダルなどフロントエンドコンポーネントで表示される動的なエラーメッセージに特に有用です。
|
|
34
|
+
|
|
35
|
+
`fastify-intlayer` は Fastify アプリケーション向けの強力な国際化 (i18n) プラグインで、クライアントの設定に基づいてローカライズされたレスポンスを返すことでバックエンドサービスをグローバルに利用可能にすることを目的としています。
|
|
36
|
+
|
|
37
|
+
### 実用的なユースケース
|
|
38
|
+
|
|
39
|
+
- **ユーザーの言語でバックエンドエラーを表示する**: エラー発生時にユーザーの母語でメッセージを表示することで理解が深まり、混乱や不満を軽減できます。これは、トーストやモーダルのようなフロントエンドコンポーネントで表示される動的なエラーメッセージに特に有用です。
|
|
40
|
+
- **多言語コンテンツの取得**: データベースからコンテンツを取得するアプリケーションでは、国際化によりそのコンテンツを複数言語で配信できます。これは、商品説明や記事、その他のコンテンツをユーザーの希望する言語で表示する必要があるECサイトやコンテンツ管理システムのようなプラットフォームにとって重要です。
|
|
41
|
+
- **多言語コンテンツの取得**: データベースからコンテンツを取得するアプリケーションでは、国際化によりそのコンテンツを複数の言語で配信できます。これは、商品説明、記事、その他のコンテンツをユーザーが好む言語で表示する必要があるeコマースサイトやコンテンツ管理システム(CMS)などのプラットフォームにとって重要です。
|
|
42
|
+
- **多言語メールの送信**: 取引メール、マーケティングキャンペーン、通知など、受信者の言語でメールを送ることで、エンゲージメントや効果が大幅に向上します。
|
|
43
|
+
- **多言語プッシュ通知**: モバイルアプリケーションでは、ユーザーの好む言語でプッシュ通知を送信することで、エンゲージメントとリテンションを向上させることができます。このパーソナルな配慮により、通知がより関連性が高く行動を促しやすく感じられます。
|
|
44
|
+
- **その他のコミュニケーション**: SMS メッセージ、システムアラート、ユーザーインターフェイスの更新など、バックエンドから送られるあらゆる形式のコミュニケーションは、ユーザーの言語で提供されることで明確さが増し、全体的なユーザー体験が向上します。
|
|
45
|
+
|
|
46
|
+
バックエンドを国際化することで、アプリケーションは文化的差異を尊重するだけでなく、グローバル市場のニーズにもより適合し、サービスを世界規模でスケールさせるための重要なステップとなります。
|
|
47
|
+
|
|
48
|
+
## はじめに
|
|
49
|
+
|
|
50
|
+
### インストール
|
|
51
|
+
|
|
52
|
+
`fastify-intlayer` の使用を開始するには、npm を使ってパッケージをインストールします:
|
|
53
|
+
|
|
54
|
+
```bash packageManager="npm"
|
|
55
|
+
npm install intlayer fastify-intlayer
|
|
56
|
+
npx intlayer init
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```bash packageManager="pnpm"
|
|
61
|
+
pnpm add intlayer fastify-intlayer
|
|
62
|
+
pnpm intlayer init
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
```bash packageManager="yarn"
|
|
67
|
+
yarn add intlayer fastify-intlayer
|
|
68
|
+
yarn intlayer init
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```bash packageManager="bun"
|
|
73
|
+
bun add intlayer fastify-intlayer
|
|
74
|
+
bunx intlayer init
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### セットアップ
|
|
79
|
+
|
|
80
|
+
プロジェクトルートに `intlayer.config.ts` を作成し、国際化の設定を構成します:
|
|
81
|
+
|
|
82
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
83
|
+
import { Locales, type IntlayerConfig } from "intlayer";
|
|
84
|
+
|
|
85
|
+
// 国際化設定
|
|
86
|
+
const config: IntlayerConfig = {
|
|
87
|
+
internationalization: {
|
|
88
|
+
// サポートするロケールを指定
|
|
89
|
+
locales: [
|
|
90
|
+
Locales.ENGLISH,
|
|
91
|
+
Locales.FRENCH,
|
|
92
|
+
Locales.SPANISH_MEXICO,
|
|
93
|
+
Locales.SPANISH_SPAIN,
|
|
94
|
+
],
|
|
95
|
+
// デフォルトのロケールを指定
|
|
96
|
+
defaultLocale: Locales.ENGLISH,
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export default config;
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
104
|
+
import { Locales } from "intlayer";
|
|
105
|
+
|
|
106
|
+
// 国際化設定(ESM)
|
|
107
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
108
|
+
const config = {
|
|
109
|
+
internationalization: {
|
|
110
|
+
// サポートするロケールを指定
|
|
111
|
+
locales: [
|
|
112
|
+
Locales.ENGLISH,
|
|
113
|
+
Locales.FRENCH,
|
|
114
|
+
Locales.SPANISH_MEXICO,
|
|
115
|
+
Locales.SPANISH_SPAIN,
|
|
116
|
+
],
|
|
117
|
+
// デフォルトのロケールを指定
|
|
118
|
+
defaultLocale: Locales.ENGLISH,
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export default config;
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
126
|
+
const { Locales } = require("intlayer");
|
|
127
|
+
|
|
128
|
+
// 国際化設定(CommonJS)
|
|
129
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
130
|
+
const config = {
|
|
131
|
+
internationalization: {
|
|
132
|
+
// サポートするロケールを指定
|
|
133
|
+
locales: [
|
|
134
|
+
Locales.ENGLISH,
|
|
135
|
+
Locales.FRENCH,
|
|
136
|
+
Locales.SPANISH_MEXICO,
|
|
137
|
+
Locales.SPANISH_SPAIN,
|
|
138
|
+
],
|
|
139
|
+
defaultLocale: Locales.ENGLISH,
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export default config;
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
147
|
+
import { Locales } from "intlayer";
|
|
148
|
+
|
|
149
|
+
/** @type {import('intlayer').IntlayerConfig} */ // IntlayerConfig 型注釈
|
|
150
|
+
const config = {
|
|
151
|
+
internationalization: {
|
|
152
|
+
locales: [
|
|
153
|
+
Locales.ENGLISH,
|
|
154
|
+
Locales.FRENCH,
|
|
155
|
+
Locales.SPANISH_MEXICO,
|
|
156
|
+
Locales.SPANISH_SPAIN,
|
|
157
|
+
],
|
|
158
|
+
defaultLocale: Locales.ENGLISH,
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export default config;
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
166
|
+
const { Locales } = require("intlayer");
|
|
167
|
+
|
|
168
|
+
/** @type {import('intlayer').IntlayerConfig} */ // IntlayerConfig 型注釈
|
|
169
|
+
const config = {
|
|
170
|
+
internationalization: {
|
|
171
|
+
locales: [
|
|
172
|
+
Locales.ENGLISH,
|
|
173
|
+
Locales.FRENCH,
|
|
174
|
+
Locales.SPANISH_MEXICO,
|
|
175
|
+
Locales.SPANISH_SPAIN,
|
|
176
|
+
],
|
|
177
|
+
defaultLocale: Locales.ENGLISH,
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
module.exports = config;
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### コンテンツを宣言する
|
|
185
|
+
|
|
186
|
+
翻訳を保存するためのコンテンツ宣言を作成および管理します:
|
|
187
|
+
|
|
188
|
+
```typescript fileName="src/index.content.ts" contentDeclarationFormat="typescript"
|
|
189
|
+
import { t, type Dictionary } from "intlayer";
|
|
190
|
+
|
|
191
|
+
const indexContent = {
|
|
192
|
+
key: "index",
|
|
193
|
+
content: {
|
|
194
|
+
exampleOfContent: t({
|
|
195
|
+
ja: "英語で返されるコンテンツの例",
|
|
196
|
+
en: "Example of returned content in English",
|
|
197
|
+
fr: "Exemple de contenu renvoyé en français",
|
|
198
|
+
"es-ES": "Ejemplo de contenido devuelto en español (España)",
|
|
199
|
+
"es-MX": "Ejemplo de contenido devuelto en español (México)",
|
|
200
|
+
}),
|
|
201
|
+
},
|
|
202
|
+
} satisfies Dictionary;
|
|
203
|
+
|
|
204
|
+
export default indexContent;
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
```javascript fileName="src/index.content.mjs" contentDeclarationFormat="esm"
|
|
208
|
+
import { t } from "intlayer";
|
|
209
|
+
|
|
210
|
+
/** @type {import('intlayer').Dictionary} */
|
|
211
|
+
const indexContent = {
|
|
212
|
+
key: "index",
|
|
213
|
+
content: {
|
|
214
|
+
exampleOfContent: t({
|
|
215
|
+
ja: "英語で返されるコンテンツの例",
|
|
216
|
+
en: "Example of returned content in English",
|
|
217
|
+
fr: "Exemple de contenu renvoyé en français",
|
|
218
|
+
"es-ES": "Ejemplo de contenido devuelto en español (España)",
|
|
219
|
+
"es-MX": "Ejemplo de contenido devuelto en español (México)",
|
|
220
|
+
}),
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
export default indexContent;
|
|
225
|
+
|
|
226
|
+
/** @type {import('intlayer').Dictionary} */
|
|
227
|
+
const indexContent = {
|
|
228
|
+
key: "index",
|
|
229
|
+
content: {
|
|
230
|
+
exampleOfContent: t({
|
|
231
|
+
ja: "英語で返されるコンテンツの例",
|
|
232
|
+
en: "Example of returned content in English",
|
|
233
|
+
fr: "Exemple de contenu renvoyé en français",
|
|
234
|
+
"es-ES": "Ejemplo de contenido devuelto en español (España)",
|
|
235
|
+
"es-MX": "Ejemplo de contenido devuelto en español (México)",
|
|
236
|
+
}),
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
export default indexContent;
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
```javascript fileName="src/index.content.cjs" contentDeclarationFormat="commonjs"
|
|
244
|
+
const { t } = require("intlayer");
|
|
245
|
+
|
|
246
|
+
/** @type {import('intlayer').Dictionary} */
|
|
247
|
+
const indexContent = {
|
|
248
|
+
key: "index",
|
|
249
|
+
content: {
|
|
250
|
+
exampleOfContent: t({
|
|
251
|
+
ja: "英語で返されるコンテンツの例",
|
|
252
|
+
en: "Example of returned content in English",
|
|
253
|
+
fr: "Exemple de contenu renvoyé en français",
|
|
254
|
+
ja: "返されるコンテンツの例(英語)",
|
|
255
|
+
"es-ES": "Ejemplo de contenido devuelto en español (España)",
|
|
256
|
+
"es-MX": "Ejemplo de contenido devuelto en español (México)",
|
|
257
|
+
}),
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
module.exports = indexContent;
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
```json fileName="src/index.content.json" contentDeclarationFormat="json"
|
|
265
|
+
{
|
|
266
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
267
|
+
"key": "index",
|
|
268
|
+
"content": {
|
|
269
|
+
"exampleOfContent": {
|
|
270
|
+
"nodeType": "translation",
|
|
271
|
+
"translation": {
|
|
272
|
+
"ja": "返されるコンテンツの例(英語)",
|
|
273
|
+
"en": "Example of returned content in English",
|
|
274
|
+
"fr": "Exemple de contenu renvoyé en français",
|
|
275
|
+
"es-ES": "Ejemplo de contenido devuelto en español (España)",
|
|
276
|
+
"es-MX": "Ejemplo de contenido devuelto en español (México)"
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
> コンテンツ宣言は、アプリケーション内の任意の場所に定義できます。ただし `contentDir` ディレクトリ(デフォルトは `./src`)に含まれている必要があります。また、コンテンツ宣言ファイルの拡張子は(デフォルトで)`.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}` に一致する必要があります。
|
|
284
|
+
|
|
285
|
+
> 詳細は[コンテンツ宣言のドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/dictionary/content_file.md)を参照してください。
|
|
286
|
+
|
|
287
|
+
### Fastify アプリケーションのセットアップ
|
|
288
|
+
|
|
289
|
+
Fastify アプリケーションを `fastify-intlayer` を使用するように設定します:
|
|
290
|
+
|
|
291
|
+
```typescript fileName="src/index.ts" codeFormat="typescript"
|
|
292
|
+
import Fastify from "fastify";
|
|
293
|
+
import { intlayer, t, getDictionary, getIntlayer } from "fastify-intlayer";
|
|
294
|
+
import dictionaryExample from "./index.content";
|
|
295
|
+
|
|
296
|
+
const fastify = Fastify({ logger: true });
|
|
297
|
+
|
|
298
|
+
javascript fileName="src/index.mjs" codeFormat="esm"
|
|
299
|
+
// 国際化プラグインを読み込む
|
|
300
|
+
await fastify.register(intlayer);
|
|
301
|
+
|
|
302
|
+
// ルート
|
|
303
|
+
fastify.get("/t_example", async (_req, reply) => {
|
|
304
|
+
return t({
|
|
305
|
+
ja: "日本語で返されるコンテンツの例",
|
|
306
|
+
en: "Example of returned content in English",
|
|
307
|
+
fr: "Exemple de contenu renvoyé en français",
|
|
308
|
+
"es-ES": "Ejemplo de contenido devuelto en español (España)",
|
|
309
|
+
"es-MX": "Ejemplo de contenido devuelto en español (México)",
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
fastify.get("/getIntlayer_example", async (_req, reply) => {
|
|
314
|
+
return getIntlayer("index").exampleOfContent;
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
fastify.get("/getDictionary_example", async (_req, reply) => {
|
|
318
|
+
return getDictionary(dictionaryExample).exampleOfContent;
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
// サーバーを起動
|
|
322
|
+
const start = async () => {
|
|
323
|
+
try {
|
|
324
|
+
await fastify.listen({ port: 3000 });
|
|
325
|
+
} catch (err) {
|
|
326
|
+
fastify.log.error(err);
|
|
327
|
+
process.exit(1);
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
start();
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
```javascript fileName="src/index.mjs" codeFormat="esm"
|
|
335
|
+
import Fastify from "fastify";
|
|
336
|
+
import { intlayer, t, getDictionary, getIntlayer } from "fastify-intlayer";
|
|
337
|
+
import dictionaryExample from "./index.content";
|
|
338
|
+
|
|
339
|
+
const fastify = Fastify({ logger: true });
|
|
340
|
+
|
|
341
|
+
// 国際化プラグインを登録
|
|
342
|
+
await fastify.register(intlayer);
|
|
343
|
+
|
|
344
|
+
// ルート
|
|
345
|
+
fastify.get("/t_example", async (_req, reply) => {
|
|
346
|
+
return t({
|
|
347
|
+
ja: "英語で返されるコンテンツの例",
|
|
348
|
+
en: "Example of returned content in English",
|
|
349
|
+
fr: "Exemple de contenu renvoyé en français",
|
|
350
|
+
"es-ES": "Ejemplo de contenido devuelto en español (España)",
|
|
351
|
+
"es-MX": "Ejemplo de contenido devuelto en español (México)",
|
|
352
|
+
});
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
fastify.get("/getIntlayer_example", async (_req, reply) => {
|
|
356
|
+
return getIntlayer("index").exampleOfContent;
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
fastify.get("/getDictionary_example", async (_req, reply) => {
|
|
360
|
+
return getDictionary(dictionaryExample).exampleOfContent;
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
// サーバーを起動
|
|
364
|
+
const start = async () => {
|
|
365
|
+
try {
|
|
366
|
+
await fastify.listen({ port: 3000 });
|
|
367
|
+
} catch (err) {
|
|
368
|
+
fastify.log.error(err);
|
|
369
|
+
process.exit(1);
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
start();
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
```javascript fileName="src/index.cjs" codeFormat="commonjs"
|
|
377
|
+
const Fastify = require("fastify");
|
|
378
|
+
const { intlayer, t, getDictionary, getIntlayer } = require("fastify-intlayer");
|
|
379
|
+
const dictionaryExample = require("./index.content");
|
|
380
|
+
|
|
381
|
+
const fastify = Fastify({ logger: true });
|
|
382
|
+
|
|
383
|
+
// async/await 用のサーバー起動ラッパー
|
|
384
|
+
const start = async () => {
|
|
385
|
+
try {
|
|
386
|
+
// 国際化プラグインを登録
|
|
387
|
+
await fastify.register(intlayer);
|
|
388
|
+
|
|
389
|
+
// ルート
|
|
390
|
+
fastify.get("/t_example", async (_req, reply) => {
|
|
391
|
+
return t({
|
|
392
|
+
ja: "返却されるコンテンツの例(英語)",
|
|
393
|
+
en: "Example of returned content in English",
|
|
394
|
+
fr: "Exemple de contenu renvoyé en français",
|
|
395
|
+
"es-ES": "Ejemplo de contenido devuelto en español (España)",
|
|
396
|
+
"es-MX": "Ejemplo de contenido devuelto en español (México)",
|
|
397
|
+
});
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
fastify.get("/getIntlayer_example", async (_req, reply) => {
|
|
401
|
+
return getIntlayer("index").exampleOfContent;
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
fastify.get("/getDictionary_example", async (_req, reply) => {
|
|
405
|
+
return getDictionary(dictionaryExample).exampleOfContent;
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
await fastify.listen({ port: 3000 });
|
|
409
|
+
} catch (err) {
|
|
410
|
+
fastify.log.error(err);
|
|
411
|
+
process.exit(1);
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
start();
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### 互換性
|
|
419
|
+
|
|
420
|
+
`fastify-intlayer` は以下と完全に互換性があります:
|
|
421
|
+
|
|
422
|
+
- [`react-intlayer`](<https://www.google.com/search?q=%5Bhttps://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/packages/react-intlayer/index.md%5D(https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/packages/react-intlayer/index.md)>) Reactアプリケーション用
|
|
423
|
+
- [`next-intlayer`](<https://www.google.com/search?q=%5Bhttps://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/packages/next-intlayer/index.md%5D(https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/packages/next-intlayer/index.md)>) Next.jsアプリケーション用
|
|
424
|
+
- [`vite-intlayer`](<https://www.google.com/search?q=%5Bhttps://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/packages/vite-intlayer/index.md%5D(https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/packages/vite-intlayer/index.md)>) Vite アプリケーション向け
|
|
425
|
+
|
|
426
|
+
また、ブラウザや API リクエストを含むさまざまな環境で、任意の国際化ソリューションとシームレスに動作します。ミドルウェアをカスタマイズして、ヘッダーやクッキーからロケールを検出するようにできます:
|
|
427
|
+
|
|
428
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
429
|
+
import { Locales, type IntlayerConfig } from "intlayer";
|
|
430
|
+
|
|
431
|
+
const config: IntlayerConfig = {
|
|
432
|
+
// ... その他の設定オプション
|
|
433
|
+
middleware: {
|
|
434
|
+
headerName: "my-locale-header",
|
|
435
|
+
cookieName: "my-locale-cookie",
|
|
436
|
+
},
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
export default config;
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
443
|
+
import { Locales } from "intlayer";
|
|
444
|
+
|
|
445
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
446
|
+
const config = {
|
|
447
|
+
// ... 他の設定オプション
|
|
448
|
+
middleware: {
|
|
449
|
+
headerName: "my-locale-header",
|
|
450
|
+
cookieName: "my-locale-cookie",
|
|
451
|
+
},
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
export default config;
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
458
|
+
const { Locales } = require("intlayer");
|
|
459
|
+
|
|
460
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
461
|
+
const config = {
|
|
462
|
+
// ... 他の設定オプション
|
|
463
|
+
middleware: {
|
|
464
|
+
headerName: "my-locale-header",
|
|
465
|
+
cookieName: "my-locale-cookie",
|
|
466
|
+
},
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
module.exports = config;
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
デフォルトでは、`fastify-intlayer` はクライアントの優先言語を判定するために `Accept-Language` ヘッダーを解釈します。
|
|
473
|
+
|
|
474
|
+
> 設定や高度なトピックの詳細については、[ドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/configuration.md)を参照してください。
|
|
475
|
+
|
|
476
|
+
### TypeScript の設定
|
|
477
|
+
|
|
478
|
+
`fastify-intlayer` は TypeScript の強力な機能を活用して国際化プロセスを強化します。TypeScript の静的型付けにより、すべての翻訳キーが網羅されていることが保証され、翻訳漏れのリスクが低減され、保守性が向上します。
|
|
479
|
+
|
|
480
|
+
自動生成される型(デフォルトでは ./types/intlayer.d.ts)を tsconfig.json ファイルに含めていることを確認してください。
|
|
481
|
+
|
|
482
|
+
```json5 fileName="tsconfig.json"
|
|
483
|
+
{
|
|
484
|
+
// ... 既存の TypeScript 設定
|
|
485
|
+
"include": [
|
|
486
|
+
// ... 既存の TypeScript 設定
|
|
487
|
+
".intlayer/**/*.ts", // 自動生成された型を含める
|
|
488
|
+
],
|
|
489
|
+
}
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
### VS Code 拡張機能
|
|
493
|
+
|
|
494
|
+
Intlayerでの開発体験を向上させるために、公式の **Intlayer VS Code Extension** をインストールできます。
|
|
495
|
+
|
|
496
|
+
[VS Code Marketplace からインストール](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
497
|
+
|
|
498
|
+
この拡張機能は以下を提供します:
|
|
499
|
+
|
|
500
|
+
- **翻訳キーのオートコンプリート**。
|
|
501
|
+
- **翻訳の欠落に対するリアルタイムエラー検出**。
|
|
502
|
+
- **翻訳コンテンツのインラインプレビュー**。
|
|
503
|
+
- **翻訳を簡単に作成・更新するためのクイックアクション**。
|
|
504
|
+
|
|
505
|
+
拡張機能の使い方の詳細については、[Intlayer VS Code Extension のドキュメント](https://intlayer.org/doc/vs-code-extension)を参照してください。
|
|
506
|
+
|
|
507
|
+
### Git 設定
|
|
508
|
+
|
|
509
|
+
Intlayerによって生成されるファイルは無視することを推奨します。これにより、それらをGitリポジトリにコミットするのを回避できます。
|
|
510
|
+
|
|
511
|
+
これを行うには、次の指示を `.gitignore` ファイルに追加できます:
|
|
512
|
+
|
|
513
|
+
```plaintext fileName=".gitignore"
|
|
514
|
+
# Intlayer によって生成されたファイルを無視する
|
|
515
|
+
.intlayer
|
|
516
|
+
```
|
package/docs/ja/readme.md
CHANGED
|
@@ -50,7 +50,7 @@ Intlayerは、ウェブおよびモバイルアプリ向けの**最新のi18nソ
|
|
|
50
50
|
| 機能 | 説明 |
|
|
51
51
|
| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
52
52
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/frameworks.png?raw=true" alt="Feature" width="700"> | **クロスフレームワーク対応**<br><br>Intlayerは、Next.js、React、Vite、Vue.js、Nuxt、Preact、Expressなど、主要なフレームワークやライブラリすべてに対応しています。 |
|
|
53
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/javascript_content_management.
|
|
53
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/javascript_content_management.jpg?raw=true" alt="Feature" width="700"> | **JavaScript駆動のコンテンツ管理**<br><br>JavaScriptの柔軟性を活用して、コンテンツを効率的に定義および管理します。<br><br> - [コンテンツ宣言](https://intlayer.org/doc/concept/content) |
|
|
54
54
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/per_locale_content_declaration_file.png?raw=true" alt="Feature" width="700"> | **ロケール別コンテンツ宣言ファイル**<br><br>自動生成の前にコンテンツを一度宣言することで、開発をスピードアップします。<br><br> - [ロケール別コンテンツ宣言ファイル](https://intlayer.org/doc/concept/per-locale-file) |
|
|
55
55
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true" alt="Feature" width="700"> | **型安全な環境**<br><br>TypeScriptを活用して、コンテンツ定義やコードのエラーを防ぎつつ、IDEの自動補完機能も利用できます。<br><br> - [TypeScriptの設定](https://intlayer.org/doc/environment/vite-and-react#configure-typescript) |
|
|
56
56
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/config_file.png?raw=true" alt="Feature" width="700"> | **簡素化されたセットアップ**<br><br>最小限の設定で迅速に開始できます。国際化、ルーティング、AI、ビルド、コンテンツ処理の設定を簡単に調整可能です。<br><br> - [Next.js統合を探る](https://intlayer.org/doc/environment/nextjs) |
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2026-01-06
|
|
3
|
+
updatedAt: 2026-01-06
|
|
4
|
+
title: CI 명령어
|
|
5
|
+
description: CI/CD 파이프라인 및 모노레포에서 자동으로 주입된 자격 증명으로 Intlayer 명령어를 실행하는 방법을 알아보세요.
|
|
6
|
+
keywords:
|
|
7
|
+
- CI
|
|
8
|
+
- CI/CD
|
|
9
|
+
- 자동화
|
|
10
|
+
- 모노레포
|
|
11
|
+
- 자격 증명
|
|
12
|
+
- CLI
|
|
13
|
+
- Intlayer
|
|
14
|
+
slugs:
|
|
15
|
+
- doc
|
|
16
|
+
- concept
|
|
17
|
+
- cli
|
|
18
|
+
- ci
|
|
19
|
+
history:
|
|
20
|
+
- version: 7.5.11
|
|
21
|
+
date: 2026-01-06
|
|
22
|
+
changes: CI 명령어 추가
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# CI 명령어
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx intlayer ci <command...>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
CI 명령어는 자동화 및 CI/CD 파이프라인을 위해 설계되었습니다. `INTLAYER_PROJECT_CREDENTIALS` 환경 변수에서 자격 증명을 자동으로 주입하고 모노레포의 여러 프로젝트에서 Intlayer 명령어를 실행할 수 있습니다.
|
|
32
|
+
|
|
33
|
+
## 작동 방식
|
|
34
|
+
|
|
35
|
+
CI 명령어는 두 가지 모드로 작동합니다:
|
|
36
|
+
|
|
37
|
+
1. **단일 프로젝트 모드**: 현재 작업 디렉토리가 `INTLAYER_PROJECT_CREDENTIALS`의 프로젝트 경로 중 하나와 일치하는 경우, 해당 특정 프로젝트에 대해서만 명령어를 실행합니다.
|
|
38
|
+
|
|
39
|
+
2. **반복 모드**: 특정 프로젝트 컨텍스트가 감지되지 않으면 모든 구성된 프로젝트를 반복하고 각 프로젝트에 대해 명령어를 실행합니다.
|
|
40
|
+
|
|
41
|
+
## 환경 변수
|
|
42
|
+
|
|
43
|
+
명령어는 `INTLAYER_PROJECT_CREDENTIALS` 환경 변수가 설정되어 있어야 합니다. 이 변수는 프로젝트 경로를 자격 증명에 매핑하는 JSON 객체를 포함해야 합니다:
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"packages/app": {
|
|
48
|
+
"clientId": "your-client-id-1",
|
|
49
|
+
"clientSecret": "your-client-secret-1"
|
|
50
|
+
},
|
|
51
|
+
"packages/admin": {
|
|
52
|
+
"clientId": "your-client-id-2",
|
|
53
|
+
"clientSecret": "your-client-secret-2"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## 패키지 관리자 감지
|
|
59
|
+
|
|
60
|
+
CI 명령어는 `npm_config_user_agent` 환경 변수를 기반으로 사용 중인 패키지 관리자(npm, yarn, pnpm 또는 bun)를 자동으로 감지하고 Intlayer를 실행하는 데 적절한 명령어를 사용합니다.
|
|
61
|
+
|
|
62
|
+
## 인수
|
|
63
|
+
|
|
64
|
+
- **`<command...>`**: 실행할 Intlayer 명령어(예: `fill`, `push`, `build`). 모든 Intlayer 명령어와 해당 인수를 전달할 수 있습니다.
|
|
65
|
+
|
|
66
|
+
> 예: `npx intlayer ci fill --verbose`
|
|
67
|
+
>
|
|
68
|
+
> 예: `npx intlayer ci push`
|
|
69
|
+
>
|
|
70
|
+
> 예: `npx intlayer ci build`
|
|
71
|
+
|
|
72
|
+
## 예제
|
|
73
|
+
|
|
74
|
+
### 단일 프로젝트 모드에서 명령어 실행
|
|
75
|
+
|
|
76
|
+
`INTLAYER_PROJECT_CREDENTIALS`의 경로 중 하나와 일치하는 프로젝트 디렉토리에 있는 경우:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
cd packages/app
|
|
80
|
+
npx intlayer ci fill
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
이렇게 하면 `packages/app` 프로젝트에 대해 자격 증명이 자동으로 주입되어 `fill` 명령어가 실행됩니다.
|
|
84
|
+
|
|
85
|
+
### 모든 프로젝트에서 명령어 실행
|
|
86
|
+
|
|
87
|
+
프로젝트 경로와 일치하지 않는 디렉토리에 있는 경우, 명령어는 모든 구성된 프로젝트를 반복합니다:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
cd /path/to/monorepo
|
|
91
|
+
npx intlayer ci push
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
이렇게 하면 `INTLAYER_PROJECT_CREDENTIALS`에 구성된 각 프로젝트에 대해 `push` 명령어가 실행됩니다.
|
|
95
|
+
|
|
96
|
+
### 추가 플래그 전달
|
|
97
|
+
|
|
98
|
+
기본 Intlayer 명령어에 모든 플래그를 전달할 수 있습니다:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npx intlayer ci fill --verbose --mode complete
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### CI/CD 파이프라인에서 사용
|
|
105
|
+
|
|
106
|
+
CI/CD 구성(예: GitHub Actions, GitLab CI)에서 `INTLAYER_PROJECT_CREDENTIALS`를 비밀 값으로 설정합니다:
|
|
107
|
+
|
|
108
|
+
```yaml
|
|
109
|
+
# GitHub Actions 예제
|
|
110
|
+
env:
|
|
111
|
+
INTLAYER_PROJECT_CREDENTIALS: ${{ secrets.INTLAYER_PROJECT_CREDENTIALS }}
|
|
112
|
+
|
|
113
|
+
steps:
|
|
114
|
+
- name: 사전 채우기
|
|
115
|
+
run: npx intlayer ci fill
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## 오류 처리
|
|
119
|
+
|
|
120
|
+
- `INTLAYER_PROJECT_CREDENTIALS`가 설정되지 않은 경우, 명령어는 오류로 종료됩니다.
|
|
121
|
+
- `INTLAYER_PROJECT_CREDENTIALS`가 유효한 JSON이 아닌 경우, 명령어는 오류로 종료됩니다.
|
|
122
|
+
- 프로젝트 경로가 존재하지 않는 경우, 경고와 함께 건너뜁니다.
|
|
123
|
+
- 프로젝트가 실패한 경우, 명령어는 0이 아닌 상태 코드로 종료됩니다.
|
|
124
|
+
|
|
125
|
+
## 사용 사례
|
|
126
|
+
|
|
127
|
+
- **모노레포 자동화**: 모노레포의 여러 프로젝트에서 Intlayer 명령어 실행
|
|
128
|
+
- **CI/CD 파이프라인**: 지속적 통합 워크플로우에서 사전 관리 자동화
|
|
129
|
+
- **일괄 작업**: 여러 Intlayer 프로젝트에 대해 동일한 작업을 한 번에 수행
|
|
130
|
+
- **비밀 관리**: 환경 변수를 사용하여 여러 프로젝트의 자격 증명을 안전하게 관리
|
|
131
|
+
|
|
132
|
+
## 보안 모범 사례
|
|
133
|
+
|
|
134
|
+
- CI/CD 플랫폼에서 `INTLAYER_PROJECT_CREDENTIALS`를 암호화된 비밀 값으로 저장
|
|
135
|
+
- 자격 증명을 버전 관리에 커밋하지 않기
|
|
136
|
+
- 다양한 배포 환경에 대해 환경별 자격 증명 사용
|
|
137
|
+
- 정기적으로 자격 증명 로테이션
|