


























@@ -132,6 +132,10 @@ describe("managed npm root", () => {
132132managedOverrides: {
133133axios: "1.16.0",
134134"node-domexception": "npm:@nolyfill/domexception@1.0.28",
135+nested: {
136+semver: "1.2.3",
137+alias: "npm:@scope/alias@1.0.0",
138+},
135139},
136140});
137141@@ -147,9 +151,46 @@ describe("managed npm root", () => {
147151"left-pad": "1.3.0",
148152axios: "1.16.0",
149153"node-domexception": "npm:@nolyfill/domexception@1.0.28",
154+nested: {
155+alias: "npm:@scope/alias@1.0.0",
156+semver: "1.2.3",
157+},
150158},
151159openclaw: {
152-managedOverrides: ["axios", "node-domexception"],
160+managedOverrides: ["axios", "nested", "node-domexception"],
161+},
162+});
163+});
164+165+it("can omit npm alias overrides for npm versions that reject them", async () => {
166+const npmRoot = await makeTempRoot();
167+168+await upsertManagedNpmRootDependency({
169+ npmRoot,
170+packageName: "@openclaw/feishu",
171+dependencySpec: "2026.5.4",
172+omitUnsupportedManagedOverrides: true,
173+managedOverrides: {
174+axios: "1.16.0",
175+"node-domexception": "npm:@nolyfill/domexception@1.0.28",
176+nested: {
177+alias: "npm:@scope/alias@1.0.0",
178+semver: "1.2.3",
179+},
180+},
181+});
182+183+await expect(
184+fs.readFile(path.join(npmRoot, "package.json"), "utf8").then((raw) => JSON.parse(raw)),
185+).resolves.toMatchObject({
186+overrides: {
187+axios: "1.16.0",
188+nested: {
189+semver: "1.2.3",
190+},
191+},
192+openclaw: {
193+managedOverrides: ["axios", "nested"],
153194},
154195});
155196});
@@ -202,6 +243,7 @@ describe("managed npm root", () => {
202243 name: "openclaw",
203244 dependencies: {
204245 "@aws-sdk/client-bedrock-runtime": "3.1024.0",
246+ "node-domexception": "npm:@nolyfill/domexception@1.0.28",
205247 },
206248 optionalDependencies: {
207249 "optional-runtime": "2.0.0",
@@ -210,8 +252,10 @@ describe("managed npm root", () => {
210252 "@aws-sdk/client-bedrock-runtime": "$@aws-sdk/client-bedrock-runtime",
211253 nested: {
212254 "optional-runtime": "$optional-runtime",
255+ alias: "$node-domexception",
213256 },
214257 axios: "1.16.0",
258+ "node-domexception": "$node-domexception",
215259 },
216260 },
217261 null,
@@ -223,8 +267,10 @@ describe("managed npm root", () => {
223267"@aws-sdk/client-bedrock-runtime": "3.1024.0",
224268nested: {
225269"optional-runtime": "2.0.0",
270+alias: "npm:@nolyfill/domexception@1.0.28",
226271},
227272axios: "1.16.0",
273+"node-domexception": "npm:@nolyfill/domexception@1.0.28",
228274});
229275});
230276此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。