mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 20:05:46 -06:00
fix(cli): derive drift command from exact npm spec
This commit is contained in:
@@ -348,6 +348,19 @@ describe("resolvePluginVersionDriftUpdateCommand", () => {
|
||||
).toBe("openclaw plugins update @openclaw/brave-plugin@2026.6.10-beta.1");
|
||||
});
|
||||
|
||||
it("prefers the parsed exact npm spec package over inconsistent drift metadata", () => {
|
||||
expect(
|
||||
resolvePluginVersionDriftUpdateCommand({
|
||||
pluginId: "brave",
|
||||
installedVersion: "2026.6.9",
|
||||
gatewayVersion: "2026.6.10-beta.1",
|
||||
source: "npm",
|
||||
packageName: "@openclaw/other-plugin",
|
||||
spec: "@openclaw/brave-plugin@2026.6.9",
|
||||
}),
|
||||
).toBe("openclaw plugins update @openclaw/brave-plugin@2026.6.10-beta.1");
|
||||
});
|
||||
|
||||
it("keeps plugin-id updates for floating npm install records", () => {
|
||||
expect(
|
||||
resolvePluginVersionDriftUpdateCommand({
|
||||
|
||||
@@ -31,7 +31,7 @@ function resolveExactNpmPinPackageName(entry: PluginVersionDriftEntry): string |
|
||||
if (parsed?.selectorKind !== "exact-version") {
|
||||
return undefined;
|
||||
}
|
||||
return entry.packageName ?? parsed.name;
|
||||
return parsed.name;
|
||||
}
|
||||
|
||||
/** Exact npm pins need a package@version target; id-only updates preserve the old pin. */
|
||||
|
||||
Reference in New Issue
Block a user