@vc-shell/release-config 1.1.91-alpha.4 → 1.1.91
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/CHANGELOG.md +503 -309
- package/README.md +32 -280
- package/dist/release-config.js +126 -284
- package/dist/release.d.ts +6 -18
- package/dist/release.d.ts.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/package.json +3 -6
package/dist/release-config.js
CHANGED
|
@@ -1,105 +1,98 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { readFileSync as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { argv as
|
|
8
|
-
import { sync as
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
function w(
|
|
12
|
-
const
|
|
13
|
-
return { pkg: JSON.parse(
|
|
1
|
+
import u from "prompts";
|
|
2
|
+
import { inc as y, valid as S, parse as R } from "semver";
|
|
3
|
+
import { readFileSync as C, writeFileSync as D } from "node:fs";
|
|
4
|
+
import k from "node:path";
|
|
5
|
+
import s from "chalk";
|
|
6
|
+
import I from "mri";
|
|
7
|
+
import { argv as M } from "node:process";
|
|
8
|
+
import { sync as U } from "cross-spawn";
|
|
9
|
+
const e = I(M.slice(2)), b = !!e.dry;
|
|
10
|
+
b && (console.log(s.inverse(s.yellow(" DRY RUN "))), console.log());
|
|
11
|
+
function w(t) {
|
|
12
|
+
const n = k.resolve(t), l = k.resolve(n, "package.json");
|
|
13
|
+
return { pkg: JSON.parse(C(l, "utf-8")), pkgDir: n, pkgPath: l };
|
|
14
14
|
}
|
|
15
|
-
async function
|
|
16
|
-
if (
|
|
17
|
-
console.log(
|
|
15
|
+
async function T(t, n) {
|
|
16
|
+
if (b) {
|
|
17
|
+
console.log(s.blue(`[dryrun] Writing package.json to ${t}`));
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
D(t, JSON.stringify(n, null, 2) + `
|
|
21
21
|
`, "utf-8");
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
async function P(t, n, l) {
|
|
24
|
+
return U(t, n, { stdio: "inherit", ...l });
|
|
25
|
+
}
|
|
26
|
+
async function A(t, n, l) {
|
|
27
|
+
return console.log(s.blue(`[dryrun] ${t} ${n.join(" ")}`), l || "");
|
|
28
|
+
}
|
|
29
|
+
const f = b ? A : P;
|
|
30
|
+
function d(t) {
|
|
31
|
+
return console.log(s.cyan(t));
|
|
32
|
+
}
|
|
33
|
+
function E(t) {
|
|
34
|
+
function n(r, o) {
|
|
35
|
+
if (r === "prerelease" && o === "alpha") {
|
|
36
|
+
if (t.includes("-alpha")) {
|
|
37
|
+
const [h, p] = t.split("-alpha."), $ = parseInt(p) + 1;
|
|
38
|
+
return `${h}-alpha.${$}`;
|
|
39
|
+
}
|
|
40
|
+
return `${y(t, "patch")}-alpha.0`;
|
|
41
|
+
}
|
|
42
|
+
return y(t, r);
|
|
43
|
+
}
|
|
44
|
+
return [
|
|
45
|
+
{
|
|
46
|
+
title: "next",
|
|
47
|
+
value: n("patch")
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
title: "alpha",
|
|
51
|
+
value: n("prerelease", "alpha")
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
title: "minor",
|
|
55
|
+
value: n("minor")
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
title: "major",
|
|
59
|
+
value: n("major")
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
value: "custom",
|
|
63
|
+
title: "custom"
|
|
64
|
+
}
|
|
65
|
+
].map((r) => (r.title = `${r.title} (${r.value})`, r));
|
|
66
|
+
}
|
|
67
|
+
const W = async ({
|
|
68
|
+
packages: t,
|
|
69
|
+
bumpVersion: n,
|
|
70
|
+
generateChangelog: l,
|
|
71
|
+
toTag: r
|
|
29
72
|
}) => {
|
|
30
|
-
|
|
73
|
+
let o;
|
|
74
|
+
if (t.length === 0)
|
|
31
75
|
throw new Error("No packages to release");
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
`));
|
|
36
|
-
const { releaseType: c } = await v({
|
|
37
|
-
type: "select",
|
|
38
|
-
name: "releaseType",
|
|
39
|
-
message: "Select release type",
|
|
40
|
-
choices: [
|
|
41
|
-
{ title: "Automatic (based on commits)", value: "auto" },
|
|
42
|
-
{ title: "Prerelease (alpha/beta/rc)", value: "prerelease" },
|
|
43
|
-
{ title: "Graduate prerelease to stable", value: "graduate" },
|
|
44
|
-
{ title: "Custom version", value: "custom" }
|
|
45
|
-
]
|
|
46
|
-
});
|
|
47
|
-
if (!c) {
|
|
48
|
-
console.log(n.yellow(`
|
|
49
|
-
Release cancelled
|
|
50
|
-
`));
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const a = ["lerna", "version", "--conventional-commits"];
|
|
54
|
-
if (c === "prerelease") {
|
|
55
|
-
const { pkg: e } = w(i[0]), t = A(e.version), o = t && t.prerelease.length > 0, g = o ? t.prerelease[0] : null, { preid: d } = await v({
|
|
76
|
+
const { pkg: v } = w(t[0]);
|
|
77
|
+
if (!o) {
|
|
78
|
+
const { release: a } = await u({
|
|
56
79
|
type: "select",
|
|
57
|
-
name: "
|
|
58
|
-
message: "Select
|
|
59
|
-
choices:
|
|
60
|
-
{
|
|
61
|
-
title: o && g === "alpha" ? "alpha (continue)" : "alpha",
|
|
62
|
-
value: "alpha"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
title: o && g === "beta" ? "beta (continue)" : "beta",
|
|
66
|
-
value: "beta"
|
|
67
|
-
},
|
|
68
|
-
{ title: o && g === "rc" ? "rc (continue)" : "rc", value: "rc" }
|
|
69
|
-
]
|
|
80
|
+
name: "release",
|
|
81
|
+
message: "Select release type",
|
|
82
|
+
choices: E(v.version)
|
|
70
83
|
});
|
|
71
|
-
|
|
72
|
-
console.log(n.yellow(`
|
|
73
|
-
Release cancelled
|
|
74
|
-
`));
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
o && g === d ? a.push("prerelease") : a.push("prerelease", "--preid", d), p.tag || (p.tag = d);
|
|
78
|
-
} else if (c === "graduate")
|
|
79
|
-
a.push("--conventional-graduate");
|
|
80
|
-
else if (c === "custom") {
|
|
81
|
-
const { pkg: e } = w(i[0]), { customVersion: t } = await v({
|
|
84
|
+
a === "custom" ? o = (await u({
|
|
82
85
|
type: "text",
|
|
83
|
-
name: "
|
|
84
|
-
message: "
|
|
85
|
-
initial:
|
|
86
|
-
|
|
87
|
-
});
|
|
88
|
-
if (!t) {
|
|
89
|
-
console.log(n.yellow(`
|
|
90
|
-
Release cancelled
|
|
91
|
-
`));
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
a.push(t);
|
|
95
|
-
const o = A(t);
|
|
96
|
-
if (o && o.prerelease.length > 0 && !p.tag) {
|
|
97
|
-
const g = o.prerelease[0];
|
|
98
|
-
typeof g == "string" && (p.tag = g);
|
|
99
|
-
}
|
|
86
|
+
name: "version",
|
|
87
|
+
message: "Input custom version",
|
|
88
|
+
initial: v.version
|
|
89
|
+
})).version : o = a;
|
|
100
90
|
}
|
|
101
|
-
if (!
|
|
102
|
-
|
|
91
|
+
if (!S(o))
|
|
92
|
+
throw new Error(`invalid target version: ${o}`);
|
|
93
|
+
const h = o.match(/-([a-zA-Z]+)(?:\.(\d+))?$/);
|
|
94
|
+
if (h && !e.tag && (e.tag = h[1]), !e.tag) {
|
|
95
|
+
const { npmTag: a } = await u({
|
|
103
96
|
type: "select",
|
|
104
97
|
name: "npmTag",
|
|
105
98
|
message: "Select npm distribution tag",
|
|
@@ -111,210 +104,59 @@ Release cancelled
|
|
|
111
104
|
{ title: "custom", value: "custom" }
|
|
112
105
|
]
|
|
113
106
|
});
|
|
114
|
-
if (
|
|
115
|
-
const
|
|
107
|
+
if (a === "custom") {
|
|
108
|
+
const g = await u({
|
|
116
109
|
type: "text",
|
|
117
110
|
name: "customTag",
|
|
118
111
|
message: "Input custom npm tag",
|
|
119
112
|
initial: "latest"
|
|
120
113
|
});
|
|
121
|
-
|
|
122
|
-
} else
|
|
114
|
+
e.tag = g.customTag;
|
|
115
|
+
} else a !== "latest" && (e.tag = a);
|
|
123
116
|
}
|
|
124
|
-
|
|
117
|
+
if (e.tag && e.tag !== "latest") {
|
|
118
|
+
const a = R(o);
|
|
119
|
+
if (a && !o.includes(`-${e.tag}`)) {
|
|
120
|
+
let i, c = 0;
|
|
121
|
+
a.prerelease.length > 0 ? (a.prerelease.length > 1 && typeof a.prerelease[1] == "number" && (c = a.prerelease[1]), i = `${`${a.major}.${a.minor}.${a.patch}`}-${e.tag}`) : i = `${y(o, "minor")}-${e.tag}`;
|
|
122
|
+
const { usePreNum: m } = await u({
|
|
123
|
+
type: "confirm",
|
|
124
|
+
name: "usePreNum",
|
|
125
|
+
message: `Add prerelease number to version? (e.g. ${i}.${c})`,
|
|
126
|
+
initial: !0
|
|
127
|
+
});
|
|
128
|
+
m && (i = `${i}.${c}`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const p = r(o);
|
|
132
|
+
let $ = `release: ${p}`;
|
|
133
|
+
e.tag && e.tag !== "latest" && ($ += ` with npm tag ${e.tag}`);
|
|
134
|
+
const { yes: N } = await u({
|
|
125
135
|
type: "confirm",
|
|
126
136
|
name: "yes",
|
|
127
|
-
message: `
|
|
137
|
+
message: `Releasing ${s.yellow(p)}${e.tag && e.tag !== "latest" ? ` with npm tag ${s.blue(e.tag)}` : ""} Confirm?`
|
|
128
138
|
});
|
|
129
|
-
if (!
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
`
|
|
133
|
-
|
|
139
|
+
if (!N) return;
|
|
140
|
+
for (let a = 0; a < t.length; a++) {
|
|
141
|
+
const g = t[a], { pkg: i } = w(g);
|
|
142
|
+
d(`
|
|
143
|
+
Updating ${s.green(i.name)} package version to ${s.green(o)}...`), await n(i.name, o);
|
|
144
|
+
const c = w(g), m = { ...c.pkg };
|
|
145
|
+
e.tag && e.tag !== "latest" ? (m.npmTag = e.tag, await T(c.pkgPath, m), console.log(`Set npmTag: ${s.blue(e.tag)} to ${s.green(i.name)}`)) : m.npmTag && (delete m.npmTag, await T(c.pkgPath, m), console.log(`Removed npmTag from ${s.green(i.name)} for latest release.`)), d(`
|
|
146
|
+
Generating ${s.green(i.name)} changelog...`), await l(i.name, o, g);
|
|
134
147
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
`
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
console.log(n.cyan(`
|
|
143
|
-
Running post-version hooks...
|
|
144
|
-
`));
|
|
145
|
-
const { pkg: e } = w(i[0] === "." ? i[1] : i[0]);
|
|
146
|
-
await s(e.version);
|
|
147
|
-
}
|
|
148
|
-
if (await D(i), await L(i), await I(i), !h && y("git", ["status", "--porcelain"], { stdio: "pipe" }).stdout?.toString().trim()) {
|
|
149
|
-
const o = y("git", ["describe", "--tags", "--abbrev=0"], { stdio: "pipe" }).stdout?.toString().trim() || "HEAD";
|
|
150
|
-
y("git", ["add", "-A"], { stdio: "inherit" }), y("git", ["commit", "--amend", "--no-edit", "--no-verify"], { stdio: "inherit" }), y("git", ["tag", "-f", o], { stdio: "inherit" }), console.log(n.cyan(`
|
|
151
|
-
Pushing changes to remote...
|
|
152
|
-
`)), y("git", ["push", "origin", "HEAD", "--force-with-lease"], { stdio: "inherit" }), y("git", ["push", "origin", o, "--force"], { stdio: "inherit" }), console.log(n.green(`
|
|
153
|
-
✅ Updated changelogs, package.json, and pushed to remote
|
|
154
|
-
`));
|
|
148
|
+
const { stdout: j } = await P("git", ["diff"], { stdio: "pipe" });
|
|
149
|
+
if (j)
|
|
150
|
+
d(`
|
|
151
|
+
Committing changes...`), await f("git", ["add", "-A"]), await f("git", ["commit", "-m", $, "--no-verify"]), await f("git", ["tag", p]);
|
|
152
|
+
else {
|
|
153
|
+
console.log("No changes to commit.");
|
|
154
|
+
return;
|
|
155
155
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
`)), console.log(n.yellow("No git operations performed. Review changes with:")), console.log(n.cyan(` git diff
|
|
160
|
-
`)), console.log(n.yellow("To revert all changes:")), console.log(n.cyan(` git checkout -- .
|
|
161
|
-
`))) : (console.log(n.green(`
|
|
162
|
-
✅ Release completed successfully!
|
|
163
|
-
`)), p.tag && p.tag !== "latest" && (console.log(n.cyan(`
|
|
164
|
-
ℹ️ Package files updated with npmTag: ${n.blue(p.tag)}`)), console.log(n.cyan(` GitHub Actions will automatically publish with this tag
|
|
165
|
-
`))));
|
|
156
|
+
d(`
|
|
157
|
+
Pushing to GitHub...`), await f("git", ["push", "origin", `refs/tags/${p}`]), await f("git", ["push"]), e.tag && e.tag !== "latest" && console.log(`
|
|
158
|
+
NOTE: This release will be published to npm with tag ${s.blue(e.tag)}`), console.log();
|
|
166
159
|
};
|
|
167
|
-
async function D(i) {
|
|
168
|
-
console.log(n.cyan(`
|
|
169
|
-
Enhancing changelogs...
|
|
170
|
-
`));
|
|
171
|
-
const f = y("npx", ["lerna", "changed", "--json"], { stdio: "pipe" }), m = /* @__PURE__ */ new Set();
|
|
172
|
-
if (f.stdout)
|
|
173
|
-
try {
|
|
174
|
-
JSON.parse(f.stdout.toString()).forEach((s) => m.add(s.name));
|
|
175
|
-
} catch {
|
|
176
|
-
}
|
|
177
|
-
for (const l of i) {
|
|
178
|
-
if (l === ".") continue;
|
|
179
|
-
const s = N.join(l, "CHANGELOG.md"), { pkg: h } = w(l), c = m.has(h.name);
|
|
180
|
-
if (!V(s)) {
|
|
181
|
-
const t = `# CHANGELOG
|
|
182
|
-
|
|
183
|
-
All notable changes to this package will be documented in this file.
|
|
184
|
-
|
|
185
|
-
## [${h.version}] (${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]})
|
|
186
|
-
|
|
187
|
-
**Note:** Version bump only - Updated dependencies to match framework version
|
|
188
|
-
`;
|
|
189
|
-
b(s, t, "utf-8"), console.log(n.gray(` Created changelog for ${h.name}`));
|
|
190
|
-
continue;
|
|
191
|
-
}
|
|
192
|
-
let a = S(s, "utf-8");
|
|
193
|
-
a = a.replace(/^All notable changes to this project will be documented in this file\.\s*\n/gm, ""), a = a.replace(
|
|
194
|
-
/^See \[Conventional Commits\]\(https:\/\/conventionalcommits\.org\) for commit guidelines\.\s*\n/gm,
|
|
195
|
-
""
|
|
196
|
-
), a = a.replace(/\n{3,}/g, `
|
|
197
|
-
|
|
198
|
-
`);
|
|
199
|
-
const r = a.split(`
|
|
200
|
-
`), u = [];
|
|
201
|
-
let e = 0;
|
|
202
|
-
for (; e < r.length; ) {
|
|
203
|
-
const t = r[e], o = t.match(/^##\s+(\[)?([\d.a-z-]+)(\])?(\s+\([^)]+\))?/i);
|
|
204
|
-
if (o) {
|
|
205
|
-
const d = o[2] === h.version;
|
|
206
|
-
for (u.push(t), e++; e < r.length && r[e].trim() === ""; )
|
|
207
|
-
u.push(r[e]), e++;
|
|
208
|
-
let C = !1, P = e, k = e;
|
|
209
|
-
for (; k < r.length && !r[k].match(/^##\s+(\[)?[\d.a-z-]+(\])?/i); ) {
|
|
210
|
-
const G = r[k].trim();
|
|
211
|
-
if (G !== "" && !G.startsWith("**Note:**")) {
|
|
212
|
-
C = !0;
|
|
213
|
-
break;
|
|
214
|
-
}
|
|
215
|
-
k++;
|
|
216
|
-
}
|
|
217
|
-
C || r.slice(P, Math.min(P + 5, r.length)).some((O) => O.includes("**Note:**")) || (d && !c ? u.push("**Note:** Version bump only - Updated dependencies to match framework version") : u.push("**Note:** Version bump only for package"), u.push(""));
|
|
218
|
-
} else
|
|
219
|
-
u.push(t), e++;
|
|
220
|
-
}
|
|
221
|
-
a = u.join(`
|
|
222
|
-
`), b(s, a, "utf-8");
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
async function $(i) {
|
|
226
|
-
const f = i.find((c) => c !== ".");
|
|
227
|
-
if (!f) return;
|
|
228
|
-
const { pkg: m } = w(f), l = m.version, s = "package.json", h = JSON.parse(S(s, "utf-8"));
|
|
229
|
-
h.version !== l && (h.version = l, b(s, JSON.stringify(h, null, 2) + `
|
|
230
|
-
`, "utf-8"), console.log(n.gray(` Updated root package.json version: ${l}`)));
|
|
231
|
-
}
|
|
232
|
-
async function L(i) {
|
|
233
|
-
console.log(n.cyan(`
|
|
234
|
-
Generating root CHANGELOG with package grouping...
|
|
235
|
-
`));
|
|
236
|
-
const f = "CHANGELOG.md", m = {
|
|
237
|
-
framework: "VC-Shell Framework (@vc-shell/framework)",
|
|
238
|
-
"cli/api-client": "API Client Generator (@vc-shell/api-client-generator)",
|
|
239
|
-
"cli/create-vc-app": "Create VC App (@vc-shell/create-vc-app)",
|
|
240
|
-
"configs/release-config": "Release Config (@vc-shell/release-config)",
|
|
241
|
-
"configs/vite-config": "Vite Config (@vc-shell/config-generator)",
|
|
242
|
-
"configs/ts-config": "TypeScript Config (@vc-shell/ts-config)"
|
|
243
|
-
}, l = {};
|
|
244
|
-
for (const c of i) {
|
|
245
|
-
if (c === ".") continue;
|
|
246
|
-
const a = N.join(c, "CHANGELOG.md"), r = m[c] || c;
|
|
247
|
-
if (!V(a)) continue;
|
|
248
|
-
const e = S(a, "utf-8").split(`
|
|
249
|
-
`);
|
|
250
|
-
let t = null, o = [];
|
|
251
|
-
for (const g of e) {
|
|
252
|
-
const d = g.match(/^##\s+(?:\[)?([\d.a-z-]+)(?:\])?(?:\s+\([^)]+\))?/i);
|
|
253
|
-
if (d) {
|
|
254
|
-
if (t && o.length > 0) {
|
|
255
|
-
const C = o.join(`
|
|
256
|
-
`).trim();
|
|
257
|
-
l[t] || (l[t] = {}), l[t][r] = C;
|
|
258
|
-
}
|
|
259
|
-
t = d[1], o = [];
|
|
260
|
-
} else t && g.trim() !== "" && !g.startsWith("# CHANGELOG") && !g.startsWith("All notable changes") && o.push(g);
|
|
261
|
-
}
|
|
262
|
-
if (t && o.length > 0) {
|
|
263
|
-
const g = o.join(`
|
|
264
|
-
`).trim();
|
|
265
|
-
l[t] || (l[t] = {}), l[t][r] = g;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
let s = `# CHANGELOG
|
|
269
|
-
|
|
270
|
-
All notable changes to this monorepo will be documented in this file.
|
|
271
|
-
|
|
272
|
-
`;
|
|
273
|
-
const h = Object.keys(l).sort((c, a) => {
|
|
274
|
-
const r = c.split(/[.-]/).map((e) => isNaN(parseInt(e)) ? e : parseInt(e)), u = a.split(/[.-]/).map((e) => isNaN(parseInt(e)) ? e : parseInt(e));
|
|
275
|
-
for (let e = 0; e < Math.max(r.length, u.length); e++) {
|
|
276
|
-
const t = r[e] ?? 0, o = u[e] ?? 0;
|
|
277
|
-
if (t !== o)
|
|
278
|
-
return typeof t == "number" && typeof o == "number" ? o - t : String(o).localeCompare(String(t));
|
|
279
|
-
}
|
|
280
|
-
return 0;
|
|
281
|
-
});
|
|
282
|
-
for (const c of h) {
|
|
283
|
-
const a = l[c], r = Object.values(a).some((e) => e && e.trim().length > 0);
|
|
284
|
-
if (s += `## ${c}
|
|
285
|
-
|
|
286
|
-
`, !r) {
|
|
287
|
-
s += `**Note:** Version bump only for package
|
|
288
|
-
|
|
289
|
-
`;
|
|
290
|
-
continue;
|
|
291
|
-
}
|
|
292
|
-
let u = !1;
|
|
293
|
-
for (const e of i) {
|
|
294
|
-
if (e === ".") continue;
|
|
295
|
-
const t = m[e] || e, o = a[t];
|
|
296
|
-
o && o.trim() && (u = !0, s += `### ${t}
|
|
297
|
-
|
|
298
|
-
`, s += `${o}
|
|
299
|
-
|
|
300
|
-
`);
|
|
301
|
-
}
|
|
302
|
-
u || (s += `**Note:** Version bump only for package
|
|
303
|
-
|
|
304
|
-
`);
|
|
305
|
-
}
|
|
306
|
-
s = s.replace(/\n{3,}/g, `
|
|
307
|
-
|
|
308
|
-
`), b(f, s, "utf-8"), console.log(n.green(" ✓ Generated root CHANGELOG.md with package grouping"));
|
|
309
|
-
}
|
|
310
|
-
async function I(i) {
|
|
311
|
-
if (p.tag)
|
|
312
|
-
for (const f of i) {
|
|
313
|
-
if (f === ".") continue;
|
|
314
|
-
const { pkg: m, pkgPath: l } = w(f), s = { ...m };
|
|
315
|
-
p.tag !== "latest" ? (s.npmTag = p.tag, await R(l, s)) : s.npmTag && (delete s.npmTag, await R(l, s));
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
160
|
export {
|
|
319
|
-
|
|
161
|
+
W as release
|
|
320
162
|
};
|
package/dist/release.d.ts
CHANGED
|
@@ -1,28 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Release function that
|
|
2
|
+
* Release function that prompts the user to select a release type and version, generates changelogs, commits changes, and pushes to GitHub.
|
|
3
3
|
* @param packages - An array of package names to release.
|
|
4
|
-
* @param bumpVersion - A function that takes a package name and version
|
|
4
|
+
* @param bumpVersion - A function that takes a package name and version and updates the package.json file with the new version.
|
|
5
5
|
* @param generateChangelog - A function that generates a changelog for a package with a given version.
|
|
6
6
|
* @param toTag - A function that takes a version and returns a tag name.
|
|
7
|
-
* @param customHooks - A function that takes a package name, version, and workspace name and returns a void or Promise<void>.
|
|
8
7
|
* @returns void
|
|
9
8
|
* @throws Error if there are no packages to release or if the target version is invalid.
|
|
10
9
|
*/
|
|
11
|
-
export declare const release: ({ packages, bumpVersion, generateChangelog, toTag,
|
|
10
|
+
export declare const release: ({ packages, bumpVersion, generateChangelog, toTag, }: {
|
|
12
11
|
packages: string[];
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* @param version
|
|
17
|
-
* @param workspaceName
|
|
18
|
-
* @returns
|
|
19
|
-
*/
|
|
20
|
-
customHooks: (version: string) => void | Promise<void>;
|
|
21
|
-
/** @deprecated Lerna handles version bumping automatically */
|
|
22
|
-
bumpVersion?: (pkgName: string, version: string) => void | Promise<void>;
|
|
23
|
-
/** @deprecated Lerna generates changelogs automatically */
|
|
24
|
-
generateChangelog?: (pkgName: string, version: string, workspaceName?: string) => void | Promise<void>;
|
|
25
|
-
/** @deprecated Lerna handles version bumping automatically */
|
|
26
|
-
toTag?: (version: string) => string;
|
|
12
|
+
bumpVersion: (pkgName: string, version: string) => void | Promise<void>;
|
|
13
|
+
generateChangelog: (pkgName: string, version: string, workspaceName?: string) => void | Promise<void>;
|
|
14
|
+
toTag: (version: string) => string;
|
|
27
15
|
}) => Promise<void>;
|
|
28
16
|
//# sourceMappingURL=release.d.ts.map
|
package/dist/release.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../src/release.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../src/release.ts"],"names":[],"mappings":"AAQA;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO,GAAU,sDAK3B;IACD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxE,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtG,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;CACpC,kBA+KA,CAAC"}
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kCAAkC,EAAE,MAAM,oBAAoB,CAAC;AAGxE,OAAO,GAAG,MAAM,KAAK,CAAC;AAItB,eAAO,MAAM,IAAI;;EAAqB,CAAC;AAEvC,eAAO,MAAM,QAAQ,SAAa,CAAC;AAOnC,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM;;cAIpC,MAAM;iBACH,MAAM;wBACC,MAAM;;;;EAIzB;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAM/E;AAED,wBAAsB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,kCAAkC,CAAC,uFAExG;AAED,wBAAsB,MAAM,CAC1B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EAAE,EACd,IAAI,CAAC,EAAE,OAAO,CAAC,kCAAkC,CAAC,GACjD,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,eAAO,MAAM,WAAW,4BAA0B,CAAC;AAEnD,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEtC;AAED,UAAU,aAAa;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,MAAM,GAAG,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kCAAkC,EAAE,MAAM,oBAAoB,CAAC;AAGxE,OAAO,GAAG,MAAM,KAAK,CAAC;AAItB,eAAO,MAAM,IAAI;;EAAqB,CAAC;AAEvC,eAAO,MAAM,QAAQ,SAAa,CAAC;AAOnC,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM;;cAIpC,MAAM;iBACH,MAAM;wBACC,MAAM;;;;EAIzB;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAM/E;AAED,wBAAsB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,kCAAkC,CAAC,uFAExG;AAED,wBAAsB,MAAM,CAC1B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EAAE,EACd,IAAI,CAAC,EAAE,OAAO,CAAC,kCAAkC,CAAC,GACjD,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,eAAO,MAAM,WAAW,4BAA0B,CAAC;AAEnD,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEtC;AAED,UAAU,aAAa;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,MAAM,GAAG,aAAa,EAAE,CAyCzE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vc-shell/release-config",
|
|
3
|
-
"version": "1.1.91
|
|
3
|
+
"version": "1.1.91",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/release-config.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"chalk": "^2.4.2",
|
|
15
15
|
"cross-spawn": "^7.0.3",
|
|
16
|
-
"lerna": "^9.0.0",
|
|
17
16
|
"mri": "^1.2.0",
|
|
18
17
|
"prompts": "^2.4.2",
|
|
19
18
|
"semver": "^7.5.4",
|
|
@@ -23,14 +22,12 @@
|
|
|
23
22
|
"@types/cross-spawn": "^6.0.6",
|
|
24
23
|
"@types/prompts": "^2.4.7",
|
|
25
24
|
"@types/semver": "^7.5.4",
|
|
26
|
-
"@vc-shell/ts-config": "1.1.91
|
|
25
|
+
"@vc-shell/ts-config": "^1.1.91",
|
|
27
26
|
"typescript": "^5.8.3",
|
|
28
27
|
"vite-plugin-dts": "^3.6.4"
|
|
29
28
|
},
|
|
30
29
|
"publishConfig": {
|
|
31
30
|
"access": "public",
|
|
32
31
|
"registry": "https://registry.npmjs.org/"
|
|
33
|
-
}
|
|
34
|
-
"stableVersion": "1.1.90",
|
|
35
|
-
"npmTag": "alpha"
|
|
32
|
+
}
|
|
36
33
|
}
|