@releasekit/notes 0.23.0 → 0.25.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.
@@ -19,6 +19,7 @@ import * as TOML from "smol-toml";
19
19
  import * as fs3 from "fs";
20
20
  import * as path3 from "path";
21
21
  import { z as z2 } from "zod";
22
+ import { parse as parse2, printParseErrorCode } from "jsonc-parser";
22
23
  import { z } from "zod";
23
24
  import * as fs2 from "fs";
24
25
  import * as os from "os";
@@ -36,17 +37,21 @@ var ConfigError = class extends ReleaseKitError {
36
37
  ];
37
38
  }
38
39
  };
39
- var MAX_JSONC_LENGTH = 1e5;
40
40
  function parseJsonc(content) {
41
- if (content.length > MAX_JSONC_LENGTH) {
42
- throw new Error(`JSONC content too long: ${content.length} characters (max ${MAX_JSONC_LENGTH})`);
43
- }
44
41
  try {
45
42
  return JSON.parse(content);
46
43
  } catch {
47
- const cleaned = content.replace(/\/\/[^\r\n]{0,10000}$/gm, "").replace(/\/\*[\s\S]{0,50000}?\*\//g, "").trim();
48
- return JSON.parse(cleaned);
49
44
  }
45
+ const errors = [];
46
+ const result = parse2(content, errors, { allowTrailingComma: true });
47
+ if (errors.length > 0) {
48
+ const { error: error2, offset } = errors[0];
49
+ throw new SyntaxError(`Invalid JSONC: ${printParseErrorCode(error2)} at position ${offset}`);
50
+ }
51
+ if (result === void 0) {
52
+ throw new SyntaxError("Invalid JSONC: no value found");
53
+ }
54
+ return result;
50
55
  }
51
56
  var GitConfigSchema = z.object({
52
57
  remote: z.string().default("origin"),
@@ -329,6 +334,8 @@ var CILabelsConfigSchema = z.object({
329
334
  skip: z.string().default("release:skip"),
330
335
  /** Bypass the standing PR for one merge — triggers a direct release. Standing-pr mode only. */
331
336
  immediate: z.string().default("release:immediate"),
337
+ /** Retry a failed publish by re-applying it to a merged standing PR. Standing-pr mode only. */
338
+ retry: z.string().default("release:retry"),
332
339
  major: z.string().default("bump:major"),
333
340
  minor: z.string().default("bump:minor"),
334
341
  patch: z.string().default("bump:patch")
@@ -336,9 +343,14 @@ var CILabelsConfigSchema = z.object({
336
343
  var StandingPrConfigSchema = z.object({
337
344
  /** Branch name for the release PR. Default: 'release/next' */
338
345
  branch: z.string().default("release/next"),
339
- /** Title template for the release PR. Variables: ${count}, ${version}. Must start with 'chore: release' to match default skip pattern on merge. */
340
- /* biome-ignore lint/suspicious/noTemplateCurlyInString: default template value */
341
- title: z.string().default("chore: release ${count} package(s)"),
346
+ /**
347
+ * Title template for the release PR. Variables: ${count} (publishable package count),
348
+ * ${version} (raw version), ${tag} (version with tag prefix). Must start with 'chore: release'
349
+ * to match default skip pattern on merge. When unset, the default depends on the versioning
350
+ * strategy: 'chore: release ${tag}' in sync mode (the repo releases as one versioned unit),
351
+ * 'chore: release ${count} package(s)' otherwise.
352
+ */
353
+ title: z.string().optional(),
342
354
  /** Labels to apply to the standing release PR */
343
355
  labels: z.array(z.string()).default(["release"]),
344
356
  /** Whether to auto-delete the release branch after PR merge. Default: true */
@@ -368,6 +380,7 @@ var CIConfigSchema = z.object({
368
380
  prerelease: "channel:prerelease",
369
381
  skip: "release:skip",
370
382
  immediate: "release:immediate",
383
+ retry: "release:retry",
371
384
  major: "bump:major",
372
385
  minor: "bump:minor",
373
386
  patch: "bump:patch"
@@ -468,7 +481,16 @@ function saveAuth(provider, apiKey) {
468
481
  existing[provider] = apiKey;
469
482
  fs2.writeFileSync(AUTH_FILE, JSON.stringify(existing, null, 2), { encoding: "utf-8", mode: 384 });
470
483
  }
471
- var CONFIG_FILE = "releasekit.config.json";
484
+ var CONFIG_FILES = ["releasekit.config.json", "releasekit.config.jsonc"];
485
+ function resolveConfigPath(cwd) {
486
+ for (const file of CONFIG_FILES) {
487
+ const candidate = path3.join(cwd, file);
488
+ if (fs3.existsSync(candidate)) {
489
+ return candidate;
490
+ }
491
+ }
492
+ return path3.join(cwd, CONFIG_FILES[0]);
493
+ }
472
494
  function loadConfigFile(configPath) {
473
495
  if (!fs3.existsSync(configPath)) {
474
496
  return {};
@@ -492,7 +514,7 @@ ${issues}`);
492
514
  }
493
515
  function loadConfig(options) {
494
516
  const cwd = options?.cwd ?? process.cwd();
495
- const configPath = options?.configPath ?? path3.join(cwd, CONFIG_FILE);
517
+ const configPath = options?.configPath ?? resolveConfigPath(cwd);
496
518
  return loadConfigFile(configPath);
497
519
  }
498
520
 
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createNotesCommand
4
- } from "./chunk-U7DE6XZR.js";
4
+ } from "./chunk-NSKMI5F2.js";
5
5
  import {
6
6
  readPackageVersion
7
7
  } from "./chunk-QCJ545PJ.js";
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  runPipeline,
19
19
  saveAuth,
20
20
  versionOutputToChangelogInput
21
- } from "./chunk-U7DE6XZR.js";
21
+ } from "./chunk-NSKMI5F2.js";
22
22
  import {
23
23
  aggregateToRoot,
24
24
  detectMonorepo,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@releasekit/notes",
3
- "version": "0.23.0",
3
+ "version": "0.25.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,27 +47,28 @@
47
47
  "access": "public"
48
48
  },
49
49
  "dependencies": {
50
- "@anthropic-ai/sdk": "^0.95.1",
50
+ "@anthropic-ai/sdk": "^0.100.1",
51
51
  "@octokit/request-error": "^7.1.0",
52
52
  "@octokit/rest": "^22.0.1",
53
53
  "chalk": "^5.6.2",
54
54
  "commander": "^14.0.3",
55
55
  "ejs": "^4.0.1",
56
56
  "handlebars": "^4.7.9",
57
- "liquidjs": "^10.25.7",
57
+ "jsonc-parser": "^3.3.1",
58
+ "liquidjs": "^10.27.0",
58
59
  "minimatch": "^10.0.0",
59
- "openai": "^6.37.0",
60
+ "openai": "^6.39.1",
60
61
  "smol-toml": "^1.6.1",
61
62
  "zod": "^4.4.3"
62
63
  },
63
64
  "devDependencies": {
64
- "@biomejs/biome": "^2.4.15",
65
+ "@biomejs/biome": "^2.4.16",
65
66
  "@types/ejs": "^3.1.5",
66
- "@types/node": "^22.19.18",
67
- "@vitest/coverage-v8": "^4.1.5",
67
+ "@types/node": "^22.19.19",
68
+ "@vitest/coverage-v8": "^4.1.8",
68
69
  "tsup": "^8.5.1",
69
70
  "typescript": "^5.9.3",
70
- "vitest": "^4.1.5",
71
+ "vitest": "^4.1.8",
71
72
  "@releasekit/config": "0.0.0",
72
73
  "@releasekit/core": "0.0.0"
73
74
  },