Skip to content

Commit

Permalink
improve publish.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
mmkal committed May 18, 2024
1 parent 7af181e commit e9005d9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions scripts/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,12 @@ const main = async () => {
const {stdout: uncommitedChanges} = await execa('git', ['status', '--porcelain', '--', '.'], {
cwd: pkg.path,
})
const sections = [...stdout.split('\n').map(line => `- ${line}`), uncommitedChanges.trim() && 'Uncommitted changes:\n' + uncommitedChanges]
const commitBullets = stdout.split('\n').filter(Boolean).map(line => `- ${line}`)
const sections = [
commitBullets.length && '<h3>Commits</h3>\n',
...commitBullets,
uncommitedChanges.trim() && 'Uncommitted changes:\n' + uncommitedChanges,
]
return sections.filter(Boolean).join('\n')
}

Expand Down Expand Up @@ -487,10 +492,12 @@ const main = async () => {
`<summary>Dependency ${depPkg.name} changed (${bumpedDeps.updated[dep]})</summary>`,
'',
'<blockquote>',
...(depChanges
depChanges
.split('\n')
.filter(line => !line.match(/^<!-- data-change-type=".*" -->$/))
.map(line => (line.trim() ? `${line}` : line)) || bumpedDeps.updated[dep]),
.map(line => (line.trim() ? `${line}` : line))
.join('\n')
|| `${bumpedDeps.updated[dep]} (Version bump)`,
'</blockquote>',
'</details>',
].join('\n')
Expand Down

0 comments on commit e9005d9

Please sign in to comment.