The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 18:00 UTC
fix(release): resolve version-qualified catalog overrides (#16411)
Yash Singh committed
Oct 6, 2026 at 04:14 UTC
1f2b10c25bc400461e6c114c2c7236e91996225c
2 files changed
+29
-4
scripts/lib/resolve-catalog.test.ts
+23
@@ -34,4 +34,27 @@ describe("resolveCatalogDependencies", () => {
34
/Expected key 'missing' in root workspace catalog/,
35
);
36
});
37
+
38
+ it("resolves version-qualified overrides without changing their selectors", () => {
39
+ assert.deepStrictEqual(
40
+ resolveCatalogDependencies(
41
+ {
42
+ "undici@^8": "catalog:",
43
+ "ws@^8": "catalog:",
44
+ "@clerk/backend@^3": "catalog:",
45
+ "@scope/parent@^1>undici@^8": "catalog:",
46
+ "parent@^1>@clerk/backend@^3": "catalog:",
47
+ },
48
+ { ...catalog, undici: "8.11.2", ws: "8.21.0" },
49
+ "apps/desktop",
50
+ ),
51
+ {
52
+ "undici@^8": "8.11.2",
53
+ "ws@^8": "8.21.0",
54
+ "@clerk/backend@^3": "3.18.1",
55
+ "@scope/parent@^1>undici@^8": "8.11.2",
56
+ "parent@^1>@clerk/backend@^3": "3.18.1",
57
+ },
58
+ );
59
+ });
60
});
scripts/lib/resolve-catalog.ts
+6
-4
@@ -32,10 +32,12 @@ export function resolveCatalogDependencies(
32
}
33
34
const catalogKey = spec.slice("catalog:".length).trim();
35
- // An override key can be a selector such as `@scope/parent>effect`; like
36
- // pnpm, a bare `catalog:` there means the catalog entry of the package
37
- // the selector ends in.
38
- const lookupKey = catalogKey.length > 0 ? catalogKey : (name.split(">").at(-1) ?? name);
35
+ // Overrides can include a parent selector and a version range. A bare
36
+ // `catalog:` looks up the final package name, keeping its scope intact.
37
+ const selector = name.split(">").at(-1) ?? name;
38
+ const versionIndex = selector.indexOf("@", 1);
39
+ const packageName = versionIndex === -1 ? selector : selector.slice(0, versionIndex);
40
+ const lookupKey = catalogKey.length > 0 ? catalogKey : packageName;
41
const resolved = catalog[lookupKey];
42
43
if (typeof resolved !== "string" || resolved.length === 0) {