@releasekit/notes 0.28.0 → 0.29.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.
@@ -3,8 +3,8 @@ import {
3
3
  detectMonorepo,
4
4
  splitByPackage,
5
5
  writeMonorepoChangelogs
6
- } from "./chunk-L34QVI62.js";
7
- import "./chunk-QCJ545PJ.js";
6
+ } from "./chunk-ECD44YFA.js";
7
+ import "./chunk-E6757S4V.js";
8
8
  export {
9
9
  aggregateToRoot,
10
10
  detectMonorepo,
@@ -108,6 +108,12 @@ var EXIT_CODES = {
108
108
  // src/output/markdown.ts
109
109
  import * as fs2 from "fs";
110
110
  import * as path2 from "path";
111
+ var DEFAULT_FIRST_RELEASE_TEXT = "_First release of ${packageName}._";
112
+ function firstReleaseLine(context, config) {
113
+ if (!context.isFirstRelease || config === false) return void 0;
114
+ const template = config?.text ?? DEFAULT_FIRST_RELEASE_TEXT;
115
+ return template.replaceAll("${packageName}", context.packageName).replaceAll("${version}", context.version);
116
+ }
111
117
  var TYPE_ORDER = ["added", "changed", "deprecated", "removed", "fixed", "security"];
112
118
  var TYPE_LABELS = {
113
119
  added: "Added",
@@ -287,6 +293,11 @@ function formatVersion(context, options) {
287
293
  const versionHeader = context.previousVersion ? `## [${versionLabel}]` : `## ${versionLabel}`;
288
294
  lines.push(`${versionHeader} - ${context.date}`);
289
295
  lines.push("");
296
+ const introLine = firstReleaseLine(context, options?.firstRelease);
297
+ if (introLine) {
298
+ lines.push(introLine);
299
+ lines.push("");
300
+ }
290
301
  if (context.compareUrl) {
291
302
  lines.push(`[Full Changelog](${context.compareUrl})`);
292
303
  lines.push("");
@@ -5,7 +5,7 @@ import {
5
5
  prependVersion,
6
6
  renderMarkdown,
7
7
  success
8
- } from "./chunk-QCJ545PJ.js";
8
+ } from "./chunk-E6757S4V.js";
9
9
 
10
10
  // src/monorepo/aggregator.ts
11
11
  import * as fs from "fs";
@@ -10,7 +10,7 @@ import {
10
10
  success,
11
11
  warn,
12
12
  writeMarkdown
13
- } from "./chunk-QCJ545PJ.js";
13
+ } from "./chunk-E6757S4V.js";
14
14
 
15
15
  // ../config/dist/index.js
16
16
  import * as fs from "fs";
@@ -379,7 +379,18 @@ var ReleaseNotesConfigSchema = z.object({
379
379
  ).optional().describe("Static list of links to append."),
380
380
  fromPRBodyMarker: z.string().optional().describe("Marker string in PR bodies; content after it is extracted and appended as links."),
381
381
  title: z.string().optional().describe("Heading for the links section.")
382
- }).optional().describe("Extra links to append to the release notes.")
382
+ }).optional().describe("Extra links to append to the release notes."),
383
+ firstRelease: z.union([
384
+ z.literal(false).describe("Set to false to disable the first-release placeholder intro."),
385
+ z.object({
386
+ text: z.string().optional().describe(
387
+ // biome-ignore lint/suspicious/noTemplateCurlyInString: documenting placeholder syntax to the user
388
+ "Placeholder intro line for a package's first release. Supports ${packageName} and ${version}. Defaults to a factual line so it reads cleanly even when published unedited."
389
+ )
390
+ })
391
+ ]).optional().describe(
392
+ "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."
393
+ )
383
394
  }).describe("Release notes configuration");
