agmd 0.3.12 → 0.3.13
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.EN.md +1 -1
- package/README.md +2 -0
- package/es6/package.json +81 -0
- package/es6/script/cli/handle.js +20 -0
- package/es6/script/cli/handle.js.map +1 -0
- package/es6/script/cli/index.js +23 -0
- package/es6/script/cli/index.js.map +1 -0
- package/es6/script/help/index.js +24 -0
- package/es6/script/help/index.js.map +1 -0
- package/es6/src/bin.js +7 -0
- package/es6/src/bin.js.map +1 -0
- package/es6/src/commands/agmd.js +24 -0
- package/es6/src/commands/agmd.js.map +1 -0
- package/es6/src/commands/change-path.js +119 -0
- package/es6/src/commands/change-path.js.map +1 -0
- package/es6/src/commands/command-actions.js +101 -0
- package/es6/src/commands/command-actions.js.map +1 -0
- package/es6/src/commands/command-handler.js +123 -0
- package/es6/src/commands/command-handler.js.map +1 -0
- package/es6/src/commands/get-file.js +163 -0
- package/es6/src/commands/get-file.js.map +1 -0
- package/es6/src/commands/get-router.js +110 -0
- package/es6/src/commands/get-router.js.map +1 -0
- package/es6/src/commands/mark-file.js +130 -0
- package/es6/src/commands/mark-file.js.map +1 -0
- package/es6/src/commands/mark-write-file.js +53 -0
- package/es6/src/commands/mark-write-file.js.map +1 -0
- package/es6/src/commands/rename-path.js +186 -0
- package/es6/src/commands/rename-path.js.map +1 -0
- package/es6/src/commands/wirte-md.js +82 -0
- package/es6/src/commands/wirte-md.js.map +1 -0
- package/{lib/index.d.ts → es6/src/index.js} +1 -0
- package/es6/src/index.js.map +1 -0
- package/es6/src/shared/constant.js +5 -0
- package/es6/src/shared/constant.js.map +1 -0
- package/es6/src/types.js +2 -0
- package/es6/src/types.js.map +1 -0
- package/es6/src/utils/router-utils.js +37 -0
- package/es6/src/utils/router-utils.js.map +1 -0
- package/lib/package.json +81 -0
- package/lib/script/cli/handle.js +25 -0
- package/lib/script/cli/handle.js.map +1 -0
- package/lib/script/cli/index.js +28 -0
- package/lib/script/cli/index.js.map +1 -0
- package/lib/script/help/index.js +26 -0
- package/lib/script/help/index.js.map +1 -0
- package/lib/src/bin.js +9 -0
- package/lib/src/bin.js.map +1 -0
- package/lib/src/commands/agmd.js +29 -0
- package/lib/src/commands/agmd.js.map +1 -0
- package/lib/src/commands/change-path.js +132 -0
- package/lib/src/commands/change-path.js.map +1 -0
- package/lib/src/commands/command-actions.js +117 -0
- package/lib/src/commands/command-actions.js.map +1 -0
- package/lib/src/commands/command-handler.js +131 -0
- package/lib/src/commands/command-handler.js.map +1 -0
- package/lib/src/commands/get-file.js +173 -0
- package/lib/src/commands/get-file.js.map +1 -0
- package/lib/src/commands/get-router.js +143 -0
- package/lib/src/commands/get-router.js.map +1 -0
- package/lib/src/commands/mark-file.js +143 -0
- package/lib/src/commands/mark-file.js.map +1 -0
- package/lib/src/commands/mark-write-file.js +61 -0
- package/lib/src/commands/mark-write-file.js.map +1 -0
- package/lib/src/commands/rename-path.js +201 -0
- package/lib/src/commands/rename-path.js.map +1 -0
- package/lib/src/commands/wirte-md.js +90 -0
- package/lib/src/commands/wirte-md.js.map +1 -0
- package/lib/src/index.js +8 -0
- package/lib/src/index.js.map +1 -0
- package/lib/src/shared/constant.js +8 -0
- package/lib/src/shared/constant.js.map +1 -0
- package/lib/src/types.js +3 -0
- package/lib/src/types.js.map +1 -0
- package/lib/src/utils/router-utils.js +43 -0
- package/lib/src/utils/router-utils.js.map +1 -0
- package/package.json +26 -27
- package/bin/bin.js +0 -160
- package/bin/bin.js.map +0 -7
- package/lib/commands/change-path.d.ts +0 -12
- package/lib/commands/get-file.d.ts +0 -26
- package/lib/commands/wirte-md.d.ts +0 -9
- package/lib/index.cjs.js +0 -1251
- package/lib/index.cjs.js.map +0 -7
- package/lib/index.esm.js +0 -1243
- package/lib/index.esm.js.map +0 -7
- package/lib/shared/logger.d.ts +0 -7
package/lib/index.cjs.js
DELETED
|
@@ -1,1251 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* agmd v0.3.11
|
|
3
|
-
* author:kakajun <253495832@qq.com>
|
|
4
|
-
* Tue Nov 28 2023 22:44:13 GMT+0800 (中国标准时间)
|
|
5
|
-
*/
|
|
6
|
-
"use strict";
|
|
7
|
-
var __create = Object.create;
|
|
8
|
-
var __defProp = Object.defineProperty;
|
|
9
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
11
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
12
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
14
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
|
-
};
|
|
16
|
-
var __export = (target, all) => {
|
|
17
|
-
for (var name in all)
|
|
18
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
-
};
|
|
20
|
-
var __copyProps = (to, from, except, desc) => {
|
|
21
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
-
for (let key of __getOwnPropNames(from))
|
|
23
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
-
mod
|
|
35
|
-
));
|
|
36
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
-
|
|
38
|
-
// node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js
|
|
39
|
-
var require_ms = __commonJS({
|
|
40
|
-
"node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js"(exports, module2) {
|
|
41
|
-
var s = 1e3;
|
|
42
|
-
var m = s * 60;
|
|
43
|
-
var h = m * 60;
|
|
44
|
-
var d = h * 24;
|
|
45
|
-
var w = d * 7;
|
|
46
|
-
var y = d * 365.25;
|
|
47
|
-
module2.exports = function(val, options2) {
|
|
48
|
-
options2 = options2 || {};
|
|
49
|
-
var type = typeof val;
|
|
50
|
-
if (type === "string" && val.length > 0) {
|
|
51
|
-
return parse(val);
|
|
52
|
-
} else if (type === "number" && isFinite(val)) {
|
|
53
|
-
return options2.long ? fmtLong(val) : fmtShort(val);
|
|
54
|
-
}
|
|
55
|
-
throw new Error(
|
|
56
|
-
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
57
|
-
);
|
|
58
|
-
};
|
|
59
|
-
function parse(str) {
|
|
60
|
-
str = String(str);
|
|
61
|
-
if (str.length > 100) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
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(
|
|
65
|
-
str
|
|
66
|
-
);
|
|
67
|
-
if (!match) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
var n = parseFloat(match[1]);
|
|
71
|
-
var type = (match[2] || "ms").toLowerCase();
|
|
72
|
-
switch (type) {
|
|
73
|
-
case "years":
|
|
74
|
-
case "year":
|
|
75
|
-
case "yrs":
|
|
76
|
-
case "yr":
|
|
77
|
-
case "y":
|
|
78
|
-
return n * y;
|
|
79
|
-
case "weeks":
|
|
80
|
-
case "week":
|
|
81
|
-
case "w":
|
|
82
|
-
return n * w;
|
|
83
|
-
case "days":
|
|
84
|
-
case "day":
|
|
85
|
-
case "d":
|
|
86
|
-
return n * d;
|
|
87
|
-
case "hours":
|
|
88
|
-
case "hour":
|
|
89
|
-
case "hrs":
|
|
90
|
-
case "hr":
|
|
91
|
-
case "h":
|
|
92
|
-
return n * h;
|
|
93
|
-
case "minutes":
|
|
94
|
-
case "minute":
|
|
95
|
-
case "mins":
|
|
96
|
-
case "min":
|
|
97
|
-
case "m":
|
|
98
|
-
return n * m;
|
|
99
|
-
case "seconds":
|
|
100
|
-
case "second":
|
|
101
|
-
case "secs":
|
|
102
|
-
case "sec":
|
|
103
|
-
case "s":
|
|
104
|
-
return n * s;
|
|
105
|
-
case "milliseconds":
|
|
106
|
-
case "millisecond":
|
|
107
|
-
case "msecs":
|
|
108
|
-
case "msec":
|
|
109
|
-
case "ms":
|
|
110
|
-
return n;
|
|
111
|
-
default:
|
|
112
|
-
return void 0;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
function fmtShort(ms) {
|
|
116
|
-
var msAbs = Math.abs(ms);
|
|
117
|
-
if (msAbs >= d) {
|
|
118
|
-
return Math.round(ms / d) + "d";
|
|
119
|
-
}
|
|
120
|
-
if (msAbs >= h) {
|
|
121
|
-
return Math.round(ms / h) + "h";
|
|
122
|
-
}
|
|
123
|
-
if (msAbs >= m) {
|
|
124
|
-
return Math.round(ms / m) + "m";
|
|
125
|
-
}
|
|
126
|
-
if (msAbs >= s) {
|
|
127
|
-
return Math.round(ms / s) + "s";
|
|
128
|
-
}
|
|
129
|
-
return ms + "ms";
|
|
130
|
-
}
|
|
131
|
-
function fmtLong(ms) {
|
|
132
|
-
var msAbs = Math.abs(ms);
|
|
133
|
-
if (msAbs >= d) {
|
|
134
|
-
return plural(ms, msAbs, d, "day");
|
|
135
|
-
}
|
|
136
|
-
if (msAbs >= h) {
|
|
137
|
-
return plural(ms, msAbs, h, "hour");
|
|
138
|
-
}
|
|
139
|
-
if (msAbs >= m) {
|
|
140
|
-
return plural(ms, msAbs, m, "minute");
|
|
141
|
-
}
|
|
142
|
-
if (msAbs >= s) {
|
|
143
|
-
return plural(ms, msAbs, s, "second");
|
|
144
|
-
}
|
|
145
|
-
return ms + " ms";
|
|
146
|
-
}
|
|
147
|
-
function plural(ms, msAbs, n, name) {
|
|
148
|
-
var isPlural = msAbs >= n * 1.5;
|
|
149
|
-
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
// node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js
|
|
155
|
-
var require_common = __commonJS({
|
|
156
|
-
"node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js"(exports, module2) {
|
|
157
|
-
function setup(env2) {
|
|
158
|
-
createDebug.debug = createDebug;
|
|
159
|
-
createDebug.default = createDebug;
|
|
160
|
-
createDebug.coerce = coerce;
|
|
161
|
-
createDebug.disable = disable;
|
|
162
|
-
createDebug.enable = enable;
|
|
163
|
-
createDebug.enabled = enabled2;
|
|
164
|
-
createDebug.humanize = require_ms();
|
|
165
|
-
createDebug.destroy = destroy;
|
|
166
|
-
Object.keys(env2).forEach((key) => {
|
|
167
|
-
createDebug[key] = env2[key];
|
|
168
|
-
});
|
|
169
|
-
createDebug.names = [];
|
|
170
|
-
createDebug.skips = [];
|
|
171
|
-
createDebug.formatters = {};
|
|
172
|
-
function selectColor(namespace) {
|
|
173
|
-
let hash = 0;
|
|
174
|
-
for (let i = 0; i < namespace.length; i++) {
|
|
175
|
-
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
176
|
-
hash |= 0;
|
|
177
|
-
}
|
|
178
|
-
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
179
|
-
}
|
|
180
|
-
createDebug.selectColor = selectColor;
|
|
181
|
-
function createDebug(namespace) {
|
|
182
|
-
let prevTime;
|
|
183
|
-
let enableOverride = null;
|
|
184
|
-
let namespacesCache;
|
|
185
|
-
let enabledCache;
|
|
186
|
-
function debug4(...args) {
|
|
187
|
-
if (!debug4.enabled) {
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
const self2 = debug4;
|
|
191
|
-
const curr = Number(/* @__PURE__ */ new Date());
|
|
192
|
-
const ms = curr - (prevTime || curr);
|
|
193
|
-
self2.diff = ms;
|
|
194
|
-
self2.prev = prevTime;
|
|
195
|
-
self2.curr = curr;
|
|
196
|
-
prevTime = curr;
|
|
197
|
-
args[0] = createDebug.coerce(args[0]);
|
|
198
|
-
if (typeof args[0] !== "string") {
|
|
199
|
-
args.unshift("%O");
|
|
200
|
-
}
|
|
201
|
-
let index = 0;
|
|
202
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format2) => {
|
|
203
|
-
if (match === "%%") {
|
|
204
|
-
return "%";
|
|
205
|
-
}
|
|
206
|
-
index++;
|
|
207
|
-
const formatter = createDebug.formatters[format2];
|
|
208
|
-
if (typeof formatter === "function") {
|
|
209
|
-
const val = args[index];
|
|
210
|
-
match = formatter.call(self2, val);
|
|
211
|
-
args.splice(index, 1);
|
|
212
|
-
index--;
|
|
213
|
-
}
|
|
214
|
-
return match;
|
|
215
|
-
});
|
|
216
|
-
createDebug.formatArgs.call(self2, args);
|
|
217
|
-
const logFn = self2.log || createDebug.log;
|
|
218
|
-
logFn.apply(self2, args);
|
|
219
|
-
}
|
|
220
|
-
debug4.namespace = namespace;
|
|
221
|
-
debug4.useColors = createDebug.useColors();
|
|
222
|
-
debug4.color = createDebug.selectColor(namespace);
|
|
223
|
-
debug4.extend = extend;
|
|
224
|
-
debug4.destroy = createDebug.destroy;
|
|
225
|
-
Object.defineProperty(debug4, "enabled", {
|
|
226
|
-
enumerable: true,
|
|
227
|
-
configurable: false,
|
|
228
|
-
get: () => {
|
|
229
|
-
if (enableOverride !== null) {
|
|
230
|
-
return enableOverride;
|
|
231
|
-
}
|
|
232
|
-
if (namespacesCache !== createDebug.namespaces) {
|
|
233
|
-
namespacesCache = createDebug.namespaces;
|
|
234
|
-
enabledCache = createDebug.enabled(namespace);
|
|
235
|
-
}
|
|
236
|
-
return enabledCache;
|
|
237
|
-
},
|
|
238
|
-
set: (v) => {
|
|
239
|
-
enableOverride = v;
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
if (typeof createDebug.init === "function") {
|
|
243
|
-
createDebug.init(debug4);
|
|
244
|
-
}
|
|
245
|
-
return debug4;
|
|
246
|
-
}
|
|
247
|
-
function extend(namespace, delimiter) {
|
|
248
|
-
const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
|
|
249
|
-
newDebug.log = this.log;
|
|
250
|
-
return newDebug;
|
|
251
|
-
}
|
|
252
|
-
function enable(namespaces) {
|
|
253
|
-
createDebug.save(namespaces);
|
|
254
|
-
createDebug.namespaces = namespaces;
|
|
255
|
-
createDebug.names = [];
|
|
256
|
-
createDebug.skips = [];
|
|
257
|
-
let i;
|
|
258
|
-
const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
|
|
259
|
-
const len = split.length;
|
|
260
|
-
for (i = 0; i < len; i++) {
|
|
261
|
-
if (!split[i]) {
|
|
262
|
-
continue;
|
|
263
|
-
}
|
|
264
|
-
namespaces = split[i].replace(/\*/g, ".*?");
|
|
265
|
-
if (namespaces[0] === "-") {
|
|
266
|
-
createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$"));
|
|
267
|
-
} else {
|
|
268
|
-
createDebug.names.push(new RegExp("^" + namespaces + "$"));
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
function disable() {
|
|
273
|
-
const namespaces = [
|
|
274
|
-
...createDebug.names.map(toNamespace),
|
|
275
|
-
...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace)
|
|
276
|
-
].join(",");
|
|
277
|
-
createDebug.enable("");
|
|
278
|
-
return namespaces;
|
|
279
|
-
}
|
|
280
|
-
function enabled2(name) {
|
|
281
|
-
if (name[name.length - 1] === "*") {
|
|
282
|
-
return true;
|
|
283
|
-
}
|
|
284
|
-
let i;
|
|
285
|
-
let len;
|
|
286
|
-
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
|
287
|
-
if (createDebug.skips[i].test(name)) {
|
|
288
|
-
return false;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
|
292
|
-
if (createDebug.names[i].test(name)) {
|
|
293
|
-
return true;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
return false;
|
|
297
|
-
}
|
|
298
|
-
function toNamespace(regexp) {
|
|
299
|
-
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
|
|
300
|
-
}
|
|
301
|
-
function coerce(val) {
|
|
302
|
-
if (val instanceof Error) {
|
|
303
|
-
return val.stack || val.message;
|
|
304
|
-
}
|
|
305
|
-
return val;
|
|
306
|
-
}
|
|
307
|
-
function destroy() {
|
|
308
|
-
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
309
|
-
}
|
|
310
|
-
createDebug.enable(createDebug.load());
|
|
311
|
-
return createDebug;
|
|
312
|
-
}
|
|
313
|
-
module2.exports = setup;
|
|
314
|
-
}
|
|
315
|
-
});
|
|
316
|
-
|
|
317
|
-
// node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js
|
|
318
|
-
var require_browser = __commonJS({
|
|
319
|
-
"node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js"(exports, module2) {
|
|
320
|
-
exports.formatArgs = formatArgs;
|
|
321
|
-
exports.save = save;
|
|
322
|
-
exports.load = load;
|
|
323
|
-
exports.useColors = useColors;
|
|
324
|
-
exports.storage = localstorage();
|
|
325
|
-
exports.destroy = (() => {
|
|
326
|
-
let warned = false;
|
|
327
|
-
return () => {
|
|
328
|
-
if (!warned) {
|
|
329
|
-
warned = true;
|
|
330
|
-
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
331
|
-
}
|
|
332
|
-
};
|
|
333
|
-
})();
|
|
334
|
-
exports.colors = [
|
|
335
|
-
"#0000CC",
|
|
336
|
-
"#0000FF",
|
|
337
|
-
"#0033CC",
|
|
338
|
-
"#0033FF",
|
|
339
|
-
"#0066CC",
|
|
340
|
-
"#0066FF",
|
|
341
|
-
"#0099CC",
|
|
342
|
-
"#0099FF",
|
|
343
|
-
"#00CC00",
|
|
344
|
-
"#00CC33",
|
|
345
|
-
"#00CC66",
|
|
346
|
-
"#00CC99",
|
|
347
|
-
"#00CCCC",
|
|
348
|
-
"#00CCFF",
|
|
349
|
-
"#3300CC",
|
|
350
|
-
"#3300FF",
|
|
351
|
-
"#3333CC",
|
|
352
|
-
"#3333FF",
|
|
353
|
-
"#3366CC",
|
|
354
|
-
"#3366FF",
|
|
355
|
-
"#3399CC",
|
|
356
|
-
"#3399FF",
|
|
357
|
-
"#33CC00",
|
|
358
|
-
"#33CC33",
|
|
359
|
-
"#33CC66",
|
|
360
|
-
"#33CC99",
|
|
361
|
-
"#33CCCC",
|
|
362
|
-
"#33CCFF",
|
|
363
|
-
"#6600CC",
|
|
364
|
-
"#6600FF",
|
|
365
|
-
"#6633CC",
|
|
366
|
-
"#6633FF",
|
|
367
|
-
"#66CC00",
|
|
368
|
-
"#66CC33",
|
|
369
|
-
"#9900CC",
|
|
370
|
-
"#9900FF",
|
|
371
|
-
"#9933CC",
|
|
372
|
-
"#9933FF",
|
|
373
|
-
"#99CC00",
|
|
374
|
-
"#99CC33",
|
|
375
|
-
"#CC0000",
|
|
376
|
-
"#CC0033",
|
|
377
|
-
"#CC0066",
|
|
378
|
-
"#CC0099",
|
|
379
|
-
"#CC00CC",
|
|
380
|
-
"#CC00FF",
|
|
381
|
-
"#CC3300",
|
|
382
|
-
"#CC3333",
|
|
383
|
-
"#CC3366",
|
|
384
|
-
"#CC3399",
|
|
385
|
-
"#CC33CC",
|
|
386
|
-
"#CC33FF",
|
|
387
|
-
"#CC6600",
|
|
388
|
-
"#CC6633",
|
|
389
|
-
"#CC9900",
|
|
390
|
-
"#CC9933",
|
|
391
|
-
"#CCCC00",
|
|
392
|
-
"#CCCC33",
|
|
393
|
-
"#FF0000",
|
|
394
|
-
"#FF0033",
|
|
395
|
-
"#FF0066",
|
|
396
|
-
"#FF0099",
|
|
397
|
-
"#FF00CC",
|
|
398
|
-
"#FF00FF",
|
|
399
|
-
"#FF3300",
|
|
400
|
-
"#FF3333",
|
|
401
|
-
"#FF3366",
|
|
402
|
-
"#FF3399",
|
|
403
|
-
"#FF33CC",
|
|
404
|
-
"#FF33FF",
|
|
405
|
-
"#FF6600",
|
|
406
|
-
"#FF6633",
|
|
407
|
-
"#FF9900",
|
|
408
|
-
"#FF9933",
|
|
409
|
-
"#FFCC00",
|
|
410
|
-
"#FFCC33"
|
|
411
|
-
];
|
|
412
|
-
function useColors() {
|
|
413
|
-
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
|
|
414
|
-
return true;
|
|
415
|
-
}
|
|
416
|
-
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
417
|
-
return false;
|
|
418
|
-
}
|
|
419
|
-
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
420
|
-
typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
421
|
-
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
422
|
-
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
|
|
423
|
-
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
424
|
-
}
|
|
425
|
-
function formatArgs(args) {
|
|
426
|
-
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
|
|
427
|
-
if (!this.useColors) {
|
|
428
|
-
return;
|
|
429
|
-
}
|
|
430
|
-
const c = "color: " + this.color;
|
|
431
|
-
args.splice(1, 0, c, "color: inherit");
|
|
432
|
-
let index = 0;
|
|
433
|
-
let lastC = 0;
|
|
434
|
-
args[0].replace(/%[a-zA-Z%]/g, (match) => {
|
|
435
|
-
if (match === "%%") {
|
|
436
|
-
return;
|
|
437
|
-
}
|
|
438
|
-
index++;
|
|
439
|
-
if (match === "%c") {
|
|
440
|
-
lastC = index;
|
|
441
|
-
}
|
|
442
|
-
});
|
|
443
|
-
args.splice(lastC, 0, c);
|
|
444
|
-
}
|
|
445
|
-
exports.log = console.debug || console.log || (() => {
|
|
446
|
-
});
|
|
447
|
-
function save(namespaces) {
|
|
448
|
-
try {
|
|
449
|
-
if (namespaces) {
|
|
450
|
-
exports.storage.setItem("debug", namespaces);
|
|
451
|
-
} else {
|
|
452
|
-
exports.storage.removeItem("debug");
|
|
453
|
-
}
|
|
454
|
-
} catch (error) {
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
function load() {
|
|
458
|
-
let r;
|
|
459
|
-
try {
|
|
460
|
-
r = exports.storage.getItem("debug");
|
|
461
|
-
} catch (error) {
|
|
462
|
-
}
|
|
463
|
-
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
464
|
-
r = process.env.DEBUG;
|
|
465
|
-
}
|
|
466
|
-
return r;
|
|
467
|
-
}
|
|
468
|
-
function localstorage() {
|
|
469
|
-
try {
|
|
470
|
-
return localStorage;
|
|
471
|
-
} catch (error) {
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
module2.exports = require_common()(exports);
|
|
475
|
-
var { formatters } = module2.exports;
|
|
476
|
-
formatters.j = function(v) {
|
|
477
|
-
try {
|
|
478
|
-
return JSON.stringify(v);
|
|
479
|
-
} catch (error) {
|
|
480
|
-
return "[UnexpectedJSONParseError]: " + error.message;
|
|
481
|
-
}
|
|
482
|
-
};
|
|
483
|
-
}
|
|
484
|
-
});
|
|
485
|
-
|
|
486
|
-
// node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js
|
|
487
|
-
var require_has_flag = __commonJS({
|
|
488
|
-
"node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js"(exports, module2) {
|
|
489
|
-
"use strict";
|
|
490
|
-
module2.exports = (flag, argv) => {
|
|
491
|
-
argv = argv || process.argv;
|
|
492
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
493
|
-
const pos = argv.indexOf(prefix + flag);
|
|
494
|
-
const terminatorPos = argv.indexOf("--");
|
|
495
|
-
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
|
496
|
-
};
|
|
497
|
-
}
|
|
498
|
-
});
|
|
499
|
-
|
|
500
|
-
// node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js
|
|
501
|
-
var require_supports_color = __commonJS({
|
|
502
|
-
"node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js"(exports, module2) {
|
|
503
|
-
"use strict";
|
|
504
|
-
var os = require("os");
|
|
505
|
-
var hasFlag = require_has_flag();
|
|
506
|
-
var env2 = process.env;
|
|
507
|
-
var forceColor;
|
|
508
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
|
|
509
|
-
forceColor = false;
|
|
510
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
511
|
-
forceColor = true;
|
|
512
|
-
}
|
|
513
|
-
if ("FORCE_COLOR" in env2) {
|
|
514
|
-
forceColor = env2.FORCE_COLOR.length === 0 || parseInt(env2.FORCE_COLOR, 10) !== 0;
|
|
515
|
-
}
|
|
516
|
-
function translateLevel(level) {
|
|
517
|
-
if (level === 0) {
|
|
518
|
-
return false;
|
|
519
|
-
}
|
|
520
|
-
return {
|
|
521
|
-
level,
|
|
522
|
-
hasBasic: true,
|
|
523
|
-
has256: level >= 2,
|
|
524
|
-
has16m: level >= 3
|
|
525
|
-
};
|
|
526
|
-
}
|
|
527
|
-
function supportsColor(stream) {
|
|
528
|
-
if (forceColor === false) {
|
|
529
|
-
return 0;
|
|
530
|
-
}
|
|
531
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
532
|
-
return 3;
|
|
533
|
-
}
|
|
534
|
-
if (hasFlag("color=256")) {
|
|
535
|
-
return 2;
|
|
536
|
-
}
|
|
537
|
-
if (stream && !stream.isTTY && forceColor !== true) {
|
|
538
|
-
return 0;
|
|
539
|
-
}
|
|
540
|
-
const min = forceColor ? 1 : 0;
|
|
541
|
-
if (process.platform === "win32") {
|
|
542
|
-
const osRelease = os.release().split(".");
|
|
543
|
-
if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
544
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
545
|
-
}
|
|
546
|
-
return 1;
|
|
547
|
-
}
|
|
548
|
-
if ("CI" in env2) {
|
|
549
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") {
|
|
550
|
-
return 1;
|
|
551
|
-
}
|
|
552
|
-
return min;
|
|
553
|
-
}
|
|
554
|
-
if ("TEAMCITY_VERSION" in env2) {
|
|
555
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
|
|
556
|
-
}
|
|
557
|
-
if (env2.COLORTERM === "truecolor") {
|
|
558
|
-
return 3;
|
|
559
|
-
}
|
|
560
|
-
if ("TERM_PROGRAM" in env2) {
|
|
561
|
-
const version = parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
562
|
-
switch (env2.TERM_PROGRAM) {
|
|
563
|
-
case "iTerm.app":
|
|
564
|
-
return version >= 3 ? 3 : 2;
|
|
565
|
-
case "Apple_Terminal":
|
|
566
|
-
return 2;
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
if (/-256(color)?$/i.test(env2.TERM)) {
|
|
570
|
-
return 2;
|
|
571
|
-
}
|
|
572
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
|
|
573
|
-
return 1;
|
|
574
|
-
}
|
|
575
|
-
if ("COLORTERM" in env2) {
|
|
576
|
-
return 1;
|
|
577
|
-
}
|
|
578
|
-
if (env2.TERM === "dumb") {
|
|
579
|
-
return min;
|
|
580
|
-
}
|
|
581
|
-
return min;
|
|
582
|
-
}
|
|
583
|
-
function getSupportLevel(stream) {
|
|
584
|
-
const level = supportsColor(stream);
|
|
585
|
-
return translateLevel(level);
|
|
586
|
-
}
|
|
587
|
-
module2.exports = {
|
|
588
|
-
supportsColor: getSupportLevel,
|
|
589
|
-
stdout: getSupportLevel(process.stdout),
|
|
590
|
-
stderr: getSupportLevel(process.stderr)
|
|
591
|
-
};
|
|
592
|
-
}
|
|
593
|
-
});
|
|
594
|
-
|
|
595
|
-
// node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js
|
|
596
|
-
var require_node = __commonJS({
|
|
597
|
-
"node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js"(exports, module2) {
|
|
598
|
-
var tty = require("tty");
|
|
599
|
-
var util = require("util");
|
|
600
|
-
exports.init = init;
|
|
601
|
-
exports.log = log;
|
|
602
|
-
exports.formatArgs = formatArgs;
|
|
603
|
-
exports.save = save;
|
|
604
|
-
exports.load = load;
|
|
605
|
-
exports.useColors = useColors;
|
|
606
|
-
exports.destroy = util.deprecate(
|
|
607
|
-
() => {
|
|
608
|
-
},
|
|
609
|
-
"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
|
|
610
|
-
);
|
|
611
|
-
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
612
|
-
try {
|
|
613
|
-
const supportsColor = require_supports_color();
|
|
614
|
-
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
615
|
-
exports.colors = [
|
|
616
|
-
20,
|
|
617
|
-
21,
|
|
618
|
-
26,
|
|
619
|
-
27,
|
|
620
|
-
32,
|
|
621
|
-
33,
|
|
622
|
-
38,
|
|
623
|
-
39,
|
|
624
|
-
40,
|
|
625
|
-
41,
|
|
626
|
-
42,
|
|
627
|
-
43,
|
|
628
|
-
44,
|
|
629
|
-
45,
|
|
630
|
-
56,
|
|
631
|
-
57,
|
|
632
|
-
62,
|
|
633
|
-
63,
|
|
634
|
-
68,
|
|
635
|
-
69,
|
|
636
|
-
74,
|
|
637
|
-
75,
|
|
638
|
-
76,
|
|
639
|
-
77,
|
|
640
|
-
78,
|
|
641
|
-
79,
|
|
642
|
-
80,
|
|
643
|
-
81,
|
|
644
|
-
92,
|
|
645
|
-
93,
|
|
646
|
-
98,
|
|
647
|
-
99,
|
|
648
|
-
112,
|
|
649
|
-
113,
|
|
650
|
-
128,
|
|
651
|
-
129,
|
|
652
|
-
134,
|
|
653
|
-
135,
|
|
654
|
-
148,
|
|
655
|
-
149,
|
|
656
|
-
160,
|
|
657
|
-
161,
|
|
658
|
-
162,
|
|
659
|
-
163,
|
|
660
|
-
164,
|
|
661
|
-
165,
|
|
662
|
-
166,
|
|
663
|
-
167,
|
|
664
|
-
168,
|
|
665
|
-
169,
|
|
666
|
-
170,
|
|
667
|
-
171,
|
|
668
|
-
172,
|
|
669
|
-
173,
|
|
670
|
-
178,
|
|
671
|
-
179,
|
|
672
|
-
184,
|
|
673
|
-
185,
|
|
674
|
-
196,
|
|
675
|
-
197,
|
|
676
|
-
198,
|
|
677
|
-
199,
|
|
678
|
-
200,
|
|
679
|
-
201,
|
|
680
|
-
202,
|
|
681
|
-
203,
|
|
682
|
-
204,
|
|
683
|
-
205,
|
|
684
|
-
206,
|
|
685
|
-
207,
|
|
686
|
-
208,
|
|
687
|
-
209,
|
|
688
|
-
214,
|
|
689
|
-
215,
|
|
690
|
-
220,
|
|
691
|
-
221
|
|
692
|
-
];
|
|
693
|
-
}
|
|
694
|
-
} catch (error) {
|
|
695
|
-
}
|
|
696
|
-
exports.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
697
|
-
return /^debug_/i.test(key);
|
|
698
|
-
}).reduce((obj, key) => {
|
|
699
|
-
const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
|
|
700
|
-
return k.toUpperCase();
|
|
701
|
-
});
|
|
702
|
-
let val = process.env[key];
|
|
703
|
-
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
704
|
-
val = true;
|
|
705
|
-
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
706
|
-
val = false;
|
|
707
|
-
} else if (val === "null") {
|
|
708
|
-
val = null;
|
|
709
|
-
} else {
|
|
710
|
-
val = Number(val);
|
|
711
|
-
}
|
|
712
|
-
obj[prop] = val;
|
|
713
|
-
return obj;
|
|
714
|
-
}, {});
|
|
715
|
-
function useColors() {
|
|
716
|
-
return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
|
|
717
|
-
}
|
|
718
|
-
function formatArgs(args) {
|
|
719
|
-
const { namespace: name, useColors: useColors2 } = this;
|
|
720
|
-
if (useColors2) {
|
|
721
|
-
const c = this.color;
|
|
722
|
-
const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
|
|
723
|
-
const prefix = ` ${colorCode};1m${name} \x1B[0m`;
|
|
724
|
-
args[0] = prefix + args[0].split("\n").join("\n" + prefix);
|
|
725
|
-
args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
|
|
726
|
-
} else {
|
|
727
|
-
args[0] = getDate() + name + " " + args[0];
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
function getDate() {
|
|
731
|
-
if (exports.inspectOpts.hideDate) {
|
|
732
|
-
return "";
|
|
733
|
-
}
|
|
734
|
-
return (/* @__PURE__ */ new Date()).toISOString() + " ";
|
|
735
|
-
}
|
|
736
|
-
function log(...args) {
|
|
737
|
-
return process.stderr.write(util.format(...args) + "\n");
|
|
738
|
-
}
|
|
739
|
-
function save(namespaces) {
|
|
740
|
-
if (namespaces) {
|
|
741
|
-
process.env.DEBUG = namespaces;
|
|
742
|
-
} else {
|
|
743
|
-
delete process.env.DEBUG;
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
function load() {
|
|
747
|
-
return process.env.DEBUG;
|
|
748
|
-
}
|
|
749
|
-
function init(debug4) {
|
|
750
|
-
debug4.inspectOpts = {};
|
|
751
|
-
const keys = Object.keys(exports.inspectOpts);
|
|
752
|
-
for (let i = 0; i < keys.length; i++) {
|
|
753
|
-
debug4.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
module2.exports = require_common()(exports);
|
|
757
|
-
var { formatters } = module2.exports;
|
|
758
|
-
formatters.o = function(v) {
|
|
759
|
-
this.inspectOpts.colors = this.useColors;
|
|
760
|
-
return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
|
|
761
|
-
};
|
|
762
|
-
formatters.O = function(v) {
|
|
763
|
-
this.inspectOpts.colors = this.useColors;
|
|
764
|
-
return util.inspect(v, this.inspectOpts);
|
|
765
|
-
};
|
|
766
|
-
}
|
|
767
|
-
});
|
|
768
|
-
|
|
769
|
-
// node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/index.js
|
|
770
|
-
var require_src = __commonJS({
|
|
771
|
-
"node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/index.js"(exports, module2) {
|
|
772
|
-
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
773
|
-
module2.exports = require_browser();
|
|
774
|
-
} else {
|
|
775
|
-
module2.exports = require_node();
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
});
|
|
779
|
-
|
|
780
|
-
// node_modules/.pnpm/node-environment@0.5.1/node_modules/node-environment/lib/compare-aliases.js
|
|
781
|
-
var require_compare_aliases = __commonJS({
|
|
782
|
-
"node_modules/.pnpm/node-environment@0.5.1/node_modules/node-environment/lib/compare-aliases.js"(exports, module2) {
|
|
783
|
-
module2.exports = function compareAliases(env2, ...aliases) {
|
|
784
|
-
return aliases.some((alias) => alias.toLowerCase() === env2.toLowerCase());
|
|
785
|
-
};
|
|
786
|
-
}
|
|
787
|
-
});
|
|
788
|
-
|
|
789
|
-
// node_modules/.pnpm/node-environment@0.5.1/node_modules/node-environment/lib/modes.enum.js
|
|
790
|
-
var require_modes_enum = __commonJS({
|
|
791
|
-
"node_modules/.pnpm/node-environment@0.5.1/node_modules/node-environment/lib/modes.enum.js"(exports, module2) {
|
|
792
|
-
var Development = {
|
|
793
|
-
dev: "dev",
|
|
794
|
-
development: "development"
|
|
795
|
-
};
|
|
796
|
-
var Production = {
|
|
797
|
-
prod: "prod",
|
|
798
|
-
production: "production"
|
|
799
|
-
};
|
|
800
|
-
module2.exports = {
|
|
801
|
-
Production,
|
|
802
|
-
Development
|
|
803
|
-
};
|
|
804
|
-
}
|
|
805
|
-
});
|
|
806
|
-
|
|
807
|
-
// node_modules/.pnpm/node-environment@0.5.1/node_modules/node-environment/lib/inspector.js
|
|
808
|
-
var require_inspector = __commonJS({
|
|
809
|
-
"node_modules/.pnpm/node-environment@0.5.1/node_modules/node-environment/lib/inspector.js"(exports, module2) {
|
|
810
|
-
var compare = require_compare_aliases();
|
|
811
|
-
var modes = require_modes_enum();
|
|
812
|
-
function inspector(...envs) {
|
|
813
|
-
const nodeEnv = process.env.NODE_ENV ?? "development";
|
|
814
|
-
if (envs.length === 0) {
|
|
815
|
-
return nodeEnv;
|
|
816
|
-
}
|
|
817
|
-
return envs.reduce((prev, env2) => {
|
|
818
|
-
if (isKnownMode(env2, nodeEnv)) {
|
|
819
|
-
return true;
|
|
820
|
-
}
|
|
821
|
-
return prev || compare(env2, nodeEnv);
|
|
822
|
-
}, false);
|
|
823
|
-
}
|
|
824
|
-
function isKnownMode(env2, nodeEnv) {
|
|
825
|
-
for (const mode of Object.values(modes)) {
|
|
826
|
-
if (compareKnownMode(env2, nodeEnv, Object.values(mode))) {
|
|
827
|
-
return true;
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
return false;
|
|
831
|
-
}
|
|
832
|
-
function compareKnownMode(env2, nodeEnv, possibleValues) {
|
|
833
|
-
return compare(env2, ...possibleValues) && compare(nodeEnv, ...possibleValues);
|
|
834
|
-
}
|
|
835
|
-
module2.exports = inspector;
|
|
836
|
-
}
|
|
837
|
-
});
|
|
838
|
-
|
|
839
|
-
// node_modules/.pnpm/node-environment@0.5.1/node_modules/node-environment/lib/index.js
|
|
840
|
-
var require_lib = __commonJS({
|
|
841
|
-
"node_modules/.pnpm/node-environment@0.5.1/node_modules/node-environment/lib/index.js"(exports, module2) {
|
|
842
|
-
module2.exports = {
|
|
843
|
-
env: require_inspector()
|
|
844
|
-
};
|
|
845
|
-
}
|
|
846
|
-
});
|
|
847
|
-
|
|
848
|
-
// src/index.ts
|
|
849
|
-
var src_exports = {};
|
|
850
|
-
__export(src_exports, {
|
|
851
|
-
getFileNodes: () => getFileNodes,
|
|
852
|
-
getMd: () => getMd
|
|
853
|
-
});
|
|
854
|
-
module.exports = __toCommonJS(src_exports);
|
|
855
|
-
|
|
856
|
-
// src/commands/get-file.ts
|
|
857
|
-
var import_fs2 = __toESM(require("fs"));
|
|
858
|
-
var import_path2 = __toESM(require("path"));
|
|
859
|
-
var import_debug2 = __toESM(require_src());
|
|
860
|
-
|
|
861
|
-
// src/commands/change-path.ts
|
|
862
|
-
var import_fs = __toESM(require("fs"));
|
|
863
|
-
var import_path = __toESM(require("path"));
|
|
864
|
-
|
|
865
|
-
// node_modules/.pnpm/kolorist@1.8.0/node_modules/kolorist/dist/esm/index.mjs
|
|
866
|
-
var enabled = true;
|
|
867
|
-
var globalVar = typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {};
|
|
868
|
-
var supportLevel = 0;
|
|
869
|
-
if (globalVar.process && globalVar.process.env && globalVar.process.stdout) {
|
|
870
|
-
const { FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, COLORTERM } = globalVar.process.env;
|
|
871
|
-
if (NODE_DISABLE_COLORS || NO_COLOR || FORCE_COLOR === "0") {
|
|
872
|
-
enabled = false;
|
|
873
|
-
} else if (FORCE_COLOR === "1" || FORCE_COLOR === "2" || FORCE_COLOR === "3") {
|
|
874
|
-
enabled = true;
|
|
875
|
-
} else if (TERM === "dumb") {
|
|
876
|
-
enabled = false;
|
|
877
|
-
} else if ("CI" in globalVar.process.env && [
|
|
878
|
-
"TRAVIS",
|
|
879
|
-
"CIRCLECI",
|
|
880
|
-
"APPVEYOR",
|
|
881
|
-
"GITLAB_CI",
|
|
882
|
-
"GITHUB_ACTIONS",
|
|
883
|
-
"BUILDKITE",
|
|
884
|
-
"DRONE"
|
|
885
|
-
].some((vendor) => vendor in globalVar.process.env)) {
|
|
886
|
-
enabled = true;
|
|
887
|
-
} else {
|
|
888
|
-
enabled = process.stdout.isTTY;
|
|
889
|
-
}
|
|
890
|
-
if (enabled) {
|
|
891
|
-
if (process.platform === "win32") {
|
|
892
|
-
supportLevel = 3;
|
|
893
|
-
} else {
|
|
894
|
-
if (COLORTERM && (COLORTERM === "truecolor" || COLORTERM === "24bit")) {
|
|
895
|
-
supportLevel = 3;
|
|
896
|
-
} else if (TERM && (TERM.endsWith("-256color") || TERM.endsWith("256"))) {
|
|
897
|
-
supportLevel = 2;
|
|
898
|
-
} else {
|
|
899
|
-
supportLevel = 1;
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
var options = {
|
|
905
|
-
enabled,
|
|
906
|
-
supportLevel
|
|
907
|
-
};
|
|
908
|
-
function kolorist(start, end, level = 1) {
|
|
909
|
-
const open = `\x1B[${start}m`;
|
|
910
|
-
const close = `\x1B[${end}m`;
|
|
911
|
-
const regex = new RegExp(`\\x1b\\[${end}m`, "g");
|
|
912
|
-
return (str) => {
|
|
913
|
-
return options.enabled && options.supportLevel >= level ? open + ("" + str).replace(regex, open) + close : "" + str;
|
|
914
|
-
};
|
|
915
|
-
}
|
|
916
|
-
var reset = kolorist(0, 0);
|
|
917
|
-
var bold = kolorist(1, 22);
|
|
918
|
-
var dim = kolorist(2, 22);
|
|
919
|
-
var italic = kolorist(3, 23);
|
|
920
|
-
var underline = kolorist(4, 24);
|
|
921
|
-
var inverse = kolorist(7, 27);
|
|
922
|
-
var hidden = kolorist(8, 28);
|
|
923
|
-
var strikethrough = kolorist(9, 29);
|
|
924
|
-
var black = kolorist(30, 39);
|
|
925
|
-
var red = kolorist(31, 39);
|
|
926
|
-
var green = kolorist(32, 39);
|
|
927
|
-
var yellow = kolorist(33, 39);
|
|
928
|
-
var blue = kolorist(34, 39);
|
|
929
|
-
var magenta = kolorist(35, 39);
|
|
930
|
-
var cyan = kolorist(36, 39);
|
|
931
|
-
var white = kolorist(97, 39);
|
|
932
|
-
var gray = kolorist(90, 39);
|
|
933
|
-
var lightGray = kolorist(37, 39);
|
|
934
|
-
var lightRed = kolorist(91, 39);
|
|
935
|
-
var lightGreen = kolorist(92, 39);
|
|
936
|
-
var lightYellow = kolorist(93, 39);
|
|
937
|
-
var lightBlue = kolorist(94, 39);
|
|
938
|
-
var lightMagenta = kolorist(95, 39);
|
|
939
|
-
var lightCyan = kolorist(96, 39);
|
|
940
|
-
var bgBlack = kolorist(40, 49);
|
|
941
|
-
var bgRed = kolorist(41, 49);
|
|
942
|
-
var bgGreen = kolorist(42, 49);
|
|
943
|
-
var bgYellow = kolorist(43, 49);
|
|
944
|
-
var bgBlue = kolorist(44, 49);
|
|
945
|
-
var bgMagenta = kolorist(45, 49);
|
|
946
|
-
var bgCyan = kolorist(46, 49);
|
|
947
|
-
var bgWhite = kolorist(107, 49);
|
|
948
|
-
var bgGray = kolorist(100, 49);
|
|
949
|
-
var bgLightRed = kolorist(101, 49);
|
|
950
|
-
var bgLightGreen = kolorist(102, 49);
|
|
951
|
-
var bgLightYellow = kolorist(103, 49);
|
|
952
|
-
var bgLightBlue = kolorist(104, 49);
|
|
953
|
-
var bgLightMagenta = kolorist(105, 49);
|
|
954
|
-
var bgLightCyan = kolorist(106, 49);
|
|
955
|
-
var bgLightGray = kolorist(47, 49);
|
|
956
|
-
|
|
957
|
-
// src/shared/logger.ts
|
|
958
|
-
var logger = {
|
|
959
|
-
info(text) {
|
|
960
|
-
console.log(lightBlue(`\u2708 - ${text}`));
|
|
961
|
-
},
|
|
962
|
-
success(text) {
|
|
963
|
-
console.log(lightGreen(`\u2714 - ${text}`));
|
|
964
|
-
},
|
|
965
|
-
warn(text) {
|
|
966
|
-
console.log(lightYellow(`\u25B6 - ${text}`));
|
|
967
|
-
},
|
|
968
|
-
error(text) {
|
|
969
|
-
console.log(lightRed(`\u2716 - ${text}`));
|
|
970
|
-
}
|
|
971
|
-
};
|
|
972
|
-
var logger_default = logger;
|
|
973
|
-
|
|
974
|
-
// src/commands/change-path.ts
|
|
975
|
-
var import_debug = __toESM(require_src());
|
|
976
|
-
var debug = (0, import_debug.default)("change-path");
|
|
977
|
-
debug.enabled = true;
|
|
978
|
-
var rootPath = process.cwd().replace(/\\/g, "/");
|
|
979
|
-
function getRelatPath(absoluteImport, fullPath) {
|
|
980
|
-
let relatPath = import_path.default.relative(import_path.default.dirname(fullPath), absoluteImport);
|
|
981
|
-
relatPath = relatPath.replace(/\\/g, "/");
|
|
982
|
-
if (relatPath.indexOf(".") !== 0) {
|
|
983
|
-
relatPath = "./" + relatPath;
|
|
984
|
-
}
|
|
985
|
-
return relatPath;
|
|
986
|
-
}
|
|
987
|
-
function makeSuffix(filePath, fullPath) {
|
|
988
|
-
let absoluteImport = "";
|
|
989
|
-
if (filePath.indexOf("@") > -1) {
|
|
990
|
-
debug("!!!!!!!!!filePath: ", filePath);
|
|
991
|
-
absoluteImport = filePath.replace("@", process.cwd());
|
|
992
|
-
} else {
|
|
993
|
-
absoluteImport = import_path.default.resolve(import_path.default.dirname(fullPath), filePath);
|
|
994
|
-
}
|
|
995
|
-
debug("makeSuffix \u5165\u53C2: absoluteImport", absoluteImport);
|
|
996
|
-
const lastName = import_path.default.extname(absoluteImport);
|
|
997
|
-
debug("lastName", lastName);
|
|
998
|
-
if (!lastName) {
|
|
999
|
-
debug("!!!!!!!!!!!\u7F3A\u540E\u7F00\u6587\u4EF6: ", absoluteImport);
|
|
1000
|
-
const suffix = [".js", ".ts", ".vue", ".tsx", "/index.js", "/index.vue"];
|
|
1001
|
-
for (let j = 0; j < suffix.length; j++) {
|
|
1002
|
-
const fixStr = suffix[j];
|
|
1003
|
-
if (import_fs.default.existsSync(absoluteImport + fixStr)) {
|
|
1004
|
-
debug("\u8865\u5168\u7684\u6587\u4EF6: ", absoluteImport + fixStr);
|
|
1005
|
-
absoluteImport = absoluteImport + fixStr;
|
|
1006
|
-
break;
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
return absoluteImport.replace(/\\/g, "/");
|
|
1011
|
-
}
|
|
1012
|
-
function getImportName(ele, dependencies) {
|
|
1013
|
-
let str = "";
|
|
1014
|
-
const flag = dependencies.some((item) => ele.indexOf(item) > -1);
|
|
1015
|
-
const reg = / from [\"|\'](.*)[\'|\"]/;
|
|
1016
|
-
if (!flag && ele.indexOf("/") > -1 && ele.indexOf("//") !== 0) {
|
|
1017
|
-
const impStr = ele.match(reg);
|
|
1018
|
-
if (impStr && impStr[1])
|
|
1019
|
-
str = impStr[1];
|
|
1020
|
-
}
|
|
1021
|
-
return str;
|
|
1022
|
-
}
|
|
1023
|
-
function changeImport(ele, fullPath, dependencies, nochangePath) {
|
|
1024
|
-
const obj = {
|
|
1025
|
-
impName: "",
|
|
1026
|
-
filePath: "",
|
|
1027
|
-
absoluteImport: ""
|
|
1028
|
-
};
|
|
1029
|
-
const impName = getImportName(ele, dependencies);
|
|
1030
|
-
if (impName) {
|
|
1031
|
-
obj.filePath = impName;
|
|
1032
|
-
debug("!!!!!!!!!\u5339\u914Dimp: ", impName);
|
|
1033
|
-
obj.absoluteImport = makeSuffix(obj.filePath, fullPath);
|
|
1034
|
-
debug("\u8865\u8FC7\u540E", obj.absoluteImport);
|
|
1035
|
-
if (!nochangePath) {
|
|
1036
|
-
obj.impName = getRelatPath(obj.absoluteImport, fullPath);
|
|
1037
|
-
debug("\u76F8\u5BF9\u8DEF\u5F84: ", obj.impName);
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
return obj;
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
// src/commands/get-file.ts
|
|
1044
|
-
var import_node_environment = __toESM(require_lib());
|
|
1045
|
-
var debug2 = (0, import_debug2.default)("get-file");
|
|
1046
|
-
debug2.enabled = false;
|
|
1047
|
-
var rootPath2 = process.cwd().replace(/\\/g, "/");
|
|
1048
|
-
var isDev = (0, import_node_environment.env)() === "development";
|
|
1049
|
-
function getFile(fullPath) {
|
|
1050
|
-
const str = import_fs2.default.readFileSync(fullPath, "utf-8");
|
|
1051
|
-
const size = str.length;
|
|
1052
|
-
const sarr = str.split(/[\n]/g);
|
|
1053
|
-
const rowSize = sarr.length;
|
|
1054
|
-
const imports = getImport(sarr, fullPath);
|
|
1055
|
-
const f = sarr[0].indexOf("eslint") === -1 && (sarr[0].indexOf("-->") > -1 || sarr[0].indexOf("*/") > -1 || sarr[0].indexOf("//") > -1) ? sarr[0] : "";
|
|
1056
|
-
return {
|
|
1057
|
-
note: f.replace(/<\/?[^>]*>|(\n|\r)/g, ""),
|
|
1058
|
-
// 去掉尾巴换行符号
|
|
1059
|
-
size,
|
|
1060
|
-
rowSize,
|
|
1061
|
-
imports
|
|
1062
|
-
};
|
|
1063
|
-
}
|
|
1064
|
-
function getImport(sarr, fullPath) {
|
|
1065
|
-
const dependencies = [];
|
|
1066
|
-
if (import_fs2.default.existsSync(rootPath2 + "/package.json")) {
|
|
1067
|
-
const pkg = require(rootPath2 + "/package.json");
|
|
1068
|
-
if (pkg.devDependencies) {
|
|
1069
|
-
dependencies.push(...Object.keys(pkg.devDependencies));
|
|
1070
|
-
} else if (pkg.dependencies) {
|
|
1071
|
-
dependencies.push(...Object.keys(pkg.dependencies));
|
|
1072
|
-
}
|
|
1073
|
-
}
|
|
1074
|
-
const imports = [];
|
|
1075
|
-
sarr.forEach((ele) => {
|
|
1076
|
-
if (ele.indexOf("from") > -1) {
|
|
1077
|
-
const { absoluteImport } = changeImport(ele, fullPath, dependencies);
|
|
1078
|
-
if (absoluteImport) {
|
|
1079
|
-
imports.push(absoluteImport);
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
});
|
|
1083
|
-
return imports;
|
|
1084
|
-
}
|
|
1085
|
-
function getFileNodes(dir = process.cwd(), option, nodes = [], level = 0) {
|
|
1086
|
-
let ignore = [
|
|
1087
|
-
// 'api',
|
|
1088
|
-
// 'src',
|
|
1089
|
-
"bin",
|
|
1090
|
-
"lib",
|
|
1091
|
-
"jest.config.js",
|
|
1092
|
-
"router",
|
|
1093
|
-
"img",
|
|
1094
|
-
"styles",
|
|
1095
|
-
"node_modules",
|
|
1096
|
-
"LICENSE",
|
|
1097
|
-
".git",
|
|
1098
|
-
".github",
|
|
1099
|
-
"dist",
|
|
1100
|
-
".husky",
|
|
1101
|
-
".vscode",
|
|
1102
|
-
".eslintrc.js",
|
|
1103
|
-
"readme-file.js",
|
|
1104
|
-
"readme-md.js"
|
|
1105
|
-
];
|
|
1106
|
-
let include = isDev ? [".js", ".vue"] : [".js", ".vue", ".ts", ".tsx"];
|
|
1107
|
-
if (option) {
|
|
1108
|
-
ignore = option.ignore || ignore;
|
|
1109
|
-
include = option.include || include;
|
|
1110
|
-
}
|
|
1111
|
-
const files = import_fs2.default.readdirSync(dir).map((item) => {
|
|
1112
|
-
const fullPath = import_path2.default.join(dir, item);
|
|
1113
|
-
const isDir = import_fs2.default.lstatSync(fullPath).isDirectory();
|
|
1114
|
-
return {
|
|
1115
|
-
name: item,
|
|
1116
|
-
isDir,
|
|
1117
|
-
level,
|
|
1118
|
-
note: "",
|
|
1119
|
-
imports: new Array(),
|
|
1120
|
-
belongTo: new Array()
|
|
1121
|
-
};
|
|
1122
|
-
}).sort((a, b) => {
|
|
1123
|
-
if (!a.isDir && b.isDir)
|
|
1124
|
-
return 1;
|
|
1125
|
-
if (a.isDir && !b.isDir)
|
|
1126
|
-
return -1;
|
|
1127
|
-
if (a.isDir && b.isDir || !a.isDir && !b.isDir)
|
|
1128
|
-
return 0;
|
|
1129
|
-
return 0;
|
|
1130
|
-
});
|
|
1131
|
-
for (let index = 0; index < files.length; index += 1) {
|
|
1132
|
-
const item = files[index];
|
|
1133
|
-
const foldFlag = ignore.findIndex((obj) => obj === item.name);
|
|
1134
|
-
if (foldFlag === -1) {
|
|
1135
|
-
const fullPath = import_path2.default.join(dir, item.name);
|
|
1136
|
-
const isDir = import_fs2.default.lstatSync(fullPath).isDirectory();
|
|
1137
|
-
if (isDir) {
|
|
1138
|
-
getFileNodes(fullPath, option, item.children = [], level + 1);
|
|
1139
|
-
item.fullPath = fullPath.replace(/\\/g, "/");
|
|
1140
|
-
nodes.push(item);
|
|
1141
|
-
} else {
|
|
1142
|
-
const i = fullPath.lastIndexOf(".");
|
|
1143
|
-
const lastName = fullPath.substring(i);
|
|
1144
|
-
if (include.includes(lastName)) {
|
|
1145
|
-
const obj = getFile(fullPath);
|
|
1146
|
-
Object.assign(item, obj);
|
|
1147
|
-
item.suffix = lastName;
|
|
1148
|
-
item.fullPath = fullPath.replace(/\\/g, "/");
|
|
1149
|
-
nodes.push(item);
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
}
|
|
1153
|
-
}
|
|
1154
|
-
return nodes;
|
|
1155
|
-
}
|
|
1156
|
-
function getNote(datas, keys) {
|
|
1157
|
-
const nodes = keys || [];
|
|
1158
|
-
datas.forEach((obj, index) => {
|
|
1159
|
-
const last = index === datas.length - 1;
|
|
1160
|
-
if (obj.children) {
|
|
1161
|
-
getNote(obj.children, nodes);
|
|
1162
|
-
}
|
|
1163
|
-
const md = setMd(obj, last);
|
|
1164
|
-
nodes.push(md);
|
|
1165
|
-
});
|
|
1166
|
-
return nodes;
|
|
1167
|
-
}
|
|
1168
|
-
function setMd(obj, last) {
|
|
1169
|
-
let filesString = "";
|
|
1170
|
-
const blank = "\u2502 ".repeat(obj.level);
|
|
1171
|
-
const pre = `${blank}${last ? "\u2514\u2500\u2500" : "\u251C\u2500\u2500"} ${obj.name}`;
|
|
1172
|
-
if (obj.isDir) {
|
|
1173
|
-
filesString += `${pre}
|
|
1174
|
-
`;
|
|
1175
|
-
} else {
|
|
1176
|
-
filesString += `${pre} ${obj.note}
|
|
1177
|
-
`;
|
|
1178
|
-
}
|
|
1179
|
-
return filesString;
|
|
1180
|
-
}
|
|
1181
|
-
|
|
1182
|
-
// src/commands/wirte-md.ts
|
|
1183
|
-
var import_debug3 = __toESM(require_src());
|
|
1184
|
-
var rootPath3 = process.cwd().replace(/\\/g, "/");
|
|
1185
|
-
var debug3 = (0, import_debug3.default)("wirte-md");
|
|
1186
|
-
debug3.enabled = false;
|
|
1187
|
-
function getCountMd(datas) {
|
|
1188
|
-
let rowTotleNumber = 0;
|
|
1189
|
-
let sizeTotleNumber = 0;
|
|
1190
|
-
const coutObj = {};
|
|
1191
|
-
function getDeatle(nodes) {
|
|
1192
|
-
nodes.forEach((obj) => {
|
|
1193
|
-
if (obj.children)
|
|
1194
|
-
getDeatle(obj.children);
|
|
1195
|
-
else if (obj.suffix && obj.rowSize && obj.size) {
|
|
1196
|
-
if (!coutObj.hasOwnProperty(obj.suffix))
|
|
1197
|
-
coutObj[obj.suffix] = 0;
|
|
1198
|
-
coutObj[obj.suffix]++;
|
|
1199
|
-
rowTotleNumber += obj.rowSize;
|
|
1200
|
-
sizeTotleNumber += obj.size;
|
|
1201
|
-
}
|
|
1202
|
-
});
|
|
1203
|
-
}
|
|
1204
|
-
getDeatle(datas);
|
|
1205
|
-
return {
|
|
1206
|
-
rowTotleNumber,
|
|
1207
|
-
sizeTotleNumber,
|
|
1208
|
-
coutObj
|
|
1209
|
-
};
|
|
1210
|
-
}
|
|
1211
|
-
function format(num) {
|
|
1212
|
-
var reg = /\d{1,3}(?=(\d{3})+$)/g;
|
|
1213
|
-
return (num + "").replace(reg, "$&,");
|
|
1214
|
-
}
|
|
1215
|
-
function setCountMd(obj) {
|
|
1216
|
-
const { rowTotleNumber, sizeTotleNumber, coutObj } = obj;
|
|
1217
|
-
let countMd = "\u{1F60D} \u4EE3\u7801\u603B\u6570\u7EDF\u8BA1\uFF1A\n";
|
|
1218
|
-
let totle = 0;
|
|
1219
|
-
for (const key in coutObj) {
|
|
1220
|
-
const ele = coutObj[key];
|
|
1221
|
-
totle += ele;
|
|
1222
|
-
countMd += `\u540E\u7F00\u662F ${key} \u7684\u6587\u4EF6\u6709 ${ele} \u4E2A
|
|
1223
|
-
`;
|
|
1224
|
-
}
|
|
1225
|
-
countMd += `\u603B\u5171\u6709 ${totle} \u4E2A\u6587\u4EF6
|
|
1226
|
-
`;
|
|
1227
|
-
let md = `\u603B\u4EE3\u7801\u884C\u6570\u6709: ${format(rowTotleNumber)}\u884C,
|
|
1228
|
-
\u603B\u4EE3\u7801\u5B57\u6570\u6709: ${format(sizeTotleNumber)}\u4E2A
|
|
1229
|
-
`;
|
|
1230
|
-
md = countMd + md;
|
|
1231
|
-
return md;
|
|
1232
|
-
}
|
|
1233
|
-
function getMd(option) {
|
|
1234
|
-
logger_default.success("\u{1F449} \u547D\u4EE4\u8FD0\u884C\u4F4D\u7F6E: " + process.cwd() + "\n");
|
|
1235
|
-
const nodes = getFileNodes(rootPath3, option);
|
|
1236
|
-
const countMdObj = getCountMd(nodes);
|
|
1237
|
-
const coutMd = setCountMd(countMdObj);
|
|
1238
|
-
logger_default.success(coutMd);
|
|
1239
|
-
const note = getNote(nodes);
|
|
1240
|
-
const md = note.join("") + "\n";
|
|
1241
|
-
if (md.length > 0) {
|
|
1242
|
-
logger_default.success("\u{1F004}\uFE0F \u751F\u6210MarkDown\u5B8C\u6BD5 !");
|
|
1243
|
-
}
|
|
1244
|
-
return { md: md + coutMd, nodes };
|
|
1245
|
-
}
|
|
1246
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
1247
|
-
0 && (module.exports = {
|
|
1248
|
-
getFileNodes,
|
|
1249
|
-
getMd
|
|
1250
|
-
});
|
|
1251
|
-
//# sourceMappingURL=index.cjs.js.map
|