mirror of https://github.com/openclaw/openclaw.git
plugins: avoid peer auto-install dependency bloat (#34017)
* plugins/install: omit peer deps during plugin npm install * tests: assert plugin install omits peer deps * extensions/googlechat: mark openclaw peer optional * extensions/memory-core: mark openclaw peer optional
This commit is contained in:
parent
a95a0be133
commit
dfb4cb87f9
|
|
@ -10,6 +10,11 @@
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"openclaw": ">=2026.3.2"
|
"openclaw": ">=2026.3.2"
|
||||||
},
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"openclaw": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
},
|
||||||
"openclaw": {
|
"openclaw": {
|
||||||
"extensions": [
|
"extensions": [
|
||||||
"./index.ts"
|
"./index.ts"
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,11 @@
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"openclaw": ">=2026.3.2"
|
"openclaw": ">=2026.3.2"
|
||||||
},
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"openclaw": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
},
|
||||||
"openclaw": {
|
"openclaw": {
|
||||||
"extensions": [
|
"extensions": [
|
||||||
"./index.ts"
|
"./index.ts"
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ export async function installPackageDir(params: {
|
||||||
await sanitizeManifestForNpmInstall(params.targetDir);
|
await sanitizeManifestForNpmInstall(params.targetDir);
|
||||||
params.logger?.info?.(params.depsLogMessage);
|
params.logger?.info?.(params.depsLogMessage);
|
||||||
const npmRes = await runCommandWithTimeout(
|
const npmRes = await runCommandWithTimeout(
|
||||||
["npm", "install", "--omit=dev", "--silent", "--ignore-scripts"],
|
["npm", "install", "--omit=dev", "--omit=peer", "--silent", "--ignore-scripts"],
|
||||||
{
|
{
|
||||||
timeoutMs: Math.max(params.timeoutMs, 300_000),
|
timeoutMs: Math.max(params.timeoutMs, 300_000),
|
||||||
cwd: params.targetDir,
|
cwd: params.targetDir,
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,14 @@ export function expectSingleNpmInstallIgnoreScriptsCall(params: {
|
||||||
throw new Error("expected npm install call");
|
throw new Error("expected npm install call");
|
||||||
}
|
}
|
||||||
const [argv, opts] = first;
|
const [argv, opts] = first;
|
||||||
expect(argv).toEqual(["npm", "install", "--omit=dev", "--silent", "--ignore-scripts"]);
|
expect(argv).toEqual([
|
||||||
|
"npm",
|
||||||
|
"install",
|
||||||
|
"--omit=dev",
|
||||||
|
"--omit=peer",
|
||||||
|
"--silent",
|
||||||
|
"--ignore-scripts",
|
||||||
|
]);
|
||||||
expect(opts?.cwd).toBe(params.expectedCwd);
|
expect(opts?.cwd).toBe(params.expectedCwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue