Skip to content

Commit 0f3ace4

Browse files
committed
🩹 Fix packager plugin & esbuild issues
1 parent 92253d3 commit 0f3ace4

File tree

4 files changed

+11
-30
lines changed

4 files changed

+11
-30
lines changed

tools/esbuild.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ const DEV_CONFIG: esbuild.BuildOptions = {
217217
}
218218

219219
const PROD_CONFIG: esbuild.BuildOptions = {
220+
...COMMON_CONFIG,
220221
minify: true,
221222
keepNames: true,
222223
drop: ['debugger'],

tools/plugins/packagerPlugin.ts

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -126,35 +126,19 @@ function plugin(): Plugin {
126126
)
127127
}
128128

129-
const changeList = versionChangelog.categories.find(
130-
(c: any) => c.title === 'Changes'
131-
)
132-
let changes = ''
133-
if (changeList) {
134-
changes =
135-
'### Changes\n\n' +
136-
changeList.list
137-
.map((v: any) => '- ' + v)
138-
.join('\n')
139-
.replace('[BREAKING]', '⚠️ **BREAKING CHANGE** — ')
140-
}
141-
const fixList = versionChangelog.categories.find(
142-
(c: any) => c.title === 'Fixes'
143-
)
144-
let fixes = ''
145-
if (fixList) {
146-
fixes =
147-
'### Fixes\n\n' +
148-
fixList.list
149-
.map((v: any) => '- ' + v)
129+
let categories = ''
130+
for (const category of versionChangelog.categories) {
131+
categories +=
132+
`\n\n### ${category.title}\n\n` +
133+
category.list
134+
.map((v: string) => '- ' + v)
150135
.join('\n')
151-
.replace('[BREAKING]', '⚠️ **BREAKING CHANGE** — ')
136+
.replaceAll('[BREAKING]', '⚠️ **BREAKING** —')
152137
}
153138

154139
content = replaceTemplateVars(content, {
155140
version: PACKAGE.version,
156-
changes,
157-
fixes,
141+
categories: categories.trim(),
158142
pings: pings.trim(),
159143
})
160144

tools/plugins/releaseNoteTemplates/discord_release_notes_template

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
# :AnimatedJava: Animated Java Release v{version}
44

5-
{changes}
6-
7-
{fixes}
5+
{categories}
86

97
## How to Install
108

tools/plugins/releaseNoteTemplates/github_release_notes_template

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Animated Java Release v{version}
22

3-
{changes}
4-
5-
{fixes}
3+
{categories}
64

75
## How to Install
86

0 commit comments

Comments
 (0)