@vc-shell/release-config 1.2.4-beta.7 → 1.2.4-beta.8
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.
|
@@ -4,10 +4,21 @@ import C from "node:path";
|
|
|
4
4
|
import l from "chalk";
|
|
5
5
|
import { valid as v, rcompare as H } from "semver";
|
|
6
6
|
function st(t, e) {
|
|
7
|
-
const o = d(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const o = d(
|
|
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
24
|
function O() {
|
package/dist/release-config.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { parse as
|
|
2
|
-
import { readFileSync as
|
|
1
|
+
import { parse as P, valid as N } from "semver";
|
|
2
|
+
import { readFileSync as b, writeFileSync as T } from "node:fs";
|
|
3
3
|
import R from "node:path";
|
|
4
|
-
import
|
|
5
|
-
import { argv as
|
|
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
|
|
10
|
-
import { h as ge } from "./generate-changelogs-
|
|
11
|
-
const c =
|
|
9
|
+
import { f as O, e as D, a as S, s as H, g as I, b as L, c as j, d as U, r as _, p as F } from "./generate-changelogs-Dx-dDlOU.js";
|
|
10
|
+
import { h as ge } from "./generate-changelogs-Dx-dDlOU.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(
|
|
15
|
+
return { pkg: JSON.parse(b(e, "utf-8")), pkgDir: o, pkgPath: e };
|
|
16
16
|
}
|
|
17
|
-
async function
|
|
17
|
+
async function J() {
|
|
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
|
|
32
|
-
const o =
|
|
31
|
+
async function M(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
|
|
54
|
+
async function G(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
|
|
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
|
|
72
|
+
function m() {
|
|
73
73
|
console.log(n.yellow(`
|
|
74
74
|
Release cancelled
|
|
75
75
|
`));
|
|
76
76
|
}
|
|
77
|
-
function
|
|
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
|
|
83
|
+
function K(t) {
|
|
84
84
|
console.log(n.cyan(`
|
|
85
85
|
Running: npx ${t.join(" ")}
|
|
86
86
|
`));
|
|
87
|
-
const o = h("npx", t, {
|
|
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
|
|
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
|
|
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
|
|
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:
|
|
145
|
-
|
|
146
|
-
const g = await
|
|
147
|
-
if (!g) return
|
|
148
|
-
const
|
|
153
|
+
const { pkg: A } = w(o[0].path), v = A.version, k = v.split(".").slice(0, 2).join("."), C = O(k, e);
|
|
154
|
+
q(e, k, C);
|
|
155
|
+
const g = await J();
|
|
156
|
+
if (!g) return m();
|
|
157
|
+
const d = [];
|
|
149
158
|
if (g !== "auto") {
|
|
150
159
|
if (g === "prerelease") {
|
|
151
|
-
const r = await
|
|
152
|
-
if (!r) return
|
|
153
|
-
|
|
160
|
+
const r = await M(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
|
-
|
|
164
|
+
d.push("--conventional-graduate");
|
|
156
165
|
else if (g === "custom") {
|
|
157
|
-
const r = await
|
|
158
|
-
if (!r) return
|
|
159
|
-
|
|
160
|
-
const l =
|
|
166
|
+
const r = await G(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
|
|
168
|
-
const
|
|
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 =
|
|
173
|
-
|
|
174
|
-
const p =
|
|
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 &&
|
|
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 (
|
|
201
|
+
if (D(o, !1), S(o, p, !1), H(o, p, e, !1), I({ 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 =
|
|
209
|
+
const r = L();
|
|
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 =
|
|
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)),
|
|
222
|
+
), process.exit(1)), U(), _(r), F(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
|
|
220
|
-
const e = "package.json", s = JSON.parse(
|
|
221
|
-
s.version !== t && (s.version = t,
|
|
228
|
+
function z(t, o) {
|
|
229
|
+
const e = "package.json", s = JSON.parse(b(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
|
-
|
|
235
|
+
I as generateRootChangelog,
|
|
227
236
|
ie as release
|
|
228
237
|
};
|
package/dist/src/git.d.ts.map
CHANGED
|
@@ -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,
|
|
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,CAqBxF;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,MAAM,GAAG,IAAI,CAa1C;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EA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AAI,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.
|
|
3
|
+
"version": "1.2.4-beta.8",
|
|
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": "
|
|
37
|
+
"gitHead": "25aa3246d45b375af4fffcc256a447d05dfda64c"
|
|
38
38
|
}
|