@k2works/claude-code-booster 1.6.0 → 1.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.
@@ -24,7 +24,7 @@ description: ビジネスアーキテクチャ分析を支援。要件定義の
24
24
 
25
25
  ### 4. 成果物
26
26
 
27
- - @docs/design/business_architecture.md - ビジネスアーキテクチャ分析書
27
+ - @docs/analysis/business_architecture.md - ビジネスアーキテクチャ分析書
28
28
 
29
29
  ### 5. 作業内容
30
30
 
File without changes
@@ -3,27 +3,27 @@
3
3
  import { execSync } from 'child_process';
4
4
  import fs from 'fs';
5
5
  import path from 'path';
6
-
7
- const isWindows = process.platform === 'win32';
6
+ import { cleanDockerEnv, isDockerAvailable, openUrl } from './shared.js';
8
7
 
9
8
  /**
10
- * Windows 環境で DOCKER_HOST を正規化した環境変数を返す
11
- * @returns {NodeJS.ProcessEnv}
9
+ * docker compose コマンドを実行
10
+ * @param {string} args - docker compose に渡す引数
12
11
  */
13
- function dockerEnv() {
14
- const env = { ...process.env };
15
- if (isWindows && env.DOCKER_HOST === 'npipe://./pipe/docker_engine') {
16
- env.DOCKER_HOST = 'npipe:////./pipe/docker_engine';
17
- }
18
- return env;
12
+ function dockerCompose(args) {
13
+ execSync(`docker compose ${args}`, { stdio: 'inherit', env: cleanDockerEnv() });
19
14
  }
20
15
 
21
16
  /**
22
- * docker compose コマンドを実行
23
- * @param {string} args - docker compose に渡す引数
17
+ * Docker が利用可能か確認し、不可なら警告メッセージを表示して false を返す
18
+ * @returns {boolean} Docker が利用可能なら true
24
19
  */
25
- function dockerCompose(args) {
26
- execSync(`docker compose ${args}`, { stdio: 'inherit', env: dockerEnv() });
20
+ function requireDocker() {
21
+ if (isDockerAvailable()) {
22
+ return true;
23
+ }
24
+ console.warn('Warning: Docker is not running. Skipping this task.');
25
+ console.warn('Please start Docker Desktop and try again.');
26
+ return false;
27
27
  }
28
28
 
29
29
  /**
@@ -32,6 +32,7 @@ function dockerCompose(args) {
32
32
  */
33
33
  export default function (gulp) {
34
34
  gulp.task('mkdocs:serve', (done) => {
35
+ if (!requireDocker()) { done(); return; }
35
36
  try {
36
37
  console.log('Starting MkDocs server...');
37
38
  dockerCompose('up -d mkdocs');
@@ -43,6 +44,7 @@ export default function (gulp) {
43
44
  });
44
45
 
45
46
  gulp.task('mkdocs:build', (done) => {
47
+ if (!requireDocker()) { done(); return; }
46
48
  try {
47
49
  console.log('Building MkDocs documentation...');
48
50
  const siteDir = path.join(process.cwd(), 'site');
@@ -58,6 +60,7 @@ export default function (gulp) {
58
60
  });
59
61
 
60
62
  gulp.task('mkdocs:stop', (done) => {
63
+ if (!requireDocker()) { done(); return; }
61
64
  try {
62
65
  console.log('Stopping MkDocs server...');
63
66
  dockerCompose('down');
@@ -70,8 +73,7 @@ export default function (gulp) {
70
73
 
71
74
  gulp.task('mkdocs:open', (done) => {
72
75
  try {
73
- const command = isWindows ? 'start http://localhost:8000' : 'open http://localhost:8000';
74
- execSync(command, { stdio: 'inherit' });
76
+ openUrl('http://localhost:8000');
75
77
  done();
76
78
  } catch (error) {
77
79
  done(error);
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ import { execSync } from 'child_process';
4
+
5
+ /**
6
+ * DOCKER_HOST を除外した環境変数を返す
7
+ * Docker Desktop 使用時に DOCKER_HOST が設定されていると接続エラーが発生するため除外する
8
+ * @returns {Object} DOCKER_HOST を除外した環境変数
9
+ */
10
+ export function cleanDockerEnv() {
11
+ const env = { ...process.env };
12
+ delete env.DOCKER_HOST;
13
+ return env;
14
+ }
15
+
16
+ /**
17
+ * Docker デーモンが利用可能か確認する
18
+ * @returns {boolean} Docker が利用可能なら true
19
+ */
20
+ export function isDockerAvailable() {
21
+ try {
22
+ execSync('docker info', { stdio: 'ignore', env: cleanDockerEnv() });
23
+ return true;
24
+ } catch {
25
+ return false;
26
+ }
27
+ }
28
+
29
+ /**
30
+ * URL をデフォルトブラウザで開く(クロスプラットフォーム対応)
31
+ * @param {string} url - 開く URL
32
+ */
33
+ export function openUrl(url) {
34
+ const platform = process.platform;
35
+ const cmd =
36
+ platform === 'win32' ? `start "" "${url}"` :
37
+ platform === 'darwin' ? `open "${url}"` :
38
+ `xdg-open "${url}"`;
39
+ execSync(cmd, { stdio: 'ignore' });
40
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k2works/claude-code-booster",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "AI Agent Development Support Tool",
5
5
  "main": "main.js",
6
6
  "bin": {