Support PowerShell and resolve workspaces by directory path

This commit is contained in:
Mohamed Boudra
2026-04-04 15:37:26 +07:00
parent 5d5a79a2a8
commit 449a4b48d2
10 changed files with 323 additions and 17 deletions
@@ -49,6 +49,31 @@ describe("patchWorkspaceServices", () => {
expect(next.get("/repo/other")).toBe(other);
});
it("patches the matching workspace when the update uses workspace directory identity", () => {
const current = new Map<string, WorkspaceDescriptor>([
[
"42",
workspace({
id: "42",
services: [],
}),
],
]);
current.set("42", {
...current.get("42")!,
workspaceDirectory: "C:\\repo\\main\\",
});
const next = patchWorkspaceServices(current, {
workspaceId: "C:/repo/main",
services: [runningService],
});
expect(next).not.toBe(current);
expect(next.get("42")?.services).toEqual([runningService]);
});
it("ignores updates for unknown workspaces", () => {
const current = new Map<string, WorkspaceDescriptor>([
["/repo/main", workspace({ id: "/repo/main", services: [] })],