@releasekit/notes 0.42.1 → 0.43.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -85,6 +85,71 @@ function removeDescriptionRefs(text, refs) {
85
85
  return num !== void 0 && remove.has(Number(num)) ? "" : match;
86
86
  }).trim();
87
87
  }
88
+ var BREAKING_SECTION = "Breaking";
89
+ var DEMOTED_SECTION = "Dependencies & version bumps";
90
+ var CHANGELOG_TYPE_LABELS = {
91
+ feat: "Added",
92
+ fix: "Fixed",
93
+ added: "Added",
94
+ changed: "Changed",
95
+ deprecated: "Deprecated",
96
+ removed: "Removed",
97
+ fixed: "Fixed",
98
+ perf: "Performance",
99
+ refactor: "Refactored",
100
+ security: "Security",
101
+ docs: "Documentation",
102
+ chore: "Chores",
103
+ test: "Tests",
104
+ build: "Build",
105
+ ci: "CI",
106
+ revert: "Reverts",
107
+ style: "Styles"
108
+ };
109
+ var CHANGELOG_LABEL_ORDER = [...new Set(Object.values(CHANGELOG_TYPE_LABELS))];
110
+ function changelogTypeLabel(type) {
111
+ return Object.hasOwn(CHANGELOG_TYPE_LABELS, type) ? CHANGELOG_TYPE_LABELS[type] : type.charAt(0).toUpperCase() + type.slice(1);
112
+ }
113
+ function groupChangelogSections(items, entryOf, { labelOrder = CHANGELOG_LABEL_ORDER, demoteScopes = [] } = {}) {
114
+ const demote = new Set(demoteScopes);
115
+ const breaking = [];
116
+ const demoted = [];
117
+ const byLabel = /* @__PURE__ */ new Map();
118
+ for (const item of items) {
119
+ const entry = entryOf(item);
120
+ if (entry.breaking) {
121
+ breaking.push(item);
122
+ } else if (entry.scope !== void 0 && demote.has(entry.scope)) {
123
+ demoted.push(item);
124
+ } else {
125
+ const label = changelogTypeLabel(entry.type);
126
+ const list = byLabel.get(label);
127
+ if (list) {
128
+ list.push(item);
129
+ } else {
130
+ byLabel.set(label, [item]);
131
+ }
132
+ }
133
+ }
134
+ const sections = [];
135
+ if (breaking.length > 0) {
136
+ sections.push({ label: BREAKING_SECTION, items: breaking });
137
+ }
138
+ for (const label of labelOrder) {
139
+ const list = byLabel.get(label);
140
+ if (list) {
141
+ sections.push({ label, items: list });
142
+ byLabel.delete(label);
143
+ }
144
+ }
145
+ for (const [label, list] of byLabel) {
146
+ sections.push({ label, items: list });
147
+ }
148
+ if (demoted.length > 0) {
149
+ sections.push({ label: DEMOTED_SECTION, items: demoted });
150
+ }
151
+ return sections;
152
+ }
88
153
  var LOG_LEVELS = {
89
154
  error: 0,
90
155
  warn: 1,
@@ -303,27 +368,7 @@ function firstReleaseLine(context, config) {
303
368
  const template = config?.text ?? DEFAULT_FIRST_RELEASE_TEXT;
304
369
  return template.replaceAll("${packageName}", context.packageName).replaceAll("${version}", context.version);
305
370
  }
306
- var TYPE_ORDER = ["added", "changed", "deprecated", "removed", "fixed", "security"];
307
- var TYPE_LABELS = {
308
- added: "Added",
309
- changed: "Changed",
310
- deprecated: "Deprecated",
311
- removed: "Removed",
312
- fixed: "Fixed",
313
- security: "Security"
314
- };
315
- function groupEntriesByType(entries) {
316
- const grouped = /* @__PURE__ */ new Map();
317
- for (const type of TYPE_ORDER) {
318
- grouped.set(type, []);
319
- }
320
- for (const entry of entries) {
321
- const existing = grouped.get(entry.type) ?? [];
322
- existing.push(entry);
323
- grouped.set(entry.type, existing);
324
- }
325
- return grouped;
326
- }
371
+ var SECTION_ORDER = ["Added", "Changed", "Deprecated", "Removed", "Fixed", "Security"];
327
372
  function formatEntry(entry, opts) {
328
373
  const refsMode = opts?.refs ?? "link";
329
374
  const appendedRefs = [...entry.issueIds ?? [], entry.prNumber];
@@ -414,11 +459,11 @@ function rerouteBreakingEntries(categories) {
414
459
  return true;
415
460
  })
416
461
  }));
