Skip to content

Commit f9fcf08

Browse files
committed
Update publish.ts
1 parent 4570067 commit f9fcf08

1 file changed

Lines changed: 33 additions & 19 deletions

File tree

script/publish.ts

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ async function getAreasForCommit(hash: string): Promise<string[]> {
4242
for (const file of files.split("\n").filter(Boolean)) {
4343
for (const pkg of PACKAGE_PATHS) {
4444
if (file.startsWith(pkg + "/") || file === pkg) {
45-
// Simplify path for display: "packages/opencode" -> "opencode", "github" -> "github"
4645
const area = pkg.replace("packages/", "").replace("sdks/", "")
4746
areas.add(area)
4847
break
@@ -63,20 +62,19 @@ if (!Script.preview) {
6362
})
6463
.then((data: any) => data.version)
6564

66-
// Get all commits, not filtered by path - we'll categorize everything
6765
const log = await $`git log v${previous}..HEAD --oneline --format="%h %s"`.text()
6866

69-
const commitLines = log.split("\n").filter((line) => line && !line.match(/^\w+ (ignore:|test:|chore:|ci:)/i))
70-
71-
// Add area info to each commit
72-
const commitsWithAreas: string[] = []
73-
for (const line of commitLines) {
74-
const hash = line.split(" ")[0]
75-
if (!hash) continue
76-
const areas = await getAreasForCommit(hash)
77-
const areaStr = areas.length > 0 ? ` [areas: ${areas.join(", ")}]` : " [areas: other]"
78-
commitsWithAreas.push(`${line}${areaStr}`)
79-
}
67+
const commitLines = log.split("\n").filter((line) => line && !line.match(/^\w+ (ignore:|test:|chore:|ci:|release:)/i))
68+
69+
const commitsWithAreas = await Promise.all(
70+
commitLines.map(async (line) => {
71+
const hash = line.split(" ")[0]
72+
if (!hash) return null
73+
const areas = await getAreasForCommit(hash)
74+
const areaStr = areas.length > 0 ? ` [areas: ${areas.join(", ")}]` : " [areas: other]"
75+
return `${line}${areaStr}`
76+
}),
77+
).then((results) => results.filter(Boolean) as string[])
8078
const commits = commitsWithAreas.join("\n")
8179

8280
const opencode = await createOpencode()
@@ -114,8 +112,8 @@ Group the changes into these categories based on the [areas: ...] tags (omit any
114112
115113
Rules:
116114
- Use the [areas: ...] tags to determine the correct category. If a commit touches multiple areas, put it in the most relevant user-facing category.
117-
- INCLUDE all commits that could affect users, even if the commit message is vague (like "fix: id" or "tweak: more retry cases"). When the message is vague, write a brief user-facing description based on the commit prefix and package context.
118-
- Only EXCLUDE "release:" commits. Include everything else - refactors, tweaks, and fixes can all impact users.
115+
- INCLUDE all commits provided. Even if the commit message is vague (like "fix: id" or "tweak: more retry cases"), write a brief user-facing description based on the commit prefix and area context.
116+
- Include everything - refactors, tweaks, and fixes can all impact users.
119117
- Do NOT make general statements about "improvements", be very specific about what was changed.
120118
- For commits that are already well-written and descriptive, avoid rewording them. Simply capitalize the first letter, fix any misspellings, and ensure proper English grammar.
121119
- DO NOT read any other commits than the ones listed above (THIS IS IMPORTANT TO AVOID DUPLICATING THINGS IN OUR CHANGELOG).
@@ -128,12 +126,28 @@ IMPORTANT: ONLY return the grouped changelog, do not include any other informati
128126
129127
<example>
130128
## TUI
131-
- Added ability to @ mention agents
129+
- Added experimental support for the Ty language server (@OpeOginni)
130+
- Added /fork slash command for keyboard-friendly session forking (@ariane-emory)
132131
- Increased retry attempts for failed requests
133-
- Fixed a bug where the TUI would render improperly on some terminals (@communityuser)
132+
- Fixed model validation before executing slash commands (@devxoul)
134133
135134
## Desktop
136-
- Improved startup performance on Windows
135+
- Added shell mode support
136+
- Fixed prompt history navigation and optimistic prompt duplication
137+
- Disabled pinch-to-zoom on Linux (@Brendonovich)
138+
139+
## Extensions
140+
- Added OIDC_BASE_URL support for custom GitHub App installations (@elithrar)
141+
142+
## UI
143+
- Fixed markdown styling issues
144+
- Fixed checkbox rendering in Safari
145+
146+
## Docs
147+
- Fixed typos in documentation (@byigitt)
148+
149+
## Other
150+
- Updated Nix flake.lock and dependency hashes
137151
</example>
138152
`,
139153
},
@@ -143,7 +157,7 @@ IMPORTANT: ONLY return the grouped changelog, do not include any other informati
143157
.then((x) => x.data?.parts?.find((y) => y.type === "text")?.text)
144158
for (const line of raw?.split("\n") ?? []) {
145159
if (line.startsWith("## ")) {
146-
if (notes.length > 0) notes.push("") // blank line before new section
160+
if (notes.length > 0) notes.push("")
147161
notes.push(line)
148162
} else if (line.startsWith("- ")) {
149163
notes.push(line)

0 commit comments

Comments
 (0)