create-einja-app 0.2.11 → 0.2.13
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 +5 -5
- package/dist/cli.js +14 -1
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
- package/templates/default/.env.ci +11 -4
- package/templates/default/.env.preview +25 -0
- package/templates/default/.github/workflows/ci.yml +73 -1
- package/templates/default/AGENTS.md +3 -0
- package/templates/default/apps/web/src/lib/auth/index.ts +5 -0
- package/templates/default/scripts/env-show.ts +1 -0
- package/templates/default/scripts/lib/env-common.ts +6 -0
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Einja Management Templateを使用したプロジェクトを素早く作成す
|
|
|
9
9
|
### 主な機能
|
|
10
10
|
|
|
11
11
|
- 🚀 **新規プロジェクト作成**: `npx create-einja-app my-project` で即座にプロジェクトを作成
|
|
12
|
-
- 🛠️ **既存プロジェクトセットアップ**:
|
|
12
|
+
- 🛠️ **既存プロジェクトセットアップ**: `setup` サブコマンドで既存プロジェクトにツールを追加
|
|
13
13
|
- 🔧 **環境ツール統合**: direnv, dotenvx, Volta, Biome, Huskyなどのツールを自動セットアップ
|
|
14
14
|
- 🔐 **認証方式選択**: NextAuth.js を使用するか選択可能
|
|
15
15
|
- 🔄 **対話式プロンプト**: わかりやすいプロンプトで設定を選択
|
|
@@ -31,7 +31,7 @@ npx create-einja-app my-project
|
|
|
31
31
|
- プロジェクト名
|
|
32
32
|
- パッケージスコープ
|
|
33
33
|
- 認証機能(NextAuth.js を使用 / なし)
|
|
34
|
-
- @einja/cli自動セットアップ
|
|
34
|
+
- @einja/dev-cli自動セットアップ
|
|
35
35
|
- Worktree設定カスタマイズ
|
|
36
36
|
|
|
37
37
|
#### オプション付き実行
|
|
@@ -50,7 +50,7 @@ npx create-einja-app my-project --skip-install
|
|
|
50
50
|
```bash
|
|
51
51
|
# 現在のディレクトリにツールを追加
|
|
52
52
|
cd existing-project
|
|
53
|
-
npx create-einja-app
|
|
53
|
+
npx create-einja-app setup
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
対話式プロンプトが表示され、以下を選択できます:
|
|
@@ -83,7 +83,7 @@ npx create-einja-app --setup
|
|
|
83
83
|
npx create-einja-app my-project --skip-git
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
### `create-einja-app
|
|
86
|
+
### `create-einja-app setup`
|
|
87
87
|
|
|
88
88
|
既存プロジェクトにツールを追加します。
|
|
89
89
|
|
|
@@ -91,7 +91,7 @@ npx create-einja-app my-project --skip-git
|
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
93
|
cd existing-project
|
|
94
|
-
npx create-einja-app
|
|
94
|
+
npx create-einja-app setup
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
### `create-einja-app add [options]`
|
package/dist/cli.js
CHANGED
|
@@ -1272,15 +1272,19 @@ function mergeTextWithMarkers(templateContent, existingContent) {
|
|
|
1272
1272
|
}
|
|
1273
1273
|
const templateManagedById = /* @__PURE__ */ new Map();
|
|
1274
1274
|
const templateSeedById = /* @__PURE__ */ new Map();
|
|
1275
|
+
const templateManagedWithoutId = [];
|
|
1275
1276
|
const processedTemplateIds = /* @__PURE__ */ new Set();
|
|
1276
1277
|
for (const section of templateSections) {
|
|
1277
1278
|
if (section.type === "managed" && section.id) {
|
|
1278
1279
|
templateManagedById.set(section.id, section);
|
|
1280
|
+
} else if (section.type === "managed") {
|
|
1281
|
+
templateManagedWithoutId.push(section);
|
|
1279
1282
|
} else if (section.type === "seed" && section.id) {
|
|
1280
1283
|
templateSeedById.set(section.id, section);
|
|
1281
1284
|
}
|
|
1282
1285
|
}
|
|
1283
1286
|
const result = [];
|
|
1287
|
+
let managedWithoutIdIndex = 0;
|
|
1284
1288
|
for (const localSection of localSections) {
|
|
1285
1289
|
if (localSection.type === "managed") {
|
|
1286
1290
|
const match = localSection.id ? templateManagedById.get(localSection.id) : void 0;
|
|
@@ -1288,7 +1292,13 @@ function mergeTextWithMarkers(templateContent, existingContent) {
|
|
|
1288
1292
|
processedTemplateIds.add(localSection.id);
|
|
1289
1293
|
result.push(match.content);
|
|
1290
1294
|
} else if (!localSection.id) {
|
|
1291
|
-
|
|
1295
|
+
const noIdMatch = templateManagedWithoutId[managedWithoutIdIndex];
|
|
1296
|
+
if (noIdMatch) {
|
|
1297
|
+
result.push(noIdMatch.content);
|
|
1298
|
+
managedWithoutIdIndex += 1;
|
|
1299
|
+
} else {
|
|
1300
|
+
result.push(localSection.content);
|
|
1301
|
+
}
|
|
1292
1302
|
}
|
|
1293
1303
|
} else if (localSection.type === "seed") {
|
|
1294
1304
|
if (localSection.id) {
|
|
@@ -1304,6 +1314,9 @@ function mergeTextWithMarkers(templateContent, existingContent) {
|
|
|
1304
1314
|
result.push(section.content);
|
|
1305
1315
|
}
|
|
1306
1316
|
}
|
|
1317
|
+
for (const section of templateManagedWithoutId.slice(managedWithoutIdIndex)) {
|
|
1318
|
+
result.push(section.content);
|
|
1319
|
+
}
|
|
1307
1320
|
for (const [id, section] of templateSeedById) {
|
|
1308
1321
|
if (!processedTemplateIds.has(id)) {
|
|
1309
1322
|
result.push(section.content);
|