@releasekit/release 0.7.11 → 0.7.13
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/aggregator-IUQUAVJC-FMVZQKPK.js +13 -0
- package/dist/baseError-DQHIJACF-MKENOKQI.js +7 -0
- package/dist/{chunk-ALHJU3KL.js → chunk-6PUHZHPR.js} +1 -1
- package/dist/chunk-BLLATA3P.js +25047 -0
- package/dist/chunk-FM2YXFEQ.js +20 -0
- package/dist/chunk-HW3BIMUI.js +73 -0
- package/dist/{chunk-D6HRZXZZ.js → chunk-LTPOKPAP.js} +10 -12
- package/dist/chunk-MKXM4ZCM.js +14096 -0
- package/dist/chunk-OOW3QGRT.js +1996 -0
- package/dist/chunk-PJO2QZSV.js +1937 -0
- package/dist/chunk-QGM4M3NI.js +37 -0
- package/dist/chunk-X6K5NWRA.js +376 -0
- package/dist/cli.js +3 -2
- package/dist/commandExecutor-E44ID5U4-ZQZNV25N.js +9 -0
- package/dist/dispatcher.js +18 -6
- package/dist/dist-3OF3AQKY.js +37 -0
- package/dist/dist-J7662OKQ.js +104 -0
- package/dist/dist-KJOL5QEY.js +59 -0
- package/dist/dist-WN32E32Z.js +433 -0
- package/dist/dist-WSR7GQXK.js +42 -0
- package/dist/index.d.ts +98 -3
- package/dist/index.js +2 -1
- package/package.json +4 -4
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
+
}) : x)(function(x) {
|
|
10
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
+
});
|
|
13
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
14
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
+
mod
|
|
31
|
+
));
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
__require,
|
|
35
|
+
__commonJS,
|
|
36
|
+
__toESM
|
|
37
|
+
};
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
// ../notes/dist/chunk-7TJSPQPW.js
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import * as fs2 from "fs";
|
|
4
|
+
import * as path2 from "path";
|
|
5
|
+
var LOG_LEVELS = {
|
|
6
|
+
error: 0,
|
|
7
|
+
warn: 1,
|
|
8
|
+
info: 2,
|
|
9
|
+
debug: 3,
|
|
10
|
+
trace: 4
|
|
11
|
+
};
|
|
12
|
+
var PREFIXES = {
|
|
13
|
+
error: "[ERROR]",
|
|
14
|
+
warn: "[WARN]",
|
|
15
|
+
info: "[INFO]",
|
|
16
|
+
debug: "[DEBUG]",
|
|
17
|
+
trace: "[TRACE]"
|
|
18
|
+
};
|
|
19
|
+
var COLORS = {
|
|
20
|
+
error: chalk.red,
|
|
21
|
+
warn: chalk.yellow,
|
|
22
|
+
info: chalk.blue,
|
|
23
|
+
debug: chalk.gray,
|
|
24
|
+
trace: chalk.dim
|
|
25
|
+
};
|
|
26
|
+
var currentLevel = "info";
|
|
27
|
+
var quietMode = false;
|
|
28
|
+
function setLogLevel(level) {
|
|
29
|
+
currentLevel = level;
|
|
30
|
+
}
|
|
31
|
+
function setQuietMode(quiet) {
|
|
32
|
+
quietMode = quiet;
|
|
33
|
+
}
|
|
34
|
+
function shouldLog(level) {
|
|
35
|
+
if (quietMode && level !== "error") return false;
|
|
36
|
+
return LOG_LEVELS[level] <= LOG_LEVELS[currentLevel];
|
|
37
|
+
}
|
|
38
|
+
function log(message, level = "info") {
|
|
39
|
+
if (!shouldLog(level)) return;
|
|
40
|
+
const formatted = COLORS[level](`${PREFIXES[level]} ${message}`);
|
|
41
|
+
console.error(formatted);
|
|
42
|
+
}
|
|
43
|
+
function error(message) {
|
|
44
|
+
log(message, "error");
|
|
45
|
+
}
|
|
46
|
+
function warn(message) {
|
|
47
|
+
log(message, "warn");
|
|
48
|
+
}
|
|
49
|
+
function info(message) {
|
|
50
|
+
log(message, "info");
|
|
51
|
+
}
|
|
52
|
+
function success(message) {
|
|
53
|
+
if (!shouldLog("info")) return;
|
|
54
|
+
console.error(chalk.green(`[SUCCESS] ${message}`));
|
|
55
|
+
}
|
|
56
|
+
function debug(message) {
|
|
57
|
+
log(message, "debug");
|
|
58
|
+
}
|
|
59
|
+
var ReleaseKitError = class _ReleaseKitError extends Error {
|
|
60
|
+
constructor(message) {
|
|
61
|
+
super(message);
|
|
62
|
+
this.name = this.constructor.name;
|
|
63
|
+
}
|
|
64
|
+
logError() {
|
|
65
|
+
log(this.message, "error");
|
|
66
|
+
if (this.suggestions.length > 0) {
|
|
67
|
+
log("\nSuggested solutions:", "info");
|
|
68
|
+
for (const [i, suggestion] of this.suggestions.entries()) {
|
|
69
|
+
log(`${i + 1}. ${suggestion}`, "info");
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
static isReleaseKitError(error2) {
|
|
74
|
+
return error2 instanceof _ReleaseKitError;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
var EXIT_CODES = {
|
|
78
|
+
SUCCESS: 0,
|
|
79
|
+
GENERAL_ERROR: 1,
|
|
80
|
+
CONFIG_ERROR: 2,
|
|
81
|
+
INPUT_ERROR: 3,
|
|
82
|
+
TEMPLATE_ERROR: 4,
|
|
83
|
+
LLM_ERROR: 5,
|
|
84
|
+
GITHUB_ERROR: 6,
|
|
85
|
+
GIT_ERROR: 7,
|
|
86
|
+
VERSION_ERROR: 8,
|
|
87
|
+
PUBLISH_ERROR: 9
|
|
88
|
+
};
|
|
89
|
+
var TYPE_ORDER = ["added", "changed", "deprecated", "removed", "fixed", "security"];
|
|
90
|
+
var TYPE_LABELS = {
|
|
91
|
+
added: "Added",
|
|
92
|
+
changed: "Changed",
|
|
93
|
+
deprecated: "Deprecated",
|
|
94
|
+
removed: "Removed",
|
|
95
|
+
fixed: "Fixed",
|
|
96
|
+
security: "Security"
|
|
97
|
+
};
|
|
98
|
+
function groupEntriesByType(entries) {
|
|
99
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
100
|
+
for (const type of TYPE_ORDER) {
|
|
101
|
+
grouped.set(type, []);
|
|
102
|
+
}
|
|
103
|
+
for (const entry of entries) {
|
|
104
|
+
const existing = grouped.get(entry.type) ?? [];
|
|
105
|
+
existing.push(entry);
|
|
106
|
+
grouped.set(entry.type, existing);
|
|
107
|
+
}
|
|
108
|
+
return grouped;
|
|
109
|
+
}
|
|
110
|
+
function formatEntry(entry) {
|
|
111
|
+
let line;
|
|
112
|
+
if (entry.breaking && entry.scope) {
|
|
113
|
+
line = `- **BREAKING** **${entry.scope}**: ${entry.description}`;
|
|
114
|
+
} else if (entry.breaking) {
|
|
115
|
+
line = `- **BREAKING** ${entry.description}`;
|
|
116
|
+
} else if (entry.scope) {
|
|
117
|
+
line = `- **${entry.scope}**: ${entry.description}`;
|
|
118
|
+
} else {
|
|
119
|
+
line = `- ${entry.description}`;
|
|
120
|
+
}
|
|
121
|
+
if (entry.issueIds && entry.issueIds.length > 0) {
|
|
122
|
+
line += ` (${entry.issueIds.join(", ")})`;
|
|
123
|
+
}
|
|
124
|
+
return line;
|
|
125
|
+
}
|
|
126
|
+
function formatVersion(context, options) {
|
|
127
|
+
const lines = [];
|
|
128
|
+
const versionLabel = options?.includePackageName && context.packageName ? `${context.packageName}@${context.version}` : context.version;
|
|
129
|
+
const versionHeader = context.previousVersion ? `## [${versionLabel}]` : `## ${versionLabel}`;
|
|
130
|
+
lines.push(`${versionHeader} - ${context.date}`);
|
|
131
|
+
lines.push("");
|
|
132
|
+
if (context.compareUrl) {
|
|
133
|
+
lines.push(`[Full Changelog](${context.compareUrl})`);
|
|
134
|
+
lines.push("");
|
|
135
|
+
}
|
|
136
|
+
if (context.enhanced?.summary) {
|
|
137
|
+
lines.push(context.enhanced.summary);
|
|
138
|
+
lines.push("");
|
|
139
|
+
}
|
|
140
|
+
const grouped = groupEntriesByType(context.entries);
|
|
141
|
+
for (const [type, entries] of grouped) {
|
|
142
|
+
if (entries.length === 0) continue;
|
|
143
|
+
lines.push(`### ${TYPE_LABELS[type]}`);
|
|
144
|
+
for (const entry of entries) {
|
|
145
|
+
lines.push(formatEntry(entry));
|
|
146
|
+
}
|
|
147
|
+
lines.push("");
|
|
148
|
+
}
|
|
149
|
+
return lines.join("\n");
|
|
150
|
+
}
|
|
151
|
+
function formatHeader() {
|
|
152
|
+
return `# Changelog
|
|
153
|
+
|
|
154
|
+
All notable changes to this project will be documented in this file.
|
|
155
|
+
|
|
156
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
157
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
158
|
+
|
|
159
|
+
`;
|
|
160
|
+
}
|
|
161
|
+
function renderMarkdown(contexts, options) {
|
|
162
|
+
const sections = [formatHeader()];
|
|
163
|
+
for (const context of contexts) {
|
|
164
|
+
sections.push(formatVersion(context, options));
|
|
165
|
+
}
|
|
166
|
+
return sections.join("\n");
|
|
167
|
+
}
|
|
168
|
+
function prependVersion(existingPath, context, options) {
|
|
169
|
+
let existing = "";
|
|
170
|
+
if (fs2.existsSync(existingPath)) {
|
|
171
|
+
existing = fs2.readFileSync(existingPath, "utf-8");
|
|
172
|
+
const headerEnd = existing.indexOf("\n## ");
|
|
173
|
+
if (headerEnd >= 0) {
|
|
174
|
+
const header = existing.slice(0, headerEnd);
|
|
175
|
+
const body = existing.slice(headerEnd + 1);
|
|
176
|
+
const newVersion = formatVersion(context, options);
|
|
177
|
+
return `${header}
|
|
178
|
+
|
|
179
|
+
${newVersion}
|
|
180
|
+
${body}`;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return renderMarkdown([context]);
|
|
184
|
+
}
|
|
185
|
+
function writeMarkdown(outputPath, contexts, config, dryRun, options) {
|
|
186
|
+
const content = renderMarkdown(contexts, options);
|
|
187
|
+
const label = /changelog/i.test(outputPath) ? "Changelog" : "Release notes";
|
|
188
|
+
if (dryRun) {
|
|
189
|
+
info(`[DRY RUN] ${label} preview (would write to ${outputPath}):`);
|
|
190
|
+
info(content);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
const dir = path2.dirname(outputPath);
|
|
194
|
+
if (!fs2.existsSync(dir)) {
|
|
195
|
+
fs2.mkdirSync(dir, { recursive: true });
|
|
196
|
+
}
|
|
197
|
+
if (outputPath === "-") {
|
|
198
|
+
process.stdout.write(content);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if (config.updateStrategy !== "regenerate" && fs2.existsSync(outputPath) && contexts.length === 1) {
|
|
202
|
+
const firstContext = contexts[0];
|
|
203
|
+
if (firstContext) {
|
|
204
|
+
const updated = prependVersion(outputPath, firstContext, options);
|
|
205
|
+
fs2.writeFileSync(outputPath, updated, "utf-8");
|
|
206
|
+
}
|
|
207
|
+
} else {
|
|
208
|
+
fs2.writeFileSync(outputPath, content, "utf-8");
|
|
209
|
+
}
|
|
210
|
+
success(`${label} written to ${outputPath}`);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// ../notes/dist/chunk-F7MUVHZ2.js
|
|
214
|
+
import * as fs from "fs";
|
|
215
|
+
import * as path from "path";
|
|
216
|
+
function splitByPackage(contexts) {
|
|
217
|
+
const byPackage = /* @__PURE__ */ new Map();
|
|
218
|
+
for (const ctx of contexts) {
|
|
219
|
+
byPackage.set(ctx.packageName, ctx);
|
|
220
|
+
}
|
|
221
|
+
return byPackage;
|
|
222
|
+
}
|
|
223
|
+
function writeFile(outputPath, content, dryRun) {
|
|
224
|
+
if (dryRun) {
|
|
225
|
+
info(`Would write to ${outputPath}`);
|
|
226
|
+
debug(content);
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
const dir = path.dirname(outputPath);
|
|
230
|
+
if (!fs.existsSync(dir)) {
|
|
231
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
232
|
+
}
|
|
233
|
+
fs.writeFileSync(outputPath, content, "utf-8");
|
|
234
|
+
success(`Changelog written to ${outputPath}`);
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
237
|
+
function aggregateToRoot(contexts) {
|
|
238
|
+
const aggregated = {
|
|
239
|
+
packageName: "monorepo",
|
|
240
|
+
version: contexts[0]?.version ?? "0.0.0",
|
|
241
|
+
previousVersion: contexts[0]?.previousVersion ?? null,
|
|
242
|
+
date: (/* @__PURE__ */ new Date()).toISOString().split("T")[0] ?? "",
|
|
243
|
+
repoUrl: contexts[0]?.repoUrl ?? null,
|
|
244
|
+
entries: []
|
|
245
|
+
};
|
|
246
|
+
for (const ctx of contexts) {
|
|
247
|
+
for (const entry of ctx.entries) {
|
|
248
|
+
aggregated.entries.push({
|
|
249
|
+
...entry,
|
|
250
|
+
scope: entry.scope ? `${ctx.packageName}/${entry.scope}` : ctx.packageName
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return aggregated;
|
|
255
|
+
}
|
|
256
|
+
function writeMonorepoChangelogs(contexts, options, config, dryRun) {
|
|
257
|
+
const files = [];
|
|
258
|
+
if (options.mode === "root" || options.mode === "both") {
|
|
259
|
+
const rootPath = path.join(options.rootPath, options.fileName ?? "CHANGELOG.md");
|
|
260
|
+
const fmtOpts = { includePackageName: true };
|
|
261
|
+
info(`Writing root changelog to ${rootPath}`);
|
|
262
|
+
let rootContent;
|
|
263
|
+
if (config.updateStrategy !== "regenerate" && fs.existsSync(rootPath)) {
|
|
264
|
+
const newSections = contexts.map((ctx) => formatVersion(ctx, fmtOpts)).join("\n");
|
|
265
|
+
const existing = fs.readFileSync(rootPath, "utf-8");
|
|
266
|
+
const headerEnd = existing.indexOf("\n## ");
|
|
267
|
+
if (headerEnd >= 0) {
|
|
268
|
+
rootContent = `${existing.slice(0, headerEnd)}
|
|
269
|
+
|
|
270
|
+
${newSections}
|
|
271
|
+
${existing.slice(headerEnd + 1)}`;
|
|
272
|
+
} else {
|
|
273
|
+
rootContent = renderMarkdown(contexts, fmtOpts);
|
|
274
|
+
}
|
|
275
|
+
} else {
|
|
276
|
+
rootContent = renderMarkdown(contexts, fmtOpts);
|
|
277
|
+
}
|
|
278
|
+
if (writeFile(rootPath, rootContent, dryRun)) {
|
|
279
|
+
files.push(rootPath);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
if (options.mode === "packages" || options.mode === "both") {
|
|
283
|
+
const byPackage = splitByPackage(contexts);
|
|
284
|
+
const packageDirMap = buildPackageDirMap(options.rootPath, options.packagesPath);
|
|
285
|
+
for (const [packageName, ctx] of byPackage) {
|
|
286
|
+
const simpleName = packageName.split("/").pop();
|
|
287
|
+
const packageDir = packageDirMap.get(packageName) ?? (simpleName ? packageDirMap.get(simpleName) : void 0) ?? null;
|
|
288
|
+
if (packageDir) {
|
|
289
|
+
const changelogPath = path.join(packageDir, options.fileName ?? "CHANGELOG.md");
|
|
290
|
+
info(`Writing changelog for ${packageName} to ${changelogPath}`);
|
|
291
|
+
const pkgContent = config.updateStrategy !== "regenerate" && fs.existsSync(changelogPath) ? prependVersion(changelogPath, ctx) : renderMarkdown([ctx]);
|
|
292
|
+
if (writeFile(changelogPath, pkgContent, dryRun)) {
|
|
293
|
+
files.push(changelogPath);
|
|
294
|
+
}
|
|
295
|
+
} else {
|
|
296
|
+
info(`Could not find directory for package ${packageName}, skipping`);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return files;
|
|
301
|
+
}
|
|
302
|
+
function buildPackageDirMap(rootPath, packagesPath) {
|
|
303
|
+
const map = /* @__PURE__ */ new Map();
|
|
304
|
+
const packagesDir = path.join(rootPath, packagesPath);
|
|
305
|
+
if (!fs.existsSync(packagesDir)) {
|
|
306
|
+
return map;
|
|
307
|
+
}
|
|
308
|
+
for (const entry of fs.readdirSync(packagesDir, { withFileTypes: true })) {
|
|
309
|
+
if (!entry.isDirectory()) continue;
|
|
310
|
+
const dirPath = path.join(packagesDir, entry.name);
|
|
311
|
+
map.set(entry.name, dirPath);
|
|
312
|
+
const packageJsonPath = path.join(dirPath, "package.json");
|
|
313
|
+
if (fs.existsSync(packageJsonPath)) {
|
|
314
|
+
try {
|
|
315
|
+
const pkg = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
|
|
316
|
+
if (pkg.name) {
|
|
317
|
+
map.set(pkg.name, dirPath);
|
|
318
|
+
}
|
|
319
|
+
} catch {
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return map;
|
|
324
|
+
}
|
|
325
|
+
function detectMonorepo(cwd) {
|
|
326
|
+
const pnpmWorkspacesPath = path.join(cwd, "pnpm-workspace.yaml");
|
|
327
|
+
const packageJsonPath = path.join(cwd, "package.json");
|
|
328
|
+
if (fs.existsSync(pnpmWorkspacesPath)) {
|
|
329
|
+
const content = fs.readFileSync(pnpmWorkspacesPath, "utf-8");
|
|
330
|
+
const packagesMatch = content.match(/packages:\s*\n\s*-\s*['"]([^'"]+)['"]/);
|
|
331
|
+
if (packagesMatch?.[1]) {
|
|
332
|
+
const packagesGlob = packagesMatch[1];
|
|
333
|
+
const packagesPath = packagesGlob.replace(/\/?\*$/, "").replace(/\/\*\*$/, "");
|
|
334
|
+
return { isMonorepo: true, packagesPath: packagesPath || "packages" };
|
|
335
|
+
}
|
|
336
|
+
return { isMonorepo: true, packagesPath: "packages" };
|
|
337
|
+
}
|
|
338
|
+
if (fs.existsSync(packageJsonPath)) {
|
|
339
|
+
try {
|
|
340
|
+
const content = fs.readFileSync(packageJsonPath, "utf-8");
|
|
341
|
+
const pkg = JSON.parse(content);
|
|
342
|
+
if (pkg.workspaces) {
|
|
343
|
+
const workspaces = Array.isArray(pkg.workspaces) ? pkg.workspaces : pkg.workspaces.packages;
|
|
344
|
+
if (workspaces?.length) {
|
|
345
|
+
const firstWorkspace = workspaces[0];
|
|
346
|
+
if (firstWorkspace) {
|
|
347
|
+
const packagesPath = firstWorkspace.replace(/\/?\*$/, "").replace(/\/\*\*$/, "");
|
|
348
|
+
return { isMonorepo: true, packagesPath: packagesPath || "packages" };
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
} catch {
|
|
353
|
+
return { isMonorepo: false, packagesPath: "" };
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
return { isMonorepo: false, packagesPath: "" };
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export {
|
|
360
|
+
setLogLevel,
|
|
361
|
+
setQuietMode,
|
|
362
|
+
error,
|
|
363
|
+
warn,
|
|
364
|
+
info,
|
|
365
|
+
success,
|
|
366
|
+
debug,
|
|
367
|
+
ReleaseKitError,
|
|
368
|
+
EXIT_CODES,
|
|
369
|
+
formatVersion,
|
|
370
|
+
renderMarkdown,
|
|
371
|
+
writeMarkdown,
|
|
372
|
+
splitByPackage,
|
|
373
|
+
aggregateToRoot,
|
|
374
|
+
writeMonorepoChangelogs,
|
|
375
|
+
detectMonorepo
|
|
376
|
+
};
|
package/dist/cli.js
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import {
|
|
3
3
|
createPreviewCommand,
|
|
4
4
|
createReleaseCommand
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-6PUHZHPR.js";
|
|
6
6
|
import {
|
|
7
7
|
readPackageVersion
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-LTPOKPAP.js";
|
|
9
|
+
import "./chunk-QGM4M3NI.js";
|
|
9
10
|
|
|
10
11
|
// src/cli.ts
|
|
11
12
|
import { realpathSync } from "fs";
|
package/dist/dispatcher.js
CHANGED
|
@@ -1,27 +1,39 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
createNotesCommand
|
|
4
|
+
} from "./chunk-BLLATA3P.js";
|
|
5
|
+
import {
|
|
6
|
+
detectMonorepo
|
|
7
|
+
} from "./chunk-X6K5NWRA.js";
|
|
8
|
+
import {
|
|
9
|
+
createPublishCommand
|
|
10
|
+
} from "./chunk-OOW3QGRT.js";
|
|
2
11
|
import {
|
|
3
12
|
createPreviewCommand,
|
|
4
13
|
createReleaseCommand
|
|
5
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-6PUHZHPR.js";
|
|
6
15
|
import {
|
|
7
16
|
EXIT_CODES,
|
|
8
17
|
error,
|
|
9
18
|
info,
|
|
10
19
|
readPackageVersion,
|
|
11
20
|
success
|
|
12
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-LTPOKPAP.js";
|
|
22
|
+
import {
|
|
23
|
+
createVersionCommand
|
|
24
|
+
} from "./chunk-MKXM4ZCM.js";
|
|
25
|
+
import "./chunk-PJO2QZSV.js";
|
|
26
|
+
import "./chunk-FM2YXFEQ.js";
|
|
27
|
+
import "./chunk-HW3BIMUI.js";
|
|
28
|
+
import "./chunk-QGM4M3NI.js";
|
|
13
29
|
|
|
14
30
|
// src/dispatcher.ts
|
|
15
31
|
import { realpathSync } from "fs";
|
|
16
32
|
import { fileURLToPath } from "url";
|
|
17
|
-
import { createNotesCommand } from "@releasekit/notes/cli";
|
|
18
|
-
import { createPublishCommand } from "@releasekit/publish/cli";
|
|
19
|
-
import { createVersionCommand } from "@releasekit/version/cli";
|
|
20
33
|
import { Command as Command2 } from "commander";
|
|
21
34
|
|
|
22
35
|
// src/init-command.ts
|
|
23
36
|
import * as fs from "fs";
|
|
24
|
-
import { detectMonorepo } from "@releasekit/notes";
|
|
25
37
|
import { Command } from "commander";
|
|
26
38
|
function createInitCommand() {
|
|
27
39
|
return new Command("init").description("Create a default releasekit.config.json").option("-f, --force", "Overwrite existing config").action((options) => {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PackageProcessor,
|
|
3
|
+
VersionEngine,
|
|
4
|
+
VersionErrorCode,
|
|
5
|
+
calculateVersion,
|
|
6
|
+
createAsyncStrategy,
|
|
7
|
+
createSingleStrategy,
|
|
8
|
+
createSyncStrategy,
|
|
9
|
+
createVersionCommand,
|
|
10
|
+
createVersionError,
|
|
11
|
+
enableJsonOutput,
|
|
12
|
+
flushPendingWrites,
|
|
13
|
+
getJsonData,
|
|
14
|
+
loadConfig2
|
|
15
|
+
} from "./chunk-MKXM4ZCM.js";
|
|
16
|
+
import "./chunk-PJO2QZSV.js";
|
|
17
|
+
import "./chunk-FM2YXFEQ.js";
|
|
18
|
+
import {
|
|
19
|
+
BaseVersionError
|
|
20
|
+
} from "./chunk-HW3BIMUI.js";
|
|
21
|
+
import "./chunk-QGM4M3NI.js";
|
|
22
|
+
export {
|
|
23
|
+
BaseVersionError,
|
|
24
|
+
PackageProcessor,
|
|
25
|
+
VersionEngine,
|
|
26
|
+
VersionErrorCode,
|
|
27
|
+
calculateVersion,
|
|
28
|
+
createAsyncStrategy,
|
|
29
|
+
createSingleStrategy,
|
|
30
|
+
createSyncStrategy,
|
|
31
|
+
createVersionCommand,
|
|
32
|
+
createVersionError,
|
|
33
|
+
enableJsonOutput,
|
|
34
|
+
flushPendingWrites,
|
|
35
|
+
getJsonData,
|
|
36
|
+
loadConfig2 as loadConfig
|
|
37
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import "./chunk-QGM4M3NI.js";
|
|
2
|
+
|
|
3
|
+
// ../../node_modules/.pnpm/conventional-commits-filter@5.0.0/node_modules/conventional-commits-filter/dist/utils.js
|
|
4
|
+
function isMatch(object, source) {
|
|
5
|
+
let aValue;
|
|
6
|
+
let bValue;
|
|
7
|
+
for (const key in source) {
|
|
8
|
+
aValue = object[key];
|
|
9
|
+
bValue = source[key];
|
|
10
|
+
if (typeof aValue === "string") {
|
|
11
|
+
aValue = aValue.trim();
|
|
12
|
+
}
|
|
13
|
+
if (typeof bValue === "string") {
|
|
14
|
+
bValue = bValue.trim();
|
|
15
|
+
}
|
|
16
|
+
if (aValue !== bValue) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
function findRevertCommit(commit, reverts) {
|
|
23
|
+
if (!reverts.size) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const rawCommit = commit.raw || commit;
|
|
27
|
+
for (const revertCommit of reverts) {
|
|
28
|
+
if (revertCommit.revert && isMatch(rawCommit, revertCommit.revert)) {
|
|
29
|
+
return revertCommit;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// ../../node_modules/.pnpm/conventional-commits-filter@5.0.0/node_modules/conventional-commits-filter/dist/RevertedCommitsFilter.js
|
|
36
|
+
var RevertedCommitsFilter = class {
|
|
37
|
+
hold = /* @__PURE__ */ new Set();
|
|
38
|
+
holdRevertsCount = 0;
|
|
39
|
+
/**
|
|
40
|
+
* Process commit to filter reverted commits
|
|
41
|
+
* @param commit
|
|
42
|
+
* @yields Commit
|
|
43
|
+
*/
|
|
44
|
+
*process(commit) {
|
|
45
|
+
const { hold } = this;
|
|
46
|
+
const revertCommit = findRevertCommit(commit, hold);
|
|
47
|
+
if (revertCommit) {
|
|
48
|
+
hold.delete(revertCommit);
|
|
49
|
+
this.holdRevertsCount--;
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (commit.revert) {
|
|
53
|
+
hold.add(commit);
|
|
54
|
+
this.holdRevertsCount++;
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (this.holdRevertsCount > 0) {
|
|
58
|
+
hold.add(commit);
|
|
59
|
+
} else {
|
|
60
|
+
if (hold.size) {
|
|
61
|
+
yield* hold;
|
|
62
|
+
hold.clear();
|
|
63
|
+
}
|
|
64
|
+
yield commit;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Flush all held commits
|
|
69
|
+
* @yields Held commits
|
|
70
|
+
*/
|
|
71
|
+
*flush() {
|
|
72
|
+
const { hold } = this;
|
|
73
|
+
if (hold.size) {
|
|
74
|
+
yield* hold;
|
|
75
|
+
hold.clear();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// ../../node_modules/.pnpm/conventional-commits-filter@5.0.0/node_modules/conventional-commits-filter/dist/filters.js
|
|
81
|
+
import { Transform } from "stream";
|
|
82
|
+
async function* filterRevertedCommits(commits) {
|
|
83
|
+
const filter = new RevertedCommitsFilter();
|
|
84
|
+
for await (const commit of commits) {
|
|
85
|
+
yield* filter.process(commit);
|
|
86
|
+
}
|
|
87
|
+
yield* filter.flush();
|
|
88
|
+
}
|
|
89
|
+
function* filterRevertedCommitsSync(commits) {
|
|
90
|
+
const filter = new RevertedCommitsFilter();
|
|
91
|
+
for (const commit of commits) {
|
|
92
|
+
yield* filter.process(commit);
|
|
93
|
+
}
|
|
94
|
+
yield* filter.flush();
|
|
95
|
+
}
|
|
96
|
+
function filterRevertedCommitsStream() {
|
|
97
|
+
return Transform.from(filterRevertedCommits);
|
|
98
|
+
}
|
|
99
|
+
export {
|
|
100
|
+
RevertedCommitsFilter,
|
|
101
|
+
filterRevertedCommits,
|
|
102
|
+
filterRevertedCommitsStream,
|
|
103
|
+
filterRevertedCommitsSync
|
|
104
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ConfigError2,
|
|
3
|
+
GitHubError,
|
|
4
|
+
InputParseError,
|
|
5
|
+
LLMError,
|
|
6
|
+
NotesError,
|
|
7
|
+
TemplateError,
|
|
8
|
+
createNotesCommand,
|
|
9
|
+
createTemplateContext,
|
|
10
|
+
getDefaultConfig,
|
|
11
|
+
getExitCode,
|
|
12
|
+
loadAuth,
|
|
13
|
+
loadConfig2,
|
|
14
|
+
parseVersionOutput,
|
|
15
|
+
parseVersionOutputFile,
|
|
16
|
+
parseVersionOutputStdin,
|
|
17
|
+
processInput,
|
|
18
|
+
renderJson,
|
|
19
|
+
runPipeline,
|
|
20
|
+
saveAuth,
|
|
21
|
+
writeJson
|
|
22
|
+
} from "./chunk-BLLATA3P.js";
|
|
23
|
+
import {
|
|
24
|
+
aggregateToRoot,
|
|
25
|
+
detectMonorepo,
|
|
26
|
+
formatVersion,
|
|
27
|
+
renderMarkdown,
|
|
28
|
+
writeMarkdown,
|
|
29
|
+
writeMonorepoChangelogs
|
|
30
|
+
} from "./chunk-X6K5NWRA.js";
|
|
31
|
+
import "./chunk-QGM4M3NI.js";
|
|
32
|
+
export {
|
|
33
|
+
ConfigError2 as ConfigError,
|
|
34
|
+
GitHubError,
|
|
35
|
+
InputParseError,
|
|
36
|
+
LLMError,
|
|
37
|
+
NotesError,
|
|
38
|
+
TemplateError,
|
|
39
|
+
aggregateToRoot,
|
|
40
|
+
createNotesCommand,
|
|
41
|
+
createTemplateContext,
|
|
42
|
+
detectMonorepo,
|
|
43
|
+
formatVersion,
|
|
44
|
+
getDefaultConfig,
|
|
45
|
+
getExitCode,
|
|
46
|
+
loadAuth,
|
|
47
|
+
loadConfig2 as loadConfig,
|
|
48
|
+
parseVersionOutput,
|
|
49
|
+
parseVersionOutputFile,
|
|
50
|
+
parseVersionOutputStdin,
|
|
51
|
+
processInput,
|
|
52
|
+
renderJson,
|
|
53
|
+
renderMarkdown,
|
|
54
|
+
runPipeline,
|
|
55
|
+
saveAuth,
|
|
56
|
+
writeJson,
|
|
57
|
+
writeMarkdown,
|
|
58
|
+
writeMonorepoChangelogs
|
|
59
|
+
};
|