@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 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
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  release
4
- } from "./chunk-IE5POH6X.js";
4
+ } from "./chunk-EBHQERFN.js";
5
5
 
6
6
  // src/cli.ts
7
7
  import { Command, InvalidArgumentError } from "commander";
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  parseCommit,
4
4
  release,
5
5
  renderEntries
6
- } from "./chunk-IE5POH6X.js";
6
+ } from "./chunk-EBHQERFN.js";
7
7
  export {
8
8
  buildChangelog,
9
9
  parseCommit,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doryski/release",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "A conventional-commit release CLI and reusable GitHub Actions workflow for npm packages",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",