bluelamp 4.0.13 → 4.0.14

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.
Files changed (111) hide show
  1. package/README.md +78 -0
  2. package/bin/bluelamp-vscode-base +317 -1
  3. package/bin/bluelamp1 +0 -0
  4. package/bin/bluelamp10 +0 -0
  5. package/bin/{bluelamp-vscode1 → bluelamp100} +0 -0
  6. package/bin/bluelamp11 +0 -0
  7. package/bin/bluelamp12 +0 -0
  8. package/bin/bluelamp13 +0 -0
  9. package/bin/bluelamp14 +0 -0
  10. package/bin/bluelamp15 +0 -0
  11. package/bin/bluelamp16 +0 -0
  12. package/bin/bluelamp17 +0 -0
  13. package/bin/bluelamp18 +0 -0
  14. package/bin/{bluelamp-vscode10 → bluelamp19} +0 -0
  15. package/bin/bluelamp2 +0 -0
  16. package/bin/{bluelamp-vscode11 → bluelamp20} +0 -0
  17. package/bin/{bluelamp-vscode12 → bluelamp21} +0 -0
  18. package/bin/{bluelamp-vscode13 → bluelamp22} +0 -0
  19. package/bin/{bluelamp-vscode14 → bluelamp23} +0 -0
  20. package/bin/{bluelamp-vscode15 → bluelamp24} +0 -0
  21. package/bin/{bluelamp-vscode16 → bluelamp25} +0 -0
  22. package/bin/{bluelamp-vscode2 → bluelamp26} +0 -0
  23. package/bin/{bluelamp-vscode3 → bluelamp27} +0 -0
  24. package/bin/{bluelamp-vscode4 → bluelamp28} +0 -0
  25. package/bin/{bluelamp-vscode5 → bluelamp29} +0 -0
  26. package/bin/bluelamp3 +0 -0
  27. package/bin/{bluelamp-vscode6 → bluelamp30} +0 -0
  28. package/bin/{bluelamp-vscode7 → bluelamp31} +0 -0
  29. package/bin/{bluelamp-vscode8 → bluelamp32} +0 -0
  30. package/bin/{bluelamp-vscode9 → bluelamp33} +0 -0
  31. package/bin/bluelamp34 +2 -0
  32. package/bin/bluelamp35 +2 -0
  33. package/bin/bluelamp36 +2 -0
  34. package/bin/bluelamp37 +2 -0
  35. package/bin/bluelamp38 +2 -0
  36. package/bin/bluelamp39 +2 -0
  37. package/bin/bluelamp4 +0 -0
  38. package/bin/bluelamp40 +2 -0
  39. package/bin/bluelamp41 +2 -0
  40. package/bin/bluelamp42 +2 -0
  41. package/bin/bluelamp43 +2 -0
  42. package/bin/bluelamp44 +2 -0
  43. package/bin/bluelamp45 +2 -0
  44. package/bin/bluelamp46 +2 -0
  45. package/bin/bluelamp47 +2 -0
  46. package/bin/bluelamp48 +2 -0
  47. package/bin/bluelamp49 +2 -0
  48. package/bin/bluelamp5 +0 -0
  49. package/bin/bluelamp50 +2 -0
  50. package/bin/bluelamp51 +2 -0
  51. package/bin/bluelamp52 +2 -0
  52. package/bin/bluelamp53 +2 -0
  53. package/bin/bluelamp54 +2 -0
  54. package/bin/bluelamp55 +2 -0
  55. package/bin/bluelamp56 +2 -0
  56. package/bin/bluelamp57 +2 -0
  57. package/bin/bluelamp58 +2 -0
  58. package/bin/bluelamp59 +2 -0
  59. package/bin/bluelamp6 +0 -0
  60. package/bin/bluelamp60 +2 -0
  61. package/bin/bluelamp61 +2 -0
  62. package/bin/bluelamp62 +2 -0
  63. package/bin/bluelamp63 +2 -0
  64. package/bin/bluelamp64 +2 -0
  65. package/bin/bluelamp65 +2 -0
  66. package/bin/bluelamp66 +2 -0
  67. package/bin/bluelamp67 +2 -0
  68. package/bin/bluelamp68 +2 -0
  69. package/bin/bluelamp69 +2 -0
  70. package/bin/bluelamp7 +0 -0
  71. package/bin/bluelamp70 +2 -0
  72. package/bin/bluelamp71 +2 -0
  73. package/bin/bluelamp72 +2 -0
  74. package/bin/bluelamp73 +2 -0
  75. package/bin/bluelamp74 +2 -0
  76. package/bin/bluelamp75 +2 -0
  77. package/bin/bluelamp76 +2 -0
  78. package/bin/bluelamp77 +2 -0
  79. package/bin/bluelamp78 +2 -0
  80. package/bin/bluelamp79 +2 -0
  81. package/bin/bluelamp8 +0 -0
  82. package/bin/bluelamp80 +2 -0
  83. package/bin/bluelamp81 +2 -0
  84. package/bin/bluelamp82 +2 -0
  85. package/bin/bluelamp83 +2 -0
  86. package/bin/bluelamp84 +2 -0
  87. package/bin/bluelamp85 +2 -0
  88. package/bin/bluelamp86 +2 -0
  89. package/bin/bluelamp87 +2 -0
  90. package/bin/bluelamp88 +2 -0
  91. package/bin/bluelamp89 +2 -0
  92. package/bin/bluelamp9 +0 -0
  93. package/bin/bluelamp90 +2 -0
  94. package/bin/bluelamp91 +2 -0
  95. package/bin/bluelamp92 +2 -0
  96. package/bin/bluelamp93 +2 -0
  97. package/bin/bluelamp94 +2 -0
  98. package/bin/bluelamp95 +2 -0
  99. package/bin/bluelamp96 +2 -0
  100. package/bin/bluelamp97 +2 -0
  101. package/bin/bluelamp98 +2 -0
  102. package/bin/bluelamp99 +2 -0
  103. package/lib/auth/InteractiveLogin.js +243 -1
  104. package/lib/auth/PortalAuthClient.js +187 -1
  105. package/lib/auth/TokenManager.js +258 -1
  106. package/lib/mcp-server/index.cjs +195 -1
  107. package/lib/mcp-server/portal-api-client.cjs +286 -1
  108. package/lib/utils/logger.js +83 -1
  109. package/package.json +102 -6
  110. package/scripts/build.js +339 -0
  111. package/scripts/generate-commands.js +45 -0
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "bluelamp",
3
- "version": "4.0.13",
4
- "description": "BlueLamp MCP Server - 18 Development Prompts for Claude Code",
5
- "main": "./lib/mcp-server/index.cjs",
3
+ "version": "4.0.14",
4
+ "description": "BlueLamp MCP Server - 100 Customizable Development Prompts for Claude Code",
5
+ "main": "lib/mcp-server/index.cjs",
6
6
  "bin": {
7
7
  "bluelamp1": "./bin/bluelamp1",
8
8
  "bluelamp2": "./bin/bluelamp2",
@@ -21,7 +21,96 @@
21
21
  "bluelamp15": "./bin/bluelamp15",
22
22
  "bluelamp16": "./bin/bluelamp16",
23
23
  "bluelamp17": "./bin/bluelamp17",
24
- "bluelamp18": "./bin/bluelamp18"
24
+ "bluelamp18": "./bin/bluelamp18",
25
+ "bluelamp19": "./bin/bluelamp19",
26
+ "bluelamp20": "./bin/bluelamp20",
27
+ "bluelamp21": "./bin/bluelamp21",
28
+ "bluelamp22": "./bin/bluelamp22",
29
+ "bluelamp23": "./bin/bluelamp23",
30
+ "bluelamp24": "./bin/bluelamp24",
31
+ "bluelamp25": "./bin/bluelamp25",
32
+ "bluelamp26": "./bin/bluelamp26",
33
+ "bluelamp27": "./bin/bluelamp27",
34
+ "bluelamp28": "./bin/bluelamp28",
35
+ "bluelamp29": "./bin/bluelamp29",
36
+ "bluelamp30": "./bin/bluelamp30",
37
+ "bluelamp31": "./bin/bluelamp31",
38
+ "bluelamp32": "./bin/bluelamp32",
39
+ "bluelamp33": "./bin/bluelamp33",
40
+ "bluelamp34": "./bin/bluelamp34",
41
+ "bluelamp35": "./bin/bluelamp35",
42
+ "bluelamp36": "./bin/bluelamp36",
43
+ "bluelamp37": "./bin/bluelamp37",
44
+ "bluelamp38": "./bin/bluelamp38",
45
+ "bluelamp39": "./bin/bluelamp39",
46
+ "bluelamp40": "./bin/bluelamp40",
47
+ "bluelamp41": "./bin/bluelamp41",
48
+ "bluelamp42": "./bin/bluelamp42",
49
+ "bluelamp43": "./bin/bluelamp43",
50
+ "bluelamp44": "./bin/bluelamp44",
51
+ "bluelamp45": "./bin/bluelamp45",
52
+ "bluelamp46": "./bin/bluelamp46",
53
+ "bluelamp47": "./bin/bluelamp47",
54
+ "bluelamp48": "./bin/bluelamp48",
55
+ "bluelamp49": "./bin/bluelamp49",
56
+ "bluelamp50": "./bin/bluelamp50",
57
+ "bluelamp51": "./bin/bluelamp51",
58
+ "bluelamp52": "./bin/bluelamp52",
59
+ "bluelamp53": "./bin/bluelamp53",
60
+ "bluelamp54": "./bin/bluelamp54",
61
+ "bluelamp55": "./bin/bluelamp55",
62
+ "bluelamp56": "./bin/bluelamp56",
63
+ "bluelamp57": "./bin/bluelamp57",
64
+ "bluelamp58": "./bin/bluelamp58",
65
+ "bluelamp59": "./bin/bluelamp59",
66
+ "bluelamp60": "./bin/bluelamp60",
67
+ "bluelamp61": "./bin/bluelamp61",
68
+ "bluelamp62": "./bin/bluelamp62",
69
+ "bluelamp63": "./bin/bluelamp63",
70
+ "bluelamp64": "./bin/bluelamp64",
71
+ "bluelamp65": "./bin/bluelamp65",
72
+ "bluelamp66": "./bin/bluelamp66",
73
+ "bluelamp67": "./bin/bluelamp67",
74
+ "bluelamp68": "./bin/bluelamp68",
75
+ "bluelamp69": "./bin/bluelamp69",
76
+ "bluelamp70": "./bin/bluelamp70",
77
+ "bluelamp71": "./bin/bluelamp71",
78
+ "bluelamp72": "./bin/bluelamp72",
79
+ "bluelamp73": "./bin/bluelamp73",
80
+ "bluelamp74": "./bin/bluelamp74",
81
+ "bluelamp75": "./bin/bluelamp75",
82
+ "bluelamp76": "./bin/bluelamp76",
83
+ "bluelamp77": "./bin/bluelamp77",
84
+ "bluelamp78": "./bin/bluelamp78",
85
+ "bluelamp79": "./bin/bluelamp79",
86
+ "bluelamp80": "./bin/bluelamp80",
87
+ "bluelamp81": "./bin/bluelamp81",
88
+ "bluelamp82": "./bin/bluelamp82",
89
+ "bluelamp83": "./bin/bluelamp83",
90
+ "bluelamp84": "./bin/bluelamp84",
91
+ "bluelamp85": "./bin/bluelamp85",
92
+ "bluelamp86": "./bin/bluelamp86",
93
+ "bluelamp87": "./bin/bluelamp87",
94
+ "bluelamp88": "./bin/bluelamp88",
95
+ "bluelamp89": "./bin/bluelamp89",
96
+ "bluelamp90": "./bin/bluelamp90",
97
+ "bluelamp91": "./bin/bluelamp91",
98
+ "bluelamp92": "./bin/bluelamp92",
99
+ "bluelamp93": "./bin/bluelamp93",
100
+ "bluelamp94": "./bin/bluelamp94",
101
+ "bluelamp95": "./bin/bluelamp95",
102
+ "bluelamp96": "./bin/bluelamp96",
103
+ "bluelamp97": "./bin/bluelamp97",
104
+ "bluelamp98": "./bin/bluelamp98",
105
+ "bluelamp99": "./bin/bluelamp99",
106
+ "bluelamp100": "./bin/bluelamp100"
107
+ },
108
+ "scripts": {
109
+ "postinstall": "node scripts/generate-commands.js",
110
+ "test": "jest",
111
+ "test:coverage": "jest --coverage",
112
+ "test:mcp": "node test-mcp.js",
113
+ "build": "node scripts/build.js"
25
114
  },
