Skip to content

Commit 9d7fe96

Browse files
bingggcursoragent
andcommitted
fix: use .cjs bin entry so npx works with type:module
- Add setup-cloudbase-openclaw.cjs (CommonJS) as bin entry - Point bin to .cjs in package.json and files - Fixes 'require is not defined' when running npx @cloudbase/setup-openclaw Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent e869efb commit 9d7fe96

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

skills/setup-cloudbase-openclaw/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
22
"name": "@cloudbase/setup-openclaw",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "Configure Moltbot/OpenClaw for CloudBase full-stack development and copy app templates",
55
"type": "module",
66
"main": "SKILL.md",
77
"bin": {
8-
"setup-cloudbase-openclaw": "./setup-cloudbase-openclaw.js"
8+
"setup-openclaw": "./setup-cloudbase-openclaw.cjs"
99
},
1010
"files": [
1111
"SKILL.md",
1212
"README.md",
1313
"references",
1414
"scripts",
1515
"plugins",
16-
"setup-cloudbase-openclaw.js"
16+
"setup-cloudbase-openclaw.cjs"
1717
],
1818
"scripts": {
1919
"detect": "node scripts/setup.mjs detect",
@@ -40,7 +40,7 @@
4040
},
4141
"repository": {
4242
"type": "git",
43-
"url": "https://github.com/tencentcloudbase/skills"
43+
"url": "git+https://github.com/tencentcloudbase/skills.git"
4444
},
4545
"author": "Tencent CloudBase",
4646
"license": "MIT",
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env node
2+
/**
3+
* Bin wrapper for setup-cloudbase-openclaw (CommonJS so it works with "type": "module").
4+
* Delegates to ESM script scripts/setup.mjs.
5+
*/
6+
const path = require('path');
7+
const { spawnSync } = require('child_process');
8+
9+
const script = path.join(__dirname, 'scripts', 'setup.mjs');
10+
const result = spawnSync(process.execPath, [script, ...process.argv.slice(2)], {
11+
stdio: 'inherit',
12+
cwd: process.cwd(),
13+
});
14+
process.exitCode = result.status != null ? result.status : 1;

0 commit comments

Comments
 (0)