@vc-shell/release-config 1.1.31 → 1.1.34

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 CHANGED
@@ -1,3 +1,15 @@
1
+ ## [1.1.34](https://github.com/VirtoCommerce/vc-shell/compare/v1.1.33...v1.1.34) (2025-06-23)
2
+
3
+
4
+
5
+ ## [1.1.33](https://github.com/VirtoCommerce/vc-shell/compare/v1.1.32...v1.1.33) (2025-06-23)
6
+
7
+
8
+
9
+ ## [1.1.32](https://github.com/VirtoCommerce/vc-shell/compare/v1.1.31...v1.1.32) (2025-06-23)
10
+
11
+
12
+
1
13
  ## [1.1.31](https://github.com/VirtoCommerce/vc-shell/compare/v1.1.30...v1.1.31) (2025-06-23)
2
14
 
3
15
 
@@ -1,32 +1,32 @@
1
- import p from "prompts";
2
- import { inc as y, valid as x, parse as S } from "semver";
3
- import { readFileSync as C, writeFileSync as I } from "node:fs";
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
4
  import k from "node:path";
5
5
  import s from "chalk";
6
- import R from "mri";
7
- import { argv as A } from "node:process";
8
- import { sync as D } from "cross-spawn";
9
- const e = R(A.slice(2)), b = !!e.dry;
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
10
  b && (console.log(s.inverse(s.yellow(" DRY RUN "))), console.log());
11
11
  function w(t) {
12
12
  const n = k.resolve(t), l = k.resolve(n, "package.json");
13
13
  return { pkg: JSON.parse(C(l, "utf-8")), pkgDir: n, pkgPath: l };
14
14
  }