26
115
  "keywords": [
27
116
  "vscode",
@@ -45,11 +134,18 @@
45
134
  },
46
135
  "files": [
47
136
  "bin/",
48
- "lib/"
137
+ "lib/",
138
+ "scripts/",
139
+ "README.md"
49
140
  ],
50
141
  "preferGlobal": true,
51
142
  "repository": {
52
143
  "type": "git",
53
144
  "url": "https://github.com/yamatovision/bluelamp-cli.git"
145
+ },
146
+ "devDependencies": {
147
+ "javascript-obfuscator": "^4.1.1",
148
+ "jest": "^30.2.0",
149
+ "terser": "^5.44.0"
54
150
  }
55
- }
151
+ }
@@ -0,0 +1,339 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * BlueLamp CLI - Production Build Script
4
+ *
5
+ * 2段階難読化戦略:
6
+ * - Terser: 一般ファイル(軽量縮小化)
7
+ * - javascript-obfuscator HIGH: 機密ファイル(強力な保護)
8
+ */
9
+
10
+ const fs = require('fs').promises;
11
+ const path = require('path');
12
+
13
+ const PROJECT_ROOT = path.dirname(__dirname);
14
+ const SRC_DIR = PROJECT_ROOT; // 現在はsrc/なし、後で移行
15
+ const DIST_DIR = path.join(PROJECT_ROOT, 'dist');
16
+
17
+ // 機密ファイル(HIGH難読化対象)
18
+ const SENSITIVE_FILES = [
19
+ 'lib/auth/InteractiveLogin.js',
20
+ 'lib/auth/PortalAuthClient.js',
21
+ 'lib/auth/TokenManager.js',
22
+ 'lib/mcp-server/portal-api-client.cjs',
23
+ 'bin/bluelamp-vscode-base'
24
+ ];
25
+
26
+ // 非処理ファイル(そのままコピー)
27
+ const COPY_ONLY_FILES = [
28
+ 'lib/agents/ブルーランプ.md'
29
+ ];
30
+
31
+ // HIGH難読化設定(機密ファイル用)
32
+ const HIGH_OBFUSCATION_OPTIONS = {
33
+ compact: true,
34
+ controlFlowFlattening: true,
35
+ controlFlowFlatteningThreshold: 0.75,
36
+ deadCodeInjection: true,
37
+ deadCodeInjectionThreshold: 0.4,
38
+ debugProtection: true,
39
+ debugProtectionInterval: 4000,
40
+ disableConsoleOutput: false,
41
+ identifierNamesGenerator: 'hexadecimal',
42
+ log: false,
43
+ numbersToExpressions: true,
44
+ renameGlobals: true,
45
+ selfDefending: true,
46
+ simplify: true,
47
+ splitStrings: true,
48
+ splitStringsChunkLength: 5,
49
+ stringArray: true,
50
+ stringArrayCallsTransform: true,
51
+ stringArrayCallsTransformThreshold: 0.8,
52
+ stringArrayEncoding: ['base64'],
53
+ stringArrayIndexShift: true,
54
+ stringArrayRotate: true,
55
+ stringArrayShuffle: true,
56
+ stringArrayWrappersCount: 2,
57
+ stringArrayWrappersChainedCalls: true,
58
+ stringArrayWrappersParametersMaxCount: 4,
59
+ stringArrayWrappersType: 'function',
60
+ stringArrayThreshold: 0.8,
61
+ transformObjectKeys: true,
62
+ unicodeEscapeSequence: false
63
+ };
64
+
65
+ // Terser設定(一般ファイル用)
66
+ const TERSER_OPTIONS = {
67
+ compress: {
68
+ dead_code: true,
69
+ drop_console: false,
70
+ drop_debugger: true,
71
+ passes: 2
72
+ },
73
+ mangle: {
74
+ reserved: ['require', 'module', 'exports', 'process', '__dirname', '__filename']
75
+ },
76
+ format: {
77
+ comments: false
78
+ }
79
+ };
80
+
81
+ class Logger {
82
+ static info(msg) { console.log(`\x1b[36m[INFO]\x1b[0m ${msg}`); }
83
+ static success(msg) { console.log(`\x1b[32m[OK]\x1b[0m ${msg}`); }
84
+ static warn(msg) { console.log(`\x1b[33m[WARN]\x1b[0m ${msg}`); }
85
+ static error(msg) { console.log(`\x1b[31m[ERROR]\x1b[0m ${msg}`); }
86
+ }
87
+
88
+ async function ensureDir(dirPath) {
89
+ try {
90
+ await fs.mkdir(dirPath, { recursive: true });
91
+ } catch (e) {
92
+ if (e.code !== 'EEXIST') throw e;
93
+ }
94
+ }
95
+
96
+ async function cleanDir(dirPath) {
97
+ try {
98
+ await fs.rm(dirPath, { recursive: true, force: true });
99
+ } catch (e) {
100
+ // ignore
101
+ }
102
+ await ensureDir(dirPath);
103
+ }
104
+
105
+ function isSensitiveFile(relativePath) {
106
+ return SENSITIVE_FILES.some(sf => relativePath.endsWith(sf) || relativePath === sf);
107
+ }
108
+
109
+ function isCopyOnlyFile(relativePath) {
110
+ return COPY_ONLY_FILES.some(cf => relativePath.endsWith(cf) || relativePath === cf);
111
+ }
112
+
113
+ function isJavaScriptFile(filePath) {
114
+ // .js, .cjs, または拡張子なしのbin/ファイル(bluelamp-vscode-base)
115
+ if (filePath.endsWith('.js') || filePath.endsWith('.cjs')) return true;
116
+ // bin/bluelamp-vscode-base は拡張子がないがJSファイル
117
+ if (filePath.includes('bin/bluelamp-vscode-base')) return true;
118
+ return false;
119
+ }
120
+
121
+ async function processWithTerser(code, filePath) {
122
+ try {
123
+ const { minify } = require('terser');
124
+ const result = await minify(code, TERSER_OPTIONS);
125
+ if (result.error) throw result.error;
126
+ return result.code;
127
+ } catch (error) {
128
+ Logger.warn(`Terser failed for ${filePath}, using original: ${error.message}`);
129
+ return code;
130
+ }
131
+ }
132
+
133
+ function processWithObfuscator(code) {
134
+ const JavaScriptObfuscator = require('javascript-obfuscator');
135
+ const result = JavaScriptObfuscator.obfuscate(code, HIGH_OBFUSCATION_OPTIONS);
136
+ return result.getObfuscatedCode();
137
+ }
138
+
139
+ async function processFile(srcPath, destPath, relativePath) {
140
+ const content = await fs.readFile(srcPath, 'utf8');
141
+
142
+ // 非JSファイルまたはコピーのみファイル
143
+ if (!isJavaScriptFile(srcPath) || isCopyOnlyFile(relativePath)) {
144
+ await ensureDir(path.dirname(destPath));
145
+ await fs.writeFile(destPath, content, 'utf8');
146
+ Logger.info(`Copy: ${relativePath}`);
147
+ return 'copy';
148
+ }
149
+
150
+ // shebang行の抽出
151
+ let shebang = '';
152
+ let codeToProcess = content;
153
+ if (content.startsWith('#!')) {
154
+ const idx = content.indexOf('\n');
155
+ shebang = content.substring(0, idx + 1);
156
+ codeToProcess = content.substring(idx + 1);
157
+ }
158
+
159
+ let processedCode;
160
+ let processType;
161
+
162
+ if (isSensitiveFile(relativePath)) {
163
+ // 機密ファイル: HIGH難読化
164
+ processedCode = processWithObfuscator(codeToProcess);
165
+ processType = 'HIGH';
166
+ Logger.success(`HIGH obfuscate: ${relativePath}`);
167
+ } else {
168
+ // 一般ファイル: Terser縮小化
169
+ processedCode = await processWithTerser(codeToProcess, relativePath);
170
+ processType = 'Terser';
171
+ Logger.info(`Terser minify: ${relativePath}`);
172
+ }
173
+
174
+ const finalCode = shebang + processedCode;
175
+
176
+ await ensureDir(path.dirname(destPath));
177
+ await fs.writeFile(destPath, finalCode, 'utf8');
178
+
179
+ // bin/ファイルの実行権限復元
180
+ if (relativePath.startsWith('bin/')) {
181
+ await fs.chmod(destPath, 0o755);
182
+ }
183
+
184
+ return processType;
185
+ }
186
+
187
+ async function collectFiles(dir, baseDir = dir) {
188
+ const files = [];
189
+ const entries = await fs.readdir(dir, { withFileTypes: true });
190
+
191
+ for (const entry of entries) {
192
+ const fullPath = path.join(dir, entry.name);
193
+ const relativePath = path.relative(baseDir, fullPath);
194
+
195
+ // 除外パターン
196
+ if (entry.name.startsWith('.') ||
197
+ entry.name === 'node_modules' ||
198
+ entry.name === 'dist' ||
199
+ entry.name === 'release' ||
200
+ entry.name === 'docs' ||
201
+ entry.name === 'scripts' ||
202
+ entry.name === 'test-mcp.js' ||
203
+ entry.name === 'test-mcp-api.js' ||
204
+ entry.name.endsWith('.md') && !COPY_ONLY_FILES.includes(relativePath)) {
205
+ continue;
206
+ }
207
+
208
+ if (entry.isDirectory()) {
209
+ const subFiles = await collectFiles(fullPath, baseDir);
210
+ files.push(...subFiles);
211
+ } else {
212
+ files.push({ fullPath, relativePath });
213
+ }
214
+ }
215
+
216
+ return files;
217
+ }
218
+
219
+ async function main() {
220
+ const startTime = Date.now();
221
+
222
+ console.log('');
223
+ console.log('╔═══════════════════════════════════════════════════════════╗');
224
+ console.log('║ BlueLamp CLI - Production Build ║');
225
+ console.log('║ 2-Stage Obfuscation: Terser + HIGH ║');
226
+ console.log('╚═══════════════════════════════════════════════════════════╝');
227
+ console.log('');
228
+
229
+ // 依存関係チェック
230
+ try {
231
+ require('terser');
232
+ require('javascript-obfuscator');
233
+ } catch (e) {
234
+ Logger.error('Missing dependencies. Run: npm install');
235
+ process.exit(1);
236
+ }
237
+
238
+ // dist/をクリーン
239
+ Logger.info('Cleaning dist/...');
240
+ await cleanDir(DIST_DIR);
241
+
242
+ // 対象ファイル収集
243
+ Logger.info('Collecting files...');
244
+
245
+ const targetDirs = ['bin', 'lib'];
246
+ const allFiles = [];
247
+
248
+ for (const dir of targetDirs) {
249
+ const dirPath = path.join(SRC_DIR, dir);
250
+ try {
251
+ const files = await collectFiles(dirPath, SRC_DIR);
252
+ allFiles.push(...files);
253
+ } catch (e) {
254
+ Logger.warn(`Directory not found: ${dir}`);
255
+ }
256
+ }
257
+
258
+ Logger.info(`Found ${allFiles.length} files to process`);
259
+ console.log('');
260
+
261
+ // ファイル処理
262
+ const stats = { terser: 0, high: 0, copy: 0, error: 0 };
263
+
264
+ for (const file of allFiles) {
265
+ const destPath = path.join(DIST_DIR, file.relativePath);
266
+
267
+ try {
268
+ const type = await processFile(file.fullPath, destPath, file.relativePath);
269
+ if (type === 'Terser') stats.terser++;
270
+ else if (type === 'HIGH') stats.high++;
271
+ else stats.copy++;
272
+ } catch (error) {
273
+ Logger.error(`Failed: ${file.relativePath} - ${error.message}`);
274
+ stats.error++;
275
+ }
276
+ }
277
+
278
+ // package.json生成(dist用に調整)
279
+ Logger.info('Generating dist/package.json...');
280
+ const pkgPath = path.join(SRC_DIR, 'package.json');
281
+ const pkg = JSON.parse(await fs.readFile(pkgPath, 'utf8'));
282
+
283
+ // binパスをdist/相対に変更しない(npm publishはdist/から行う)
284
+ const distPkg = {
285
+ name: pkg.name,
286
+ version: pkg.version,
287
+ description: pkg.description,
288
+ main: pkg.main.replace('lib/', './lib/'),
289
+ bin: {},
290
+ keywords: pkg.keywords,
291
+ author: pkg.author,
292
+ license: pkg.license,
293
+ dependencies: pkg.dependencies,
294
+ engines: pkg.engines,
295
+ files: ['bin/', 'lib/'],
296
+ preferGlobal: pkg.preferGlobal,
297
+ repository: pkg.repository
298
+ };
299
+
300
+ // binパスを相対パスに
301
+ for (const [cmd, binPath] of Object.entries(pkg.bin)) {
302
+ distPkg.bin[cmd] = binPath.replace('./bin/', './bin/');
303
+ }
304
+
305
+ await fs.writeFile(
306
+ path.join(DIST_DIR, 'package.json'),
307
+ JSON.stringify(distPkg, null, 2),
308
+ 'utf8'
309
+ );
310
+
311
+ // 結果表示
312
+ const duration = ((Date.now() - startTime) / 1000).toFixed(2);
313
+
314
+ console.log('');
315
+ console.log('╔═══════════════════════════════════════════════════════════╗');
316
+ console.log('║ Build Complete ║');
317
+ console.log('╠═══════════════════════════════════════════════════════════╣');
318
+ console.log(`║ Terser (general): ${String(stats.terser).padStart(3)} files ║`);
319
+ console.log(`║ HIGH (sensitive): ${String(stats.high).padStart(3)} files ║`);
320
+ console.log(`║ Copy only: ${String(stats.copy).padStart(3)} files ║`);
321
+ console.log(`║ Errors: ${String(stats.error).padStart(3)} files ║`);
322
+ console.log(`║ Time: ${duration.padStart(5)}s ║`);
323
+ console.log('╠═══════════════════════════════════════════════════════════╣');
324
+ console.log('║ Output: dist/ ║');
325
+ console.log('║ ║');
326
+ console.log('║ To publish: ║');
327
+ console.log('║ cd dist && npm publish ║');
328
+ console.log('╚═══════════════════════════════════════════════════════════╝');
329
+ console.log('');
330
+
331
+ if (stats.error > 0) {
332
+ process.exit(1);
333
+ }
334
+ }
335
+
336
+ main().catch(e => {
337
+ Logger.error(e.message);
338
+ process.exit(1);
339
+ });
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * BlueLamp コマンド生成スクリプト
5
+ * bluelamp1〜100 の100個のコマンドファイルを自動生成
6
+ */
7
+
8
+ const fs = require('fs');
9
+ const path = require('path');
10
+
11
+ const binDir = path.join(__dirname, '..', 'bin');
12
+ const baseScript = path.join(binDir, 'bluelamp-vscode-base');
13
+
14
+ // 生成するコマンド数(100スロット対応)
15
+ const MAX_SLOTS = 100;
16
+
17
+ console.log('🔵 BlueLamp コマンド生成開始...\n');
18
+
19
+ // bluelamp1〜100 を生成
20
+ let createdCount = 0;
21
+ for (let i = 1; i <= MAX_SLOTS; i++) {
22
+ const commandName = `bluelamp${i}`;
23
+ const commandPath = path.join(binDir, commandName);
24
+
25
+ // ラッパースクリプトを作成
26
+ const content = `#!/usr/bin/env node
27
+ require('./bluelamp-vscode-base');
28
+ `;
29
+
30
+ fs.writeFileSync(commandPath, content);
31
+ fs.chmodSync(commandPath, '755');
32
+ createdCount++;
33
+
34
+ // 進捗表示(10個ごと)
35
+ if (i % 10 === 0) {
36
+ console.log(` ✅ bluelamp1〜${i} 作成完了`);
37
+ }
38
+ }
39
+
40
+ // ベーススクリプトにも実行権限を付与
41
+ if (fs.existsSync(baseScript)) {
42
+ fs.chmodSync(baseScript, '755');
43
+ }
44
+
45
+ console.log(`\n✨ ${createdCount}個のコマンドファイルを生成しました (bluelamp1〜bluelamp${MAX_SLOTS})`);