import "vite-plus/test/config"; import { defineConfig, mergeConfig } from "vite-plus"; import baseConfig from "../../vite.config.ts"; import { loadRepoEnv } from "../../scripts/lib/public-config.ts"; const internalPackagePrefixes = ["@t3tools/", "effect-acp", "effect-codex-app-server"]; const repoEnv = loadRepoEnv(); export default mergeConfig( baseConfig, defineConfig({ run: { tasks: { build: { command: "node scripts/cli.ts build", dependsOn: ["@t3tools/web#build"], cache: false, }, }, }, pack: { entry: ["src/bin.ts"], outDir: "dist", sourcemap: true, clean: true, deps: { alwaysBundle: (id: string) => internalPackagePrefixes.some((prefix) => id.startsWith(prefix)), onlyBundle: false, }, banner: { js: "#!/usr/bin/env node\n", }, define: { __T3CODE_BUILD_RELAY_URL__: JSON.stringify(repoEnv.T3CODE_RELAY_URL?.trim() ?? ""), __T3CODE_BUILD_CLERK_PUBLISHABLE_KEY__: JSON.stringify( repoEnv.T3CODE_CLERK_PUBLISHABLE_KEY?.trim() ?? "", ), __T3CODE_BUILD_CLERK_CLI_OAUTH_CLIENT_ID__: JSON.stringify( repoEnv.T3CODE_CLERK_CLI_OAUTH_CLIENT_ID?.trim() ?? "", ), }, }, test: { // The server suite exercises sqlite, git, temp worktrees, and orchestration // runtimes heavily. Running files in parallel introduces load-sensitive flakes. fileParallelism: false, // Server integration tests exercise sqlite, git, and orchestration together. // Under package-wide runs they can exceed the default budget on loaded CI hosts. hookTimeout: 120_000, testTimeout: 120_000, }, }), );