@releasekit/notes 0.3.0-next.0 → 0.3.0-next.2

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.
@@ -3,8 +3,8 @@ import {
3
3
  detectMonorepo,
4
4
  splitByPackage,
5
5
  writeMonorepoChangelogs
6
- } from "./chunk-O4VCGEZT.js";
7
- import "./chunk-H7G2HRHI.js";
6
+ } from "./chunk-TSLTZ26C.js";
7
+ import "./chunk-QCF6V2IY.js";
8
8
  export {
9
9
  aggregateToRoot,
10
10
  detectMonorepo,
@@ -39,9 +39,10 @@ function formatEntry(entry) {
39
39
  }
40
40
  return line;
41
41
  }
42
- function formatVersion(context) {
42
+ function formatVersion(context, options) {
43
43
  const lines = [];
44
- const versionHeader = context.previousVersion ? `## [${context.version}]` : `## ${context.version}`;
44
+ const versionLabel = options?.includePackageName && context.packageName ? `${context.packageName}@${context.version}` : context.version;
45
+ const versionHeader = context.previousVersion ? `## [${versionLabel}]` : `## ${versionLabel}`;
45
46
  lines.push(`${versionHeader} - ${context.date}`);
46
47
  lines.push("");
47
48
  if (context.compareUrl) {
@@ -73,14 +74,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
73
74
 
74
75
  `;
75
76
  }
76
- function renderMarkdown(contexts) {
77
+ function renderMarkdown(contexts, options) {
77
78
  const sections = [formatHeader()];
78
79
  for (const context of contexts) {
79
- sections.push(formatVersion(context));
80
+ sections.push(formatVersion(context, options));
80
81
  }
81
82
  return sections.join("\n");
82
83
  }
83
- function prependVersion(existingPath, context) {
84
+ function prependVersion(existingPath, context, options) {
84
85
  let existing = "";
85
86
  if (fs.existsSync(existingPath)) {
86
87
  existing = fs.readFileSync(existingPath, "utf-8");
@@ -88,7 +89,7 @@ function prependVersion(existingPath, context) {
88
89
  if (headerEnd >= 0) {
89
90
  const header = existing.slice(0, headerEnd);
90
91
  const body = existing.slice(headerEnd + 1);
91
- const newVersion = formatVersion(context);
92
+ const newVersion = formatVersion(context, options);
92
93
  return `${header}
93
94
 
94
95
  ${newVersion}
@@ -2,7 +2,7 @@ import {
2
2
  formatVersion,
3
3
  renderMarkdown,
4
4
  writeMarkdown
5
- } from "./chunk-H7G2HRHI.js";
5
+ } from "./chunk-QCF6V2IY.js";
6
6
 
7
7
  // src/core/config.ts
8
8
  import {
@@ -289,7 +289,7 @@ var OllamaProvider = class extends BaseLLMProvider {
289
289
  "Content-Type": "application/json"
290
290
  };
291
291
  if (this.apiKey) {
292
- headers["Authorization"] = `Bearer ${this.apiKey}`;
292
+ headers.Authorization = `Bearer ${this.apiKey}`;
293
293
  }
294
294
  const baseUrl = this.baseURL.endsWith("/api") ? this.baseURL.slice(0, -4) : this.baseURL;
295
295
  const response = await fetch(`${baseUrl}/api/chat`, {
@@ -450,7 +450,6 @@ function validateScope(scope, allowedScopes, rules) {
450
450
  return scope;
451
451
  case "fallback":
452
452
  return rules?.fallbackScope;
453
- case "remove":
454
453
  default:
455
454
  return void 0;
456
455
  }
@@ -1377,7 +1376,8 @@ async function runPipeline(input, config, dryRun) {
1377
1376
  }
1378
1377
  const files = [];
1379
1378
  for (const output of config.output) {
1380
- info3(`Generating ${output.format} output`);
1379
+ const outputLabel = output.file ? `${output.format} output \u2192 ${output.file}` : `${output.format} output`;
1380
+ info3(`Generating ${outputLabel}`);
1381
1381
  switch (output.format) {
1382
1382
  case "markdown": {
1383
1383
  const file = output.file ?? "CHANGELOG.md";
@@ -1436,7 +1436,7 @@ async function runPipeline(input, config, dryRun) {
1436
1436
  }
1437
1437
  }
1438
1438
  if (config.monorepo?.mode) {
1439
- const { detectMonorepo, writeMonorepoChangelogs } = await import("./aggregator-BDTUZWOA.js");
1439
+ const { detectMonorepo, writeMonorepoChangelogs } = await import("./aggregator-JZ3VUZKP.js");
1440
1440
  const cwd = process.cwd();
1441
1441
  const detected = detectMonorepo(cwd);
1442
1442
  if (detected.isMonorepo) {
@@ -1,7 +1,8 @@
1
1
  import {
2
+ formatVersion,
2
3
  prependVersion,
3
4
  renderMarkdown
4
- } from "./chunk-H7G2HRHI.js";
5
+ } from "./chunk-QCF6V2IY.js";
5
6
 
6
7
  // src/monorepo/aggregator.ts
7
8
  import * as fs from "fs";
@@ -54,10 +55,25 @@ function aggregateToRoot(contexts) {
54
55
  function writeMonorepoChangelogs(contexts, options, config, dryRun) {
55
56
  const files = [];
56
57
  if (options.mode === "root" || options.mode === "both") {
57
- const aggregated = aggregateToRoot(contexts);
58
58
  const rootPath = path.join(options.rootPath, "CHANGELOG.md");
59
+ const fmtOpts = { includePackageName: true };
59
60
  info(`Writing root changelog to ${rootPath}`);
60
- const rootContent = config.updateStrategy === "prepend" && fs.existsSync(rootPath) ? prependVersion(rootPath, aggregated) : renderMarkdown([aggregated]);
61
+ let rootContent;
62
+ if (config.updateStrategy === "prepend" && fs.existsSync(rootPath)) {
63
+ const newSections = contexts.map((ctx) => formatVersion(ctx, fmtOpts)).join("\n");
64
+ const existing = fs.readFileSync(rootPath, "utf-8");
65
+ const headerEnd = existing.indexOf("\n## ");
66
+ if (headerEnd >= 0) {
67
+ rootContent = `${existing.slice(0, headerEnd)}
68
+
69
+ ${newSections}
70
+ ${existing.slice(headerEnd + 1)}`;
71
+ } else {
72
+ rootContent = renderMarkdown(contexts, fmtOpts);
73
+ }
74
+ } else {
75
+ rootContent = renderMarkdown(contexts, fmtOpts);
76
+ }
61
77
  if (writeFile(rootPath, rootContent, dryRun)) {
62
78
  files.push(rootPath);
63
79
  }
package/dist/cli.cjs CHANGED
@@ -59,9 +59,10 @@ function formatEntry(entry) {
59
59
  }
60
60
  return line;
61
61
  }
62
- function formatVersion(context) {
62
+ function formatVersion(context, options) {
63
63
  const lines = [];
64
- const versionHeader = context.previousVersion ? `## [${context.version}]` : `## ${context.version}`;
64
+ const versionLabel = options?.includePackageName && context.packageName ? `${context.packageName}@${context.version}` : context.version;
65
+ const versionHeader = context.previousVersion ? `## [${versionLabel}]` : `## ${versionLabel}`;
65
66
  lines.push(`${versionHeader} - ${context.date}`);
66
67
  lines.push("");
67
68
  if (context.compareUrl) {
@@ -93,14 +94,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
93
94
 
94
95
  `;
95
96
  }
96
- function renderMarkdown(contexts) {
97
+ function renderMarkdown(contexts, options) {
97
98
  const sections = [formatHeader()];
98
99
  for (const context of contexts) {
99
- sections.push(formatVersion(context));
100
+ sections.push(formatVersion(context, options));
100
101
  }
101
102
  return sections.join("\n");
102
103
  }
103
- function prependVersion(existingPath, context) {
104
+ function prependVersion(existingPath, context, options) {
104
105
  let existing = "";
105
106
  if (fs2.existsSync(existingPath)) {
106
107
  existing = fs2.readFileSync(existingPath, "utf-8");
@@ -108,7 +109,7 @@ function prependVersion(existingPath, context) {
108
109
  if (headerEnd >= 0) {
109
110
  const header = existing.slice(0, headerEnd);
110
111
  const body = existing.slice(headerEnd + 1);
111
- const newVersion = formatVersion(context);
112
+ const newVersion = formatVersion(context, options);
112
113
  return `${header}
113
114
 
114
115
  ${newVersion}
@@ -222,10 +223,25 @@ function aggregateToRoot(contexts) {
222
223
  function writeMonorepoChangelogs(contexts, options, config, dryRun) {
223
224
  const files = [];
224
225
  if (options.mode === "root" || options.mode === "both") {
225
- const aggregated = aggregateToRoot(contexts);
226
226
  const rootPath = path6.join(options.rootPath, "CHANGELOG.md");
227
+ const fmtOpts = { includePackageName: true };
227
228
  (0, import_core8.info)(`Writing root changelog to ${rootPath}`);
228
- const rootContent = config.updateStrategy === "prepend" && fs8.existsSync(rootPath) ? prependVersion(rootPath, aggregated) : renderMarkdown([aggregated]);
229
+ let rootContent;
230
+ if (config.updateStrategy === "prepend" && fs8.existsSync(rootPath)) {
231
+ const newSections = contexts.map((ctx) => formatVersion(ctx, fmtOpts)).join("\n");
232
+ const existing = fs8.readFileSync(rootPath, "utf-8");
233
+ const headerEnd = existing.indexOf("\n## ");
234
+ if (headerEnd >= 0) {
235
+ rootContent = `${existing.slice(0, headerEnd)}
236
+
237
+ ${newSections}
238
+ ${existing.slice(headerEnd + 1)}`;
239
+ } else {
240
+ rootContent = renderMarkdown(contexts, fmtOpts);
241
+ }
242
+ } else {
243
+ rootContent = renderMarkdown(contexts, fmtOpts);
244
+ }
229
245
  if (writeFile(rootPath, rootContent, dryRun)) {
230
246
  files.push(rootPath);
231
247
  }
@@ -551,7 +567,7 @@ var OllamaProvider = class extends BaseLLMProvider {
551
567
  "Content-Type": "application/json"
552
568
  };
553
569
  if (this.apiKey) {
554
- headers["Authorization"] = `Bearer ${this.apiKey}`;
570
+ headers.Authorization = `Bearer ${this.apiKey}`;
555
571
  }
556
572
  const baseUrl = this.baseURL.endsWith("/api") ? this.baseURL.slice(0, -4) : this.baseURL;
557
573
  const response = await fetch(`${baseUrl}/api/chat`, {
@@ -712,7 +728,6 @@ function validateScope(scope, allowedScopes, rules) {
712
728
  return scope;
713
729
  case "fallback":
714
730
  return rules?.fallbackScope;
715
- case "remove":
716
731
  default:
717
732
  return void 0;
718
733
  }
@@ -1681,7 +1696,8 @@ async function runPipeline(input, config, dryRun) {
1681
1696
  }
1682
1697
  const files = [];
1683
1698
  for (const output of config.output) {
1684
- (0, import_core9.info)(`Generating ${output.format} output`);
1699
+ const outputLabel = output.file ? `${output.format} output \u2192 ${output.file}` : `${output.format} output`;
1700
+ (0, import_core9.info)(`Generating ${outputLabel}`);
1685
1701
  switch (output.format) {
1686
1702
  case "markdown": {
1687
1703
  const file = output.file ?? "CHANGELOG.md";
package/dist/cli.js CHANGED
@@ -8,8 +8,8 @@ import {
8
8
  parsePackageVersioner,
9
9
  runPipeline,
10
10
  saveAuth
11
- } from "./chunk-X4LY5WGG.js";
12
- import "./chunk-H7G2HRHI.js";
11
+ } from "./chunk-QUBVC5LF.js";
12
+ import "./chunk-QCF6V2IY.js";
13
13
 
14
14
  // src/cli.ts
15
15
  import * as fs from "fs";
package/dist/index.cjs CHANGED
@@ -59,9 +59,10 @@ function formatEntry(entry) {
59
59
  }
60
60
  return line;
61
61
  }
62
- function formatVersion(context) {
62
+ function formatVersion(context, options) {
63
63
  const lines = [];
64
- const versionHeader = context.previousVersion ? `## [${context.version}]` : `## ${context.version}`;
64
+ const versionLabel = options?.includePackageName && context.packageName ? `${context.packageName}@${context.version}` : context.version;
65
+ const versionHeader = context.previousVersion ? `## [${versionLabel}]` : `## ${versionLabel}`;
65
66
  lines.push(`${versionHeader} - ${context.date}`);
66
67
  lines.push("");
67
68
  if (context.compareUrl) {
@@ -93,14 +94,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
93
94
 
94
95
  `;
95
96
  }
96
- function renderMarkdown(contexts) {
97
+ function renderMarkdown(contexts, options) {
97
98
  const sections = [formatHeader()];
98
99
  for (const context of contexts) {
99
- sections.push(formatVersion(context));
100
+ sections.push(formatVersion(context, options));
100
101
  }
101
102
  return sections.join("\n");
102
103
  }
103
- function prependVersion(existingPath, context) {
104
+ function prependVersion(existingPath, context, options) {
104
105
  let existing = "";
105
106
  if (fs2.existsSync(existingPath)) {
106
107
  existing = fs2.readFileSync(existingPath, "utf-8");
@@ -108,7 +109,7 @@ function prependVersion(existingPath, context) {
108
109
  if (headerEnd >= 0) {
109
110
  const header = existing.slice(0, headerEnd);
110
111
  const body = existing.slice(headerEnd + 1);
111
- const newVersion = formatVersion(context);
112
+ const newVersion = formatVersion(context, options);
112
113
  return `${header}
113
114
 
114
115
  ${newVersion}
@@ -222,10 +223,25 @@ function aggregateToRoot(contexts) {
222
223
  function writeMonorepoChangelogs(contexts, options, config, dryRun) {
223
224
  const files = [];
224
225
  if (options.mode === "root" || options.mode === "both") {
225
- const aggregated = aggregateToRoot(contexts);
226
226
  const rootPath = path6.join(options.rootPath, "CHANGELOG.md");
227
+ const fmtOpts = { includePackageName: true };
227
228
  (0, import_core8.info)(`Writing root changelog to ${rootPath}`);
228
- const rootContent = config.updateStrategy === "prepend" && fs8.existsSync(rootPath) ? prependVersion(rootPath, aggregated) : renderMarkdown([aggregated]);
229
+ let rootContent;
230
+ if (config.updateStrategy === "prepend" && fs8.existsSync(rootPath)) {
231
+ const newSections = contexts.map((ctx) => formatVersion(ctx, fmtOpts)).join("\n");
232
+ const existing = fs8.readFileSync(rootPath, "utf-8");
233
+ const headerEnd = existing.indexOf("\n## ");
234
+ if (headerEnd >= 0) {
235
+ rootContent = `${existing.slice(0, headerEnd)}
236
+
237
+ ${newSections}
238
+ ${existing.slice(headerEnd + 1)}`;
239
+ } else {
240
+ rootContent = renderMarkdown(contexts, fmtOpts);
241
+ }
242
+ } else {
243
+ rootContent = renderMarkdown(contexts, fmtOpts);
244
+ }
229
245
  if (writeFile(rootPath, rootContent, dryRun)) {
230
246
  files.push(rootPath);
231
247
  }
@@ -598,7 +614,7 @@ var OllamaProvider = class extends BaseLLMProvider {
598
614
  "Content-Type": "application/json"
599
615
  };
600
616
  if (this.apiKey) {
601
- headers["Authorization"] = `Bearer ${this.apiKey}`;
617
+ headers.Authorization = `Bearer ${this.apiKey}`;
602
618
  }
603
619
  const baseUrl = this.baseURL.endsWith("/api") ? this.baseURL.slice(0, -4) : this.baseURL;
604
620
  const response = await fetch(`${baseUrl}/api/chat`, {
@@ -759,7 +775,6 @@ function validateScope(scope, allowedScopes, rules) {
759
775
  return scope;
760
776
  case "fallback":
761
777
  return rules?.fallbackScope;
762
- case "remove":
763
778
  default:
764
779
  return void 0;
765
780
  }
@@ -1728,7 +1743,8 @@ async function runPipeline(input, config, dryRun) {
1728
1743
  }
1729
1744
  const files = [];
1730
1745
  for (const output of config.output) {
1731
- (0, import_core9.info)(`Generating ${output.format} output`);
1746
+ const outputLabel = output.file ? `${output.format} output \u2192 ${output.file}` : `${output.format} output`;
1747
+ (0, import_core9.info)(`Generating ${outputLabel}`);
1732
1748
  switch (output.format) {
1733
1749
  case "markdown": {
1734
1750
  const file = output.file ?? "CHANGELOG.md";
package/dist/index.d.cts CHANGED
@@ -208,8 +208,12 @@ declare function detectMonorepo(cwd: string): {
208
208
  declare function renderJson(contexts: TemplateContext[]): string;
209
209
  declare function writeJson(outputPath: string, contexts: TemplateContext[], dryRun: boolean): void;
210
210
 
211
- declare function formatVersion(context: TemplateContext): string;
212
- declare function renderMarkdown(contexts: TemplateContext[]): string;
211
+ interface FormatVersionOptions {
212
+ /** Include the package name in the version header (e.g. `## [pkg@1.0.0]`). */
213
+ includePackageName?: boolean;
214
+ }
215
+ declare function formatVersion(context: TemplateContext, options?: FormatVersionOptions): string;
216
+ declare function renderMarkdown(contexts: TemplateContext[], options?: FormatVersionOptions): string;
213
217
  declare function writeMarkdown(outputPath: string, contexts: TemplateContext[], config: Config, dryRun: boolean): void;
214
218
 
215
219
  export { NotesError as ChangelogCreatorError, type ChangelogEntry, type ChangelogInput, type ChangelogType, type CompleteOptions, type Config, ConfigError, type DocumentContext, type EnhancedData, GitHubError, InputParseError, type InputSource, type LLMCategory, type LLMConfig, LLMError, type LLMOptions, type LLMPromptOverrides, type LLMPromptsConfig, type MonorepoConfig, type MonorepoMode, NotesError, type OutputConfig, type OutputFormat, type PackageChangelog, type PipelineResult, type RetryOptions, type ScopeConfig, type ScopeRules, type TemplateConfig, type TemplateContext, type TemplateEngine, TemplateError, type UpdateStrategy, aggregateToRoot, createTemplateContext, detectMonorepo, formatVersion, getDefaultConfig, getExitCode, loadConfig, parsePackageVersioner, parsePackageVersionerFile, parsePackageVersionerStdin, processInput, renderJson, renderMarkdown, runPipeline, writeJson, writeMarkdown, writeMonorepoChangelogs };
package/dist/index.d.ts CHANGED
@@ -208,8 +208,12 @@ declare function detectMonorepo(cwd: string): {
208
208
  declare function renderJson(contexts: TemplateContext[]): string;
209
209
  declare function writeJson(outputPath: string, contexts: TemplateContext[], dryRun: boolean): void;
210
210
 
211
- declare function formatVersion(context: TemplateContext): string;
212
- declare function renderMarkdown(contexts: TemplateContext[]): string;
211
+ interface FormatVersionOptions {
212
+ /** Include the package name in the version header (e.g. `## [pkg@1.0.0]`). */
213
+ includePackageName?: boolean;
214
+ }
215
+ declare function formatVersion(context: TemplateContext, options?: FormatVersionOptions): string;
216
+ declare function renderMarkdown(contexts: TemplateContext[], options?: FormatVersionOptions): string;
213
217
  declare function writeMarkdown(outputPath: string, contexts: TemplateContext[], config: Config, dryRun: boolean): void;
214
218
 
215
219
  export { NotesError as ChangelogCreatorError, type ChangelogEntry, type ChangelogInput, type ChangelogType, type CompleteOptions, type Config, ConfigError, type DocumentContext, type EnhancedData, GitHubError, InputParseError, type InputSource, type LLMCategory, type LLMConfig, LLMError, type LLMOptions, type LLMPromptOverrides, type LLMPromptsConfig, type MonorepoConfig, type MonorepoMode, NotesError, type OutputConfig, type OutputFormat, type PackageChangelog, type PipelineResult, type RetryOptions, type ScopeConfig, type ScopeRules, type TemplateConfig, type TemplateContext, type TemplateEngine, TemplateError, type UpdateStrategy, aggregateToRoot, createTemplateContext, detectMonorepo, formatVersion, getDefaultConfig, getExitCode, loadConfig, parsePackageVersioner, parsePackageVersionerFile, parsePackageVersionerStdin, processInput, renderJson, renderMarkdown, runPipeline, writeJson, writeMarkdown, writeMonorepoChangelogs };
package/dist/index.js CHANGED
@@ -19,17 +19,17 @@ import {
19
19
  runPipeline,
20
20
  saveAuth,
21
21
  writeJson
22
- } from "./chunk-X4LY5WGG.js";
22
+ } from "./chunk-QUBVC5LF.js";
23
23
  import {
24
24
  aggregateToRoot,
25
25
  detectMonorepo,
26
26
  writeMonorepoChangelogs
27
- } from "./chunk-O4VCGEZT.js";
27
+ } from "./chunk-TSLTZ26C.js";
28
28
  import {
29
29
  formatVersion,
30
30
  renderMarkdown,
31
31
  writeMarkdown
32
- } from "./chunk-H7G2HRHI.js";
32
+ } from "./chunk-QCF6V2IY.js";
33
33
  export {
34
34
  NotesError as ChangelogCreatorError,
35
35
  ConfigError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@releasekit/notes",
3
- "version": "0.3.0-next.0",
3
+ "version": "0.3.0-next.2",
4
4
  "description": "Release notes and changelog generation with LLM-powered enhancement and flexible templating",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",