agmd 0.2.10 → 0.3.0-alpha0.1
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/README.md +80 -1
- package/bin/bin.js +148 -0
- package/bin/bin.js.map +7 -0
- package/lib/commands/get-file.d.ts +18 -0
- package/lib/commands/wirte-md.d.ts +9 -0
- package/lib/index.cjs.js +791 -58
- package/lib/index.cjs.js.map +3 -3
- package/lib/index.d.ts +3 -20
- package/lib/index.esm.js +815 -57
- package/lib/index.esm.js.map +3 -3
- package/package.json +14 -5
- package/bin/agmd.js +0 -25
- package/bin/agmd.js.map +0 -7
- package/bin/readme-file.js +0 -1
package/lib/index.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* agmd v0.
|
|
2
|
+
* agmd v0.3.0-alpha0.1
|
|
3
3
|
* author:kakajun <253495832@qq.com>
|
|
4
|
-
* Tue
|
|
4
|
+
* Tue Apr 05 2022 23:47:23 GMT+0800 (中国标准时间)
|
|
5
5
|
*/
|
|
6
6
|
var __create = Object.create;
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
@@ -10,6 +10,9 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
10
10
|
var __getProtoOf = Object.getPrototypeOf;
|
|
11
11
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
12
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
13
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
14
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
|
+
};
|
|
13
16
|
var __export = (target, all) => {
|
|
14
17
|
for (var name in all)
|
|
15
18
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -31,31 +34,768 @@ var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
|
31
34
|
};
|
|
32
35
|
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
33
36
|
|
|
37
|
+
// node_modules/_ms@2.1.2@ms/index.js
|
|
38
|
+
var require_ms_2_1 = __commonJS({
|
|
39
|
+
"node_modules/_ms@2.1.2@ms/index.js"(exports, module2) {
|
|
40
|
+
var s = 1e3;
|
|
41
|
+
var m = s * 60;
|
|
42
|
+
var h = m * 60;
|
|
43
|
+
var d = h * 24;
|
|
44
|
+
var w = d * 7;
|
|
45
|
+
var y = d * 365.25;
|
|
46
|
+
module2.exports = function(val, options) {
|
|
47
|
+
options = options || {};
|
|
48
|
+
var type = typeof val;
|
|
49
|
+
if (type === "string" && val.length > 0) {
|
|
50
|
+
return parse(val);
|
|
51
|
+
} else if (type === "number" && isFinite(val)) {
|
|
52
|
+
return options.long ? fmtLong(val) : fmtShort(val);
|
|
53
|
+
}
|
|
54
|
+
throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
|
|
55
|
+
};
|
|
56
|
+
function parse(str) {
|
|
57
|
+
str = String(str);
|
|
58
|
+
if (str.length > 100) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
|
|
62
|
+
if (!match) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
var n = parseFloat(match[1]);
|
|
66
|
+
var type = (match[2] || "ms").toLowerCase();
|
|
67
|
+
switch (type) {
|
|
68
|
+
case "years":
|
|
69
|
+
case "year":
|
|
70
|
+
case "yrs":
|
|
71
|
+
case "yr":
|
|
72
|
+
case "y":
|
|
73
|
+
return n * y;
|
|
74
|
+
case "weeks":
|
|
75
|
+
case "week":
|
|
76
|
+
case "w":
|
|
77
|
+
return n * w;
|
|
78
|
+
case "days":
|
|
79
|
+
case "day":
|
|
80
|
+
case "d":
|
|
81
|
+
return n * d;
|
|
82
|
+
case "hours":
|
|
83
|
+
case "hour":
|
|
84
|
+
case "hrs":
|
|
85
|
+
case "hr":
|
|
86
|
+
case "h":
|
|
87
|
+
return n * h;
|
|
88
|
+
case "minutes":
|
|
89
|
+
case "minute":
|
|
90
|
+
case "mins":
|
|
91
|
+
case "min":
|
|
92
|
+
case "m":
|
|
93
|
+
return n * m;
|
|
94
|
+
case "seconds":
|
|
95
|
+
case "second":
|
|
96
|
+
case "secs":
|
|
97
|
+
case "sec":
|
|
98
|
+
case "s":
|
|
99
|
+
return n * s;
|
|
100
|
+
case "milliseconds":
|
|
101
|
+
case "millisecond":
|
|
102
|
+
case "msecs":
|
|
103
|
+
case "msec":
|
|
104
|
+
case "ms":
|
|
105
|
+
return n;
|
|
106
|
+
default:
|
|
107
|
+
return void 0;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function fmtShort(ms) {
|
|
111
|
+
var msAbs = Math.abs(ms);
|
|
112
|
+
if (msAbs >= d) {
|
|
113
|
+
return Math.round(ms / d) + "d";
|
|
114
|
+
}
|
|
115
|
+
if (msAbs >= h) {
|
|
116
|
+
return Math.round(ms / h) + "h";
|
|
117
|
+
}
|
|
118
|
+
if (msAbs >= m) {
|
|
119
|
+
return Math.round(ms / m) + "m";
|
|
120
|
+
}
|
|
121
|
+
if (msAbs >= s) {
|
|
122
|
+
return Math.round(ms / s) + "s";
|
|
123
|
+
}
|
|
124
|
+
return ms + "ms";
|
|
125
|
+
}
|
|
126
|
+
function fmtLong(ms) {
|
|
127
|
+
var msAbs = Math.abs(ms);
|
|
128
|
+
if (msAbs >= d) {
|
|
129
|
+
return plural(ms, msAbs, d, "day");
|
|
130
|
+
}
|
|
131
|
+
if (msAbs >= h) {
|
|
132
|
+
return plural(ms, msAbs, h, "hour");
|
|
133
|
+
}
|
|
134
|
+
if (msAbs >= m) {
|
|
135
|
+
return plural(ms, msAbs, m, "minute");
|
|
136
|
+
}
|
|
137
|
+
if (msAbs >= s) {
|
|
138
|
+
return plural(ms, msAbs, s, "second");
|
|
139
|
+
}
|
|
140
|
+
return ms + " ms";
|
|
141
|
+
}
|
|
142
|
+
function plural(ms, msAbs, n, name) {
|
|
143
|
+
var isPlural = msAbs >= n * 1.5;
|
|
144
|
+
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
// node_modules/_debug@4.3.4@debug/src/common.js
|
|
150
|
+
var require_common = __commonJS({
|
|
151
|
+
"node_modules/_debug@4.3.4@debug/src/common.js"(exports, module2) {
|
|
152
|
+
function setup(env) {
|
|
153
|
+
createDebug.debug = createDebug;
|
|
154
|
+
createDebug.default = createDebug;
|
|
155
|
+
createDebug.coerce = coerce;
|
|
156
|
+
createDebug.disable = disable;
|
|
157
|
+
createDebug.enable = enable;
|
|
158
|
+
createDebug.enabled = enabled;
|
|
159
|
+
createDebug.humanize = require_ms_2_1();
|
|
160
|
+
createDebug.destroy = destroy;
|
|
161
|
+
Object.keys(env).forEach((key) => {
|
|
162
|
+
createDebug[key] = env[key];
|
|
163
|
+
});
|
|
164
|
+
createDebug.names = [];
|
|
165
|
+
createDebug.skips = [];
|
|
166
|
+
createDebug.formatters = {};
|
|
167
|
+
function selectColor(namespace) {
|
|
168
|
+
let hash = 0;
|
|
169
|
+
for (let i = 0; i < namespace.length; i++) {
|
|
170
|
+
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
171
|
+
hash |= 0;
|
|
172
|
+
}
|
|
173
|
+
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
174
|
+
}
|
|
175
|
+
createDebug.selectColor = selectColor;
|
|
176
|
+
function createDebug(namespace) {
|
|
177
|
+
let prevTime;
|
|
178
|
+
let enableOverride = null;
|
|
179
|
+
let namespacesCache;
|
|
180
|
+
let enabledCache;
|
|
181
|
+
function debug3(...args) {
|
|
182
|
+
if (!debug3.enabled) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const self = debug3;
|
|
186
|
+
const curr = Number(new Date());
|
|
187
|
+
const ms = curr - (prevTime || curr);
|
|
188
|
+
self.diff = ms;
|
|
189
|
+
self.prev = prevTime;
|
|
190
|
+
self.curr = curr;
|
|
191
|
+
prevTime = curr;
|
|
192
|
+
args[0] = createDebug.coerce(args[0]);
|
|
193
|
+
if (typeof args[0] !== "string") {
|
|
194
|
+
args.unshift("%O");
|
|
195
|
+
}
|
|
196
|
+
let index = 0;
|
|
197
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format2) => {
|
|
198
|
+
if (match === "%%") {
|
|
199
|
+
return "%";
|
|
200
|
+
}
|
|
201
|
+
index++;
|
|
202
|
+
const formatter = createDebug.formatters[format2];
|
|
203
|
+
if (typeof formatter === "function") {
|
|
204
|
+
const val = args[index];
|
|
205
|
+
match = formatter.call(self, val);
|
|
206
|
+
args.splice(index, 1);
|
|
207
|
+
index--;
|
|
208
|
+
}
|
|
209
|
+
return match;
|
|
210
|
+
});
|
|
211
|
+
createDebug.formatArgs.call(self, args);
|
|
212
|
+
const logFn = self.log || createDebug.log;
|
|
213
|
+
logFn.apply(self, args);
|
|
214
|
+
}
|
|
215
|
+
debug3.namespace = namespace;
|
|
216
|
+
debug3.useColors = createDebug.useColors();
|
|
217
|
+
debug3.color = createDebug.selectColor(namespace);
|
|
218
|
+
debug3.extend = extend;
|
|
219
|
+
debug3.destroy = createDebug.destroy;
|
|
220
|
+
Object.defineProperty(debug3, "enabled", {
|
|
221
|
+
enumerable: true,
|
|
222
|
+
configurable: false,
|
|
223
|
+
get: () => {
|
|
224
|
+
if (enableOverride !== null) {
|
|
225
|
+
return enableOverride;
|
|
226
|
+
}
|
|
227
|
+
if (namespacesCache !== createDebug.namespaces) {
|
|
228
|
+
namespacesCache = createDebug.namespaces;
|
|
229
|
+
enabledCache = createDebug.enabled(namespace);
|
|
230
|
+
}
|
|
231
|
+
return enabledCache;
|
|
232
|
+
},
|
|
233
|
+
set: (v) => {
|
|
234
|
+
enableOverride = v;
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
if (typeof createDebug.init === "function") {
|
|
238
|
+
createDebug.init(debug3);
|
|
239
|
+
}
|
|
240
|
+
return debug3;
|
|
241
|
+
}
|
|
242
|
+
function extend(namespace, delimiter) {
|
|
243
|
+
const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
|
|
244
|
+
newDebug.log = this.log;
|
|
245
|
+
return newDebug;
|
|
246
|
+
}
|
|
247
|
+
function enable(namespaces) {
|
|
248
|
+
createDebug.save(namespaces);
|
|
249
|
+
createDebug.namespaces = namespaces;
|
|
250
|
+
createDebug.names = [];
|
|
251
|
+
createDebug.skips = [];
|
|
252
|
+
let i;
|
|
253
|
+
const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
|
|
254
|
+
const len = split.length;
|
|
255
|
+
for (i = 0; i < len; i++) {
|
|
256
|
+
if (!split[i]) {
|
|
257
|
+
continue;
|
|
258
|
+
}
|
|
259
|
+
namespaces = split[i].replace(/\*/g, ".*?");
|
|
260
|
+
if (namespaces[0] === "-") {
|
|
261
|
+
createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$"));
|
|
262
|
+
} else {
|
|
263
|
+
createDebug.names.push(new RegExp("^" + namespaces + "$"));
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
function disable() {
|
|
268
|
+
const namespaces = [
|
|
269
|
+
...createDebug.names.map(toNamespace),
|
|
270
|
+
...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace)
|
|
271
|
+
].join(",");
|
|
272
|
+
createDebug.enable("");
|
|
273
|
+
return namespaces;
|
|
274
|
+
}
|
|
275
|
+
function enabled(name) {
|
|
276
|
+
if (name[name.length - 1] === "*") {
|
|
277
|
+
return true;
|
|
278
|
+
}
|
|
279
|
+
let i;
|
|
280
|
+
let len;
|
|
281
|
+
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
|
282
|
+
if (createDebug.skips[i].test(name)) {
|
|
283
|
+
return false;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
|
287
|
+
if (createDebug.names[i].test(name)) {
|
|
288
|
+
return true;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
293
|
+
function toNamespace(regexp) {
|
|
294
|
+
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
|
|
295
|
+
}
|
|
296
|
+
function coerce(val) {
|
|
297
|
+
if (val instanceof Error) {
|
|
298
|
+
return val.stack || val.message;
|
|
299
|
+
}
|
|
300
|
+
return val;
|
|
301
|
+
}
|
|
302
|
+
function destroy() {
|
|
303
|
+
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
304
|
+
}
|
|
305
|
+
createDebug.enable(createDebug.load());
|
|
306
|
+
return createDebug;
|
|
307
|
+
}
|
|
308
|
+
module2.exports = setup;
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
// node_modules/_debug@4.3.4@debug/src/browser.js
|
|
313
|
+
var require_browser = __commonJS({
|
|
314
|
+
"node_modules/_debug@4.3.4@debug/src/browser.js"(exports, module2) {
|
|
315
|
+
exports.formatArgs = formatArgs;
|
|
316
|
+
exports.save = save;
|
|
317
|
+
exports.load = load;
|
|
318
|
+
exports.useColors = useColors;
|
|
319
|
+
exports.storage = localstorage();
|
|
320
|
+
exports.destroy = (() => {
|
|
321
|
+
let warned = false;
|
|
322
|
+
return () => {
|
|
323
|
+
if (!warned) {
|
|
324
|
+
warned = true;
|
|
325
|
+
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
})();
|
|
329
|
+
exports.colors = [
|
|
330
|
+
"#0000CC",
|
|
331
|
+
"#0000FF",
|
|
332
|
+
"#0033CC",
|
|
333
|
+
"#0033FF",
|
|
334
|
+
"#0066CC",
|
|
335
|
+
"#0066FF",
|
|
336
|
+
"#0099CC",
|
|
337
|
+
"#0099FF",
|
|
338
|
+
"#00CC00",
|
|
339
|
+
"#00CC33",
|
|
340
|
+
"#00CC66",
|
|
341
|
+
"#00CC99",
|
|
342
|
+
"#00CCCC",
|
|
343
|
+
"#00CCFF",
|
|
344
|
+
"#3300CC",
|
|
345
|
+
"#3300FF",
|
|
346
|
+
"#3333CC",
|
|
347
|
+
"#3333FF",
|
|
348
|
+
"#3366CC",
|
|
349
|
+
"#3366FF",
|
|
350
|
+
"#3399CC",
|
|
351
|
+
"#3399FF",
|
|
352
|
+
"#33CC00",
|
|
353
|
+
"#33CC33",
|
|
354
|
+
"#33CC66",
|
|
355
|
+
"#33CC99",
|
|
356
|
+
"#33CCCC",
|
|
357
|
+
"#33CCFF",
|
|
358
|
+
"#6600CC",
|
|
359
|
+
"#6600FF",
|
|
360
|
+
"#6633CC",
|
|
361
|
+
"#6633FF",
|
|
362
|
+
"#66CC00",
|
|
363
|
+
"#66CC33",
|
|
364
|
+
"#9900CC",
|
|
365
|
+
"#9900FF",
|
|
366
|
+
"#9933CC",
|
|
367
|
+
"#9933FF",
|
|
368
|
+
"#99CC00",
|
|
369
|
+
"#99CC33",
|
|
370
|
+
"#CC0000",
|
|
371
|
+
"#CC0033",
|
|
372
|
+
"#CC0066",
|
|
373
|
+
"#CC0099",
|
|
374
|
+
"#CC00CC",
|
|
375
|
+
"#CC00FF",
|
|
376
|
+
"#CC3300",
|
|
377
|
+
"#CC3333",
|
|
378
|
+
"#CC3366",
|
|
379
|
+
"#CC3399",
|
|
380
|
+
"#CC33CC",
|
|
381
|
+
"#CC33FF",
|
|
382
|
+
"#CC6600",
|
|
383
|
+
"#CC6633",
|
|
384
|
+
"#CC9900",
|
|
385
|
+
"#CC9933",
|
|
386
|
+
"#CCCC00",
|
|
387
|
+
"#CCCC33",
|
|
388
|
+
"#FF0000",
|
|
389
|
+
"#FF0033",
|
|
390
|
+
"#FF0066",
|
|
391
|
+
"#FF0099",
|
|
392
|
+
"#FF00CC",
|
|
393
|
+
"#FF00FF",
|
|
394
|
+
"#FF3300",
|
|
395
|
+
"#FF3333",
|
|
396
|
+
"#FF3366",
|
|
397
|
+
"#FF3399",
|
|
398
|
+
"#FF33CC",
|
|
399
|
+
"#FF33FF",
|
|
400
|
+
"#FF6600",
|
|
401
|
+
"#FF6633",
|
|
402
|
+
"#FF9900",
|
|
403
|
+
"#FF9933",
|
|
404
|
+
"#FFCC00",
|
|
405
|
+
"#FFCC33"
|
|
406
|
+
];
|
|
407
|
+
function useColors() {
|
|
408
|
+
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
|
|
409
|
+
return true;
|
|
410
|
+
}
|
|
411
|
+
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
412
|
+
return false;
|
|
413
|
+
}
|
|
414
|
+
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
415
|
+
}
|
|
416
|
+
function formatArgs(args) {
|
|
417
|
+
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
|
|
418
|
+
if (!this.useColors) {
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
const c = "color: " + this.color;
|
|
422
|
+
args.splice(1, 0, c, "color: inherit");
|
|
423
|
+
let index = 0;
|
|
424
|
+
let lastC = 0;
|
|
425
|
+
args[0].replace(/%[a-zA-Z%]/g, (match) => {
|
|
426
|
+
if (match === "%%") {
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
index++;
|
|
430
|
+
if (match === "%c") {
|
|
431
|
+
lastC = index;
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
args.splice(lastC, 0, c);
|
|
435
|
+
}
|
|
436
|
+
exports.log = console.debug || console.log || (() => {
|
|
437
|
+
});
|
|
438
|
+
function save(namespaces) {
|
|
439
|
+
try {
|
|
440
|
+
if (namespaces) {
|
|
441
|
+
exports.storage.setItem("debug", namespaces);
|
|
442
|
+
} else {
|
|
443
|
+
exports.storage.removeItem("debug");
|
|
444
|
+
}
|
|
445
|
+
} catch (error) {
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
function load() {
|
|
449
|
+
let r;
|
|
450
|
+
try {
|
|
451
|
+
r = exports.storage.getItem("debug");
|
|
452
|
+
} catch (error) {
|
|
453
|
+
}
|
|
454
|
+
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
455
|
+
r = process.env.DEBUG;
|
|
456
|
+
}
|
|
457
|
+
return r;
|
|
458
|
+
}
|
|
459
|
+
function localstorage() {
|
|
460
|
+
try {
|
|
461
|
+
return localStorage;
|
|
462
|
+
} catch (error) {
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
module2.exports = require_common()(exports);
|
|
466
|
+
var { formatters } = module2.exports;
|
|
467
|
+
formatters.j = function(v) {
|
|
468
|
+
try {
|
|
469
|
+
return JSON.stringify(v);
|
|
470
|
+
} catch (error) {
|
|
471
|
+
return "[UnexpectedJSONParseError]: " + error.message;
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
// node_modules/supports-color/node_modules/has-flag/index.js
|
|
478
|
+
var require_has_flag = __commonJS({
|
|
479
|
+
"node_modules/supports-color/node_modules/has-flag/index.js"(exports, module2) {
|
|
480
|
+
"use strict";
|
|
481
|
+
module2.exports = (flag, argv) => {
|
|
482
|
+
argv = argv || process.argv;
|
|
483
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
484
|
+
const pos = argv.indexOf(prefix + flag);
|
|
485
|
+
const terminatorPos = argv.indexOf("--");
|
|
486
|
+
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
// node_modules/supports-color/index.js
|
|
492
|
+
var require_supports_color = __commonJS({
|
|
493
|
+
"node_modules/supports-color/index.js"(exports, module2) {
|
|
494
|
+
"use strict";
|
|
495
|
+
var os = require("os");
|
|
496
|
+
var hasFlag = require_has_flag();
|
|
497
|
+
var env = process.env;
|
|
498
|
+
var forceColor;
|
|
499
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
|
|
500
|
+
forceColor = false;
|
|
501
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
502
|
+
forceColor = true;
|
|
503
|
+
}
|
|
504
|
+
if ("FORCE_COLOR" in env) {
|
|
505
|
+
forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
|
|
506
|
+
}
|
|
507
|
+
function translateLevel(level) {
|
|
508
|
+
if (level === 0) {
|
|
509
|
+
return false;
|
|
510
|
+
}
|
|
511
|
+
return {
|
|
512
|
+
level,
|
|
513
|
+
hasBasic: true,
|
|
514
|
+
has256: level >= 2,
|
|
515
|
+
has16m: level >= 3
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
function supportsColor(stream) {
|
|
519
|
+
if (forceColor === false) {
|
|
520
|
+
return 0;
|
|
521
|
+
}
|
|
522
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
523
|
+
return 3;
|
|
524
|
+
}
|
|
525
|
+
if (hasFlag("color=256")) {
|
|
526
|
+
return 2;
|
|
527
|
+
}
|
|
528
|
+
if (stream && !stream.isTTY && forceColor !== true) {
|
|
529
|
+
return 0;
|
|
530
|
+
}
|
|
531
|
+
const min = forceColor ? 1 : 0;
|
|
532
|
+
if (process.platform === "win32") {
|
|
533
|
+
const osRelease = os.release().split(".");
|
|
534
|
+
if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
535
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
536
|
+
}
|
|
537
|
+
return 1;
|
|
538
|
+
}
|
|
539
|
+
if ("CI" in env) {
|
|
540
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
541
|
+
return 1;
|
|
542
|
+
}
|
|
543
|
+
return min;
|
|
544
|
+
}
|
|
545
|
+
if ("TEAMCITY_VERSION" in env) {
|
|
546
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
547
|
+
}
|
|
548
|
+
if (env.COLORTERM === "truecolor") {
|
|
549
|
+
return 3;
|
|
550
|
+
}
|
|
551
|
+
if ("TERM_PROGRAM" in env) {
|
|
552
|
+
const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
553
|
+
switch (env.TERM_PROGRAM) {
|
|
554
|
+
case "iTerm.app":
|
|
555
|
+
return version >= 3 ? 3 : 2;
|
|
556
|
+
case "Apple_Terminal":
|
|
557
|
+
return 2;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
561
|
+
return 2;
|
|
562
|
+
}
|
|
563
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
564
|
+
return 1;
|
|
565
|
+
}
|
|
566
|
+
if ("COLORTERM" in env) {
|
|
567
|
+
return 1;
|
|
568
|
+
}
|
|
569
|
+
if (env.TERM === "dumb") {
|
|
570
|
+
return min;
|
|
571
|
+
}
|
|
572
|
+
return min;
|
|
573
|
+
}
|
|
574
|
+
function getSupportLevel(stream) {
|
|
575
|
+
const level = supportsColor(stream);
|
|
576
|
+
return translateLevel(level);
|
|
577
|
+
}
|
|
578
|
+
module2.exports = {
|
|
579
|
+
supportsColor: getSupportLevel,
|
|
580
|
+
stdout: getSupportLevel(process.stdout),
|
|
581
|
+
stderr: getSupportLevel(process.stderr)
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
|
|
586
|
+
// node_modules/_debug@4.3.4@debug/src/node.js
|
|
587
|
+
var require_node = __commonJS({
|
|
588
|
+
"node_modules/_debug@4.3.4@debug/src/node.js"(exports, module2) {
|
|
589
|
+
var tty = require("tty");
|
|
590
|
+
var util = require("util");
|
|
591
|
+
exports.init = init;
|
|
592
|
+
exports.log = log;
|
|
593
|
+
exports.formatArgs = formatArgs;
|
|
594
|
+
exports.save = save;
|
|
595
|
+
exports.load = load;
|
|
596
|
+
exports.useColors = useColors;
|
|
597
|
+
exports.destroy = util.deprecate(() => {
|
|
598
|
+
}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
599
|
+
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
600
|
+
try {
|
|
601
|
+
const supportsColor = require_supports_color();
|
|
602
|
+
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
603
|
+
exports.colors = [
|
|
604
|
+
20,
|
|
605
|
+
21,
|
|
606
|
+
26,
|
|
607
|
+
27,
|
|
608
|
+
32,
|
|
609
|
+
33,
|
|
610
|
+
38,
|
|
611
|
+
39,
|
|
612
|
+
40,
|
|
613
|
+
41,
|
|
614
|
+
42,
|
|
615
|
+
43,
|
|
616
|
+
44,
|
|
617
|
+
45,
|
|
618
|
+
56,
|
|
619
|
+
57,
|
|
620
|
+
62,
|
|
621
|
+
63,
|
|
622
|
+
68,
|
|
623
|
+
69,
|
|
624
|
+
74,
|
|
625
|
+
75,
|
|
626
|
+
76,
|
|
627
|
+
77,
|
|
628
|
+
78,
|
|
629
|
+
79,
|
|
630
|
+
80,
|
|
631
|
+
81,
|
|
632
|
+
92,
|
|
633
|
+
93,
|
|
634
|
+
98,
|
|
635
|
+
99,
|
|
636
|
+
112,
|
|
637
|
+
113,
|
|
638
|
+
128,
|
|
639
|
+
129,
|
|
640
|
+
134,
|
|
641
|
+
135,
|
|
642
|
+
148,
|
|
643
|
+
149,
|
|
644
|
+
160,
|
|
645
|
+
161,
|
|
646
|
+
162,
|
|
647
|
+
163,
|
|
648
|
+
164,
|
|
649
|
+
165,
|
|
650
|
+
166,
|
|
651
|
+
167,
|
|
652
|
+
168,
|
|
653
|
+
169,
|
|
654
|
+
170,
|
|
655
|
+
171,
|
|
656
|
+
172,
|
|
657
|
+
173,
|
|
658
|
+
178,
|
|
659
|
+
179,
|
|
660
|
+
184,
|
|
661
|
+
185,
|
|
662
|
+
196,
|
|
663
|
+
197,
|
|
664
|
+
198,
|
|
665
|
+
199,
|
|
666
|
+
200,
|
|
667
|
+
201,
|
|
668
|
+
202,
|
|
669
|
+
203,
|
|
670
|
+
204,
|
|
671
|
+
205,
|
|
672
|
+
206,
|
|
673
|
+
207,
|
|
674
|
+
208,
|
|
675
|
+
209,
|
|
676
|
+
214,
|
|
677
|
+
215,
|
|
678
|
+
220,
|
|
679
|
+
221
|
|
680
|
+
];
|
|
681
|
+
}
|
|
682
|
+
} catch (error) {
|
|
683
|
+
}
|
|
684
|
+
exports.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
685
|
+
return /^debug_/i.test(key);
|
|
686
|
+
}).reduce((obj, key) => {
|
|
687
|
+
const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
|
|
688
|
+
return k.toUpperCase();
|
|
689
|
+
});
|
|
690
|
+
let val = process.env[key];
|
|
691
|
+
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
692
|
+
val = true;
|
|
693
|
+
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
694
|
+
val = false;
|
|
695
|
+
} else if (val === "null") {
|
|
696
|
+
val = null;
|
|
697
|
+
} else {
|
|
698
|
+
val = Number(val);
|
|
699
|
+
}
|
|
700
|
+
obj[prop] = val;
|
|
701
|
+
return obj;
|
|
702
|
+
}, {});
|
|
703
|
+
function useColors() {
|
|
704
|
+
return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
|
|
705
|
+
}
|
|
706
|
+
function formatArgs(args) {
|
|
707
|
+
const { namespace: name, useColors: useColors2 } = this;
|
|
708
|
+
if (useColors2) {
|
|
709
|
+
const c = this.color;
|
|
710
|
+
const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
|
|
711
|
+
const prefix = ` ${colorCode};1m${name} \x1B[0m`;
|
|
712
|
+
args[0] = prefix + args[0].split("\n").join("\n" + prefix);
|
|
713
|
+
args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
|
|
714
|
+
} else {
|
|
715
|
+
args[0] = getDate() + name + " " + args[0];
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
function getDate() {
|
|
719
|
+
if (exports.inspectOpts.hideDate) {
|
|
720
|
+
return "";
|
|
721
|
+
}
|
|
722
|
+
return new Date().toISOString() + " ";
|
|
723
|
+
}
|
|
724
|
+
function log(...args) {
|
|
725
|
+
return process.stderr.write(util.format(...args) + "\n");
|
|
726
|
+
}
|
|
727
|
+
function save(namespaces) {
|
|
728
|
+
if (namespaces) {
|
|
729
|
+
process.env.DEBUG = namespaces;
|
|
730
|
+
} else {
|
|
731
|
+
delete process.env.DEBUG;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
function load() {
|
|
735
|
+
return process.env.DEBUG;
|
|
736
|
+
}
|
|
737
|
+
function init(debug3) {
|
|
738
|
+
debug3.inspectOpts = {};
|
|
739
|
+
const keys = Object.keys(exports.inspectOpts);
|
|
740
|
+
for (let i = 0; i < keys.length; i++) {
|
|
741
|
+
debug3.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
module2.exports = require_common()(exports);
|
|
745
|
+
var { formatters } = module2.exports;
|
|
746
|
+
formatters.o = function(v) {
|
|
747
|
+
this.inspectOpts.colors = this.useColors;
|
|
748
|
+
return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
|
|
749
|
+
};
|
|
750
|
+
formatters.O = function(v) {
|
|
751
|
+
this.inspectOpts.colors = this.useColors;
|
|
752
|
+
return util.inspect(v, this.inspectOpts);
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
});
|
|
756
|
+
|
|
757
|
+
// node_modules/_debug@4.3.4@debug/src/index.js
|
|
758
|
+
var require_src = __commonJS({
|
|
759
|
+
"node_modules/_debug@4.3.4@debug/src/index.js"(exports, module2) {
|
|
760
|
+
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
761
|
+
module2.exports = require_browser();
|
|
762
|
+
} else {
|
|
763
|
+
module2.exports = require_node();
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
});
|
|
767
|
+
|
|
34
768
|
// src/index.ts
|
|
35
769
|
var src_exports = {};
|
|
36
770
|
__export(src_exports, {
|
|
37
771
|
getFileNodes: () => getFileNodes,
|
|
38
|
-
getMd: () => getMd
|
|
39
|
-
wirteMd: () => wirteMd
|
|
772
|
+
getMd: () => getMd
|
|
40
773
|
});
|
|
774
|
+
|
|
775
|
+
// src/commands/wirte-md.ts
|
|
776
|
+
var import_path2 = __toESM(require("path"));
|
|
777
|
+
|
|
778
|
+
// src/commands/get-file.ts
|
|
41
779
|
var import_fs = __toESM(require("fs"));
|
|
42
780
|
var import_path = __toESM(require("path"));
|
|
781
|
+
var import_debug = __toESM(require_src());
|
|
782
|
+
var debug = (0, import_debug.default)("get-file");
|
|
783
|
+
debug.enabled = false;
|
|
43
784
|
function getFile(file) {
|
|
44
785
|
const str = import_fs.default.readFileSync(file, "utf-8");
|
|
45
786
|
const size = str.length;
|
|
46
|
-
const sarr = str.split(/[\n
|
|
787
|
+
const sarr = str.split(/[\n]/g);
|
|
47
788
|
const rowSize = sarr.length;
|
|
48
789
|
const f = sarr[0].indexOf("eslint") === -1 && (sarr[0].indexOf("-->") > -1 || sarr[0].indexOf("*/") > -1 || sarr[0].indexOf("//") > -1) ? sarr[0] : "";
|
|
49
|
-
return {
|
|
790
|
+
return {
|
|
791
|
+
note: f,
|
|
792
|
+
size,
|
|
793
|
+
rowSize
|
|
794
|
+
};
|
|
50
795
|
}
|
|
51
|
-
function getFileNodes(
|
|
796
|
+
function getFileNodes(dir = import_path.default.resolve("./"), option, nodes = [], level = 0) {
|
|
52
797
|
let ignore = [
|
|
53
|
-
"public",
|
|
54
|
-
"build",
|
|
55
798
|
"img",
|
|
56
|
-
"assets",
|
|
57
|
-
"mock",
|
|
58
|
-
"api",
|
|
59
799
|
"styles",
|
|
60
800
|
"node_modules",
|
|
61
801
|
"LICENSE",
|
|
@@ -64,12 +804,7 @@ function getFileNodes(option, nodes = [], dir = import_path.default.resolve("./"
|
|
|
64
804
|
"dist",
|
|
65
805
|
".husky",
|
|
66
806
|
".vscode",
|
|
67
|
-
"babel.config.js",
|
|
68
|
-
"prettier.config.js",
|
|
69
|
-
"commitlint.config.js",
|
|
70
807
|
"readme-file.js",
|
|
71
|
-
"vue.config.js",
|
|
72
|
-
".eslintrc.js",
|
|
73
808
|
"readme-md.js"
|
|
74
809
|
];
|
|
75
810
|
let include = [".js", ".vue", ".ts"];
|
|
@@ -84,7 +819,9 @@ function getFileNodes(option, nodes = [], dir = import_path.default.resolve("./"
|
|
|
84
819
|
name: item,
|
|
85
820
|
isDir,
|
|
86
821
|
level,
|
|
87
|
-
note: ""
|
|
822
|
+
note: "",
|
|
823
|
+
imports: new Array(),
|
|
824
|
+
belongTo: new Array()
|
|
88
825
|
};
|
|
89
826
|
}).sort((a, b) => {
|
|
90
827
|
if (!a.isDir && b.isDir)
|
|
@@ -102,7 +839,7 @@ function getFileNodes(option, nodes = [], dir = import_path.default.resolve("./"
|
|
|
102
839
|
const fullPath = import_path.default.join(dir, item.name);
|
|
103
840
|
const isDir = import_fs.default.lstatSync(fullPath).isDirectory();
|
|
104
841
|
if (isDir) {
|
|
105
|
-
getFileNodes(option, item.children = [],
|
|
842
|
+
getFileNodes(fullPath, option, item.children = [], level + 1);
|
|
106
843
|
nodes.push(item);
|
|
107
844
|
} else {
|
|
108
845
|
const i = fullPath.lastIndexOf(".");
|
|
@@ -111,6 +848,7 @@ function getFileNodes(option, nodes = [], dir = import_path.default.resolve("./"
|
|
|
111
848
|
const obj = getFile(fullPath);
|
|
112
849
|
Object.assign(item, obj);
|
|
113
850
|
item.suffix = lastName;
|
|
851
|
+
item.fullPath = fullPath;
|
|
114
852
|
nodes.push(item);
|
|
115
853
|
}
|
|
116
854
|
}
|
|
@@ -123,13 +861,10 @@ function getNote(datas, keys) {
|
|
|
123
861
|
datas.forEach((obj, index) => {
|
|
124
862
|
const last = index === datas.length - 1;
|
|
125
863
|
if (obj.children) {
|
|
126
|
-
const md = setMd(obj, last);
|
|
127
|
-
nodes.push(md);
|
|
128
864
|
getNote(obj.children, nodes);
|
|
129
|
-
} else {
|
|
130
|
-
const md = setMd(obj, last);
|
|
131
|
-
nodes.push(md);
|
|
132
865
|
}
|
|
866
|
+
const md = setMd(obj, last);
|
|
867
|
+
nodes.push(md);
|
|
133
868
|
});
|
|
134
869
|
return nodes;
|
|
135
870
|
}
|
|
@@ -146,28 +881,11 @@ function setMd(obj, last) {
|
|
|
146
881
|
}
|
|
147
882
|
return filesString;
|
|
148
883
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const { rowTotleNumber, sizeTotleNumber, coutObj } = obj;
|
|
155
|
-
let countMd = "";
|
|
156
|
-
let totle = 0;
|
|
157
|
-
for (const key in coutObj) {
|
|
158
|
-
const ele = coutObj[key];
|
|
159
|
-
totle += ele;
|
|
160
|
-
countMd += `The suffix is ${key} has ${ele} files
|
|
161
|
-
`;
|
|
162
|
-
}
|
|
163
|
-
countMd += `The totle has ${totle} files
|
|
164
|
-
`;
|
|
165
|
-
let md = `Total number of file lines: ${format(rowTotleNumber)},
|
|
166
|
-
Total number of codes: ${format(sizeTotleNumber)}
|
|
167
|
-
`;
|
|
168
|
-
md = countMd + md;
|
|
169
|
-
return md;
|
|
170
|
-
}
|
|
884
|
+
|
|
885
|
+
// src/commands/wirte-md.ts
|
|
886
|
+
var import_debug2 = __toESM(require_src());
|
|
887
|
+
var debug2 = (0, import_debug2.default)("wirte-md");
|
|
888
|
+
debug2.enabled = false;
|
|
171
889
|
function getCountMd(datas) {
|
|
172
890
|
let rowTotleNumber = 0;
|
|
173
891
|
let sizeTotleNumber = 0;
|
|
@@ -192,9 +910,31 @@ function getCountMd(datas) {
|
|
|
192
910
|
coutObj
|
|
193
911
|
};
|
|
194
912
|
}
|
|
195
|
-
function
|
|
196
|
-
|
|
197
|
-
|
|
913
|
+
function format(num) {
|
|
914
|
+
var reg = /\d{1,3}(?=(\d{3})+$)/g;
|
|
915
|
+
return (num + "").replace(reg, "$&,");
|
|
916
|
+
}
|
|
917
|
+
function setCountMd(obj) {
|
|
918
|
+
const { rowTotleNumber, sizeTotleNumber, coutObj } = obj;
|
|
919
|
+
let countMd = "";
|
|
920
|
+
let totle = 0;
|
|
921
|
+
for (const key in coutObj) {
|
|
922
|
+
const ele = coutObj[key];
|
|
923
|
+
totle += ele;
|
|
924
|
+
countMd += `The suffix is ${key} has ${ele} files
|
|
925
|
+
`;
|
|
926
|
+
}
|
|
927
|
+
countMd += `The totle has ${totle} files
|
|
928
|
+
`;
|
|
929
|
+
let md = `Total number of file lines: ${format(rowTotleNumber)},
|
|
930
|
+
Total number of codes: ${format(sizeTotleNumber)}
|
|
931
|
+
`;
|
|
932
|
+
md = countMd + md;
|
|
933
|
+
return md;
|
|
934
|
+
}
|
|
935
|
+
function getMd(rootPath, option) {
|
|
936
|
+
console.log("\x1B[36m%s\x1B[0m", "*** run location: ", import_path2.default.resolve("./") + "\n");
|
|
937
|
+
const nodes = getFileNodes(rootPath, option);
|
|
198
938
|
const countMdObj = getCountMd(nodes);
|
|
199
939
|
const coutMd = setCountMd(countMdObj);
|
|
200
940
|
console.log("\x1B[33m%s\x1B[0m", coutMd);
|
|
@@ -203,19 +943,12 @@ function getMd(option) {
|
|
|
203
943
|
if (md.length > 0) {
|
|
204
944
|
console.log("\x1B[36m%s\x1B[0m", "*** Automatic generation completed ! ");
|
|
205
945
|
}
|
|
206
|
-
return md + coutMd;
|
|
207
|
-
}
|
|
208
|
-
function wirteMd(data, filePath) {
|
|
209
|
-
const file = import_path.default.resolve(__dirname, filePath);
|
|
210
|
-
import_fs.default.writeFile(file, data, { encoding: "utf8" }, () => {
|
|
211
|
-
console.log("Write successful");
|
|
212
|
-
});
|
|
946
|
+
return { md: md + coutMd, nodes };
|
|
213
947
|
}
|
|
214
948
|
module.exports = __toCommonJS(src_exports);
|
|
215
949
|
// Annotate the CommonJS export names for ESM import in node:
|
|
216
950
|
0 && (module.exports = {
|
|
217
951
|
getFileNodes,
|
|
218
|
-
getMd
|
|
219
|
-
wirteMd
|
|
952
|
+
getMd
|
|
220
953
|
});
|
|
221
954
|
//# sourceMappingURL=index.cjs.js.map
|