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 = ["@pierre/diffs", "@v12/", "effect-acp", "effect-codex-app-server"];
8
9export function shouldBundleCliDependency(id: string): boolean {
10 return bundledPackagePrefixes.some((prefix) => id.startsWith(prefix));
11}
12
13const repoEnv = loadRepoEnv();
14
15export default mergeConfig(
16 baseConfig,
17 defineConfig({
18 run: {
19 tasks: {
20 build: {
21 command: "node scripts/cli.ts build",
22 dependsOn: ["@v12/web#build"],
23 cache: false,
24 },
25 },
26 },
27 pack: {
28 entry: ["src/bin.ts"],
29 outDir: "dist",
30 sourcemap: true,
31 clean: true,
32 deps: {
33 alwaysBundle: shouldBundleCliDependency,
34 onlyBundle: false,
35 },
36 banner: {
37 js: "#!/usr/bin/env node\n",
38 },
39 define: {
40 __V12_BUILD_RELAY_URL__: JSON.stringify(repoEnv.V12_RELAY_URL?.trim() ?? ""),
41 __V12_BUILD_CLERK_PUBLISHABLE_KEY__: JSON.stringify(
42 repoEnv.V12_CLERK_PUBLISHABLE_KEY?.trim() ?? "",
43 ),
44 __V12_BUILD_CLERK_CLI_OAUTH_CLIENT_ID__: JSON.stringify(
45 repoEnv.V12_CLERK_CLI_OAUTH_CLIENT_ID?.trim() ?? "",
46 ),
47 __V12_BUILD_RELAY_CLIENT_OTLP_TRACES_URL__: JSON.stringify(
48 repoEnv.V12_RELAY_CLIENT_OTLP_TRACES_URL?.trim() ?? "",
49 ),
50 __V12_BUILD_RELAY_CLIENT_OTLP_TRACES_DATASET__: JSON.stringify(
51 repoEnv.V12_RELAY_CLIENT_OTLP_TRACES_DATASET?.trim() ?? "",
52 ),
53 __V12_BUILD_RELAY_CLIENT_OTLP_TRACES_TOKEN__: JSON.stringify(
54 repoEnv.V12_RELAY_CLIENT_OTLP_TRACES_TOKEN?.trim() ?? "",
55 ),
56 },
57 },
58 test: {
59 // The server suite exercises sqlite, git, temp worktrees, and orchestration
60 // runtimes heavily. Running files in parallel introduces load-sensitive flakes.
61 fileParallelism: false,
62 // Server integration tests exercise sqlite, git, and orchestration together.
63 // Under package-wide runs they can exceed the default budget on loaded CI hosts.
64 hookTimeout: 120_000,
65 testTimeout: 120_000,
66 },
67 }),
68);