From fe222b9945cce91dee3e0ee78b17ae9ed7a7ef37 Mon Sep 17 00:00:00 2001 From: amianthus <49116958+SirTenzin@users.noreply.github.com> Date: Sat, 16 May 2026 15:13:51 +0100 Subject: [PATCH] =?UTF-8?q?fix(dw):=20=F0=9F=90=9B=20run=20bun=20install?= =?UTF-8?q?=20at=20start=20of=20setup=20so=20fresh=20worktrees=20have=20ts?= =?UTF-8?q?x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Conductor/Superset clone a bare worktree with no node_modules. The legacy .superset/setup.sh ran bun install; cmdSetup did not, so drizzle-kit generate (which executes the temp .ts drizzle config via NODE_OPTIONS=--import tsx) failed with ERR_MODULE_NOT_FOUND for tsx. Now cmdSetup runs bun install at the very top — Bun no-ops when lockfile matches, so the cost on repeat runs is negligible. --- scripts/dw/commands/setup.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/dw/commands/setup.ts b/scripts/dw/commands/setup.ts index 641d5c95d..bfd00cff4 100644 --- a/scripts/dw/commands/setup.ts +++ b/scripts/dw/commands/setup.ts @@ -1,4 +1,4 @@ -import { fatal, log } from "../helpers/shell.ts"; +import { fatal, log, shInherit } from "../helpers/shell.ts"; import { getCanonicalWorktree, getCurrentWorktree } from "../helpers/git.ts"; import { loadRegistry, @@ -11,6 +11,7 @@ import { setupAgentWorktree, autoSetupTestOrg } from "../helpers/setup.ts"; import { ensureComposeStack } from "../helpers/compose.ts"; import { writeEnvLocalFiles } from "../helpers/env-files.ts"; import { ensureEmulateRunning } from "../helpers/emulate.ts"; +import { PROJECT_ROOT } from "../constants.ts"; import type { RegistryEntry } from "../types.ts"; export async function cmdSetup(): Promise { @@ -18,6 +19,12 @@ export async function cmdSetup(): Promise { fatal("bun dw is disabled in production"); } + // Fresh Conductor/Superset worktrees have no node_modules; drizzle-kit needs tsx. + // Bun is fast no-op when lockfile matches installed tree. + log("ensuring deps installed (bun install)"); + const installCode = shInherit("bun", ["install"], { cwd: PROJECT_ROOT }); + if (installCode !== 0) fatal(`bun install failed (exit ${installCode})`); + const canonical = getCanonicalWorktree(); const cwd = getCurrentWorktree(); let registry = loadRegistry();