@aku11i/phantom 0.6.0 → 0.8.0

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.ja.md CHANGED
@@ -215,7 +215,7 @@ phantom shell feature-awesome # 機能開発を続行
215
215
 
216
216
  ## ⚙️ 設定
217
217
 
218
- Phantomはリポジトリルートの`phantom.config.json`ファイルによる設定をサポートします。これにより、新しいworktreeを作成する際に自動的にコピーされるファイルを定義できます。
218
+ Phantomはリポジトリルートの`phantom.config.json`ファイルによる設定をサポートします。これにより、新しいworktreeを作成する際に自動的にコピーされるファイルの定義や、実行されるコマンドを設定できます。
219
219
 
220
220
  ### 設定ファイル
221
221
 
@@ -228,6 +228,10 @@ Phantomはリポジトリルートの`phantom.config.json`ファイルによる
228
228
  ".env",
229
229
  ".env.local",
230
230
  "config/local.json"
231
+ ],
232
+ "commands": [
233
+ "pnpm install",
234
+ "pnpm build"
231
235
  ]
232
236
  }
233
237
  }
@@ -256,6 +260,32 @@ Phantomはリポジトリルートの`phantom.config.json`ファイルによる
256
260
 
257
261
  > **注意:** 現在、globパターンはサポートされていません。ファイルはリポジトリルートからの相対パスで正確に指定する必要があります。
258
262
 
263
+ ### 作成後コマンド
264
+
265
+ Phantomは新しいworktreeを作成した後に自動的にコマンドを実行できます。これは以下のような場合に便利です:
266
+
267
+ - 依存関係のインストール(`pnpm install`、`npm install`、`yarn install`)
268
+ - プロジェクトのビルド
269
+ - 開発環境のセットアップ
270
+ - データベースマイグレーションの実行
271
+ - プロジェクト固有のその他のセットアップタスク
272
+
273
+ コマンドは設定ファイルで指定された順序で実行されます。コマンドが失敗した場合、作成プロセスは停止し、エラーが報告されます。
274
+
275
+ 使用例:
276
+ ```json
277
+ {
278
+ "postCreate": {
279
+ "commands": [
280
+ "pnpm install", // 依存関係をインストール
281
+ "pnpm db:migrate", // データベースマイグレーションを実行
282
+ "cp .env.example .env", // テンプレートから環境ファイルを作成
283
+ "pnpm build" // プロジェクトをビルド
284
+ ]
285
+ }
286
+ }
287
+ ```
288
+
259
289
  ## 🛠️ 開発
260
290
 
261
291
  ```bash
@@ -333,8 +363,8 @@ Phantomの新しいバージョンをリリースするには:
333
363
  ```
334
364
 
335
365
  7. **リリースノートを分かりやすく更新**
336
- - 自動生成されたリリースノートをレビュー
337
- - 重要な詳細についてはPRの説明を確認
366
+ - 自動生成されたリリースノートを`gh release view v<version>`でレビュー
367
+ - 重要な詳細についてはPRの説明を`gh pr view <number>`で確認
338
368
  - リリースノートをよりユーザーフレンドリーに更新:
339
369
  - 変更をカテゴリー別にグループ化(機能、バグ修正、改善)
340
370
  - 新機能には使用例を追加
package/README.md CHANGED
@@ -218,7 +218,7 @@ phantom shell feature-awesome # Continue feature development
218
218
 
219
219
  ## ⚙️ Configuration
220
220
 
221
- Phantom supports configuration through a `phantom.config.json` file in your repository root. This allows you to define files to be automatically copied when creating new worktrees.
221
+ Phantom supports configuration through a `phantom.config.json` file in your repository root. This allows you to define files to be automatically copied and commands to be executed when creating new worktrees.
222
222
 
223
223
  ### Configuration File
224
224
 
@@ -231,6 +231,10 @@ Create a `phantom.config.json` file in your repository root:
231
231
  ".env",
232
232
  ".env.local",
233
233
  "config/local.json"
234
+ ],
235
+ "commands": [
236
+ "pnpm install",
237
+ "pnpm build"
234
238
  ]
235
239
  }
236
240
  }
@@ -259,6 +263,32 @@ You can specify files to copy in two ways:
259
263
 
260
264
  > **Note:** Currently, glob patterns are not supported. Files must be specified with their exact paths relative to the repository root.
261
265
 
266
+ ### Post-Create Commands
267
+
268
+ Phantom can automatically execute commands after creating a new worktree. This is useful for:
269
+
270
+ - Installing dependencies (`pnpm install`, `npm install`, `yarn install`)
271
+ - Building the project
272
+ - Setting up the development environment
273
+ - Running database migrations
274
+ - Any other setup tasks specific to your project
275
+
276
+ Commands are executed in the order they are specified in the configuration file. If a command fails, the creation process will stop and report the error.
277
+
278
+ Example use cases:
279
+ ```json
280
+ {
281
+ "postCreate": {
282
+ "commands": [
283
+ "pnpm install", // Install dependencies
284
+ "pnpm db:migrate", // Run database migrations
285
+ "cp .env.example .env", // Create environment file from template
286
+ "pnpm build" // Build the project
287
+ ]
288
+ }
289
+ }
290
+ ```
291
+
262
292
  ## 🛠️ Development
263
293
 
264
294
  ```bash
@@ -336,8 +366,8 @@ To release a new version of Phantom:
336
366
  ```
337
367
 
338
368
  7. **Update release notes for clarity**
339
- - Review the auto-generated release notes
340
- - Check PR descriptions for important details
369
+ - Review the auto-generated release notes using `gh release view v<version>`
370
+ - Check PR descriptions for important details using `gh pr view <number>`
341
371
  - Update the release notes to be more user-friendly:
342
372
  - Group changes by category (Features, Bug Fixes, Improvements)
343
373
  - Add usage examples for new features