@vc-shell/release-config 1.2.4-beta.7 → 2.0.0-alpha.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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { h as i } from "./generate-changelogs-BPFwnUNn.js";
2
+ import { h as i } from "./generate-changelogs-CiQDT33J.js";
3
3
  import { resolve as s } from "node:path";
4
4
  import e from "chalk";
5
5
  async function l() {
@@ -1,26 +1,37 @@
1
- import { sync as d } from "cross-spawn";
1
+ import { sync as f } from "cross-spawn";
2
2
  import { existsSync as N, readFileSync as E, writeFileSync as b } from "node:fs";
3
3
  import C from "node:path";
4
4
  import l from "chalk";
5
- import { valid as v, rcompare as H } from "semver";
5
+ import { valid as v, rcompare as R } from "semver";
6
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
- });
7
+ const o = f(
8
+ "git",
9
+ [
10
+ "describe",
11
+ "--tags",
12
+ "--abbrev=0",
13
+ "--first-parent",
14
+ "--match",
15
+ `${e}${t}.*`
16
+ ],
17
+ {
18
+ stdio: "pipe",
19
+ encoding: "utf-8"
20
+ }
21
+ );
11
22
  return o.status === 0 && o.stdout ? o.stdout.toString().trim() : null;
12
23
  }
13
- function O() {
14
- const t = d("git", ["remote", "get-url", "origin"], {
24
+ function x() {
25
+ const t = f("git", ["remote", "get-url", "origin"], {
15
26
  stdio: "pipe",
16
27
  encoding: "utf-8"
17
28
  });
18
29
  return t.status === 0 && t.stdout ? t.stdout.toString().trim().replace(/\.git$/, "").replace(/^git@github\.com:/, "https://github.com/") : null;
19
30
  }
20
- function V(t, e, o) {
31
+ function O(t, e, o) {
21
32
  const r = ["log", "--format=%H %s", `${t}..${e}`];
22
33
  o && r.push("--", o);
23
- const i = d("git", r, {
34
+ const i = f("git", r, {
24
35
  stdio: "pipe",
25
36
  encoding: "utf-8"
26
37
  });
@@ -43,46 +54,48 @@ function V(t, e, o) {
43
54
  return n;
44
55
  }
45
56
  function it() {
46
- const t = d("git", ["describe", "--tags", "--abbrev=0"], {
57
+ const t = f("git", ["describe", "--tags", "--abbrev=0"], {
47
58
  stdio: "pipe",
48
59
  encoding: "utf-8"
49
60
  });
50
61
  return t.status === 0 && t.stdout ? t.stdout.toString().trim() : null;
51
62
  }
52
- function rt() {
53
- d("git", ["add", "-u"], { stdio: "inherit" }).status !== 0 && (console.error(l.red(`
63
+ function rt(t) {
64
+ t?.length && f("git", ["add", "--", ...t], { stdio: "inherit" }).status !== 0 && (console.error(l.red(`
65
+ Failed to stage explicit files
66
+ `)), process.exit(1)), f("git", ["add", "-u"], { stdio: "inherit" }).status !== 0 && (console.error(l.red(`
54
67
  Failed to stage changes
55
- `)), process.exit(1)), d("git", ["commit", "--amend", "--no-edit"], { stdio: "inherit" }).status !== 0 && (console.error(l.red(`
68
+ `)), process.exit(1)), f("git", ["commit", "--amend", "--no-edit"], { stdio: "inherit" }).status !== 0 && (console.error(l.red(`
56
69
  Failed to amend commit
57
70
  `)), process.exit(1));
58
71
  }
59
72
  function ct(t) {
60
- d("git", ["tag", "-f", "-a", t, "-m", t], { stdio: "inherit" }).status !== 0 && (console.error(l.red(`
73
+ f("git", ["tag", "-f", "-a", t, "-m", t], { stdio: "inherit" }).status !== 0 && (console.error(l.red(`
61
74
  Failed to recreate tag
62
75
  `)), process.exit(1));
63
76
  }
64
77
  function at(t) {
65
78
  console.log(l.cyan(`
66
79
  Pushing changes to remote...
67
- `)), d("git", ["push", "origin", "HEAD", "--force-with-lease"], { stdio: "inherit" }).status !== 0 && (console.error(l.red(`
80
+ `)), f("git", ["push", "origin", "HEAD", "--force-with-lease"], { stdio: "inherit" }).status !== 0 && (console.error(l.red(`
68
81
  Failed to push commit
69
- `)), process.exit(1)), d("git", ["push", "origin", t, "--force"], { stdio: "inherit" }).status !== 0 && (console.error(l.red(`
82
+ `)), process.exit(1)), f("git", ["push", "origin", t, "--force"], { stdio: "inherit" }).status !== 0 && (console.error(l.red(`
70
83
  Failed to push tag
71
84
  `)), process.exit(1));
72
85
  }
73
- function x(t) {
74
- const e = d("git", ["tag", "-l", `${t}*`], {
86
+ function V(t) {
87
+ const e = f("git", ["tag", "-l", `${t}*`], {
75
88
  stdio: "pipe",
76
89
  encoding: "utf-8"
77
90
  });
78
91
  return e.status !== 0 || !e.stdout ? [] : e.stdout.toString().trim().split(`
79
92
  `).filter(Boolean).sort((r, i) => {
80
93
  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);
94
+ return n && s ? R(n, s) : i.localeCompare(r);
82
95
  });
83
96
  }
84
97
  function w(t, e) {
85
- const o = x(e), r = `${e}${t}`, i = o.indexOf(r);
98
+ const o = V(e), r = `${e}${t}`, i = o.indexOf(r);
86
99
  if (i !== -1)
87
100
  return i >= o.length - 1 ? null : o[i + 1];
88
101
  const n = v(t);
@@ -90,13 +103,13 @@ function w(t, e) {
90
103
  return console.warn(l.yellow(` getPreviousVersionTag: invalid version "${t}"`)), null;
91
104
  for (const s of o) {
92
105
  const c = v(s.startsWith(e) ? s.slice(e.length) : s);
93
- if (c && H(n, c) < 0)
106
+ if (c && R(n, c) < 0)
94
107
  return s;
95
108
  }
96
109
  return null;
97
110
  }
98
111
  function ut() {
99
- const t = d("git", ["log", "-1", "--format=%s"], {
112
+ const t = f("git", ["log", "-1", "--format=%s"], {
100
113
  stdio: "pipe",
101
114
  encoding: "utf-8"
102
115
  });
@@ -167,22 +180,22 @@ Supplementing current version entries for ${e}...
167
180
  console.log(l.gray(" No previous release tag found; skipping current version supplementation"));
168
181
  return;
169
182
  }
170
- const n = O();
183
+ const n = x();
171
184
  let s = 0;
172
185
  for (const c of t) {
173
186
  const a = C.join(c.path, "CHANGELOG.md");
174
187
  if (!N(a)) continue;
175
- const g = V(i, "HEAD", c.path), u = W(g, n);
188
+ const g = O(i, "HEAD", c.path), u = W(g, n);
176
189
  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"));
190
+ const d = E(a, "utf-8"), p = B(d, e, u);
191
+ p !== d && (s++, r || b(a, p, "utf-8"));
179
192
  }
180
193
  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
194
  }
182
195
  function y(t) {
183
196
  return t.replace(j, "").trim().length === 0;
184
197
  }
185
- function k(t, e, o) {
198
+ function H(t, e, o) {
186
199
  if (!e || o.length === 0) return;
187
200
  const r = o.join(`
188
201
  `).trim();
@@ -233,17 +246,17 @@ function P(t) {
233
246
  let i = null, n = [];
234
247
  for (const s of r) {
235
248
  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);
249
+ c ? (H(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
250
  }
238
- return k(e, i, n), { versionContent: e, versionHeaders: o };
251
+ return H(e, i, n), { versionContent: e, versionHeaders: o };
239
252
  }
240
253
  function F(t, e) {
241
254
  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);
255
+ const i = k(e?.[o]), n = k(e?.[r]);
256
+ return i !== null && n !== null && i !== n ? n - i : v(o) && v(r) ? R(o, r) : r.localeCompare(o);
244
257
  });
245
258
  }
246
- function R(t) {
259
+ function k(t) {
247
260
  if (!t) return null;
248
261
  const e = t.match(/\((\d{4}-\d{2}-\d{2})\)\s*$/);
249
262
  if (!e) return null;
@@ -257,9 +270,9 @@ Generating root CHANGELOG with package grouping...
257
270
  `));
258
271
  const n = C.join(r, "CHANGELOG.md"), s = {}, c = {};
259
272
  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);
273
+ const d = C.join(r, u.path, "CHANGELOG.md");
274
+ if (!N(d)) continue;
275
+ const p = E(d, "utf-8"), m = P(p);
263
276
  for (const [h, $] of Object.entries(m.versionContent))
264
277
  s[h] || (s[h] = {}), s[h][u.displayName] = $, !c[h] && m.versionHeaders[h] && (c[h] = m.versionHeaders[h]);
265
278
  }
@@ -271,7 +284,7 @@ All notable changes to this monorepo will be documented in this file.
271
284
  `);
272
285
  const g = F(Object.keys(s), c);
273
286
  for (const u of g) {
274
- const f = s[u], p = Object.values(f).some(
287
+ const d = s[u], p = Object.values(d).some(
275
288
  ($) => !!$?.trim() && !y($)
276
289
  ), m = c[u] || u;
277
290
  if (a += `## ${m}
@@ -284,7 +297,7 @@ All notable changes to this monorepo will be documented in this file.
284
297
  }
285
298
  let h = !1;
286
299
  for (const $ of o) {
287
- const G = f[$.displayName];
300
+ const G = d[$.displayName];
288
301
  G && G.trim() && (y(G) || (h = !0, a += `### ${$.displayName}
289
302
 
290
303
  `, a += `${G}
@@ -370,7 +383,7 @@ const A = [
370
383
  function z(t, e, o, r) {
371
384
  const i = ["log", "--format=%H %s", e ? `${e}..${t}` : t];
372
385
  r && i.push("--", r);
373
- const n = d("git", i, {
386
+ const n = f("git", i, {
374
387
  stdio: "pipe",
375
388
  encoding: "utf-8",
376
389
  cwd: o
@@ -381,10 +394,10 @@ function z(t, e, o, r) {
381
394
  for (const g of c) {
382
395
  const u = g.indexOf(" ");
383
396
  if (u === -1) continue;
384
- const f = g.substring(0, u), m = g.substring(u + 1).match(a);
397
+ const d = g.substring(0, u), m = g.substring(u + 1).match(a);
385
398
  m && s.push({
386
- hash: f,
387
- shortHash: f.substring(0, 7),
399
+ hash: d,
400
+ shortHash: d.substring(0, 7),
388
401
  type: m[1],
389
402
  scope: m[2] || null,
390
403
  subject: m[4],
@@ -394,7 +407,7 @@ function z(t, e, o, r) {
394
407
  return s;
395
408
  }
396
409
  function Y(t, e) {
397
- const o = d("git", ["tag", "-l", `${e}*`], {
410
+ const o = f("git", ["tag", "-l", `${e}*`], {
398
411
  stdio: "pipe",
399
412
  encoding: "utf-8",
400
413
  cwd: t
@@ -410,7 +423,7 @@ function Y(t, e) {
410
423
  });
411
424
  }
412
425
  function K(t) {
413
- const e = d("git", ["remote", "get-url", "origin"], {
426
+ const e = f("git", ["remote", "get-url", "origin"], {
414
427
  stdio: "pipe",
415
428
  encoding: "utf-8",
416
429
  cwd: t
@@ -418,7 +431,7 @@ function K(t) {
418
431
  return e.status !== 0 || !e.stdout ? null : e.stdout.toString().trim().replace(/\.git$/, "").replace(/^git@github\.com:/, "https://github.com/");
419
432
  }
420
433
  function U(t, e) {
421
- const o = d("git", ["log", "-1", "--format=%ct", e], {
434
+ const o = f("git", ["log", "-1", "--format=%ct", e], {
422
435
  stdio: "pipe",
423
436
  encoding: "utf-8",
424
437
  cwd: t
@@ -426,7 +439,7 @@ function U(t, e) {
426
439
  return o.status === 0 && o.stdout?.trim() && Number(o.stdout.trim()) || 0;
427
440
  }
428
441
  function Z(t, e) {
429
- const o = d("git", ["log", "-1", "--format=%cs", e], {
442
+ const o = f("git", ["log", "-1", "--format=%cs", e], {
430
443
  stdio: "pipe",
431
444
  encoding: "utf-8",
432
445
  cwd: t
@@ -472,12 +485,12 @@ function J(t, e) {
472
485
  function Q(t, e, o, r) {
473
486
  const i = Y(t, o), n = [];
474
487
  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(
488
+ 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), d = z(
476
489
  c,
477
490
  a,
478
491
  t,
479
492
  C.join(t, e.path)
480
- ), p = J(f, r);
493
+ ), p = J(d, r);
481
494
  n.push(u), n.push(""), n.push(p || "**Note:** Version bump only for package"), n.push("");
482
495
  }
483
496
  return n.join(`
@@ -499,8 +512,8 @@ Generating initial CHANGELOG.md files...
499
512
  for (const c of e) {
500
513
  const a = C.join(o, c.path, "CHANGELOG.md");
501
514
  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}`));
515
+ const u = `${a}.backup`, d = E(a, "utf-8");
516
+ b(u, d, "utf-8"), console.log(l.gray(` Backed up ${a} to ${u}`));
504
517
  }
505
518
  console.log(l.blue(`
506
519
  Generating changelog for ${c.name}...`));
@@ -1,20 +1,20 @@
1
- import { parse as b, valid as N } from "semver";
2
- import { readFileSync as P, writeFileSync as $ } from "node:fs";
1
+ import { parse as P, valid as N } from "semver";
2
+ import { readFileSync as A, writeFileSync as T } from "node:fs";
3
3
  import R from "node:path";
4
- import T from "mri";
5
- import { argv as D } from "node:process";
4
+ import $ from "mri";
5
+ import { argv as E } from "node:process";
6
6
  import n from "chalk";
7
7
  import { sync as h } from "cross-spawn";
8
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));
9
+ import { f as O, e as D, a as H, s as L, g as S, b as I, c as j, d as G, r as U, p as _ } from "./generate-changelogs-CiQDT33J.js";
10
+ import { h as ge } from "./generate-changelogs-CiQDT33J.js";
11
+ const c = $(E.slice(2));
12
12
  c.dry;
13
13
  function w(t) {
14
14
  const o = R.resolve(t), e = R.resolve(o, "package.json");
15
- return { pkg: JSON.parse(P(e, "utf-8")), pkgDir: o, pkgPath: e };
15
+ return { pkg: JSON.parse(A(e, "utf-8")), pkgDir: o, pkgPath: e };
16
16
  }
17
- async function O() {
17
+ async function F() {
18
18
  const { releaseType: t } = await y({
19
19
  type: "select",
20
20
  name: "releaseType",
@@ -28,8 +28,8 @@ async function O() {
28
28
  });
29
29
  return t;
30
30
  }
31
- async function G(t) {
32
- const o = b(t), e = o && o.prerelease.length > 0, s = e ? o.prerelease[0] : null, { preid: a } = await y({
31
+ async function J(t) {
32
+ const o = P(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",
@@ -51,7 +51,7 @@ async function G(t) {
51
51
  if (a)
52
52
  return e && s === a ? { preid: a, lernaVersionArg: "prerelease", lernaPreidArgs: [] } : { preid: a, lernaVersionArg: "prerelease", lernaPreidArgs: ["--preid", a] };
53
53
  }
54
- async function B(t) {
54
+ async function M(t) {
55
55
  const { customVersion: o } = await y({
56
56
  type: "text",
57
57
  name: "customVersion",
@@ -61,7 +61,7 @@ async function B(t) {
61
61
  });
62
62
  return o;
63
63
  }
64
- async function W() {
64
+ async function B() {
65
65
  const { yes: t } = await y({
66
66
  type: "confirm",
67
67
  name: "yes",
@@ -69,27 +69,36 @@ async function W() {
69
69
  });
70
70
  return !!t;
71
71
  }
72
- function d() {
72
+ function m() {
73
73
  console.log(n.yellow(`
74
74
  Release cancelled
75
75
  `));
76
76
  }
77
- function Y(t, o) {
77
+ function W(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 q(t) {
83
+ function K(t) {
84
84
  console.log(n.cyan(`
85
85
  Running: npx ${t.join(" ")}
86
86
  `));
87
- const o = h("npx", t, { stdio: "inherit" });
87
+ const o = h("npx", t, {
88
+ stdio: "inherit",
89
+ env: {
90
+ ...process.env,
91
+ // Lerna v8+ resolves projects through Nx and can accidentally bind to a parent workspace
92
+ // when the releasable app lives inside a larger monorepo. Pin the workspace root to the
93
+ // current project so changed packages are detected correctly.
94
+ NX_WORKSPACE_ROOT_PATH: process.env.NX_WORKSPACE_ROOT_PATH || process.cwd()
95
+ }
96
+ });
88
97
  o.status !== 0 && (console.error(n.red(`
89
98
  Release process failed
90
99
  `)), process.exit(o.status || 1));
91
100
  }
92
- function z(t) {
101
+ function X(t) {
93
102
  const o = {};
94
103
  for (const e of t) {
95
104
  const { pkg: s } = w(e.path);
@@ -97,7 +106,7 @@ function z(t) {
97
106
  }
98
107
  return o;
99
108
  }
100
- function K(t, o) {
109
+ function Y(t, o) {
101
110
  for (const e of t) {
102
111
  const { pkg: s } = w(e.path);
103
112
  if (s.version !== o[e.path])
@@ -105,7 +114,7 @@ function K(t, o) {
105
114
  }
106
115
  return null;
107
116
  }
108
- function Q(t, o, e) {
117
+ function q(t, o, e) {
109
118
  if (console.log(n.gray(`
110
119
  --- Release diagnostics ---`)), console.log(n.gray(` tagVersionPrefix: "${t}"`)), console.log(n.gray(` looking for tags: ${t}${o}.*`)), e) {
111
120
  const s = h("git", ["rev-list", "--count", `${e}..HEAD`], {
@@ -141,44 +150,44 @@ async function ie(t) {
141
150
  i && console.log(n.yellow(`
142
151
  DRY RUN MODE - No git operations will be performed
143
152
  `));
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 = [];
153
+ const { pkg: b } = w(o[0].path), v = b.version, k = v.split(".").slice(0, 2).join("."), C = O(k, e);
154
+ q(e, k, C);
155
+ const g = await F();
156
+ if (!g) return m();
157
+ const d = [];
149
158
  if (g !== "auto") {
150
159
  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);
160
+ const r = await J(v);
161
+ if (!r) return m();
162
+ d.push(r.lernaVersionArg, ...r.lernaPreidArgs), c.tag || (c.tag = r.preid);
154
163
  } else if (g === "graduate")
155
- m.push("--conventional-graduate");
164
+ d.push("--conventional-graduate");
156
165
  else if (g === "custom") {
157
- const r = await B(v);
158
- if (!r) return d();
159
- m.push(r);
160
- const l = b(r);
166
+ const r = await M(v);
167
+ if (!r) return m();
168
+ d.push(r);
169
+ const l = P(r);
161
170
  if (l && l.prerelease.length > 0 && !c.tag) {
162
171
  const u = l.prerelease[0];
163
172
  typeof u == "string" && (c.tag = u);
164
173
  }
165
174
  }
166
175
  }
167
- if (!await W()) return d();
168
- const C = Y(m, {
176
+ if (!await B()) return m();
177
+ const V = W(d, {
169
178
  tagVersionPrefix: e,
170
179
  isDryRun: i,
171
180
  forcePublish: f || !!c.force
172
- }), x = z(o);
173
- q(C);
174
- const p = K(o, x);
181
+ }), x = X(o);
182
+ K(V);
183
+ const p = Y(o, x);
175
184
  if (!p) {
176
185
  console.log(n.yellow(`
177
186
  No packages were versioned. Nothing to release.
178
187
  `));
179
188
  return;
180
189
  }
181
- if (a && X(p), s && (console.log(n.cyan(`
190
+ if (a && z(p), s && (console.log(n.cyan(`
182
191
  Running post-version hooks...
183
192
  `)), await s(p)), !i) {
184
193
  console.log(n.cyan(`
@@ -189,7 +198,7 @@ Updating yarn.lock with new package versions...
189
198
  Failed to update yarn.lock
190
199
  `)), process.exit(r.status || 1));
191
200
  }
192
- if (I(o, !1), L(o, p, !1), S(o, p, e, !1), j({ packages: o }, !1), i)
201
+ if (D(o, !1), H(o, p, !1), L(o, p, e, !1), S({ packages: o }, !1), i)
193
202
  console.log(n.yellow(`
194
203
  Dry run completed successfully!
195
204
  `)), console.log(n.cyan("Changes made:")), console.log(n.cyan(" - Updated package versions")), console.log(n.cyan(` - Generated/updated CHANGELOG.md files
@@ -197,11 +206,11 @@ Dry run completed successfully!
197
206
  `)), console.log(n.yellow("To revert all changes:")), console.log(n.cyan(` git checkout -- .
198
207
  `));
199
208
  else {
200
- const r = H();
209
+ const r = I();
201
210
  r || (console.error(n.red(`
202
211
  Could not determine the git tag created by Lerna
203
212
  `)), process.exit(1));
204
- const l = U(), u = `release: ${e}`;
213
+ const l = j(), u = `release: ${e}`;
205
214
  (!l || !l.startsWith(u)) && (console.error(
206
215
  n.red(
207
216
  `
@@ -210,19 +219,19 @@ This may indicate extra commits were made after Lerna's release commit.
210
219
  Aborting to prevent amending/tagging the wrong commit.
211
220
  `
212
221
  )
213
- ), process.exit(1)), F(), J(r), M(r), console.log(n.green(`
222
+ ), process.exit(1)), G(["package.json", "CHANGELOG.md"]), U(r), _(r), console.log(n.green(`
214
223
  Release completed successfully!
215
224
  `)), console.log(n.cyan(`npmTag will be automatically determined from git tag in CI
216
225
  `));
217
226
  }
218
227
  }
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) + `
228
+ function z(t, o) {
229
+ const e = "package.json", s = JSON.parse(A(e, "utf-8"));
230
+ s.version !== t && (s.version = t, T(e, JSON.stringify(s, null, 2) + `
222
231
  `, "utf-8"), console.log(n.gray(` Updated root package.json version: ${t}`)));
223
232
  }
224
233
  export {
225
234
  ge as generateInitialChangelogs,
226
- j as generateRootChangelog,
235
+ S as generateRootChangelog,
227
236
  ie as release
228
237
  };
package/dist/src/git.d.ts CHANGED
@@ -39,9 +39,13 @@ export declare function getLatestTag(): string | null;
39
39
  * Stages all modified tracked files and amends the last commit (created by Lerna).
40
40
  * Uses `git add -u` to capture all release changes including custom hook modifications
41
41
  * (e.g. boilerplate template versions, app dependency updates).
42
+ *
43
+ * @param explicitFiles - Files to stage explicitly before `git add -u`.
44
+ * Explicit `git add` ensures these files are staged even when `assume-unchanged`
45
+ * or `skip-worktree` bits are set, or when `git add -u` misses them for any reason.
42
46
  * Exits on failure.
43
47
  */
44
- export declare function stageAndAmendCommit(): void;
48
+ export declare function stageAndAmendCommit(explicitFiles?: string[]): void;
45
49
  /**
46
50
  * Deletes and recreates the tag as an annotated tag on the amended commit.
47
51
  */
@@ -1 +1 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/git.ts"],"names":[],"mappings":"AAIA;;;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,IAAI,CAa1C;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAK9C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAKrD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAStE;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,UAAU,CAAC,EAAE,MAAM,GAClB,kBAAkB,EAAE,CAsCtB;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,GAAG,IAAI,CAU5C;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAY1C;AAED;;GAEG;AACH,wBAAgB,oBAAoB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C,QAAQ,EAAE,aAAa,EAAE,EACzB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACrC,MAAM,GAAG,IAAI,CAQf;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAqClG"}
1
+ {"version":3,"file":"lerna.d.ts","sourceRoot":"","sources":["../../src/lerna.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IAClC,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,eAAe,EAAE,MAAM,EAAE,EACzB,OAAO,EAAE,mBAAmB,GAC3B,MAAM,EAAE,CAsBV;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAiBpD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOvF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,aAAa,EAAE,EACzB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACrC,MAAM,GAAG,IAAI,CAQf;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAqClG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vc-shell/release-config",
3
- "version": "1.2.4-beta.7",
3
+ "version": "2.0.0-alpha.0",
4
4
  "type": "module",
5
5
  "main": "dist/release-config.js",
6
6
  "types": "./dist/src/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  "lerna": "^9.0.0",
21
21
  "mri": "^1.2.0",
22
22
  "prompts": "^2.4.2",
23
- "semver": "^7.5.4"
23
+ "semver": "^7.7.4"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/cross-spawn": "^6.0.6",
@@ -34,5 +34,5 @@
34
34
  "access": "public",
35
35
  "registry": "https://registry.npmjs.org/"
36
36
  },
37
- "gitHead": "cc6ef5c98d3f8b6489126a950e994335016ea35d"
37
+ "gitHead": "f028d9e1fe410a18fec4e127a65860cfb2309e36"
38
38
  }