Open History to see the last commit
1import "vite-plus/test/config";
2import { defineConfig, mergeConfig } from "vite-plus";
3
4import baseConfig from "../../vite.config.ts";
5import { loadRepoEnv } from "../../scripts/lib/public-config.ts";
6
7const bundledPackagePrefixes = [
8 "@pierre/diffs",
9 "@t3tools/",
10 "effect-acp",
11 "effect-codex-app-server",
12];
13
14export function shouldBundleCliDependency(id: string): boolean {
15 return bundledPackagePrefixes.some((prefix) => id.startsWith(prefix));
16}
17
18const repoEnv = loadRepoEnv();
19
20export default mergeConfig(
21 baseConfig,
22 defineConfig({
23 run: {
24 tasks: {
25 build: {
26 command: "node scripts/cli.ts build",
27 dependsOn: ["@t3tools/web#build"],
28 cache: false,
29 },
30 },
31 },
32 pack: {
33 entry: ["src/bin.ts"],
34 outDir: "dist",
35 sourcemap: true,
36 clean: true,
37 deps: {
38 alwaysBundle: shouldBundleCliDependency,
39 onlyBundle: false,
40 },
41 banner: {
42 js: "#!/usr/bin/env node\n",
43 },
44 define: {
45 __T3CODE_BUILD_RELAY_URL__: JSON.stringify(repoEnv.T3CODE_RELAY_URL?.trim() ?? ""),
46 __T3CODE_BUILD_CLERK_PUBLISHABLE_KEY__: JSON.stringify(
47 repoEnv.T3CODE_CLERK_PUBLISHABLE_KEY?.trim() ?? "",
48 ),
49 __T3CODE_BUILD_CLERK_CLI_OAUTH_CLIENT_ID__: JSON.stringify(
50 repoEnv.T3CODE_CLERK_CLI_OAUTH_CLIENT_ID?.trim() ?? "",
51 ),
52 __T3CODE_BUILD_RELAY_CLIENT_OTLP_TRACES_URL__: JSON.stringify(
53 repoEnv.T3CODE_RELAY_CLIENT_OTLP_TRACES_URL?.trim() ?? "",
54 ),
55 __T3CODE_BUILD_RELAY_CLIENT_OTLP_TRACES_DATASET__: JSON.stringify(
56 repoEnv.T3CODE_RELAY_CLIENT_OTLP_TRACES_DATASET?.trim() ?? "",
57 ),
58 __T3CODE_BUILD_RELAY_CLIENT_OTLP_TRACES_TOKEN__: JSON.stringify(
59 repoEnv.T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN?.trim() ?? "",
60 ),
61 },
62 },
63 test: {
64 // The server suite exercises sqlite, git, temp worktrees, and orchestration
65 // runtimes heavily. Running files in parallel introduces load-sensitive flakes.
66 fileParallelism: false,
67 // Server integration tests exercise sqlite, git, and orchestration together.
68 // Under package-wide runs they can exceed the default budget on loaded CI hosts.
69 hookTimeout: 120_000,
70 testTimeout: 120_000,
71 },
72 }),
73);