Skip to content

Commit 8b28c22

Browse files
committed
fix(server): drop nested Effect override selectors from staging
Copying publish-time keys like `@effect/vitest>vitest` into the staging root made npm reject the install with "Override without name". Keep only plain effect / @effect/* version pins.
1 parent a5bd7b3 commit 8b28c22

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎apps/server/src/cloud/pinnedRuntime.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const effectOverridesJson = JSON.stringify({
2222
effect: "4.0.0-rc.112",
2323
"@effect/platform-node": "4.0.0-rc.112",
2424
"@effect/platform-node-shared": "4.0.0-rc.112",
25+
"@effect/vitest>vitest": "-",
2526
vite: "npm:@voidzero-dev/[email protected]",
2627
});
2728

@@ -75,14 +76,15 @@ const successfulRunner = (fs: FileSystem.FileSystem, path: Path.Path) =>
7576
}),
7677
});
7778

78-
it("selectEffectOverrides keeps only effect and @effect/* string pins", () => {
79+
it("selectEffectOverrides keeps only plain effect package version pins", () => {
7980
assert.deepEqual(
8081
selectEffectOverrides({
8182
effect: "4.0.0-rc.112",
8283
"@effect/platform-node": "4.0.0-rc.112",
84+
"@effect/vitest>vitest": "-",
85+
"@effect/broken": 12,
8386
vite: "1.0.0",
8487
"@clerk/react": "6.0.0",
85-
"@effect/broken": 12,
8688
}),
8789
{
8890
effect: "4.0.0-rc.112",

‎apps/server/src/cloud/pinnedRuntime.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,15 @@ export class PinnedRuntimePreflightBlockedError extends Schema.TaggedError<Pinne
8585
* npm only honors `overrides` on the root project. Published `t3` carries Effect
8686
* pins, but they are ignored when `t3` is installed as a dependency into an empty
8787
* staging directory — caret ranges then float onto incompatible Effect RCs.
88-
* Re-apply only the Effect-related pins at the staging root before install.
88+
* Re-apply only plain Effect package pins at the staging root before install.
89+
* Nested selectors (`pkg>dep`) and removal overrides (`-`) are publish-time
90+
* monorepo policy and are rejected by npm when copied into this staging root.
8991
*/
9092
export function selectEffectOverrides(overrides: Record<string, unknown>): Record<string, string> {
9193
const selected: Record<string, string> = {};
9294
for (const [key, value] of Object.entries(overrides)) {
93-
if ((key === "effect" || key.startsWith("@effect/")) && typeof value === "string") {
95+
if (typeof value !== "string" || value === "-" || value.length === 0) continue;
96+
if (key === "effect" || /^@effect\/[^>]+$/.test(key)) {
9497
selected[key] = value;
9598
}
9699
}

0 commit comments

Comments
 (0)