@releasekit/notes 0.38.0 → 0.38.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/dist/{aggregator-GQ55YUGA.js → aggregator-74VELOCJ.js} +2 -2
- package/dist/{chunk-J2CKYTB2.js → chunk-2FU6P7SA.js} +4 -4
- package/dist/{chunk-JIYLIQQ6.js → chunk-EWEPFCCT.js} +23 -2
- package/dist/{chunk-SY2YT6H3.js → chunk-WTOR47NP.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/index.js +3 -3
- package/package.json +3 -3
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
success,
|
|
12
12
|
warn,
|
|
13
13
|
writeMarkdown
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-EWEPFCCT.js";
|
|
15
15
|
|
|
16
16
|
// ../config/dist/index.js
|
|
17
17
|
import * as fs from "fs";
|
|
@@ -285,7 +285,7 @@ var ChangelogConfigSchema = z.object({
|
|
|
285
285
|
file: z.string().optional().describe("Changelog file name override (default: CHANGELOG.md)"),
|
|
286
286
|
templates: TemplateConfigSchema.optional().describe("Template configuration for changelog"),
|
|
287
287
|
refs: z.enum(["strip", "escape", "link"]).default("link").describe(
|
|
288
|
-
"How `#NNN` issue/PR refs in the changelog are rendered. 'link' (default): the PR and the issues it closed are labelled as `(PR #503 \xB7 closes #500)`, where the PR links to its canonical /pull/ URL with `PR #503` as the visible text \u2014 this keeps the GitHub hovercard but stops the bare-token rich inline card that duplicated the entry; closed issues link to /issues/. An entry with no identifiable PR (a non-squash commit, or a non-GitHub repo) falls back to a plain ref list. 'escape': plain text \\#NNN (no link, no hovercard, no PR/closes labelling). 'strip': refs are removed entirely. Scoped-package / @user mentions in entry text are always neutralised regardless of this setting."
|
|
288
|
+
"How `#NNN` issue/PR refs in the changelog are rendered. Applies to the whole entry \u2014 both the appended label and any bare `#N` carried over from the commit subject into the description (a description ref that also appears in the appended label is de-duplicated away). 'link' (default): the PR and the issues it closed are labelled as `(PR #503 \xB7 closes #500)`, where the PR links to its canonical /pull/ URL with `PR #503` as the visible text \u2014 this keeps the GitHub hovercard but stops the bare-token rich inline card that duplicated the entry; closed issues link to /issues/. An entry with no identifiable PR (a non-squash commit, or a non-GitHub repo) falls back to a plain ref list. 'escape': plain text \\#NNN (no link, no hovercard, no PR/closes labelling). 'strip': refs are removed entirely. Scoped-package / @user mentions in entry text are always neutralised regardless of this setting."
|
|
289
289
|
)
|
|
290
290
|
}).describe("Changelog file configuration");
|
|
291
291
|
var LLMOptionsSchema = z.object({
|
|
@@ -2939,7 +2939,7 @@ async function runPipeline(input, config, dryRun, pipelineOptions) {
|
|
|
2939
2939
|
const dir = releaseNotesConfig.file.dir;
|
|
2940
2940
|
info(`Generating release notes \u2192 ${dir}`);
|
|
2941
2941
|
try {
|
|
2942
|
-
const { detectMonorepo } = await import("./aggregator-
|
|
2942
|
+
const { detectMonorepo } = await import("./aggregator-74VELOCJ.js");
|
|
2943
2943
|
const nested = detectMonorepo(process.cwd()).isMonorepo || contexts.length > 1;
|
|
2944
2944
|
const renderContent = (ctx) => {
|
|
2945
2945
|
if (releaseNotesConfig.templates?.path) {
|
|
@@ -3001,7 +3001,7 @@ async function processInput(inputJson, config, dryRun, pipelineOptions) {
|
|
|
3001
3001
|
return runPipeline(input, config, dryRun, pipelineOptions);
|
|
3002
3002
|
}
|
|
3003
3003
|
async function writeMonorepoFiles(contexts, config, dryRun, fileName, refs) {
|
|
3004
|
-
const { detectMonorepo, writeMonorepoChangelogs } = await import("./aggregator-
|
|
3004
|
+
const { detectMonorepo, writeMonorepoChangelogs } = await import("./aggregator-74VELOCJ.js");
|
|
3005
3005
|
const cwd = process.cwd();
|
|
3006
3006
|
const detected = detectMonorepo(cwd);
|
|
3007
3007
|
if (!detected.isMonorepo) return [];
|
|
@@ -43,6 +43,23 @@ var CODE_SPAN_OR_MENTION = /`[^`]*`|(?<![0-9A-Za-z_@\\/])@[A-Za-z0-9][A-Za-z0-9-
|
|
|
43
43
|
function escapeChangelogMentions(text) {
|
|
44
44
|
return text.replace(CODE_SPAN_OR_MENTION, (match) => match.startsWith("`") ? match : `\\${match}`);
|
|
45
45
|
}
|
|
46
|
+
var CODE_SPAN_OR_DESC_REF = /`[^`]*`|( ?)(?:\(#(\d+)\)|(?<![\\[/\w])#(\d+)\b)/g;
|
|
47
|
+
function neutralizeDescriptionRefs(text, appendedRefs, mode, repoUrl) {
|
|
48
|
+
const appended = new Set(appendedRefs.filter((r) => !!r).map((r) => Number(r.replace(/^#/, ""))));
|
|
49
|
+
const ownerRepo = mode === "link" && repoUrl ? parseGitHubOwnerRepo(repoUrl) : null;
|
|
50
|
+
const out = text.replace(
|
|
51
|
+
CODE_SPAN_OR_DESC_REF,
|
|
52
|
+
(match, lead, parenNum, bareNum) => {
|
|
53
|
+
const num = parenNum ?? bareNum;
|
|
54
|
+
if (num === void 0) return match;
|
|
55
|
+
const ws = lead ?? "";
|
|
56
|
+
if (appended.has(Number(num)) || mode === "strip") return "";
|
|
57
|
+
const inner = ownerRepo ? `[#${num}](https://github.com/${ownerRepo.owner}/${ownerRepo.repo}/issues/${num})` : `\\#${num}`;
|
|
58
|
+
return parenNum !== void 0 ? `${ws}(${inner})` : `${ws}${inner}`;
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
return out.trim();
|
|
62
|
+
}
|
|
46
63
|
function readPackageVersion(importMetaUrl) {
|
|
47
64
|
try {
|
|
48
65
|
const dir = path2.dirname(fileURLToPath(importMetaUrl));
|
|
@@ -175,7 +192,11 @@ function groupEntriesByType(entries) {
|
|
|
175
192
|
return grouped;
|
|
176
193
|
}
|
|
177
194
|
function formatEntry(entry, opts) {
|
|
178
|
-
const
|
|
195
|
+
const refsMode = opts?.refs ?? "link";
|
|
196
|
+
const appendedRefs = [...entry.issueIds ?? [], entry.prNumber];
|
|
197
|
+
const description = escapeChangelogMentions(
|
|
198
|
+
neutralizeDescriptionRefs(entry.description, appendedRefs, refsMode, opts?.repoUrl ?? null)
|
|
199
|
+
);
|
|
179
200
|
const scope = entry.scope ? escapeChangelogMentions(entry.scope) : void 0;
|
|
180
201
|
const leadIn = entry.leadIn ? escapeChangelogMentions(entry.leadIn) : void 0;
|
|
181
202
|
let line;
|
|
@@ -192,7 +213,7 @@ function formatEntry(entry, opts) {
|
|
|
192
213
|
} else {
|
|
193
214
|
line = `- ${description}`;
|
|
194
215
|
}
|
|
195
|
-
const refs = renderIssueRefs(entry.issueIds ?? [],
|
|
216
|
+
const refs = renderIssueRefs(entry.issueIds ?? [], refsMode, opts?.repoUrl ?? null, entry.prNumber);
|
|
196
217
|
if (refs) {
|
|
197
218
|
line += ` ${refs}`;
|
|
198
219
|
}
|
package/dist/cli.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
createNotesCommand
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2FU6P7SA.js";
|
|
5
5
|
import {
|
|
6
6
|
readPackageVersion
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EWEPFCCT.js";
|
|
8
8
|
|
|
9
9
|
// src/cli.ts
|
|
10
10
|
import * as fs from "fs";
|
package/dist/index.js
CHANGED
|
@@ -18,12 +18,12 @@ import {
|
|
|
18
18
|
runPipeline,
|
|
19
19
|
saveAuth,
|
|
20
20
|
versionOutputToChangelogInput
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-2FU6P7SA.js";
|
|
22
22
|
import {
|
|
23
23
|
aggregateToRoot,
|
|
24
24
|
detectMonorepo,
|
|
25
25
|
writeMonorepoChangelogs
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-WTOR47NP.js";
|
|
27
27
|
import {
|
|
28
28
|
debug,
|
|
29
29
|
formatVersion,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
renderMarkdown,
|
|
32
32
|
success,
|
|
33
33
|
writeMarkdown
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-EWEPFCCT.js";
|
|
35
35
|
|
|
36
36
|
// src/output/json.ts
|
|
37
37
|
import * as fs from "fs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@releasekit/notes",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.1",
|
|
4
4
|
"description": "Release notes and changelog generation with LLM-powered enhancement and flexible templating",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
"tsup": "^8.5.1",
|
|
70
70
|
"typescript": "^5.9.3",
|
|
71
71
|
"vitest": "^4.1.9",
|
|
72
|
-
"@releasekit/forge": "0.0.0",
|
|
73
|
-
"@releasekit/core": "0.0.0",
|
|
74
72
|
"@releasekit/config": "0.0.0",
|
|
73
|
+
"@releasekit/core": "0.0.0",
|
|
74
|
+
"@releasekit/forge": "0.0.0",
|
|
75
75
|
"@releasekit/git": "0.0.0"
|
|
76
76
|
},
|
|
77
77
|
"engines": {
|