384
395
  var NotesInputConfigSchema = z.object({
385
396
  source: z.string().optional(),
@@ -398,6 +409,9 @@ var CILabelsConfigSchema = z.object({
398
409
  skip: z.string().default("release:skip").describe("Label to suppress a release on this PR"),
399
410
  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."),
400
411
  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."),
412
+ previewNotes: z.string().default("release:preview-notes").describe(
413
+ "Label on the standing PR that generates LLM release notes on demand into an editable region in the PR body, for review and editing before merge. Standing-pr mode only."
414
+ ),
401
415
  major: z.string().default("bump:major").describe("Label to force a major bump"),
402
416
  minor: z.string().default("bump:minor").describe("Label to force a minor bump"),
403
417
  patch: z.string().default("bump:patch").describe("Label to force a patch bump")
@@ -439,6 +453,7 @@ var CIConfigSchema = z.object({
439
453
  skip: "release:skip",
440
454
  immediate: "release:immediate",
441
455
  retry: "release:retry",
456
+ previewNotes: "release:preview-notes",
442
457
  major: "bump:major",
443
458
  minor: "bump:minor",
444
459
  patch: "bump:patch"
@@ -2342,7 +2357,8 @@ function createTemplateContext(pkg) {
2342
2357
  date: pkg.date,
2343
2358
  repoUrl: pkg.repoUrl,
2344
2359
  entries: pkg.entries,
2345
- compareUrl
2360
+ compareUrl,
2361
+ isFirstRelease: pkg.previousVersion === null
2346
2362
  };
2347
2363
  }
2348
2364
  function createDocumentContext(contexts, repoUrl) {
@@ -2541,7 +2557,8 @@ async function runPipeline(input, config, dryRun, pipelineOptions) {
2541
2557
  const fmtOpts = {
2542
2558
  includePackageName: contexts.length > 1 || contexts.some((c) => c.packageName.includes("/")),
2543
2559
  categoryOrder: llmConfig?.categoryOrder,
2544
- links: releaseNotesConfig?.links
2560
+ links: releaseNotesConfig?.links,
2561
+ firstRelease: releaseNotesConfig?.firstRelease
2545
2562
  };
2546
2563
  if (!pipelineOptions?.skipChangelogs && changelogConfig !== false && changelogConfig.mode) {
2547
2564
  const fileName = changelogConfig.file ?? "CHANGELOG.md";
@@ -2574,7 +2591,7 @@ async function runPipeline(input, config, dryRun, pipelineOptions) {
2574
2591
  const dir = releaseNotesConfig.file.dir;
2575
2592
  info(`Generating release notes \u2192 ${dir}`);
2576
2593
  try {
2577
- const { detectMonorepo } = await import("./aggregator-GXJXPM7O.js");
2594
+ const { detectMonorepo } = await import("./aggregator-6TEWRELZ.js");
2578
2595
  const nested = detectMonorepo(process.cwd()).isMonorepo || contexts.length > 1;
2579
2596
  const renderContent = (ctx) => {
2580
2597
  if (releaseNotesConfig.templates?.path) {
@@ -2594,7 +2611,7 @@ async function runPipeline(input, config, dryRun, pipelineOptions) {
2594
2611
  const packageNotes = {};
2595
2612
  const releaseNotesResult = {};
2596
2613
  for (const ctx of contexts) {
2597
- packageNotes[ctx.packageName] = formatVersion(ctx);
2614
+ packageNotes[ctx.packageName] = formatVersion(ctx, { firstRelease: releaseNotesConfig?.firstRelease });
2598
2615
  if (pipelineOptions?.skipReleaseNotes) {
2599
2616
  continue;
2600
2617
  }
@@ -2621,7 +2638,7 @@ async function runPipeline(input, config, dryRun, pipelineOptions) {
2621
2638
  info(
2622
2639
  `No LLM release notes or template output for ${ctx.packageName}, using formatted changelog as release notes preview`
2623
2640
  );
2624
- releaseNotesResult[ctx.packageName] = formatVersion(ctx);
2641
+ releaseNotesResult[ctx.packageName] = formatVersion(ctx, { firstRelease: releaseNotesConfig?.firstRelease });
2625
2642
  }
2626
2643
  }
2627
2644
  }
@@ -2636,7 +2653,7 @@ async function processInput(inputJson, config, dryRun, pipelineOptions) {
2636
2653
  return runPipeline(input, config, dryRun, pipelineOptions);
2637
2654
  }
2638
2655
  async function writeMonorepoFiles(contexts, config, dryRun, fileName) {
2639
- const { detectMonorepo, writeMonorepoChangelogs } = await import("./aggregator-GXJXPM7O.js");
2656
+ const { detectMonorepo, writeMonorepoChangelogs } = await import("./aggregator-6TEWRELZ.js");
2640
2657
  const cwd = process.cwd();
2641
2658
  const detected = detectMonorepo(cwd);
2642
2659
  if (!detected.isMonorepo) return [];
package/dist/cli.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createNotesCommand
4
- } from "./chunk-5TPZELKB.js";
4
+ } from "./chunk-QHSLAQIS.js";
5
5
  import {
6
6
  readPackageVersion
7
- } from "./chunk-QCJ545PJ.js";
7
+ } from "./chunk-E6757S4V.js";
8
8
 
9
9
  // src/cli.ts
10
10
  import * as fs from "fs";
package/dist/index.js CHANGED
@@ -18,12 +18,12 @@ import {
18
18
  runPipeline,
19
19
  saveAuth,
20
20
  versionOutputToChangelogInput
21
- } from "./chunk-5TPZELKB.js";
21
+ } from "./chunk-QHSLAQIS.js";
22
22
  import {
23
23
  aggregateToRoot,
24
24
  detectMonorepo,
25
25
  writeMonorepoChangelogs
26
- } from "./chunk-L34QVI62.js";
26
+ } from "./chunk-ECD44YFA.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-QCJ545PJ.js";
34
+ } from "./chunk-E6757S4V.js";
35
35
 
36
36
  // src/output/json.ts
37
37
  import * as fs from "fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@releasekit/notes",
3
- "version": "0.28.0",
3
+ "version": "0.29.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,7 +47,7 @@
47
47
  "access": "public"
48
48
  },
49
49
  "dependencies": {
50
- "@anthropic-ai/sdk": "^0.102.0",
50
+ "@anthropic-ai/sdk": "^0.104.1",
51
51
  "@octokit/request-error": "^7.1.0",
52
52
  "@octokit/rest": "^22.0.1",
53
53
  "chalk": "^5.6.2",
@@ -59,17 +59,17 @@
59
59
  "minimatch": "^10.0.0",
60
60
  "openai": "^6.42.0",
61
61
  "smol-toml": "^1.6.1",
62
- "yaml": "^2.8.3",
62
+ "yaml": "^2.9.0",
63
63
  "zod": "^4.4.3"
64
64
  },
65
65
  "devDependencies": {
66
- "@biomejs/biome": "^2.4.16",
66
+ "@biomejs/biome": "^2.5.0",
67
67
  "@types/ejs": "^3.1.5",
68
- "@types/node": "^22.19.20",
69
- "@vitest/coverage-v8": "^4.1.8",
68
+ "@types/node": "^22.19.21",
69
+ "@vitest/coverage-v8": "^4.1.9",
70
70
  "tsup": "^8.5.1",
71
71
  "typescript": "^5.9.3",
72
- "vitest": "^4.1.8",
72
+ "vitest": "^4.1.9",
73
73
  "@releasekit/config": "0.0.0",
74
74
  "@releasekit/core": "0.0.0"
75
75
  },