Skip to content

Commit f58994c

Browse files
committed
build(desktop-artifact): use BUN_FROZEN_LOCKFILE env var instead of --no
- Remove bun.lock copy to staging directory. The staging package.json is a flat workspace subset with structural differences from the repo lockfile, causing resolution conflicts in frozen mode. - Set BUN_FROZEN_LOCKFILE=0 environment variable instead of passing --no-frozen-lockfile. This is cleaner and lets bun generate a fresh lockfile for the staging subset without conflicts. - Add @effect/platform-node-shared to support the build dependencies.
1 parent 2b55450 commit f58994c

4 files changed

Lines changed: 14 additions & 16 deletions

File tree

apps/server/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"@anthropic-ai/claude-agent-sdk": "^0.2.77",
2727
"@effect/platform-bun": "catalog:",
2828
"@effect/platform-node": "catalog:",
29+
"@effect/platform-node-shared": "catalog:",
2930
"@effect/sql-sqlite-bun": "catalog:",
3031
"@pierre/diffs": "^1.1.0-beta.16",
3132
"effect": "catalog:",

bun.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"@effect/atom-react": "4.0.0-beta.43",
1313
"@effect/platform-bun": "4.0.0-beta.43",
1414
"@effect/platform-node": "4.0.0-beta.43",
15+
"@effect/platform-node-shared": "4.0.0-beta.43",
1516
"@effect/sql-sqlite-bun": "4.0.0-beta.43",
1617
"@effect/vitest": "4.0.0-beta.43",
1718
"@effect/language-service": "0.84.2",

scripts/build-desktop-artifact.ts

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -684,28 +684,22 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (
684684
const stagePackageJsonString = yield* encodeJsonString(stagePackageJson);
685685
yield* fs.writeFileString(path.join(stageAppDir, "package.json"), `${stagePackageJsonString}\n`);
686686

687-
const repoLockfile = path.join(repoRoot, "bun.lock");
688-
const stageLockfile = path.join(stageAppDir, "bun.lock");
689-
if (yield* fs.exists(repoLockfile)) {
690-
yield* fs.copy(repoLockfile, stageLockfile);
691-
yield* Effect.log(
692-
"[desktop-artifact] Copied bun.lock to staging directory for deterministic installs",
693-
);
694-
}
695-
696687
yield* Effect.log("[desktop-artifact] Installing staged production dependencies...");
697688
yield* runCommand(
698689
ChildProcess.make({
699690
cwd: stageAppDir,
691+
env: {
692+
...process.env,
693+
// The staging package.json is a flat non-workspace subset of the monorepo.
694+
// There is no pre-existing lockfile, so bun generates a fresh one during
695+
// install. In CI, bun defaults to --frozen-lockfile when it detects CI=true,
696+
// which would reject any install that produces a new lockfile. Explicitly
697+
// disable it so the staging install can resolve and lock its own dependencies.
698+
BUN_FROZEN_LOCKFILE: "0",
699+
},
700700
...commandOutputOptions(options.verbose),
701-
// Windows needs shell mode to resolve .cmd shims (e.g. bun.cmd).
702701
shell: process.platform === "win32",
703-
// The staging package.json is a flat non-workspace subset of the monorepo,
704-
// so the copied bun.lock will have structural differences. Allow bun to
705-
// reconcile the lockfile while still using it for dependency resolution
706-
// guidance. Without this, CI (which defaults to --frozen-lockfile) rejects
707-
// the install because the lockfile doesn't match the staged package.json.
708-
})`bun install --production --no-frozen-lockfile`,
702+
})`bun install --production`,
709703
);
710704

711705
const buildEnv: NodeJS.ProcessEnv = {

0 commit comments

Comments
 (0)