@vc-shell/release-config 1.2.4-beta.6 → 1.2.4-beta.7

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/README.md CHANGED
@@ -13,6 +13,7 @@ Release management system powered by Lerna for VC-Shell monorepo.
13
13
  - **Root package versioning** - root package.json stays synchronized
14
14
  - **Apps synchronization** - automatic @vc-shell/* dependency updates in apps/
15
15
  - **Initial changelog generation** - create changelogs from entire git history
16
+ - **Lockstep mode** - optional `forcePublish: true` bumps every package on each release
16
17
  - **Backward compatible** - maintains existing release script API
17
18
 
18
19
  ## Usage
@@ -24,6 +25,7 @@ import { release } from "@vc-shell/release-config";
24
25
 
25
26
  release({
26
27
  packages: [".", "framework", "cli/*", "configs/*"],
28
+ forcePublish: true,
27
29
  toTag: (version) => `v${version}`,
28
30
  bumpVersion: async (pkgName, version) => {
29
31
  // Optional: custom version bump logic (Lerna handles this automatically)
@@ -44,7 +46,7 @@ release({
44
46
  **Version bump:**
45
47
  4. Lerna analyzes git history using conventional commits
46
48
  5. Determines which packages changed
47
- 6. Updates all package versions (fixed versioning)
49
+ 6. Updates all package versions (or all packages when `forcePublish: true`)
48
50
  7. Generates CHANGELOG.md for each package
49
51
  8. Synchronizes internal dependencies automatically
50
52
  9. Creates git commit and tag
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { c as i } from "./generate-changelogs-ujWf_gXz.js";
2
+ import { h as i } from "./generate-changelogs-BPFwnUNn.js";
3
3
  import { resolve as s } from "node:path";
4
4
  import e from "chalk";
5
5
  async function l() {
@@ -0,0 +1,527 @@
1
+ import { sync as d } from "cross-spawn";
2
+ import { existsSync as N, readFileSync as E, writeFileSync as b } from "node:fs";
3
+ import C from "node:path";
4
+ import l from "chalk";
5
+ import { valid as v, rcompare as H } from "semver";
6
+ function st(t, e) {
7
+ const o = d("git", ["describe", "--tags", "--abbrev=0", "--match", `${e}${t}.*`], {
8
+ stdio: "pipe",
9
+ encoding: "utf-8"
10
+ });
11
+ return o.status === 0 && o.stdout ? o.stdout.toString().trim() : null;
12
+ }
13
+ function O() {
14
+ const t = d("git", ["remote", "get-url", "origin"], {
15
+ stdio: "pipe",
16
+ encoding: "utf-8"
17
+ });
18
+ return t.status === 0 && t.stdout ? t.stdout.toString().trim().replace(/\.git$/, "").replace(/^git@github\.com:/, "https://github.com/") : null;
19
+ }
20
+ function V(t, e, o) {
21
+ const r = ["log", "--format=%H %s", `${t}..${e}`];
22
+ o && r.push("--", o);
23
+ const i = d("git", r, {
24
+ stdio: "pipe",
25
+ encoding: "utf-8"
26
+ });
27
+ if (i.status !== 0 || !i.stdout) return [];
28
+ const n = [], s = i.stdout.toString().trim().split(`
29
+ `).filter(Boolean), c = /^(\w+)(?:\(([^)]+)\))?(!)?\s*:\s*(.+)$/;
30
+ for (const a of s) {
31
+ const g = a.indexOf(" ");
32
+ if (g === -1) continue;
33
+ const u = a.substring(0, g), p = a.substring(g + 1).match(c);
34
+ p && n.push({
35
+ hash: u,
36
+ shortHash: u.substring(0, 7),
37
+ type: p[1],
38
+ scope: p[2] || null,
39
+ subject: p[4],
40
+ breaking: !!p[3]
41
+ });
42
+ }
43
+ return n;
44
+ }
45
+ function it() {
46
+ const t = d("git", ["describe", "--tags", "--abbrev=0"], {
47
+ stdio: "pipe",
48
+ encoding: "utf-8"
49
+ });
50
+ return t.status === 0 && t.stdout ? t.stdout.toString().trim() : null;
51
+ }
52
+ function rt() {
53
+ d("git", ["add", "-u"], { stdio: "inherit" }).status !== 0 && (console.error(l.red(`
54
+ Failed to stage changes
55
+ `)), process.exit(1)), d("git", ["commit", "--amend", "--no-edit"], { stdio: "inherit" }).status !== 0 && (console.error(l.red(`
56
+ Failed to amend commit
57
+ `)), process.exit(1));
58
+ }
59
+ function ct(t) {
60
+ d("git", ["tag", "-f", "-a", t, "-m", t], { stdio: "inherit" }).status !== 0 && (console.error(l.red(`
61
+ Failed to recreate tag
62
+ `)), process.exit(1));
63
+ }
64
+ function at(t) {
65
+ console.log(l.cyan(`
66
+ Pushing changes to remote...
67
+ `)), d("git", ["push", "origin", "HEAD", "--force-with-lease"], { stdio: "inherit" }).status !== 0 && (console.error(l.red(`
68
+ Failed to push commit
69
+ `)), process.exit(1)), d("git", ["push", "origin", t, "--force"], { stdio: "inherit" }).status !== 0 && (console.error(l.red(`
70
+ Failed to push tag
71
+ `)), process.exit(1));
72
+ }
73
+ function x(t) {
74
+ const e = d("git", ["tag", "-l", `${t}*`], {
75
+ stdio: "pipe",
76
+ encoding: "utf-8"
77
+ });
78
+ return e.status !== 0 || !e.stdout ? [] : e.stdout.toString().trim().split(`
79
+ `).filter(Boolean).sort((r, i) => {
80
+ const n = v(r.startsWith(t) ? r.slice(t.length) : r), s = v(i.startsWith(t) ? i.slice(t.length) : i);
81
+ return n && s ? H(n, s) : i.localeCompare(r);
82
+ });
83
+ }
84
+ function w(t, e) {
85
+ const o = x(e), r = `${e}${t}`, i = o.indexOf(r);
86
+ if (i !== -1)
87
+ return i >= o.length - 1 ? null : o[i + 1];
88
+ const n = v(t);
89
+ if (!n)
90
+ return console.warn(l.yellow(` getPreviousVersionTag: invalid version "${t}"`)), null;
91
+ for (const s of o) {
92
+ const c = v(s.startsWith(e) ? s.slice(e.length) : s);
93
+ if (c && H(n, c) < 0)
94
+ return s;
95
+ }
96
+ return null;
97
+ }
98
+ function ut() {
99
+ const t = d("git", ["log", "-1", "--format=%s"], {
100
+ stdio: "pipe",
101
+ encoding: "utf-8"
102
+ });
103
+ return t.status === 0 && t.stdout ? t.stdout.toString().trim() : null;
104
+ }
105
+ const S = /^#{1,2}\s+(?:\[)?(\d[\da-z.-]*)(?:\])?/i, j = /\*\*Note:\*\*\s+Version bump only[^\n]*/gi;
106
+ function T(t) {
107
+ let e = t;
108
+ return e = e.replace(/^# CHANGELOG\s*\n/gm, ""), e = e.replace(/^# Change Log\s*\n/gm, ""), e = e.replace(
109
+ /^All notable changes to this (project|package) will be documented in this file\.\s*\n/gm,
110
+ ""
111
+ ), e = e.replace(
112
+ /^See \[Conventional Commits\]\(https:\/\/conventionalcommits\.org\) for commit guidelines\.\s*\n/gm,
113
+ ""
114
+ ), e = e.replace(/\n{3,}/g, `
115
+
116
+ `), e;
117
+ }
118
+ function L(t) {
119
+ return t.replace(
120
+ /^(#{1,2}\s+(?:\[[^\]]+\]|\d[\da-z.-]*)[^\n]*\n)\n(?=#{1,2}\s+(?:\[|\d)|$)/gim,
121
+ `$1
122
+ **Note:** Version bump only for package
123
+
124
+ `
125
+ );
126
+ }
127
+ function lt(t, e = !1) {
128
+ console.log(l.cyan(`
129
+ Enhancing changelogs...
130
+ `));
131
+ for (const o of t) {
132
+ const r = C.join(o.path, "CHANGELOG.md");
133
+ if (!N(r)) continue;
134
+ let i = E(r, "utf-8");
135
+ i = T(i), i = L(i), i = I(i), i = i.trim() + `
136
+ `, e || b(r, i, "utf-8");
137
+ }
138
+ }
139
+ function gt(t, e, o = !1) {
140
+ console.log(l.cyan(`
141
+ Ensuring current version entries for ${e}...
142
+ `));
143
+ let r = 0;
144
+ for (const i of t) {
145
+ const n = C.join(i.path, "CHANGELOG.md");
146
+ if (!N(n)) continue;
147
+ let s = E(n, "utf-8");
148
+ const c = e.replace(/\./g, "\\.");
149
+ if (new RegExp(`^#{1,2}\\s+\\[?${c}\\]?\\b`, "m").test(s)) continue;
150
+ const g = `## ${e}
151
+
152
+ **Note:** Version bump only for package
153
+
154
+ `, u = s.match(/^#{1,2}\s+\[?\d[\da-z.-]*\]?[^\n]*/m);
155
+ u && u.index !== void 0 ? s = s.substring(0, u.index) + g + s.substring(u.index) : s.trim() ? s = s.trimEnd() + `
156
+
157
+ ` + g : s = g, r++, o || b(n, s, "utf-8");
158
+ }
159
+ r > 0 ? console.log(l.green(` Inserted ${r} current version entr${r === 1 ? "y" : "ies"}`)) : console.log(l.gray(" All packages already have a current version entry"));
160
+ }
161
+ function ft(t, e, o = "v", r = !1) {
162
+ console.log(l.cyan(`
163
+ Supplementing current version entries for ${e}...
164
+ `));
165
+ const i = w(e, o);
166
+ if (!i) {
167
+ console.log(l.gray(" No previous release tag found; skipping current version supplementation"));
168
+ return;
169
+ }
170
+ const n = O();
171
+ let s = 0;
172
+ for (const c of t) {
173
+ const a = C.join(c.path, "CHANGELOG.md");
174
+ if (!N(a)) continue;
175
+ const g = V(i, "HEAD", c.path), u = W(g, n);
176
+ if (!u) continue;
177
+ const f = E(a, "utf-8"), p = B(f, e, u);
178
+ p !== f && (s++, r || b(a, p, "utf-8"));
179
+ }
180
+ s > 0 ? console.log(l.green(` Supplemented ${s} current version entr${s === 1 ? "y" : "ies"}`)) : console.log(l.gray(" No current version entries needed supplementation"));
181
+ }
182
+ function y(t) {
183
+ return t.replace(j, "").trim().length === 0;
184
+ }
185
+ function k(t, e, o) {
186
+ if (!e || o.length === 0) return;
187
+ const r = o.join(`
188
+ `).trim();
189
+ if (!r) return;
190
+ const i = t[e];
191
+ (!i || y(i) && !y(r)) && (t[e] = r);
192
+ }
193
+ function I(t) {
194
+ const e = t.split(`
195
+ `), o = [], r = [], i = /* @__PURE__ */ new Map();
196
+ let n = null;
197
+ const s = () => {
198
+ if (!n) return;
199
+ const c = n.lines.slice(1).join(`
200
+ `).trim(), a = i.get(n.version);
201
+ if (a === void 0) {
202
+ i.set(n.version, r.length), r.push(n), n = null;
203
+ return;
204
+ }
205
+ const u = r[a].lines.slice(1).join(`
206
+ `).trim();
207
+ y(u) && !y(c) && (r[a] = n), n = null;
208
+ };
209
+ for (const c of e) {
210
+ const a = c.match(S);
211
+ if (a) {
212
+ s(), n = { version: a[1], lines: [c] };
213
+ continue;
214
+ }
215
+ n ? n.lines.push(c) : o.push(c);
216
+ }
217
+ return s(), [...o, ...r.flatMap((c) => c.lines)].join(`
218
+ `);
219
+ }
220
+ function B(t, e, o) {
221
+ const r = e.replace(/\./g, "\\."), i = new RegExp(
222
+ `(^#{1,2}\\s+\\[?${r}\\]?[^\\n]*\\n)([\\s\\S]*?)(?=^#{1,2}\\s+\\[?\\d[\\da-z.-]*\\]?|$)`,
223
+ "m"
224
+ );
225
+ return t.replace(i, (n, s, c) => y(c) ? `${s}
226
+ ${o.trim()}
227
+
228
+ ` : n);
229
+ }
230
+ function P(t) {
231
+ const e = {}, o = {}, r = t.split(`
232
+ `);
233
+ let i = null, n = [];
234
+ for (const s of r) {
235
+ const c = s.match(S);
236
+ c ? (k(e, i, n), i = c[1], n = [], o[i] || (o[i] = s.replace(/^#{1,2}\s+/, ""))) : i && s.trim() !== "" && !s.startsWith("# CHANGELOG") && !s.startsWith("# Change Log") && !s.startsWith("All notable changes") && !s.startsWith("See [Conventional Commits]") && n.push(s);
237
+ }
238
+ return k(e, i, n), { versionContent: e, versionHeaders: o };
239
+ }
240
+ function F(t, e) {
241
+ return [...t].sort((o, r) => {
242
+ const i = R(e?.[o]), n = R(e?.[r]);
243
+ return i !== null && n !== null && i !== n ? n - i : v(o) && v(r) ? H(o, r) : r.localeCompare(o);
244
+ });
245
+ }
246
+ function R(t) {
247
+ if (!t) return null;
248
+ const e = t.match(/\((\d{4}-\d{2}-\d{2})\)\s*$/);
249
+ if (!e) return null;
250
+ const o = Date.parse(`${e[1]}T00:00:00Z`);
251
+ return Number.isNaN(o) ? null : o;
252
+ }
253
+ function D(t, e = !1) {
254
+ const { packages: o, rootDir: r = process.cwd(), includeRootHeader: i = !1 } = t;
255
+ console.log(l.cyan(`
256
+ Generating root CHANGELOG with package grouping...
257
+ `));
258
+ const n = C.join(r, "CHANGELOG.md"), s = {}, c = {};
259
+ for (const u of o) {
260
+ const f = C.join(r, u.path, "CHANGELOG.md");
261
+ if (!N(f)) continue;
262
+ const p = E(f, "utf-8"), m = P(p);
263
+ for (const [h, $] of Object.entries(m.versionContent))
264
+ s[h] || (s[h] = {}), s[h][u.displayName] = $, !c[h] && m.versionHeaders[h] && (c[h] = m.versionHeaders[h]);
265
+ }
266
+ let a = "";
267
+ i && (a = `# CHANGELOG
268
+
269
+ All notable changes to this monorepo will be documented in this file.
270
+
271
+ `);
272
+ const g = F(Object.keys(s), c);
273
+ for (const u of g) {
274
+ const f = s[u], p = Object.values(f).some(
275
+ ($) => !!$?.trim() && !y($)
276
+ ), m = c[u] || u;
277
+ if (a += `## ${m}
278
+
279
+ `, !p) {
280
+ a += `**Note:** Version bump only for package
281
+
282
+ `;
283
+ continue;
284
+ }
285
+ let h = !1;
286
+ for (const $ of o) {
287
+ const G = f[$.displayName];
288
+ G && G.trim() && (y(G) || (h = !0, a += `### ${$.displayName}
289
+
290
+ `, a += `${G}
291
+
292
+ `));
293
+ }
294
+ h || (a += `**Note:** Version bump only for package
295
+
296
+ `);
297
+ }
298
+ a = a.replace(/\n{3,}/g, `
299
+
300
+ `), a = a.trim() + `
301
+ `, e ? console.log(l.yellow(` [dry-run] Would write root CHANGELOG.md (${g.length} versions)`)) : (b(n, a, "utf-8"), console.log(l.green(" Generated root CHANGELOG.md with package grouping")));
302
+ }
303
+ const M = {
304
+ feat: "Features",
305
+ fix: "Bug Fixes",
306
+ perf: "Performance Improvements",
307
+ revert: "Reverts",
308
+ docs: "Documentation",
309
+ style: "Styles",
310
+ refactor: "Code Refactoring",
311
+ test: "Tests",
312
+ build: "Build System",
313
+ ci: "Continuous Integration"
314
+ };
315
+ function W(t, e) {
316
+ const o = {};
317
+ for (const n of t) {
318
+ const s = M[n.type];
319
+ s && (o[s] || (o[s] = []), o[s].push(n));
320
+ }
321
+ if (Object.keys(o).length === 0) return "";
322
+ let r = "";
323
+ const i = [
324
+ "Features",
325
+ "Bug Fixes",
326
+ "Performance Improvements",
327
+ "Reverts",
328
+ "Documentation",
329
+ "Styles",
330
+ "Code Refactoring",
331
+ "Tests",
332
+ "Build System",
333
+ "Continuous Integration"
334
+ ];
335
+ for (const n of i) {
336
+ const s = o[n];
337
+ if (!(!s || s.length === 0)) {
338
+ r += `### ${n}
339
+
340
+ `;
341
+ for (const c of s) {
342
+ const a = e ? `([${c.shortHash}](${e}/commit/${c.hash}))` : `(${c.shortHash})`;
343
+ r += c.scope ? `- **${c.scope}:** ${c.subject} ${a}
344
+ ` : `- ${c.subject} ${a}
345
+ `;
346
+ }
347
+ r += `
348
+ `;
349
+ }
350
+ }
351
+ return r.trim();
352
+ }
353
+ const A = [
354
+ { heading: "Features", types: ["feat"] },
355
+ { heading: "Bug Fixes", types: ["fix"] },
356
+ { heading: "Performance Improvements", types: ["perf"] },
357
+ { heading: "Reverts", types: ["revert"] },
358
+ { heading: "Documentation", types: ["docs"] },
359
+ { heading: "Styles", types: ["style"] },
360
+ { heading: "Code Refactoring", types: ["refactor"] },
361
+ { heading: "Tests", types: ["test"] },
362
+ { heading: "Build System", types: ["build"] },
363
+ { heading: "CI/CD", types: ["ci"] },
364
+ { heading: "Chores", hidden: !0, types: ["chore"] }
365
+ ], _ = new Map(
366
+ A.flatMap(
367
+ (t) => t.types.map((e) => [e, { heading: t.heading, hidden: t.hidden }])
368
+ )
369
+ );
370
+ function z(t, e, o, r) {
371
+ const i = ["log", "--format=%H %s", e ? `${e}..${t}` : t];
372
+ r && i.push("--", r);
373
+ const n = d("git", i, {
374
+ stdio: "pipe",
375
+ encoding: "utf-8",
376
+ cwd: o
377
+ });
378
+ if (n.status !== 0 || !n.stdout) return [];
379
+ const s = [], c = n.stdout.toString().trim().split(`
380
+ `).filter(Boolean), a = /^(\w+)(?:\(([^)]+)\))?(!)?\s*:\s*(.+)$/;
381
+ for (const g of c) {
382
+ const u = g.indexOf(" ");
383
+ if (u === -1) continue;
384
+ const f = g.substring(0, u), m = g.substring(u + 1).match(a);
385
+ m && s.push({
386
+ hash: f,
387
+ shortHash: f.substring(0, 7),
388
+ type: m[1],
389
+ scope: m[2] || null,
390
+ subject: m[4],
391
+ breaking: !!m[3]
392
+ });
393
+ }
394
+ return s;
395
+ }
396
+ function Y(t, e) {
397
+ const o = d("git", ["tag", "-l", `${e}*`], {
398
+ stdio: "pipe",
399
+ encoding: "utf-8",
400
+ cwd: t
401
+ });
402
+ if (o.status !== 0 || !o.stdout) return [];
403
+ const r = o.stdout.toString().trim().split(`
404
+ `).filter(Boolean), i = /* @__PURE__ */ new Map();
405
+ for (const n of r)
406
+ i.set(n, U(t, n));
407
+ return r.sort((n, s) => {
408
+ const c = i.get(n) || 0, a = i.get(s) || 0;
409
+ return c !== a ? a - c : s.localeCompare(n);
410
+ });
411
+ }
412
+ function K(t) {
413
+ const e = d("git", ["remote", "get-url", "origin"], {
414
+ stdio: "pipe",
415
+ encoding: "utf-8",
416
+ cwd: t
417
+ });
418
+ return e.status !== 0 || !e.stdout ? null : e.stdout.toString().trim().replace(/\.git$/, "").replace(/^git@github\.com:/, "https://github.com/");
419
+ }
420
+ function U(t, e) {
421
+ const o = d("git", ["log", "-1", "--format=%ct", e], {
422
+ stdio: "pipe",
423
+ encoding: "utf-8",
424
+ cwd: t
425
+ });
426
+ return o.status === 0 && o.stdout?.trim() && Number(o.stdout.trim()) || 0;
427
+ }
428
+ function Z(t, e) {
429
+ const o = d("git", ["log", "-1", "--format=%cs", e], {
430
+ stdio: "pipe",
431
+ encoding: "utf-8",
432
+ cwd: t
433
+ });
434
+ return o.status === 0 && o.stdout?.trim() ? o.stdout.trim() : "";
435
+ }
436
+ function q(t, e, o, r, i) {
437
+ const n = Z(t, o);
438
+ return i && r ? `## [${e}](${i}/compare/${r}...${o})${n ? ` (${n})` : ""}` : `## ${e}${n ? ` (${n})` : ""}`;
439
+ }
440
+ function J(t, e) {
441
+ const o = /* @__PURE__ */ new Map(), r = [];
442
+ for (const n of t) {
443
+ const s = _.get(n.type);
444
+ !s || s.hidden || (o.has(s.heading) || o.set(s.heading, []), o.get(s.heading).push(n), n.breaking && r.push(n));
445
+ }
446
+ if (o.size === 0)
447
+ return "";
448
+ const i = [];
449
+ for (const n of A) {
450
+ if (n.hidden) continue;
451
+ const s = o.get(n.heading);
452
+ if (!(!s || s.length === 0)) {
453
+ i.push(`### ${n.heading}`, "");
454
+ for (const c of s) {
455
+ const a = e ? `([${c.shortHash}](${e}/commit/${c.hash}))` : `(${c.shortHash})`;
456
+ i.push(
457
+ c.scope ? `- **${c.scope}:** ${c.subject} ${a}` : `- ${c.subject} ${a}`
458
+ );
459
+ }
460
+ i.push("");
461
+ }
462
+ }
463
+ if (r.length > 0) {
464
+ i.push("### BREAKING CHANGES", "");
465
+ for (const n of r)
466
+ i.push(n.scope ? `- **${n.scope}:** ${n.subject}` : `- ${n.subject}`);
467
+ i.push("");
468
+ }
469
+ return i.join(`
470
+ `).trim();
471
+ }
472
+ function Q(t, e, o, r) {
473
+ const i = Y(t, o), n = [];
474
+ for (let s = 0; s < i.length; s++) {
475
+ const c = i[s], a = s < i.length - 1 ? i[s + 1] : null, g = c.startsWith(o) ? c.slice(o.length) : c, u = q(t, g, c, a, r), f = z(
476
+ c,
477
+ a,
478
+ t,
479
+ C.join(t, e.path)
480
+ ), p = J(f, r);
481
+ n.push(u), n.push(""), n.push(p || "**Note:** Version bump only for package"), n.push("");
482
+ }
483
+ return n.join(`
484
+ `).trim() + `
485
+ `;
486
+ }
487
+ async function dt(t) {
488
+ const {
489
+ packages: e,
490
+ rootDir: o = process.cwd(),
491
+ generateRoot: r = !0,
492
+ includeRootHeader: i = !0,
493
+ tagVersionPrefix: n = "v"
494
+ } = t;
495
+ console.log(l.cyan(`
496
+ Generating initial CHANGELOG.md files...
497
+ `));
498
+ const s = K(o);
499
+ for (const c of e) {
500
+ const a = C.join(o, c.path, "CHANGELOG.md");
501
+ if (N(a)) {
502
+ const u = `${a}.backup`, f = E(a, "utf-8");
503
+ b(u, f, "utf-8"), console.log(l.gray(` Backed up ${a} to ${u}`));
504
+ }
505
+ console.log(l.blue(`
506
+ Generating changelog for ${c.name}...`));
507
+ const g = Q(o, c, n, s);
508
+ b(a, g, "utf-8"), console.log(l.green(` Generated ${a}`));
509
+ }
510
+ r && await D({ packages: e, rootDir: o, includeRootHeader: i }), console.log(l.green(`
511
+ Initial changelogs generated successfully!`)), console.log(l.cyan(`
512
+ Next steps:`)), console.log(l.cyan(" 1. Review the generated CHANGELOG.md files")), console.log(l.cyan(" 2. Make any manual adjustments if needed")), console.log(l.cyan(` 3. Commit the changes
513
+ `));
514
+ }
515
+ export {
516
+ gt as a,
517
+ it as b,
518
+ ut as c,
519
+ rt as d,
520
+ lt as e,
521
+ st as f,
522
+ D as g,
523
+ dt as h,
524
+ at as p,
525
+ ct as r,
526
+ ft as s
527
+ };
@@ -1,21 +1,21 @@
1
1
  import { parse as b, valid as N } from "semver";
2
- import { readFileSync as V, writeFileSync as x } from "node:fs";
2
+ import { readFileSync as P, writeFileSync as $ } from "node:fs";
3
3
  import R from "node:path";
4
- import $ from "mri";
4
+ import T from "mri";
5
5
  import { argv as D } from "node:process";
6
6
  import n from "chalk";
7
- import { sync as f } from "cross-spawn";
8
- import d from "prompts";
9
- import { f as T, e as I, b as E, d as L, g as S, a as j, s as U, r as J, p as O } from "./generate-changelogs-ujWf_gXz.js";
10
- import { c as le } from "./generate-changelogs-ujWf_gXz.js";
11
- const l = $(D.slice(2));
12
- l.dry;
13
- function v(t) {
7
+ import { sync as h } from "cross-spawn";
8
+ import y from "prompts";
9
+ import { f as E, e as I, a as L, s as S, g as j, b as H, c as U, d as F, r as J, p as M } from "./generate-changelogs-BPFwnUNn.js";
10
+ import { h as ge } from "./generate-changelogs-BPFwnUNn.js";
11
+ const c = T(D.slice(2));
12
+ c.dry;
13
+ function w(t) {
14
14
  const o = R.resolve(t), e = R.resolve(o, "package.json");
15
- return { pkg: JSON.parse(V(e, "utf-8")), pkgDir: o, pkgPath: e };
15
+ return { pkg: JSON.parse(P(e, "utf-8")), pkgDir: o, pkgPath: e };
16
16
  }
17
- async function F() {
18
- const { releaseType: t } = await d({
17
+ async function O() {
18
+ const { releaseType: t } = await y({
19
19
  type: "select",
20
20
  name: "releaseType",
21
21
  message: "Select release type",
@@ -29,7 +29,7 @@ async function F() {
29
29
  return t;
30
30
  }
31
31
  async function G(t) {
32
- const o = b(t), e = o && o.prerelease.length > 0, s = e ? o.prerelease[0] : null, { preid: i } = await d({
32
+ const o = b(t), e = o && o.prerelease.length > 0, s = e ? o.prerelease[0] : null, { preid: a } = await y({
33
33
  type: "select",
34
34
  name: "preid",
35
35
  message: "Select prerelease identifier",
@@ -48,11 +48,11 @@ async function G(t) {
48
48
  }
49
49
  ]
50
50
  });
51
- if (i)
52
- return e && s === i ? { preid: i, lernaVersionArg: "prerelease", lernaPreidArgs: [] } : { preid: i, lernaVersionArg: "prerelease", lernaPreidArgs: ["--preid", i] };
51
+ if (a)
52
+ return e && s === a ? { preid: a, lernaVersionArg: "prerelease", lernaPreidArgs: [] } : { preid: a, lernaVersionArg: "prerelease", lernaPreidArgs: ["--preid", a] };
53
53
  }
54
- async function H(t) {
55
- const { customVersion: o } = await d({
54
+ async function B(t) {
55
+ const { customVersion: o } = await y({
56
56
  type: "text",
57
57
  name: "customVersion",
58
58
  message: "Enter custom version",
@@ -61,63 +61,63 @@ async function H(t) {
61
61
  });
62
62
  return o;
63
63
  }
64
- async function B() {
65
- const { yes: t } = await d({
64
+ async function W() {
65
+ const { yes: t } = await y({
66
66
  type: "confirm",
67
67
  name: "yes",
68
68
  message: "Ready to release. Continue?"
69
69
  });
70
70
  return !!t;
71
71
  }
72
- function u() {
72
+ function d() {
73
73
  console.log(n.yellow(`
74
74
  Release cancelled
75
75
  `));
76
76
  }
77
- function M(t, o) {
77
+ function Y(t, o) {
78
78
  const e = ["lerna", "version", ...t];
79
79
  return e.push("--conventional-commits"), e.push("--tag-version-prefix", o.tagVersionPrefix), e.push("--no-push"), o.isDryRun && e.push("--no-git-tag-version"), o.forcePublish && (e.push("--force-publish"), console.log(n.yellow(`
80
80
  Force publish mode - all packages will be versioned
81
81
  `))), e;
82
82
  }
83
- function Y(t) {
83
+ function q(t) {
84
84
  console.log(n.cyan(`
85
85
  Running: npx ${t.join(" ")}
86
86
  `));
87
- const o = f("npx", t, { stdio: "inherit" });
87
+ const o = h("npx", t, { stdio: "inherit" });
88
88
  o.status !== 0 && (console.error(n.red(`
89
89
  Release process failed
90
90
  `)), process.exit(o.status || 1));
91
91
  }
92
- function q(t) {
92
+ function z(t) {
93
93
  const o = {};
94
94
  for (const e of t) {
95
- const { pkg: s } = v(e.path);
95
+ const { pkg: s } = w(e.path);
96
96
  o[e.path] = s.version;
97
97
  }
98
98
  return o;
99
99
  }
100
- function z(t, o) {
100
+ function K(t, o) {
101
101
  for (const e of t) {
102
- const { pkg: s } = v(e.path);
102
+ const { pkg: s } = w(e.path);
103
103
  if (s.version !== o[e.path])
104
104
  return s.version;
105
105
  }
106
106
  return null;
107
107
  }
108
- function K(t, o, e) {
108
+ function Q(t, o, e) {
109
109
  if (console.log(n.gray(`
110
110
  --- Release diagnostics ---`)), console.log(n.gray(` tagVersionPrefix: "${t}"`)), console.log(n.gray(` looking for tags: ${t}${o}.*`)), e) {
111
- const s = f("git", ["rev-list", "--count", `${e}..HEAD`], {
111
+ const s = h("git", ["rev-list", "--count", `${e}..HEAD`], {
112
112
  stdio: "pipe",
113
113
  encoding: "utf-8"
114
- }), i = s.status === 0 ? s.stdout.trim() : "?", a = f(
114
+ }), a = s.status === 0 ? s.stdout.trim() : "?", f = h(
115
115
  "git",
116
116
  ["log", `${e}..HEAD`, "--oneline", "--grep", "^feat\\|^fix\\|^perf\\|^revert"],
117
117
  { stdio: "pipe", encoding: "utf-8" }
118
- ), g = a.status === 0 ? a.stdout.trim().split(`
118
+ ), i = f.status === 0 ? f.stdout.trim().split(`
119
119
  `).filter(Boolean).length : 0;
120
- console.log(n.gray(` last matching tag: ${e}`)), console.log(n.gray(` commits since tag: ${i}`)), console.log(n.gray(` conventional commits: ${g}`)), g === 0 && parseInt(i) > 0 && console.log(
120
+ console.log(n.gray(` last matching tag: ${e}`)), console.log(n.gray(` commits since tag: ${a}`)), console.log(n.gray(` conventional commits: ${i}`)), i === 0 && parseInt(a) > 0 && console.log(
121
121
  n.yellow(
122
122
  " No conventional commits found. Use --force to publish anyway."
123
123
  )
@@ -127,68 +127,69 @@ function K(t, o, e) {
127
127
  console.log(n.gray(`---------------------------
128
128
  `));
129
129
  }
130
- async function re(t) {
130
+ async function ie(t) {
131
131
  const {
132
132
  packages: o,
133
133
  tagVersionPrefix: e = "v",
134
134
  customHooks: s,
135
- updateRootVersion: i = !0
135
+ updateRootVersion: a = !0,
136
+ forcePublish: f = !1
136
137
  } = t;
137
138
  if (o.length === 0)
138
139
  throw new Error("No packages to release");
139
- const a = !!l.dry;
140
- a && console.log(n.yellow(`
140
+ const i = !!c.dry;
141
+ i && console.log(n.yellow(`
141
142
  DRY RUN MODE - No git operations will be performed
142
143
  `));
143
- const { pkg: g } = v(o[0].path), m = g.version, k = m.split(".").slice(0, 2).join("."), P = T(k, e);
144
- K(e, k, P);
145
- const c = await F();
146
- if (!c) return u();
147
- const p = [];
148
- if (c !== "auto") {
149
- if (c === "prerelease") {
150
- const r = await G(m);
151
- if (!r) return u();
152
- p.push(r.lernaVersionArg, ...r.lernaPreidArgs), l.tag || (l.tag = r.preid);
153
- } else if (c === "graduate")
154
- p.push("--conventional-graduate");
155
- else if (c === "custom") {
156
- const r = await H(m);
157
- if (!r) return u();
158
- p.push(r);
159
- const h = b(r);
160
- if (h && h.prerelease.length > 0 && !l.tag) {
161
- const w = h.prerelease[0];
162
- typeof w == "string" && (l.tag = w);
144
+ const { pkg: V } = w(o[0].path), v = V.version, k = v.split(".").slice(0, 2).join("."), A = E(k, e);
145
+ Q(e, k, A);
146
+ const g = await O();
147
+ if (!g) return d();
148
+ const m = [];
149
+ if (g !== "auto") {
150
+ if (g === "prerelease") {
151
+ const r = await G(v);
152
+ if (!r) return d();
153
+ m.push(r.lernaVersionArg, ...r.lernaPreidArgs), c.tag || (c.tag = r.preid);
154
+ } else if (g === "graduate")
155
+ m.push("--conventional-graduate");
156
+ else if (g === "custom") {
157
+ const r = await B(v);
158
+ if (!r) return d();
159
+ m.push(r);
160
+ const l = b(r);
161
+ if (l && l.prerelease.length > 0 && !c.tag) {
162
+ const u = l.prerelease[0];
163
+ typeof u == "string" && (c.tag = u);
163
164
  }
164
165
  }
165
166
  }
166
- if (!await B()) return u();
167
- const A = M(p, {
167
+ if (!await W()) return d();
168
+ const C = Y(m, {
168
169
  tagVersionPrefix: e,
169
- isDryRun: a,
170
- forcePublish: !!l.force
171
- }), C = q(o);
172
- Y(A);
173
- const y = z(o, C);
174
- if (!y) {
170
+ isDryRun: i,
171
+ forcePublish: f || !!c.force
172
+ }), x = z(o);
173
+ q(C);
174
+ const p = K(o, x);
175
+ if (!p) {
175
176
  console.log(n.yellow(`
176
177
  No packages were versioned. Nothing to release.
177
178
  `));
178
179
  return;
179
180
  }
180
- if (i && Q(y, a), s && (console.log(n.cyan(`
181
+ if (a && X(p), s && (console.log(n.cyan(`
181
182
  Running post-version hooks...
182
- `)), await s(y)), !a) {
183
+ `)), await s(p)), !i) {
183
184
  console.log(n.cyan(`
184
185
  Updating yarn.lock with new package versions...
185
186
  `));
186
- const r = f("yarn", ["install"], { stdio: "inherit" });
187
+ const r = h("yarn", ["install"], { stdio: "inherit" });
187
188
  r.status !== 0 && (console.error(n.red(`
188
189
  Failed to update yarn.lock
189
190
  `)), process.exit(r.status || 1));
190
191
  }
191
- if (I(o, a), E(o, e, a), L(o, a), S({ packages: o }, a), a)
192
+ if (I(o, !1), L(o, p, !1), S(o, p, e, !1), j({ packages: o }, !1), i)
192
193
  console.log(n.yellow(`
193
194
  Dry run completed successfully!
194
195
  `)), console.log(n.cyan("Changes made:")), console.log(n.cyan(" - Updated package versions")), console.log(n.cyan(` - Generated/updated CHANGELOG.md files
@@ -196,22 +197,32 @@ Dry run completed successfully!
196
197
  `)), console.log(n.yellow("To revert all changes:")), console.log(n.cyan(` git checkout -- .
197
198
  `));
198
199
  else {
199
- const r = j();
200
+ const r = H();
200
201
  r || (console.error(n.red(`
201
202
  Could not determine the git tag created by Lerna
202
- `)), process.exit(1)), U(), J(r), O(r), console.log(n.green(`
203
+ `)), process.exit(1));
204
+ const l = U(), u = `release: ${e}`;
205
+ (!l || !l.startsWith(u)) && (console.error(
206
+ n.red(
207
+ `
208
+ Tag validation failed: HEAD commit message "${l}" does not match expected pattern "${u}*".
209
+ This may indicate extra commits were made after Lerna's release commit.
210
+ Aborting to prevent amending/tagging the wrong commit.
211
+ `
212
+ )
213
+ ), process.exit(1)), F(), J(r), M(r), console.log(n.green(`
203
214
  Release completed successfully!
204
215
  `)), console.log(n.cyan(`npmTag will be automatically determined from git tag in CI
205
216
  `));
206
217
  }
207
218
  }
208
- function Q(t, o) {
209
- const e = "package.json", s = JSON.parse(V(e, "utf-8"));
210
- s.version !== t && (s.version = t, o || x(e, JSON.stringify(s, null, 2) + `
219
+ function X(t, o) {
220
+ const e = "package.json", s = JSON.parse(P(e, "utf-8"));
221
+ s.version !== t && (s.version = t, $(e, JSON.stringify(s, null, 2) + `
211
222
  `, "utf-8"), console.log(n.gray(` Updated root package.json version: ${t}`)));
212
223
  }
213
224
  export {
214
- le as generateInitialChangelogs,
215
- S as generateRootChangelog,
216
- re as release
225
+ ge as generateInitialChangelogs,
226
+ j as generateRootChangelog,
227
+ ie as release
217
228
  };
@@ -13,10 +13,22 @@ export declare function addVersionBumpNotes(content: string): string;
13
13
  */
14
14
  export declare function enhancePackageChangelogs(packages: PackageConfig[], dryRun?: boolean): void;
15
15
  /**
16
- * Sorts version strings in descending order using semver.rcompare.
17
- * Falls back to string comparison for non-semver strings.
16
+ * Ensures each package has an entry for the current release version.
17
+ * If Lerna skipped a package because it had no direct changes, we still add
18
+ * a placeholder section for the version so lockstep releases stay aligned.
18
19
  */
19
- export declare function sortVersionsDescending(versions: string[]): string[];
20
+ export declare function ensureCurrentVersionEntries(packages: PackageConfig[], version: string, dryRun?: boolean): void;
21
+ /**
22
+ * Replaces "Version bump only" current sections with git-derived changelog
23
+ * entries when a package had only non-default conventional commit types
24
+ * (e.g. refactor/docs/build) that Lerna omitted from the package changelog.
25
+ */
26
+ export declare function supplementCurrentVersionEntries(packages: PackageConfig[], version: string, tagVersionPrefix?: string, dryRun?: boolean): void;
27
+ /**
28
+ * Sorts version strings in descending order by release date when available.
29
+ * Falls back to semver.rcompare, then string comparison.
30
+ */
31
+ export declare function sortVersionsDescending(versions: string[], versionHeaders?: Record<string, string>): string[];
20
32
  /**
21
33
  * Generates a consolidated root CHANGELOG.md from package changelogs,
22
34
  * grouped by version with sub-headings per package.
@@ -37,4 +49,27 @@ export declare function backfillEmptyVersions(packages: PackageConfig[], tagPref
37
49
  * that were already recorded in backfilled older versions.
38
50
  */
39
51
  export declare function deduplicateChangelog(packages: PackageConfig[], dryRun?: boolean): void;
52
+ /**
53
+ * Inserts missing version entries into package CHANGELOGs.
54
+ *
55
+ * In Lerna fixed-mode, packages with no changes sometimes don't get
56
+ * a CHANGELOG entry even though a version tag exists. This function
57
+ * compares git tags with CHANGELOG headers and inserts missing entries
58
+ * with a "Version bump only" placeholder, so that `backfillEmptyVersions`
59
+ * can then attempt to fill them with actual commits.
60
+ */
61
+ export declare function insertMissingVersionEntries(packages: PackageConfig[], tagPrefix: string, dryRun?: boolean): void;
62
+ /**
63
+ * Supplements version sections that have SOME content but are missing commits
64
+ * present in the git tag range.
65
+ *
66
+ * For each version section with content, compares commit short hashes in the
67
+ * CHANGELOG against commits in the actual git range (previous_tag..version_tag).
68
+ * Appends any missing commits to the existing section.
69
+ *
70
+ * This handles the case where Lerna recorded some commits but the tag includes
71
+ * additional commits made after the CHANGELOG was generated (e.g. post-release
72
+ * fixes amended into the release commit).
73
+ */
74
+ export declare function supplementIncompleteVersions(packages: PackageConfig[], tagPrefix: string, dryRun?: boolean): void;
40
75
  //# sourceMappingURL=changelog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../src/changelog.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAYjF;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAc7D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,O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AM,UAAQ,GACb,IAAI,CAoCN;AAqJD;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAAE,EAClB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACtC,MAAM,EAAE,CAcV;AAcD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAQ,GAAG,IAAI,CAkFzF;AA4ED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,aAAa,EAAE,EACzB,SAAS,EAAE,MAAM,EACjB,MAAM,UAAQ,GACb,IAAI,CAqDN;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE,MAAM,UAAQ,GAAG,IAAI,CA6EpF;AAID;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,aAAa,EAAE,EACzB,SAAS,EAAE,MAAM,EACjB,MAAM,UAAQ,GACb,IAAI,CAsEN;AAID;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,aAAa,EAAE,EACzB,SAAS,EAAE,MAAM,EACjB,MAAM,UAAQ,GACb,IAAI,CAmFN"}
@@ -1 +1 @@
1
- {"version":3,"file":"generate-changelogs.d.ts","sourceRoot":"","sources":["../../src/generate-changelogs.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,qBAAqB,EACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAGtF,YAAY,EAAE,aAAa,EAAE,yBAAyB,EAAE,CAAC;AAEzD;;;GAGG;AACH,wBAAsB,yBAAyB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0DjG;AAGD,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
1
+ {"version":3,"file":"generate-changelogs.d.ts","sourceRoot":"","sources":["../../src/generate-changelogs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAGtF,YAAY,EAAE,aAAa,EAAE,yBAAyB,EAAE,CAAC;AAqPzD;;;GAGG;AACH,wBAAsB,yBAAyB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuCjG;AAGD,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
package/dist/src/git.d.ts CHANGED
@@ -51,4 +51,20 @@ export declare function recreateAnnotatedTag(tag: string): void;
51
51
  * Uses --force-with-lease for the commit (safe force) and --force for the tag.
52
52
  */
53
53
  export declare function pushToRemote(tag: string): void;
54
+ /**
55
+ * Returns all version tags matching the given prefix, sorted by semver descending.
56
+ * Example: getAllVersionTags("v") → ["v1.2.4-beta.6", "v1.2.4-beta.5", ...]
57
+ */
58
+ export declare function getAllVersionTags(prefix: string): string[];
59
+ /**
60
+ * Given a version string, finds the immediately preceding version TAG.
61
+ * Uses semver sorting on all tags matching the prefix.
62
+ * Works even when the target tag does not exist yet (e.g. during dry-run).
63
+ * Example: getPreviousVersionTag("1.2.4-beta.5", "v") → "v1.2.4-beta.4"
64
+ */
65
+ export declare function getPreviousVersionTag(version: string, prefix: string): string | null;
66
+ /**
67
+ * Gets the commit message of HEAD.
68
+ */
69
+ export declare function getHeadCommitMessage(): string | null;
54
70
  //# sourceMappingURL=git.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/git.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUxF;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,MAAM,GAAG,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3D;;;GAGG;AACH,wBAAsB,OAAO,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAuIlE"}
1
+ {"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../src/release.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AA8B3D;;;GAGG;AACH,wBAAsB,OAAO,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAwJlE"}
@@ -18,12 +18,16 @@ export interface ReleaseConfig {
18
18
  customHooks?: (version: string) => void | Promise<void>;
19
19
  /** Whether to sync root package.json version with packages (default true). */
20
20
  updateRootVersion?: boolean;
21
+ /** Whether to version every package on each release (default false). */
22
+ forcePublish?: boolean;
21
23
  }
22
24
  export interface ChangelogGeneratorOptions {
23
25
  packages: PackageConfig[];
24
26
  rootDir?: string;
25
27
  generateRoot?: boolean;
26
28
  includeRootHeader?: boolean;
29
+ /** Git tag prefix used to identify release tags (default "v"). */
30
+ tagVersionPrefix?: string;
27
31
  }
28
32
  export interface RootChangelogOptions {
29
33
  packages: PackageConfig[];
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,2FAA2F;IAC3F,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uEAAuE;IACvE,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,8EAA8E;IAC9E,iBAAiB,CAAC,EAAE,OAAO,C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E,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vc-shell/release-config",
3
- "version": "1.2.4-beta.6",
3
+ "version": "1.2.4-beta.7",
4
4
  "type": "module",
5
5
  "main": "dist/release-config.js",
6
6
  "types": "./dist/src/index.d.ts",
@@ -34,5 +34,5 @@
34
34
  "access": "public",
35
35
  "registry": "https://registry.npmjs.org/"
36
36
  },
37
- "gitHead": "86734c47306da89feb6b16685287744bb2855cc8"
37
+ "gitHead": "cc6ef5c98d3f8b6489126a950e994335016ea35d"
38
38
  }
@@ -1,352 +0,0 @@
1
- import { sync as p } from "cross-spawn";
2
- import { existsSync as v, readFileSync as G, writeFileSync as H } from "node:fs";
3
- import $ from "node:path";
4
- import a from "chalk";
5
- import { valid as R, rcompare as j } from "semver";
6
- function _(e, t) {
7
- const s = p("git", ["describe", "--tags", "--abbrev=0", "--match", `${t}${e}.*`], {
8
- stdio: "pipe",
9
- encoding: "utf-8"
10
- });
11
- return s.status === 0 && s.stdout ? s.stdout.toString().trim() : null;
12
- }
13
- function x() {
14
- const e = p("git", ["remote", "get-url", "origin"], {
15
- stdio: "pipe",
16
- encoding: "utf-8"
17
- });
18
- return e.status === 0 && e.stdout ? e.stdout.toString().trim().replace(/\.git$/, "").replace(/^git@github\.com:/, "https://github.com/") : null;
19
- }
20
- function V(e) {
21
- return p("git", ["rev-parse", "--verify", `refs/tags/${e}`], {
22
- stdio: "pipe"
23
- }).status === 0;
24
- }
25
- function F(e) {
26
- return p("git", ["merge-base", "--is-ancestor", e, "HEAD"], {
27
- stdio: "pipe"
28
- }).status === 0;
29
- }
30
- function P(e, t) {
31
- const s = p("git", ["merge-base", e, t], {
32
- stdio: "pipe",
33
- encoding: "utf-8"
34
- });
35
- return s.status === 0 && s.stdout ? s.stdout.toString().trim() : null;
36
- }
37
- function S(e, t, s) {
38
- const l = ["log", "--format=%H %s", `${e}..${t}`];
39
- s && l.push("--", s);
40
- const r = p("git", l, {
41
- stdio: "pipe",
42
- encoding: "utf-8"
43
- });
44
- if (r.status !== 0 || !r.stdout) return [];
45
- const i = [], n = r.stdout.toString().trim().split(`
46
- `).filter(Boolean), c = /^(\w+)(?:\(([^)]+)\))?(!)?\s*:\s*(.+)$/;
47
- for (const o of n) {
48
- const h = o.indexOf(" ");
49
- if (h === -1) continue;
50
- const d = o.substring(0, h), m = o.substring(h + 1).match(c);
51
- m && i.push({
52
- hash: d,
53
- shortHash: d.substring(0, 7),
54
- type: m[1],
55
- scope: m[2] || null,
56
- subject: m[4],
57
- breaking: !!m[3]
58
- });
59
- }
60
- return i;
61
- }
62
- function J() {
63
- const e = p("git", ["describe", "--tags", "--abbrev=0"], {
64
- stdio: "pipe",
65
- encoding: "utf-8"
66
- });
67
- return e.status === 0 && e.stdout ? e.stdout.toString().trim() : null;
68
- }
69
- function K() {
70
- p("git", ["add", "-u"], { stdio: "inherit" }).status !== 0 && (console.error(a.red(`
71
- Failed to stage changes
72
- `)), process.exit(1)), p("git", ["commit", "--amend", "--no-edit"], { stdio: "inherit" }).status !== 0 && (console.error(a.red(`
73
- Failed to amend commit
74
- `)), process.exit(1));
75
- }
76
- function Q(e) {
77
- p("git", ["tag", "-f", "-a", e, "-m", e], { stdio: "inherit" }).status !== 0 && (console.error(a.red(`
78
- Failed to recreate tag
79
- `)), process.exit(1));
80
- }
81
- function X(e) {
82
- console.log(a.cyan(`
83
- Pushing changes to remote...
84
- `)), p("git", ["push", "origin", "HEAD", "--force-with-lease"], { stdio: "inherit" }).status !== 0 && (console.error(a.red(`
85
- Failed to push commit
86
- `)), process.exit(1)), p("git", ["push", "origin", e, "--force"], { stdio: "inherit" }).status !== 0 && (console.error(a.red(`
87
- Failed to push tag
88
- `)), process.exit(1));
89
- }
90
- function O(e) {
91
- let t = e;
92
- return t = t.replace(/^# CHANGELOG\s*\n/gm, ""), t = t.replace(/^# Change Log\s*\n/gm, ""), t = t.replace(
93
- /^All notable changes to this (project|package) will be documented in this file\.\s*\n/gm,
94
- ""
95
- ), t = t.replace(
96
- /^See \[Conventional Commits\]\(https:\/\/conventionalcommits\.org\) for commit guidelines\.\s*\n/gm,
97
- ""
98
- ), t = t.replace(/\n{3,}/g, `
99
-
100
- `), t;
101
- }
102
- function L(e) {
103
- return e.replace(
104
- /^(##\s+\[[^\]]+\][^\n]*\n)\n(##\s+\[|$)/gm,
105
- `$1
106
- **Note:** Version bump only for package
107
-
108
- $2`
109
- );
110
- }
111
- function Z(e, t = !1) {
112
- console.log(a.cyan(`
113
- Enhancing changelogs...
114
- `));
115
- for (const s of e) {
116
- const l = $.join(s.path, "CHANGELOG.md");
117
- if (!v(l)) continue;
118
- let r = G(l, "utf-8");
119
- r = O(r), r = L(r), r = r.trim() + `
120
- `, t || H(l, r, "utf-8");
121
- }
122
- }
123
- function B(e) {
124
- const t = {}, s = {}, l = e.split(`
125
- `);
126
- let r = null, i = [];
127
- for (const n of l) {
128
- const c = n.match(/^##\s+(?:\[)?([\d.a-z-]+)(?:\])?(?:\s+\([^)]+\))?/i);
129
- c ? (r && i.length > 0 && (t[r] = i.join(`
130
- `).trim()), r = c[1], i = [], s[r] || (s[r] = n.replace(/^##\s+/, ""))) : r && n.trim() !== "" && !n.startsWith("# CHANGELOG") && !n.startsWith("# Change Log") && !n.startsWith("All notable changes") && !n.startsWith("See [Conventional Commits]") && i.push(n);
131
- }
132
- return r && i.length > 0 && (t[r] = i.join(`
133
- `).trim()), { versionContent: t, versionHeaders: s };
134
- }
135
- function D(e) {
136
- return [...e].sort((t, s) => R(t) && R(s) ? j(t, s) : s.localeCompare(t));
137
- }
138
- function I(e, t = !1) {
139
- const { packages: s, rootDir: l = process.cwd(), includeRootHeader: r = !1 } = e;
140
- console.log(a.cyan(`
141
- Generating root CHANGELOG with package grouping...
142
- `));
143
- const i = $.join(l, "CHANGELOG.md"), n = {}, c = {};
144
- for (const d of s) {
145
- const f = $.join(l, d.path, "CHANGELOG.md");
146
- if (!v(f)) continue;
147
- const m = G(f, "utf-8"), y = B(m);
148
- for (const [u, b] of Object.entries(y.versionContent))
149
- n[u] || (n[u] = {}), n[u][d.displayName] = b, !c[u] && y.versionHeaders[u] && (c[u] = y.versionHeaders[u]);
150
- }
151
- let o = "";
152
- r && (o = `# CHANGELOG
153
-
154
- All notable changes to this monorepo will be documented in this file.
155
-
156
- `);
157
- const h = D(Object.keys(n));
158
- for (const d of h) {
159
- const f = n[d], m = Object.values(f).some((b) => !b || !b.trim() ? !1 : b.replace(/\*\*Note:\*\*\s+Version bump only[^\n]*/gi, "").trim().length > 0), y = c[d] || d;
160
- if (o += `## ${y}
161
-
162
- `, !m) {
163
- o += `**Note:** Version bump only for package
164
-
165
- `;
166
- continue;
167
- }
168
- let u = !1;
169
- for (const b of s) {
170
- const C = f[b.displayName];
171
- C && C.trim() && C.replace(/\*\*Note:\*\*\s+Version bump only[^\n]*/gi, "").trim().length > 0 && (u = !0, o += `### ${b.displayName}
172
-
173
- `, o += `${C}
174
-
175
- `);
176
- }
177
- u || (o += `**Note:** Version bump only for package
178
-
179
- `);
180
- }
181
- o = o.replace(/\n{3,}/g, `
182
-
183
- `), o = o.trim() + `
184
- `, t ? console.log(a.yellow(` [dry-run] Would write root CHANGELOG.md (${h.length} versions)`)) : (H(i, o, "utf-8"), console.log(a.green(" Generated root CHANGELOG.md with package grouping")));
185
- }
186
- const T = {
187
- feat: "Features",
188
- fix: "Bug Fixes",
189
- perf: "Performance Improvements",
190
- revert: "Reverts"
191
- };
192
- function N(e) {
193
- return V(e) ? F(e) ? e : P(e, "HEAD") : null;
194
- }
195
- function W(e, t) {
196
- const s = {};
197
- for (const i of e) {
198
- const n = T[i.type];
199
- n && (s[n] || (s[n] = []), s[n].push(i));
200
- }
201
- if (Object.keys(s).length === 0) return "";
202
- let l = "";
203
- const r = ["Features", "Bug Fixes", "Performance Improvements", "Reverts"];
204
- for (const i of r) {
205
- const n = s[i];
206
- if (!(!n || n.length === 0)) {
207
- l += `### ${i}
208
-
209
- `;
210
- for (const c of n) {
211
- const o = t ? `([${c.shortHash}](${t}/commit/${c.hash}))` : `(${c.shortHash})`;
212
- l += c.scope ? `- **${c.scope}:** ${c.subject} ${o}
213
- ` : `- ${c.subject} ${o}
214
- `;
215
- }
216
- l += `
217
- `;
218
- }
219
- }
220
- return l.trim();
221
- }
222
- function ee(e, t, s = !1) {
223
- console.log(a.cyan(`
224
- Backfilling empty changelog versions...
225
- `));
226
- const l = x();
227
- let r = 0;
228
- for (const i of e) {
229
- const n = $.join(i.path, "CHANGELOG.md");
230
- if (!v(n)) continue;
231
- let c = G(n, "utf-8");
232
- const o = [];
233
- for (const f of c.matchAll(/^##\s+\[?([\d.a-z-]+)\]?/gm))
234
- o.push(f[1]);
235
- const h = /^(##\s+\[?([\d.a-z-]+)\]?[^\n]*\n)\n\*\*Note:\*\*\s+Version bump only[^\n]*/gm;
236
- let d = !1;
237
- c = c.replace(h, (f, m, y) => {
238
- const u = o.indexOf(y);
239
- if (u === -1) return f;
240
- const b = u < o.length - 1 ? o[u + 1] : null;
241
- if (!b) return f;
242
- const C = N(`${t}${b}`);
243
- if (!C) return f;
244
- let g = N(`${t}${y}`);
245
- if (!g) {
246
- const A = u > 0 ? o[u - 1] : null;
247
- g = A ? N(`${t}${A}`) : null, g || (g = "HEAD");
248
- }
249
- if (C === g) return f;
250
- const w = S(C, g, i.path).filter((A) => !c.includes(A.shortHash)), E = W(w, l);
251
- return E ? (d = !0, r++, console.log(a.gray(` Backfilled ${i.name} v${y} (${w.length} commits)`)), `${m}
252
- ${E}`) : f;
253
- }), d && !s && H(n, c, "utf-8");
254
- }
255
- r > 0 ? console.log(a.green(` Backfilled ${r} empty changelog version(s)`)) : console.log(a.gray(" No empty versions to backfill"));
256
- }
257
- function te(e, t = !1) {
258
- for (const s of e) {
259
- const l = $.join(s.path, "CHANGELOG.md");
260
- if (!v(l)) continue;
261
- const r = G(l, "utf-8"), i = [], n = /^(##\s+\[?[\d.a-z-]+\]?[^\n]*)\n/gm;
262
- let c = 0, o = "";
263
- for (const g of r.matchAll(n))
264
- o && i.push({ header: o, body: r.substring(c, g.index) }), o = g[1], c = g.index + g[0].length;
265
- if (o && i.push({ header: o, body: r.substring(c) }), i.length < 2) continue;
266
- const h = /\[([a-f0-9]{7})\]\(/g, d = /* @__PURE__ */ new Set();
267
- for (let g = 1; g < i.length; g++)
268
- for (const k of i[g].body.matchAll(h))
269
- d.add(k[1]);
270
- if (d.size === 0) continue;
271
- const f = i[0].body, m = f.split(`
272
- `).filter((g) => {
273
- if (!g.startsWith("- ")) return !0;
274
- const k = g.match(/\[([a-f0-9]{7})\]\(/);
275
- return !k || !d.has(k[1]);
276
- }), y = m.join(`
277
- `);
278
- if (y === f) continue;
279
- i[0].body = y;
280
- let u = "";
281
- for (const g of i)
282
- u += `${g.header}
283
- ${g.body}`;
284
- u = u.replace(/\n{3,}/g, `
285
-
286
- `).trim() + `
287
- `, i[0].body.replace(/###[^\n]*/g, "").trim() || (u = u.replace(
288
- i[0].body,
289
- `
290
- **Note:** Version bump only for package
291
-
292
- `
293
- )), t || H(l, u, "utf-8");
294
- const C = f.split(`
295
- `).length - m.length;
296
- C > 0 && console.log(a.gray(` Deduplicated ${s.name}: removed ${C} duplicate entries`));
297
- }
298
- }
299
- async function ne(e) {
300
- const { packages: t, rootDir: s = process.cwd(), generateRoot: l = !0, includeRootHeader: r = !0 } = e;
301
- console.log(a.cyan(`
302
- Generating initial CHANGELOG.md files...
303
- `));
304
- for (const i of t) {
305
- const n = $.join(s, i.path, "CHANGELOG.md");
306
- if (v(n)) {
307
- const o = `${n}.backup`, h = G(n, "utf-8");
308
- H(o, h, "utf-8"), console.log(a.gray(` Backed up ${n} to ${o}`));
309
- }
310
- if (console.log(a.blue(`
311
- Generating changelog for ${i.name}...`)), p(
312
- "npx",
313
- [
314
- "conventional-changelog",
315
- "-p",
316
- "conventionalcommits",
317
- "-i",
318
- n,
319
- "-s",
320
- "-r",
321
- "0",
322
- "--commit-path",
323
- $.join(s, i.path)
324
- ],
325
- { stdio: "inherit", cwd: s }
326
- ).status === 0) {
327
- if (v(n)) {
328
- let o = G(n, "utf-8");
329
- o = O(o), o = L(o), o = o.trim() + `
330
- `, H(n, o, "utf-8");
331
- }
332
- console.log(a.green(` Generated ${n}`));
333
- } else
334
- console.log(a.red(` Failed to generate ${n}`));
335
- }
336
- l && await I({ packages: t, rootDir: s, includeRootHeader: r }), console.log(a.green(`
337
- Initial changelogs generated successfully!`)), console.log(a.cyan(`
338
- Next steps:`)), console.log(a.cyan(" 1. Review the generated CHANGELOG.md files")), console.log(a.cyan(" 2. Make any manual adjustments if needed")), console.log(a.cyan(` 3. Commit the changes
339
- `));
340
- }
341
- export {
342
- J as a,
343
- ee as b,
344
- ne as c,
345
- te as d,
346
- Z as e,
347
- _ as f,
348
- I as g,
349
- X as p,
350
- Q as r,
351
- K as s
352
- };