@releasekit/notes 0.43.0 → 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/README.md +2 -40
- package/dist/{aggregator-FLRONORL.js → aggregator-N733ZTAA.js} +2 -2
- package/dist/{chunk-TNTTAFQ4.js → chunk-ECBA67PM.js} +117 -88
- package/dist/{chunk-U5JUUEEQ.js → chunk-UAPJMRGO.js} +366 -236
- package/dist/{chunk-YNGSEWF6.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-providers.md +4 -18
- package/docs/llm-release-notes.md +17 -1
- package/docs/monorepo.md +3 -16
- package/docs/templates.md +1 -1
- package/package.json +10 -10
- package/templates/angular/version.hbs +7 -0
- package/templates/github-release/release.md.ejs +1 -1
- package/templates/keep-a-changelog/version.liquid +21 -19
- package/docs/configuration.md +0 -403
|
@@ -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,34 +72,37 @@ 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
|
),
|
|
87
93
|
paths: z.array(z.string()).optional().describe(
|
|
88
|
-
"Directories, relative to each package, to bump a Cargo.toml in instead of the package's own directory. Ignored in group mode."
|
|
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
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
|
-
"Directories, relative to each package, to bump a pubspec.yaml in instead of the package's own directory. Ignored in group mode."
|
|
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)."
|
|
@@ -129,7 +142,7 @@ var VersionConfigSchema = z.object({
|
|
|
129
142
|
groups: z.record(z.string(), VersionGroupSchema).optional().describe(
|
|
130
143
|
"Named version groups. Each group binds a set of package patterns to a fixed, linked, or independent sync mode. fixed: any releasable change in any member releases ALL members at the shared group version (bump(max(member baselines))). linked: only members with releasable changes release, but every releasing member shares the same computed version. independent: only members with releasable changes release, each on its own commit-driven version line (no shared version), but the set is atomic \u2014 targeting any member pulls in the whole group. Packages not matched by any group version independently. A package may belong to at most one group. Set version.sync to false when using groups."
|
|
131
144
|
),
|
|
132
|
-
packages: z.array(z.string()).default([]).describe("Packages to include in versioning"),
|
|
145
|
+
packages: z.array(z.string()).default([]).describe("Packages to include in versioning. Empty includes every discovered package."),
|
|
133
146
|
sharedPackages: z.array(z.string()).optional().describe(
|
|
134
147
|
'Foundational packages whose changes belong in every package\u2019s changelog. A commit touching only a shared package (exact name or glob) is classified as repo-level and surfaced under "Project-wide changes" rather than attributed to that one package. Default: none \u2014 no package is treated as shared unless declared.'
|
|
135
148
|
),
|
|
@@ -141,16 +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.'
|
|
158
|
+
),
|
|
159
|
+
commitMessage: z.string().optional().describe(
|
|
160
|
+
// biome-ignore lint/suspicious/noTemplateCurlyInString: documenting placeholder syntax to the user
|
|
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."
|
|
145
162
|
),
|
|
146
|
-
commitMessage: z.string().optional().describe("Template for release commit messages"),
|
|
147
163
|
mismatchStrategy: z.enum(["error", "warn", "ignore", "prefer-package", "prefer-git"]).default("warn").describe("How to handle version mismatches"),
|
|
148
|
-
versionPrefix: z.string().default("").describe(
|
|
164
|
+
versionPrefix: z.string().default("v").describe('Prefix for version tags. Set "" for tags like "1.2.3".'),
|
|
149
165
|
prereleaseIdentifier: z.string().optional().describe("Identifier for prerelease versions (e.g., 'alpha', 'beta')"),
|
|
150
166
|
allowFirstBump: z.boolean().default(false).describe(
|
|
151
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.'
|
|
152
168
|
),
|
|
153
|
-
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."),
|
|
154
170
|
zeroMajor: z.enum(["spec", "strict"]).default("spec").describe(
|
|
155
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."
|
|
156
172
|
),
|
|
@@ -158,7 +174,28 @@ var VersionConfigSchema = z.object({
|
|
|
158
174
|
cargo: VersionCargoConfigSchema.optional().describe("Cargo/Rust configuration"),
|
|
159
175
|
pub: VersionPubConfigSchema.optional().describe("Dart/Flutter pub configuration")
|
|
160
176
|
});
|
|
161
|
-
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({
|
|
162
199
|
enabled: z.boolean().default(true).describe(
|
|
163
200
|
"Publish to npm. Detected npm packages are published by default; set false to opt out (version and tag only)."
|
|
164
201
|
),
|
|
@@ -170,29 +207,34 @@ var NpmConfigSchema = z.object({
|
|
|
170
207
|
tag: z.string().default("latest").describe("NPM dist tag"),
|
|
171
208
|
publishOrder: z.array(z.string()).default([]).describe("Explicit publish order for npm packages; empty auto-sorts dependencies first")
|
|
172
209
|
});
|
|
173
|
-
var CargoPublishConfigSchema = z.
|
|
210
|
+
var CargoPublishConfigSchema = z.strictObject({
|
|
174
211
|
enabled: z.boolean().default(true).describe(
|
|
175
212
|
"Publish to crates.io. Detected Rust packages are published by default; set false to opt out (version and tag only)."
|
|
176
213
|
),
|
|
177
|
-
noVerify: z.boolean().default(false).describe(
|
|
178
|
-
|
|
179
|
-
|
|
214
|
+
noVerify: z.boolean().default(false).describe(
|
|
215
|
+
"Pass --no-verify to cargo publish, skipping the pre-publish build of the packaged crate. Use only as a temporary workaround for a build that fails in CI."
|
|
216
|
+
),
|
|
217
|
+
publishOrder: z.array(z.string()).default([]).describe(
|
|
218
|
+
"Crate names to publish first, in this order; the rest follow in discovery order. Empty sorts crates by their path dependencies."
|
|
219
|
+
),
|
|
220
|
+
clean: z.boolean().default(false).describe("Run cargo clean in each crate's directory before publishing.")
|
|
180
221
|
});
|
|
181
|
-
var PubPublishConfigSchema = z.
|
|
222
|
+
var PubPublishConfigSchema = z.strictObject({
|
|
182
223
|
enabled: z.boolean().default(true).describe(
|
|
183
224
|
"Publish to pub.dev. Detected Dart/Flutter packages are published by default; set false to opt out (version and tag only)."
|
|
184
225
|
),
|
|
185
|
-
publishOrder: z.array(z.string()).default([]).describe("
|
|
226
|
+
publishOrder: z.array(z.string()).default([]).describe("Package names to publish first, in this order; the rest follow in discovery order.")
|
|
186
227
|
});
|
|
187
|
-
var PublishGitConfigSchema = z.
|
|
228
|
+
var PublishGitConfigSchema = z.strictObject({
|
|
188
229
|
push: z.boolean().optional().describe("Push tags and commits to remote. When unset, inherits the top-level git.push (which defaults to push)."),
|
|
189
230
|
pushMethod: z.enum(["auto", "ssh", "https"]).optional().describe("Push method override"),
|
|
190
231
|
remote: z.string().optional().describe("Remote name override"),
|
|
191
232
|
branch: z.string().optional().describe("Branch name override"),
|
|
192
233
|
httpsTokenEnv: z.string().optional().describe("Environment variable name containing a GitHub token for HTTPS pushes"),
|
|
193
|
-
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")
|
|
194
236
|
});
|
|
195
|
-
var GitHubReleaseConfigSchema = z.
|
|
237
|
+
var GitHubReleaseConfigSchema = z.strictObject({
|
|
196
238
|
enabled: z.boolean().default(true).describe("Enable GitHub releases"),
|
|
197
239
|
draft: z.boolean().default(true).describe("Create as draft release"),
|
|
198
240
|
perPackage: z.boolean().default(true).describe("Create separate release per package"),
|
|
@@ -203,49 +245,53 @@ var GitHubReleaseConfigSchema = z.object({
|
|
|
203
245
|
/* biome-ignore lint/suspicious/noTemplateCurlyInString: default template value */
|
|
204
246
|
titleTemplate: z.string().default("${packageName}: ${version}").describe(
|
|
205
247
|
// biome-ignore lint/suspicious/noTemplateCurlyInString: documenting placeholder syntax to the user
|
|
206
|
-
"Template for the GitHub release title when a package name is resolved. Available variables: ${packageName} (original scoped name, e.g. '@scope/pkg'), ${version} (e.g. 'v1.0.0').
|
|
248
|
+
"Template for the GitHub release title when a package name is resolved. Available variables: ${packageName} (original scoped name, e.g. '@scope/pkg'), ${version} (the package's new version, with a 'v' when its tag has one, e.g. 'v1.0.0'). Tags without a package name, e.g. 'v1.0.0' or 'release-1.0.0', are used as the title unchanged."
|
|
207
249
|
),
|
|
208
|
-
skipPackages: z.array(z.string()).default([]).describe(
|
|
250
|
+
skipPackages: z.array(z.string()).default([]).describe(
|
|
251
|
+
"Package names to exclude from GitHub release creation. The name as tags spell it also matches, e.g. 'scope-pkg' for '@scope/pkg'."
|
|
252
|
+
)
|
|
209
253
|
});
|
|
210
|
-
var VerifyRegistryNpmConfigSchema = z.
|
|
254
|
+
var VerifyRegistryNpmConfigSchema = z.strictObject({
|
|
211
255
|
enabled: z.boolean().default(true).describe("Verify NPM publish"),
|
|
212
256
|
maxAttempts: z.number().int().positive().default(5).describe("Maximum verification attempts"),
|
|
213
|
-
initialDelay: z.number().int().positive().default(15e3).describe("
|
|
257
|
+
initialDelay: z.number().int().positive().default(15e3).describe("Wait in ms after the first failed check; each later wait is multiplied by backoffMultiplier."),
|
|
214
258
|
backoffMultiplier: z.number().positive().default(2).describe("Exponential backoff multiplier")
|
|
215
259
|
});
|
|
216
|
-
var VerifyRegistryCargoConfigSchema = z.
|
|
260
|
+
var VerifyRegistryCargoConfigSchema = z.strictObject({
|
|
217
261
|
enabled: z.boolean().default(true).describe("Verify Cargo publish"),
|
|
218
262
|
maxAttempts: z.number().int().positive().default(10).describe("Maximum verification attempts"),
|
|
219
|
-
initialDelay: z.number().int().positive().default(3e4).describe("
|
|
263
|
+
initialDelay: z.number().int().positive().default(3e4).describe("Wait in ms after the first failed check; each later wait is multiplied by backoffMultiplier."),
|
|
220
264
|
backoffMultiplier: z.number().positive().default(2).describe("Exponential backoff multiplier")
|
|
221
265
|
});
|
|
222
|
-
var VerifyRegistryPubConfigSchema = z.
|
|
266
|
+
var VerifyRegistryPubConfigSchema = z.strictObject({
|
|
223
267
|
enabled: z.boolean().default(true).describe("Verify Dart pub publish"),
|
|
224
268
|
maxAttempts: z.number().int().positive().default(10).describe("Maximum verification attempts"),
|
|
225
|
-
initialDelay: z.number().int().positive().default(3e4).describe("
|
|
269
|
+
initialDelay: z.number().int().positive().default(3e4).describe("Wait in ms after the first failed check; each later wait is multiplied by backoffMultiplier."),
|
|
226
270
|
backoffMultiplier: z.number().positive().default(2).describe("Exponential backoff multiplier")
|
|
227
271
|
});
|
|
228
|
-
var VerifyConfigSchema = z.
|
|
272
|
+
var VerifyConfigSchema = z.strictObject({
|
|
229
273
|
npm: VerifyRegistryNpmConfigSchema.default({
|
|
230
274
|
enabled: true,
|
|
231
275
|
maxAttempts: 5,
|
|
232
276
|
initialDelay: 15e3,
|
|
233
277
|
backoffMultiplier: 2
|
|
234
|
-
}),
|
|
278
|
+
}).describe("Poll npm after each publish until the new version is visible."),
|
|
235
279
|
cargo: VerifyRegistryCargoConfigSchema.default({
|
|
236
280
|
enabled: true,
|
|
237
281
|
maxAttempts: 10,
|
|
238
282
|
initialDelay: 3e4,
|
|
239
283
|
backoffMultiplier: 2
|
|
240
|
-
})
|
|
284
|
+
}).describe(
|
|
285
|
+
"Poll crates.io after each publish until the new version is visible. Its index updates more slowly than npm's, so the defaults wait longer."
|
|
286
|
+
),
|
|
241
287
|
pub: VerifyRegistryPubConfigSchema.default({
|
|
242
288
|
enabled: true,
|
|
243
289
|
maxAttempts: 10,
|
|
244
290
|
initialDelay: 3e4,
|
|
245
291
|
backoffMultiplier: 2
|
|
246
|
-
})
|
|
292
|
+
}).describe("Poll pub.dev after each publish until the new version is visible.")
|
|
247
293
|
});
|
|
248
|
-
var PublishConfigSchema = z.
|
|
294
|
+
var PublishConfigSchema = z.strictObject({
|
|
249
295
|
git: PublishGitConfigSchema.optional().describe("Git publishing options"),
|
|
250
296
|
npm: NpmConfigSchema.default({
|
|
251
297
|
enabled: true,
|
|
@@ -298,17 +344,22 @@ var PublishConfigSchema = z.object({
|
|
|
298
344
|
}
|
|
299
345
|
}).describe("Registry verification configuration")
|
|
300
346
|
});
|
|
301
|
-
var TemplateConfigSchema = z.
|
|
302
|
-
path: z.string().optional().describe("
|
|
303
|
-
engine: z.enum(["handlebars", "liquid", "ejs"]).optional().describe("Template engine")
|
|
347
|
+
var TemplateConfigSchema = z.strictObject({
|
|
348
|
+
path: z.string().optional().describe("Template file, or a directory of composable templates."),
|
|
349
|
+
engine: z.enum(["handlebars", "liquid", "ejs"]).optional().describe("Template engine. Detected from the template files when omitted; ignored without path.")
|
|
304
350
|
});
|
|
305
351
|
var LocationModeSchema = z.enum(["root", "packages", "both"]);
|
|
306
|
-
var ReleaseNotesFileConfigSchema = z.
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
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({
|
|
310
361
|
mode: LocationModeSchema.optional().describe(
|
|
311
|
-
"Where to write changelog files
|
|
362
|
+
"Where to write changelog files: 'root' (the default) at the repo root, 'packages' in each package (monorepos only), or 'both'."
|
|
312
363
|
),
|
|
313
364
|
file: z.string().optional().describe("Changelog file name override (default: CHANGELOG.md)"),
|
|
314
365
|
templates: TemplateConfigSchema.optional().describe("Template configuration for changelog"),
|
|
@@ -316,32 +367,32 @@ var ChangelogConfigSchema = z.object({
|
|
|
316
367
|
"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."
|
|
317
368
|
),
|
|
318
369
|
demoteScopes: z.array(z.string()).default([...DEFAULT_DEMOTE_SCOPES]).describe(
|
|
319
|
-
'Conventional-commit scopes whose changelog entries
|
|
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.'
|
|
320
371
|
)
|
|
321
372
|
}).describe("Changelog file configuration");
|
|
322
|
-
var LLMOptionsSchema = z.
|
|
323
|
-
timeout: z.number().int().optional().describe("Idle timeout in ms: a streamed response fails only when nothing arrives for this long"),
|
|
324
|
-
maxTokens: z.number().int().optional().describe("Max tokens to generate"),
|
|
325
|
-
temperature: z.number().optional().describe("Sampling temperature")
|
|
373
|
+
var LLMOptionsSchema = z.strictObject({
|
|
374
|
+
timeout: z.number().int().optional().describe("Idle timeout in ms: a streamed response fails only when nothing arrives for this long. Default: 60000."),
|
|
375
|
+
maxTokens: z.number().int().optional().describe("Max tokens to generate. Default: 16384."),
|
|
376
|
+
temperature: z.number().optional().describe("Sampling temperature. Default: 0.7; the anthropic provider ignores it.")
|
|
326
377
|
});
|
|
327
|
-
var LLMRetryConfigSchema = z.
|
|
328
|
-
maxAttempts: z.number().int().positive().optional().describe("Maximum number of attempts"),
|
|
329
|
-
initialDelay: z.number().int().nonnegative().optional().describe("
|
|
330
|
-
maxDelay: z.number().int().positive().optional().describe("Maximum delay in ms"),
|
|
331
|
-
backoffFactor: z.number().positive().optional().describe("Delay multiplier per attempt")
|
|
378
|
+
var LLMRetryConfigSchema = z.strictObject({
|
|
379
|
+
maxAttempts: z.number().int().positive().optional().describe("Maximum number of attempts, including the first. Default: 3."),
|
|
380
|
+
initialDelay: z.number().int().nonnegative().optional().describe("Delay in ms before the first retry. Default: 1000."),
|
|
381
|
+
maxDelay: z.number().int().positive().optional().describe("Maximum delay in ms between attempts. Default: 30000."),
|
|
382
|
+
backoffFactor: z.number().positive().optional().describe("Delay multiplier per attempt. Default: 2.")
|
|
332
383
|
});
|
|
333
|
-
var LLMTasksConfigSchema = z.
|
|
334
|
-
summarize: z.boolean().optional().describe("
|
|
335
|
-
enhance: z.boolean().optional().describe("
|
|
336
|
-
categorize: z.boolean().optional().describe("
|
|
337
|
-
releaseNotes: z.boolean().optional().describe("
|
|
384
|
+
var LLMTasksConfigSchema = z.strictObject({
|
|
385
|
+
summarize: z.boolean().optional().describe("Write a 2\u20133 sentence summary of the release."),
|
|
386
|
+
enhance: z.boolean().optional().describe("Rewrite each entry's description to be clearer for users."),
|
|
387
|
+
categorize: z.boolean().optional().describe("Group entries into the configured categories."),
|
|
388
|
+
releaseNotes: z.boolean().optional().describe("Write prose release notes for the GitHub Release body and any release-notes files.")
|
|
338
389
|
});
|
|
339
|
-
var LLMCategorySchema = z.
|
|
390
|
+
var LLMCategorySchema = z.strictObject({
|
|
340
391
|
name: z.string().describe("Category label shown in release notes (e.g. 'Features')"),
|
|
341
392
|
description: z.string().describe("LLM instruction describing what commits belong in this category"),
|
|
342
393
|
scopes: z.array(z.string()).optional().describe("Conventional commit scopes assigned to this category")
|
|
343
394
|
});
|
|
344
|
-
var ScopeRulesSchema = z.
|
|
395
|
+
var ScopeRulesSchema = z.strictObject({
|
|
345
396
|
allowed: z.array(z.string()).optional().describe("Explicit list of valid scope names; commits with unlisted scopes trigger invalidScopeAction"),
|
|
346
397
|
caseSensitive: z.boolean().default(false).describe("Whether scope comparison is case-sensitive"),
|
|
347
398
|
invalidScopeAction: z.enum(["remove", "keep", "fallback"]).default("remove").describe(
|
|
@@ -349,53 +400,63 @@ var ScopeRulesSchema = z.object({
|
|
|
349
400
|
),
|
|
350
401
|
fallbackScope: z.string().optional().describe("Scope substituted when invalidScopeAction is 'fallback'")
|
|
351
402
|
});
|
|
352
|
-
var ScopeConfigSchema = z.
|
|
403
|
+
var ScopeConfigSchema = z.strictObject({
|
|
353
404
|
mode: z.enum(["restricted", "packages", "none", "unrestricted"]).default("unrestricted").describe(
|
|
354
405
|
"Scope allowlist source: 'restricted' uses rules.allowed, 'packages' derives scopes from workspace package names, 'none' strips all scopes, 'unrestricted' allows any scope"
|
|
355
406
|
),
|
|
356
407
|
rules: ScopeRulesSchema.optional().describe("Scope validation and transformation rules")
|
|
357
408
|
});
|
|
358
|
-
var LLMPromptOverridesSchema = z.
|
|
359
|
-
enhance: z.string().optional().describe("
|
|
360
|
-
categorize: z.string().optional().describe("
|
|
361
|
-
enhanceAndCategorize: z.string().optional().describe("
|
|
362
|
-
summarize: z.string().optional().describe("
|
|
363
|
-
releaseNotes: z.string().optional().describe("
|
|
409
|
+
var LLMPromptOverridesSchema = z.strictObject({
|
|
410
|
+
enhance: z.string().optional().describe("For the enhance task when categorize is off."),
|
|
411
|
+
categorize: z.string().optional().describe("For the categorize task when enhance is off."),
|
|
412
|
+
enhanceAndCategorize: z.string().optional().describe("For the combined task that replaces enhance and categorize when both are on."),
|
|
413
|
+
summarize: z.string().optional().describe("For the summarize task."),
|
|
414
|
+
releaseNotes: z.string().optional().describe("For the releaseNotes task.")
|
|
364
415
|
});
|
|
365
|
-
var LLMPromptsConfigSchema = z.
|
|
416
|
+
var LLMPromptsConfigSchema = z.strictObject({
|
|
366
417
|
instructions: LLMPromptOverridesSchema.optional().describe(
|
|
367
|
-
"
|
|
418
|
+
"Extra instructions appended to a task's built-in system prompt. The task's output format is unchanged."
|
|
368
419
|
)
|
|
369
420
|
});
|
|
370
|
-
var LLMConfigBaseSchema = z.
|
|
421
|
+
var LLMConfigBaseSchema = z.strictObject({
|
|
371
422
|
provider: z.enum(["openai", "openai-compatible", "anthropic", "ollama"]).describe("LLM provider"),
|
|
372
|
-
model: z.string().min(1, "model must be a non-empty string \u2014 set it to a model the provider serves.").describe(
|
|
373
|
-
"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."
|
|
374
425
|
),
|
|
375
426
|
baseURL: z.string().optional().describe("Custom API base URL. Required for the openai-compatible provider."),
|
|
376
|
-
apiKey: z.string().optional().describe(
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
427
|
+
apiKey: z.string().optional().describe(
|
|
428
|
+
"API key. When unset, releasekit uses the key saved by releasekit-notes auth, then the provider's environment variable (e.g. OPENAI_API_KEY); prefer either to an inline key."
|
|
429
|
+
),
|
|
430
|
+
options: LLMOptionsSchema.optional().describe("Options for each request to the provider."),
|
|
431
|
+
concurrency: z.number().int().positive().optional().describe(
|
|
432
|
+
"Maximum packages processed at once and, separately, entries a package's standalone enhance task rewrites at once. Default: 5."
|
|
433
|
+
),
|
|
434
|
+
retry: LLMRetryConfigSchema.optional().describe("Retries for LLM requests that fail with a retryable error."),
|
|
435
|
+
tasks: LLMTasksConfigSchema.optional().describe("LLM tasks to run. Each is off unless set to true."),
|
|
381
436
|
categories: z.array(LLMCategorySchema).default(() => [
|
|
382
437
|
{ name: "Breaking", description: "Breaking changes that require user action to upgrade" },
|
|
383
438
|
{ name: "New", description: "New features and capabilities" },
|
|
384
439
|
{ name: "Changed", description: "Changes to existing functionality" },
|
|
385
440
|
{ name: "Fixed", description: "Bug fixes" },
|
|
386
441
|
{ name: "Developer", description: "Internal changes: CI, tooling, dependencies, refactoring" }
|
|
387
|
-
])
|
|
442
|
+
]).describe(
|
|
443
|
+
"Categories the categorize task sorts entries into. Default: Breaking, New, Changed, Fixed and Developer, each with a built-in description."
|
|
444
|
+
),
|
|
388
445
|
style: z.string().default(
|
|
389
446
|
'Write in past tense ("Added feature", not "Add feature"). Be concise and user-focused. Lead with the impact, not the implementation detail.'
|
|
390
|
-
).describe(
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
447
|
+
).describe(
|
|
448
|
+
"Writing-style instruction for the enhance task, alone or combined with categorize. Default: past tense, concise and user-focused, leading with the impact."
|
|
449
|
+
),
|
|
450
|
+
scopes: ScopeConfigSchema.optional().describe("Validation of the scopes the LLM assigns to entries."),
|
|
451
|
+
prompts: LLMPromptsConfigSchema.optional().describe("Per-task prompt additions."),
|
|
452
|
+
examples: z.number().int().min(0).max(5).default(3).describe(
|
|
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."
|
|
454
|
+
),
|
|
455
|
+
context: z.strictObject({
|
|
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.")
|
|
396
457
|
}).default({ pullRequests: true }).describe("Additional context sources for the LLM."),
|
|
397
458
|
categoryOrder: z.array(z.string()).optional().describe(
|
|
398
|
-
"
|
|
459
|
+
"Order of the rendered categories. Listed ones come first; the rest keep their order in categories, except Breaking, which stays first unless listed."
|
|
399
460
|
),
|
|
400
461
|
cache: z.boolean().default(false).describe(
|
|
401
462
|
"Cache LLM responses on disk (under the OS temp dir), keyed by a hash of the provider, model, prompt, and request options. A re-run or backfill with the same inputs reuses the cached generation instead of re-calling the provider. Off by default."
|
|
@@ -410,7 +471,7 @@ var LLMConfigSchema = LLMConfigBaseSchema.superRefine((cfg, ctx) => {
|
|
|
410
471
|
});
|
|
411
472
|
}
|
|
412
473
|
});
|
|
413
|
-
var ReleaseNotesConfigSchema = z.
|
|
474
|
+
var ReleaseNotesConfigSchema = z.strictObject({
|
|
414
475
|
file: ReleaseNotesFileConfigSchema.optional().describe(
|
|
415
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."
|
|
416
477
|
),
|
|
@@ -418,48 +479,56 @@ var ReleaseNotesConfigSchema = z.object({
|
|
|
418
479
|
"Template for rendering release notes (e.g. to add docs-site frontmatter). Takes precedence over LLM prose and the default formatted section."
|
|
419
480
|
),
|
|
420
481
|
llm: LLMConfigSchema.optional().describe("LLM configuration for release notes"),
|
|
421
|
-
links: z.
|
|
482
|
+
links: z.strictObject({
|
|
422
483
|
items: z.array(
|
|
423
|
-
z.
|
|
484
|
+
z.strictObject({
|
|
424
485
|
label: z.string().describe("Link text"),
|
|
425
486
|
url: z.string().url().describe("Link URL")
|
|
426
487
|
})
|
|
427
|
-
).optional().describe("Static
|
|
428
|
-
fromPRBodyMarker: z.string().optional().describe(
|
|
429
|
-
|
|
430
|
-
|
|
488
|
+
).optional().describe("Static links, each { label, url }, listed first."),
|
|
489
|
+
fromPRBodyMarker: z.string().optional().describe(
|
|
490
|
+
"Also collect links from linked PR bodies: each line starting with this marker adds its markdown link or bare URL, skipping URLs already listed. Needs llm.context.pullRequests."
|
|
491
|
+
),
|
|
492
|
+
title: z.string().optional().describe("Heading for the links section. Default: Links.")
|
|
493
|
+
}).optional().describe(
|
|
494
|
+
"Links section the built-in renderer appends to each version. Rendered only when the categorize task produced categories."
|
|
495
|
+
),
|
|
431
496
|
firstRelease: z.union([
|
|
432
497
|
z.literal(false).describe("Set to false to disable the first-release placeholder intro."),
|
|
433
|
-
z.
|
|
498
|
+
z.strictObject({
|
|
434
499
|
text: z.string().optional().describe(
|
|
435
500
|
// biome-ignore lint/suspicious/noTemplateCurlyInString: documenting placeholder syntax to the user
|
|
436
|
-
"Placeholder intro line for a package's first release. Supports ${packageName} and ${version}.
|
|
501
|
+
"Placeholder intro line for a package's first release. Supports ${packageName} and ${version}. Default: '_First release of ${packageName}._'."
|
|
437
502
|
)
|
|
438
503
|
})
|
|
439
504
|
]).optional().describe(
|
|
440
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."
|
|
441
506
|
)
|
|
442
507
|
}).describe("Release notes configuration");
|
|
443
|
-
var NotesInputConfigSchema = z.
|
|
508
|
+
var NotesInputConfigSchema = z.strictObject({
|
|
444
509
|
source: z.string().optional(),
|
|
445
510
|
file: z.string().optional()
|
|
446
511
|
});
|
|
447
|
-
var NotesConfigSchema = z.
|
|
448
|
-
changelog: z.union([z.literal(false).describe("Set to false to disable changelog generation"), ChangelogConfigSchema]).optional(),
|
|
449
|
-
releaseNotes: z.union([z.literal(false).describe("Set to false to disable release notes"), ReleaseNotesConfigSchema]).optional()
|
|
512
|
+
var NotesConfigSchema = z.strictObject({
|
|
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."),
|
|
514
|
+
releaseNotes: z.union([z.literal(false).describe("Set to false to disable release notes"), ReleaseNotesConfigSchema]).optional().describe(
|
|
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."
|
|
516
|
+
),
|
|
450
517
|
updateStrategy: z.enum(["prepend", "regenerate"]).optional().describe(
|
|
451
|
-
"How to update existing changelog files. 'prepend' adds new entries
|
|
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."
|
|
452
519
|
)
|
|
453
520
|
});
|
|
454
|
-
var CILabelsConfigSchema = z.
|
|
521
|
+
var CILabelsConfigSchema = z.strictObject({
|
|
455
522
|
graduate: z.string().default("release:graduate").describe(
|
|
456
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."
|
|
457
524
|
),
|
|
458
525
|
graduatePackagePrefix: z.string().default("graduate:").describe(
|
|
459
526
|
"Prefix for per-package graduate labels on the standing PR. A `graduate:<package>` label graduates just that prerelease package (and, atomically, any fixed/linked group it belongs to) to its stable base version on the next update, while other prerelease packages stay on their line. The whole-batch `graduate` label still graduates everything. Standing-pr mode only."
|
|
460
527
|
),
|
|
461
|
-
prerelease: z.string().default("channel:prerelease").describe("Label
|
|
462
|
-
skip: z.string().default("release:skip").describe(
|
|
528
|
+
prerelease: z.string().default("channel:prerelease").describe("Label that makes the release a prerelease. In label-trigger mode it needs a bump label too."),
|
|
529
|
+
skip: z.string().default("release:skip").describe(
|
|
530
|
+
"Label that stops a merged PR from releasing. Commit-trigger mode only; in label mode, leave off the bump label instead."
|
|
531
|
+
),
|
|
463
532
|
immediate: z.string().default("release:immediate").describe("Label to bypass the standing PR for one merge \u2014 triggers a direct release. Standing-pr mode only."),
|
|
464
533
|
retry: z.string().default("release:retry").describe("Label to retry a failed publish by re-applying it to a merged standing PR. Standing-pr mode only."),
|
|
465
534
|
previewNotes: z.string().default("release:preview-notes").describe(
|
|
@@ -472,24 +541,30 @@ var CILabelsConfigSchema = z.object({
|
|
|
472
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."
|
|
473
542
|
)
|
|
474
543
|
});
|
|
475
|
-
var StandingPrConfigSchema = z.
|
|
476
|
-
branch: z.string().default("release/next").describe(
|
|
544
|
+
var StandingPrConfigSchema = z.strictObject({
|
|
545
|
+
branch: z.string().default("release/next").describe(
|
|
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."
|
|
547
|
+
),
|
|
477
548
|
title: z.string().optional().describe(
|
|
478
549
|
// biome-ignore lint/suspicious/noTemplateCurlyInString: documenting placeholder syntax to the user
|
|
479
|
-
"PR title template. Variables: ${count} (publishable package count), ${version} (
|
|
550
|
+
"PR title template. Variables: ${count} (publishable package count), ${version} (the first publishable package's new version), ${tag} (version with tag prefix). Also the release commit's subject, so it must match a release.ci.skipPatterns entry and carry no CI-skip marker. A title with a CI-skip marker is replaced by 'chore: release preparation'. So is one the skip patterns miss, if they match 'chore: release preparation'. The run warns either way. Default depends on the versioning strategy: 'chore: release ${tag}' in sync mode, 'chore: release ${count} package(s)' otherwise."
|
|
551
|
+
),
|
|
552
|
+
labels: z.array(z.string()).default(["release"]).describe(
|
|
553
|
+
"Labels to apply to the standing release PR. Don't include bump, channel, scope or release labels: the standing PR reads its own labels as release overrides."
|
|
480
554
|
),
|
|
481
|
-
labels: z.array(z.string()).default(["release"]).describe("Labels to apply to the standing release PR."),
|
|
482
555
|
deleteBranchOnMerge: z.boolean().default(true).describe(
|
|
483
556
|
"Whether to auto-delete the release branch after the PR is merged. Publish keeps it if an update has moved it since the merge, or if the merged PR's head commit can't be read."
|
|
484
557
|
),
|
|
485
|
-
mergeMethod: z.enum(["merge", "squash", "rebase"]).default("merge").describe(
|
|
558
|
+
mergeMethod: z.enum(["merge", "squash", "rebase"]).default("merge").describe(
|
|
559
|
+
"Merge method for releasekit standing-pr merge. Use 'squash' or 'rebase' so the release commit's subject reaches the base branch, where release.ci.skipPatterns can match it."
|
|
560
|
+
),
|
|
486
561
|
minAge: z.string().optional().describe(
|
|
487
|
-
"Minimum age of the standing PR before it can be merged. Duration string, e.g. '6h', '30m', '1d'. Gate enforced via the releasekit/standing-pr commit status check; configure it as a required status check in branch protection to block merges."
|
|
562
|
+
"Minimum age of the standing PR, counted from when it was first opened, before it can be merged. Duration string, e.g. '6h', '30m', '1d'. Gate enforced via the releasekit/standing-pr commit status check; configure it as a required status check in branch protection to block merges."
|
|
488
563
|
),
|
|
489
564
|
minPackages: z.number().int().positive().optional().describe(
|
|
490
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."
|
|
491
566
|
),
|
|
492
|
-
authorization: z.
|
|
567
|
+
authorization: z.strictObject({
|
|
493
568
|
requiredPermission: z.enum(["admin", "maintain", "write"]).default("admin").describe(
|
|
494
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."
|
|
495
570
|
),
|
|
@@ -505,7 +580,7 @@ var StandingPrConfigSchema = z.object({
|
|
|
505
580
|
"Refuse to publish the standing PR when the actor who merged it is not authorized (defense-in-depth behind a branch-protection ruleset, which is the primary merge gate). Set false to rely on branch protection alone."
|
|
506
581
|
)
|
|
507
582
|
}).optional().describe(
|
|
508
|
-
"Restrict who can steer the standing PR \u2014 its selection checkboxes, per-row channel toggles, release labels, and merge. Omit to allow anyone with the GitHub permission GitHub itself requires for each action
|
|
583
|
+
"Restrict who can steer the standing PR \u2014 its selection checkboxes, per-row channel toggles, release labels, and merge. Omit to allow anyone with the GitHub permission GitHub itself requires for each action."
|
|
509
584
|
),
|
|
510
585
|
primaryPackages: z.array(z.string()).default([]).describe(
|
|
511
586
|
"Packages that drive releases \u2014 rendered as parent rows in the standing-PR selection list, with their coupled group-mates and changed prerequisites nested beneath, so one parent toggle holds back the whole release unit. Glob patterns or exact names. Empty (default) \u2192 flat per-package list (current behavior)."
|
|
@@ -514,16 +589,16 @@ var StandingPrConfigSchema = z.object({
|
|
|
514
589
|
"How the selection list renders when primaryPackages is set. streamlined: one checkbox per primary, coupled members shown read-only in a collapsed pane, and a held-back primary cascades to its unit. granular: every package keeps its own checkbox, nested under its primary, with no cascade. No effect when primaryPackages is empty."
|
|
515
590
|
),
|
|
516
591
|
combinedChangelogFooter: z.boolean().default(true).describe(
|
|
517
|
-
"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). 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."
|
|
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."
|
|
518
593
|
),
|
|
519
594
|
channelToggle: z.boolean().default(false).describe(
|
|
520
|
-
"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."
|
|
521
596
|
),
|
|
522
597
|
summaryTable: z.boolean().default(false).describe(
|
|
523
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.'
|
|
524
599
|
)
|
|
525
600
|
});
|
|
526
|
-
var CIConfigSchema = z.
|
|
601
|
+
var CIConfigSchema = z.strictObject({
|
|
527
602
|
releaseStrategy: z.enum(["manual", "direct", "standing-pr"]).default("direct").describe(
|
|
528
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."
|
|
529
604
|
),
|
|
@@ -532,7 +607,7 @@ var CIConfigSchema = z.object({
|
|
|
532
607
|
),
|
|
533
608
|
prPreview: z.union([
|
|
534
609
|
z.boolean(),
|
|
535
|
-
z.
|
|
610
|
+
z.strictObject({
|
|
536
611
|
enabled: z.boolean().default(true).describe("Whether PR preview comments are posted."),
|
|
537
612
|
markStaleAfterRelease: z.boolean().default(false).describe(
|
|
538
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."
|
|
@@ -563,17 +638,19 @@ var CIConfigSchema = z.object({
|
|
|
563
638
|
"Configuration for the standing release PR feature (ci.releaseStrategy: 'standing-pr')."
|
|
564
639
|
)
|
|
565
640
|
});
|
|
566
|
-
var ReleaseCIConfigSchema = z.
|
|
567
|
-
skipPatterns: z.array(z.string().min(1)).optional().describe(
|
|
641
|
+
var ReleaseCIConfigSchema = z.strictObject({
|
|
642
|
+
skipPatterns: z.array(z.string().min(1)).optional().describe(
|
|
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 '."
|
|
644
|
+
),
|
|
568
645
|
minChanges: z.number().int().positive().optional().describe("Minimum number of packages with releasable changes required to trigger a release"),
|
|
569
646
|
githubRelease: z.literal(false).optional().describe("Set to false to disable GitHub release creation in CI"),
|
|
570
647
|
notes: z.literal(false).optional().describe("Set to false to disable changelog generation in CI")
|
|
571
648
|
});
|
|
572
|
-
var ReleaseConfigSchema = z.
|
|
649
|
+
var ReleaseConfigSchema = z.strictObject({
|
|
573
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>."),
|
|
574
651
|
ci: ReleaseCIConfigSchema.optional().describe("CI-specific automation settings")
|
|
575
652
|
});
|
|
576
|
-
var ReleaseKitConfigSchema = z.
|
|
653
|
+
var ReleaseKitConfigSchema = z.strictObject({
|
|
577
654
|
$schema: z.string().optional().describe("JSON schema reference URL"),
|
|
578
655
|
git: GitConfigSchema.optional().describe("Git configuration"),
|
|
579
656
|
monorepo: MonorepoConfigSchema.optional().describe("Monorepo configuration"),
|
|
@@ -611,26 +688,33 @@ function substituteVariables(value, rootDir = process.cwd()) {
|
|
|
611
688
|
});
|
|
612
689
|
return result;
|
|
613
690
|
}
|
|
614
|
-
var SOLE_REFERENCE_PATTERN = /^\{(
|
|
615
|
-
function substituteInObject(obj, rootDir = process.cwd()) {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
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
|
+
}
|
|
619
703
|
return void 0;
|
|
620
704
|
}
|
|
621
705
|
return result;
|
|
622
706
|
}
|
|
623
|
-
if (Array.isArray(
|
|
624
|
-
return
|
|
707
|
+
if (Array.isArray(value)) {
|
|
708
|
+
return value.map((item, index) => substituteAt(item, rootDir, [...path62, index], onUnsetEnv));
|
|
625
709
|
}
|
|
626
|
-
if (
|
|
710
|
+
if (value && typeof value === "object") {
|
|
627
711
|
const result = {};
|
|
628
|
-
for (const [key,
|
|
629
|
-
result[key] =
|
|
712
|
+
for (const [key, item] of Object.entries(value)) {
|
|
713
|
+
result[key] = substituteAt(item, rootDir, [...path62, key], onUnsetEnv);
|
|
630
714
|
}
|
|
631
715
|
return result;
|
|
632
716
|
}
|
|
633
|
-
return
|
|
717
|
+
return value;
|
|
634
718
|
}
|
|
635
719
|
var AUTH_DIR = path2.join(os.homedir(), ".config", "releasekit");
|
|
636
720
|
var AUTH_FILE = path2.join(AUTH_DIR, "auth.json");
|
|
@@ -653,100 +737,133 @@ function saveAuth(provider, apiKey) {
|
|
|
653
737
|
existing[provider] = apiKey;
|
|
654
738
|
fs2.writeFileSync(AUTH_FILE, JSON.stringify(existing, null, 2), { encoding: "utf-8", mode: 384 });
|
|
655
739
|
}
|
|
656
|
-
var
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
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
|
+
});
|
|
662
793
|
}
|
|
663
|
-
|
|
664
|
-
|
|
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
|
+
});
|
|
665
800
|
}
|
|
666
|
-
function
|
|
667
|
-
return
|
|
801
|
+
function samePath(a, b) {
|
|
802
|
+
return a.length === b.length && a.every((key, i) => key === b[i]);
|
|
668
803
|
}
|
|
669
|
-
function
|
|
670
|
-
|
|
671
|
-
return;
|
|
672
|
-
}
|
|
673
|
-
const rn = config.notes.releaseNotes;
|
|
674
|
-
const removed = [];
|
|
675
|
-
if ("mode" in rn) {
|
|
676
|
-
removed.push("mode");
|
|
677
|
-
}
|
|
678
|
-
if ("directory" in rn) {
|
|
679
|
-
removed.push("directory");
|
|
680
|
-
}
|
|
681
|
-
if (typeof rn.file === "string") {
|
|
682
|
-
removed.push("file (string)");
|
|
683
|
-
}
|
|
684
|
-
if (removed.length === 0) {
|
|
685
|
-
return;
|
|
686
|
-
}
|
|
687
|
-
throw new ConfigError(
|
|
688
|
-
`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.`
|
|
689
|
-
);
|
|
804
|
+
function zodConfigError(error2, unsetEnv) {
|
|
805
|
+
return configValidationError(flattenIssues(error2.issues, unsetEnv));
|
|
690
806
|
}
|
|
691
|
-
function
|
|
692
|
-
|
|
693
|
-
|
|
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
|
+
}
|
|
694
818
|
}
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
)
|
|
699
|
-
|
|
700
|
-
return;
|
|
819
|
+
}
|
|
820
|
+
function copyUnsetEnv(from, to) {
|
|
821
|
+
const refs = unsetEnvByOwner.get(from);
|
|
822
|
+
if (refs) {
|
|
823
|
+
unsetEnvByOwner.set(to, new Map(refs));
|
|
701
824
|
}
|
|
702
|
-
throw new ConfigError(
|
|
703
|
-
`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.`
|
|
704
|
-
);
|
|
705
825
|
}
|
|
706
|
-
function
|
|
707
|
-
|
|
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) {
|
|
708
831
|
return;
|
|
709
832
|
}
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
`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).`
|
|
715
|
-
);
|
|
716
|
-
}
|
|
717
|
-
if (isRecord(config.ci.prPreview) && "refreshAfterRelease" in config.ci.prPreview) {
|
|
718
|
-
throw new ConfigError(
|
|
719
|
-
"ci.prPreview.refreshAfterRelease was renamed to markStaleAfterRelease. It now marks open PRs' previews stale after a release instead of recomputing them."
|
|
720
|
-
);
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
if (isRecord(config.monorepo) && "mainPackage" in config.monorepo) {
|
|
724
|
-
throw new ConfigError("monorepo.mainPackage was removed \u2014 use version.mainPackage instead.");
|
|
725
|
-
}
|
|
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
|
+
]);
|
|
726
837
|
}
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
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
|
+
}
|
|
730
845
|
}
|
|
846
|
+
return path3.join(cwd, CONFIG_FILES[0]);
|
|
731
847
|
}
|
|
732
848
|
function loadConfigFile(configPath) {
|
|
733
849
|
if (!fs3.existsSync(configPath)) {
|
|
734
850
|
return {};
|
|
735
851
|
}
|
|
852
|
+
const unsetEnv = [];
|
|
736
853
|
try {
|
|
737
854
|
const content = fs3.readFileSync(configPath, "utf-8");
|
|
738
855
|
const parsed = parseJsonc(content);
|
|
739
|
-
const substituted = substituteInObject(
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
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;
|
|
745
864
|
} catch (error2) {
|
|
746
865
|
if (error2 instanceof z2.ZodError) {
|
|
747
|
-
|
|
748
|
-
throw new ConfigError(`Config validation errors:
|
|
749
|
-
${issues}`);
|
|
866
|
+
throw zodConfigError(error2, unsetEnv);
|
|
750
867
|
}
|
|
751
868
|
if (error2 instanceof SyntaxError) {
|
|
752
869
|
throw new ConfigError(`Invalid JSON in config file: ${error2.message}`);
|
|
@@ -855,7 +972,8 @@ var VersionPackageChangelogSchema = z3.looseObject({
|
|
|
855
972
|
previousVersion: z3.string().nullable(),
|
|
856
973
|
revisionRange: z3.string(),
|
|
857
974
|
repoUrl: z3.string().nullable(),
|
|
858
|
-
entries: z3.array(VersionChangelogEntrySchema)
|
|
975
|
+
entries: z3.array(VersionChangelogEntrySchema),
|
|
976
|
+
tag: z3.string().optional()
|
|
859
977
|
});
|
|
860
978
|
var VersionPackageUpdateSchema = z3.looseObject({
|
|
861
979
|
packageName: z3.string(),
|
|
@@ -870,11 +988,15 @@ var VersionOutputSchema = z3.looseObject({
|
|
|
870
988
|
changelogs: z3.array(VersionPackageChangelogSchema),
|
|
871
989
|
commitMessage: z3.string().optional(),
|
|
872
990
|
tags: z3.array(z3.string()),
|
|
873
|
-
baselineTags: z3.array(z3.string()).optional()
|
|
991
|
+
baselineTags: z3.array(z3.string()).optional(),
|
|
992
|
+
additionalFiles: z3.array(z3.string()).optional()
|
|
874
993
|
});
|
|
875
994
|
|
|
876
995
|
// src/input/version-output.ts
|
|
877
|
-
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
|
+
});
|
|
878
1000
|
function normalizeEntryType(type) {
|
|
879
1001
|
const typeMap = {
|
|
880
1002
|
added: "added",
|
|
@@ -896,10 +1018,12 @@ function versionOutputToChangelogInput(data) {
|
|
|
896
1018
|
if (!data.changelogs || !Array.isArray(data.changelogs)) {
|
|
897
1019
|
throw new InputParseError('Input must contain a "changelogs" array');
|
|
898
1020
|
}
|
|
1021
|
+
const soleTag = data.tags?.length === 1 && !data.updates?.some((u) => u.tag) ? data.tags[0] : void 0;
|
|
899
1022
|
const packages = data.changelogs.map((changelog) => ({
|
|
900
1023
|
packageName: changelog.packageName,
|
|
901
1024
|
version: changelog.version,
|
|
902
1025
|
previousVersion: changelog.previousVersion,
|
|
1026
|
+
tag: changelog.tag ?? data.updates?.find((u) => u.packageName === changelog.packageName)?.tag ?? soleTag,
|
|
903
1027
|
revisionRange: changelog.revisionRange,
|
|
904
1028
|
repoUrl: changelog.repoUrl,
|
|
905
1029
|
date: (/* @__PURE__ */ new Date()).toISOString().split("T")[0] ?? "",
|
|
@@ -1039,7 +1163,7 @@ function isBotComment(comment) {
|
|
|
1039
1163
|
if (!user) {
|
|
1040
1164
|
return true;
|
|
1041
1165
|
}
|
|
1042
|
-
return user.type === "Bot" || user.login
|
|
1166
|
+
return user.type === "Bot" || user.login?.endsWith("[bot]") === true;
|
|
1043
1167
|
}
|
|
1044
1168
|
var REPO_PERMISSIONS = ["admin", "maintain", "write", "triage", "read", "none"];
|
|
1045
1169
|
var MAX_RELEASE_PAGES = 3;
|
|
@@ -1129,7 +1253,13 @@ var GitHubForge = class {
|
|
|
1129
1253
|
}
|
|
1130
1254
|
async getPullRequest(prNumber) {
|
|
1131
1255
|
const { data } = await this.octokit.rest.pulls.get({ ...this.base, pull_number: prNumber });
|
|
1132
|
-
return {
|
|
1256
|
+
return {
|
|
1257
|
+
body: data.body ?? "",
|
|
1258
|
+
labels: labelNames(data.labels),
|
|
1259
|
+
headSha: data.head?.sha,
|
|
1260
|
+
headRef: data.head?.ref,
|
|
1261
|
+
baseRef: data.base?.ref
|
|
1262
|
+
};
|
|
1133
1263
|
}
|
|
1134
1264
|
async createPullRequest(pr) {
|
|
1135
1265
|
const { data } = await this.octokit.rest.pulls.create({ ...this.base, ...pr });
|
|
@@ -1138,8 +1268,8 @@ var GitHubForge = class {
|
|
|
1138
1268
|
async updatePullRequest(prNumber, changes) {
|
|
1139
1269
|
await this.octokit.rest.pulls.update({ ...this.base, pull_number: prNumber, ...changes });
|
|
1140
1270
|
}
|
|
1141
|
-
async mergePullRequest(prNumber, method) {
|
|
1142
|
-
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 });
|
|
1143
1273
|
}
|
|
1144
1274
|
async createIssue(issue) {
|
|
1145
1275
|
const { data } = await this.octokit.rest.issues.create({ ...this.base, ...issue });
|
|
@@ -3091,41 +3221,37 @@ function isVersionStartAt(tag, i) {
|
|
|
3091
3221
|
}
|
|
3092
3222
|
return false;
|
|
3093
3223
|
}
|
|
3094
|
-
function generateCompareUrl(repoUrl, from, to, packageName) {
|
|
3224
|
+
function generateCompareUrl(repoUrl, from, to, packageName, tag) {
|
|
3095
3225
|
const isPackageSpecific = from.includes("@") && packageName && from.includes(packageName);
|
|
3096
|
-
let fromVersion;
|
|
3097
3226
|
let toVersion;
|
|
3098
|
-
if (
|
|
3099
|
-
|
|
3227
|
+
if (tag) {
|
|
3228
|
+
toVersion = tag;
|
|
3229
|
+
} else if (isPackageSpecific) {
|
|
3100
3230
|
toVersion = `${packageName}@${to.startsWith("v") ? "" : "v"}${to}`;
|
|
3101
3231
|
} else {
|
|
3102
3232
|
const toClean = to.replace(/^v/, "");
|
|
3103
3233
|
const atPos = from.lastIndexOf("@");
|
|
3104
3234
|
const dashVPos = from.lastIndexOf("-v");
|
|
3105
3235
|
if (atPos > 0 && isVersionStartAt(from, atPos + 1)) {
|
|
3106
|
-
fromVersion = from;
|
|
3107
3236
|
toVersion = `${from.slice(0, atPos + 1)}${from[atPos + 1] === "v" ? "v" : ""}${toClean}`;
|
|
3108
3237
|
} else if (dashVPos > 0 && from.charCodeAt(dashVPos + 2) >= 48 && from.charCodeAt(dashVPos + 2) <= 57) {
|
|
3109
|
-
fromVersion = from;
|
|
3110
3238
|
toVersion = `${from.slice(0, dashVPos + 1)}v${toClean}`;
|
|
3111
3239
|
} else {
|
|
3112
3240
|
const sepPos = findCompoundTagSepPos(from);
|
|
3113
3241
|
if (sepPos > 0) {
|
|
3114
|
-
fromVersion = from;
|
|
3115
3242
|
toVersion = `${from.slice(0, sepPos + 1)}${toClean}`;
|
|
3116
3243
|
} else {
|
|
3117
|
-
|
|
3118
|
-
toVersion = toClean;
|
|
3244
|
+
toVersion = `${from.startsWith("v") ? "v" : ""}${toClean}`;
|
|
3119
3245
|
}
|
|
3120
3246
|
}
|
|
3121
3247
|
}
|
|
3122
3248
|
if (/gitlab\.com/i.test(repoUrl)) {
|
|
3123
|
-
return `${repoUrl}/-/compare/${
|
|
3249
|
+
return `${repoUrl}/-/compare/${from}...${toVersion}`;
|
|
3124
3250
|
}
|
|
3125
3251
|
if (/bitbucket\.org/i.test(repoUrl)) {
|
|
3126
|
-
return `${repoUrl}/branches/compare/${
|
|
3252
|
+
return `${repoUrl}/branches/compare/${from}..${toVersion}`;
|
|
3127
3253
|
}
|
|
3128
|
-
return `${repoUrl}/compare/${
|
|
3254
|
+
return `${repoUrl}/compare/${from}...${toVersion}`;
|
|
3129
3255
|
}
|
|
3130
3256
|
function buildOrderedCategories(rawCategories, configCategories) {
|
|
3131
3257
|
const order = configCategories?.map((c) => c.name) ?? [];
|
|
@@ -3140,7 +3266,7 @@ function buildOrderedCategories(rawCategories, configCategories) {
|
|
|
3140
3266
|
});
|
|
3141
3267
|
}
|
|
3142
3268
|
function createTemplateContext(pkg) {
|
|
3143
|
-
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;
|
|
3144
3270
|
return {
|
|
3145
3271
|
packageName: pkg.packageName,
|
|
3146
3272
|
version: pkg.version,
|
|
@@ -3319,7 +3445,8 @@ async function runPipeline(input, config, dryRun, pipelineOptions) {
|
|
|
3319
3445
|
const changelogConfig = config.changelog === false ? false : { mode: "root", ...config.changelog ?? {} };
|
|
3320
3446
|
const releaseNotesConfig = config.releaseNotes === false || config.releaseNotes === void 0 ? void 0 : config.releaseNotes;
|
|
3321
3447
|
const llmConfig = releaseNotesConfig?.llm;
|
|
3322
|
-
if (llmConfig &&
|
|
3448
|
+
if (llmConfig && runsLlmTasks(llmConfig, pipelineOptions?.skipReleaseNotes)) {
|
|
3449
|
+
assertLlmModel(llmConfig);
|
|
3323
3450
|
info("Processing with LLM enhancement");
|
|
3324
3451
|
const examplesCount = llmConfig.examples ?? 3;
|
|
3325
3452
|
const repoUrl = contexts[0]?.repoUrl ?? input.metadata?.repoUrl;
|
|
@@ -3423,7 +3550,7 @@ async function runPipeline(input, config, dryRun, pipelineOptions) {
|
|
|
3423
3550
|
const dir = releaseNotesConfig.file.dir;
|
|
3424
3551
|
info(`Generating release notes \u2192 ${dir}`);
|
|
3425
3552
|
try {
|
|
3426
|
-
const { detectMonorepo } = await import("./aggregator-
|
|
3553
|
+
const { detectMonorepo } = await import("./aggregator-N733ZTAA.js");
|
|
3427
3554
|
const nested = detectMonorepo(process.cwd()).isMonorepo || contexts.length > 1;
|
|
3428
3555
|
const renderContent = (ctx) => {
|
|
3429
3556
|
if (releaseNotesConfig.templates?.path) {
|
|
@@ -3487,7 +3614,7 @@ async function processInput(inputJson, config, dryRun, pipelineOptions) {
|
|
|
3487
3614
|
return runPipeline(input, config, dryRun, pipelineOptions);
|
|
3488
3615
|
}
|
|
3489
3616
|
async function writeMonorepoFiles(contexts, config, dryRun, fileName, refs) {
|
|
3490
|
-
const { detectMonorepo, writeMonorepoChangelogs } = await import("./aggregator-
|
|
3617
|
+
const { detectMonorepo, writeMonorepoChangelogs } = await import("./aggregator-N733ZTAA.js");
|
|
3491
3618
|
const cwd = process.cwd();
|
|
3492
3619
|
const detected = detectMonorepo(cwd);
|
|
3493
3620
|
if (!detected.isMonorepo) {
|
|
@@ -3610,6 +3737,9 @@ function createNotesCommand() {
|
|
|
3610
3737
|
const detail = issues?.map((i) => i.message).join("; ") ?? (err instanceof Error ? err.message : String(err));
|
|
3611
3738
|
throw new Error(`Invalid LLM configuration from --llm-* flags: ${detail}`);
|
|
3612
3739
|
}
|
|
3740
|
+
if (existingLlm) {
|
|
3741
|
+
copyUnsetEnv(existingLlm, validatedLlm);
|
|
3742
|
+
}
|
|
3613
3743
|
config.releaseNotes = {
|
|
3614
3744
|
...existingRn,
|
|
3615
3745
|
llm: validatedLlm
|