Skip to content

Commit 75ec830

Browse files
authored
fix: Fix parallel build race condition in CI publish (#1159)
1 parent 62859d8 commit 75ec830

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

apps/code/vite.main.config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ export default defineConfig(({ mode }) => {
469469
copyPosthogPlugin(isDev),
470470
copyDrizzleMigrations(),
471471
copyCodexAcpBinaries(),
472-
createPosthogPlugin(env),
472+
createPosthogPlugin(env, "posthog-code-main"),
473473
].filter(Boolean),
474474
define: {
475475
__BUILD_COMMIT__: JSON.stringify(getGitCommit()),

apps/code/vite.renderer.config.mts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ export default defineConfig(({ mode }) => {
1919
const env = loadEnv(mode, path.resolve(__dirname, "../.."), "");
2020

2121
return {
22-
plugins: [react(), tsconfigPaths(), createPosthogPlugin(env)].filter(
23-
Boolean,
24-
),
22+
plugins: [
23+
react(),
24+
tsconfigPaths(),
25+
createPosthogPlugin(env, "posthog-code-renderer"),
26+
].filter(Boolean),
2527
build: {
2628
sourcemap: true,
2729
},

apps/code/vite.shared.mts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
77

88
export function createPosthogPlugin(
99
env: Record<string, string>,
10+
project: string,
1011
): Plugin | null {
1112
if (!env.POSTHOG_SOURCEMAP_API_KEY || !env.POSTHOG_ENV_ID) {
1213
return null;
@@ -16,7 +17,7 @@ export function createPosthogPlugin(
1617
envId: env.POSTHOG_ENV_ID,
1718
host: env.POSTHOG_HOST,
1819
sourcemaps: {
19-
team: "posthog-code",
20+
project,
2021
deleteAfterUpload: true,
2122
},
2223
});

0 commit comments

Comments
 (0)