@releasekit/notes 0.24.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.
- package/dist/{chunk-3UY2G62A.js → chunk-NSKMI5F2.js} +25 -8
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -1
|
@@ -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")
|
|
@@ -373,6 +380,7 @@ var CIConfigSchema = z.object({
|
|
|
373
380
|
prerelease: "channel:prerelease",
|
|
374
381
|
skip: "release:skip",
|
|
375
382
|
immediate: "release:immediate",
|
|
383
|
+
retry: "release:retry",
|
|
376
384
|
major: "bump:major",
|
|
377
385
|
minor: "bump:minor",
|
|
378
386
|
patch: "bump:patch"
|
|
@@ -473,7 +481,16 @@ function saveAuth(provider, apiKey) {
|
|
|
473
481
|
existing[provider] = apiKey;
|
|
474
482
|
fs2.writeFileSync(AUTH_FILE, JSON.stringify(existing, null, 2), { encoding: "utf-8", mode: 384 });
|
|
475
483
|
}
|
|
476
|
-
var
|
|
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
|
+
}
|
|
477
494
|
function loadConfigFile(configPath) {
|
|
478
495
|
if (!fs3.existsSync(configPath)) {
|
|
479
496
|
return {};
|
|
@@ -497,7 +514,7 @@ ${issues}`);
|
|
|
497
514
|
}
|
|
498
515
|
function loadConfig(options) {
|
|
499
516
|
const cwd = options?.cwd ?? process.cwd();
|
|
500
|
-
const configPath = options?.configPath ??
|
|
517
|
+
const configPath = options?.configPath ?? resolveConfigPath(cwd);
|
|
501
518
|
return loadConfigFile(configPath);
|
|
502
519
|
}
|
|
503
520
|
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@releasekit/notes",
|
|
3
|
-
"version": "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",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"commander": "^14.0.3",
|
|
55
55
|
"ejs": "^4.0.1",
|
|
56
56
|
"handlebars": "^4.7.9",
|
|
57
|
+
"jsonc-parser": "^3.3.1",
|
|
57
58
|
"liquidjs": "^10.27.0",
|
|
58
59
|
"minimatch": "^10.0.0",
|
|
59
60
|
"openai": "^6.39.1",
|