417
- const breakingCatIdx = stripped.findIndex((c) => c.name === "Breaking");
462
+ const breakingCatIdx = stripped.findIndex((c) => c.name === BREAKING_SECTION);
418
463
  if (breakingCatIdx >= 0) {
419
464
  return stripped.map((c, i) => i === breakingCatIdx ? { ...c, entries: [...breakingEntries, ...c.entries] } : c);
420
465
  }
421
- return [{ name: "Breaking", entries: breakingEntries }, ...stripped.filter((c) => c.entries.length > 0)];
466
+ return [{ name: BREAKING_SECTION, entries: breakingEntries }, ...stripped.filter((c) => c.entries.length > 0)];
422
467
  }
423
468
  function applyOrder(categories, order) {
424
469
  if (order.length === 0) {
@@ -427,7 +472,7 @@ function applyOrder(categories, order) {
427
472
  return [...categories].sort((a, b) => {
428
473
  const ai = order.indexOf(a.name);
429
474
  const bi = order.indexOf(b.name);
430
- const rank = (name, idx) => idx === -1 ? name === "Breaking" ? -1 : order.length : idx;
475
+ const rank = (name, idx) => idx === -1 ? name === BREAKING_SECTION ? -1 : order.length : idx;
431
476
  return rank(a.name, ai) - rank(b.name, bi);
432
477
  });
433
478
  }
@@ -542,13 +587,9 @@ function formatVersion(context, options) {
542
587
  lines.push("");
543
588
  }
544
589
  } else {
545
- const grouped = groupEntriesByType(context.entries);
546
- for (const [type, entries] of grouped) {
547
- if (entries.length === 0) {
548
- continue;
549
- }
550
- lines.push(`### ${TYPE_LABELS[type]}`);
551
- for (const entry of entries) {
590
+ for (const section of groupChangelogSections(context.entries, (e) => e, { labelOrder: SECTION_ORDER })) {
591
+ lines.push(`### ${section.label}`);
592
+ for (const entry of section.items) {
552
593
  lines.push(formatEntry(entry, refOpts));
553
594
  }
554
595
  lines.push("");
package/dist/cli.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createNotesCommand
4
- } from "./chunk-OTH3XXI4.js";
4
+ } from "./chunk-T54LUVMQ.js";
5
5
  import {
6
6
  readPackageVersion
7
- } from "./chunk-CBMVDKDR.js";
7
+ } from "./chunk-YIHEHXCU.js";
8
8
 
9
9
  // src/cli.ts
10
10
  import * as fs from "fs";
package/dist/index.d.ts CHANGED
@@ -84,6 +84,8 @@ interface VersionPackageUpdate {
84
84
  */
85
85
  previousVersion?: string;
86
86
  filePath: string;
87
+ /** Every manifest bumped in this directory, `filePath` included. Absent in older manifests. */
88
+ files?: string[];
87
89
  /** Absent when all packages share one tag. */
88
90
  tag?: string;
89
91
  /**
@@ -337,6 +339,10 @@ declare class InputParseError extends NotesError {
337
339
  readonly code = "INPUT_PARSE_ERROR";
338
340
  readonly suggestions: string[];
339
341
  }
342
+ declare class InputValidationError extends NotesError {
343
+ readonly code = "INPUT_VALIDATION_ERROR";
344
+ readonly suggestions: string[];
345
+ }
340
346
  declare class TemplateError extends NotesError {
341
347
  readonly code = "TEMPLATE_ERROR";
342
348
  readonly suggestions: string[];
@@ -361,7 +367,7 @@ declare class ConfigError extends NotesError {
361
367
  }
362
368
  declare function getExitCode(error: NotesError): number;
363
369
 
364
- declare function versionOutputToChangelogInput(data: VersionOutput): ChangelogInput;
370
+ declare function versionOutputToChangelogInput(data: Pick<VersionOutput, 'changelogs'>): ChangelogInput;
365
371
  declare function parseVersionOutput(json: string): ChangelogInput;
366
372
  declare function parseVersionOutputFile(filePath: string): ChangelogInput;
367
373
  declare function parseVersionOutputStdin(): Promise<ChangelogInput>;
@@ -396,5 +402,5 @@ declare function formatVersion(context: TemplateContext, options?: FormatVersion
396
402
  declare function renderMarkdown(contexts: TemplateContext[], options?: FormatVersionOptions): string;
397
403
  declare function writeMarkdown(outputPath: string, contexts: TemplateContext[], config: Config, dryRun: boolean, options?: FormatVersionOptions): void;
398
404
 
399
- 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 };
405
+ export { ConfigError, GitHubError, InputParseError, InputValidationError, LLMError, NotesError, TemplateError, aggregateToRoot, createTemplateContext, detectMonorepo, formatVersion, getDefaultConfig, getExitCode, loadAuth, loadConfig, parseVersionOutput, parseVersionOutputFile, parseVersionOutputStdin, processInput, renderJson, renderMarkdown, runPipeline, saveAuth, versionOutputToChangelogInput, writeJson, writeMarkdown, writeMonorepoChangelogs };
400
406
  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
@@ -2,6 +2,7 @@ import {
2
2
  ConfigError,
3
3
  GitHubError,
4
4
  InputParseError,
5
+ InputValidationError,
5
6
  LLMError,
6
7
  NotesError,
7
8
  TemplateError,
@@ -18,12 +19,12 @@ import {
18
19
  runPipeline,
19
20
  saveAuth,
20
21
  versionOutputToChangelogInput
21
- } from "./chunk-OTH3XXI4.js";
22
+ } from "./chunk-T54LUVMQ.js";
22
23
  import {
23
24
  aggregateToRoot,
24
25
  detectMonorepo,
25
26
  writeMonorepoChangelogs
26
- } from "./chunk-KQQPQQSS.js";
27
+ } from "./chunk-6HUNK367.js";
27
28
  import {
28
29
  debug,
29
30
  formatVersion,
@@ -31,7 +32,7 @@ import {
31
32
  renderMarkdown,
32
33
  success,
33
34
  writeMarkdown
34
- } from "./chunk-CBMVDKDR.js";
35
+ } from "./chunk-YIHEHXCU.js";
35
36
 
36
37
  // src/output/json.ts
37
38
  import * as fs from "fs";
@@ -72,6 +73,7 @@ export {
72
73
  ConfigError,
73
74
  GitHubError,
74
75
  InputParseError,
76
+ InputValidationError,
75
77
  LLMError,
76
78
  NotesError,
77
79
  TemplateError,
@@ -202,7 +202,7 @@ You do not need `mode` or `file` configured for this task — the generated text
202
202
 
203
203
  ### Links section
204
204
 
205
- When LLM categorisation is active, you can configure the built-in renderer to append a links section (migration guides, changelogs, etc.) to each release. This is configured on `notes.releaseNotes.links`, not inside `llm`. See [notes.releaseNotes.links](./configuration.md#notesreleasenoteslinks) in the configuration reference.
205
+ When LLM categorisation is active, you can configure the built-in renderer to append a links section (migration guides, changelogs, etc.) to each release. It's configured on [`notes.releaseNotes.links`](../../../docs/configuration.md#notesreleasenoteslinks), not inside `llm`.
206
206
 
207
207
  ---
208
208
 
@@ -255,26 +255,12 @@ If you need fully custom output formatting, use the [templates system](./templat
255
255
 
256
256
  ## CLI Flags
257
257
 
258
- LLM options can also be set via CLI flags without a config file:
258
+ The `--llm-*` flags set LLM options without a config file. Every flag is in the [CLI reference](../../../docs/cli.md#releasekit-notes-generate).
259
259
 
260
260
  ```bash
261
261
  releasekit-notes \
262
+ --input version-output.json \
262
263
  --llm-provider anthropic \
263
264
  --llm-model claude-haiku-4-5 \
264
- --llm-tasks enhance,release-notes \
265
- --input version-output.json
266
- ```
267
-
268
- > **Task name format:** CLI flags use kebab-case (`release-notes`), while the config file uses camelCase (`releaseNotes`). The mapping is: `enhance` → `enhance`, `categorize` → `categorize`, `summarize` → `summarize`, `releaseNotes` → `release-notes`.
269
-
270
- Use `--no-llm` to disable LLM processing even when it is configured:
271
-
272
- ```bash
273
- releasekit-notes --no-llm
274
- ```
275
-
276
- Use `--no-release-notes` to disable release notes entirely (including LLM):
277
-
278
- ```bash
279
- releasekit-notes --no-release-notes
265
+ --llm-tasks enhance,release-notes
280
266
  ```
package/docs/monorepo.md CHANGED
@@ -73,27 +73,12 @@ Custom file name applies to all packages:
73
73
 
74
74
  ## CLI Flags
75
75
 
76
- Use `--changelog-mode` to override the changelog location, and `--release-notes-dir` to write per-version release-notes files:
76
+ `--changelog-mode` overrides the configured changelog location. Every flag is in the [CLI reference](../../../docs/cli.md#releasekit-notes-generate).
77
77
 
78
78
  ```bash
79
- # Root changelog only
80
- releasekit-notes --changelog-mode root
81
-
82
- # Per-package changelogs
83
79
  releasekit-notes --changelog-mode packages
84
-
85
- # Both
86
- releasekit-notes --changelog-mode both
87
-
88
- # Use --monorepo as a shorthand for the changelog mode
89
- releasekit-notes --monorepo packages
90
-
91
- # Per-version release-notes files
92
- releasekit-notes --release-notes-dir release-notes
93
80
  ```
94
81
 
95
- `--monorepo` sets the changelog mode (release notes use a per-version directory, not modes). An explicit `--changelog-mode` takes priority over `--monorepo` when both are present.
96
-
97
82
  ---
98
83
 
99
84
  ## Monorepo Path Configuration
package/docs/templates.md CHANGED
@@ -138,7 +138,7 @@ When no custom template is configured, the built-in markdown renderer applies th
138
138
 
139
139
  **Scope grouping:** Within a category, entries sharing the same scope value (two or more) are rendered under a `**scope**:` group header. Entries with a unique scope render with the scope inline (`**scope**: description`). Entries with no scope render as plain bullets.
140
140
 
141
- **Breaking change re-routing:** Any entry with `breaking: true` is moved to a `Breaking` category at render time, regardless of which category the LLM assigned it to. If no `Breaking` category exists, one is created and prepended before all other categories.
141
+ **Breaking change re-routing:** Any entry with `breaking: true` is moved to a `Breaking` category at render time, regardless of which category the LLM assigned it to. If no `Breaking` category exists, one is created and prepended before all other categories. Output without LLM categories gets the same leading `Breaking` section.
142
142
 
143
143
  **`leadIn` prefix:** Entries with a `leadIn` value render as `**leadIn**: description`. Combined with `breaking: true`, the format is `**BREAKING** **leadIn**: description`.
144
144
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@releasekit/notes",
3
- "version": "0.42.1",
3
+ "version": "0.43.1",
4
4
  "description": "Release notes and changelog generation with LLM-powered enhancement and flexible templating",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -47,32 +47,32 @@
47
47
  "access": "public"
48
48
  },
49
49
  "dependencies": {
50
- "@anthropic-ai/sdk": "^1.0.0",
50
+ "@anthropic-ai/sdk": "^1.6.0",
51
51
  "@octokit/rest": "^22.0.1",
52
52
  "chalk": "^6.0.1",
53
- "commander": "^15.0.0",
53
+ "commander": "^15.1.0",
54
54
  "ejs": "^7.0.2",
55
55
  "handlebars": "^4.7.10",
56
56
  "jsonc-parser": "^3.3.1",
57
- "liquidjs": "^10.30.0",
58
- "minimatch": "^10.2.6",
59
- "openai": "^7.41.0",
57
+ "liquidjs": "^10.30.1",
58
+ "minimatch": "^11.0.5",
59
+ "openai": "^7.53.0",
60
60
  "smol-toml": "^1.9.0",
61
61
  "yaml": "^2.9.1",
62
62
  "zod": "^4.6.7"
63
63
  },
64
64
  "devDependencies": {
65
- "@biomejs/biome": "^2.6.2",
65
+ "@biomejs/biome": "^2.6.6",
66
66
  "@releasekit/config": "0.0.0",
67
67
  "@releasekit/core": "0.0.0",
68
68
  "@releasekit/forge": "0.0.0",
69
69
  "@releasekit/git": "0.0.0",
70
70
  "@types/ejs": "^3.1.5",
71
- "@types/node": "^26.6.5",
72
- "@vitest/coverage-v8": "^5.0.5",
71
+ "@types/node": "^26.6.6",
72
+ "@vitest/coverage-v8": "^5.1.0",
73
73
  "tsup": "^9.0.0",
74
74
  "typescript": "^6.0.3",
75
- "vitest": "^5.0.5"
75
+ "vitest": "^5.1.0"
76
76
  },
77
77
  "engines": {
78
78
  "node": ">=22.12"
@@ -4,5 +4,12 @@
4
4
  {{/if}}
5
5
 
6
6
  {{#each entries}}
7
+ {{#if breaking}}
7
8
  {{> entry}}
9
+ {{/if}}
10
+ {{/each}}
11
+ {{#each entries}}
12
+ {{#unless breaking}}
13
+ {{> entry}}
14
+ {{/unless}}
8
15
  {{/each}}
@@ -7,7 +7,7 @@
7
7
  <%= version.enhanced.releaseNotes %>
8
8
  <% } else { %>
9
9
  <% if (version.entries.length > 0) { %>
10
- <% version.entries.forEach(function(entry) { %>
10
+ <% [...version.entries.filter((e) => e.breaking), ...version.entries.filter((e) => !e.breaking)].forEach(function(entry) { %>
11
11
  - <% if (entry.breaking) { %>**BREAKING** <% } %><% if (entry.scope) { %>**<%= entry.scope %>**: <% } %><%= entry.description %><% if (entry.issueIds) { %> (<%= entry.issueIds.join(', ') %>)<% } %>
12
12
 
13
13
  <% }); %>
@@ -3,52 +3,54 @@
3
3
  [Full Changelog]({{ version.compareUrl }})
4
4
  {% endif %}
5
5
 
6
- {% assign added = version.entries | where: "type", "added" %}
7
- {% assign changed = version.entries | where: "type", "changed" %}
8
- {% assign deprecated = version.entries | where: "type", "deprecated" %}
9
- {% assign removed = version.entries | where: "type", "removed" %}
10
- {% assign fixed = version.entries | where: "type", "fixed" %}
11
- {% assign security = version.entries | where: "type", "security" %}
12
-
6
+ {% assign breaking = version.entries | where: "breaking" %}
7
+ {% assign nonBreaking = version.entries | reject: "breaking" %}
8
+ {% assign added = nonBreaking | where: "type", "added" %}
9
+ {% assign changed = nonBreaking | where: "type", "changed" %}
10
+ {% assign deprecated = nonBreaking | where: "type", "deprecated" %}
11
+ {% assign removed = nonBreaking | where: "type", "removed" %}
12
+ {% assign fixed = nonBreaking | where: "type", "fixed" %}
13
+ {% assign security = nonBreaking | where: "type", "security" %}
14
+
15
+ {% if breaking.size > 0 %}
16
+ ### Breaking
17
+ {% for entry in breaking %}
18
+ {% include "entry" %}
19
+ {% endfor %}
20
+ {% endif %}
13
21
  {% if added.size > 0 %}
14
22
  ### Added
15
23
  {% for entry in added %}
16
- - {% if entry.breaking %}**BREAKING** {% endif %}{% if entry.scope %}**{{ entry.scope }}**: {% endif %}{{ entry.description }}{% if entry.issueIds %} ({{ entry.issueIds | join: ", " }}){% endif %}
17
-
24
+ {% include "entry" %}
18
25
  {% endfor %}
19
26
  {% endif %}
20
27
  {% if changed.size > 0 %}
21
28
  ### Changed
22
29
  {% for entry in changed %}
23
- - {% if entry.breaking %}**BREAKING** {% endif %}{% if entry.scope %}**{{ entry.scope }}**: {% endif %}{{ entry.description }}{% if entry.issueIds %} ({{ entry.issueIds | join: ", " }}){% endif %}
24
-
30
+ {% include "entry" %}
25
31
  {% endfor %}
26
32
  {% endif %}
27
33
  {% if deprecated.size > 0 %}
28
34
  ### Deprecated
29
35
  {% for entry in deprecated %}
30
- - {% if entry.breaking %}**BREAKING** {% endif %}{% if entry.scope %}**{{ entry.scope }}**: {% endif %}{{ entry.description }}{% if entry.issueIds %} ({{ entry.issueIds | join: ", " }}){% endif %}
31
-
36
+ {% include "entry" %}
32
37
  {% endfor %}
33
38
  {% endif %}
34
39
  {% if removed.size > 0 %}
35
40
  ### Removed
36
41
  {% for entry in removed %}
37
- - {% if entry.breaking %}**BREAKING** {% endif %}{% if entry.scope %}**{{ entry.scope }}**: {% endif %}{{ entry.description }}{% if entry.issueIds %} ({{ entry.issueIds | join: ", " }}){% endif %}
38
-
42
+ {% include "entry" %}
39
43
  {% endfor %}
40
44
  {% endif %}
41
45
  {% if fixed.size > 0 %}
42
46
  ### Fixed
43
47
  {% for entry in fixed %}
44
- - {% if entry.breaking %}**BREAKING** {% endif %}{% if entry.scope %}**{{ entry.scope }}**: {% endif %}{{ entry.description }}{% if entry.issueIds %} ({{ entry.issueIds | join: ", " }}){% endif %}
45
-
48
+ {% include "entry" %}
46
49
  {% endfor %}
47
50
  {% endif %}
48
51
  {% if security.size > 0 %}
49
52
  ### Security
50
53
  {% for entry in security %}
51
- - {% if entry.breaking %}**BREAKING** {% endif %}{% if entry.scope %}**{{ entry.scope }}**: {% endif %}{{ entry.description }}{% if entry.issueIds %} ({{ entry.issueIds | join: ", " }}){% endif %}
52
-
54
+ {% include "entry" %}
53
55
  {% endfor %}
54
56
  {% endif %}