@doryski/release 1.1.0 → 1.1.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/README.md +4 -0
- package/dist/{chunk-IE5POH6X.js → chunk-EBHQERFN.js} +3 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -71,6 +71,10 @@ Section content comes from one of two places:
|
|
|
71
71
|
→ `### Breaking Changes`. Scopes render as a bold prefix. Non-user-facing
|
|
72
72
|
types (`chore`, `docs`, `test`, `ci`, `build`, `style`, `release`) are dropped.
|
|
73
73
|
|
|
74
|
+
Link references are maintained only where the document already uses them: a
|
|
75
|
+
`[X.Y.Z]: …/releases/tag/vX.Y.Z` entry is added for the new version, and an
|
|
76
|
+
`[Unreleased]: …/compare/vX.Y.Z...HEAD` entry is repointed at it.
|
|
77
|
+
|
|
74
78
|
When neither source yields anything, `CHANGELOG.md` is left untouched.
|
|
75
79
|
|
|
76
80
|
## Programmatic use
|
|
@@ -107,6 +107,8 @@ var withLinkRef = (tail, version) => {
|
|
|
107
107
|
if (lines.some((line) => line.startsWith(`[${version}]:`))) return tail;
|
|
108
108
|
return [...lines.slice(0, at), ref, ...lines.slice(at)].join("\n");
|
|
109
109
|
};
|
|
110
|
+
var UNRELEASED_REF_RE = /^(\[Unreleased\]:\s*\S*\/compare\/)v\d+\.\d+\.\d+(\.{3}HEAD)\s*$/i;
|
|
111
|
+
var withUnreleasedRef = (tail, version) => tail.split("\n").map((line) => line.replace(UNRELEASED_REF_RE, `$1v${version}$2`)).join("\n");
|
|
110
112
|
var buildChangelog = ({
|
|
111
113
|
content,
|
|
112
114
|
version,
|
|
@@ -123,7 +125,7 @@ var buildChangelog = ({
|
|
|
123
125
|
`## [${released}] - ${date}
|
|
124
126
|
|
|
125
127
|
${body}`,
|
|
126
|
-
withLinkRef(tail.trim(), released)
|
|
128
|
+
withUnreleasedRef(withLinkRef(tail.trim(), released), released)
|
|
127
129
|
].filter((block) => Boolean(block));
|
|
128
130
|
return `${blocks.join("\n\n")}
|
|
129
131
|
`;
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED