fix(plugins): preserve CLI diagnostics and exercise reviewed updates

Move new source capability coverage to real browser journeys. Update the requirements regression to exercise preview and apply, and preserve the existing duplicate-selector diagnostic across positional option scopes.
This commit is contained in:
Mohamed Boudra
2026-09-16 23:40:07 +02:00
parent c3a1e0027d
commit 1e53533235
5 changed files with 78 additions and 138 deletions
@@ -31,7 +31,10 @@ describe("global command options", () => {
it("rejects conflicting parent and command selectors", async () => {
await expect(
parseHost(["--host", "first:6767", "ls", "--host", "last:6767"]),
).rejects.toMatchObject({ code: "TARGET_AMBIGUOUS" });
).rejects.toMatchObject({
code: "TARGET_AMBIGUOUS",
message: "Conflicting duplicate --host selectors.",
});
});
it("lets local-only commands ignore a global host", async () => {
+4 -2
View File
@@ -47,8 +47,10 @@ export function withGlobalOptions<Args extends unknown[], Result>(
if (typeof value === "string") selectors[key].add(value);
}
}
if (selectors.home.size > 1 || selectors.host.size > 1)
throw { code: "TARGET_AMBIGUOUS", message: "Conflicting duplicate daemon selectors." };
for (const key of ["home", "host"] as const) {
if (selectors[key].size > 1)
throw { code: "TARGET_AMBIGUOUS", message: `Conflicting duplicate --${key} selectors.` };
}
const localOnly = localCommands.has(command);
options.daemonTarget = selectDaemonTarget(options, process.env, localOnly);
mergedArgs[mergedArgs.length - 2] = options;