fix(dw): 🐛 run bun install at start of setup so fresh worktrees have tsx

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.
This commit is contained in:
amianthus
2026-05-16 15:13:51 +01:00
parent 8274cc7510
commit fe222b9945

View File

@@ -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<RegistryEntry> {
@@ -18,6 +19,12 @@ export async function cmdSetup(): Promise<RegistryEntry> {
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();