bingocode 1.0.8 → 1.0.10

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/bin/bingo CHANGED
@@ -12,4 +12,4 @@ else
12
12
  ENV_FILE_FLAG=""
13
13
  fi
14
14
 
15
- exec bun --preload ./preload.ts $ENV_FILE_FLAG ./src/entrypoints/cli.tsx --cli-menu-demo "$@"
15
+ exec bun --preload ./preload.ts $ENV_FILE_FLAG ./src/entrypoints/cli.tsx "$@"
package/bin/bingo-win.cjs CHANGED
@@ -46,8 +46,12 @@ const bun = fs.existsSync(bunPath) ? bunPath : 'bun';
46
46
  // 主 CLI 入口
47
47
  const entry = path.join(__dirname, '..', 'src', 'entrypoints', 'cli.tsx');
48
48
 
49
- // preload shim(定义 MACRO 全局变量)
49
+ // preload shim(定义 MACRO 全局变量)——必须用绝对路径,bunfig.toml 在 npm 全局安装后不生效
50
50
  const preload = path.join(__dirname, '..', 'preload.ts');
51
+ if (!fs.existsSync(preload)) {
52
+ console.error('[bingocode] 找不到 preload.ts,MACRO 将无法注入:' + preload);
53
+ process.exit(1);
54
+ }
51
55
 
52
56
  // 检查 .env
53
57
  let envFlag = '';
@@ -57,7 +61,7 @@ if (fs.existsSync(envPath)) {
57
61
  }
58
62
 
59
63
  const extraArgs = process.argv.slice(2);
60
- const args = [`--preload=${preload}`, envFlag, entry, '--cli-menu-demo', ...extraArgs].filter(Boolean);
64
+ const args = [`--preload=${preload}`, envFlag, entry, ...extraArgs].filter(Boolean);
61
65
 
62
66
  const child = spawn(bun, args, { stdio: 'inherit' });
63
67
 
@@ -15,6 +15,13 @@ const bun =
15
15
  // 主 CLI 入口
16
16
  const entry = path.join(__dirname, '..', 'src', 'entrypoints', 'cli.tsx');
17
17
 
18
+ // preload shim(定义 MACRO 全局变量)——必须用绝对路径,bunfig.toml 在 npm 全局安装后不生效
19
+ const preload = path.join(__dirname, '..', 'preload.ts');
20
+ if (!fs.existsSync(preload)) {
21
+ console.error('[bingocode] 找不到 preload.ts,MACRO 将无法注入:' + preload);
22
+ process.exit(1);
23
+ }
24
+
18
25
  // 检查 .env
19
26
  let envFlag = '';
20
27
  const envPath = path.join(__dirname, '..', '.env');
@@ -23,7 +30,7 @@ if (fs.existsSync(envPath)) {
23
30
  }
24
31
 
25
32
  const extraArgs = process.argv.slice(2);
26
- const args = [envFlag, entry, ...extraArgs].filter(Boolean);
33
+ const args = [`--preload=${preload}`, envFlag, entry, ...extraArgs].filter(Boolean);
27
34
 
28
35
  const child = spawn(bun, args, { stdio: 'inherit' });
29
36
 
@@ -16,6 +16,13 @@ const bun =
16
16
  // 主 CLI 入口
17
17
  const entry = path.join(__dirname, '..', 'src', 'entrypoints', 'cli.tsx');
18
18
 
19
+ // preload shim(定义 MACRO 全局变量)——必须用绝对路径,bunfig.toml 在 npm 全局安装后不生效
20
+ const preload = path.join(__dirname, '..', 'preload.ts');
21
+ if (!fs.existsSync(preload)) {
22
+ console.error('[bingocode] 找不到 preload.ts,MACRO 将无法注入:' + preload);
23
+ process.exit(1);
24
+ }
25
+
19
26
  // 检查 .env 是否存在,自动加环境变量参数
20
27
  let envFlag = '';
21
28
  const envPath = path.join(__dirname, '..', '.env');
@@ -23,9 +30,9 @@ if (fs.existsSync(envPath)) {
23
30
  envFlag = `--env-file=${envPath}`;
24
31
  }
25
32
 
26
- // 拼接全部参数:主文件、env、传入参数
33
+ // 拼接全部参数:preload、主文件、env、传入参数
27
34
  const extraArgs = process.argv.slice(2);
28
- const args = [envFlag, entry, ...extraArgs].filter(Boolean); // 过滤空串
35
+ const args = [`--preload=${preload}`, envFlag, entry, ...extraArgs].filter(Boolean); // 过滤空串
29
36
 
30
37
  // 启动 bun
31
38
  const child = spawn(bun, args, { stdio: 'inherit' });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bingocode",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "claude": "bin/claude-win.cjs",