@releasekit/notes 0.43.1 → 0.44.0
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-SCGIHWXW.js → aggregator-N733ZTAA.js} +2 -2
- package/dist/{chunk-YIHEHXCU.js → chunk-ECBA67PM.js} +48 -60
- package/dist/{chunk-T54LUVMQ.js → chunk-UAPJMRGO.js} +255 -168
- package/dist/{chunk-6HUNK367.js → chunk-ZY4HXAQV.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +11 -3
- package/dist/index.js +3 -3
- package/docs/llm-release-notes.md +17 -1
- package/docs/monorepo.md +2 -0
- package/package.json +1 -1
|
@@ -8,6 +8,15 @@ import { fileURLToPath } from "url";
|
|
|
8
8
|
import chalk from "chalk";
|
|
9
9
|
import { minimatch } from "minimatch";
|
|
10
10
|
import * as path3 from "path";
|
|
11
|
+
var CODE_SPAN_OR_COMMENT_OPEN = /(?<!(?<!\\)\\(?:\\\\)*)`[^`]*`|<!--/g;
|
|
12
|
+
function escapeCommentOpeners(text, opts) {
|
|
13
|
+
return text.replace(CODE_SPAN_OR_COMMENT_OPEN, (match) => {
|
|
14
|
+
if (!match.startsWith("`")) {
|
|
15
|
+
return "<!--";
|
|
16
|
+
}
|
|
17
|
+
return opts?.keepCodeSpans ? match : match.replaceAll("<!--", "<!\u200B--");
|
|
18
|
+
});
|
|
19
|
+
}
|
|
11
20
|
function parseGitHubOwnerRepo(repoUrl) {
|
|
12
21
|
const [, scpOwner, scpRepo] = repoUrl.match(/^git@github\.com:([^/]+)\/(.+?)(?:\.git)?$/) ?? [];
|
|
13
22
|
if (scpOwner && scpRepo) {
|
|
@@ -369,14 +378,14 @@ function firstReleaseLine(context, config) {
|
|
|
369
378
|
return template.replaceAll("${packageName}", context.packageName).replaceAll("${version}", context.version);
|
|
370
379
|
}
|
|
371
380
|
var SECTION_ORDER = ["Added", "Changed", "Deprecated", "Removed", "Fixed", "Security"];
|
|
381
|
+
function escapeCommitText(text) {
|
|
382
|
+
return escapeCommentOpeners(escapeChangelogMentions(text), { keepCodeSpans: true });
|
|
383
|
+
}
|
|
372
384
|
function formatEntry(entry, opts) {
|
|
373
385
|
const refsMode = opts?.refs ?? "link";
|
|
374
386
|
const appendedRefs = [...entry.issueIds ?? [], entry.prNumber];
|
|
375
|
-
const description =
|
|
376
|
-
|
|
377
|
-
);
|
|
378
|
-
const scope = entry.scope ? escapeChangelogMentions(entry.scope) : void 0;
|
|
379
|
-
const leadIn = entry.leadIn ? escapeChangelogMentions(entry.leadIn) : void 0;
|
|
387
|
+
const description = neutralizeDescriptionRefs(entry.description, appendedRefs, refsMode, opts?.repoUrl ?? null);
|
|
388
|
+
const { scope, leadIn } = entry;
|
|
380
389
|
let line;
|
|
381
390
|
if (leadIn && entry.breaking) {
|
|
382
391
|
line = `- **BREAKING** **${leadIn}**: ${description}`;
|
|
@@ -395,11 +404,10 @@ function formatEntry(entry, opts) {
|
|
|
395
404
|
if (refs) {
|
|
396
405
|
line += ` ${refs}`;
|
|
397
406
|
}
|
|
398
|
-
return line;
|
|
407
|
+
return escapeCommitText(line);
|
|
399
408
|
}
|
|
400
409
|
function formatCategorySection(name, entries, refOpts) {
|
|
401
|
-
const
|
|
402
|
-
lines.push(`### ${name}`);
|
|
410
|
+
const blocks = [`### ${name}`];
|
|
403
411
|
const scopeCounts = /* @__PURE__ */ new Map();
|
|
404
412
|
for (const entry of entries) {
|
|
405
413
|
if (entry.scope) {
|
|
@@ -412,36 +420,27 @@ function formatCategorySection(name, entries, refOpts) {
|
|
|
412
420
|
groupedScopes.add(scope);
|
|
413
421
|
}
|
|
414
422
|
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
group.push(entry);
|
|
425
|
-
byScope.set(entry.scope, group);
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
const renderedScopes = /* @__PURE__ */ new Set();
|
|
429
|
-
for (const entry of entries) {
|
|
430
|
-
if (entry.scope && groupedScopes.has(entry.scope)) {
|
|
431
|
-
if (!renderedScopes.has(entry.scope)) {
|
|
432
|
-
renderedScopes.add(entry.scope);
|
|
433
|
-
lines.push(`**${escapeChangelogMentions(entry.scope)}**:`);
|
|
434
|
-
for (const e of byScope.get(entry.scope) ?? []) {
|
|
435
|
-
lines.push(formatEntry(e, { ...refOpts, hideScope: true }));
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
} else {
|
|
439
|
-
lines.push(formatEntry(entry, refOpts));
|
|
440
|
-
}
|
|
423
|
+
const ungrouped = [];
|
|
424
|
+
const byScope = /* @__PURE__ */ new Map();
|
|
425
|
+
for (const entry of entries) {
|
|
426
|
+
if (entry.scope && groupedScopes.has(entry.scope)) {
|
|
427
|
+
const group = byScope.get(entry.scope) ?? [];
|
|
428
|
+
group.push(entry);
|
|
429
|
+
byScope.set(entry.scope, group);
|
|
430
|
+
} else {
|
|
431
|
+
ungrouped.push(entry);
|
|
441
432
|
}
|
|
442
433
|
}
|
|
443
|
-
|
|
444
|
-
|
|
434
|
+
if (ungrouped.length > 0) {
|
|
435
|
+
blocks.push(ungrouped.map((entry) => formatEntry(entry, refOpts)).join("\n"));
|
|
436
|
+
}
|
|
437
|
+
for (const [scope, group] of byScope) {
|
|
438
|
+
blocks.push(
|
|
439
|
+
`**${escapeCommitText(scope)}**:`,
|
|
440
|
+
group.map((entry) => formatEntry(entry, { ...refOpts, hideScope: true })).join("\n")
|
|
441
|
+
);
|
|
442
|
+
}
|
|
443
|
+
return blocks;
|
|
445
444
|
}
|
|
446
445
|
function rerouteBreakingEntries(categories) {
|
|
447
446
|
const hasBreaking = categories.some((c) => c.entries.some((e) => e.breaking));
|
|
@@ -550,24 +549,19 @@ function resolveLinks(entries, linksConfig) {
|
|
|
550
549
|
return merged;
|
|
551
550
|
}
|
|
552
551
|
function formatVersion(context, options) {
|
|
553
|
-
const lines = [];
|
|
554
552
|
const refOpts = { refs: options?.refs ?? "link", repoUrl: context.repoUrl };
|
|
555
553
|
const versionLabel = options?.includePackageName && context.packageName ? `${context.packageName}@${context.version}` : context.version;
|
|
556
554
|
const versionHeader = context.previousVersion ? `## [${versionLabel}]` : `## ${versionLabel}`;
|
|
557
|
-
|
|
558
|
-
lines.push("");
|
|
555
|
+
const blocks = [`${versionHeader} - ${context.date}`];
|
|
559
556
|
const introLine = firstReleaseLine(context, options?.firstRelease);
|
|
560
557
|
if (introLine) {
|
|
561
|
-
|
|
562
|
-
lines.push("");
|
|
558
|
+
blocks.push(introLine);
|
|
563
559
|
}
|
|
564
560
|
if (context.compareUrl) {
|
|
565
|
-
|
|
566
|
-
lines.push("");
|
|
561
|
+
blocks.push(`[Full Changelog](${context.compareUrl})`);
|
|
567
562
|
}
|
|
568
563
|
if (context.enhanced?.summary) {
|
|
569
|
-
|
|
570
|
-
lines.push("");
|
|
564
|
+
blocks.push(context.enhanced.summary);
|
|
571
565
|
}
|
|
572
566
|
if (context.enhanced?.categories && context.enhanced.categories.length > 0) {
|
|
573
567
|
let categories = rerouteBreakingEntries(context.enhanced.categories);
|
|
@@ -576,26 +570,22 @@ function formatVersion(context, options) {
|
|
|
576
570
|
if (category.entries.length === 0) {
|
|
577
571
|
continue;
|
|
578
572
|
}
|
|
579
|
-
|
|
573
|
+
blocks.push(...formatCategorySection(category.name, category.entries, refOpts));
|
|
580
574
|
}
|
|
581
575
|
const links = resolveLinks(context.entries, options?.links);
|
|
582
576
|
if (links.length > 0) {
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
lines.push("");
|
|
577
|
+
blocks.push(
|
|
578
|
+
`### ${options?.links?.title ?? "Links"}`,
|
|
579
|
+
links.map((link) => `- [${link.label}](${link.url})`).join("\n")
|
|
580
|
+
);
|
|
588
581
|
}
|
|
589
582
|
} else {
|
|
590
583
|
for (const section of groupChangelogSections(context.entries, (e) => e, { labelOrder: SECTION_ORDER })) {
|
|
591
|
-
|
|
592
|
-
for (const entry of section.items) {
|
|
593
|
-
lines.push(formatEntry(entry, refOpts));
|
|
594
|
-
}
|
|
595
|
-
lines.push("");
|
|
584
|
+
blocks.push(`### ${section.label}`, section.items.map((entry) => formatEntry(entry, refOpts)).join("\n"));
|
|
596
585
|
}
|
|
597
586
|
}
|
|
598
|
-
return
|
|
587
|
+
return `${blocks.join("\n\n")}
|
|
588
|
+
`;
|
|
599
589
|
}
|
|
600
590
|
function formatHeader() {
|
|
601
591
|
return `# Changelog
|
|
@@ -604,7 +594,6 @@ All notable changes to this project will be documented in this file.
|
|
|
604
594
|
|
|
605
595
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
606
596
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
607
|
-
|
|
608
597
|
`;
|
|
609
598
|
}
|
|
610
599
|
function renderMarkdown(contexts, options) {
|
|
@@ -628,10 +617,9 @@ ${existing}`;
|
|
|
628
617
|
if (headerEnd === -1) {
|
|
629
618
|
return `${existing.trimEnd()}
|
|
630
619
|
|
|
631
|
-
|
|
632
620
|
${sections}`;
|
|
633
621
|
}
|
|
634
|
-
return `${existing.slice(0, headerEnd)}
|
|
622
|
+
return `${existing.slice(0, headerEnd).trimEnd()}
|
|
635
623
|
|
|
636
624
|
${sections}
|
|
637
625
|
${existing.slice(headerEnd + 1)}`;
|
|
@@ -14,12 +14,14 @@ import {
|
|
|
14
14
|
unwrapEnvelope,
|
|
15
15
|
warn,
|
|
16
16
|
writeMarkdown
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ECBA67PM.js";
|
|
18
18
|
|
|
19
19
|
// ../config/dist/index.js
|
|
20
20
|
import * as fs from "fs";
|
|
21
21
|
import * as path from "path";
|
|
22
22
|
import * as TOML from "smol-toml";
|
|
23
|
+
import { execFile } from "child_process";
|
|
24
|
+
import { promisify } from "util";
|
|
23
25
|
import * as fs3 from "fs";
|
|
24
26
|
import * as path3 from "path";
|
|
25
27
|
import { z as z2 } from "zod";
|
|
@@ -44,6 +46,7 @@ var ConfigError = class extends ReleaseKitError {
|
|
|
44
46
|
];
|
|
45
47
|
}
|
|
46
48
|
};
|
|
49
|
+
var execFileAsync = promisify(execFile);
|
|
47
50
|
function parseJsonc(content) {
|
|
48
51
|
try {
|
|
49
52
|
return JSON.parse(content);
|
|
@@ -61,7 +64,7 @@ function parseJsonc(content) {
|
|
|
61
64
|
return result;
|
|
62
65
|
}
|
|
63
66
|
var DEFAULT_DEMOTE_SCOPES = ["deps", "deps-dev"];
|
|
64
|
-
var GitConfigSchema = z.
|
|
67
|
+
var GitConfigSchema = z.strictObject({
|
|
65
68
|
remote: z.string().default("origin").describe("Git remote name"),
|
|
66
69
|
branch: z.string().optional().describe(
|
|
67
70
|
"Branch that releases land on: a direct release pushes its commit here, and the standing release PR targets it. When unset, a direct release pushes the current branch and the standing PR targets main."
|
|
@@ -69,18 +72,21 @@ var GitConfigSchema = z.object({
|
|
|
69
72
|
pushMethod: z.enum(["auto", "ssh", "https"]).default("auto").describe("Method for pushing to remote"),
|
|
70
73
|
push: z.boolean().optional().describe("Whether to push changes to remote"),
|
|
71
74
|
httpsTokenEnv: z.string().optional().describe("Environment variable name containing a GitHub token for HTTPS pushes"),
|
|
72
|
-
skipHooks: z.boolean().optional().describe("Skip Git hooks when committing")
|
|
75
|
+
skipHooks: z.boolean().optional().describe("Skip Git hooks when committing"),
|
|
76
|
+
formatCommand: z.string().optional().describe(
|
|
77
|
+
"Formatter to run on the files a release writes, before committing them, e.g. `npx biome format --write`. ReleaseKit appends their paths and runs the command without a shell: quote an argument that contains spaces, and run a project-local tool through npx or pnpm exec, since the GitHub Action doesn't put node_modules/.bin on the PATH. Pass a flag that skips files the formatter can't handle, e.g. Prettier's `--ignore-unknown`. A non-zero exit fails the release before anything is committed."
|
|
78
|
+
)
|
|
73
79
|
});
|
|
74
|
-
var MonorepoConfigSchema = z.
|
|
80
|
+
var MonorepoConfigSchema = z.strictObject({
|
|
75
81
|
rootPath: z.string().optional().describe("Path to root changelog"),
|
|
76
82
|
packagesPath: z.string().optional().describe("Path to packages directory")
|
|
77
83
|
});
|
|
78
|
-
var VersionNpmConfigSchema = z.
|
|
84
|
+
var VersionNpmConfigSchema = z.strictObject({
|
|
79
85
|
enabled: z.boolean().default(true).describe(
|
|
80
86
|
"Version package.json manifests. Detected npm packages are versioned by default; set false to opt out (e.g. npm versioning handled elsewhere)."
|
|
81
87
|
)
|
|
82
88
|
});
|
|
83
|
-
var VersionCargoConfigSchema = z.
|
|
89
|
+
var VersionCargoConfigSchema = z.strictObject({
|
|
84
90
|
enabled: z.boolean().default(true).describe(
|
|
85
91
|
"Version Cargo.toml manifests. Detected Rust packages are versioned by default; set false to opt out (e.g. a vendored crate, or Rust versioning handled elsewhere)."
|
|
86
92
|
),
|
|
@@ -88,15 +94,15 @@ var VersionCargoConfigSchema = z.object({
|
|
|
88
94
|
"Directories, relative to each package, to bump a Cargo.toml in instead of the package's own directory. Not searched recursively. Ignored in group mode."
|
|
89
95
|
)
|
|
90
96
|
});
|
|
91
|
-
var VersionPubConfigSchema = z.
|
|
97
|
+
var VersionPubConfigSchema = z.strictObject({
|
|
92
98
|
enabled: z.boolean().default(true).describe(
|
|
93
|
-
"Version pubspec.yaml manifests. Detected Dart/Flutter packages are versioned by default; set false to opt out
|
|
99
|
+
"Version pubspec.yaml manifests. Detected Dart/Flutter packages are versioned by default; set false to opt out."
|
|
94
100
|
),
|
|
95
101
|
paths: z.array(z.string()).optional().describe(
|
|
96
102
|
"Directories, relative to each package, to bump a pubspec.yaml in instead of the package's own directory. Not searched recursively. Ignored in group mode."
|
|
97
103
|
)
|
|
98
104
|
});
|
|
99
|
-
var VersionGroupSchema = z.
|
|
105
|
+
var VersionGroupSchema = z.strictObject({
|
|
100
106
|
packages: z.array(z.string()).min(1).describe(
|
|
101
107
|
"Package patterns (exact names, @scope/*, or globs) whose matched packages form this group. Same matching rules as version.packages."
|
|
102
108
|
),
|
|
@@ -106,22 +112,29 @@ var VersionGroupSchema = z.object({
|
|
|
106
112
|
});
|
|
107
113
|
var PresetSchema = z.enum(["angular", "conventionalcommits"]);
|
|
108
114
|
var DEFAULT_PRESET = "conventionalcommits";
|
|
109
|
-
var
|
|
110
|
-
|
|
111
|
-
|
|
115
|
+
var VersionConfigBaseSchema = z.strictObject({
|
|
116
|
+
tagTemplate: z.string().regex(/\$\{version\}$/, {
|
|
117
|
+
message: (
|
|
118
|
+
// biome-ignore lint/suspicious/noTemplateCurlyInString: documenting the expected placeholder syntax to the user
|
|
119
|
+
"tagTemplate must end with ${version}: tags are found by the text before it, so text after it breaks the next release."
|
|
120
|
+
)
|
|
121
|
+
}).optional().describe(
|
|
112
122
|
// biome-ignore lint/suspicious/noTemplateCurlyInString: documenting placeholder syntax to the user
|
|
113
|
-
|
|
123
|
+
'Template for Git tags, ending with ${version}. Available variables: ${version} (version number), ${prefix} (versionPrefix value, e.g. \'v\'), ${packageName} (sanitized package name, e.g. \'scope-pkg\'). Example: "${packageName}-${prefix}${version}" produces "scope-pkg-v1.2.3". Defaults to "${packageName}@${prefix}${version}" with packageSpecificTags, otherwise "${prefix}${version}".'
|
|
114
124
|
),
|
|
115
|
-
baselineTagTemplate: z.string().regex(
|
|
125
|
+
baselineTagTemplate: z.string().regex(/\$\{version\}$/, {
|
|
116
126
|
message: (
|
|
117
127
|
// biome-ignore lint/suspicious/noTemplateCurlyInString: documenting the expected placeholder syntax to the user
|
|
118
|
-
'baselineTagTemplate must
|
|
128
|
+
'baselineTagTemplate must end with ${version} so the prefix can be derived (e.g. "release/${prefix}${version}").'
|
|
119
129
|
)
|
|
120
130
|
}).optional().describe(
|
|
121
131
|
// biome-ignore lint/suspicious/noTemplateCurlyInString: documenting placeholder syntax to the user
|
|
122
|
-
'Optional secondary tag template for an internal \'baseline\' marker that records the release commit on the source branch. Use this when tagTemplate resolves to a tag that gets force-moved off the source branch by a downstream step (e.g. a GitHub Action distributing built artifacts at the version tag) \u2014 the baseline tag stays on the release commit so future version-bump and changelog calculations can still find the previous release. Must
|
|
132
|
+
'Optional secondary tag template for an internal \'baseline\' marker that records the release commit on the source branch. Use this when tagTemplate resolves to a tag that gets force-moved off the source branch by a downstream step (e.g. a GitHub Action distributing built artifacts at the version tag) \u2014 the baseline tag stays on the release commit so future version-bump and changelog calculations can still find the previous release. Must end with ${version} so the baseline prefix can be derived. Supports the same variables as tagTemplate. Example: "release/${prefix}${version}" produces "release/v1.2.3".'
|
|
133
|
+
),
|
|
134
|
+
packageSpecificTags: z.boolean().default(false).describe(
|
|
135
|
+
// biome-ignore lint/suspicious/noTemplateCurlyInString: documenting placeholder syntax to the user
|
|
136
|
+
'Tag each package separately, e.g. "scope-pkg@v1.2.3". tagTemplate must then contain ${packageName}.'
|
|
123
137
|
),
|
|
124
|
-
packageSpecificTags: z.boolean().default(false).describe("Enable package-specific tagging"),
|
|
125
138
|
preset: PresetSchema.default(DEFAULT_PRESET).describe("Commit convention preset"),
|
|
126
139
|
sync: z.boolean().default(true).describe(
|
|
127
140
|
"Global lockstep versioning. true is sugar for one implicit fixed group of every package \u2014 it shares the same mechanism as version.groups. Set to false when using version.groups; sync: true alongside groups is treated as the implicit all-packages fixed group taking precedence (a config conflict, warned about at runtime)."
|
|
@@ -141,19 +154,19 @@ var VersionConfigSchema = z.object({
|
|
|
141
154
|
'Packages to exclude from versioning (glob patterns or exact names). Private packages ("private": true) are skipped automatically \u2014 see includePrivate \u2014 so they do not need to be listed here.'
|
|
142
155
|
),
|
|
143
156
|
includePrivate: z.boolean().default(false).describe(
|
|
144
|
-
'Include npm packages marked "private": true (in package.json) in the release flow. Default false: private packages are skipped at discovery \u2014 they cannot be published to any registry, mirroring the Cargo `publish = false` and pub `publish_to: none` skips already applied during discovery. Set true to version a private package for internal tracking.
|
|
157
|
+
'Include npm packages marked "private": true (in package.json) in the release flow. Default false: private packages are skipped at discovery \u2014 they cannot be published to any registry, mirroring the Cargo `publish = false` and pub `publish_to: none` skips already applied during discovery. Set true to version a private package for internal tracking. A private package listed in version.packages by its exact package name or exact directory path (e.g. "packages/app") is always included regardless of this setting; one matched only by a glob (e.g. "packages/*" or "@scope/*") is still skipped.'
|
|
145
158
|
),
|
|
146
159
|
commitMessage: z.string().optional().describe(
|
|
147
160
|
// biome-ignore lint/suspicious/noTemplateCurlyInString: documenting placeholder syntax to the user
|
|
148
161
|
"Template for the release commit message. Supports ${version} and ${packageName}. Default: 'chore: release ${packageName} v${version}' for sync and single-package releases; otherwise 'chore: release' followed by each released package and version."
|
|
149
162
|
),
|
|
150
163
|
mismatchStrategy: z.enum(["error", "warn", "ignore", "prefer-package", "prefer-git"]).default("warn").describe("How to handle version mismatches"),
|
|
151
|
-
versionPrefix: z.string().default("").describe(
|
|
164
|
+
versionPrefix: z.string().default("v").describe('Prefix for version tags. Set "" for tags like "1.2.3".'),
|
|
152
165
|
prereleaseIdentifier: z.string().optional().describe("Identifier for prerelease versions (e.g., 'alpha', 'beta')"),
|
|
153
166
|
allowFirstBump: z.boolean().default(false).describe(
|
|
154
167
|
'Acknowledge applying a bump on a first release with an already-stable manifest. On a first release (no prior tag), `--stable --bump <type>` applies the bump (e.g. 1.0.0 \u2192 2.0.0) rather than graduating, which can silently overshoot the staged first version. By default this is flagged per `mismatchStrategy` (warn, or abort under "error"); set true (or pass --allow-first-bump) to apply the bump silently \u2014 legitimate when importing a package with prior external version history.'
|
|
155
168
|
),
|
|
156
|
-
strictReachable: z.boolean().default(false).describe("
|
|
169
|
+
strictReachable: z.boolean().default(false).describe("Fail the run when the previous release tag isn't reachable from HEAD, instead of falling back."),
|
|
157
170
|
zeroMajor: z.enum(["spec", "strict"]).default("spec").describe(
|
|
158
171
|
"Pre-1.0 handling of commit-inferred breaking changes. 'spec' (default): bump the 0.x minor (0.24.0 \u2192 0.25.0), per semver \xA74. 'strict': bump the next major (\u2192 1.0.0). Inferred path only \u2014 explicit overrides (--bump major, bump:major) always graduate to 1.0.0."
|
|
159
172
|
),
|
|
@@ -161,7 +174,28 @@ var VersionConfigSchema = z.object({
|
|
|
161
174
|
cargo: VersionCargoConfigSchema.optional().describe("Cargo/Rust configuration"),
|
|
162
175
|
pub: VersionPubConfigSchema.optional().describe("Dart/Flutter pub configuration")
|
|
163
176
|
});
|
|
164
|
-
var
|
|
177
|
+
var VersionConfigSchema = VersionConfigBaseSchema.superRefine((cfg, ctx) => {
|
|
178
|
+
if (cfg.packageSpecificTags && cfg.tagTemplate !== void 0 && !cfg.tagTemplate.includes("${packageName}")) {
|
|
179
|
+
ctx.addIssue({
|
|
180
|
+
code: z.ZodIssueCode.custom,
|
|
181
|
+
path: ["tagTemplate"],
|
|
182
|
+
message: (
|
|
183
|
+
// biome-ignore lint/suspicious/noTemplateCurlyInString: documenting the expected placeholder syntax to the user
|
|
184
|
+
'tagTemplate must contain ${packageName} when packageSpecificTags is true, or every package gets the same tag. Remove tagTemplate to use "${packageName}@${prefix}${version}".'
|
|
185
|
+
)
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
for (const key of ["tagTemplate", "baselineTagTemplate"]) {
|
|
189
|
+
if (/\d+\.\d+\.\d+/.test(cfg[key]?.split("${version}")[0] ?? "")) {
|
|
190
|
+
ctx.addIssue({
|
|
191
|
+
code: z.ZodIssueCode.custom,
|
|
192
|
+
path: [key],
|
|
193
|
+
message: `${key} can't contain a version before \${version}: a tag's version is read as the first one in it.`
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
var NpmConfigSchema = z.strictObject({
|
|
165
199
|
enabled: z.boolean().default(true).describe(
|
|
166
200
|
"Publish to npm. Detected npm packages are published by default; set false to opt out (version and tag only)."
|
|
167
201
|
),
|
|
@@ -173,7 +207,7 @@ var NpmConfigSchema = z.object({
|
|
|
173
207
|
tag: z.string().default("latest").describe("NPM dist tag"),
|
|
174
208
|
publishOrder: z.array(z.string()).default([]).describe("Explicit publish order for npm packages; empty auto-sorts dependencies first")
|
|
175
209
|
});
|
|
176
|
-
var CargoPublishConfigSchema = z.
|
|
210
|
+
var CargoPublishConfigSchema = z.strictObject({
|
|
177
211
|
enabled: z.boolean().default(true).describe(
|
|
178
212
|
"Publish to crates.io. Detected Rust packages are published by default; set false to opt out (version and tag only)."
|
|
179
213
|
),
|
|
@@ -185,21 +219,22 @@ var CargoPublishConfigSchema = z.object({
|
|
|
185
219
|
),
|
|
186
220
|
clean: z.boolean().default(false).describe("Run cargo clean in each crate's directory before publishing.")
|
|
187
221
|
});
|
|
188
|
-
var PubPublishConfigSchema = z.
|
|
222
|
+
var PubPublishConfigSchema = z.strictObject({
|
|
189
223
|
enabled: z.boolean().default(true).describe(
|
|
190
224
|
"Publish to pub.dev. Detected Dart/Flutter packages are published by default; set false to opt out (version and tag only)."
|
|
191
225
|
),
|
|
192
226
|
publishOrder: z.array(z.string()).default([]).describe("Package names to publish first, in this order; the rest follow in discovery order.")
|
|
193
227
|
});
|
|
194
|
-
var PublishGitConfigSchema = z.
|
|
228
|
+
var PublishGitConfigSchema = z.strictObject({
|
|
195
229
|
push: z.boolean().optional().describe("Push tags and commits to remote. When unset, inherits the top-level git.push (which defaults to push)."),
|
|
196
230
|
pushMethod: z.enum(["auto", "ssh", "https"]).optional().describe("Push method override"),
|
|
197
231
|
remote: z.string().optional().describe("Remote name override"),
|
|
198
232
|
branch: z.string().optional().describe("Branch name override"),
|
|
199
233
|
httpsTokenEnv: z.string().optional().describe("Environment variable name containing a GitHub token for HTTPS pushes"),
|
|
200
|
-
skipHooks: z.boolean().optional().describe("Skip Git hooks when committing")
|
|
234
|
+
skipHooks: z.boolean().optional().describe("Skip Git hooks when committing"),
|
|
235
|
+
formatCommand: z.string().optional().describe("Format command override")
|
|
201
236
|
});
|
|
202
|
-
var GitHubReleaseConfigSchema = z.
|
|
237
|
+
var GitHubReleaseConfigSchema = z.strictObject({
|
|
203
238
|
enabled: z.boolean().default(true).describe("Enable GitHub releases"),
|
|
204
239
|
draft: z.boolean().default(true).describe("Create as draft release"),
|
|
205
240
|
perPackage: z.boolean().default(true).describe("Create separate release per package"),
|
|
@@ -216,25 +251,25 @@ var GitHubReleaseConfigSchema = z.object({
|
|
|
216
251
|
"Package names to exclude from GitHub release creation. The name as tags spell it also matches, e.g. 'scope-pkg' for '@scope/pkg'."
|
|
217
252
|
)
|
|
218
253
|
});
|
|
219
|
-
var VerifyRegistryNpmConfigSchema = z.
|
|
254
|
+
var VerifyRegistryNpmConfigSchema = z.strictObject({
|
|
220
255
|
enabled: z.boolean().default(true).describe("Verify NPM publish"),
|
|
221
256
|
maxAttempts: z.number().int().positive().default(5).describe("Maximum verification attempts"),
|
|
222
257
|
initialDelay: z.number().int().positive().default(15e3).describe("Wait in ms after the first failed check; each later wait is multiplied by backoffMultiplier."),
|
|
223
258
|
backoffMultiplier: z.number().positive().default(2).describe("Exponential backoff multiplier")
|
|
224
259
|
});
|
|
225
|
-
var VerifyRegistryCargoConfigSchema = z.
|
|
260
|
+
var VerifyRegistryCargoConfigSchema = z.strictObject({
|
|
226
261
|
enabled: z.boolean().default(true).describe("Verify Cargo publish"),
|
|
227
262
|
maxAttempts: z.number().int().positive().default(10).describe("Maximum verification attempts"),
|
|
228
263
|
initialDelay: z.number().int().positive().default(3e4).describe("Wait in ms after the first failed check; each later wait is multiplied by backoffMultiplier."),
|
|
229
264
|
backoffMultiplier: z.number().positive().default(2).describe("Exponential backoff multiplier")
|
|
230
265
|
});
|
|
231
|
-
var VerifyRegistryPubConfigSchema = z.
|
|
266
|
+
var VerifyRegistryPubConfigSchema = z.strictObject({
|
|
232
267
|
enabled: z.boolean().default(true).describe("Verify Dart pub publish"),
|
|
233
268
|
maxAttempts: z.number().int().positive().default(10).describe("Maximum verification attempts"),
|
|
234
269
|
initialDelay: z.number().int().positive().default(3e4).describe("Wait in ms after the first failed check; each later wait is multiplied by backoffMultiplier."),
|
|
235
270
|
backoffMultiplier: z.number().positive().default(2).describe("Exponential backoff multiplier")
|
|
236
271
|
});
|
|
237
|
-
var VerifyConfigSchema = z.
|
|
272
|
+
var VerifyConfigSchema = z.strictObject({
|
|
238
273
|
npm: VerifyRegistryNpmConfigSchema.default({
|
|
239
274
|
enabled: true,
|
|
240
275
|
maxAttempts: 5,
|
|
@@ -256,7 +291,7 @@ var VerifyConfigSchema = z.object({
|
|
|
256
291
|
backoffMultiplier: 2
|
|
257
292
|
}).describe("Poll pub.dev after each publish until the new version is visible.")
|
|
258
293
|
});
|
|
259
|
-
var PublishConfigSchema = z.
|
|
294
|
+
var PublishConfigSchema = z.strictObject({
|
|
260
295
|
git: PublishGitConfigSchema.optional().describe("Git publishing options"),
|
|
261
296
|
npm: NpmConfigSchema.default({
|
|
262
297
|
enabled: true,
|
|
@@ -309,15 +344,20 @@ var PublishConfigSchema = z.object({
|
|
|
309
344
|
}
|
|
310
345
|
}).describe("Registry verification configuration")
|
|
311
346
|
});
|
|
312
|
-
var TemplateConfigSchema = z.
|
|
347
|
+
var TemplateConfigSchema = z.strictObject({
|
|
313
348
|
path: z.string().optional().describe("Template file, or a directory of composable templates."),
|
|
314
349
|
engine: z.enum(["handlebars", "liquid", "ejs"]).optional().describe("Template engine. Detected from the template files when omitted; ignored without path.")
|
|
315
350
|
});
|
|
316
351
|
var LocationModeSchema = z.enum(["root", "packages", "both"]);
|
|
317
|
-
var ReleaseNotesFileConfigSchema = z.
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
352
|
+
var ReleaseNotesFileConfigSchema = z.strictObject(
|
|
353
|
+
{
|
|
354
|
+
dir: z.string().default("release-notes").describe("Directory for the per-version release-notes files.")
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
error: (issue) => issue.code === "invalid_type" && typeof issue.input === "string" ? 'the string form was removed - set it to { "dir": "release-notes" } for per-version files, or use notes.changelog.mode for a cumulative changelog' : void 0
|
|
358
|
+
}
|
|
359
|
+
);
|
|
360
|
+
var ChangelogConfigSchema = z.strictObject({
|
|
321
361
|
mode: LocationModeSchema.optional().describe(
|
|
322
362
|
"Where to write changelog files: 'root' (the default) at the repo root, 'packages' in each package (monorepos only), or 'both'."
|
|
323
363
|
),
|
|
@@ -330,29 +370,29 @@ var ChangelogConfigSchema = z.object({
|
|
|
330
370
|
'Conventional-commit scopes whose changelog entries move to a trailing "Dependencies & version bumps" subsection instead of mixing with Added / Fixed / Changed. A breaking change still comes first, under Breaking. Applies to the release preview comment and the standing-PR changelogs (each releasable row and the "Show all changes" footer). Entries are moved, not dropped, so the de-duplicated change count is unchanged. Default: ["deps", "deps-dev"], the scopes Dependabot uses. Set to [] to render every scope inline.'
|
|
331
371
|
)
|
|
332
372
|
}).describe("Changelog file configuration");
|
|
333
|
-
var LLMOptionsSchema = z.
|
|
373
|
+
var LLMOptionsSchema = z.strictObject({
|
|
334
374
|
timeout: z.number().int().optional().describe("Idle timeout in ms: a streamed response fails only when nothing arrives for this long. Default: 60000."),
|
|
335
375
|
maxTokens: z.number().int().optional().describe("Max tokens to generate. Default: 16384."),
|
|
336
376
|
temperature: z.number().optional().describe("Sampling temperature. Default: 0.7; the anthropic provider ignores it.")
|
|
337
377
|
});
|
|
338
|
-
var LLMRetryConfigSchema = z.
|
|
378
|
+
var LLMRetryConfigSchema = z.strictObject({
|
|
339
379
|
maxAttempts: z.number().int().positive().optional().describe("Maximum number of attempts, including the first. Default: 3."),
|
|
340
380
|
initialDelay: z.number().int().nonnegative().optional().describe("Delay in ms before the first retry. Default: 1000."),
|
|
341
381
|
maxDelay: z.number().int().positive().optional().describe("Maximum delay in ms between attempts. Default: 30000."),
|
|
342
382
|
backoffFactor: z.number().positive().optional().describe("Delay multiplier per attempt. Default: 2.")
|
|
343
383
|
});
|
|
344
|
-
var LLMTasksConfigSchema = z.
|
|
384
|
+
var LLMTasksConfigSchema = z.strictObject({
|
|
345
385
|
summarize: z.boolean().optional().describe("Write a 2\u20133 sentence summary of the release."),
|
|
346
386
|
enhance: z.boolean().optional().describe("Rewrite each entry's description to be clearer for users."),
|
|
347
387
|
categorize: z.boolean().optional().describe("Group entries into the configured categories."),
|
|
348
388
|
releaseNotes: z.boolean().optional().describe("Write prose release notes for the GitHub Release body and any release-notes files.")
|
|
349
389
|
});
|
|
350
|
-
var LLMCategorySchema = z.
|
|
390
|
+
var LLMCategorySchema = z.strictObject({
|
|
351
391
|
name: z.string().describe("Category label shown in release notes (e.g. 'Features')"),
|
|
352
392
|
description: z.string().describe("LLM instruction describing what commits belong in this category"),
|
|
353
393
|
scopes: z.array(z.string()).optional().describe("Conventional commit scopes assigned to this category")
|
|
354
394
|
});
|
|
355
|
-
var ScopeRulesSchema = z.
|
|
395
|
+
var ScopeRulesSchema = z.strictObject({
|
|
356
396
|
allowed: z.array(z.string()).optional().describe("Explicit list of valid scope names; commits with unlisted scopes trigger invalidScopeAction"),
|
|
357
397
|
caseSensitive: z.boolean().default(false).describe("Whether scope comparison is case-sensitive"),
|
|
358
398
|
invalidScopeAction: z.enum(["remove", "keep", "fallback"]).default("remove").describe(
|
|
@@ -360,28 +400,28 @@ var ScopeRulesSchema = z.object({
|
|
|
360
400
|
),
|
|
361
401
|
fallbackScope: z.string().optional().describe("Scope substituted when invalidScopeAction is 'fallback'")
|
|
362
402
|
});
|
|
363
|
-
var ScopeConfigSchema = z.
|
|
403
|
+
var ScopeConfigSchema = z.strictObject({
|
|
364
404
|
mode: z.enum(["restricted", "packages", "none", "unrestricted"]).default("unrestricted").describe(
|
|
365
405
|
"Scope allowlist source: 'restricted' uses rules.allowed, 'packages' derives scopes from workspace package names, 'none' strips all scopes, 'unrestricted' allows any scope"
|
|
366
406
|
),
|
|
367
407
|
rules: ScopeRulesSchema.optional().describe("Scope validation and transformation rules")
|
|
368
408
|
});
|
|
369
|
-
var LLMPromptOverridesSchema = z.
|
|
409
|
+
var LLMPromptOverridesSchema = z.strictObject({
|
|
370
410
|
enhance: z.string().optional().describe("For the enhance task when categorize is off."),
|
|
371
411
|
categorize: z.string().optional().describe("For the categorize task when enhance is off."),
|
|
372
412
|
enhanceAndCategorize: z.string().optional().describe("For the combined task that replaces enhance and categorize when both are on."),
|
|
373
413
|
summarize: z.string().optional().describe("For the summarize task."),
|
|
374
414
|
releaseNotes: z.string().optional().describe("For the releaseNotes task.")
|
|
375
415
|
});
|
|
376
|
-
var LLMPromptsConfigSchema = z.
|
|
416
|
+
var LLMPromptsConfigSchema = z.strictObject({
|
|
377
417
|
instructions: LLMPromptOverridesSchema.optional().describe(
|
|
378
418
|
"Extra instructions appended to a task's built-in system prompt. The task's output format is unchanged."
|
|
379
419
|
)
|
|
380
420
|
});
|
|
381
|
-
var LLMConfigBaseSchema = z.
|
|
421
|
+
var LLMConfigBaseSchema = z.strictObject({
|
|
382
422
|
provider: z.enum(["openai", "openai-compatible", "anthropic", "ollama"]).describe("LLM provider"),
|
|
383
|
-
model: z.string().min(1, "model must be a non-empty string \u2014 set it to a model the provider serves.").describe(
|
|
384
|
-
"Model identifier for the selected provider
|
|
423
|
+
model: z.string().min(1, "model must be a non-empty string \u2014 set it to a model the provider serves.").optional().describe(
|
|
424
|
+
"Model identifier for the selected provider; releasekit ships no default. Checked only when a run calls the LLM, so other runs work without it."
|
|
385
425
|
),
|
|
386
426
|
baseURL: z.string().optional().describe("Custom API base URL. Required for the openai-compatible provider."),
|
|
387
427
|
apiKey: z.string().optional().describe(
|
|
@@ -412,7 +452,7 @@ var LLMConfigBaseSchema = z.object({
|
|
|
412
452
|
examples: z.number().int().min(0).max(5).default(3).describe(
|
|
413
453
|
"Number of the project's past GitHub Releases (0\u20135) used as style examples in the combined enhance and categorize prompt and the releaseNotes prompt. Needs GITHUB_TOKEN or GH_TOKEN."
|
|
414
454
|
),
|
|
415
|
-
context: z.
|
|
455
|
+
context: z.strictObject({
|
|
416
456
|
pullRequests: z.boolean().default(true).describe("Fetch the title and body of each entry's linked PR as LLM context. Needs GITHUB_TOKEN or GH_TOKEN.")
|
|
417
457
|
}).default({ pullRequests: true }).describe("Additional context sources for the LLM."),
|
|
418
458
|
categoryOrder: z.array(z.string()).optional().describe(
|
|
@@ -431,7 +471,7 @@ var LLMConfigSchema = LLMConfigBaseSchema.superRefine((cfg, ctx) => {
|
|
|
431
471
|
});
|
|
432
472
|
}
|
|
433
473
|
});
|
|
434
|
-
var ReleaseNotesConfigSchema = z.
|
|
474
|
+
var ReleaseNotesConfigSchema = z.strictObject({
|
|
435
475
|
file: ReleaseNotesFileConfigSchema.optional().describe(
|
|
436
476
|
"Optional in-repo file output. Omit to keep release notes only on the GitHub release body (the default). When set, writes one immutable Markdown file per version under `dir` \u2014 release-notes/<package>/<version>.md in a monorepo, release-notes/<version>.md in a single-package repo \u2014 giving a browsable, provider-independent per-release history."
|
|
437
477
|
),
|
|
@@ -439,9 +479,9 @@ var ReleaseNotesConfigSchema = z.object({
|
|
|
439
479
|
"Template for rendering release notes (e.g. to add docs-site frontmatter). Takes precedence over LLM prose and the default formatted section."
|
|
440
480
|
),
|
|
441
481
|
llm: LLMConfigSchema.optional().describe("LLM configuration for release notes"),
|
|
442
|
-
links: z.
|
|
482
|
+
links: z.strictObject({
|
|
443
483
|
items: z.array(
|
|
444
|
-
z.
|
|
484
|
+
z.strictObject({
|
|
445
485
|
label: z.string().describe("Link text"),
|
|
446
486
|
url: z.string().url().describe("Link URL")
|
|
447
487
|
})
|
|
@@ -455,7 +495,7 @@ var ReleaseNotesConfigSchema = z.object({
|
|
|
455
495
|
),
|
|
456
496
|
firstRelease: z.union([
|
|
457
497
|
z.literal(false).describe("Set to false to disable the first-release placeholder intro."),
|
|
458
|
-
z.
|
|
498
|
+
z.strictObject({
|
|
459
499
|
text: z.string().optional().describe(
|
|
460
500
|
// biome-ignore lint/suspicious/noTemplateCurlyInString: documenting placeholder syntax to the user
|
|
461
501
|
"Placeholder intro line for a package's first release. Supports ${packageName} and ${version}. Default: '_First release of ${packageName}._'."
|
|
@@ -465,11 +505,11 @@ var ReleaseNotesConfigSchema = z.object({
|
|
|
465
505
|
"First-release placeholder intro, shown when a package has no prior version (previousVersion is null). Default-on with a factual line; set to false to disable."
|
|
466
506
|
)
|
|
467
507
|
}).describe("Release notes configuration");
|
|
468
|
-
var NotesInputConfigSchema = z.
|
|
508
|
+
var NotesInputConfigSchema = z.strictObject({
|
|
469
509
|
source: z.string().optional(),
|
|
470
510
|
file: z.string().optional()
|
|
471
511
|
});
|
|
472
|
-
var NotesConfigSchema = z.
|
|
512
|
+
var NotesConfigSchema = z.strictObject({
|
|
473
513
|
changelog: z.union([z.literal(false).describe("Set to false to disable changelog generation"), ChangelogConfigSchema]).optional().describe("Changelog generation, on by default. Set to false to disable."),
|
|
474
514
|
releaseNotes: z.union([z.literal(false).describe("Set to false to disable release notes"), ReleaseNotesConfigSchema]).optional().describe(
|
|
475
515
|
"Release notes for the GitHub Release body and optional per-version files. Off unless set. {} turns them on using each version's changelog section; set llm or templates to change the content."
|
|
@@ -478,7 +518,7 @@ var NotesConfigSchema = z.object({
|
|
|
478
518
|
"How to update existing changelog files. 'prepend' (the default) adds the new entries at the top; 'regenerate' overwrites the file with this run's output."
|
|
479
519
|
)
|
|
480
520
|
});
|
|
481
|
-
var CILabelsConfigSchema = z.
|
|
521
|
+
var CILabelsConfigSchema = z.strictObject({
|
|
482
522
|
graduate: z.string().default("release:graduate").describe(
|
|
483
523
|
"Label that graduates a prerelease to its stable base version (e.g. 1.0.0-next.6 \u2192 1.0.0). A standalone release trigger in label/direct mode; in standing-pr mode it sets the next merge to graduate."
|
|
484
524
|
),
|
|
@@ -501,7 +541,7 @@ var CILabelsConfigSchema = z.object({
|
|
|
501
541
|
"Label on the standing PR that also releases the changed prerequisites (transitive internal dependencies) of the targeted/scoped packages \u2014 each at its own commit-driven bump. Standing-pr mode only."
|
|
502
542
|
)
|
|
503
543
|
});
|
|
504
|
-
var StandingPrConfigSchema = z.
|
|
544
|
+
var StandingPrConfigSchema = z.strictObject({
|
|
505
545
|
branch: z.string().default("release/next").describe(
|
|
506
546
|
"Branch name for the standing release PR. Each update resets it to the base branch and force-pushes it, so don't commit to it."
|
|
507
547
|
),
|
|
@@ -524,7 +564,7 @@ var StandingPrConfigSchema = z.object({
|
|
|
524
564
|
minPackages: z.number().int().positive().optional().describe(
|
|
525
565
|
"Minimum number of packages with releasable changes required to create or maintain the standing PR. Below this threshold the PR is closed and no new PR is opened."
|
|
526
566
|
),
|
|
527
|
-
authorization: z.
|
|
567
|
+
authorization: z.strictObject({
|
|
528
568
|
requiredPermission: z.enum(["admin", "maintain", "write"]).default("admin").describe(
|
|
529
569
|
"Minimum repository permission an actor needs to steer the standing PR \u2014 tick/untick selection checkboxes, flip per-row channel toggles, apply release labels, and (with branch protection) merge. Default: admin."
|
|
530
570
|
),
|
|
@@ -552,13 +592,13 @@ var StandingPrConfigSchema = z.object({
|
|
|
552
592
|
"Append the de-duplicated combined-changelog footer to the standing PR: every change listed once, flat across packages and grouped by change type (Added/Fixed/Changed), breaking changes first. It complements the per-row changelogs co-located with each releasable row. Set false to suppress this redundant per-package summary \u2014 the per-row changelogs remain, project-wide (shared) changes are still shown in their own block, and sync releases (which have no per-row changelogs) always show the combined changelog regardless of this setting."
|
|
553
593
|
),
|
|
554
594
|
channelToggle: z.boolean().default(false).describe(
|
|
555
|
-
"Add a per-row channel toggle to the standing-PR selection list: a nested checkbox under each releasable row to ship a stable package as a prerelease (\u2192 X.Y.Z-next.0 on the `next` dist-tag) or graduate a prerelease package to its stable base \u2014 shifting just that package (and its group) without narrowing the release. Off by default so repos that do not need it keep the tight one-line-per-package list. A held-back (unticked) row hides its channel toggle.
|
|
595
|
+
"Add a per-row channel toggle to the standing-PR selection list: a nested checkbox under each releasable row to ship a stable package as a prerelease (\u2192 X.Y.Z-next.0 on the `next` dist-tag) or graduate a prerelease package to its stable base \u2014 shifting just that package (and its group) without narrowing the release. Off by default so repos that do not need it keep the tight one-line-per-package list. A held-back (unticked) row hides its channel toggle. A sync release, which ships as one unit, instead gets a single graduate-to-stable checkbox under its queued changes when it is on a prerelease line."
|
|
556
596
|
),
|
|
557
597
|
summaryTable: z.boolean().default(false).describe(
|
|
558
598
|
'Render a collapsed "Version summary" table near the top of the standing PR: one row per publishing package showing its current version, next version, bump magnitude, and dist-tag. A scannable from \u2192 to overview (the Dependabot mental model) that complements the interactive checkbox list \u2014 which GitHub only renders as a list, never in a table cell. Off by default.'
|
|
559
599
|
)
|
|
560
600
|
});
|
|
561
|
-
var CIConfigSchema = z.
|
|
601
|
+
var CIConfigSchema = z.strictObject({
|
|
562
602
|
releaseStrategy: z.enum(["manual", "direct", "standing-pr"]).default("direct").describe(
|
|
563
603
|
"How releases are delivered. 'direct': release on merge to main. 'manual': releases triggered manually (e.g. workflow_dispatch). 'standing-pr': changes accumulate in a release PR; gate mode acts as the immediate-release evaluator, firing only for merges labelled with the immediate label."
|
|
564
604
|
),
|
|
@@ -567,7 +607,7 @@ var CIConfigSchema = z.object({
|
|
|
567
607
|
),
|
|
568
608
|
prPreview: z.union([
|
|
569
609
|
z.boolean(),
|
|
570
|
-
z.
|
|
610
|
+
z.strictObject({
|
|
571
611
|
enabled: z.boolean().default(true).describe("Whether PR preview comments are posted."),
|
|
572
612
|
markStaleAfterRelease: z.boolean().default(false).describe(
|
|
573
613
|
"After a standing-PR publish, or a `releasekit release` that pushes the release branch, mark the preview on open PRs into that branch as stale until the PR's next push or label change. `releasekit publish` on its own doesn't. Best-effort: a failure never fails the release."
|
|
@@ -598,7 +638,7 @@ var CIConfigSchema = z.object({
|
|
|
598
638
|
"Configuration for the standing release PR feature (ci.releaseStrategy: 'standing-pr')."
|
|
599
639
|
)
|
|
600
640
|
});
|
|
601
|
-
var ReleaseCIConfigSchema = z.
|
|
641
|
+
var ReleaseCIConfigSchema = z.strictObject({
|
|
602
642
|
skipPatterns: z.array(z.string().min(1)).optional().describe(
|
|
603
643
|
"Strings that skip a release, gate run or standing-PR update when found anywhere in the HEAD commit's subject. When unset, only standing-PR updates skip, and only on 'chore: release '."
|
|
604
644
|
),
|
|
@@ -606,11 +646,11 @@ var ReleaseCIConfigSchema = z.object({
|
|
|
606
646
|
githubRelease: z.literal(false).optional().describe("Set to false to disable GitHub release creation in CI"),
|
|
607
647
|
notes: z.literal(false).optional().describe("Set to false to disable changelog generation in CI")
|
|
608
648
|
});
|
|
609
|
-
var ReleaseConfigSchema = z.
|
|
649
|
+
var ReleaseConfigSchema = z.strictObject({
|
|
610
650
|
steps: z.array(z.enum(["notes", "publish"])).min(1).optional().describe("Which steps to run by default. Omitting a step is equivalent to --skip-<step>."),
|
|
611
651
|
ci: ReleaseCIConfigSchema.optional().describe("CI-specific automation settings")
|
|
612
652
|
});
|
|
613
|
-
var ReleaseKitConfigSchema = z.
|
|
653
|
+
var ReleaseKitConfigSchema = z.strictObject({
|
|
614
654
|
$schema: z.string().optional().describe("JSON schema reference URL"),
|
|
615
655
|
git: GitConfigSchema.optional().describe("Git configuration"),
|
|
616
656
|
monorepo: MonorepoConfigSchema.optional().describe("Monorepo configuration"),
|
|
@@ -648,26 +688,33 @@ function substituteVariables(value, rootDir = process.cwd()) {
|
|
|
648
688
|
});
|
|
649
689
|
return result;
|
|
650
690
|
}
|
|
651
|
-
var SOLE_REFERENCE_PATTERN = /^\{(
|
|
652
|
-
function substituteInObject(obj, rootDir = process.cwd()) {
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
691
|
+
var SOLE_REFERENCE_PATTERN = /^\{(env|file):([^}]+)\}$/;
|
|
692
|
+
function substituteInObject(obj, rootDir = process.cwd(), onUnsetEnv) {
|
|
693
|
+
return substituteAt(obj, rootDir, [], onUnsetEnv);
|
|
694
|
+
}
|
|
695
|
+
function substituteAt(value, rootDir, path62, onUnsetEnv) {
|
|
696
|
+
if (typeof value === "string") {
|
|
697
|
+
const result = substituteVariables(value, rootDir);
|
|
698
|
+
const sole = SOLE_REFERENCE_PATTERN.exec(value);
|
|
699
|
+
if (result === "" && sole) {
|
|
700
|
+
if (sole[1] === "env") {
|
|
701
|
+
onUnsetEnv?.(path62, sole[2]);
|
|
702
|
+
}
|
|
656
703
|
return void 0;
|
|
657
704
|
}
|
|
658
705
|
return result;
|
|
659
706
|
}
|
|
660
|
-
if (Array.isArray(
|
|
661
|
-
return
|
|
707
|
+
if (Array.isArray(value)) {
|
|
708
|
+
return value.map((item, index) => substituteAt(item, rootDir, [...path62, index], onUnsetEnv));
|
|
662
709
|
}
|
|
663
|
-
if (
|
|
710
|
+
if (value && typeof value === "object") {
|
|
664
711
|
const result = {};
|
|
665
|
-
for (const [key,
|
|
666
|
-
result[key] =
|
|
712
|
+
for (const [key, item] of Object.entries(value)) {
|
|
713
|
+
result[key] = substituteAt(item, rootDir, [...path62, key], onUnsetEnv);
|
|
667
714
|
}
|
|
668
715
|
return result;
|
|
669
716
|
}
|
|
670
|
-
return
|
|
717
|
+
return value;
|
|
671
718
|
}
|
|
672
719
|
var AUTH_DIR = path2.join(os.homedir(), ".config", "releasekit");
|
|
673
720
|
var AUTH_FILE = path2.join(AUTH_DIR, "auth.json");
|
|
@@ -690,100 +737,133 @@ function saveAuth(provider, apiKey) {
|
|
|
690
737
|
existing[provider] = apiKey;
|
|
691
738
|
fs2.writeFileSync(AUTH_FILE, JSON.stringify(existing, null, 2), { encoding: "utf-8", mode: 384 });
|
|
692
739
|
}
|
|
693
|
-
var
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
740
|
+
var LLM_MODEL_PATH = ["notes", "releaseNotes", "llm", "model"];
|
|
741
|
+
var RELEASE_NOTES_OUTPUT = 'release notes go to the GitHub release body by default; for in-repo per-version files set notes.releaseNotes.file to { "dir": "release-notes" }, and for a cumulative changelog use notes.changelog.mode';
|
|
742
|
+
var VERSION_BUMPS = "use Conventional Commits or --bump for version bumps, version.groups for coupled packages, and release:with-prerequisites / --include-prerequisites to release a package's changed dependencies";
|
|
743
|
+
var REMOVED_KEYS = /* @__PURE__ */ new Map([
|
|
744
|
+
["notes.releaseNotes.mode", `removed - ${RELEASE_NOTES_OUTPUT}`],
|
|
745
|
+
["notes.releaseNotes.directory", `removed - ${RELEASE_NOTES_OUTPUT}`],
|
|
746
|
+
[
|
|
747
|
+
"notes.releaseNotes.llm.prompts.templates",
|
|
748
|
+
"removed - use notes.releaseNotes.llm.prompts.instructions to add to the built-in prompts"
|
|
749
|
+
],
|
|
750
|
+
["version.versionStrategy", `removed - ${VERSION_BUMPS}`],
|
|
751
|
+
["version.branchPatterns", `removed - ${VERSION_BUMPS}`],
|
|
752
|
+
["version.defaultReleaseType", `removed - ${VERSION_BUMPS}`],
|
|
753
|
+
["version.updateInternalDependencies", `removed - ${VERSION_BUMPS}`],
|
|
754
|
+
["version.baseBranch", "moved to git.branch"],
|
|
755
|
+
["version.skipHooks", "moved to git.skipHooks"],
|
|
756
|
+
["ci.autoRelease", "removed - it had no effect"],
|
|
757
|
+
["ci.skipPatterns", "moved to release.ci.skipPatterns"],
|
|
758
|
+
["ci.minChanges", "moved to release.ci.minChanges"],
|
|
759
|
+
[
|
|
760
|
+
"ci.prPreview.refreshAfterRelease",
|
|
761
|
+
"renamed to markStaleAfterRelease, which marks open PRs' previews stale after a release instead of recomputing them"
|
|
762
|
+
],
|
|
763
|
+
["ci.labels.stable", "renamed to ci.labels.graduate"],
|
|
764
|
+
["monorepo.mainPackage", "moved to version.mainPackage"],
|
|
765
|
+
["monorepo.mode", "removed - changelog aggregation is set by notes.changelog.mode"]
|
|
766
|
+
]);
|
|
767
|
+
var unsetEnvByOwner = /* @__PURE__ */ new WeakMap();
|
|
768
|
+
function configValidationError(issues) {
|
|
769
|
+
const lines = issues.map((issue) => ` ${issue.path.join(".")}: ${issue.message}`).join("\n");
|
|
770
|
+
return new ConfigError(`Config validation errors:
|
|
771
|
+
${lines}`);
|
|
772
|
+
}
|
|
773
|
+
function unsetEnvMessage(name) {
|
|
774
|
+
return `{env:${name}} is not set`;
|
|
775
|
+
}
|
|
776
|
+
function isRootTypeMismatch(issue) {
|
|
777
|
+
return issue.path.length === 0 && (issue.code === "invalid_type" || issue.code === "invalid_value");
|
|
778
|
+
}
|
|
779
|
+
function flattenIssues(issues, unsetEnv, prefix = []) {
|
|
780
|
+
return issues.flatMap((issue) => {
|
|
781
|
+
const path62 = [...prefix, ...issue.path];
|
|
782
|
+
if (issue.code === "invalid_union") {
|
|
783
|
+
const matched = issue.errors.filter((branch) => !branch.every(isRootTypeMismatch));
|
|
784
|
+
if (matched.length === 1) {
|
|
785
|
+
return flattenIssues(matched[0], unsetEnv, path62);
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
if (issue.code === "unrecognized_keys") {
|
|
789
|
+
return issue.keys.map((key) => {
|
|
790
|
+
const keyPath = [...path62, key];
|
|
791
|
+
return { path: keyPath, message: REMOVED_KEYS.get(keyPath.join(".")) ?? "unknown key" };
|
|
792
|
+
});
|
|
699
793
|
}
|
|
700
|
-
|
|
701
|
-
|
|
794
|
+
const ref = unsetEnv.find((r) => samePath(r.path, path62));
|
|
795
|
+
if (ref) {
|
|
796
|
+
return [{ path: path62, message: unsetEnvMessage(ref.name) }];
|
|
797
|
+
}
|
|
798
|
+
return [{ path: path62, message: issue.message }];
|
|
799
|
+
});
|
|
702
800
|
}
|
|
703
|
-
function
|
|
704
|
-
return
|
|
801
|
+
function samePath(a, b) {
|
|
802
|
+
return a.length === b.length && a.every((key, i) => key === b[i]);
|
|
705
803
|
}
|
|
706
|
-
function
|
|
707
|
-
|
|
708
|
-
return;
|
|
709
|
-
}
|
|
710
|
-
const rn = config.notes.releaseNotes;
|
|
711
|
-
const removed = [];
|
|
712
|
-
if ("mode" in rn) {
|
|
713
|
-
removed.push("mode");
|
|
714
|
-
}
|
|
715
|
-
if ("directory" in rn) {
|
|
716
|
-
removed.push("directory");
|
|
717
|
-
}
|
|
718
|
-
if (typeof rn.file === "string") {
|
|
719
|
-
removed.push("file (string)");
|
|
720
|
-
}
|
|
721
|
-
if (removed.length === 0) {
|
|
722
|
-
return;
|
|
723
|
-
}
|
|
724
|
-
throw new ConfigError(
|
|
725
|
-
`notes.releaseNotes no longer supports ${removed.join(", ")}. Release notes go to the GitHub release body by default; for in-repo per-version files set notes.releaseNotes.file to { "dir": "release-notes" }. For a cumulative changelog file, use changelog.mode.`
|
|
726
|
-
);
|
|
804
|
+
function zodConfigError(error2, unsetEnv) {
|
|
805
|
+
return configValidationError(flattenIssues(error2.issues, unsetEnv));
|
|
727
806
|
}
|
|
728
|
-
function
|
|
729
|
-
|
|
730
|
-
|
|
807
|
+
function rememberUnsetEnv(config, unsetEnv) {
|
|
808
|
+
for (const { path: path62, name } of unsetEnv) {
|
|
809
|
+
const owner = path62.slice(0, -1).reduce(
|
|
810
|
+
(node, key) => node && typeof node === "object" ? node[key] : void 0,
|
|
811
|
+
config
|
|
812
|
+
);
|
|
813
|
+
if (owner && typeof owner === "object") {
|
|
814
|
+
const refs = unsetEnvByOwner.get(owner) ?? /* @__PURE__ */ new Map();
|
|
815
|
+
refs.set(path62[path62.length - 1], name);
|
|
816
|
+
unsetEnvByOwner.set(owner, refs);
|
|
817
|
+
}
|
|
731
818
|
}
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
)
|
|
736
|
-
|
|
737
|
-
return;
|
|
819
|
+
}
|
|
820
|
+
function copyUnsetEnv(from, to) {
|
|
821
|
+
const refs = unsetEnvByOwner.get(from);
|
|
822
|
+
if (refs) {
|
|
823
|
+
unsetEnvByOwner.set(to, new Map(refs));
|
|
738
824
|
}
|
|
739
|
-
throw new ConfigError(
|
|
740
|
-
`version no longer supports ${removed.join(", ")}. Branch-pattern versioning was never functional \u2014 use Conventional Commits or --bump for version bumps. For coupled packages use version.groups; to release a package's changed dependencies use release:with-prerequisites / --include-prerequisites.`
|
|
741
|
-
);
|
|
742
825
|
}
|
|
743
|
-
function
|
|
744
|
-
|
|
826
|
+
function runsLlmTasks(llm, skipReleaseNotes) {
|
|
827
|
+
return llm !== void 0 && !process.env.CHANGELOG_NO_LLM && !skipReleaseNotes && Object.values(llm.tasks ?? {}).some(Boolean);
|
|
828
|
+
}
|
|
829
|
+
function assertLlmModel(llm) {
|
|
830
|
+
if (llm.model) {
|
|
745
831
|
return;
|
|
746
832
|
}
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
`ci no longer supports ${removed.join(", ")}. autoRelease was removed (it had no effect); skipPatterns and minChanges live under release.ci (release.ci.skipPatterns / release.ci.minChanges).`
|
|
752
|
-
);
|
|
753
|
-
}
|
|
754
|
-
if (isRecord(config.ci.prPreview) && "refreshAfterRelease" in config.ci.prPreview) {
|
|
755
|
-
throw new ConfigError(
|
|
756
|
-
"ci.prPreview.refreshAfterRelease was renamed to markStaleAfterRelease. It now marks open PRs' previews stale after a release instead of recomputing them."
|
|
757
|
-
);
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
if (isRecord(config.monorepo) && "mainPackage" in config.monorepo) {
|
|
761
|
-
throw new ConfigError("monorepo.mainPackage was removed \u2014 use version.mainPackage instead.");
|
|
762
|
-
}
|
|
833
|
+
const name = unsetEnvByOwner.get(llm)?.get("model");
|
|
834
|
+
throw configValidationError([
|
|
835
|
+
{ path: LLM_MODEL_PATH, message: name ? unsetEnvMessage(name) : "required to run LLM tasks" }
|
|
836
|
+
]);
|
|
763
837
|
}
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
838
|
+
var CONFIG_FILES = ["releasekit.config.json", "releasekit.config.jsonc"];
|
|
839
|
+
function resolveConfigPath(cwd) {
|
|
840
|
+
for (const file of CONFIG_FILES) {
|
|
841
|
+
const candidate = path3.join(cwd, file);
|
|
842
|
+
if (fs3.existsSync(candidate)) {
|
|
843
|
+
return candidate;
|
|
844
|
+
}
|
|
767
845
|
}
|
|
846
|
+
return path3.join(cwd, CONFIG_FILES[0]);
|
|
768
847
|
}
|
|
769
848
|
function loadConfigFile(configPath) {
|
|
770
849
|
if (!fs3.existsSync(configPath)) {
|
|
771
850
|
return {};
|
|
772
851
|
}
|
|
852
|
+
const unsetEnv = [];
|
|
773
853
|
try {
|
|
774
854
|
const content = fs3.readFileSync(configPath, "utf-8");
|
|
775
855
|
const parsed = parseJsonc(content);
|
|
776
|
-
const substituted = substituteInObject(
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
856
|
+
const substituted = substituteInObject(
|
|
857
|
+
parsed,
|
|
858
|
+
path3.dirname(configPath),
|
|
859
|
+
(refPath, name) => unsetEnv.push({ path: refPath, name })
|
|
860
|
+
);
|
|
861
|
+
const config = ReleaseKitConfigSchema.parse(substituted);
|
|
862
|
+
rememberUnsetEnv(config, unsetEnv);
|
|
863
|
+
return config;
|
|
782
864
|
} catch (error2) {
|
|
783
865
|
if (error2 instanceof z2.ZodError) {
|
|
784
|
-
|
|
785
|
-
throw new ConfigError(`Config validation errors:
|
|
786
|
-
${issues}`);
|
|
866
|
+
throw zodConfigError(error2, unsetEnv);
|
|
787
867
|
}
|
|
788
868
|
if (error2 instanceof SyntaxError) {
|
|
789
869
|
throw new ConfigError(`Invalid JSON in config file: ${error2.message}`);
|
|
@@ -892,7 +972,8 @@ var VersionPackageChangelogSchema = z3.looseObject({
|
|
|
892
972
|
previousVersion: z3.string().nullable(),
|
|
893
973
|
revisionRange: z3.string(),
|
|
894
974
|
repoUrl: z3.string().nullable(),
|
|
895
|
-
entries: z3.array(VersionChangelogEntrySchema)
|
|
975
|
+
entries: z3.array(VersionChangelogEntrySchema),
|
|
976
|
+
tag: z3.string().optional()
|
|
896
977
|
});
|
|
897
978
|
var VersionPackageUpdateSchema = z3.looseObject({
|
|
898
979
|
packageName: z3.string(),
|
|
@@ -907,11 +988,15 @@ var VersionOutputSchema = z3.looseObject({
|
|
|
907
988
|
changelogs: z3.array(VersionPackageChangelogSchema),
|
|
908
989
|
commitMessage: z3.string().optional(),
|
|
909
990
|
tags: z3.array(z3.string()),
|
|
910
|
-
baselineTags: z3.array(z3.string()).optional()
|
|
991
|
+
baselineTags: z3.array(z3.string()).optional(),
|
|
992
|
+
additionalFiles: z3.array(z3.string()).optional()
|
|
911
993
|
});
|
|
912
994
|
|
|
913
995
|
// src/input/version-output.ts
|
|
914
|
-
var NotesVersionOutputSchema = VersionOutputSchema.pick({ changelogs: true })
|
|
996
|
+
var NotesVersionOutputSchema = VersionOutputSchema.pick({ changelogs: true, updates: true, tags: true }).partial({
|
|
997
|
+
updates: true,
|
|
998
|
+
tags: true
|
|
999
|
+
});
|
|
915
1000
|
function normalizeEntryType(type) {
|
|
916
1001
|
const typeMap = {
|
|
917
1002
|
added: "added",
|
|
@@ -933,10 +1018,12 @@ function versionOutputToChangelogInput(data) {
|
|
|
933
1018
|
if (!data.changelogs || !Array.isArray(data.changelogs)) {
|
|
934
1019
|
throw new InputParseError('Input must contain a "changelogs" array');
|
|
935
1020
|
}
|
|
1021
|
+
const soleTag = data.tags?.length === 1 && !data.updates?.some((u) => u.tag) ? data.tags[0] : void 0;
|
|
936
1022
|
const packages = data.changelogs.map((changelog) => ({
|
|
937
1023
|
packageName: changelog.packageName,
|
|
938
1024
|
version: changelog.version,
|
|
939
1025
|
previousVersion: changelog.previousVersion,
|
|
1026
|
+
tag: changelog.tag ?? data.updates?.find((u) => u.packageName === changelog.packageName)?.tag ?? soleTag,
|
|
940
1027
|
revisionRange: changelog.revisionRange,
|
|
941
1028
|
repoUrl: changelog.repoUrl,
|
|
942
1029
|
date: (/* @__PURE__ */ new Date()).toISOString().split("T")[0] ?? "",
|
|
@@ -1181,8 +1268,8 @@ var GitHubForge = class {
|
|
|
1181
1268
|
async updatePullRequest(prNumber, changes) {
|
|
1182
1269
|
await this.octokit.rest.pulls.update({ ...this.base, pull_number: prNumber, ...changes });
|
|
1183
1270
|
}
|
|
1184
|
-
async mergePullRequest(prNumber, method) {
|
|
1185
|
-
await this.octokit.rest.pulls.merge({ ...this.base, pull_number: prNumber, merge_method: method });
|
|
1271
|
+
async mergePullRequest(prNumber, method, sha) {
|
|
1272
|
+
await this.octokit.rest.pulls.merge({ ...this.base, pull_number: prNumber, merge_method: method, sha });
|
|
1186
1273
|
}
|
|
1187
1274
|
async createIssue(issue) {
|
|
1188
1275
|
const { data } = await this.octokit.rest.issues.create({ ...this.base, ...issue });
|
|
@@ -3134,41 +3221,37 @@ function isVersionStartAt(tag, i) {
|
|
|
3134
3221
|
}
|
|
3135
3222
|
return false;
|
|
3136
3223
|
}
|
|
3137
|
-
function generateCompareUrl(repoUrl, from, to, packageName) {
|
|
3224
|
+
function generateCompareUrl(repoUrl, from, to, packageName, tag) {
|
|
3138
3225
|
const isPackageSpecific = from.includes("@") && packageName && from.includes(packageName);
|
|
3139
|
-
let fromVersion;
|
|
3140
3226
|
let toVersion;
|
|
3141
|
-
if (
|
|
3142
|
-
|
|
3227
|
+
if (tag) {
|
|
3228
|
+
toVersion = tag;
|
|
3229
|
+
} else if (isPackageSpecific) {
|
|
3143
3230
|
toVersion = `${packageName}@${to.startsWith("v") ? "" : "v"}${to}`;
|
|
3144
3231
|
} else {
|
|
3145
3232
|
const toClean = to.replace(/^v/, "");
|
|
3146
3233
|
const atPos = from.lastIndexOf("@");
|
|
3147
3234
|
const dashVPos = from.lastIndexOf("-v");
|
|
3148
3235
|
if (atPos > 0 && isVersionStartAt(from, atPos + 1)) {
|
|
3149
|
-
fromVersion = from;
|
|
3150
3236
|
toVersion = `${from.slice(0, atPos + 1)}${from[atPos + 1] === "v" ? "v" : ""}${toClean}`;
|
|
3151
3237
|
} else if (dashVPos > 0 && from.charCodeAt(dashVPos + 2) >= 48 && from.charCodeAt(dashVPos + 2) <= 57) {
|
|
3152
|
-
fromVersion = from;
|
|
3153
3238
|
toVersion = `${from.slice(0, dashVPos + 1)}v${toClean}`;
|
|
3154
3239
|
} else {
|
|
3155
3240
|
const sepPos = findCompoundTagSepPos(from);
|
|
3156
3241
|
if (sepPos > 0) {
|
|
3157
|
-
fromVersion = from;
|
|
3158
3242
|
toVersion = `${from.slice(0, sepPos + 1)}${toClean}`;
|
|
3159
3243
|
} else {
|
|
3160
|
-
|
|
3161
|
-
toVersion = toClean;
|
|
3244
|
+
toVersion = `${from.startsWith("v") ? "v" : ""}${toClean}`;
|
|
3162
3245
|
}
|
|
3163
3246
|
}
|
|
3164
3247
|
}
|
|
3165
3248
|
if (/gitlab\.com/i.test(repoUrl)) {
|
|
3166
|
-
return `${repoUrl}/-/compare/${
|
|
3249
|
+
return `${repoUrl}/-/compare/${from}...${toVersion}`;
|
|
3167
3250
|
}
|
|
3168
3251
|
if (/bitbucket\.org/i.test(repoUrl)) {
|
|
3169
|
-
return `${repoUrl}/branches/compare/${
|
|
3252
|
+
return `${repoUrl}/branches/compare/${from}..${toVersion}`;
|
|
3170
3253
|
}
|
|
3171
|
-
return `${repoUrl}/compare/${
|
|
3254
|
+
return `${repoUrl}/compare/${from}...${toVersion}`;
|
|
3172
3255
|
}
|
|
3173
3256
|
function buildOrderedCategories(rawCategories, configCategories) {
|
|
3174
3257
|
const order = configCategories?.map((c) => c.name) ?? [];
|
|
@@ -3183,7 +3266,7 @@ function buildOrderedCategories(rawCategories, configCategories) {
|
|
|
3183
3266
|
});
|
|
3184
3267
|
}
|
|
3185
3268
|
function createTemplateContext(pkg) {
|
|
3186
|
-
const compareUrl = pkg.repoUrl && pkg.previousVersion ? generateCompareUrl(pkg.repoUrl, pkg.previousVersion, pkg.version, pkg.packageName) : void 0;
|
|
3269
|
+
const compareUrl = pkg.repoUrl && pkg.previousVersion ? generateCompareUrl(pkg.repoUrl, pkg.previousVersion, pkg.version, pkg.packageName, pkg.tag) : void 0;
|
|
3187
3270
|
return {
|
|
3188
3271
|
packageName: pkg.packageName,
|
|
3189
3272
|
version: pkg.version,
|
|
@@ -3362,7 +3445,8 @@ async function runPipeline(input, config, dryRun, pipelineOptions) {
|
|
|
3362
3445
|
const changelogConfig = config.changelog === false ? false : { mode: "root", ...config.changelog ?? {} };
|
|
3363
3446
|
const releaseNotesConfig = config.releaseNotes === false || config.releaseNotes === void 0 ? void 0 : config.releaseNotes;
|
|
3364
3447
|
const llmConfig = releaseNotesConfig?.llm;
|
|
3365
|
-
if (llmConfig &&
|
|
3448
|
+
if (llmConfig && runsLlmTasks(llmConfig, pipelineOptions?.skipReleaseNotes)) {
|
|
3449
|
+
assertLlmModel(llmConfig);
|
|
3366
3450
|
info("Processing with LLM enhancement");
|
|
3367
3451
|
const examplesCount = llmConfig.examples ?? 3;
|
|
3368
3452
|
const repoUrl = contexts[0]?.repoUrl ?? input.metadata?.repoUrl;
|
|
@@ -3466,7 +3550,7 @@ async function runPipeline(input, config, dryRun, pipelineOptions) {
|
|
|
3466
3550
|
const dir = releaseNotesConfig.file.dir;
|
|
3467
3551
|
info(`Generating release notes \u2192 ${dir}`);
|
|
3468
3552
|
try {
|
|
3469
|
-
const { detectMonorepo } = await import("./aggregator-
|
|
3553
|
+
const { detectMonorepo } = await import("./aggregator-N733ZTAA.js");
|
|
3470
3554
|
const nested = detectMonorepo(process.cwd()).isMonorepo || contexts.length > 1;
|
|
3471
3555
|
const renderContent = (ctx) => {
|
|
3472
3556
|
if (releaseNotesConfig.templates?.path) {
|
|
@@ -3530,7 +3614,7 @@ async function processInput(inputJson, config, dryRun, pipelineOptions) {
|
|
|
3530
3614
|
return runPipeline(input, config, dryRun, pipelineOptions);
|
|
3531
3615
|
}
|
|
3532
3616
|
async function writeMonorepoFiles(contexts, config, dryRun, fileName, refs) {
|
|
3533
|
-
const { detectMonorepo, writeMonorepoChangelogs } = await import("./aggregator-
|
|
3617
|
+
const { detectMonorepo, writeMonorepoChangelogs } = await import("./aggregator-N733ZTAA.js");
|
|
3534
3618
|
const cwd = process.cwd();
|
|
3535
3619
|
const detected = detectMonorepo(cwd);
|
|
3536
3620
|
if (!detected.isMonorepo) {
|
|
@@ -3653,6 +3737,9 @@ function createNotesCommand() {
|
|
|
3653
3737
|
const detail = issues?.map((i) => i.message).join("; ") ?? (err instanceof Error ? err.message : String(err));
|
|
3654
3738
|
throw new Error(`Invalid LLM configuration from --llm-* flags: ${detail}`);
|
|
3655
3739
|
}
|
|
3740
|
+
if (existingLlm) {
|
|
3741
|
+
copyUnsetEnv(existingLlm, validatedLlm);
|
|
3742
|
+
}
|
|
3656
3743
|
config.releaseNotes = {
|
|
3657
3744
|
...existingRn,
|
|
3658
3745
|
llm: validatedLlm
|
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-UAPJMRGO.js";
|
|
5
5
|
import {
|
|
6
6
|
readPackageVersion
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ECBA67PM.js";
|
|
8
8
|
|
|
9
9
|
// src/cli.ts
|
|
10
10
|
import * as fs from "fs";
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import 'commander';
|
|
|
5
5
|
declare const MonorepoConfigSchema: z.ZodObject<{
|
|
6
6
|
rootPath: z.ZodOptional<z.ZodString>;
|
|
7
7
|
packagesPath: z.ZodOptional<z.ZodString>;
|
|
8
|
-
}, z.core.$
|
|
8
|
+
}, z.core.$strict>;
|
|
9
9
|
type MonorepoConfig = z.infer<typeof MonorepoConfigSchema>;
|
|
10
10
|
declare function loadAuth(): Record<string, string>;
|
|
11
11
|
declare function saveAuth(provider: string, apiKey: string): void;
|
|
@@ -49,6 +49,8 @@ interface VersionPackageChangelog {
|
|
|
49
49
|
revisionRange: string;
|
|
50
50
|
repoUrl: string | null;
|
|
51
51
|
entries: VersionChangelogEntry[];
|
|
52
|
+
/** The tag this changelog releases: the package's own, or a sync release's shared one. Absent in older manifests. */
|
|
53
|
+
tag?: string;
|
|
52
54
|
}
|
|
53
55
|
/** `'graduated'`: a prerelease promoted to stable, ignoring any requested bump. `'first-release'`: no prior tag. */
|
|
54
56
|
type VersionAction = 'first-release' | 'graduated' | 'bumped';
|
|
@@ -74,6 +76,11 @@ interface VersionOutput {
|
|
|
74
76
|
* been force-moved off it.
|
|
75
77
|
*/
|
|
76
78
|
baselineTags?: string[];
|
|
79
|
+
/**
|
|
80
|
+
* Files the version step wrote that no update names, such as the `Cargo.toml` of a non-releasing crate that depends
|
|
81
|
+
* on a releasing crate. Absent when there are none, and in older manifests.
|
|
82
|
+
*/
|
|
83
|
+
additionalFiles?: string[];
|
|
77
84
|
}
|
|
78
85
|
interface VersionPackageUpdate {
|
|
79
86
|
packageName: string;
|
|
@@ -143,6 +150,7 @@ interface PackageChangelog {
|
|
|
143
150
|
packageName: string;
|
|
144
151
|
version: string;
|
|
145
152
|
previousVersion: string | null;
|
|
153
|
+
tag?: string;
|
|
146
154
|
revisionRange: string;
|
|
147
155
|
repoUrl: string | null;
|
|
148
156
|
date: string;
|
|
@@ -245,7 +253,7 @@ interface TemplateConfig {
|
|
|
245
253
|
}
|
|
246
254
|
interface LLMConfig {
|
|
247
255
|
provider: 'openai' | 'openai-compatible' | 'anthropic' | 'ollama';
|
|
248
|
-
model
|
|
256
|
+
model?: string;
|
|
249
257
|
baseURL?: string;
|
|
250
258
|
apiKey?: string;
|
|
251
259
|
options?: {
|
|
@@ -367,7 +375,7 @@ declare class ConfigError extends NotesError {
|
|
|
367
375
|
}
|
|
368
376
|
declare function getExitCode(error: NotesError): number;
|
|
369
377
|
|
|
370
|
-
declare function versionOutputToChangelogInput(data: Pick<VersionOutput, 'changelogs'>): ChangelogInput;
|
|
378
|
+
declare function versionOutputToChangelogInput(data: Pick<VersionOutput, 'changelogs'> & Partial<Pick<VersionOutput, 'updates' | 'tags'>>): ChangelogInput;
|
|
371
379
|
declare function parseVersionOutput(json: string): ChangelogInput;
|
|
372
380
|
declare function parseVersionOutputFile(filePath: string): ChangelogInput;
|
|
373
381
|
declare function parseVersionOutputStdin(): Promise<ChangelogInput>;
|
package/dist/index.js
CHANGED
|
@@ -19,12 +19,12 @@ import {
|
|
|
19
19
|
runPipeline,
|
|
20
20
|
saveAuth,
|
|
21
21
|
versionOutputToChangelogInput
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-UAPJMRGO.js";
|
|
23
23
|
import {
|
|
24
24
|
aggregateToRoot,
|
|
25
25
|
detectMonorepo,
|
|
26
26
|
writeMonorepoChangelogs
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-ZY4HXAQV.js";
|
|
28
28
|
import {
|
|
29
29
|
debug,
|
|
30
30
|
formatVersion,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
renderMarkdown,
|
|
33
33
|
success,
|
|
34
34
|
writeMarkdown
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-ECBA67PM.js";
|
|
36
36
|
|
|
37
37
|
// src/output/json.ts
|
|
38
38
|
import * as fs from "fs";
|
|
@@ -34,13 +34,16 @@ Without LLM, the built-in renderer groups entries by their conventional commit t
|
|
|
34
34
|
## [2.0.0] - 2026-01-15
|
|
35
35
|
|
|
36
36
|
### Changed
|
|
37
|
+
|
|
37
38
|
- rename connect() to initialize() across public API
|
|
38
39
|
|
|
39
40
|
### Added
|
|
41
|
+
|
|
40
42
|
- add triggerDeeplink() for deep link testing
|
|
41
43
|
- add mock IPC handler support
|
|
42
44
|
|
|
43
45
|
### Fixed
|
|
46
|
+
|
|
44
47
|
- null pointer in renderer process memory management
|
|
45
48
|
```
|
|
46
49
|
|
|
@@ -50,14 +53,18 @@ With `enhance + categorize` enabled, the same commits produce:
|
|
|
50
53
|
## [2.0.0] - 2026-01-15
|
|
51
54
|
|
|
52
55
|
### Breaking
|
|
56
|
+
|
|
53
57
|
- **BREAKING** **API rename**: Rename connect() to initialize()
|
|
54
58
|
|
|
55
59
|
### New
|
|
60
|
+
|
|
56
61
|
**ipc**:
|
|
62
|
+
|
|
57
63
|
- **Deeplink testing**: Add deep link support via triggerDeeplink()
|
|
58
64
|
- Add mock IPC support
|
|
59
65
|
|
|
60
66
|
### Fixed
|
|
67
|
+
|
|
61
68
|
- Resolve memory leak in renderer process
|
|
62
69
|
```
|
|
63
70
|
|
|
@@ -236,12 +243,14 @@ When the built-in markdown renderer encounters a category where **two or more en
|
|
|
236
243
|
|
|
237
244
|
```markdown
|
|
238
245
|
### New
|
|
246
|
+
|
|
239
247
|
**ipc**:
|
|
248
|
+
|
|
240
249
|
- **Deeplink testing**: Add deep link support via triggerDeeplink()
|
|
241
250
|
- Add mock IPC support
|
|
242
251
|
```
|
|
243
252
|
|
|
244
|
-
A scope that appears on only one entry renders inline: `- **scope**: description`. Entries with no scope render as plain bullets.
|
|
253
|
+
A scope that appears on only one entry renders inline: `- **scope**: description`. Entries with no scope render as plain bullets. Both come before the scope groups, so no entry sits under a label it doesn't have.
|
|
245
254
|
|
|
246
255
|
Scope is assigned by the LLM (or inherited from the source commit). Control what scopes are valid with the `scopes` config.
|
|
247
256
|
|
|
@@ -351,6 +360,7 @@ Rendered output:
|
|
|
351
360
|
|
|
352
361
|
```markdown
|
|
353
362
|
### Migration guide
|
|
363
|
+
|
|
354
364
|
- [v2.0 migration](https://docs.example.com/migrate-v2)
|
|
355
365
|
- [Full guide](https://docs.example.com/full-guide)
|
|
356
366
|
```
|
|
@@ -439,20 +449,26 @@ Note that `links` is a property of `releaseNotes`, not `llm`.
|
|
|
439
449
|
## [2.0.0] - 2026-01-15
|
|
440
450
|
|
|
441
451
|
### Breaking
|
|
452
|
+
|
|
442
453
|
- **BREAKING** **API rename**: Rename connect() to initialize()
|
|
443
454
|
|
|
444
455
|
### New
|
|
456
|
+
|
|
445
457
|
**ipc**:
|
|
458
|
+
|
|
446
459
|
- **Deeplink testing**: Add deep link support via triggerDeeplink()
|
|
447
460
|
- Add mock IPC support
|
|
448
461
|
|
|
449
462
|
### Fixed
|
|
463
|
+
|
|
450
464
|
- Resolve memory leak in renderer process
|
|
451
465
|
|
|
452
466
|
### Developer
|
|
467
|
+
|
|
453
468
|
- Migrate bundler to esbuild 0.20
|
|
454
469
|
|
|
455
470
|
### Links
|
|
471
|
+
|
|
456
472
|
- [v2.0 migration guide](https://docs.example.com/migrate-v2)
|
|
457
473
|
```
|
|
458
474
|
|
package/docs/monorepo.md
CHANGED
|
@@ -39,11 +39,13 @@ In `"root"` or `"both"` mode, the root changelog aggregates entries from all pac
|
|
|
39
39
|
## [@myorg/core@2.0.0] — 2026-03-15
|
|
40
40
|
|
|
41
41
|
### Added
|
|
42
|
+
|
|
42
43
|
- New streaming API
|
|
43
44
|
|
|
44
45
|
## [utils@1.1.0] — 2026-03-15
|
|
45
46
|
|
|
46
47
|
### Fixed
|
|
48
|
+
|
|
47
49
|
- Memory leak in event handler
|
|
48
50
|
```
|
|
49
51
|
|
package/package.json
CHANGED