@npmcli/template-oss 4.21.0 → 4.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/content/index.js
CHANGED
|
@@ -199,10 +199,10 @@ module.exports = {
|
|
|
199
199
|
},
|
|
200
200
|
allowedPackages: [],
|
|
201
201
|
changelogTypes: [
|
|
202
|
-
{ type: 'feat', section: 'Features', hidden: false },
|
|
203
|
-
{ type: 'fix', section: 'Bug Fixes', hidden: false },
|
|
204
|
-
{ type: 'docs', section: 'Documentation', hidden: false },
|
|
205
|
-
{ type: 'deps', section: 'Dependencies', hidden: false },
|
|
206
|
-
{ type: 'chore', section: 'Chores', hidden: false },
|
|
202
|
+
{ type: 'feat', section: 'Features', hidden: false, collapse: false },
|
|
203
|
+
{ type: 'fix', section: 'Bug Fixes', hidden: false, collapse: false },
|
|
204
|
+
{ type: 'docs', section: 'Documentation', hidden: false, collapse: false },
|
|
205
|
+
{ type: 'deps', section: 'Dependencies', hidden: false, collapse: false },
|
|
206
|
+
{ type: 'chore', section: 'Chores', hidden: false, collapse: true },
|
|
207
207
|
],
|
|
208
208
|
}
|
package/lib/release/changelog.js
CHANGED
|
@@ -6,6 +6,7 @@ class Changelog {
|
|
|
6
6
|
#title
|
|
7
7
|
#entries = {}
|
|
8
8
|
#types = new Set([Changelog.BREAKING])
|
|
9
|
+
#sections = {}
|
|
9
10
|
#titles = {
|
|
10
11
|
[Changelog.BREAKING]: '⚠️ BREAKING CHANGES',
|
|
11
12
|
}
|
|
@@ -14,6 +15,7 @@ class Changelog {
|
|
|
14
15
|
this.#title = `## ${url ? link(version, url) : version} (${formatDate()})`
|
|
15
16
|
for (const section of sections) {
|
|
16
17
|
this.#types.add(section.type)
|
|
18
|
+
this.#sections[section.type] = section
|
|
17
19
|
this.#titles[section.type] = section.section
|
|
18
20
|
}
|
|
19
21
|
}
|
|
@@ -26,6 +28,16 @@ class Changelog {
|
|
|
26
28
|
this.#entries[type].push(...entries)
|
|
27
29
|
}
|
|
28
30
|
|
|
31
|
+
#getEntries (type) {
|
|
32
|
+
const section = this.#sections[type]
|
|
33
|
+
const entries = this.#entries[type].map(list)
|
|
34
|
+
if (section?.collapse) {
|
|
35
|
+
entries.unshift('<details><summary>Commits</summary>\n')
|
|
36
|
+
entries.push('\n</details>')
|
|
37
|
+
}
|
|
38
|
+
return entries.join('\n')
|
|
39
|
+
}
|
|
40
|
+
|
|
29
41
|
toString () {
|
|
30
42
|
const body = [this.#title]
|
|
31
43
|
for (const type of this.#types) {
|
|
@@ -33,7 +45,7 @@ class Changelog {
|
|
|
33
45
|
if (this.#entries[type]?.length) {
|
|
34
46
|
body.push(
|
|
35
47
|
`### ${title}`,
|
|
36
|
-
this.#
|
|
48
|
+
this.#getEntries(type)
|
|
37
49
|
)
|
|
38
50
|
}
|
|
39
51
|
}
|