@releasekit/notes 0.41.2 → 0.42.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-NMUD72J2.js → aggregator-75QONDAK.js} +2 -4
- package/dist/{chunk-2PRVRNSI.js → chunk-3X4XBORT.js} +472 -235
- package/dist/{chunk-FI3F2ND5.js → chunk-LA3V665B.js} +177 -37
- package/dist/{chunk-YO6KWOCB.js → chunk-OEY4SBEM.js} +4 -3
- package/dist/cli.d.ts +5 -9
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +517 -9
- package/dist/index.js +3 -3
- package/docs/configuration.md +1 -1
- package/package.json +22 -22
- package/templates/angular/entry.hbs +1 -1
- package/templates/github-release/release.md.ejs +1 -1
- package/templates/keep-a-changelog/entry.liquid +1 -1
- package/templates/keep-a-changelog/version.liquid +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,517 @@
|
|
|
1
|
-
export { createNotesCommand } from './
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
export { createNotesCommand } from './cli.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import 'commander';
|
|
4
|
+
|
|
5
|
+
declare const MonorepoConfigSchema: z.ZodObject<{
|
|
6
|
+
rootPath: z.ZodOptional<z.ZodString>;
|
|
7
|
+
packagesPath: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
type MonorepoConfig = z.infer<typeof MonorepoConfigSchema>;
|
|
10
|
+
declare function loadAuth(): Record<string, string>;
|
|
11
|
+
declare function saveAuth(provider: string, apiKey: string): void;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Neutralising bare GitHub-autolinked tokens in changelog output. GitHub auto-links a bare `#NNN`
|
|
15
|
+
* issue/PR ref (with a hovercard) and treats a bare `@scope/pkg` / `@user` as a mention (a stray
|
|
16
|
+
* link that can ping/subscribe a real org or team on every release PR). Both render surfaces — the
|
|
17
|
+
* notes Markdown (`CHANGELOG.md`, GitHub release body) and the standing-PR body — share these two
|
|
18
|
+
* pure helpers so the treatment stays identical.
|
|
19
|
+
*/
|
|
20
|
+
/** How bare `#NNN` issue/PR refs in a changelog are rendered. */
|
|
21
|
+
type ChangelogRefsMode = 'strip' | 'escape' | 'link';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Base error class that all releasekit errors should extend.
|
|
25
|
+
* Provides consistent error handling with codes and suggestions.
|
|
26
|
+
*/
|
|
27
|
+
declare abstract class ReleaseKitError extends Error {
|
|
28
|
+
abstract readonly code: string;
|
|
29
|
+
abstract readonly suggestions: string[];
|
|
30
|
+
constructor(message: string);
|
|
31
|
+
logError(): void;
|
|
32
|
+
/** True for an error from any copy of core (see {@link RELEASEKIT_ERROR_BRAND}), not just this one. */
|
|
33
|
+
static isReleaseKitError(error: unknown): error is ReleaseKitError;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Shared types for the releasekit ecosystem.
|
|
38
|
+
*
|
|
39
|
+
* These types define the JSON contract between @releasekit/version (producer)
|
|
40
|
+
* and @releasekit/notes (consumer). Changes here affect both packages.
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* A single changelog entry produced by @releasekit/version.
|
|
44
|
+
*/
|
|
45
|
+
interface VersionChangelogEntry {
|
|
46
|
+
type: string;
|
|
47
|
+
description: string;
|
|
48
|
+
issueIds?: string[];
|
|
49
|
+
/**
|
|
50
|
+
* The pull request this entry shipped through, taken from the trailing `(#N)` GitHub appends to a
|
|
51
|
+
* squash-merge commit subject. It marks which of the {@link issueIds} is the PR (the rest are closed
|
|
52
|
+
* issues), so the changelog can render `(PR #N · closes #M)` instead of a flat ref list. The number
|
|
53
|
+
* is also kept inside `issueIds` (the full flat list), so a consumer that ignores this field still
|
|
54
|
+
* shows the ref. Optional and additive — absent means no identifiable PR (a non-squash commit or an
|
|
55
|
+
* old manifest), and renderers fall back to the plain ref list.
|
|
56
|
+
*/
|
|
57
|
+
prNumber?: string;
|
|
58
|
+
scope?: string;
|
|
59
|
+
originalType?: string;
|
|
60
|
+
breaking?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* True when this entry is a fabricated `Update version to X` placeholder minted by the
|
|
63
|
+
* version-groups engine for a lockstep carry — a group member bumped only to stay in sync, with
|
|
64
|
+
* no commits of its own. It is not derived from a real commit. The preview formatter treats a
|
|
65
|
+
* changelog whose entries are *all* synthetic as "no real changes" and collapses the package into
|
|
66
|
+
* the "Also bumped" list instead of rendering a full block of placeholder noise.
|
|
67
|
+
*
|
|
68
|
+
* Only the groups engine sets it, and only on a clean empty extraction: an independently-released
|
|
69
|
+
* package (single/async strategy) or an extraction-error fallback keeps its visible block, since
|
|
70
|
+
* neither is a no-change carry. Optional and additive — absent means a real entry, so manifests
|
|
71
|
+
* written before this field existed render exactly as before.
|
|
72
|
+
*/
|
|
73
|
+
synthetic?: boolean;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Changelog data for a single package, as emitted by @releasekit/version --json.
|
|
77
|
+
*/
|
|
78
|
+
interface VersionPackageChangelog {
|
|
79
|
+
packageName: string;
|
|
80
|
+
version: string;
|
|
81
|
+
previousVersion: string | null;
|
|
82
|
+
revisionRange: string;
|
|
83
|
+
repoUrl: string | null;
|
|
84
|
+
entries: VersionChangelogEntry[];
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The resolved action a package's version landed on — purely additive observability, it
|
|
88
|
+
* never changes which version resolves. `'graduated'` means a prerelease was promoted to stable and
|
|
89
|
+
* any requested bump was ignored; `'bumped'` is the ordinary commit/label-driven bump;
|
|
90
|
+
* `'first-release'` is a package with no prior tag. Defined as a string-literal union (core cannot
|
|
91
|
+
* import the version package, where the deriving logic lives).
|
|
92
|
+
*/
|
|
93
|
+
type VersionAction = 'first-release' | 'graduated' | 'bumped';
|
|
94
|
+
/**
|
|
95
|
+
* The release channel a version sits on. Derived per-package and purely from the resolved
|
|
96
|
+
* version: `'prerelease'` when the version carries a semver prerelease segment (`…-<preid>.N`), else
|
|
97
|
+
* `'stable'`. A standing PR with permanently-mixed maturity carries both at once — some `'stable'`
|
|
98
|
+
* packages, some `'prerelease'` — each advancing along its own line.
|
|
99
|
+
*/
|
|
100
|
+
type ReleaseChannel = 'stable' | 'prerelease';
|
|
101
|
+
/**
|
|
102
|
+
* The `data` of @releasekit/version's `--json` envelope.
|
|
103
|
+
* This is the primary interchange format between version and notes.
|
|
104
|
+
*/
|
|
105
|
+
interface VersionOutput {
|
|
106
|
+
dryRun: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Which versioning strategy produced this output. Lets consumers (preview, standing PR)
|
|
109
|
+
* render sync releases as a single versioned unit instead of a package count. Optional
|
|
110
|
+
* for backwards compatibility with manifests produced before this field existed.
|
|
111
|
+
*
|
|
112
|
+
* `'group'` is the version-groups engine (fixed/linked, and the implicit all-packages fixed
|
|
113
|
+
* group that `version.sync: true` desugars to). `'sync'` remains for the legacy lockstep
|
|
114
|
+
* strategy so existing consumers keep working unchanged.
|
|
115
|
+
*/
|
|
116
|
+
strategy?: 'sync' | 'single' | 'async' | 'group';
|
|
117
|
+
updates: VersionPackageUpdate[];
|
|
118
|
+
changelogs: VersionPackageChangelog[];
|
|
119
|
+
/**
|
|
120
|
+
* Changelog entries from commits that don't touch any specific package directory
|
|
121
|
+
* (CI, infrastructure, shared package changes). Stored separately so they can be
|
|
122
|
+
* rendered once rather than duplicated across every per-package changelog.
|
|
123
|
+
*/
|
|
124
|
+
sharedEntries?: VersionChangelogEntry[];
|
|
125
|
+
commitMessage?: string;
|
|
126
|
+
/** Consumer-facing tags from `tagTemplate` (e.g. `v1.2.3`). The publish pipeline pushes
|
|
127
|
+
* them and creates a GitHub Release for each. */
|
|
128
|
+
tags: string[];
|
|
129
|
+
/** Internal baseline-marker tags from `baselineTagTemplate` (e.g. `release/v1.2.3`).
|
|
130
|
+
* Pushed alongside `tags` but not used to create GitHub Releases — they exist purely
|
|
131
|
+
* so future version-bump and changelog calculations can find the previous release on
|
|
132
|
+
* the source branch's history when the consumer-facing tag has been force-moved off it. */
|
|
133
|
+
baselineTags?: string[];
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* A package update record in the version output.
|
|
137
|
+
*/
|
|
138
|
+
interface VersionPackageUpdate {
|
|
139
|
+
packageName: string;
|
|
140
|
+
newVersion: string;
|
|
141
|
+
/**
|
|
142
|
+
* The resolved baseline version this update bumped from — the package's prior release, in the same
|
|
143
|
+
* consumer-tag display form the changelog carries ({@link VersionPackageChangelog.previousVersion}).
|
|
144
|
+
* Absent for a first release and whenever the baseline was unreachable / fell back to all-history,
|
|
145
|
+
* so consumers derive the bump magnitude only when it is present. Optional for backwards
|
|
146
|
+
* compatibility: standing-PR manifests written before this field existed omit it (old PRs still
|
|
147
|
+
* open), so every consumer must tolerate its absence (render a dash / skip the delta).
|
|
148
|
+
*/
|
|
149
|
+
previousVersion?: string;
|
|
150
|
+
filePath: string;
|
|
151
|
+
/** Per-package git tag. Set only when each package has its own tag (async mode or sync+packageSpecificTags). Absent in sync mode with a single shared tag. */
|
|
152
|
+
tag?: string;
|
|
153
|
+
/**
|
|
154
|
+
* True when this update is the workspace-root package.json, bumped only to keep the root
|
|
155
|
+
* version in lockstep (sync mode). Root updates are not publishable packages — consumers
|
|
156
|
+
* should exclude them from package counts and package lists.
|
|
157
|
+
*/
|
|
158
|
+
isRoot?: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Name of the version group this package was released as part of (from `version.groups`, or
|
|
161
|
+
* the implicit all-packages group that `version.sync: true` desugars to). Absent for packages
|
|
162
|
+
* versioned independently. CI surfaces can use this to treat a fixed group atomically (e.g.
|
|
163
|
+
* expand a scope label that matches part of a group to the whole group).
|
|
164
|
+
*/
|
|
165
|
+
group?: string;
|
|
166
|
+
/**
|
|
167
|
+
* Role in a `--include-prerequisites` release: `'target'` for an explicitly-selected
|
|
168
|
+
* (group-expanded) package that receives the bump/prerelease/stable override, `'prerequisite'`
|
|
169
|
+
* for a changed transitive dependency pulled in to keep the targets installable (it keeps its own
|
|
170
|
+
* commit-driven bump). Absent on plain releases and for the root lockstep bump — consumers treat
|
|
171
|
+
* an absent role as a target.
|
|
172
|
+
*/
|
|
173
|
+
role?: 'target' | 'prerequisite';
|
|
174
|
+
/**
|
|
175
|
+
* For a `'prerequisite'` update, the target package(s) it was pulled in for (a shared dependency
|
|
176
|
+
* can serve several). Lets CI surfaces render "target → its prerequisites" without re-deriving
|
|
177
|
+
* the dependency graph. Absent for targets.
|
|
178
|
+
*/
|
|
179
|
+
prerequisiteOf?: string[];
|
|
180
|
+
/**
|
|
181
|
+
* The resolved version action for this update: `'graduated'` (prerelease → stable, bump
|
|
182
|
+
* ignored), `'bumped'` (commit/label-driven), or `'first-release'`. Purely additive observability —
|
|
183
|
+
* it never affects which version resolved. Optional for backwards compatibility: standing-PR
|
|
184
|
+
* manifests produced before this field existed won't carry it, so every consumer must tolerate
|
|
185
|
+
* its absence (render nothing).
|
|
186
|
+
*/
|
|
187
|
+
action?: VersionAction;
|
|
188
|
+
/** Short human-readable reason for {@link action} (e.g. `Graduated 1.0.0-next.1 → 1.0.0 (bump ignored).`). Optional, same back-compat rule as {@link action}. */
|
|
189
|
+
actionReason?: string;
|
|
190
|
+
/**
|
|
191
|
+
* The release channel this package's new version sits on: `'prerelease'` when `newVersion`
|
|
192
|
+
* carries a semver prerelease segment, else `'stable'`. Derived from the resolved version via
|
|
193
|
+
* {@link deriveReleaseChannel}; a mixed standing PR carries both, each package advancing on its own
|
|
194
|
+
* line. Purely additive observability — it never affects which version resolves. Optional for
|
|
195
|
+
* backwards compatibility: standing-PR manifests written before this field existed omit it, so every
|
|
196
|
+
* consumer must tolerate its absence (re-derive from `newVersion`).
|
|
197
|
+
*/
|
|
198
|
+
channel?: ReleaseChannel;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
interface RetryOptions {
|
|
202
|
+
maxAttempts?: number;
|
|
203
|
+
initialDelay?: number;
|
|
204
|
+
maxDelay?: number;
|
|
205
|
+
backoffFactor?: number;
|
|
206
|
+
/**
|
|
207
|
+
* Decide whether a thrown error is worth retrying. `true` (or omitting the predicate) retries;
|
|
208
|
+
* `false` stops immediately and rethrows. Lets callers fail fast on non-transient errors
|
|
209
|
+
* (e.g. 4xx auth/validation) while still retrying timeout/429/5xx/network failures.
|
|
210
|
+
*/
|
|
211
|
+
shouldRetry?: (error: unknown) => boolean;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
type ChangelogType = 'added' | 'changed' | 'deprecated' | 'removed' | 'fixed' | 'security';
|
|
215
|
+
interface PRContext {
|
|
216
|
+
number: number;
|
|
217
|
+
title: string;
|
|
218
|
+
body: string;
|
|
219
|
+
}
|
|
220
|
+
interface ChangelogEntry {
|
|
221
|
+
type: ChangelogType;
|
|
222
|
+
description: string;
|
|
223
|
+
issueIds?: string[];
|
|
224
|
+
/** The PR this entry shipped through (trailing `(#N)` of a squash-merge subject); marks which of
|
|
225
|
+
* {@link issueIds} is the PR vs. a closed issue. Optional — absent means no identifiable PR. */
|
|
226
|
+
prNumber?: string;
|
|
227
|
+
scope?: string;
|
|
228
|
+
originalType?: string;
|
|
229
|
+
breaking?: boolean;
|
|
230
|
+
leadIn?: string;
|
|
231
|
+
/** Populated upstream of LLM tasks; never serialised to disk. */
|
|
232
|
+
context?: {
|
|
233
|
+
prs: PRContext[];
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
interface PackageChangelog {
|
|
237
|
+
packageName: string;
|
|
238
|
+
version: string;
|
|
239
|
+
previousVersion: string | null;
|
|
240
|
+
revisionRange: string;
|
|
241
|
+
repoUrl: string | null;
|
|
242
|
+
date: string;
|
|
243
|
+
entries: ChangelogEntry[];
|
|
244
|
+
}
|
|
245
|
+
type InputSource = 'version' | 'conventional-changelog' | 'git-log' | 'manual';
|
|
246
|
+
interface ChangelogInput {
|
|
247
|
+
source: InputSource;
|
|
248
|
+
packages: PackageChangelog[];
|
|
249
|
+
metadata?: {
|
|
250
|
+
repoUrl?: string;
|
|
251
|
+
defaultBranch?: string;
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
interface EnhancedCategory {
|
|
255
|
+
name: string;
|
|
256
|
+
entries: ChangelogEntry[];
|
|
257
|
+
}
|
|
258
|
+
interface EnhancedData {
|
|
259
|
+
entries: ChangelogEntry[];
|
|
260
|
+
summary?: string;
|
|
261
|
+
categories?: EnhancedCategory[];
|
|
262
|
+
releaseNotes?: string;
|
|
263
|
+
}
|
|
264
|
+
interface TemplateContext {
|
|
265
|
+
packageName: string;
|
|
266
|
+
version: string;
|
|
267
|
+
previousVersion: string | null;
|
|
268
|
+
date: string;
|
|
269
|
+
repoUrl: string | null;
|
|
270
|
+
entries: ChangelogEntry[];
|
|
271
|
+
compareUrl?: string;
|
|
272
|
+
enhanced?: EnhancedData;
|
|
273
|
+
/** True when `previousVersion === null` — the package has no prior release. Templates can branch
|
|
274
|
+
* on it to add a first-release intro; the default renderer seeds a placeholder line. */
|
|
275
|
+
isFirstRelease?: boolean;
|
|
276
|
+
}
|
|
277
|
+
interface DocumentContext {
|
|
278
|
+
project: {
|
|
279
|
+
name: string;
|
|
280
|
+
repoUrl?: string;
|
|
281
|
+
};
|
|
282
|
+
versions: TemplateContext[];
|
|
283
|
+
unreleased?: TemplateContext;
|
|
284
|
+
compareUrls?: Record<string, string>;
|
|
285
|
+
/** True when rendered for a single-package inline context (e.g. GitHub release body).
|
|
286
|
+
* Templates can use this to suppress document-level headings that are redundant
|
|
287
|
+
* when the content is embedded in a release that already shows the package/version. */
|
|
288
|
+
perPackage?: boolean;
|
|
289
|
+
/** Which release-notes destination this render targets: `'file'` (an in-repo per-version file)
|
|
290
|
+
* or `'release'` (the GitHub release body). Templates can branch on it — e.g. emit docs-site
|
|
291
|
+
* YAML frontmatter only for `'file'`, since it would render as literal text in a GitHub release. */
|
|
292
|
+
output?: 'file' | 'release';
|
|
293
|
+
}
|
|
294
|
+
interface LLMOptions {
|
|
295
|
+
timeout?: number;
|
|
296
|
+
maxTokens?: number;
|
|
297
|
+
temperature?: number;
|
|
298
|
+
}
|
|
299
|
+
interface LLMPromptOverrides {
|
|
300
|
+
enhance?: string;
|
|
301
|
+
categorize?: string;
|
|
302
|
+
enhanceAndCategorize?: string;
|
|
303
|
+
summarize?: string;
|
|
304
|
+
releaseNotes?: string;
|
|
305
|
+
}
|
|
306
|
+
interface LLMPromptsConfig {
|
|
307
|
+
instructions?: LLMPromptOverrides;
|
|
308
|
+
}
|
|
309
|
+
interface LLMCategory {
|
|
310
|
+
name: string;
|
|
311
|
+
description: string;
|
|
312
|
+
scopes?: string[];
|
|
313
|
+
}
|
|
314
|
+
interface ScopeRules {
|
|
315
|
+
allowed?: string[];
|
|
316
|
+
caseSensitive?: boolean;
|
|
317
|
+
invalidScopeAction?: 'remove' | 'keep' | 'fallback';
|
|
318
|
+
fallbackScope?: string;
|
|
319
|
+
}
|
|
320
|
+
interface ScopeConfig {
|
|
321
|
+
mode?: 'restricted' | 'packages' | 'none' | 'unrestricted';
|
|
322
|
+
rules?: ScopeRules;
|
|
323
|
+
}
|
|
324
|
+
type UpdateStrategy = 'prepend' | 'regenerate';
|
|
325
|
+
interface Config {
|
|
326
|
+
changelog?: false | ChangelogConfig;
|
|
327
|
+
releaseNotes?: false | ReleaseNotesConfig;
|
|
328
|
+
monorepo?: MonorepoConfig;
|
|
329
|
+
updateStrategy?: UpdateStrategy;
|
|
330
|
+
}
|
|
331
|
+
type JSONSchema = Record<string, unknown>;
|
|
332
|
+
interface CompleteOptions {
|
|
333
|
+
maxTokens?: number;
|
|
334
|
+
temperature?: number;
|
|
335
|
+
timeout?: number;
|
|
336
|
+
schema?: JSONSchema;
|
|
337
|
+
toolName?: string;
|
|
338
|
+
}
|
|
339
|
+
type TemplateEngine = 'handlebars' | 'liquid' | 'ejs';
|
|
340
|
+
interface TemplateConfig {
|
|
341
|
+
path?: string;
|
|
342
|
+
engine?: TemplateEngine;
|
|
343
|
+
}
|
|
344
|
+
interface LLMConfig {
|
|
345
|
+
provider: 'openai' | 'openai-compatible' | 'anthropic' | 'ollama';
|
|
346
|
+
model: string;
|
|
347
|
+
baseURL?: string;
|
|
348
|
+
apiKey?: string;
|
|
349
|
+
options?: {
|
|
350
|
+
timeout?: number;
|
|
351
|
+
maxTokens?: number;
|
|
352
|
+
temperature?: number;
|
|
353
|
+
};
|
|
354
|
+
concurrency?: number;
|
|
355
|
+
retry?: RetryOptions;
|
|
356
|
+
tasks?: {
|
|
357
|
+
summarize?: boolean;
|
|
358
|
+
enhance?: boolean;
|
|
359
|
+
categorize?: boolean;
|
|
360
|
+
releaseNotes?: boolean;
|
|
361
|
+
};
|
|
362
|
+
context?: {
|
|
363
|
+
pullRequests?: boolean;
|
|
364
|
+
};
|
|
365
|
+
examples?: number;
|
|
366
|
+
categoryOrder?: string[];
|
|
367
|
+
cache?: boolean;
|
|
368
|
+
categories?: Array<{
|
|
369
|
+
name: string;
|
|
370
|
+
description: string;
|
|
371
|
+
scopes?: string[];
|
|
372
|
+
}>;
|
|
373
|
+
style?: string;
|
|
374
|
+
scopes?: ScopeConfig;
|
|
375
|
+
prompts?: {
|
|
376
|
+
instructions?: Record<string, string>;
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
type LocationMode = 'root' | 'packages' | 'both';
|
|
380
|
+
interface ChangelogConfig {
|
|
381
|
+
mode?: LocationMode;
|
|
382
|
+
file?: string;
|
|
383
|
+
templates?: TemplateConfig;
|
|
384
|
+
/** How bare `#NNN` issue/PR refs render in the changelog. Default `'link'` when unset. */
|
|
385
|
+
refs?: ChangelogRefsMode;
|
|
386
|
+
}
|
|
387
|
+
interface LinksConfig {
|
|
388
|
+
items?: Array<{
|
|
389
|
+
label: string;
|
|
390
|
+
url: string;
|
|
391
|
+
}>;
|
|
392
|
+
fromPRBodyMarker?: string;
|
|
393
|
+
title?: string;
|
|
394
|
+
}
|
|
395
|
+
interface ReleaseNotesFileConfig {
|
|
396
|
+
/** Directory for the per-version release-notes files (default: release-notes). */
|
|
397
|
+
dir?: string;
|
|
398
|
+
}
|
|
399
|
+
interface FirstReleaseConfig {
|
|
400
|
+
/** Placeholder intro line for a package's first release. Supports ${packageName} and ${version}. */
|
|
401
|
+
text?: string;
|
|
402
|
+
}
|
|
403
|
+
interface ReleaseNotesConfig {
|
|
404
|
+
/** In-repo per-version file output. Omit to keep notes only on the GitHub release body. */
|
|
405
|
+
file?: ReleaseNotesFileConfig;
|
|
406
|
+
templates?: TemplateConfig;
|
|
407
|
+
llm?: LLMConfig;
|
|
408
|
+
links?: LinksConfig;
|
|
409
|
+
/** First-release placeholder intro. Default-on with a factual line; set to false to disable. */
|
|
410
|
+
firstRelease?: false | FirstReleaseConfig;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
declare function loadConfig(projectDir?: string, configFile?: string): Config;
|
|
414
|
+
declare function getDefaultConfig(): Config;
|
|
415
|
+
|
|
416
|
+
declare function createTemplateContext(pkg: PackageChangelog): TemplateContext;
|
|
417
|
+
interface PipelineResult {
|
|
418
|
+
/** Per-package rendered markdown keyed by package name. */
|
|
419
|
+
packageNotes: Record<string, string>;
|
|
420
|
+
/** File paths that were written to disk. */
|
|
421
|
+
files: string[];
|
|
422
|
+
/** GitHub release notes content keyed by package name. */
|
|
423
|
+
releaseNotes?: Record<string, string>;
|
|
424
|
+
}
|
|
425
|
+
interface PipelineOptions {
|
|
426
|
+
/**
|
|
427
|
+
* Skip the LLM pass and the release-notes file write (RELEASE_NOTES.md).
|
|
428
|
+
* Per-package CHANGELOG.md is unaffected. Use during standing-PR update so the
|
|
429
|
+
* standing-PR workflow doesn't depend on LLM availability and doesn't pay for
|
|
430
|
+
* an LLM call on every push to main.
|
|
431
|
+
*/
|
|
432
|
+
skipReleaseNotes?: boolean;
|
|
433
|
+
/**
|
|
434
|
+
* Skip the changelog file writes (CHANGELOG.md). LLM + release-notes generation
|
|
435
|
+
* are unaffected. Use during publish from manifest to regenerate only the
|
|
436
|
+
* release notes against an already-bumped tree.
|
|
437
|
+
*/
|
|
438
|
+
skipChangelogs?: boolean;
|
|
439
|
+
}
|
|
440
|
+
declare function runPipeline(input: ChangelogInput, config: Config, dryRun: boolean, pipelineOptions?: PipelineOptions): Promise<PipelineResult>;
|
|
441
|
+
declare function processInput(inputJson: string, config: Config, dryRun: boolean, pipelineOptions?: PipelineOptions): Promise<PipelineResult>;
|
|
442
|
+
|
|
443
|
+
declare abstract class NotesError extends ReleaseKitError {
|
|
444
|
+
}
|
|
445
|
+
declare class InputParseError extends NotesError {
|
|
446
|
+
readonly code = "INPUT_PARSE_ERROR";
|
|
447
|
+
readonly suggestions: string[];
|
|
448
|
+
}
|
|
449
|
+
declare class TemplateError extends NotesError {
|
|
450
|
+
readonly code = "TEMPLATE_ERROR";
|
|
451
|
+
readonly suggestions: string[];
|
|
452
|
+
}
|
|
453
|
+
declare class LLMError extends NotesError {
|
|
454
|
+
readonly code = "LLM_ERROR";
|
|
455
|
+
readonly suggestions: string[];
|
|
456
|
+
/**
|
|
457
|
+
* Whether the underlying failure is transient and worth retrying (timeout / 429 / 5xx / network).
|
|
458
|
+
* `false` marks a non-retryable failure (4xx auth/validation) so `withRetry` fails fast instead of
|
|
459
|
+
* burning the whole backoff budget. `undefined` means "unclassified" — callers retry by default.
|
|
460
|
+
*/
|
|
461
|
+
readonly retryable?: boolean;
|
|
462
|
+
constructor(message: string, options?: {
|
|
463
|
+
retryable?: boolean;
|
|
464
|
+
cause?: unknown;
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
declare class GitHubError extends NotesError {
|
|
468
|
+
readonly code = "GITHUB_ERROR";
|
|
469
|
+
readonly suggestions: string[];
|
|
470
|
+
}
|
|
471
|
+
declare class ConfigError extends NotesError {
|
|
472
|
+
readonly code = "CONFIG_ERROR";
|
|
473
|
+
readonly suggestions: string[];
|
|
474
|
+
}
|
|
475
|
+
declare function getExitCode(error: NotesError): number;
|
|
476
|
+
|
|
477
|
+
declare function versionOutputToChangelogInput(data: VersionOutput): ChangelogInput;
|
|
478
|
+
declare function parseVersionOutput(json: string): ChangelogInput;
|
|
479
|
+
declare function parseVersionOutputFile(filePath: string): ChangelogInput;
|
|
480
|
+
declare function parseVersionOutputStdin(): Promise<ChangelogInput>;
|
|
481
|
+
|
|
482
|
+
interface MonorepoOptions {
|
|
483
|
+
rootPath: string;
|
|
484
|
+
packagesPath: string;
|
|
485
|
+
mode: 'root' | 'packages' | 'both';
|
|
486
|
+
fileName?: string;
|
|
487
|
+
}
|
|
488
|
+
declare function aggregateToRoot(contexts: TemplateContext[]): TemplateContext;
|
|
489
|
+
declare function writeMonorepoChangelogs(contexts: TemplateContext[], options: MonorepoOptions, config: {
|
|
490
|
+
updateStrategy?: 'prepend' | 'regenerate';
|
|
491
|
+
}, dryRun: boolean, refs?: ChangelogRefsMode): string[];
|
|
492
|
+
declare function detectMonorepo(cwd: string): {
|
|
493
|
+
isMonorepo: boolean;
|
|
494
|
+
packagesPath: string;
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
declare function renderJson(contexts: TemplateContext[]): string;
|
|
498
|
+
declare function writeJson(outputPath: string, contexts: TemplateContext[], dryRun: boolean): void;
|
|
499
|
+
|
|
500
|
+
interface FormatVersionOptions {
|
|
501
|
+
/** Include the package name in the version header (e.g. `## [pkg@1.0.0]`). */
|
|
502
|
+
includePackageName?: boolean;
|
|
503
|
+
/** Order to render LLM-categorised sections. Only applies when enhanced.categories is present. */
|
|
504
|
+
categoryOrder?: string[];
|
|
505
|
+
/** Migration/doc links to render at the end of the release notes section. */
|
|
506
|
+
links?: LinksConfig;
|
|
507
|
+
/** First-release placeholder intro config, or `false` to suppress it. */
|
|
508
|
+
firstRelease?: FirstReleaseConfig | false;
|
|
509
|
+
/** How bare `#NNN` issue/PR refs are rendered (`changelog.refs`; default `'link'`). */
|
|
510
|
+
refs?: ChangelogRefsMode;
|
|
511
|
+
}
|
|
512
|
+
declare function formatVersion(context: TemplateContext, options?: FormatVersionOptions): string;
|
|
513
|
+
declare function renderMarkdown(contexts: TemplateContext[], options?: FormatVersionOptions): string;
|
|
514
|
+
declare function writeMarkdown(outputPath: string, contexts: TemplateContext[], config: Config, dryRun: boolean, options?: FormatVersionOptions): void;
|
|
515
|
+
|
|
516
|
+
export { ConfigError, GitHubError, InputParseError, LLMError, NotesError, TemplateError, aggregateToRoot, createTemplateContext, detectMonorepo, formatVersion, getDefaultConfig, getExitCode, loadAuth, loadConfig, parseVersionOutput, parseVersionOutputFile, parseVersionOutputStdin, processInput, renderJson, renderMarkdown, runPipeline, saveAuth, versionOutputToChangelogInput, writeJson, writeMarkdown, writeMonorepoChangelogs };
|
|
517
|
+
export type { ChangelogConfig, ChangelogEntry, ChangelogInput, ChangelogType, CompleteOptions, Config, DocumentContext, EnhancedCategory, EnhancedData, FirstReleaseConfig, InputSource, JSONSchema, LLMCategory, LLMConfig, LLMOptions, LLMPromptOverrides, LLMPromptsConfig, LinksConfig, LocationMode, PRContext, PackageChangelog, PipelineOptions, PipelineResult, ReleaseNotesConfig, ReleaseNotesFileConfig, RetryOptions, ScopeConfig, ScopeRules, TemplateConfig, TemplateContext, TemplateEngine, UpdateStrategy };
|
package/dist/index.js
CHANGED
|
@@ -18,12 +18,12 @@ import {
|
|
|
18
18
|
runPipeline,
|
|
19
19
|
saveAuth,
|
|
20
20
|
versionOutputToChangelogInput
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-3X4XBORT.js";
|
|
22
22
|
import {
|
|
23
23
|
aggregateToRoot,
|
|
24
24
|
detectMonorepo,
|
|
25
25
|
writeMonorepoChangelogs
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-OEY4SBEM.js";
|
|
27
27
|
import {
|
|
28
28
|
debug,
|
|
29
29
|
formatVersion,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
renderMarkdown,
|
|
32
32
|
success,
|
|
33
33
|
writeMarkdown
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-LA3V665B.js";
|
|
35
35
|
|
|
36
36
|
// src/output/json.ts
|
|
37
37
|
import * as fs from "fs";
|
package/docs/configuration.md
CHANGED
|
@@ -233,7 +233,7 @@ How existing changelog files are updated when new entries are generated.
|
|
|
233
233
|
|
|
234
234
|
| Option | Type | Default | Description |
|
|
235
235
|
|--------|------|---------|-------------|
|
|
236
|
-
| `timeout` | `integer` (ms) | `60000` |
|
|
236
|
+
| `timeout` | `integer` (ms) | `60000` | Idle timeout: a streamed response fails only when nothing arrives for this long |
|
|
237
237
|
| `maxTokens` | `integer` | `16384` | Maximum tokens to generate |
|
|
238
238
|
| `temperature` | `number` | `0.7` | Sampling temperature (0–2) |
|
|
239
239
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@releasekit/notes",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0",
|
|
4
4
|
"description": "Release notes and changelog generation with LLM-powered enhancement and flexible templating",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -47,35 +47,35 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@anthropic-ai/sdk": "^0.
|
|
50
|
+
"@anthropic-ai/sdk": "^1.0.0",
|
|
51
51
|
"@octokit/rest": "^22.0.1",
|
|
52
|
-
"chalk": "^
|
|
53
|
-
"commander": "^
|
|
54
|
-
"ejs": "^
|
|
55
|
-
"handlebars": "^4.7.
|
|
52
|
+
"chalk": "^6.0.1",
|
|
53
|
+
"commander": "^15.0.0",
|
|
54
|
+
"ejs": "^7.0.2",
|
|
55
|
+
"handlebars": "^4.7.10",
|
|
56
56
|
"jsonc-parser": "^3.3.1",
|
|
57
|
-
"liquidjs": "^10.
|
|
58
|
-
"minimatch": "^10.
|
|
59
|
-
"openai": "^
|
|
60
|
-
"smol-toml": "^1.
|
|
61
|
-
"yaml": "^2.9.
|
|
62
|
-
"zod": "^4.
|
|
57
|
+
"liquidjs": "^10.30.0",
|
|
58
|
+
"minimatch": "^10.2.6",
|
|
59
|
+
"openai": "^7.41.0",
|
|
60
|
+
"smol-toml": "^1.9.0",
|
|
61
|
+
"yaml": "^2.9.1",
|
|
62
|
+
"zod": "^4.6.7"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@biomejs/biome": "^2.
|
|
66
|
-
"@types/ejs": "^3.1.5",
|
|
67
|
-
"@types/node": "^22.20.1",
|
|
68
|
-
"@vitest/coverage-v8": "^4.1.10",
|
|
69
|
-
"tsup": "^8.5.1",
|
|
70
|
-
"typescript": "^5.9.3",
|
|
71
|
-
"vitest": "^4.1.10",
|
|
65
|
+
"@biomejs/biome": "^2.6.2",
|
|
72
66
|
"@releasekit/config": "0.0.0",
|
|
73
|
-
"@releasekit/forge": "0.0.0",
|
|
74
67
|
"@releasekit/core": "0.0.0",
|
|
75
|
-
"@releasekit/
|
|
68
|
+
"@releasekit/forge": "0.0.0",
|
|
69
|
+
"@releasekit/git": "0.0.0",
|
|
70
|
+
"@types/ejs": "^3.1.5",
|
|
71
|
+
"@types/node": "^26.6.5",
|
|
72
|
+
"@vitest/coverage-v8": "^5.0.5",
|
|
73
|
+
"tsup": "^9.0.0",
|
|
74
|
+
"typescript": "^6.0.3",
|
|
75
|
+
"vitest": "^5.0.5"
|
|
76
76
|
},
|
|
77
77
|
"engines": {
|
|
78
|
-
"node": ">=22"
|
|
78
|
+
"node": ">=22.12"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"build": "tsup",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
- {{#if scope}}**{{scope}}**: {{/if}}{{description}}{{#if issueIds}} ({{join issueIds ", "}}){{/if}}
|
|
1
|
+
- {{#if breaking}}**BREAKING** {{/if}}{{#if scope}}**{{scope}}**: {{/if}}{{description}}{{#if issueIds}} ({{join issueIds ", "}}){{/if}}
|
|
2
2
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<% } else { %>
|
|
9
9
|
<% if (version.entries.length > 0) { %>
|
|
10
10
|
<% version.entries.forEach(function(entry) { %>
|
|
11
|
-
- <% if (entry.scope) { %>**<%= entry.scope %>**: <% } %><%= entry.description %><% if (entry.issueIds) { %> (<%= entry.issueIds.join(', ') %>)<% } %>
|
|
11
|
+
- <% if (entry.breaking) { %>**BREAKING** <% } %><% if (entry.scope) { %>**<%= entry.scope %>**: <% } %><%= entry.description %><% if (entry.issueIds) { %> (<%= entry.issueIds.join(', ') %>)<% } %>
|
|
12
12
|
|
|
13
13
|
<% }); %>
|
|
14
14
|
<% } %>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
- {% if entry.scope %}**{{ entry.scope }}**: {% endif %}{{ entry.description }}{% if entry.issueIds %} ({{ entry.issueIds | join: ", " }}){% endif %}
|
|
1
|
+
- {% if entry.breaking %}**BREAKING** {% endif %}{% if entry.scope %}**{{ entry.scope }}**: {% endif %}{{ entry.description }}{% if entry.issueIds %} ({{ entry.issueIds | join: ", " }}){% endif %}
|
|
2
2
|
|