@wato787/microcms-cli 0.1.0 → 0.1.1

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 CHANGED
@@ -64,6 +64,7 @@ microcms-cli gen-types blog
64
64
  #### Required environment variables
65
65
 
66
66
  `gen-types` は **実行した利用者の環境変数** から設定を読み取ります。
67
+ カレントディレクトリの `.env` と `.env.local` を自動で読み込みます(`.env.local` は後から読み込むため、同名の変数を上書きします)。[dotenv](https://github.com/motdotla/dotenv) 使用。
67
68
  CLI引数で指定しない場合、以下の環境変数が必要です。
68
69
 
69
70
  ```bash
package/dist/index.js CHANGED
@@ -1,11 +1,15 @@
1
1
  #!/usr/bin/env node
2
+ import path from 'node:path';
3
+ import dotenv from 'dotenv';
4
+ dotenv.config();
5
+ dotenv.config({ path: path.resolve(process.cwd(), '.env.local') });
2
6
  import { Command } from 'commander';
3
7
  import { genTypesCommand } from './commands/gen-types/index.js';
4
8
  const program = new Command();
5
9
  program
6
10
  .name('microcms-cli')
7
11
  .description('CLI for microCMS')
8
- .version('0.1.0');
12
+ .version('0.1.1');
9
13
  program
10
14
  .command('gen-types [endpointId]')
11
15
  .description('Fetch API schema from microCMS Management API and generate TypeScript types')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wato787/microcms-cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "AI-friendly CLI tool for microCMS, built with Bun",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -24,6 +24,7 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "commander": "^12.0.0",
27
+ "dotenv": "^17.3.1",
27
28
  "picocolors": "^1.0.0"
28
29
  },
29
30
  "devDependencies": {