@lingyao037/openclaw-lingyao-cli 0.3.2 → 0.3.3
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/cli.mjs +12 -10
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -27,7 +27,7 @@ const CYAN = '\x1b[36m';
|
|
|
27
27
|
const NC = '\x1b[0m';
|
|
28
28
|
|
|
29
29
|
class LingyaoInstaller {
|
|
30
|
-
constructor(customPath = null, skipDeps =
|
|
30
|
+
constructor(customPath = null, skipDeps = true) {
|
|
31
31
|
this.openclawPath = null;
|
|
32
32
|
this.customPath = customPath;
|
|
33
33
|
this.skipDeps = skipDeps;
|
|
@@ -227,13 +227,15 @@ class LingyaoInstaller {
|
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
// 从 npx/npm 临时目录一起复制运行时依赖,避免目标 Gateway 再执行一次安装。
|
|
230
|
+
// 注意:默认不复制 node_modules,因为插件依赖(axios/ws/zod)已在目标 OpenClaw 环境中可用。
|
|
231
|
+
// 如遇特殊情况需强制复制依赖,可传入 --with-deps 参数。
|
|
230
232
|
const runtimeModulesPath = join(__dirname, 'node_modules');
|
|
231
233
|
if (existsSync(runtimeModulesPath) && statSync(runtimeModulesPath).isDirectory()) {
|
|
232
|
-
if (
|
|
234
|
+
if (this.skipDeps) {
|
|
235
|
+
this.info('跳过复制 node_modules (默认行为,使用目标环境已有依赖)');
|
|
236
|
+
} else {
|
|
233
237
|
this.log('复制运行时依赖...');
|
|
234
238
|
this.copyDirectory(runtimeModulesPath, join(targetDir, 'node_modules'));
|
|
235
|
-
} else {
|
|
236
|
-
this.info('跳过复制运行时依赖 (--no-deps)');
|
|
237
239
|
}
|
|
238
240
|
} else {
|
|
239
241
|
if (!this.skipDeps) {
|
|
@@ -540,14 +542,14 @@ async function main() {
|
|
|
540
542
|
const args = process.argv.slice(2);
|
|
541
543
|
let command = 'install';
|
|
542
544
|
let customPath = null;
|
|
543
|
-
let skipDeps =
|
|
545
|
+
let skipDeps = true;
|
|
544
546
|
|
|
545
547
|
for (let i = 0; i < args.length; i++) {
|
|
546
548
|
if (args[i] === '--path' && i + 1 < args.length) {
|
|
547
549
|
customPath = args[i + 1];
|
|
548
550
|
i++; // 跳过路径参数
|
|
549
|
-
} else if (args[i] === '--
|
|
550
|
-
skipDeps =
|
|
551
|
+
} else if (args[i] === '--with-deps') {
|
|
552
|
+
skipDeps = false;
|
|
551
553
|
} else if (!args[i].startsWith('--')) {
|
|
552
554
|
command = args[i];
|
|
553
555
|
}
|
|
@@ -579,7 +581,7 @@ async function main() {
|
|
|
579
581
|
|
|
580
582
|
参数:
|
|
581
583
|
--path <目录> # 指定 OpenClaw 安装目录
|
|
582
|
-
--
|
|
584
|
+
--with-deps # 复制 node_modules(默认不复制,避免依赖冲突)
|
|
583
585
|
|
|
584
586
|
环境要求:
|
|
585
587
|
• Node.js >= 22
|
|
@@ -589,8 +591,8 @@ async function main() {
|
|
|
589
591
|
# 从 npm 安装(推荐)
|
|
590
592
|
npx -y @lingyao/openclaw-lingyao-cli install
|
|
591
593
|
|
|
592
|
-
#
|
|
593
|
-
npx -y @lingyao/openclaw-lingyao-cli install --
|
|
594
|
+
# 强制复制 node_modules(仅在明确需要时使用)
|
|
595
|
+
npx -y @lingyao/openclaw-lingyao-cli install --with-deps
|
|
594
596
|
|
|
595
597
|
# 从 npm 卸载
|
|
596
598
|
npx -y @lingyao/openclaw-lingyao-cli uninstall
|
package/package.json
CHANGED