@done-coding/cli-utils 0.4.0-alpha.0 → 0.5.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.
- package/es/index.mjs +187 -139
- package/package.json +4 -2
- package/types/git.d.ts +71 -0
- package/types/index.d.ts +1 -0
package/es/index.mjs
CHANGED
|
@@ -1,51 +1,52 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import O from "chalk";
|
|
3
|
-
import { default as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
3
|
+
import { default as pt } from "chalk";
|
|
4
|
+
import g from "node:path";
|
|
5
|
+
import b, { existsSync as y, mkdirSync as H, writeFileSync as C, readFileSync as d } from "node:fs";
|
|
6
|
+
import m from "crypto";
|
|
7
7
|
import D from "prompts";
|
|
8
|
-
import
|
|
8
|
+
import N from "yargs";
|
|
9
9
|
import { hideBin as A } from "yargs/helpers";
|
|
10
|
-
import { execSync as
|
|
11
|
-
import
|
|
10
|
+
import { execSync as a } from "node:child_process";
|
|
11
|
+
import v from "json5";
|
|
12
12
|
export * from "json5";
|
|
13
|
-
import { default as
|
|
14
|
-
import
|
|
15
|
-
import { default as
|
|
16
|
-
import { default as
|
|
13
|
+
import { default as yt } from "json5";
|
|
14
|
+
import u from "pinyin";
|
|
15
|
+
import { default as Ct } from "lodash.get";
|
|
16
|
+
import { default as $t } from "lodash.set";
|
|
17
|
+
import { default as wt } from "lodash.curry";
|
|
17
18
|
const c = Object.assign(
|
|
18
|
-
(
|
|
19
|
+
(t, ...r) => console.log(...r.map((e) => O[t](e))),
|
|
19
20
|
{
|
|
20
21
|
/** 成功 */
|
|
21
|
-
success: (...
|
|
22
|
+
success: (...t) => c("green", ...t),
|
|
22
23
|
/** /步骤 */
|
|
23
|
-
stage: (...
|
|
24
|
+
stage: (...t) => c("blue", ...t),
|
|
24
25
|
/** 提示信息 */
|
|
25
|
-
info: (...
|
|
26
|
+
info: (...t) => c("cyan", ...t),
|
|
26
27
|
/** 警告 */
|
|
27
|
-
warn: (...
|
|
28
|
+
warn: (...t) => c("yellow", ...t),
|
|
28
29
|
/** 错误 */
|
|
29
|
-
error: (...
|
|
30
|
+
error: (...t) => c("red", ...t),
|
|
30
31
|
/** 跳过 */
|
|
31
|
-
skip: (...
|
|
32
|
+
skip: (...t) => c("gray", ...t)
|
|
32
33
|
}
|
|
33
|
-
),
|
|
34
|
+
), tt = (t, {
|
|
34
35
|
/** 当前目录 */
|
|
35
36
|
currentDir: r = process.cwd(),
|
|
36
37
|
/** 优先找最远的父目录 */
|
|
37
|
-
isFindFarthest:
|
|
38
|
+
isFindFarthest: e = !0
|
|
38
39
|
} = {}) => {
|
|
39
|
-
const n =
|
|
40
|
+
const n = g.resolve(r).split(g.sep).map((o, i, l) => i ? g.join(l.slice(0, i).join(g.sep), o) : o);
|
|
40
41
|
for (; n.length; ) {
|
|
41
|
-
const o =
|
|
42
|
-
if (
|
|
42
|
+
const o = e ? n.shift() : n.pop(), i = g.join(o, t);
|
|
43
|
+
if (b.existsSync(i))
|
|
43
44
|
return o;
|
|
44
45
|
}
|
|
45
|
-
},
|
|
46
|
-
function
|
|
47
|
-
return
|
|
48
|
-
|
|
46
|
+
}, $ = "aes-256-cbc", P = 16, p = "hex", h = ":";
|
|
47
|
+
function w(t) {
|
|
48
|
+
return m.pbkdf2Sync(
|
|
49
|
+
t,
|
|
49
50
|
"done-coding-cli-salt",
|
|
50
51
|
// 使用固定的盐值
|
|
51
52
|
1e4,
|
|
@@ -55,84 +56,84 @@ function $(e) {
|
|
|
55
56
|
"sha256"
|
|
56
57
|
);
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
-
text:
|
|
59
|
+
function rt({
|
|
60
|
+
text: t,
|
|
60
61
|
secretKey: r
|
|
61
62
|
}) {
|
|
62
63
|
try {
|
|
63
|
-
const
|
|
64
|
-
let
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
return `${
|
|
68
|
-
} catch (
|
|
64
|
+
const e = w(r), n = m.randomBytes(P), o = m.createCipheriv($, e, n);
|
|
65
|
+
let i = o.update(t);
|
|
66
|
+
i = Buffer.concat([i, o.final()]);
|
|
67
|
+
const l = n.toString(p), s = i.toString(p);
|
|
68
|
+
return `${l}${h}${s}`;
|
|
69
|
+
} catch (e) {
|
|
69
70
|
return c.error(
|
|
70
|
-
`加密失败: ${
|
|
71
|
+
`加密失败: ${e instanceof Error ? e.message : String(e)}`
|
|
71
72
|
), "";
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
-
encryptedText:
|
|
75
|
+
function et({
|
|
76
|
+
encryptedText: t,
|
|
76
77
|
secretKey: r
|
|
77
78
|
}) {
|
|
78
79
|
try {
|
|
79
|
-
if (!
|
|
80
|
+
if (!t.includes(h))
|
|
80
81
|
return "";
|
|
81
|
-
const
|
|
82
|
-
if (n.length !==
|
|
82
|
+
const e = w(r), [n, o] = t.split(h);
|
|
83
|
+
if (n.length !== P * 2)
|
|
83
84
|
return "";
|
|
84
|
-
const
|
|
85
|
-
let
|
|
86
|
-
return
|
|
87
|
-
} catch (
|
|
85
|
+
const i = Buffer.from(n, p), l = Buffer.from(o, p), s = m.createDecipheriv($, e, i);
|
|
86
|
+
let f = s.update(l);
|
|
87
|
+
return f = Buffer.concat([f, s.final()]), f.toString();
|
|
88
|
+
} catch (e) {
|
|
88
89
|
return c.error(
|
|
89
|
-
`解密失败: ${
|
|
90
|
+
`解密失败: ${e instanceof Error ? e.message : String(e)}`
|
|
90
91
|
), "";
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
|
-
const
|
|
94
|
-
const [r,
|
|
94
|
+
const E = (...t) => {
|
|
95
|
+
const [r, e = {}] = t;
|
|
95
96
|
return D(r, {
|
|
96
97
|
onCancel(n) {
|
|
97
98
|
return c.error(`退出${n == null ? void 0 : n.name}输入`), process.exit(1);
|
|
98
99
|
},
|
|
99
|
-
...
|
|
100
|
+
...e
|
|
100
101
|
});
|
|
101
|
-
}, R = (
|
|
102
|
-
|
|
103
|
-
},
|
|
104
|
-
const
|
|
105
|
-
return
|
|
106
|
-
},
|
|
102
|
+
}, R = (t, r) => {
|
|
103
|
+
t ? c.error(t) : c.error(r.message), r != null && r.stack && c.error(r.stack), process.exit(1);
|
|
104
|
+
}, T = () => {
|
|
105
|
+
const t = A(process.argv);
|
|
106
|
+
return N(t);
|
|
107
|
+
}, j = (t, {
|
|
107
108
|
usage: r,
|
|
108
|
-
version:
|
|
109
|
+
version: e,
|
|
109
110
|
demandCommandCount: n,
|
|
110
111
|
options: o,
|
|
111
|
-
positionals:
|
|
112
|
-
subcommands:
|
|
112
|
+
positionals: i,
|
|
113
|
+
subcommands: l
|
|
113
114
|
}) => {
|
|
114
|
-
let
|
|
115
|
-
r && (
|
|
116
|
-
const
|
|
117
|
-
return
|
|
118
|
-
},
|
|
119
|
-
const
|
|
120
|
-
return
|
|
121
|
-
},
|
|
122
|
-
const { command: r, describe:
|
|
123
|
-
}, ...o } =
|
|
115
|
+
let s = t.strict();
|
|
116
|
+
r && (s = s.usage(`Usage: ${r}`)), n && (s = s.demandCommand(n));
|
|
117
|
+
const f = "help";
|
|
118
|
+
return s = s.help(f), e ? s = s.version(e).alias("h", f).alias("v", "version") : s = s.alias("h", f), o && (s = s.options(o)), i && (s = Object.entries(i).reduce((S, [k, x]) => S.positional(k, x), s)), l && (s = s.command(l)), s;
|
|
119
|
+
}, ot = async ({ handler: t, ...r }) => {
|
|
120
|
+
const e = await j(T(), r).fail(R).argv;
|
|
121
|
+
return t ? t(e) : e;
|
|
122
|
+
}, nt = (t) => {
|
|
123
|
+
const { command: r, describe: e, handler: n = () => {
|
|
124
|
+
}, ...o } = t;
|
|
124
125
|
return {
|
|
125
126
|
command: r,
|
|
126
|
-
describe:
|
|
127
|
-
builder(
|
|
128
|
-
return
|
|
127
|
+
describe: e,
|
|
128
|
+
builder(i) {
|
|
129
|
+
return j(i, o);
|
|
129
130
|
},
|
|
130
131
|
handler: n
|
|
131
132
|
};
|
|
132
133
|
};
|
|
133
|
-
var
|
|
134
|
-
const
|
|
135
|
-
const { editorType:
|
|
134
|
+
var _ = /* @__PURE__ */ ((t) => (t.VSCODE = "VsCode", t.CURSOR = "Cursor", t.OTHER = "其他", t))(_ || {});
|
|
135
|
+
const L = async () => {
|
|
136
|
+
const { editorType: t } = await E([
|
|
136
137
|
{
|
|
137
138
|
name: "editorType",
|
|
138
139
|
type: "select",
|
|
@@ -148,116 +149,163 @@ const N = async () => {
|
|
|
148
149
|
}))
|
|
149
150
|
}
|
|
150
151
|
]);
|
|
151
|
-
return
|
|
152
|
-
},
|
|
152
|
+
return t;
|
|
153
|
+
}, F = {
|
|
153
154
|
Cursor: "cursor",
|
|
154
155
|
VsCode: "code"
|
|
155
|
-
},
|
|
156
|
+
}, M = (t, r, e) => {
|
|
156
157
|
try {
|
|
157
|
-
|
|
158
|
+
a(`${t} -v`, { stdio: "ignore" }), a(`${t} ${r}`);
|
|
158
159
|
} catch {
|
|
159
|
-
|
|
160
|
+
e();
|
|
160
161
|
}
|
|
161
|
-
},
|
|
162
|
-
const
|
|
163
|
-
${n}, 请用编辑器打开 ${
|
|
162
|
+
}, B = (t, r) => {
|
|
163
|
+
const e = (n) => c.info(`
|
|
164
|
+
${n}, 请用编辑器打开 ${t} 进行编辑
|
|
164
165
|
`);
|
|
165
166
|
switch (r) {
|
|
166
167
|
case "Cursor":
|
|
167
168
|
case "VsCode": {
|
|
168
|
-
const n =
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
const n = F[r];
|
|
170
|
+
M(n, t, () => {
|
|
171
|
+
e(`${n}命令未安装`);
|
|
171
172
|
});
|
|
172
173
|
break;
|
|
173
174
|
}
|
|
174
175
|
default:
|
|
175
|
-
|
|
176
|
+
e("其他编辑器");
|
|
176
177
|
}
|
|
177
|
-
},
|
|
178
|
+
}, J = (t = process.cwd()) => ({
|
|
178
179
|
/** 必须保留 */
|
|
179
180
|
rootDir: {
|
|
180
181
|
type: "string",
|
|
181
182
|
alias: "R",
|
|
182
183
|
describe: "运行目录",
|
|
183
184
|
/** 必须设置默认值 */
|
|
184
|
-
default:
|
|
185
|
+
default: t
|
|
185
186
|
}
|
|
186
|
-
}),
|
|
187
|
-
configPathDefault:
|
|
187
|
+
}), it = ({
|
|
188
|
+
configPathDefault: t,
|
|
188
189
|
rootDirDefault: r
|
|
189
190
|
}) => ({
|
|
190
191
|
/** 必须保留 */
|
|
191
|
-
...
|
|
192
|
+
...J(r),
|
|
192
193
|
/** 必须保留 */
|
|
193
194
|
configPath: {
|
|
194
195
|
type: "string",
|
|
195
196
|
alias: "C",
|
|
196
197
|
describe: "配置文件相对路径",
|
|
197
198
|
/** 必须设置默认值 */
|
|
198
|
-
default:
|
|
199
|
+
default: t
|
|
199
200
|
}
|
|
200
|
-
}),
|
|
201
|
-
const { configPath:
|
|
202
|
-
return
|
|
201
|
+
}), V = async (t, r) => {
|
|
202
|
+
const { configPath: e, rootDir: n } = r, o = g.resolve(n, e), i = g.dirname(o);
|
|
203
|
+
return y(i) || H(i, {
|
|
203
204
|
recursive: !0
|
|
204
|
-
}), o.endsWith(".json5") ? (c.info(`json5模式写入 ${o}`),
|
|
205
|
-
},
|
|
206
|
-
onFileGenerated:
|
|
205
|
+
}), o.endsWith(".json5") ? (c.info(`json5模式写入 ${o}`), C(o, v.stringify(t, null, 2)), o) : (c.info(`json模式写入 ${o}`), C(o, JSON.stringify(t, null, 2)), o);
|
|
206
|
+
}, st = async (t, r, {
|
|
207
|
+
onFileGenerated: e,
|
|
207
208
|
edit: n = !1
|
|
208
209
|
} = {}) => {
|
|
209
|
-
const o = await
|
|
210
|
-
if (
|
|
211
|
-
const
|
|
212
|
-
|
|
210
|
+
const o = await V(t, r);
|
|
211
|
+
if (e == null || e(o), n) {
|
|
212
|
+
const i = await L();
|
|
213
|
+
B(r.configPath, i);
|
|
213
214
|
}
|
|
214
|
-
},
|
|
215
|
-
const { configPath:
|
|
216
|
-
if (!
|
|
215
|
+
}, ct = async (t, r) => {
|
|
216
|
+
const { configPath: e, rootDir: n } = t, o = g.resolve(n, e);
|
|
217
|
+
if (!y(o)) {
|
|
217
218
|
if (r)
|
|
218
219
|
return c.info("配置文件不存在,使用onNotExists返回值"), r();
|
|
219
|
-
const
|
|
220
|
-
throw new Error(
|
|
220
|
+
const i = `配置文件不存在 ${o}`;
|
|
221
|
+
throw new Error(i);
|
|
221
222
|
}
|
|
222
|
-
return o.endsWith(".json5") ? (c.info(`json5模式解析 ${o}`),
|
|
223
|
-
},
|
|
224
|
-
const { useDefaultConfig:
|
|
223
|
+
return o.endsWith(".json5") ? (c.info(`json5模式解析 ${o}`), v.parse(d(o, "utf8"))) : (c.info(`json模式解析 ${o}`), JSON.parse(d(o, "utf8")));
|
|
224
|
+
}, at = async () => {
|
|
225
|
+
const { useDefaultConfig: t } = await E({
|
|
225
226
|
name: "useDefaultConfig",
|
|
226
227
|
type: "confirm",
|
|
227
228
|
message: "使用默认模板配置",
|
|
228
229
|
initial: !0
|
|
229
230
|
});
|
|
230
|
-
return
|
|
231
|
-
},
|
|
232
|
-
rootDir:
|
|
231
|
+
return t;
|
|
232
|
+
}, Y = "./package.json", ft = ({
|
|
233
|
+
rootDir: t
|
|
233
234
|
}) => {
|
|
234
|
-
const r =
|
|
235
|
-
if (!
|
|
236
|
-
throw new Error(`${
|
|
237
|
-
const
|
|
238
|
-
return JSON.parse(
|
|
235
|
+
const r = g.resolve(t, Y);
|
|
236
|
+
if (!y(r))
|
|
237
|
+
throw new Error(`${t}未找到package.json文件`);
|
|
238
|
+
const e = d(r, "utf-8");
|
|
239
|
+
return JSON.parse(e);
|
|
240
|
+
}, lt = ({
|
|
241
|
+
remoteAlias: t
|
|
242
|
+
} = {}) => {
|
|
243
|
+
try {
|
|
244
|
+
const r = a("git rev-parse HEAD").toString().trim(), e = a('git log -1 --pretty=format:"%an"').toString().trim(), n = a('git log -1 --pretty=format:"%ae"').toString().trim(), o = a('git log -1 --pretty=format:"%s"').toString().trim(), i = a("git config user.name").toString().trim(), l = a("git config user.email").toString().trim(), s = a("git rev-parse --abbrev-ref HEAD").toString().trim();
|
|
245
|
+
let f = "";
|
|
246
|
+
try {
|
|
247
|
+
f = a(`git config --get remote.${t}.url`).toString().trim();
|
|
248
|
+
} catch {
|
|
249
|
+
c.warn("git远程仓库地址获取失败或者不存在");
|
|
250
|
+
}
|
|
251
|
+
return {
|
|
252
|
+
lastHash: r,
|
|
253
|
+
lastCommitter: e,
|
|
254
|
+
lastCommitterPinYin: u(e, {
|
|
255
|
+
style: u.STYLE_NORMAL,
|
|
256
|
+
heteronym: !1
|
|
257
|
+
}).join(""),
|
|
258
|
+
lastCommitEmail: n,
|
|
259
|
+
lastCommitMsg: o,
|
|
260
|
+
userName: i,
|
|
261
|
+
userNamePinYin: u(i, {
|
|
262
|
+
style: u.STYLE_NORMAL,
|
|
263
|
+
heteronym: !1
|
|
264
|
+
}).join(""),
|
|
265
|
+
userEmail: l,
|
|
266
|
+
branchName: s,
|
|
267
|
+
remoteInfo: f ? {
|
|
268
|
+
alias: t,
|
|
269
|
+
url: f
|
|
270
|
+
} : void 0
|
|
271
|
+
};
|
|
272
|
+
} catch (r) {
|
|
273
|
+
throw c.error("获取git最后提交信息失败"), r;
|
|
274
|
+
}
|
|
275
|
+
}, gt = ({
|
|
276
|
+
branchName: t,
|
|
277
|
+
version: r,
|
|
278
|
+
remoteInfo: e
|
|
279
|
+
}) => {
|
|
280
|
+
e && (a(`git push ${e.alias} v${r}`, {
|
|
281
|
+
stdio: "inherit"
|
|
282
|
+
}), a(`git push ${e.alias} ${t}`, {
|
|
283
|
+
stdio: "inherit"
|
|
284
|
+
}));
|
|
239
285
|
};
|
|
240
286
|
export {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
287
|
+
_ as EditorTypeEnum,
|
|
288
|
+
wt as _curry,
|
|
289
|
+
Ct as _get,
|
|
290
|
+
$t as _set,
|
|
291
|
+
pt as chalk,
|
|
292
|
+
ot as createMainCommand,
|
|
293
|
+
nt as createSubcommand,
|
|
294
|
+
et as decryptAES,
|
|
295
|
+
rt as encryptAES,
|
|
296
|
+
it as getConfigFileCommonOptions,
|
|
297
|
+
L as getEditorType,
|
|
298
|
+
lt as getGitLastCommitInfo,
|
|
299
|
+
ft as getPackageJson,
|
|
300
|
+
J as getRootDirOptions,
|
|
301
|
+
at as getUseDefaultConfig,
|
|
302
|
+
V as initConfigFile,
|
|
303
|
+
st as initHandlerCommon,
|
|
304
|
+
yt as json5,
|
|
258
305
|
c as log,
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
306
|
+
tt as lookForParentTarget,
|
|
307
|
+
B as openFileInEditor,
|
|
308
|
+
gt as pushGitPublishInfoToRemote,
|
|
309
|
+
ct as readConfigFile,
|
|
310
|
+
E as xPrompts
|
|
263
311
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@done-coding/cli-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-alpha.0",
|
|
4
4
|
"description": "cli utils",
|
|
5
5
|
"private": false,
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@types/lodash.get": "^4.4.9",
|
|
43
43
|
"@types/lodash.set": "^4.3.9",
|
|
44
44
|
"@types/node": "^18.0.0",
|
|
45
|
+
"@types/pinyin": "^2.10.0",
|
|
45
46
|
"@types/prompts": "^2.4.6",
|
|
46
47
|
"@types/yargs": "^17.0.28",
|
|
47
48
|
"rimraf": "^6.0.1",
|
|
@@ -58,8 +59,9 @@
|
|
|
58
59
|
"lodash.curry": "^4.1.1",
|
|
59
60
|
"lodash.get": "^4.4.2",
|
|
60
61
|
"lodash.set": "^4.3.2",
|
|
62
|
+
"pinyin": "^2.11.2",
|
|
61
63
|
"prompts": "^2.4.2",
|
|
62
64
|
"yargs": "^17.7.2"
|
|
63
65
|
},
|
|
64
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "86cdd3eaf8cc8be3e48a812b93fd7c2110fcc879"
|
|
65
67
|
}
|
package/types/git.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/** 获取git最好提交信息参数 */
|
|
2
|
+
export interface GetGitLastCommitParams {
|
|
3
|
+
/**
|
|
4
|
+
* 远程仓库别名
|
|
5
|
+
*/
|
|
6
|
+
remoteAlias?: string;
|
|
7
|
+
}
|
|
8
|
+
/** 远程仓库信息 */
|
|
9
|
+
export interface GitRemoteInfo {
|
|
10
|
+
/**
|
|
11
|
+
* 远程仓库别名
|
|
12
|
+
*/
|
|
13
|
+
alias?: GetGitLastCommitParams["remoteAlias"];
|
|
14
|
+
/**
|
|
15
|
+
* 仓库地址
|
|
16
|
+
*/
|
|
17
|
+
url?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* git最后提交信息
|
|
21
|
+
*/
|
|
22
|
+
export interface GitLastCommitInfo {
|
|
23
|
+
/**
|
|
24
|
+
* 最后一次提交hash值
|
|
25
|
+
*/
|
|
26
|
+
lastHash: string;
|
|
27
|
+
/**
|
|
28
|
+
* 最后一次提交者
|
|
29
|
+
*/
|
|
30
|
+
lastCommitter: string;
|
|
31
|
+
/**
|
|
32
|
+
* 最后一次提交者拼音
|
|
33
|
+
*/
|
|
34
|
+
lastCommitterPinYin: string;
|
|
35
|
+
/**
|
|
36
|
+
* 最后一次提交者邮箱
|
|
37
|
+
*/
|
|
38
|
+
lastCommitEmail: string;
|
|
39
|
+
/**
|
|
40
|
+
* 最后一次提交信息
|
|
41
|
+
*/
|
|
42
|
+
lastCommitMsg: string;
|
|
43
|
+
/**
|
|
44
|
+
* 用户名
|
|
45
|
+
*/
|
|
46
|
+
userName: string;
|
|
47
|
+
/**
|
|
48
|
+
* 用户名拼音
|
|
49
|
+
*/
|
|
50
|
+
userNamePinYin: string;
|
|
51
|
+
/**
|
|
52
|
+
* 邮箱
|
|
53
|
+
*/
|
|
54
|
+
userEmail: string;
|
|
55
|
+
/**
|
|
56
|
+
* 分知名
|
|
57
|
+
*/
|
|
58
|
+
branchName: string;
|
|
59
|
+
/** 远程仓库信息 */
|
|
60
|
+
remoteInfo?: GitRemoteInfo;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* 获取git 最后提交信息
|
|
64
|
+
*/
|
|
65
|
+
export declare const getGitLastCommitInfo: ({ remoteAlias, }?: GetGitLastCommitParams) => GitLastCommitInfo;
|
|
66
|
+
/** 推送git发布信息到远程仓库 */
|
|
67
|
+
export declare const pushGitPublishInfoToRemote: ({ branchName, version, remoteInfo, }: {
|
|
68
|
+
branchName: string;
|
|
69
|
+
version: string;
|
|
70
|
+
remoteInfo?: GitRemoteInfo | undefined;
|
|
71
|
+
}) => void;
|
package/types/index.d.ts
CHANGED