15
- async function M(t, n) {
15
+ async function T(t, n) {
16
16
  if (b) {
17
17
  console.log(s.blue(`[dryrun] Writing package.json to ${t}`));
18
18
  return;
19
19
  }
20
- I(t, JSON.stringify(n, null, 2) + `
20
+ D(t, JSON.stringify(n, null, 2) + `
21
21
  `, "utf-8");
22
22
  }
23
- async function N(t, n, l) {
24
- return D(t, n, { stdio: "inherit", ...l });
23
+ async function P(t, n, l) {
24
+ return U(t, n, { stdio: "inherit", ...l });
25
25
  }
26
- async function U(t, n, l) {
26
+ async function A(t, n, l) {
27
27
  return console.log(s.blue(`[dryrun] ${t} ${n.join(" ")}`), l || "");
28
28
  }
29
- const u = b ? U : N;
29
+ const f = b ? A : P;
30
30
  function d(t) {
31
31
  return console.log(s.cyan(t));
32
32
  }
@@ -34,8 +34,8 @@ function E(t) {
34
34
  function n(r, o) {
35
35
  if (r === "prerelease" && o === "alpha") {
36
36
  if (t.includes("-alpha")) {
37
- const [f, c] = t.split("-alpha."), h = parseInt(c) + 1;
38
- return `${f}-alpha.${h}`;
37
+ const [h, p] = t.split("-alpha."), $ = parseInt(p) + 1;
38
+ return `${h}-alpha.${$}`;
39
39
  }
40
40
  return `${y(t, "patch")}-alpha.0`;
41
41
  }
@@ -64,7 +64,7 @@ function E(t) {
64
64
  }
65
65
  ].map((r) => (r.title = `${r.title} (${r.value})`, r));
66
66
  }
67
- const H = async ({
67
+ const W = async ({
68
68
  packages: t,
69
69
  bumpVersion: n,
70
70
  generateChangelog: l,
@@ -73,26 +73,26 @@ const H = async ({
73
73
  let o;
74
74
  if (t.length === 0)
75
75
  throw new Error("No packages to release");
76
- const { pkg: $ } = w(t[0]);
76
+ const { pkg: v } = w(t[0]);
77
77
  if (!o) {
78
- const { release: a } = await p({
78
+ const { release: a } = await u({
79
79
  type: "select",
80
80
  name: "release",
81
81
  message: "Select release type",
82
- choices: E($.version)
82
+ choices: E(v.version)
83
83
  });
84
- a === "custom" ? o = (await p({
84
+ a === "custom" ? o = (await u({
85
85
  type: "text",
86
86
  name: "version",
87
87
  message: "Input custom version",
88
- initial: $.version
88
+ initial: v.version
89
89
  })).version : o = a;
90
90
  }
91
- if (!x(o))
91
+ if (!S(o))
92
92
  throw new Error(`invalid target version: ${o}`);
93
- const f = o.match(/-([a-zA-Z]+)(?:\.(\d+))?$/);
94
- if (f && !e.tag && (e.tag = f[1]), !e.tag) {
95
- const { npmTag: a } = await p({
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({
96
96
  type: "select",
97
97
  name: "npmTag",
98
98
  message: "Select npm distribution tag",
@@ -105,7 +105,7 @@ const H = async ({
105
105
  ]
106
106
  });
107
107
  if (a === "custom") {
108
- const g = await p({
108
+ const g = await u({
109
109
  type: "text",
110
110
  name: "customTag",
111
111
  message: "Input custom npm tag",
@@ -115,50 +115,48 @@ const H = async ({
115
115
  } else a !== "latest" && (e.tag = a);
116
116
  }
117
117
  if (e.tag && e.tag !== "latest") {
118
- const a = S(o);
118
+ const a = R(o);
119
119
  if (a && !o.includes(`-${e.tag}`)) {
120
- let i, m = 0;
121
- a.prerelease.length > 0 ? (a.prerelease.length > 1 && typeof a.prerelease[1] == "number" && (m = a.prerelease[1]), i = `${`${a.major}.${a.minor}.${a.patch}`}-${e.tag}`) : i = `${y(o, "minor")}-${e.tag}`;
122
- const { usePreNum: v } = await p({
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
123
  type: "confirm",
124
124
  name: "usePreNum",
125
- message: `Add prerelease number to version? (e.g. ${i}.${m})`,
125
+ message: `Add prerelease number to version? (e.g. ${i}.${c})`,
126
126
  initial: !0
127
127
  });
128
- v && (i = `${i}.${m}`);
128
+ m && (i = `${i}.${c}`);
129
129
  }
130
130
  }
131
- const c = r(o);
132
- let h = `release: ${c}`;
133
- e.tag && e.tag !== "latest" && (h += ` with npm tag ${e.tag}`);
134
- const { yes: P } = await p({
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({
135
135
  type: "confirm",
136
136
  name: "yes",
137
- message: `Releasing ${s.yellow(c)}${e.tag && e.tag !== "latest" ? ` with npm tag ${s.blue(e.tag)}` : ""} Confirm?`
137
+ message: `Releasing ${s.yellow(p)}${e.tag && e.tag !== "latest" ? ` with npm tag ${s.blue(e.tag)}` : ""} Confirm?`
138
138
  });
139
- if (!P) return;
139
+ if (!N) return;
140
140
  for (let a = 0; a < t.length; a++) {
141
141
  const g = t[a], { pkg: i } = w(g);
142
- if (d(`
143
- Updating ${s.green(i.name)} package version to ${s.green(o)}...`), await n(i.name, o), e.tag && e.tag !== "latest") {
144
- const m = w(g), v = { ...m.pkg, npmTag: e.tag };
145
- await M(m.pkgPath, v), console.log(`Added npmTag: ${s.blue(e.tag)} to ${s.green(i.name)}`);
146
- }
147
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(`
148
146
  Generating ${s.green(i.name)} changelog...`), await l(i.name, o, g);
149
147
  }
150
- const { stdout: T } = await N("git", ["diff"], { stdio: "pipe" });
151
- if (T)
148
+ const { stdout: j } = await P("git", ["diff"], { stdio: "pipe" });
149
+ if (j)
152
150
  d(`
153
- Committing changes...`), await u("git", ["add", "-A"]), await u("git", ["commit", "-m", h, "--no-verify"]), await u("git", ["tag", c]);
151
+ Committing changes...`), await f("git", ["add", "-A"]), await f("git", ["commit", "-m", $, "--no-verify"]), await f("git", ["tag", p]);
154
152
  else {
155
153
  console.log("No changes to commit.");
156
154
  return;
157
155
  }
158
156
  d(`
159
- Pushing to GitHub...`), await u("git", ["push", "origin", `refs/tags/${c}`]), await u("git", ["push"]), e.tag && e.tag !== "latest" && console.log(`
157
+ Pushing to GitHub...`), await f("git", ["push", "origin", `refs/tags/${p}`]), await f("git", ["push"]), e.tag && e.tag !== "latest" && console.log(`
160
158
  NOTE: This release will be published to npm with tag ${s.blue(e.tag)}`), console.log();
161
159
  };
162
160
  export {
163
- H as release
161
+ W as release
164
162
  };
@@ -1 +1 @@
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,kBAyKA,CAAC"}
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vc-shell/release-config",
3
- "version": "1.1.31",
3
+ "version": "1.1.34",
4
4
  "type": "module",
5
5
  "main": "dist/release-config.js",
6
6
  "types": "./dist/index.d.ts",
@@ -22,13 +22,12 @@
22
22
  "@types/cross-spawn": "^6.0.6",
23
23
  "@types/prompts": "^2.4.7",
24
24
  "@types/semver": "^7.5.4",
25
- "@vc-shell/ts-config": "^1.1.31",
25
+ "@vc-shell/ts-config": "^1.1.34",
26
26
  "typescript": "^5.8.3",
27
27
  "vite-plugin-dts": "^3.6.4"
28
28
  },
29
29
  "publishConfig": {
30
30
  "access": "public",
31
31
  "registry": "https://registry.npmjs.org/"
32
- },
33
- "npmTag": "next"
32
+ }
34
33
  }