Skip to content

Commit cc261cc

Browse files
committed
Fix build
1 parent 8728fda commit cc261cc

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

apps/web/utils/changelog-ai.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { generateObject } from "ai";
22
import { z } from "zod";
3-
import { PostType } from "@repo/supabase";
43
import { openRouter } from "./ai-gateway";
54
import { getPRCommits, getPRDetails, getPRFiles } from "./github";
5+
import { PostType } from "@changes-page/supabase/types/page";
66

77
export interface ChangelogInput {
88
pr: Awaited<ReturnType<typeof getPRDetails>>;
@@ -36,7 +36,7 @@ const MAX_COMMITS = 50;
3636
const MAX_FILES = 100;
3737

3838
export async function generateChangelog(
39-
input: ChangelogInput,
39+
input: ChangelogInput
4040
): Promise<ChangelogOutput> {
4141
const truncatedCommits = input.commits.slice(0, MAX_COMMITS);
4242
const truncatedFiles = [...input.files]
@@ -61,7 +61,11 @@ Generate:
6161
6262
<summary-rules>
6363
The summary will be posted as a GitHub comment to inform the developer what was done.
64-
${input.previousDraft ? "This is a REVISION of an existing draft based on user feedback." : "This is a NEW changelog draft."}
64+
${
65+
input.previousDraft
66+
? "This is a REVISION of an existing draft based on user feedback."
67+
: "This is a NEW changelog draft."
68+
}
6569
6670
${
6771
input.previousDraft
@@ -75,9 +79,13 @@ Keep it to 1-2 sentences. Be specific about the main features/changes covered.
7579
</summary-rules>
7680
</instructions>
7781
78-
${input.userInstructions ? `<user-instructions>
82+
${
83+
input.userInstructions
84+
? `<user-instructions>
7985
"""${input.userInstructions}"""
80-
</user-instructions>` : ""}`,
86+
</user-instructions>`
87+
: ""
88+
}`,
8189
prompt: `<input>
8290
<pr-title>
8391
"""${input.pr.title}"""
@@ -92,7 +100,9 @@ ${truncatedCommits.map((c) => c.commit.message).join("\n")}
92100
"""
93101
</commits>
94102
95-
<files-changed additions="${input.pr.additions}" deletions="${input.pr.deletions}">
103+
<files-changed additions="${input.pr.additions}" deletions="${
104+
input.pr.deletions
105+
}">
96106
"""
97107
${truncatedFiles.map((f) => `${f.status}: ${f.filename}`).join("\n")}
98108
"""

0 commit comments

Comments
 (0)