@done-coding/cli-publish 0.7.13 → 0.7.14-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.
package/es/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { c as m } from "./index-f33712b6.js";
2
+ import { c as m } from "./index-b589f4ab.js";
3
3
  import "@done-coding/cli-utils";
4
4
  import "node:child_process";
5
5
  import "semver";
@@ -7,7 +7,7 @@ import S, { rmSync as K } from "node:fs";
7
7
  var I = /* @__PURE__ */ ((e) => (e.INIT = "init", e.EXEC = "exec", e.ALIAS = "alias", e))(I || {}), r = /* @__PURE__ */ ((e) => (e.MAJOR = "major", e.MINOR = "minor", e.PATCH = "patch", e.PREMAJOR = "premajor", e.PREMINOR = "preminor", e.PREPATCH = "prepatch", e.PRERELEASE = "prerelease", e.CUSTOM_VERSION = "custom version", e))(r || {}), f = /* @__PURE__ */ ((e) => (e.LATEST = "latest", e.NEXT = "next", e.ALPHA = "alpha", e.BETA = "beta", e.RC = "rc", e))(f || {}), c = /* @__PURE__ */ ((e) => (e.NPM = "npm", e.WEB = "web", e))(c || {});
8
8
  const R = {
9
9
  name: "@done-coding/cli-publish",
10
- version: "0.7.13",
10
+ version: "0.7.14-alpha.0",
11
11
  description: "项目发布命令行工具",
12
12
  bin: {
13
13
  "dc-publish": "es/cli.mjs"
@@ -55,22 +55,22 @@ const R = {
55
55
  m.warn("没有配置别名发布信息");
56
56
  return;
57
57
  }
58
- const { rootDir: d } = e, s = $({ rootDir: d }), { name: a, version: i } = s;
58
+ const { rootDir: d } = e, s = $({ rootDir: d }), { name: i, version: a } = s;
59
59
  return U({
60
60
  dir: G(R.cliConfig.moduleName),
61
61
  fn: async (n) => {
62
62
  var g;
63
- S.mkdirSync(n, { recursive: !0 }), l(`pnpm add ${a}@${i}`, {
63
+ S.mkdirSync(n, { recursive: !0 }), l(`pnpm add ${i}@${a}`, {
64
64
  stdio: "inherit",
65
65
  cwd: n
66
66
  });
67
- const h = (g = l(`npm dist-tag ${a}`).toString().trim().split(`
67
+ const h = (g = l(`npm dist-tag ${i}`).toString().trim().split(`
68
68
  `).map((E) => E.split(":").map((w) => w.trim())).find(
69
- ([, E]) => E === i
69
+ ([, E]) => E === a
70
70
  )) == null ? void 0 : g[0];
71
71
  if (!h)
72
- return m.warn(`没有找到 ${a}@${i} 对应的dist-tag`);
73
- const C = z.resolve(n, "node_modules", a), u = $({
72
+ return m.warn(`没有找到 ${i}@${a} 对应的dist-tag`);
73
+ const C = z.resolve(n, "node_modules", i), u = $({
74
74
  rootDir: C
75
75
  });
76
76
  for (let E of o) {
@@ -125,21 +125,21 @@ const R = {
125
125
  type: t,
126
126
  distTag: o
127
127
  }) => {
128
- let d = e.name, s = "", a;
129
- const { version: i } = e;
130
- if (!i)
128
+ let d = e.name, s = "", i;
129
+ const { version: a } = e;
130
+ if (!a)
131
131
  throw new Error("当前版本号为空");
132
132
  switch (t) {
133
133
  case r.PATCH:
134
134
  case r.MINOR:
135
135
  case r.MAJOR: {
136
- s = N(i, t), a = o || f.LATEST;
136
+ s = N(a, t), i = o || f.LATEST;
137
137
  break;
138
138
  }
139
139
  case r.PREPATCH:
140
140
  case r.PREMINOR:
141
141
  case r.PREMAJOR: {
142
- s = N(i, t, f.ALPHA), a = o || f.ALPHA;
142
+ s = N(a, t, f.ALPHA), i = o || f.ALPHA;
143
143
  break;
144
144
  }
145
145
  case r.PRERELEASE: {
@@ -149,7 +149,7 @@ const R = {
149
149
  message: "请输入修饰符",
150
150
  initial: f.ALPHA
151
151
  })).identifier;
152
- s = N(i, t, n), a = o || n;
152
+ s = N(a, t, n), i = o || n;
153
153
  break;
154
154
  }
155
155
  default:
@@ -157,16 +157,16 @@ const R = {
157
157
  type: "text",
158
158
  name: "customVersion",
159
159
  message: "请输入自定义版本号"
160
- })).customVersion, a = o || f.LATEST;
160
+ })).customVersion, i = o || f.LATEST;
161
161
  }
162
162
  if (!s)
163
163
  throw new Error("version is empty");
164
164
  return {
165
165
  name: d,
166
166
  version: s,
167
- tag: a
167
+ tag: i
168
168
  };
169
- }, ie = async ({
169
+ }, ae = async ({
170
170
  type: e,
171
171
  packageJson: t,
172
172
  distTag: o
@@ -192,7 +192,7 @@ const R = {
192
192
  type: n,
193
193
  distTag: o
194
194
  });
195
- const a = [
195
+ const i = [
196
196
  ...s.map((n) => ({
197
197
  title: `${n} (${d[n].version})`,
198
198
  value: n
@@ -204,23 +204,23 @@ const R = {
204
204
  title: n,
205
205
  value: n
206
206
  }))
207
- ], i = (await L({
207
+ ], a = (await L({
208
208
  type: "select",
209
209
  name: "selectType",
210
210
  message: `请选择发布类型,当前版本:${t.version}`,
211
- choices: a
211
+ choices: i
212
212
  })).selectType;
213
- return s.includes(i) ? d[i] : P({
213
+ return s.includes(a) ? d[a] : P({
214
214
  packageJson: t,
215
- type: i,
215
+ type: a,
216
216
  distTag: o
217
217
  });
218
218
  }
219
219
  }, x = async (e) => {
220
- const { mode: t, type: o, push: d, rootDir: s, distTag: a } = e, i = await H(e, () => ({})), n = i[t], A = await W(n), T = $({ rootDir: s }), p = await ie({
220
+ const { mode: t, type: o, push: d, rootDir: s, distTag: i } = e, a = await H(e, () => ({})), n = a[t], A = await W(n), T = $({ rootDir: s }), p = await ae({
221
221
  type: o,
222
222
  packageJson: T,
223
- distTag: a
223
+ distTag: i
224
224
  }), { version: h } = p;
225
225
  l(`npm version ${h}`, {
226
226
  cwd: s,
@@ -269,8 +269,8 @@ const R = {
269
269
  branchName: A.branchName,
270
270
  version: p.version,
271
271
  remoteInfo: A.remoteInfo
272
- }), m.success(`发布成功,版本号:${h}`), t === c.NPM && J(i) && M(e);
273
- }, ae = {
272
+ }), m.success(`发布成功,版本号:${h}`), t === c.NPM && J(a) && M(e);
273
+ }, ie = {
274
274
  command: "$0",
275
275
  describe: "执行发布命令",
276
276
  options: re(),
@@ -291,7 +291,7 @@ const R = {
291
291
  version: ce,
292
292
  subcommands: [
293
293
  ne,
294
- ae,
294
+ ie,
295
295
  se
296
296
  ].map(y),
297
297
  demandCommandCount: 1,
package/es/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { d as u, b as e, P as b, S as p, a as t, h as d } from "./index-f33712b6.js";
2
+ import { d as u, b as e, P as b, S as p, a as t, h as d } from "./index-b589f4ab.js";
3
3
  import "@done-coding/cli-utils";
4
4
  import "node:child_process";
5
5
  import "semver";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@done-coding/cli-publish",
3
- "version": "0.7.13",
3
+ "version": "0.7.14-alpha.0",
4
4
  "description": "项目发布命令行工具",
5
5
  "private": false,
6
6
  "module": "es/index.mjs",
@@ -41,12 +41,12 @@
41
41
  "license": "MIT",
42
42
  "sideEffects": false,
43
43
  "devDependencies": {
44
- "@done-coding/cli-inject": "0.5.20",
44
+ "@done-coding/cli-inject": "0.5.21-alpha.0",
45
45
  "@types/node": "^18.0.0",
46
46
  "@types/semver": "^7.5.3",
47
47
  "@types/yargs": "^17.0.28",
48
48
  "rimraf": "^6.0.1",
49
- "typescript": "^5.2.2",
49
+ "typescript": "^5.8.3",
50
50
  "vite": "^4.4.11",
51
51
  "vite-plugin-dts": "^3.6.0"
52
52
  },
@@ -54,8 +54,8 @@
54
54
  "node": ">=18.0.0"
55
55
  },
56
56
  "dependencies": {
57
- "@done-coding/cli-utils": "0.8.1",
57
+ "@done-coding/cli-utils": "0.8.2-alpha.0",
58
58
  "semver": "^7.5.4"
59
59
  },
60
- "gitHead": "0930f800167c04a86b56eae9741872dd51bec0c6"
60
+ "gitHead": "b09dd794f69ba2dafe22a3519d712d059c2eb376"
61
61
  }