create-vue 3.15.1 → 3.16.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/LICENSE +109 -88
- package/bundle.js +3168 -0
- package/package.json +12 -12
- package/template/base/.vscode/settings.json +1 -1
- package/template/base/package.json +2 -2
- package/template/code/default/src/components/TheWelcome.vue +1 -1
- package/template/code/router/src/components/TheWelcome.vue +1 -1
- package/template/code/typescript-default/src/components/TheWelcome.vue +1 -1
- package/template/code/typescript-router/src/components/TheWelcome.vue +1 -1
- package/template/config/cypress/package.json +2 -2
- package/template/config/cypress-ct/package.json +1 -1
- package/template/config/jsx/package.json +2 -2
- package/template/config/nightwatch/package.json +4 -4
- package/template/config/oxlint/.vscode/extensions.json +3 -0
- package/template/config/playwright/package.json +1 -1
- package/template/config/typescript/package.json +1 -1
- package/template/config/vitest/package.json +1 -1
- package/template/eslint/package.json +1 -1
- package/template/tsconfig/base/package.json +1 -1
- package/outfile.cjs +0 -2810
package/outfile.cjs
DELETED
|
@@ -1,2810 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/*! create-vue v3.15.1 | MIT */
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
10
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
|
|
29
|
-
// node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
|
30
|
-
var require_src = __commonJS({
|
|
31
|
-
"node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports2, module2) {
|
|
32
|
-
"use strict";
|
|
33
|
-
var ESC = "\x1B";
|
|
34
|
-
var CSI = `${ESC}[`;
|
|
35
|
-
var beep = "\x07";
|
|
36
|
-
var cursor = {
|
|
37
|
-
to(x2, y2) {
|
|
38
|
-
if (!y2) return `${CSI}${x2 + 1}G`;
|
|
39
|
-
return `${CSI}${y2 + 1};${x2 + 1}H`;
|
|
40
|
-
},
|
|
41
|
-
move(x2, y2) {
|
|
42
|
-
let ret = "";
|
|
43
|
-
if (x2 < 0) ret += `${CSI}${-x2}D`;
|
|
44
|
-
else if (x2 > 0) ret += `${CSI}${x2}C`;
|
|
45
|
-
if (y2 < 0) ret += `${CSI}${-y2}A`;
|
|
46
|
-
else if (y2 > 0) ret += `${CSI}${y2}B`;
|
|
47
|
-
return ret;
|
|
48
|
-
},
|
|
49
|
-
up: (count = 1) => `${CSI}${count}A`,
|
|
50
|
-
down: (count = 1) => `${CSI}${count}B`,
|
|
51
|
-
forward: (count = 1) => `${CSI}${count}C`,
|
|
52
|
-
backward: (count = 1) => `${CSI}${count}D`,
|
|
53
|
-
nextLine: (count = 1) => `${CSI}E`.repeat(count),
|
|
54
|
-
prevLine: (count = 1) => `${CSI}F`.repeat(count),
|
|
55
|
-
left: `${CSI}G`,
|
|
56
|
-
hide: `${CSI}?25l`,
|
|
57
|
-
show: `${CSI}?25h`,
|
|
58
|
-
save: `${ESC}7`,
|
|
59
|
-
restore: `${ESC}8`
|
|
60
|
-
};
|
|
61
|
-
var scroll = {
|
|
62
|
-
up: (count = 1) => `${CSI}S`.repeat(count),
|
|
63
|
-
down: (count = 1) => `${CSI}T`.repeat(count)
|
|
64
|
-
};
|
|
65
|
-
var erase = {
|
|
66
|
-
screen: `${CSI}2J`,
|
|
67
|
-
up: (count = 1) => `${CSI}1J`.repeat(count),
|
|
68
|
-
down: (count = 1) => `${CSI}J`.repeat(count),
|
|
69
|
-
line: `${CSI}2K`,
|
|
70
|
-
lineEnd: `${CSI}K`,
|
|
71
|
-
lineStart: `${CSI}1K`,
|
|
72
|
-
lines(count) {
|
|
73
|
-
let clear = "";
|
|
74
|
-
for (let i = 0; i < count; i++)
|
|
75
|
-
clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
76
|
-
if (count)
|
|
77
|
-
clear += cursor.left;
|
|
78
|
-
return clear;
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
module2.exports = { cursor, scroll, erase, beep };
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
// node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
86
|
-
var require_picocolors = __commonJS({
|
|
87
|
-
"node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports2, module2) {
|
|
88
|
-
var p = process || {};
|
|
89
|
-
var argv = p.argv || [];
|
|
90
|
-
var env = p.env || {};
|
|
91
|
-
var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
92
|
-
var formatter = (open, close, replace = open) => (input) => {
|
|
93
|
-
let string = "" + input, index = string.indexOf(close, open.length);
|
|
94
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
95
|
-
};
|
|
96
|
-
var replaceClose = (string, close, replace, index) => {
|
|
97
|
-
let result = "", cursor = 0;
|
|
98
|
-
do {
|
|
99
|
-
result += string.substring(cursor, index) + replace;
|
|
100
|
-
cursor = index + close.length;
|
|
101
|
-
index = string.indexOf(close, cursor);
|
|
102
|
-
} while (~index);
|
|
103
|
-
return result + string.substring(cursor);
|
|
104
|
-
};
|
|
105
|
-
var createColors = (enabled = isColorSupported) => {
|
|
106
|
-
let f = enabled ? formatter : () => String;
|
|
107
|
-
return {
|
|
108
|
-
isColorSupported: enabled,
|
|
109
|
-
reset: f("\x1B[0m", "\x1B[0m"),
|
|
110
|
-
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
111
|
-
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
112
|
-
italic: f("\x1B[3m", "\x1B[23m"),
|
|
113
|
-
underline: f("\x1B[4m", "\x1B[24m"),
|
|
114
|
-
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
115
|
-
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
116
|
-
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
117
|
-
black: f("\x1B[30m", "\x1B[39m"),
|
|
118
|
-
red: f("\x1B[31m", "\x1B[39m"),
|
|
119
|
-
green: f("\x1B[32m", "\x1B[39m"),
|
|
120
|
-
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
121
|
-
blue: f("\x1B[34m", "\x1B[39m"),
|
|
122
|
-
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
123
|
-
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
124
|
-
white: f("\x1B[37m", "\x1B[39m"),
|
|
125
|
-
gray: f("\x1B[90m", "\x1B[39m"),
|
|
126
|
-
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
127
|
-
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
128
|
-
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
129
|
-
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
130
|
-
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
131
|
-
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
132
|
-
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
133
|
-
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
134
|
-
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
135
|
-
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
136
|
-
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
137
|
-
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
138
|
-
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
139
|
-
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
140
|
-
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
141
|
-
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
142
|
-
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
143
|
-
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
144
|
-
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
145
|
-
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
146
|
-
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
147
|
-
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
148
|
-
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
149
|
-
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
150
|
-
};
|
|
151
|
-
};
|
|
152
|
-
module2.exports = createColors();
|
|
153
|
-
module2.exports.createColors = createColors;
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
// node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/lib/utils.js
|
|
158
|
-
var require_utils = __commonJS({
|
|
159
|
-
"node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/lib/utils.js"(exports2) {
|
|
160
|
-
"use strict";
|
|
161
|
-
var regExpChars = /[|\\{}()[\]^$+*?.]/g;
|
|
162
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
163
|
-
var hasOwn = function(obj, key) {
|
|
164
|
-
return hasOwnProperty.apply(obj, [key]);
|
|
165
|
-
};
|
|
166
|
-
exports2.escapeRegExpChars = function(string) {
|
|
167
|
-
if (!string) {
|
|
168
|
-
return "";
|
|
169
|
-
}
|
|
170
|
-
return String(string).replace(regExpChars, "\\$&");
|
|
171
|
-
};
|
|
172
|
-
var _ENCODE_HTML_RULES = {
|
|
173
|
-
"&": "&",
|
|
174
|
-
"<": "<",
|
|
175
|
-
">": ">",
|
|
176
|
-
'"': """,
|
|
177
|
-
"'": "'"
|
|
178
|
-
};
|
|
179
|
-
var _MATCH_HTML = /[&<>'"]/g;
|
|
180
|
-
function encode_char(c2) {
|
|
181
|
-
return _ENCODE_HTML_RULES[c2] || c2;
|
|
182
|
-
}
|
|
183
|
-
var escapeFuncStr = `var _ENCODE_HTML_RULES = {
|
|
184
|
-
"&": "&"
|
|
185
|
-
, "<": "<"
|
|
186
|
-
, ">": ">"
|
|
187
|
-
, '"': """
|
|
188
|
-
, "'": "'"
|
|
189
|
-
}
|
|
190
|
-
, _MATCH_HTML = /[&<>'"]/g;
|
|
191
|
-
function encode_char(c) {
|
|
192
|
-
return _ENCODE_HTML_RULES[c] || c;
|
|
193
|
-
};
|
|
194
|
-
`;
|
|
195
|
-
exports2.escapeXML = function(markup) {
|
|
196
|
-
return markup == void 0 ? "" : String(markup).replace(_MATCH_HTML, encode_char);
|
|
197
|
-
};
|
|
198
|
-
function escapeXMLToString() {
|
|
199
|
-
return Function.prototype.toString.call(this) + ";\n" + escapeFuncStr;
|
|
200
|
-
}
|
|
201
|
-
try {
|
|
202
|
-
if (typeof Object.defineProperty === "function") {
|
|
203
|
-
Object.defineProperty(exports2.escapeXML, "toString", { value: escapeXMLToString });
|
|
204
|
-
} else {
|
|
205
|
-
exports2.escapeXML.toString = escapeXMLToString;
|
|
206
|
-
}
|
|
207
|
-
} catch (err) {
|
|
208
|
-
console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)");
|
|
209
|
-
}
|
|
210
|
-
exports2.shallowCopy = function(to, from) {
|
|
211
|
-
from = from || {};
|
|
212
|
-
if (to !== null && to !== void 0) {
|
|
213
|
-
for (var p in from) {
|
|
214
|
-
if (!hasOwn(from, p)) {
|
|
215
|
-
continue;
|
|
216
|
-
}
|
|
217
|
-
if (p === "__proto__" || p === "constructor") {
|
|
218
|
-
continue;
|
|
219
|
-
}
|
|
220
|
-
to[p] = from[p];
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
return to;
|
|
224
|
-
};
|
|
225
|
-
exports2.shallowCopyFromList = function(to, from, list) {
|
|
226
|
-
list = list || [];
|
|
227
|
-
from = from || {};
|
|
228
|
-
if (to !== null && to !== void 0) {
|
|
229
|
-
for (var i = 0; i < list.length; i++) {
|
|
230
|
-
var p = list[i];
|
|
231
|
-
if (typeof from[p] != "undefined") {
|
|
232
|
-
if (!hasOwn(from, p)) {
|
|
233
|
-
continue;
|
|
234
|
-
}
|
|
235
|
-
if (p === "__proto__" || p === "constructor") {
|
|
236
|
-
continue;
|
|
237
|
-
}
|
|
238
|
-
to[p] = from[p];
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
return to;
|
|
243
|
-
};
|
|
244
|
-
exports2.cache = {
|
|
245
|
-
_data: {},
|
|
246
|
-
set: function(key, val) {
|
|
247
|
-
this._data[key] = val;
|
|
248
|
-
},
|
|
249
|
-
get: function(key) {
|
|
250
|
-
return this._data[key];
|
|
251
|
-
},
|
|
252
|
-
remove: function(key) {
|
|
253
|
-
delete this._data[key];
|
|
254
|
-
},
|
|
255
|
-
reset: function() {
|
|
256
|
-
this._data = {};
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
exports2.hyphenToCamel = function(str) {
|
|
260
|
-
return str.replace(/-[a-z]/g, function(match) {
|
|
261
|
-
return match[1].toUpperCase();
|
|
262
|
-
});
|
|
263
|
-
};
|
|
264
|
-
exports2.createNullProtoObjWherePossible = function() {
|
|
265
|
-
if (typeof Object.create == "function") {
|
|
266
|
-
return function() {
|
|
267
|
-
return /* @__PURE__ */ Object.create(null);
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
if (!({ __proto__: null } instanceof Object)) {
|
|
271
|
-
return function() {
|
|
272
|
-
return { __proto__: null };
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
return function() {
|
|
276
|
-
return {};
|
|
277
|
-
};
|
|
278
|
-
}();
|
|
279
|
-
exports2.hasOwnOnlyObject = function(obj) {
|
|
280
|
-
var o2 = exports2.createNullProtoObjWherePossible();
|
|
281
|
-
for (var p in obj) {
|
|
282
|
-
if (hasOwn(obj, p)) {
|
|
283
|
-
o2[p] = obj[p];
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
return o2;
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
|
|
291
|
-
// node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/package.json
|
|
292
|
-
var require_package = __commonJS({
|
|
293
|
-
"node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/package.json"(exports2, module2) {
|
|
294
|
-
module2.exports = {
|
|
295
|
-
name: "ejs",
|
|
296
|
-
description: "Embedded JavaScript templates",
|
|
297
|
-
keywords: [
|
|
298
|
-
"template",
|
|
299
|
-
"engine",
|
|
300
|
-
"ejs"
|
|
301
|
-
],
|
|
302
|
-
version: "3.1.10",
|
|
303
|
-
author: "Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)",
|
|
304
|
-
license: "Apache-2.0",
|
|
305
|
-
bin: {
|
|
306
|
-
ejs: "./bin/cli.js"
|
|
307
|
-
},
|
|
308
|
-
main: "./lib/ejs.js",
|
|
309
|
-
jsdelivr: "ejs.min.js",
|
|
310
|
-
unpkg: "ejs.min.js",
|
|
311
|
-
repository: {
|
|
312
|
-
type: "git",
|
|
313
|
-
url: "git://github.com/mde/ejs.git"
|
|
314
|
-
},
|
|
315
|
-
bugs: "https://github.com/mde/ejs/issues",
|
|
316
|
-
homepage: "https://github.com/mde/ejs",
|
|
317
|
-
dependencies: {
|
|
318
|
-
jake: "^10.8.5"
|
|
319
|
-
},
|
|
320
|
-
devDependencies: {
|
|
321
|
-
browserify: "^16.5.1",
|
|
322
|
-
eslint: "^6.8.0",
|
|
323
|
-
"git-directory-deploy": "^1.5.1",
|
|
324
|
-
jsdoc: "^4.0.2",
|
|
325
|
-
"lru-cache": "^4.0.1",
|
|
326
|
-
mocha: "^10.2.0",
|
|
327
|
-
"uglify-js": "^3.3.16"
|
|
328
|
-
},
|
|
329
|
-
engines: {
|
|
330
|
-
node: ">=0.10.0"
|
|
331
|
-
},
|
|
332
|
-
scripts: {
|
|
333
|
-
test: "npx jake test"
|
|
334
|
-
}
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
|
|
339
|
-
// node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/lib/ejs.js
|
|
340
|
-
var require_ejs = __commonJS({
|
|
341
|
-
"node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/lib/ejs.js"(exports2) {
|
|
342
|
-
"use strict";
|
|
343
|
-
var fs7 = require("fs");
|
|
344
|
-
var path7 = require("path");
|
|
345
|
-
var utils = require_utils();
|
|
346
|
-
var scopeOptionWarned = false;
|
|
347
|
-
var _VERSION_STRING = require_package().version;
|
|
348
|
-
var _DEFAULT_OPEN_DELIMITER = "<";
|
|
349
|
-
var _DEFAULT_CLOSE_DELIMITER = ">";
|
|
350
|
-
var _DEFAULT_DELIMITER = "%";
|
|
351
|
-
var _DEFAULT_LOCALS_NAME = "locals";
|
|
352
|
-
var _NAME = "ejs";
|
|
353
|
-
var _REGEX_STRING = "(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)";
|
|
354
|
-
var _OPTS_PASSABLE_WITH_DATA = [
|
|
355
|
-
"delimiter",
|
|
356
|
-
"scope",
|
|
357
|
-
"context",
|
|
358
|
-
"debug",
|
|
359
|
-
"compileDebug",
|
|
360
|
-
"client",
|
|
361
|
-
"_with",
|
|
362
|
-
"rmWhitespace",
|
|
363
|
-
"strict",
|
|
364
|
-
"filename",
|
|
365
|
-
"async"
|
|
366
|
-
];
|
|
367
|
-
var _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat("cache");
|
|
368
|
-
var _BOM = /^\uFEFF/;
|
|
369
|
-
var _JS_IDENTIFIER = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
|
|
370
|
-
exports2.cache = utils.cache;
|
|
371
|
-
exports2.fileLoader = fs7.readFileSync;
|
|
372
|
-
exports2.localsName = _DEFAULT_LOCALS_NAME;
|
|
373
|
-
exports2.promiseImpl = new Function("return this;")().Promise;
|
|
374
|
-
exports2.resolveInclude = function(name, filename, isDir) {
|
|
375
|
-
var dirname2 = path7.dirname;
|
|
376
|
-
var extname = path7.extname;
|
|
377
|
-
var resolve7 = path7.resolve;
|
|
378
|
-
var includePath = resolve7(isDir ? filename : dirname2(filename), name);
|
|
379
|
-
var ext = extname(name);
|
|
380
|
-
if (!ext) {
|
|
381
|
-
includePath += ".ejs";
|
|
382
|
-
}
|
|
383
|
-
return includePath;
|
|
384
|
-
};
|
|
385
|
-
function resolvePaths(name, paths) {
|
|
386
|
-
var filePath;
|
|
387
|
-
if (paths.some(function(v2) {
|
|
388
|
-
filePath = exports2.resolveInclude(name, v2, true);
|
|
389
|
-
return fs7.existsSync(filePath);
|
|
390
|
-
})) {
|
|
391
|
-
return filePath;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
function getIncludePath(path8, options) {
|
|
395
|
-
var includePath;
|
|
396
|
-
var filePath;
|
|
397
|
-
var views = options.views;
|
|
398
|
-
var match = /^[A-Za-z]+:\\|^\//.exec(path8);
|
|
399
|
-
if (match && match.length) {
|
|
400
|
-
path8 = path8.replace(/^\/*/, "");
|
|
401
|
-
if (Array.isArray(options.root)) {
|
|
402
|
-
includePath = resolvePaths(path8, options.root);
|
|
403
|
-
} else {
|
|
404
|
-
includePath = exports2.resolveInclude(path8, options.root || "/", true);
|
|
405
|
-
}
|
|
406
|
-
} else {
|
|
407
|
-
if (options.filename) {
|
|
408
|
-
filePath = exports2.resolveInclude(path8, options.filename);
|
|
409
|
-
if (fs7.existsSync(filePath)) {
|
|
410
|
-
includePath = filePath;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
if (!includePath && Array.isArray(views)) {
|
|
414
|
-
includePath = resolvePaths(path8, views);
|
|
415
|
-
}
|
|
416
|
-
if (!includePath && typeof options.includer !== "function") {
|
|
417
|
-
throw new Error('Could not find the include file "' + options.escapeFunction(path8) + '"');
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
return includePath;
|
|
421
|
-
}
|
|
422
|
-
function handleCache(options, template) {
|
|
423
|
-
var func;
|
|
424
|
-
var filename = options.filename;
|
|
425
|
-
var hasTemplate = arguments.length > 1;
|
|
426
|
-
if (options.cache) {
|
|
427
|
-
if (!filename) {
|
|
428
|
-
throw new Error("cache option requires a filename");
|
|
429
|
-
}
|
|
430
|
-
func = exports2.cache.get(filename);
|
|
431
|
-
if (func) {
|
|
432
|
-
return func;
|
|
433
|
-
}
|
|
434
|
-
if (!hasTemplate) {
|
|
435
|
-
template = fileLoader(filename).toString().replace(_BOM, "");
|
|
436
|
-
}
|
|
437
|
-
} else if (!hasTemplate) {
|
|
438
|
-
if (!filename) {
|
|
439
|
-
throw new Error("Internal EJS error: no file name or template provided");
|
|
440
|
-
}
|
|
441
|
-
template = fileLoader(filename).toString().replace(_BOM, "");
|
|
442
|
-
}
|
|
443
|
-
func = exports2.compile(template, options);
|
|
444
|
-
if (options.cache) {
|
|
445
|
-
exports2.cache.set(filename, func);
|
|
446
|
-
}
|
|
447
|
-
return func;
|
|
448
|
-
}
|
|
449
|
-
function tryHandleCache(options, data, cb) {
|
|
450
|
-
var result;
|
|
451
|
-
if (!cb) {
|
|
452
|
-
if (typeof exports2.promiseImpl == "function") {
|
|
453
|
-
return new exports2.promiseImpl(function(resolve7, reject) {
|
|
454
|
-
try {
|
|
455
|
-
result = handleCache(options)(data);
|
|
456
|
-
resolve7(result);
|
|
457
|
-
} catch (err) {
|
|
458
|
-
reject(err);
|
|
459
|
-
}
|
|
460
|
-
});
|
|
461
|
-
} else {
|
|
462
|
-
throw new Error("Please provide a callback function");
|
|
463
|
-
}
|
|
464
|
-
} else {
|
|
465
|
-
try {
|
|
466
|
-
result = handleCache(options)(data);
|
|
467
|
-
} catch (err) {
|
|
468
|
-
return cb(err);
|
|
469
|
-
}
|
|
470
|
-
cb(null, result);
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
function fileLoader(filePath) {
|
|
474
|
-
return exports2.fileLoader(filePath);
|
|
475
|
-
}
|
|
476
|
-
function includeFile(path8, options) {
|
|
477
|
-
var opts = utils.shallowCopy(utils.createNullProtoObjWherePossible(), options);
|
|
478
|
-
opts.filename = getIncludePath(path8, opts);
|
|
479
|
-
if (typeof options.includer === "function") {
|
|
480
|
-
var includerResult = options.includer(path8, opts.filename);
|
|
481
|
-
if (includerResult) {
|
|
482
|
-
if (includerResult.filename) {
|
|
483
|
-
opts.filename = includerResult.filename;
|
|
484
|
-
}
|
|
485
|
-
if (includerResult.template) {
|
|
486
|
-
return handleCache(opts, includerResult.template);
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
return handleCache(opts);
|
|
491
|
-
}
|
|
492
|
-
function rethrow(err, str, flnm, lineno, esc) {
|
|
493
|
-
var lines = str.split("\n");
|
|
494
|
-
var start = Math.max(lineno - 3, 0);
|
|
495
|
-
var end = Math.min(lines.length, lineno + 3);
|
|
496
|
-
var filename = esc(flnm);
|
|
497
|
-
var context = lines.slice(start, end).map(function(line, i) {
|
|
498
|
-
var curr = i + start + 1;
|
|
499
|
-
return (curr == lineno ? " >> " : " ") + curr + "| " + line;
|
|
500
|
-
}).join("\n");
|
|
501
|
-
err.path = filename;
|
|
502
|
-
err.message = (filename || "ejs") + ":" + lineno + "\n" + context + "\n\n" + err.message;
|
|
503
|
-
throw err;
|
|
504
|
-
}
|
|
505
|
-
function stripSemi(str) {
|
|
506
|
-
return str.replace(/;(\s*$)/, "$1");
|
|
507
|
-
}
|
|
508
|
-
exports2.compile = function compile(template, opts) {
|
|
509
|
-
var templ;
|
|
510
|
-
if (opts && opts.scope) {
|
|
511
|
-
if (!scopeOptionWarned) {
|
|
512
|
-
console.warn("`scope` option is deprecated and will be removed in EJS 3");
|
|
513
|
-
scopeOptionWarned = true;
|
|
514
|
-
}
|
|
515
|
-
if (!opts.context) {
|
|
516
|
-
opts.context = opts.scope;
|
|
517
|
-
}
|
|
518
|
-
delete opts.scope;
|
|
519
|
-
}
|
|
520
|
-
templ = new Template(template, opts);
|
|
521
|
-
return templ.compile();
|
|
522
|
-
};
|
|
523
|
-
exports2.render = function(template, d3, o2) {
|
|
524
|
-
var data = d3 || utils.createNullProtoObjWherePossible();
|
|
525
|
-
var opts = o2 || utils.createNullProtoObjWherePossible();
|
|
526
|
-
if (arguments.length == 2) {
|
|
527
|
-
utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA);
|
|
528
|
-
}
|
|
529
|
-
return handleCache(opts, template)(data);
|
|
530
|
-
};
|
|
531
|
-
exports2.renderFile = function() {
|
|
532
|
-
var args = Array.prototype.slice.call(arguments);
|
|
533
|
-
var filename = args.shift();
|
|
534
|
-
var cb;
|
|
535
|
-
var opts = { filename };
|
|
536
|
-
var data;
|
|
537
|
-
var viewOpts;
|
|
538
|
-
if (typeof arguments[arguments.length - 1] == "function") {
|
|
539
|
-
cb = args.pop();
|
|
540
|
-
}
|
|
541
|
-
if (args.length) {
|
|
542
|
-
data = args.shift();
|
|
543
|
-
if (args.length) {
|
|
544
|
-
utils.shallowCopy(opts, args.pop());
|
|
545
|
-
} else {
|
|
546
|
-
if (data.settings) {
|
|
547
|
-
if (data.settings.views) {
|
|
548
|
-
opts.views = data.settings.views;
|
|
549
|
-
}
|
|
550
|
-
if (data.settings["view cache"]) {
|
|
551
|
-
opts.cache = true;
|
|
552
|
-
}
|
|
553
|
-
viewOpts = data.settings["view options"];
|
|
554
|
-
if (viewOpts) {
|
|
555
|
-
utils.shallowCopy(opts, viewOpts);
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA_EXPRESS);
|
|
559
|
-
}
|
|
560
|
-
opts.filename = filename;
|
|
561
|
-
} else {
|
|
562
|
-
data = utils.createNullProtoObjWherePossible();
|
|
563
|
-
}
|
|
564
|
-
return tryHandleCache(opts, data, cb);
|
|
565
|
-
};
|
|
566
|
-
exports2.Template = Template;
|
|
567
|
-
exports2.clearCache = function() {
|
|
568
|
-
exports2.cache.reset();
|
|
569
|
-
};
|
|
570
|
-
function Template(text, optsParam) {
|
|
571
|
-
var opts = utils.hasOwnOnlyObject(optsParam);
|
|
572
|
-
var options = utils.createNullProtoObjWherePossible();
|
|
573
|
-
this.templateText = text;
|
|
574
|
-
this.mode = null;
|
|
575
|
-
this.truncate = false;
|
|
576
|
-
this.currentLine = 1;
|
|
577
|
-
this.source = "";
|
|
578
|
-
options.client = opts.client || false;
|
|
579
|
-
options.escapeFunction = opts.escape || opts.escapeFunction || utils.escapeXML;
|
|
580
|
-
options.compileDebug = opts.compileDebug !== false;
|
|
581
|
-
options.debug = !!opts.debug;
|
|
582
|
-
options.filename = opts.filename;
|
|
583
|
-
options.openDelimiter = opts.openDelimiter || exports2.openDelimiter || _DEFAULT_OPEN_DELIMITER;
|
|
584
|
-
options.closeDelimiter = opts.closeDelimiter || exports2.closeDelimiter || _DEFAULT_CLOSE_DELIMITER;
|
|
585
|
-
options.delimiter = opts.delimiter || exports2.delimiter || _DEFAULT_DELIMITER;
|
|
586
|
-
options.strict = opts.strict || false;
|
|
587
|
-
options.context = opts.context;
|
|
588
|
-
options.cache = opts.cache || false;
|
|
589
|
-
options.rmWhitespace = opts.rmWhitespace;
|
|
590
|
-
options.root = opts.root;
|
|
591
|
-
options.includer = opts.includer;
|
|
592
|
-
options.outputFunctionName = opts.outputFunctionName;
|
|
593
|
-
options.localsName = opts.localsName || exports2.localsName || _DEFAULT_LOCALS_NAME;
|
|
594
|
-
options.views = opts.views;
|
|
595
|
-
options.async = opts.async;
|
|
596
|
-
options.destructuredLocals = opts.destructuredLocals;
|
|
597
|
-
options.legacyInclude = typeof opts.legacyInclude != "undefined" ? !!opts.legacyInclude : true;
|
|
598
|
-
if (options.strict) {
|
|
599
|
-
options._with = false;
|
|
600
|
-
} else {
|
|
601
|
-
options._with = typeof opts._with != "undefined" ? opts._with : true;
|
|
602
|
-
}
|
|
603
|
-
this.opts = options;
|
|
604
|
-
this.regex = this.createRegex();
|
|
605
|
-
}
|
|
606
|
-
Template.modes = {
|
|
607
|
-
EVAL: "eval",
|
|
608
|
-
ESCAPED: "escaped",
|
|
609
|
-
RAW: "raw",
|
|
610
|
-
COMMENT: "comment",
|
|
611
|
-
LITERAL: "literal"
|
|
612
|
-
};
|
|
613
|
-
Template.prototype = {
|
|
614
|
-
createRegex: function() {
|
|
615
|
-
var str = _REGEX_STRING;
|
|
616
|
-
var delim = utils.escapeRegExpChars(this.opts.delimiter);
|
|
617
|
-
var open = utils.escapeRegExpChars(this.opts.openDelimiter);
|
|
618
|
-
var close = utils.escapeRegExpChars(this.opts.closeDelimiter);
|
|
619
|
-
str = str.replace(/%/g, delim).replace(/</g, open).replace(/>/g, close);
|
|
620
|
-
return new RegExp(str);
|
|
621
|
-
},
|
|
622
|
-
compile: function() {
|
|
623
|
-
var src;
|
|
624
|
-
var fn;
|
|
625
|
-
var opts = this.opts;
|
|
626
|
-
var prepended = "";
|
|
627
|
-
var appended = "";
|
|
628
|
-
var escapeFn = opts.escapeFunction;
|
|
629
|
-
var ctor;
|
|
630
|
-
var sanitizedFilename = opts.filename ? JSON.stringify(opts.filename) : "undefined";
|
|
631
|
-
if (!this.source) {
|
|
632
|
-
this.generateSource();
|
|
633
|
-
prepended += ' var __output = "";\n function __append(s) { if (s !== undefined && s !== null) __output += s }\n';
|
|
634
|
-
if (opts.outputFunctionName) {
|
|
635
|
-
if (!_JS_IDENTIFIER.test(opts.outputFunctionName)) {
|
|
636
|
-
throw new Error("outputFunctionName is not a valid JS identifier.");
|
|
637
|
-
}
|
|
638
|
-
prepended += " var " + opts.outputFunctionName + " = __append;\n";
|
|
639
|
-
}
|
|
640
|
-
if (opts.localsName && !_JS_IDENTIFIER.test(opts.localsName)) {
|
|
641
|
-
throw new Error("localsName is not a valid JS identifier.");
|
|
642
|
-
}
|
|
643
|
-
if (opts.destructuredLocals && opts.destructuredLocals.length) {
|
|
644
|
-
var destructuring = " var __locals = (" + opts.localsName + " || {}),\n";
|
|
645
|
-
for (var i = 0; i < opts.destructuredLocals.length; i++) {
|
|
646
|
-
var name = opts.destructuredLocals[i];
|
|
647
|
-
if (!_JS_IDENTIFIER.test(name)) {
|
|
648
|
-
throw new Error("destructuredLocals[" + i + "] is not a valid JS identifier.");
|
|
649
|
-
}
|
|
650
|
-
if (i > 0) {
|
|
651
|
-
destructuring += ",\n ";
|
|
652
|
-
}
|
|
653
|
-
destructuring += name + " = __locals." + name;
|
|
654
|
-
}
|
|
655
|
-
prepended += destructuring + ";\n";
|
|
656
|
-
}
|
|
657
|
-
if (opts._with !== false) {
|
|
658
|
-
prepended += " with (" + opts.localsName + " || {}) {\n";
|
|
659
|
-
appended += " }\n";
|
|
660
|
-
}
|
|
661
|
-
appended += " return __output;\n";
|
|
662
|
-
this.source = prepended + this.source + appended;
|
|
663
|
-
}
|
|
664
|
-
if (opts.compileDebug) {
|
|
665
|
-
src = "var __line = 1\n , __lines = " + JSON.stringify(this.templateText) + "\n , __filename = " + sanitizedFilename + ";\ntry {\n" + this.source + "} catch (e) {\n rethrow(e, __lines, __filename, __line, escapeFn);\n}\n";
|
|
666
|
-
} else {
|
|
667
|
-
src = this.source;
|
|
668
|
-
}
|
|
669
|
-
if (opts.client) {
|
|
670
|
-
src = "escapeFn = escapeFn || " + escapeFn.toString() + ";\n" + src;
|
|
671
|
-
if (opts.compileDebug) {
|
|
672
|
-
src = "rethrow = rethrow || " + rethrow.toString() + ";\n" + src;
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
if (opts.strict) {
|
|
676
|
-
src = '"use strict";\n' + src;
|
|
677
|
-
}
|
|
678
|
-
if (opts.debug) {
|
|
679
|
-
console.log(src);
|
|
680
|
-
}
|
|
681
|
-
if (opts.compileDebug && opts.filename) {
|
|
682
|
-
src = src + "\n//# sourceURL=" + sanitizedFilename + "\n";
|
|
683
|
-
}
|
|
684
|
-
try {
|
|
685
|
-
if (opts.async) {
|
|
686
|
-
try {
|
|
687
|
-
ctor = new Function("return (async function(){}).constructor;")();
|
|
688
|
-
} catch (e2) {
|
|
689
|
-
if (e2 instanceof SyntaxError) {
|
|
690
|
-
throw new Error("This environment does not support async/await");
|
|
691
|
-
} else {
|
|
692
|
-
throw e2;
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
} else {
|
|
696
|
-
ctor = Function;
|
|
697
|
-
}
|
|
698
|
-
fn = new ctor(opts.localsName + ", escapeFn, include, rethrow", src);
|
|
699
|
-
} catch (e2) {
|
|
700
|
-
if (e2 instanceof SyntaxError) {
|
|
701
|
-
if (opts.filename) {
|
|
702
|
-
e2.message += " in " + opts.filename;
|
|
703
|
-
}
|
|
704
|
-
e2.message += " while compiling ejs\n\n";
|
|
705
|
-
e2.message += "If the above error is not helpful, you may want to try EJS-Lint:\n";
|
|
706
|
-
e2.message += "https://github.com/RyanZim/EJS-Lint";
|
|
707
|
-
if (!opts.async) {
|
|
708
|
-
e2.message += "\n";
|
|
709
|
-
e2.message += "Or, if you meant to create an async function, pass `async: true` as an option.";
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
throw e2;
|
|
713
|
-
}
|
|
714
|
-
var returnedFn = opts.client ? fn : function anonymous(data) {
|
|
715
|
-
var include = function(path8, includeData) {
|
|
716
|
-
var d3 = utils.shallowCopy(utils.createNullProtoObjWherePossible(), data);
|
|
717
|
-
if (includeData) {
|
|
718
|
-
d3 = utils.shallowCopy(d3, includeData);
|
|
719
|
-
}
|
|
720
|
-
return includeFile(path8, opts)(d3);
|
|
721
|
-
};
|
|
722
|
-
return fn.apply(
|
|
723
|
-
opts.context,
|
|
724
|
-
[data || utils.createNullProtoObjWherePossible(), escapeFn, include, rethrow]
|
|
725
|
-
);
|
|
726
|
-
};
|
|
727
|
-
if (opts.filename && typeof Object.defineProperty === "function") {
|
|
728
|
-
var filename = opts.filename;
|
|
729
|
-
var basename3 = path7.basename(filename, path7.extname(filename));
|
|
730
|
-
try {
|
|
731
|
-
Object.defineProperty(returnedFn, "name", {
|
|
732
|
-
value: basename3,
|
|
733
|
-
writable: false,
|
|
734
|
-
enumerable: false,
|
|
735
|
-
configurable: true
|
|
736
|
-
});
|
|
737
|
-
} catch (e2) {
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
return returnedFn;
|
|
741
|
-
},
|
|
742
|
-
generateSource: function() {
|
|
743
|
-
var opts = this.opts;
|
|
744
|
-
if (opts.rmWhitespace) {
|
|
745
|
-
this.templateText = this.templateText.replace(/[\r\n]+/g, "\n").replace(/^\s+|\s+$/gm, "");
|
|
746
|
-
}
|
|
747
|
-
this.templateText = this.templateText.replace(/[ \t]*<%_/gm, "<%_").replace(/_%>[ \t]*/gm, "_%>");
|
|
748
|
-
var self = this;
|
|
749
|
-
var matches = this.parseTemplateText();
|
|
750
|
-
var d3 = this.opts.delimiter;
|
|
751
|
-
var o2 = this.opts.openDelimiter;
|
|
752
|
-
var c2 = this.opts.closeDelimiter;
|
|
753
|
-
if (matches && matches.length) {
|
|
754
|
-
matches.forEach(function(line, index) {
|
|
755
|
-
var closing;
|
|
756
|
-
if (line.indexOf(o2 + d3) === 0 && line.indexOf(o2 + d3 + d3) !== 0) {
|
|
757
|
-
closing = matches[index + 2];
|
|
758
|
-
if (!(closing == d3 + c2 || closing == "-" + d3 + c2 || closing == "_" + d3 + c2)) {
|
|
759
|
-
throw new Error('Could not find matching close tag for "' + line + '".');
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
self.scanLine(line);
|
|
763
|
-
});
|
|
764
|
-
}
|
|
765
|
-
},
|
|
766
|
-
parseTemplateText: function() {
|
|
767
|
-
var str = this.templateText;
|
|
768
|
-
var pat = this.regex;
|
|
769
|
-
var result = pat.exec(str);
|
|
770
|
-
var arr = [];
|
|
771
|
-
var firstPos;
|
|
772
|
-
while (result) {
|
|
773
|
-
firstPos = result.index;
|
|
774
|
-
if (firstPos !== 0) {
|
|
775
|
-
arr.push(str.substring(0, firstPos));
|
|
776
|
-
str = str.slice(firstPos);
|
|
777
|
-
}
|
|
778
|
-
arr.push(result[0]);
|
|
779
|
-
str = str.slice(result[0].length);
|
|
780
|
-
result = pat.exec(str);
|
|
781
|
-
}
|
|
782
|
-
if (str) {
|
|
783
|
-
arr.push(str);
|
|
784
|
-
}
|
|
785
|
-
return arr;
|
|
786
|
-
},
|
|
787
|
-
_addOutput: function(line) {
|
|
788
|
-
if (this.truncate) {
|
|
789
|
-
line = line.replace(/^(?:\r\n|\r|\n)/, "");
|
|
790
|
-
this.truncate = false;
|
|
791
|
-
}
|
|
792
|
-
if (!line) {
|
|
793
|
-
return line;
|
|
794
|
-
}
|
|
795
|
-
line = line.replace(/\\/g, "\\\\");
|
|
796
|
-
line = line.replace(/\n/g, "\\n");
|
|
797
|
-
line = line.replace(/\r/g, "\\r");
|
|
798
|
-
line = line.replace(/"/g, '\\"');
|
|
799
|
-
this.source += ' ; __append("' + line + '")\n';
|
|
800
|
-
},
|
|
801
|
-
scanLine: function(line) {
|
|
802
|
-
var self = this;
|
|
803
|
-
var d3 = this.opts.delimiter;
|
|
804
|
-
var o2 = this.opts.openDelimiter;
|
|
805
|
-
var c2 = this.opts.closeDelimiter;
|
|
806
|
-
var newLineCount = 0;
|
|
807
|
-
newLineCount = line.split("\n").length - 1;
|
|
808
|
-
switch (line) {
|
|
809
|
-
case o2 + d3:
|
|
810
|
-
case o2 + d3 + "_":
|
|
811
|
-
this.mode = Template.modes.EVAL;
|
|
812
|
-
break;
|
|
813
|
-
case o2 + d3 + "=":
|
|
814
|
-
this.mode = Template.modes.ESCAPED;
|
|
815
|
-
break;
|
|
816
|
-
case o2 + d3 + "-":
|
|
817
|
-
this.mode = Template.modes.RAW;
|
|
818
|
-
break;
|
|
819
|
-
case o2 + d3 + "#":
|
|
820
|
-
this.mode = Template.modes.COMMENT;
|
|
821
|
-
break;
|
|
822
|
-
case o2 + d3 + d3:
|
|
823
|
-
this.mode = Template.modes.LITERAL;
|
|
824
|
-
this.source += ' ; __append("' + line.replace(o2 + d3 + d3, o2 + d3) + '")\n';
|
|
825
|
-
break;
|
|
826
|
-
case d3 + d3 + c2:
|
|
827
|
-
this.mode = Template.modes.LITERAL;
|
|
828
|
-
this.source += ' ; __append("' + line.replace(d3 + d3 + c2, d3 + c2) + '")\n';
|
|
829
|
-
break;
|
|
830
|
-
case d3 + c2:
|
|
831
|
-
case "-" + d3 + c2:
|
|
832
|
-
case "_" + d3 + c2:
|
|
833
|
-
if (this.mode == Template.modes.LITERAL) {
|
|
834
|
-
this._addOutput(line);
|
|
835
|
-
}
|
|
836
|
-
this.mode = null;
|
|
837
|
-
this.truncate = line.indexOf("-") === 0 || line.indexOf("_") === 0;
|
|
838
|
-
break;
|
|
839
|
-
default:
|
|
840
|
-
if (this.mode) {
|
|
841
|
-
switch (this.mode) {
|
|
842
|
-
case Template.modes.EVAL:
|
|
843
|
-
case Template.modes.ESCAPED:
|
|
844
|
-
case Template.modes.RAW:
|
|
845
|
-
if (line.lastIndexOf("//") > line.lastIndexOf("\n")) {
|
|
846
|
-
line += "\n";
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
switch (this.mode) {
|
|
850
|
-
// Just executing code
|
|
851
|
-
case Template.modes.EVAL:
|
|
852
|
-
this.source += " ; " + line + "\n";
|
|
853
|
-
break;
|
|
854
|
-
// Exec, esc, and output
|
|
855
|
-
case Template.modes.ESCAPED:
|
|
856
|
-
this.source += " ; __append(escapeFn(" + stripSemi(line) + "))\n";
|
|
857
|
-
break;
|
|
858
|
-
// Exec and output
|
|
859
|
-
case Template.modes.RAW:
|
|
860
|
-
this.source += " ; __append(" + stripSemi(line) + ")\n";
|
|
861
|
-
break;
|
|
862
|
-
case Template.modes.COMMENT:
|
|
863
|
-
break;
|
|
864
|
-
// Literal <%% mode, append as raw output
|
|
865
|
-
case Template.modes.LITERAL:
|
|
866
|
-
this._addOutput(line);
|
|
867
|
-
break;
|
|
868
|
-
}
|
|
869
|
-
} else {
|
|
870
|
-
this._addOutput(line);
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
if (self.opts.compileDebug && newLineCount) {
|
|
874
|
-
this.currentLine += newLineCount;
|
|
875
|
-
this.source += " ; __line = " + this.currentLine + "\n";
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
};
|
|
879
|
-
exports2.escapeXML = utils.escapeXML;
|
|
880
|
-
exports2.__express = exports2.renderFile;
|
|
881
|
-
exports2.VERSION = _VERSION_STRING;
|
|
882
|
-
exports2.name = _NAME;
|
|
883
|
-
if (typeof window != "undefined") {
|
|
884
|
-
window.ejs = exports2;
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
});
|
|
888
|
-
|
|
889
|
-
// index.ts
|
|
890
|
-
var fs6 = __toESM(require("fs"), 1);
|
|
891
|
-
var path6 = __toESM(require("path"), 1);
|
|
892
|
-
var import_node_util = require("util");
|
|
893
|
-
|
|
894
|
-
// node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/dist/index.mjs
|
|
895
|
-
var import_sisteransi = __toESM(require_src(), 1);
|
|
896
|
-
var import_node_process = require("process");
|
|
897
|
-
var import_node_readline = __toESM(require("readline"), 1);
|
|
898
|
-
var import_node_tty = require("tty");
|
|
899
|
-
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
900
|
-
function J({ onlyFirst: t = false } = {}) {
|
|
901
|
-
const F2 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
902
|
-
return new RegExp(F2, t ? void 0 : "g");
|
|
903
|
-
}
|
|
904
|
-
var Q = J();
|
|
905
|
-
function T(t) {
|
|
906
|
-
if (typeof t != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
|
|
907
|
-
return t.replace(Q, "");
|
|
908
|
-
}
|
|
909
|
-
function O(t) {
|
|
910
|
-
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
911
|
-
}
|
|
912
|
-
var P = { exports: {} };
|
|
913
|
-
(function(t) {
|
|
914
|
-
var u2 = {};
|
|
915
|
-
t.exports = u2, u2.eastAsianWidth = function(e2) {
|
|
916
|
-
var s = e2.charCodeAt(0), i = e2.length == 2 ? e2.charCodeAt(1) : 0, D2 = s;
|
|
917
|
-
return 55296 <= s && s <= 56319 && 56320 <= i && i <= 57343 && (s &= 1023, i &= 1023, D2 = s << 10 | i, D2 += 65536), D2 == 12288 || 65281 <= D2 && D2 <= 65376 || 65504 <= D2 && D2 <= 65510 ? "F" : D2 == 8361 || 65377 <= D2 && D2 <= 65470 || 65474 <= D2 && D2 <= 65479 || 65482 <= D2 && D2 <= 65487 || 65490 <= D2 && D2 <= 65495 || 65498 <= D2 && D2 <= 65500 || 65512 <= D2 && D2 <= 65518 ? "H" : 4352 <= D2 && D2 <= 4447 || 4515 <= D2 && D2 <= 4519 || 4602 <= D2 && D2 <= 4607 || 9001 <= D2 && D2 <= 9002 || 11904 <= D2 && D2 <= 11929 || 11931 <= D2 && D2 <= 12019 || 12032 <= D2 && D2 <= 12245 || 12272 <= D2 && D2 <= 12283 || 12289 <= D2 && D2 <= 12350 || 12353 <= D2 && D2 <= 12438 || 12441 <= D2 && D2 <= 12543 || 12549 <= D2 && D2 <= 12589 || 12593 <= D2 && D2 <= 12686 || 12688 <= D2 && D2 <= 12730 || 12736 <= D2 && D2 <= 12771 || 12784 <= D2 && D2 <= 12830 || 12832 <= D2 && D2 <= 12871 || 12880 <= D2 && D2 <= 13054 || 13056 <= D2 && D2 <= 19903 || 19968 <= D2 && D2 <= 42124 || 42128 <= D2 && D2 <= 42182 || 43360 <= D2 && D2 <= 43388 || 44032 <= D2 && D2 <= 55203 || 55216 <= D2 && D2 <= 55238 || 55243 <= D2 && D2 <= 55291 || 63744 <= D2 && D2 <= 64255 || 65040 <= D2 && D2 <= 65049 || 65072 <= D2 && D2 <= 65106 || 65108 <= D2 && D2 <= 65126 || 65128 <= D2 && D2 <= 65131 || 110592 <= D2 && D2 <= 110593 || 127488 <= D2 && D2 <= 127490 || 127504 <= D2 && D2 <= 127546 || 127552 <= D2 && D2 <= 127560 || 127568 <= D2 && D2 <= 127569 || 131072 <= D2 && D2 <= 194367 || 177984 <= D2 && D2 <= 196605 || 196608 <= D2 && D2 <= 262141 ? "W" : 32 <= D2 && D2 <= 126 || 162 <= D2 && D2 <= 163 || 165 <= D2 && D2 <= 166 || D2 == 172 || D2 == 175 || 10214 <= D2 && D2 <= 10221 || 10629 <= D2 && D2 <= 10630 ? "Na" : D2 == 161 || D2 == 164 || 167 <= D2 && D2 <= 168 || D2 == 170 || 173 <= D2 && D2 <= 174 || 176 <= D2 && D2 <= 180 || 182 <= D2 && D2 <= 186 || 188 <= D2 && D2 <= 191 || D2 == 198 || D2 == 208 || 215 <= D2 && D2 <= 216 || 222 <= D2 && D2 <= 225 || D2 == 230 || 232 <= D2 && D2 <= 234 || 236 <= D2 && D2 <= 237 || D2 == 240 || 242 <= D2 && D2 <= 243 || 247 <= D2 && D2 <= 250 || D2 == 252 || D2 == 254 || D2 == 257 || D2 == 273 || D2 == 275 || D2 == 283 || 294 <= D2 && D2 <= 295 || D2 == 299 || 305 <= D2 && D2 <= 307 || D2 == 312 || 319 <= D2 && D2 <= 322 || D2 == 324 || 328 <= D2 && D2 <= 331 || D2 == 333 || 338 <= D2 && D2 <= 339 || 358 <= D2 && D2 <= 359 || D2 == 363 || D2 == 462 || D2 == 464 || D2 == 466 || D2 == 468 || D2 == 470 || D2 == 472 || D2 == 474 || D2 == 476 || D2 == 593 || D2 == 609 || D2 == 708 || D2 == 711 || 713 <= D2 && D2 <= 715 || D2 == 717 || D2 == 720 || 728 <= D2 && D2 <= 731 || D2 == 733 || D2 == 735 || 768 <= D2 && D2 <= 879 || 913 <= D2 && D2 <= 929 || 931 <= D2 && D2 <= 937 || 945 <= D2 && D2 <= 961 || 963 <= D2 && D2 <= 969 || D2 == 1025 || 1040 <= D2 && D2 <= 1103 || D2 == 1105 || D2 == 8208 || 8211 <= D2 && D2 <= 8214 || 8216 <= D2 && D2 <= 8217 || 8220 <= D2 && D2 <= 8221 || 8224 <= D2 && D2 <= 8226 || 8228 <= D2 && D2 <= 8231 || D2 == 8240 || 8242 <= D2 && D2 <= 8243 || D2 == 8245 || D2 == 8251 || D2 == 8254 || D2 == 8308 || D2 == 8319 || 8321 <= D2 && D2 <= 8324 || D2 == 8364 || D2 == 8451 || D2 == 8453 || D2 == 8457 || D2 == 8467 || D2 == 8470 || 8481 <= D2 && D2 <= 8482 || D2 == 8486 || D2 == 8491 || 8531 <= D2 && D2 <= 8532 || 8539 <= D2 && D2 <= 8542 || 8544 <= D2 && D2 <= 8555 || 8560 <= D2 && D2 <= 8569 || D2 == 8585 || 8592 <= D2 && D2 <= 8601 || 8632 <= D2 && D2 <= 8633 || D2 == 8658 || D2 == 8660 || D2 == 8679 || D2 == 8704 || 8706 <= D2 && D2 <= 8707 || 8711 <= D2 && D2 <= 8712 || D2 == 8715 || D2 == 8719 || D2 == 8721 || D2 == 8725 || D2 == 8730 || 8733 <= D2 && D2 <= 8736 || D2 == 8739 || D2 == 8741 || 8743 <= D2 && D2 <= 8748 || D2 == 8750 || 8756 <= D2 && D2 <= 8759 || 8764 <= D2 && D2 <= 8765 || D2 == 8776 || D2 == 8780 || D2 == 8786 || 8800 <= D2 && D2 <= 8801 || 8804 <= D2 && D2 <= 8807 || 8810 <= D2 && D2 <= 8811 || 8814 <= D2 && D2 <= 8815 || 8834 <= D2 && D2 <= 8835 || 8838 <= D2 && D2 <= 8839 || D2 == 8853 || D2 == 8857 || D2 == 8869 || D2 == 8895 || D2 == 8978 || 9312 <= D2 && D2 <= 9449 || 9451 <= D2 && D2 <= 9547 || 9552 <= D2 && D2 <= 9587 || 9600 <= D2 && D2 <= 9615 || 9618 <= D2 && D2 <= 9621 || 9632 <= D2 && D2 <= 9633 || 9635 <= D2 && D2 <= 9641 || 9650 <= D2 && D2 <= 9651 || 9654 <= D2 && D2 <= 9655 || 9660 <= D2 && D2 <= 9661 || 9664 <= D2 && D2 <= 9665 || 9670 <= D2 && D2 <= 9672 || D2 == 9675 || 9678 <= D2 && D2 <= 9681 || 9698 <= D2 && D2 <= 9701 || D2 == 9711 || 9733 <= D2 && D2 <= 9734 || D2 == 9737 || 9742 <= D2 && D2 <= 9743 || 9748 <= D2 && D2 <= 9749 || D2 == 9756 || D2 == 9758 || D2 == 9792 || D2 == 9794 || 9824 <= D2 && D2 <= 9825 || 9827 <= D2 && D2 <= 9829 || 9831 <= D2 && D2 <= 9834 || 9836 <= D2 && D2 <= 9837 || D2 == 9839 || 9886 <= D2 && D2 <= 9887 || 9918 <= D2 && D2 <= 9919 || 9924 <= D2 && D2 <= 9933 || 9935 <= D2 && D2 <= 9953 || D2 == 9955 || 9960 <= D2 && D2 <= 9983 || D2 == 10045 || D2 == 10071 || 10102 <= D2 && D2 <= 10111 || 11093 <= D2 && D2 <= 11097 || 12872 <= D2 && D2 <= 12879 || 57344 <= D2 && D2 <= 63743 || 65024 <= D2 && D2 <= 65039 || D2 == 65533 || 127232 <= D2 && D2 <= 127242 || 127248 <= D2 && D2 <= 127277 || 127280 <= D2 && D2 <= 127337 || 127344 <= D2 && D2 <= 127386 || 917760 <= D2 && D2 <= 917999 || 983040 <= D2 && D2 <= 1048573 || 1048576 <= D2 && D2 <= 1114109 ? "A" : "N";
|
|
918
|
-
}, u2.characterLength = function(e2) {
|
|
919
|
-
var s = this.eastAsianWidth(e2);
|
|
920
|
-
return s == "F" || s == "W" || s == "A" ? 2 : 1;
|
|
921
|
-
};
|
|
922
|
-
function F2(e2) {
|
|
923
|
-
return e2.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
924
|
-
}
|
|
925
|
-
u2.length = function(e2) {
|
|
926
|
-
for (var s = F2(e2), i = 0, D2 = 0; D2 < s.length; D2++) i = i + this.characterLength(s[D2]);
|
|
927
|
-
return i;
|
|
928
|
-
}, u2.slice = function(e2, s, i) {
|
|
929
|
-
textLen = u2.length(e2), s = s || 0, i = i || 1, s < 0 && (s = textLen + s), i < 0 && (i = textLen + i);
|
|
930
|
-
for (var D2 = "", C2 = 0, o2 = F2(e2), E = 0; E < o2.length; E++) {
|
|
931
|
-
var a = o2[E], n = u2.length(a);
|
|
932
|
-
if (C2 >= s - (n == 2 ? 1 : 0)) if (C2 + n <= i) D2 += a;
|
|
933
|
-
else break;
|
|
934
|
-
C2 += n;
|
|
935
|
-
}
|
|
936
|
-
return D2;
|
|
937
|
-
};
|
|
938
|
-
})(P);
|
|
939
|
-
var X = P.exports;
|
|
940
|
-
var DD = O(X);
|
|
941
|
-
var uD = function() {
|
|
942
|
-
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
|
|
943
|
-
};
|
|
944
|
-
var FD = O(uD);
|
|
945
|
-
function A(t, u2 = {}) {
|
|
946
|
-
if (typeof t != "string" || t.length === 0 || (u2 = { ambiguousIsNarrow: true, ...u2 }, t = T(t), t.length === 0)) return 0;
|
|
947
|
-
t = t.replace(FD(), " ");
|
|
948
|
-
const F2 = u2.ambiguousIsNarrow ? 1 : 2;
|
|
949
|
-
let e2 = 0;
|
|
950
|
-
for (const s of t) {
|
|
951
|
-
const i = s.codePointAt(0);
|
|
952
|
-
if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879) continue;
|
|
953
|
-
switch (DD.eastAsianWidth(s)) {
|
|
954
|
-
case "F":
|
|
955
|
-
case "W":
|
|
956
|
-
e2 += 2;
|
|
957
|
-
break;
|
|
958
|
-
case "A":
|
|
959
|
-
e2 += F2;
|
|
960
|
-
break;
|
|
961
|
-
default:
|
|
962
|
-
e2 += 1;
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
return e2;
|
|
966
|
-
}
|
|
967
|
-
var m = 10;
|
|
968
|
-
var L = (t = 0) => (u2) => `\x1B[${u2 + t}m`;
|
|
969
|
-
var N = (t = 0) => (u2) => `\x1B[${38 + t};5;${u2}m`;
|
|
970
|
-
var I = (t = 0) => (u2, F2, e2) => `\x1B[${38 + t};2;${u2};${F2};${e2}m`;
|
|
971
|
-
var r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
|
|
972
|
-
Object.keys(r.modifier);
|
|
973
|
-
var tD = Object.keys(r.color);
|
|
974
|
-
var eD = Object.keys(r.bgColor);
|
|
975
|
-
[...tD, ...eD];
|
|
976
|
-
function sD() {
|
|
977
|
-
const t = /* @__PURE__ */ new Map();
|
|
978
|
-
for (const [u2, F2] of Object.entries(r)) {
|
|
979
|
-
for (const [e2, s] of Object.entries(F2)) r[e2] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, F2[e2] = r[e2], t.set(s[0], s[1]);
|
|
980
|
-
Object.defineProperty(r, u2, { value: F2, enumerable: false });
|
|
981
|
-
}
|
|
982
|
-
return Object.defineProperty(r, "codes", { value: t, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = L(), r.color.ansi256 = N(), r.color.ansi16m = I(), r.bgColor.ansi = L(m), r.bgColor.ansi256 = N(m), r.bgColor.ansi16m = I(m), Object.defineProperties(r, { rgbToAnsi256: { value: (u2, F2, e2) => u2 === F2 && F2 === e2 ? u2 < 8 ? 16 : u2 > 248 ? 231 : Math.round((u2 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u2 / 255 * 5) + 6 * Math.round(F2 / 255 * 5) + Math.round(e2 / 255 * 5), enumerable: false }, hexToRgb: { value: (u2) => {
|
|
983
|
-
const F2 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u2.toString(16));
|
|
984
|
-
if (!F2) return [0, 0, 0];
|
|
985
|
-
let [e2] = F2;
|
|
986
|
-
e2.length === 3 && (e2 = [...e2].map((i) => i + i).join(""));
|
|
987
|
-
const s = Number.parseInt(e2, 16);
|
|
988
|
-
return [s >> 16 & 255, s >> 8 & 255, s & 255];
|
|
989
|
-
}, enumerable: false }, hexToAnsi256: { value: (u2) => r.rgbToAnsi256(...r.hexToRgb(u2)), enumerable: false }, ansi256ToAnsi: { value: (u2) => {
|
|
990
|
-
if (u2 < 8) return 30 + u2;
|
|
991
|
-
if (u2 < 16) return 90 + (u2 - 8);
|
|
992
|
-
let F2, e2, s;
|
|
993
|
-
if (u2 >= 232) F2 = ((u2 - 232) * 10 + 8) / 255, e2 = F2, s = F2;
|
|
994
|
-
else {
|
|
995
|
-
u2 -= 16;
|
|
996
|
-
const C2 = u2 % 36;
|
|
997
|
-
F2 = Math.floor(u2 / 36) / 5, e2 = Math.floor(C2 / 6) / 5, s = C2 % 6 / 5;
|
|
998
|
-
}
|
|
999
|
-
const i = Math.max(F2, e2, s) * 2;
|
|
1000
|
-
if (i === 0) return 30;
|
|
1001
|
-
let D2 = 30 + (Math.round(s) << 2 | Math.round(e2) << 1 | Math.round(F2));
|
|
1002
|
-
return i === 2 && (D2 += 60), D2;
|
|
1003
|
-
}, enumerable: false }, rgbToAnsi: { value: (u2, F2, e2) => r.ansi256ToAnsi(r.rgbToAnsi256(u2, F2, e2)), enumerable: false }, hexToAnsi: { value: (u2) => r.ansi256ToAnsi(r.hexToAnsi256(u2)), enumerable: false } }), r;
|
|
1004
|
-
}
|
|
1005
|
-
var iD = sD();
|
|
1006
|
-
var v = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
|
|
1007
|
-
var CD = 39;
|
|
1008
|
-
var w = "\x07";
|
|
1009
|
-
var W = "[";
|
|
1010
|
-
var rD = "]";
|
|
1011
|
-
var R = "m";
|
|
1012
|
-
var y = `${rD}8;;`;
|
|
1013
|
-
var V = (t) => `${v.values().next().value}${W}${t}${R}`;
|
|
1014
|
-
var z = (t) => `${v.values().next().value}${y}${t}${w}`;
|
|
1015
|
-
var ED = (t) => t.split(" ").map((u2) => A(u2));
|
|
1016
|
-
var _ = (t, u2, F2) => {
|
|
1017
|
-
const e2 = [...u2];
|
|
1018
|
-
let s = false, i = false, D2 = A(T(t[t.length - 1]));
|
|
1019
|
-
for (const [C2, o2] of e2.entries()) {
|
|
1020
|
-
const E = A(o2);
|
|
1021
|
-
if (D2 + E <= F2 ? t[t.length - 1] += o2 : (t.push(o2), D2 = 0), v.has(o2) && (s = true, i = e2.slice(C2 + 1).join("").startsWith(y)), s) {
|
|
1022
|
-
i ? o2 === w && (s = false, i = false) : o2 === R && (s = false);
|
|
1023
|
-
continue;
|
|
1024
|
-
}
|
|
1025
|
-
D2 += E, D2 === F2 && C2 < e2.length - 1 && (t.push(""), D2 = 0);
|
|
1026
|
-
}
|
|
1027
|
-
!D2 && t[t.length - 1].length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
|
|
1028
|
-
};
|
|
1029
|
-
var nD = (t) => {
|
|
1030
|
-
const u2 = t.split(" ");
|
|
1031
|
-
let F2 = u2.length;
|
|
1032
|
-
for (; F2 > 0 && !(A(u2[F2 - 1]) > 0); ) F2--;
|
|
1033
|
-
return F2 === u2.length ? t : u2.slice(0, F2).join(" ") + u2.slice(F2).join("");
|
|
1034
|
-
};
|
|
1035
|
-
var oD = (t, u2, F2 = {}) => {
|
|
1036
|
-
if (F2.trim !== false && t.trim() === "") return "";
|
|
1037
|
-
let e2 = "", s, i;
|
|
1038
|
-
const D2 = ED(t);
|
|
1039
|
-
let C2 = [""];
|
|
1040
|
-
for (const [E, a] of t.split(" ").entries()) {
|
|
1041
|
-
F2.trim !== false && (C2[C2.length - 1] = C2[C2.length - 1].trimStart());
|
|
1042
|
-
let n = A(C2[C2.length - 1]);
|
|
1043
|
-
if (E !== 0 && (n >= u2 && (F2.wordWrap === false || F2.trim === false) && (C2.push(""), n = 0), (n > 0 || F2.trim === false) && (C2[C2.length - 1] += " ", n++)), F2.hard && D2[E] > u2) {
|
|
1044
|
-
const B2 = u2 - n, p = 1 + Math.floor((D2[E] - B2 - 1) / u2);
|
|
1045
|
-
Math.floor((D2[E] - 1) / u2) < p && C2.push(""), _(C2, a, u2);
|
|
1046
|
-
continue;
|
|
1047
|
-
}
|
|
1048
|
-
if (n + D2[E] > u2 && n > 0 && D2[E] > 0) {
|
|
1049
|
-
if (F2.wordWrap === false && n < u2) {
|
|
1050
|
-
_(C2, a, u2);
|
|
1051
|
-
continue;
|
|
1052
|
-
}
|
|
1053
|
-
C2.push("");
|
|
1054
|
-
}
|
|
1055
|
-
if (n + D2[E] > u2 && F2.wordWrap === false) {
|
|
1056
|
-
_(C2, a, u2);
|
|
1057
|
-
continue;
|
|
1058
|
-
}
|
|
1059
|
-
C2[C2.length - 1] += a;
|
|
1060
|
-
}
|
|
1061
|
-
F2.trim !== false && (C2 = C2.map((E) => nD(E)));
|
|
1062
|
-
const o2 = [...C2.join(`
|
|
1063
|
-
`)];
|
|
1064
|
-
for (const [E, a] of o2.entries()) {
|
|
1065
|
-
if (e2 += a, v.has(a)) {
|
|
1066
|
-
const { groups: B2 } = new RegExp(`(?:\\${W}(?<code>\\d+)m|\\${y}(?<uri>.*)${w})`).exec(o2.slice(E).join("")) || { groups: {} };
|
|
1067
|
-
if (B2.code !== void 0) {
|
|
1068
|
-
const p = Number.parseFloat(B2.code);
|
|
1069
|
-
s = p === CD ? void 0 : p;
|
|
1070
|
-
} else B2.uri !== void 0 && (i = B2.uri.length === 0 ? void 0 : B2.uri);
|
|
1071
|
-
}
|
|
1072
|
-
const n = iD.codes.get(Number(s));
|
|
1073
|
-
o2[E + 1] === `
|
|
1074
|
-
` ? (i && (e2 += z("")), s && n && (e2 += V(n))) : a === `
|
|
1075
|
-
` && (s && n && (e2 += V(s)), i && (e2 += z(i)));
|
|
1076
|
-
}
|
|
1077
|
-
return e2;
|
|
1078
|
-
};
|
|
1079
|
-
function G(t, u2, F2) {
|
|
1080
|
-
return String(t).normalize().replace(/\r\n/g, `
|
|
1081
|
-
`).split(`
|
|
1082
|
-
`).map((e2) => oD(e2, u2, F2)).join(`
|
|
1083
|
-
`);
|
|
1084
|
-
}
|
|
1085
|
-
var aD = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
1086
|
-
var c = { actions: new Set(aD), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]) };
|
|
1087
|
-
function k(t, u2) {
|
|
1088
|
-
if (typeof t == "string") return c.aliases.get(t) === u2;
|
|
1089
|
-
for (const F2 of t) if (F2 !== void 0 && k(F2, u2)) return true;
|
|
1090
|
-
return false;
|
|
1091
|
-
}
|
|
1092
|
-
function lD(t, u2) {
|
|
1093
|
-
if (t === u2) return;
|
|
1094
|
-
const F2 = t.split(`
|
|
1095
|
-
`), e2 = u2.split(`
|
|
1096
|
-
`), s = [];
|
|
1097
|
-
for (let i = 0; i < Math.max(F2.length, e2.length); i++) F2[i] !== e2[i] && s.push(i);
|
|
1098
|
-
return s;
|
|
1099
|
-
}
|
|
1100
|
-
var xD = globalThis.process.platform.startsWith("win");
|
|
1101
|
-
var S = Symbol("clack:cancel");
|
|
1102
|
-
function BD(t) {
|
|
1103
|
-
return t === S;
|
|
1104
|
-
}
|
|
1105
|
-
function d(t, u2) {
|
|
1106
|
-
const F2 = t;
|
|
1107
|
-
F2.isTTY && F2.setRawMode(u2);
|
|
1108
|
-
}
|
|
1109
|
-
var AD = Object.defineProperty;
|
|
1110
|
-
var pD = (t, u2, F2) => u2 in t ? AD(t, u2, { enumerable: true, configurable: true, writable: true, value: F2 }) : t[u2] = F2;
|
|
1111
|
-
var h = (t, u2, F2) => (pD(t, typeof u2 != "symbol" ? u2 + "" : u2, F2), F2);
|
|
1112
|
-
var x = class {
|
|
1113
|
-
constructor(u2, F2 = true) {
|
|
1114
|
-
h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", false), h(this, "_prevFrame", ""), h(this, "_subscribers", /* @__PURE__ */ new Map()), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
|
|
1115
|
-
const { input: e2 = import_node_process.stdin, output: s = import_node_process.stdout, render: i, signal: D2, ...C2 } = u2;
|
|
1116
|
-
this.opts = C2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i.bind(this), this._track = F2, this._abortSignal = D2, this.input = e2, this.output = s;
|
|
1117
|
-
}
|
|
1118
|
-
unsubscribe() {
|
|
1119
|
-
this._subscribers.clear();
|
|
1120
|
-
}
|
|
1121
|
-
setSubscriber(u2, F2) {
|
|
1122
|
-
const e2 = this._subscribers.get(u2) ?? [];
|
|
1123
|
-
e2.push(F2), this._subscribers.set(u2, e2);
|
|
1124
|
-
}
|
|
1125
|
-
on(u2, F2) {
|
|
1126
|
-
this.setSubscriber(u2, { cb: F2 });
|
|
1127
|
-
}
|
|
1128
|
-
once(u2, F2) {
|
|
1129
|
-
this.setSubscriber(u2, { cb: F2, once: true });
|
|
1130
|
-
}
|
|
1131
|
-
emit(u2, ...F2) {
|
|
1132
|
-
const e2 = this._subscribers.get(u2) ?? [], s = [];
|
|
1133
|
-
for (const i of e2) i.cb(...F2), i.once && s.push(() => e2.splice(e2.indexOf(i), 1));
|
|
1134
|
-
for (const i of s) i();
|
|
1135
|
-
}
|
|
1136
|
-
prompt() {
|
|
1137
|
-
return new Promise((u2, F2) => {
|
|
1138
|
-
if (this._abortSignal) {
|
|
1139
|
-
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), u2(S);
|
|
1140
|
-
this._abortSignal.addEventListener("abort", () => {
|
|
1141
|
-
this.state = "cancel", this.close();
|
|
1142
|
-
}, { once: true });
|
|
1143
|
-
}
|
|
1144
|
-
const e2 = new import_node_tty.WriteStream(0);
|
|
1145
|
-
e2._write = (s, i, D2) => {
|
|
1146
|
-
var _a, _b;
|
|
1147
|
-
this._track && (this.value = (_a = this.rl) == null ? void 0 : _a.line.replace(/\t/g, ""), this._cursor = ((_b = this.rl) == null ? void 0 : _b.cursor) ?? 0, this.emit("value", this.value)), D2();
|
|
1148
|
-
}, this.input.pipe(e2), this.rl = import_node_readline.default.createInterface({ input: this.input, output: e2, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), import_node_readline.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), d(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
1149
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), d(this.input, false), u2(this.value);
|
|
1150
|
-
}), this.once("cancel", () => {
|
|
1151
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), d(this.input, false), u2(S);
|
|
1152
|
-
});
|
|
1153
|
-
});
|
|
1154
|
-
}
|
|
1155
|
-
onKeypress(u2, F2) {
|
|
1156
|
-
var _a, _b;
|
|
1157
|
-
if (this.state === "error" && (this.state = "active"), (F2 == null ? void 0 : F2.name) && (!this._track && c.aliases.has(F2.name) && this.emit("cursor", c.aliases.get(F2.name)), c.actions.has(F2.name) && this.emit("cursor", F2.name)), u2 && (u2.toLowerCase() === "y" || u2.toLowerCase() === "n") && this.emit("confirm", u2.toLowerCase() === "y"), u2 === " " && this.opts.placeholder && (this.value || ((_a = this.rl) == null ? void 0 : _a.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u2 && this.emit("key", u2.toLowerCase()), (F2 == null ? void 0 : F2.name) === "return") {
|
|
1158
|
-
if (this.opts.validate) {
|
|
1159
|
-
const e2 = this.opts.validate(this.value);
|
|
1160
|
-
e2 && (this.error = e2 instanceof Error ? e2.message : e2, this.state = "error", (_b = this.rl) == null ? void 0 : _b.write(this.value));
|
|
1161
|
-
}
|
|
1162
|
-
this.state !== "error" && (this.state = "submit");
|
|
1163
|
-
}
|
|
1164
|
-
k([u2, F2 == null ? void 0 : F2.name, F2 == null ? void 0 : F2.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
1165
|
-
}
|
|
1166
|
-
close() {
|
|
1167
|
-
var _a;
|
|
1168
|
-
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
1169
|
-
`), d(this.input, false), (_a = this.rl) == null ? void 0 : _a.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
1170
|
-
}
|
|
1171
|
-
restoreCursor() {
|
|
1172
|
-
const u2 = G(this._prevFrame, process.stdout.columns, { hard: true }).split(`
|
|
1173
|
-
`).length - 1;
|
|
1174
|
-
this.output.write(import_sisteransi.cursor.move(-999, u2 * -1));
|
|
1175
|
-
}
|
|
1176
|
-
render() {
|
|
1177
|
-
const u2 = G(this._render(this) ?? "", process.stdout.columns, { hard: true });
|
|
1178
|
-
if (u2 !== this._prevFrame) {
|
|
1179
|
-
if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
|
|
1180
|
-
else {
|
|
1181
|
-
const F2 = lD(this._prevFrame, u2);
|
|
1182
|
-
if (this.restoreCursor(), F2 && (F2 == null ? void 0 : F2.length) === 1) {
|
|
1183
|
-
const e2 = F2[0];
|
|
1184
|
-
this.output.write(import_sisteransi.cursor.move(0, e2)), this.output.write(import_sisteransi.erase.lines(1));
|
|
1185
|
-
const s = u2.split(`
|
|
1186
|
-
`);
|
|
1187
|
-
this.output.write(s[e2]), this._prevFrame = u2, this.output.write(import_sisteransi.cursor.move(0, s.length - e2 - 1));
|
|
1188
|
-
return;
|
|
1189
|
-
}
|
|
1190
|
-
if (F2 && (F2 == null ? void 0 : F2.length) > 1) {
|
|
1191
|
-
const e2 = F2[0];
|
|
1192
|
-
this.output.write(import_sisteransi.cursor.move(0, e2)), this.output.write(import_sisteransi.erase.down());
|
|
1193
|
-
const s = u2.split(`
|
|
1194
|
-
`).slice(e2);
|
|
1195
|
-
this.output.write(s.join(`
|
|
1196
|
-
`)), this._prevFrame = u2;
|
|
1197
|
-
return;
|
|
1198
|
-
}
|
|
1199
|
-
this.output.write(import_sisteransi.erase.down());
|
|
1200
|
-
}
|
|
1201
|
-
this.output.write(u2), this.state === "initial" && (this.state = "active"), this._prevFrame = u2;
|
|
1202
|
-
}
|
|
1203
|
-
}
|
|
1204
|
-
};
|
|
1205
|
-
var fD = class extends x {
|
|
1206
|
-
get cursor() {
|
|
1207
|
-
return this.value ? 0 : 1;
|
|
1208
|
-
}
|
|
1209
|
-
get _value() {
|
|
1210
|
-
return this.cursor === 0;
|
|
1211
|
-
}
|
|
1212
|
-
constructor(u2) {
|
|
1213
|
-
super(u2, false), this.value = !!u2.initialValue, this.on("value", () => {
|
|
1214
|
-
this.value = this._value;
|
|
1215
|
-
}), this.on("confirm", (F2) => {
|
|
1216
|
-
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = F2, this.state = "submit", this.close();
|
|
1217
|
-
}), this.on("cursor", () => {
|
|
1218
|
-
this.value = !this.value;
|
|
1219
|
-
});
|
|
1220
|
-
}
|
|
1221
|
-
};
|
|
1222
|
-
var bD = Object.defineProperty;
|
|
1223
|
-
var mD = (t, u2, F2) => u2 in t ? bD(t, u2, { enumerable: true, configurable: true, writable: true, value: F2 }) : t[u2] = F2;
|
|
1224
|
-
var Y = (t, u2, F2) => (mD(t, typeof u2 != "symbol" ? u2 + "" : u2, F2), F2);
|
|
1225
|
-
var wD = class extends x {
|
|
1226
|
-
constructor(u2) {
|
|
1227
|
-
super(u2, false), Y(this, "options"), Y(this, "cursor", 0), this.options = u2.options, this.value = [...u2.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F2 }) => F2 === u2.cursorAt), 0), this.on("key", (F2) => {
|
|
1228
|
-
F2 === "a" && this.toggleAll();
|
|
1229
|
-
}), this.on("cursor", (F2) => {
|
|
1230
|
-
switch (F2) {
|
|
1231
|
-
case "left":
|
|
1232
|
-
case "up":
|
|
1233
|
-
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
1234
|
-
break;
|
|
1235
|
-
case "down":
|
|
1236
|
-
case "right":
|
|
1237
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
1238
|
-
break;
|
|
1239
|
-
case "space":
|
|
1240
|
-
this.toggleValue();
|
|
1241
|
-
break;
|
|
1242
|
-
}
|
|
1243
|
-
});
|
|
1244
|
-
}
|
|
1245
|
-
get _value() {
|
|
1246
|
-
return this.options[this.cursor].value;
|
|
1247
|
-
}
|
|
1248
|
-
toggleAll() {
|
|
1249
|
-
const u2 = this.value.length === this.options.length;
|
|
1250
|
-
this.value = u2 ? [] : this.options.map((F2) => F2.value);
|
|
1251
|
-
}
|
|
1252
|
-
toggleValue() {
|
|
1253
|
-
const u2 = this.value.includes(this._value);
|
|
1254
|
-
this.value = u2 ? this.value.filter((F2) => F2 !== this._value) : [...this.value, this._value];
|
|
1255
|
-
}
|
|
1256
|
-
};
|
|
1257
|
-
var SD = Object.defineProperty;
|
|
1258
|
-
var $D = (t, u2, F2) => u2 in t ? SD(t, u2, { enumerable: true, configurable: true, writable: true, value: F2 }) : t[u2] = F2;
|
|
1259
|
-
var q = (t, u2, F2) => ($D(t, typeof u2 != "symbol" ? u2 + "" : u2, F2), F2);
|
|
1260
|
-
var jD = class extends x {
|
|
1261
|
-
constructor(u2) {
|
|
1262
|
-
super(u2, false), q(this, "options"), q(this, "cursor", 0), this.options = u2.options, this.cursor = this.options.findIndex(({ value: F2 }) => F2 === u2.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F2) => {
|
|
1263
|
-
switch (F2) {
|
|
1264
|
-
case "left":
|
|
1265
|
-
case "up":
|
|
1266
|
-
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
1267
|
-
break;
|
|
1268
|
-
case "down":
|
|
1269
|
-
case "right":
|
|
1270
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
1271
|
-
break;
|
|
1272
|
-
}
|
|
1273
|
-
this.changeValue();
|
|
1274
|
-
});
|
|
1275
|
-
}
|
|
1276
|
-
get _value() {
|
|
1277
|
-
return this.options[this.cursor];
|
|
1278
|
-
}
|
|
1279
|
-
changeValue() {
|
|
1280
|
-
this.value = this._value.value;
|
|
1281
|
-
}
|
|
1282
|
-
};
|
|
1283
|
-
var PD = class extends x {
|
|
1284
|
-
get valueWithCursor() {
|
|
1285
|
-
if (this.state === "submit") return this.value;
|
|
1286
|
-
if (this.cursor >= this.value.length) return `${this.value}\u2588`;
|
|
1287
|
-
const u2 = this.value.slice(0, this.cursor), [F2, ...e2] = this.value.slice(this.cursor);
|
|
1288
|
-
return `${u2}${import_picocolors.default.inverse(F2)}${e2.join("")}`;
|
|
1289
|
-
}
|
|
1290
|
-
get cursor() {
|
|
1291
|
-
return this._cursor;
|
|
1292
|
-
}
|
|
1293
|
-
constructor(u2) {
|
|
1294
|
-
super(u2), this.on("finalize", () => {
|
|
1295
|
-
this.value || (this.value = u2.defaultValue);
|
|
1296
|
-
});
|
|
1297
|
-
}
|
|
1298
|
-
};
|
|
1299
|
-
|
|
1300
|
-
// node_modules/.pnpm/@clack+prompts@0.10.0/node_modules/@clack/prompts/dist/index.mjs
|
|
1301
|
-
var import_node_process2 = __toESM(require("process"), 1);
|
|
1302
|
-
var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
1303
|
-
var import_sisteransi2 = __toESM(require_src(), 1);
|
|
1304
|
-
function ce() {
|
|
1305
|
-
return import_node_process2.default.platform !== "win32" ? import_node_process2.default.env.TERM !== "linux" : !!import_node_process2.default.env.CI || !!import_node_process2.default.env.WT_SESSION || !!import_node_process2.default.env.TERMINUS_SUBLIME || import_node_process2.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process2.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process2.default.env.TERM_PROGRAM === "vscode" || import_node_process2.default.env.TERM === "xterm-256color" || import_node_process2.default.env.TERM === "alacritty" || import_node_process2.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
1306
|
-
}
|
|
1307
|
-
var V2 = ce();
|
|
1308
|
-
var u = (t, n) => V2 ? t : n;
|
|
1309
|
-
var le = u("\u25C6", "*");
|
|
1310
|
-
var L2 = u("\u25A0", "x");
|
|
1311
|
-
var W2 = u("\u25B2", "x");
|
|
1312
|
-
var C = u("\u25C7", "o");
|
|
1313
|
-
var ue = u("\u250C", "T");
|
|
1314
|
-
var o = u("\u2502", "|");
|
|
1315
|
-
var d2 = u("\u2514", "\u2014");
|
|
1316
|
-
var k2 = u("\u25CF", ">");
|
|
1317
|
-
var P2 = u("\u25CB", " ");
|
|
1318
|
-
var A2 = u("\u25FB", "[\u2022]");
|
|
1319
|
-
var T2 = u("\u25FC", "[+]");
|
|
1320
|
-
var F = u("\u25FB", "[ ]");
|
|
1321
|
-
var $e = u("\u25AA", "\u2022");
|
|
1322
|
-
var _2 = u("\u2500", "-");
|
|
1323
|
-
var me = u("\u256E", "+");
|
|
1324
|
-
var de = u("\u251C", "+");
|
|
1325
|
-
var pe = u("\u256F", "+");
|
|
1326
|
-
var q2 = u("\u25CF", "\u2022");
|
|
1327
|
-
var D = u("\u25C6", "*");
|
|
1328
|
-
var U2 = u("\u25B2", "!");
|
|
1329
|
-
var K = u("\u25A0", "x");
|
|
1330
|
-
var w2 = (t) => {
|
|
1331
|
-
switch (t) {
|
|
1332
|
-
case "initial":
|
|
1333
|
-
case "active":
|
|
1334
|
-
return import_picocolors2.default.cyan(le);
|
|
1335
|
-
case "cancel":
|
|
1336
|
-
return import_picocolors2.default.red(L2);
|
|
1337
|
-
case "error":
|
|
1338
|
-
return import_picocolors2.default.yellow(W2);
|
|
1339
|
-
case "submit":
|
|
1340
|
-
return import_picocolors2.default.green(C);
|
|
1341
|
-
}
|
|
1342
|
-
};
|
|
1343
|
-
var B = (t) => {
|
|
1344
|
-
const { cursor: n, options: s, style: r2 } = t, i = t.maxItems ?? Number.POSITIVE_INFINITY, a = Math.max(process.stdout.rows - 4, 0), c2 = Math.min(a, Math.max(i, 5));
|
|
1345
|
-
let l2 = 0;
|
|
1346
|
-
n >= l2 + c2 - 3 ? l2 = Math.max(Math.min(n - c2 + 3, s.length - c2), 0) : n < l2 + 2 && (l2 = Math.max(n - 2, 0));
|
|
1347
|
-
const $2 = c2 < s.length && l2 > 0, p = c2 < s.length && l2 + c2 < s.length;
|
|
1348
|
-
return s.slice(l2, l2 + c2).map((M2, v2, x2) => {
|
|
1349
|
-
const j2 = v2 === 0 && $2, E = v2 === x2.length - 1 && p;
|
|
1350
|
-
return j2 || E ? import_picocolors2.default.dim("...") : r2(M2, v2 + l2 === n);
|
|
1351
|
-
});
|
|
1352
|
-
};
|
|
1353
|
-
var he = (t) => new PD({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, render() {
|
|
1354
|
-
var _a;
|
|
1355
|
-
const n = `${import_picocolors2.default.gray(o)}
|
|
1356
|
-
${w2(this.state)} ${t.message}
|
|
1357
|
-
`, s = t.placeholder ? import_picocolors2.default.inverse(t.placeholder[0]) + import_picocolors2.default.dim(t.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), r2 = this.value ? this.valueWithCursor : s;
|
|
1358
|
-
switch (this.state) {
|
|
1359
|
-
case "error":
|
|
1360
|
-
return `${n.trim()}
|
|
1361
|
-
${import_picocolors2.default.yellow(o)} ${r2}
|
|
1362
|
-
${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
|
|
1363
|
-
`;
|
|
1364
|
-
case "submit":
|
|
1365
|
-
return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(this.value || t.placeholder)}`;
|
|
1366
|
-
case "cancel":
|
|
1367
|
-
return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${((_a = this.value) == null ? void 0 : _a.trim()) ? `
|
|
1368
|
-
${import_picocolors2.default.gray(o)}` : ""}`;
|
|
1369
|
-
default:
|
|
1370
|
-
return `${n}${import_picocolors2.default.cyan(o)} ${r2}
|
|
1371
|
-
${import_picocolors2.default.cyan(d2)}
|
|
1372
|
-
`;
|
|
1373
|
-
}
|
|
1374
|
-
} }).prompt();
|
|
1375
|
-
var ye = (t) => {
|
|
1376
|
-
const n = t.active ?? "Yes", s = t.inactive ?? "No";
|
|
1377
|
-
return new fD({ active: n, inactive: s, initialValue: t.initialValue ?? true, render() {
|
|
1378
|
-
const r2 = `${import_picocolors2.default.gray(o)}
|
|
1379
|
-
${w2(this.state)} ${t.message}
|
|
1380
|
-
`, i = this.value ? n : s;
|
|
1381
|
-
switch (this.state) {
|
|
1382
|
-
case "submit":
|
|
1383
|
-
return `${r2}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(i)}`;
|
|
1384
|
-
case "cancel":
|
|
1385
|
-
return `${r2}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i))}
|
|
1386
|
-
${import_picocolors2.default.gray(o)}`;
|
|
1387
|
-
default:
|
|
1388
|
-
return `${r2}${import_picocolors2.default.cyan(o)} ${this.value ? `${import_picocolors2.default.green(k2)} ${n}` : `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(n)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(s)}` : `${import_picocolors2.default.green(k2)} ${s}`}
|
|
1389
|
-
${import_picocolors2.default.cyan(d2)}
|
|
1390
|
-
`;
|
|
1391
|
-
}
|
|
1392
|
-
} }).prompt();
|
|
1393
|
-
};
|
|
1394
|
-
var ve = (t) => {
|
|
1395
|
-
const n = (s, r2) => {
|
|
1396
|
-
const i = s.label ?? String(s.value);
|
|
1397
|
-
switch (r2) {
|
|
1398
|
-
case "selected":
|
|
1399
|
-
return `${import_picocolors2.default.dim(i)}`;
|
|
1400
|
-
case "active":
|
|
1401
|
-
return `${import_picocolors2.default.green(k2)} ${i} ${s.hint ? import_picocolors2.default.dim(`(${s.hint})`) : ""}`;
|
|
1402
|
-
case "cancelled":
|
|
1403
|
-
return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i))}`;
|
|
1404
|
-
default:
|
|
1405
|
-
return `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(i)}`;
|
|
1406
|
-
}
|
|
1407
|
-
};
|
|
1408
|
-
return new jD({ options: t.options, initialValue: t.initialValue, render() {
|
|
1409
|
-
const s = `${import_picocolors2.default.gray(o)}
|
|
1410
|
-
${w2(this.state)} ${t.message}
|
|
1411
|
-
`;
|
|
1412
|
-
switch (this.state) {
|
|
1413
|
-
case "submit":
|
|
1414
|
-
return `${s}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
|
|
1415
|
-
case "cancel":
|
|
1416
|
-
return `${s}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
|
|
1417
|
-
${import_picocolors2.default.gray(o)}`;
|
|
1418
|
-
default:
|
|
1419
|
-
return `${s}${import_picocolors2.default.cyan(o)} ${B({ cursor: this.cursor, options: this.options, maxItems: t.maxItems, style: (r2, i) => n(r2, i ? "active" : "inactive") }).join(`
|
|
1420
|
-
${import_picocolors2.default.cyan(o)} `)}
|
|
1421
|
-
${import_picocolors2.default.cyan(d2)}
|
|
1422
|
-
`;
|
|
1423
|
-
}
|
|
1424
|
-
} }).prompt();
|
|
1425
|
-
};
|
|
1426
|
-
var fe = (t) => {
|
|
1427
|
-
const n = (s, r2) => {
|
|
1428
|
-
const i = s.label ?? String(s.value);
|
|
1429
|
-
return r2 === "active" ? `${import_picocolors2.default.cyan(A2)} ${i} ${s.hint ? import_picocolors2.default.dim(`(${s.hint})`) : ""}` : r2 === "selected" ? `${import_picocolors2.default.green(T2)} ${import_picocolors2.default.dim(i)}` : r2 === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i))}` : r2 === "active-selected" ? `${import_picocolors2.default.green(T2)} ${i} ${s.hint ? import_picocolors2.default.dim(`(${s.hint})`) : ""}` : r2 === "submitted" ? `${import_picocolors2.default.dim(i)}` : `${import_picocolors2.default.dim(F)} ${import_picocolors2.default.dim(i)}`;
|
|
1430
|
-
};
|
|
1431
|
-
return new wD({ options: t.options, initialValues: t.initialValues, required: t.required ?? true, cursorAt: t.cursorAt, validate(s) {
|
|
1432
|
-
if (this.required && s.length === 0) return `Please select at least one option.
|
|
1433
|
-
${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
|
|
1434
|
-
}, render() {
|
|
1435
|
-
const s = `${import_picocolors2.default.gray(o)}
|
|
1436
|
-
${w2(this.state)} ${t.message}
|
|
1437
|
-
`, r2 = (i, a) => {
|
|
1438
|
-
const c2 = this.value.includes(i.value);
|
|
1439
|
-
return a && c2 ? n(i, "active-selected") : c2 ? n(i, "selected") : n(i, a ? "active" : "inactive");
|
|
1440
|
-
};
|
|
1441
|
-
switch (this.state) {
|
|
1442
|
-
case "submit":
|
|
1443
|
-
return `${s}${import_picocolors2.default.gray(o)} ${this.options.filter(({ value: i }) => this.value.includes(i)).map((i) => n(i, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none")}`;
|
|
1444
|
-
case "cancel": {
|
|
1445
|
-
const i = this.options.filter(({ value: a }) => this.value.includes(a)).map((a) => n(a, "cancelled")).join(import_picocolors2.default.dim(", "));
|
|
1446
|
-
return `${s}${import_picocolors2.default.gray(o)} ${i.trim() ? `${i}
|
|
1447
|
-
${import_picocolors2.default.gray(o)}` : ""}`;
|
|
1448
|
-
}
|
|
1449
|
-
case "error": {
|
|
1450
|
-
const i = this.error.split(`
|
|
1451
|
-
`).map((a, c2) => c2 === 0 ? `${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(a)}` : ` ${a}`).join(`
|
|
1452
|
-
`);
|
|
1453
|
-
return `${s + import_picocolors2.default.yellow(o)} ${B({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: r2 }).join(`
|
|
1454
|
-
${import_picocolors2.default.yellow(o)} `)}
|
|
1455
|
-
${i}
|
|
1456
|
-
`;
|
|
1457
|
-
}
|
|
1458
|
-
default:
|
|
1459
|
-
return `${s}${import_picocolors2.default.cyan(o)} ${B({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: r2 }).join(`
|
|
1460
|
-
${import_picocolors2.default.cyan(o)} `)}
|
|
1461
|
-
${import_picocolors2.default.cyan(d2)}
|
|
1462
|
-
`;
|
|
1463
|
-
}
|
|
1464
|
-
} }).prompt();
|
|
1465
|
-
};
|
|
1466
|
-
var xe = (t = "") => {
|
|
1467
|
-
process.stdout.write(`${import_picocolors2.default.gray(d2)} ${import_picocolors2.default.red(t)}
|
|
1468
|
-
|
|
1469
|
-
`);
|
|
1470
|
-
};
|
|
1471
|
-
var Ie = (t = "") => {
|
|
1472
|
-
process.stdout.write(`${import_picocolors2.default.gray(ue)} ${t}
|
|
1473
|
-
`);
|
|
1474
|
-
};
|
|
1475
|
-
var Se = (t = "") => {
|
|
1476
|
-
process.stdout.write(`${import_picocolors2.default.gray(o)}
|
|
1477
|
-
${import_picocolors2.default.gray(d2)} ${t}
|
|
1478
|
-
|
|
1479
|
-
`);
|
|
1480
|
-
};
|
|
1481
|
-
var J2 = `${import_picocolors2.default.gray(o)} `;
|
|
1482
|
-
|
|
1483
|
-
// index.ts
|
|
1484
|
-
var import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
1485
|
-
var import_ejs2 = __toESM(require_ejs(), 1);
|
|
1486
|
-
|
|
1487
|
-
// utils/banners.ts
|
|
1488
|
-
var defaultBanner = "Vue.js - The Progressive JavaScript Framework";
|
|
1489
|
-
var gradientBanner = "\x1B[38;2;66;211;146mV\x1B[39m\x1B[38;2;66;211;146mu\x1B[39m\x1B[38;2;66;211;146me\x1B[39m\x1B[38;2;66;211;146m.\x1B[39m\x1B[38;2;66;211;146mj\x1B[39m\x1B[38;2;67;209;149ms\x1B[39m \x1B[38;2;68;206;152m-\x1B[39m \x1B[38;2;69;204;155mT\x1B[39m\x1B[38;2;70;201;158mh\x1B[39m\x1B[38;2;71;199;162me\x1B[39m \x1B[38;2;72;196;165mP\x1B[39m\x1B[38;2;73;194;168mr\x1B[39m\x1B[38;2;74;192;171mo\x1B[39m\x1B[38;2;75;189;174mg\x1B[39m\x1B[38;2;76;187;177mr\x1B[39m\x1B[38;2;77;184;180me\x1B[39m\x1B[38;2;78;182;183ms\x1B[39m\x1B[38;2;79;179;186ms\x1B[39m\x1B[38;2;80;177;190mi\x1B[39m\x1B[38;2;81;175;193mv\x1B[39m\x1B[38;2;82;172;196me\x1B[39m \x1B[38;2;83;170;199mJ\x1B[39m\x1B[38;2;83;167;202ma\x1B[39m\x1B[38;2;84;165;205mv\x1B[39m\x1B[38;2;85;162;208ma\x1B[39m\x1B[38;2;86;160;211mS\x1B[39m\x1B[38;2;87;158;215mc\x1B[39m\x1B[38;2;88;155;218mr\x1B[39m\x1B[38;2;89;153;221mi\x1B[39m\x1B[38;2;90;150;224mp\x1B[39m\x1B[38;2;91;148;227mt\x1B[39m \x1B[38;2;92;145;230mF\x1B[39m\x1B[38;2;93;143;233mr\x1B[39m\x1B[38;2;94;141;236ma\x1B[39m\x1B[38;2;95;138;239mm\x1B[39m\x1B[38;2;96;136;243me\x1B[39m\x1B[38;2;97;133;246mw\x1B[39m\x1B[38;2;98;131;249mo\x1B[39m\x1B[38;2;99;128;252mr\x1B[39m\x1B[38;2;100;126;255mk\x1B[39m";
|
|
1490
|
-
|
|
1491
|
-
// utils/renderTemplate.ts
|
|
1492
|
-
var fs = __toESM(require("fs"), 1);
|
|
1493
|
-
var path = __toESM(require("path"), 1);
|
|
1494
|
-
var import_node_url = require("url");
|
|
1495
|
-
|
|
1496
|
-
// utils/deepMerge.ts
|
|
1497
|
-
var isObject = (val) => val && typeof val === "object";
|
|
1498
|
-
var mergeArrayWithDedupe = (a, b2) => Array.from(/* @__PURE__ */ new Set([...a, ...b2]));
|
|
1499
|
-
function deepMerge(target, obj) {
|
|
1500
|
-
for (const key of Object.keys(obj)) {
|
|
1501
|
-
const oldVal = target[key];
|
|
1502
|
-
const newVal = obj[key];
|
|
1503
|
-
if (Array.isArray(oldVal) && Array.isArray(newVal)) {
|
|
1504
|
-
target[key] = mergeArrayWithDedupe(oldVal, newVal);
|
|
1505
|
-
} else if (isObject(oldVal) && isObject(newVal)) {
|
|
1506
|
-
target[key] = deepMerge(oldVal, newVal);
|
|
1507
|
-
} else {
|
|
1508
|
-
target[key] = newVal;
|
|
1509
|
-
}
|
|
1510
|
-
}
|
|
1511
|
-
return target;
|
|
1512
|
-
}
|
|
1513
|
-
var deepMerge_default = deepMerge;
|
|
1514
|
-
|
|
1515
|
-
// utils/sortDependencies.ts
|
|
1516
|
-
function sortDependencies(packageJson) {
|
|
1517
|
-
const sorted = {};
|
|
1518
|
-
const depTypes = ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"];
|
|
1519
|
-
for (const depType of depTypes) {
|
|
1520
|
-
if (packageJson[depType]) {
|
|
1521
|
-
sorted[depType] = {};
|
|
1522
|
-
Object.keys(packageJson[depType]).sort().forEach((name) => {
|
|
1523
|
-
sorted[depType][name] = packageJson[depType][name];
|
|
1524
|
-
});
|
|
1525
|
-
}
|
|
1526
|
-
}
|
|
1527
|
-
return {
|
|
1528
|
-
...packageJson,
|
|
1529
|
-
...sorted
|
|
1530
|
-
};
|
|
1531
|
-
}
|
|
1532
|
-
|
|
1533
|
-
// utils/renderTemplate.ts
|
|
1534
|
-
function renderTemplate(src, dest, callbacks) {
|
|
1535
|
-
const stats = fs.statSync(src);
|
|
1536
|
-
if (stats.isDirectory()) {
|
|
1537
|
-
if (path.basename(src) === "node_modules") {
|
|
1538
|
-
return;
|
|
1539
|
-
}
|
|
1540
|
-
fs.mkdirSync(dest, { recursive: true });
|
|
1541
|
-
for (const file of fs.readdirSync(src)) {
|
|
1542
|
-
renderTemplate(path.resolve(src, file), path.resolve(dest, file), callbacks);
|
|
1543
|
-
}
|
|
1544
|
-
return;
|
|
1545
|
-
}
|
|
1546
|
-
const filename = path.basename(src);
|
|
1547
|
-
if (filename === "package.json" && fs.existsSync(dest)) {
|
|
1548
|
-
const existing = JSON.parse(fs.readFileSync(dest, "utf8"));
|
|
1549
|
-
const newPackage = JSON.parse(fs.readFileSync(src, "utf8"));
|
|
1550
|
-
const pkg = sortDependencies(deepMerge_default(existing, newPackage));
|
|
1551
|
-
fs.writeFileSync(dest, JSON.stringify(pkg, null, 2) + "\n");
|
|
1552
|
-
return;
|
|
1553
|
-
}
|
|
1554
|
-
if (filename === "extensions.json" && fs.existsSync(dest)) {
|
|
1555
|
-
const existing = JSON.parse(fs.readFileSync(dest, "utf8"));
|
|
1556
|
-
const newExtensions = JSON.parse(fs.readFileSync(src, "utf8"));
|
|
1557
|
-
const extensions = deepMerge_default(existing, newExtensions);
|
|
1558
|
-
fs.writeFileSync(dest, JSON.stringify(extensions, null, 2) + "\n");
|
|
1559
|
-
return;
|
|
1560
|
-
}
|
|
1561
|
-
if (filename === "settings.json" && fs.existsSync(dest)) {
|
|
1562
|
-
const existing = JSON.parse(fs.readFileSync(dest, "utf8"));
|
|
1563
|
-
const newSettings = JSON.parse(fs.readFileSync(src, "utf8"));
|
|
1564
|
-
const settings = deepMerge_default(existing, newSettings);
|
|
1565
|
-
fs.writeFileSync(dest, JSON.stringify(settings, null, 2) + "\n");
|
|
1566
|
-
return;
|
|
1567
|
-
}
|
|
1568
|
-
if (filename.startsWith("_")) {
|
|
1569
|
-
dest = path.resolve(path.dirname(dest), filename.replace(/^_/, "."));
|
|
1570
|
-
}
|
|
1571
|
-
if (filename === "_gitignore" && fs.existsSync(dest)) {
|
|
1572
|
-
const existing = fs.readFileSync(dest, "utf8");
|
|
1573
|
-
const newGitignore = fs.readFileSync(src, "utf8");
|
|
1574
|
-
fs.writeFileSync(dest, existing + "\n" + newGitignore);
|
|
1575
|
-
return;
|
|
1576
|
-
}
|
|
1577
|
-
if (filename.endsWith(".data.mjs")) {
|
|
1578
|
-
dest = dest.replace(/\.data\.mjs$/, "");
|
|
1579
|
-
callbacks.push(async (dataStore) => {
|
|
1580
|
-
const getData = (await import((0, import_node_url.pathToFileURL)(src).toString())).default;
|
|
1581
|
-
dataStore[dest] = await getData({
|
|
1582
|
-
oldData: dataStore[dest] || {}
|
|
1583
|
-
});
|
|
1584
|
-
});
|
|
1585
|
-
return;
|
|
1586
|
-
}
|
|
1587
|
-
fs.copyFileSync(src, dest);
|
|
1588
|
-
}
|
|
1589
|
-
var renderTemplate_default = renderTemplate;
|
|
1590
|
-
|
|
1591
|
-
// utils/directoryTraverse.ts
|
|
1592
|
-
var fs2 = __toESM(require("fs"), 1);
|
|
1593
|
-
var path2 = __toESM(require("path"), 1);
|
|
1594
|
-
function preOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
|
|
1595
|
-
for (const filename of fs2.readdirSync(dir)) {
|
|
1596
|
-
if (filename === ".git") {
|
|
1597
|
-
continue;
|
|
1598
|
-
}
|
|
1599
|
-
const fullpath = path2.resolve(dir, filename);
|
|
1600
|
-
if (fs2.lstatSync(fullpath).isDirectory()) {
|
|
1601
|
-
dirCallback(fullpath);
|
|
1602
|
-
if (fs2.existsSync(fullpath)) {
|
|
1603
|
-
preOrderDirectoryTraverse(fullpath, dirCallback, fileCallback);
|
|
1604
|
-
}
|
|
1605
|
-
continue;
|
|
1606
|
-
}
|
|
1607
|
-
fileCallback(fullpath);
|
|
1608
|
-
}
|
|
1609
|
-
}
|
|
1610
|
-
function postOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
|
|
1611
|
-
for (const filename of fs2.readdirSync(dir)) {
|
|
1612
|
-
if (filename === ".git") {
|
|
1613
|
-
continue;
|
|
1614
|
-
}
|
|
1615
|
-
const fullpath = path2.resolve(dir, filename);
|
|
1616
|
-
if (fs2.lstatSync(fullpath).isDirectory()) {
|
|
1617
|
-
postOrderDirectoryTraverse(fullpath, dirCallback, fileCallback);
|
|
1618
|
-
dirCallback(fullpath);
|
|
1619
|
-
continue;
|
|
1620
|
-
}
|
|
1621
|
-
fileCallback(fullpath);
|
|
1622
|
-
}
|
|
1623
|
-
}
|
|
1624
|
-
|
|
1625
|
-
// utils/getCommand.ts
|
|
1626
|
-
function getCommand(packageManager, scriptName, args) {
|
|
1627
|
-
if (scriptName === "install") {
|
|
1628
|
-
return packageManager === "yarn" ? "yarn" : `${packageManager} install`;
|
|
1629
|
-
}
|
|
1630
|
-
if (scriptName === "build") {
|
|
1631
|
-
return packageManager === "npm" || packageManager === "bun" ? `${packageManager} run build` : `${packageManager} build`;
|
|
1632
|
-
}
|
|
1633
|
-
if (args) {
|
|
1634
|
-
return packageManager === "npm" ? `npm run ${scriptName} -- ${args}` : `${packageManager} ${scriptName} ${args}`;
|
|
1635
|
-
} else {
|
|
1636
|
-
return packageManager === "npm" ? `npm run ${scriptName}` : `${packageManager} ${scriptName}`;
|
|
1637
|
-
}
|
|
1638
|
-
}
|
|
1639
|
-
|
|
1640
|
-
// utils/generateReadme.ts
|
|
1641
|
-
var sfcTypeSupportDoc = [
|
|
1642
|
-
"",
|
|
1643
|
-
"## Type Support for `.vue` Imports in TS",
|
|
1644
|
-
"",
|
|
1645
|
-
"TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.",
|
|
1646
|
-
""
|
|
1647
|
-
].join("\n");
|
|
1648
|
-
function generateReadme({
|
|
1649
|
-
projectName,
|
|
1650
|
-
packageManager,
|
|
1651
|
-
needsTypeScript,
|
|
1652
|
-
needsCypress,
|
|
1653
|
-
needsNightwatch,
|
|
1654
|
-
needsCypressCT,
|
|
1655
|
-
needsNightwatchCT,
|
|
1656
|
-
needsPlaywright,
|
|
1657
|
-
needsVitest,
|
|
1658
|
-
needsEslint
|
|
1659
|
-
}) {
|
|
1660
|
-
const commandFor = (scriptName, args) => getCommand(packageManager, scriptName, args);
|
|
1661
|
-
let readme = `# ${projectName}
|
|
1662
|
-
|
|
1663
|
-
This template should help get you started developing with Vue 3 in Vite.
|
|
1664
|
-
|
|
1665
|
-
## Recommended IDE Setup
|
|
1666
|
-
|
|
1667
|
-
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
|
|
1668
|
-
${needsTypeScript ? sfcTypeSupportDoc : ""}
|
|
1669
|
-
## Customize configuration
|
|
1670
|
-
|
|
1671
|
-
See [Vite Configuration Reference](https://vite.dev/config/).
|
|
1672
|
-
|
|
1673
|
-
## Project Setup
|
|
1674
|
-
|
|
1675
|
-
`;
|
|
1676
|
-
let installCommand = commandFor("install");
|
|
1677
|
-
if (packageManager === "pnpm" && needsNightwatch) {
|
|
1678
|
-
installCommand += `
|
|
1679
|
-
pnpm approve-builds # for pnpm 10+`;
|
|
1680
|
-
}
|
|
1681
|
-
let npmScriptsDescriptions = `\`\`\`sh
|
|
1682
|
-
${installCommand}
|
|
1683
|
-
\`\`\`
|
|
1684
|
-
|
|
1685
|
-
### Compile and Hot-Reload for Development
|
|
1686
|
-
|
|
1687
|
-
\`\`\`sh
|
|
1688
|
-
${commandFor("dev")}
|
|
1689
|
-
\`\`\`
|
|
1690
|
-
|
|
1691
|
-
### ${needsTypeScript ? "Type-Check, " : ""}Compile and Minify for Production
|
|
1692
|
-
|
|
1693
|
-
\`\`\`sh
|
|
1694
|
-
${commandFor("build")}
|
|
1695
|
-
\`\`\`
|
|
1696
|
-
`;
|
|
1697
|
-
if (needsVitest) {
|
|
1698
|
-
npmScriptsDescriptions += `
|
|
1699
|
-
### Run Unit Tests with [Vitest](https://vitest.dev/)
|
|
1700
|
-
|
|
1701
|
-
\`\`\`sh
|
|
1702
|
-
${commandFor("test:unit")}
|
|
1703
|
-
\`\`\`
|
|
1704
|
-
`;
|
|
1705
|
-
}
|
|
1706
|
-
if (needsCypressCT) {
|
|
1707
|
-
npmScriptsDescriptions += `
|
|
1708
|
-
### Run Headed Component Tests with [Cypress Component Testing](https://on.cypress.io/component)
|
|
1709
|
-
|
|
1710
|
-
\`\`\`sh
|
|
1711
|
-
${commandFor("test:unit:dev")} # or \`${commandFor("test:unit")}\` for headless testing
|
|
1712
|
-
\`\`\`
|
|
1713
|
-
`;
|
|
1714
|
-
}
|
|
1715
|
-
if (needsCypress) {
|
|
1716
|
-
npmScriptsDescriptions += `
|
|
1717
|
-
### Run End-to-End Tests with [Cypress](https://www.cypress.io/)
|
|
1718
|
-
|
|
1719
|
-
\`\`\`sh
|
|
1720
|
-
${commandFor("test:e2e:dev")}
|
|
1721
|
-
\`\`\`
|
|
1722
|
-
|
|
1723
|
-
This runs the end-to-end tests against the Vite development server.
|
|
1724
|
-
It is much faster than the production build.
|
|
1725
|
-
|
|
1726
|
-
But it's still recommended to test the production build with \`test:e2e\` before deploying (e.g. in CI environments):
|
|
1727
|
-
|
|
1728
|
-
\`\`\`sh
|
|
1729
|
-
${commandFor("build")}
|
|
1730
|
-
${commandFor("test:e2e")}
|
|
1731
|
-
\`\`\`
|
|
1732
|
-
`;
|
|
1733
|
-
}
|
|
1734
|
-
if (needsNightwatch) {
|
|
1735
|
-
npmScriptsDescriptions += `
|
|
1736
|
-
### Run End-to-End Tests with [Nightwatch](https://nightwatchjs.org/)
|
|
1737
|
-
|
|
1738
|
-
\`\`\`sh
|
|
1739
|
-
# When using CI, the project must be built first.
|
|
1740
|
-
${commandFor("build")}
|
|
1741
|
-
|
|
1742
|
-
# Runs the end-to-end tests
|
|
1743
|
-
${commandFor("test:e2e")}
|
|
1744
|
-
# Runs the tests only on Chrome
|
|
1745
|
-
${commandFor("test:e2e", "--env chrome")}
|
|
1746
|
-
# Runs the tests of a specific file
|
|
1747
|
-
${commandFor("test:e2e", `tests/e2e/example.${needsTypeScript ? "ts" : "js"}`)}
|
|
1748
|
-
# Runs the tests in debug mode
|
|
1749
|
-
${commandFor("test:e2e", "--debug")}
|
|
1750
|
-
\`\`\`
|
|
1751
|
-
`;
|
|
1752
|
-
}
|
|
1753
|
-
if (needsNightwatchCT) {
|
|
1754
|
-
npmScriptsDescriptions += `
|
|
1755
|
-
### Run Headed Component Tests with [Nightwatch Component Testing](https://nightwatchjs.org/guide/component-testing/introduction.html)
|
|
1756
|
-
|
|
1757
|
-
\`\`\`sh
|
|
1758
|
-
${commandFor("test:unit")}
|
|
1759
|
-
${commandFor("test:unit -- --headless # for headless testing")}
|
|
1760
|
-
\`\`\`
|
|
1761
|
-
`;
|
|
1762
|
-
}
|
|
1763
|
-
if (needsPlaywright) {
|
|
1764
|
-
npmScriptsDescriptions += `
|
|
1765
|
-
### Run End-to-End Tests with [Playwright](https://playwright.dev)
|
|
1766
|
-
|
|
1767
|
-
\`\`\`sh
|
|
1768
|
-
# Install browsers for the first run
|
|
1769
|
-
npx playwright install
|
|
1770
|
-
|
|
1771
|
-
# When testing on CI, must build the project first
|
|
1772
|
-
${commandFor("build")}
|
|
1773
|
-
|
|
1774
|
-
# Runs the end-to-end tests
|
|
1775
|
-
${commandFor("test:e2e")}
|
|
1776
|
-
# Runs the tests only on Chromium
|
|
1777
|
-
${commandFor("test:e2e", "--project=chromium")}
|
|
1778
|
-
# Runs the tests of a specific file
|
|
1779
|
-
${commandFor("test:e2e", "tests/example.spec.ts")}
|
|
1780
|
-
# Runs the tests in debug mode
|
|
1781
|
-
${commandFor("test:e2e", "--debug")}
|
|
1782
|
-
\`\`\`
|
|
1783
|
-
`;
|
|
1784
|
-
}
|
|
1785
|
-
if (needsEslint) {
|
|
1786
|
-
npmScriptsDescriptions += `
|
|
1787
|
-
### Lint with [ESLint](https://eslint.org/)
|
|
1788
|
-
|
|
1789
|
-
\`\`\`sh
|
|
1790
|
-
${commandFor("lint")}
|
|
1791
|
-
\`\`\`
|
|
1792
|
-
`;
|
|
1793
|
-
}
|
|
1794
|
-
readme += npmScriptsDescriptions;
|
|
1795
|
-
return readme;
|
|
1796
|
-
}
|
|
1797
|
-
|
|
1798
|
-
// utils/getLanguage.ts
|
|
1799
|
-
var fs3 = __toESM(require("fs"), 1);
|
|
1800
|
-
var path3 = __toESM(require("path"), 1);
|
|
1801
|
-
function linkLocale(locale) {
|
|
1802
|
-
if (locale === "C") {
|
|
1803
|
-
return "en-US";
|
|
1804
|
-
}
|
|
1805
|
-
let linkedLocale;
|
|
1806
|
-
try {
|
|
1807
|
-
linkedLocale = Intl.getCanonicalLocales(locale)[0];
|
|
1808
|
-
} catch (error) {
|
|
1809
|
-
console.log(`${error.toString()}, invalid language tag: "${locale}"
|
|
1810
|
-
`);
|
|
1811
|
-
}
|
|
1812
|
-
switch (linkedLocale) {
|
|
1813
|
-
case "zh-TW":
|
|
1814
|
-
case "zh-HK":
|
|
1815
|
-
case "zh-MO":
|
|
1816
|
-
linkedLocale = "zh-Hant";
|
|
1817
|
-
break;
|
|
1818
|
-
case "zh-CN":
|
|
1819
|
-
case "zh-SG":
|
|
1820
|
-
linkedLocale = "zh-Hans";
|
|
1821
|
-
break;
|
|
1822
|
-
default:
|
|
1823
|
-
linkedLocale = locale;
|
|
1824
|
-
}
|
|
1825
|
-
return linkedLocale;
|
|
1826
|
-
}
|
|
1827
|
-
function getLocale() {
|
|
1828
|
-
const shellLocale = process.env.LC_ALL || // POSIX locale environment variables
|
|
1829
|
-
process.env.LC_MESSAGES || process.env.LANG || Intl.DateTimeFormat().resolvedOptions().locale || // Built-in ECMA-402 support
|
|
1830
|
-
"en-US";
|
|
1831
|
-
return linkLocale(shellLocale.split(".")[0].replace("_", "-"));
|
|
1832
|
-
}
|
|
1833
|
-
function getLanguage() {
|
|
1834
|
-
const locale = getLocale();
|
|
1835
|
-
const localesRoot = path3.resolve(__dirname, "locales");
|
|
1836
|
-
const languageFilePath = path3.resolve(localesRoot, `${locale}.json`);
|
|
1837
|
-
const doesLanguageExist = fs3.existsSync(languageFilePath);
|
|
1838
|
-
const lang = doesLanguageExist ? require(languageFilePath) : require(path3.resolve(localesRoot, "en-US.json"));
|
|
1839
|
-
return lang;
|
|
1840
|
-
}
|
|
1841
|
-
|
|
1842
|
-
// utils/renderEslint.ts
|
|
1843
|
-
var fs4 = __toESM(require("fs"), 1);
|
|
1844
|
-
var path4 = __toESM(require("path"), 1);
|
|
1845
|
-
|
|
1846
|
-
// node_modules/.pnpm/@vue+create-eslint-config@0.9.1/node_modules/@vue/create-eslint-config/renderEjsFile.js
|
|
1847
|
-
var import_ejs = __toESM(require_ejs(), 1);
|
|
1848
|
-
var templates = { "./templates/_editorconfig.ejs": "[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue,css,scss,sass,less,styl}]\ncharset = utf-8\nindent_size = 2\nindent_style = space\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n<%_ if (styleGuide !== 'standard' || needsPrettier) { _%>\n<%#\n// standard doesn't have an opinion on line endings\n// https://github.com/standard/standard/issues/140\n// or maximum line length\n// https://github.com/standard/standard/issues/1559\n// Prettier enforces these things, though.\n%>\nend_of_line = lf\nmax_line_length = 100\n<%_ } _%>\n", "./templates/_gitattributes": "* text=auto eol=lf\n", "./templates/_prettierrc.json.ejs": `<%_ if (styleGuide === 'airbnb') { _%>
|
|
1849
|
-
{
|
|
1850
|
-
"$schema": "https://json.schemastore.org/prettierrc",
|
|
1851
|
-
"printWidth": 100,
|
|
1852
|
-
"singleQuote": true
|
|
1853
|
-
}
|
|
1854
|
-
<%_ } else if (styleGuide === 'standard') { _%>
|
|
1855
|
-
{
|
|
1856
|
-
"$schema": "https://json.schemastore.org/prettierrc",
|
|
1857
|
-
"semi": false,
|
|
1858
|
-
"singleQuote": true,
|
|
1859
|
-
"jsxSingleQuote": true,
|
|
1860
|
-
"trailingComma": "none"
|
|
1861
|
-
}
|
|
1862
|
-
<%_ } else { _%>
|
|
1863
|
-
<%#
|
|
1864
|
-
The default style follows the one used in the vuejs/create-vue repository
|
|
1865
|
-
<https://github.com/vuejs/create-vue/blob/main/.prettierrc>
|
|
1866
|
-
%>
|
|
1867
|
-
{
|
|
1868
|
-
"$schema": "https://json.schemastore.org/prettierrc",
|
|
1869
|
-
"semi": false,
|
|
1870
|
-
"singleQuote": true,
|
|
1871
|
-
"printWidth": 100
|
|
1872
|
-
}
|
|
1873
|
-
<%_ } _%>
|
|
1874
|
-
`, "./templates/eslint.config.js.ejs": "<%_ for (const { importer } of configsBeforeVuePlugin) { _%>\n<%- importer %>\n<%_ } _%>\nimport js from '@eslint/js'\nimport pluginVue from 'eslint-plugin-vue'\nimport globals from 'globals'\n<%_ for (const { importer } of configsAfterVuePlugin) { _%>\n<%- importer %>\n<%_ } _%>\n\nexport default [\n {\n name: 'app/files-to-lint',\n files: ['**/*.{<%= fileExtensions.join(',') %>}'],\n },\n\n {\n name: 'app/files-to-ignore',\n ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'],\n },\n\n {\n languageOptions: {\n globals: {\n ...globals.browser,\n },\n },\n },\n\n<%_ for (const { content } of configsBeforeVuePlugin) { _%>\n <%- content %><%# TODO: auto-indent if content's multi-line %>\n<%_ } _%>\n js.configs.recommended,\n ...pluginVue.configs['flat/essential'],\n<%_ for (const { content } of configsAfterVuePlugin) { _%>\n <%- content %><%# TODO: auto-indent if content's multi-line %>\n<%_ } _%>\n]\n", "./templates/eslint.config.ts.ejs": "<%_ for (const { importer } of configsBeforeVuePlugin) { _%>\n<%- importer %>\n<%_ } _%>\nimport pluginVue from 'eslint-plugin-vue'\nimport { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'\n<%_ for (const { importer } of configsAfterVuePlugin) { _%>\n<%- importer %>\n<%_ } _%>\n\n// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:\n// import { configureVueProject } from '@vue/eslint-config-typescript'\n// configureVueProject({ scriptLangs: ['ts', 'tsx'] })\n// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup\n\nexport default defineConfigWithVueTs(\n {\n name: 'app/files-to-lint',\n files: ['**/*.{<%= fileExtensions.join(',') %>}'],\n },\n\n {\n name: 'app/files-to-ignore',\n ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'],\n },\n\n<%_ for (const { content } of configsBeforeVuePlugin) { _%>\n <%- content %><%# TODO: auto-indent if content's multi-line %>\n<%_ } _%>\n pluginVue.configs['flat/essential'],\n vueTsConfigs.recommended,\n<%_ for (const { content } of configsAfterVuePlugin) { _%>\n <%- content %><%# TODO: auto-indent if content's multi-line %>\n<%_ } _%>\n)\n" };
|
|
1875
|
-
function renderEjsFile(filePath, data) {
|
|
1876
|
-
return import_ejs.default.render(templates[filePath], data, {});
|
|
1877
|
-
}
|
|
1878
|
-
|
|
1879
|
-
// node_modules/.pnpm/@vue+create-eslint-config@0.9.1/node_modules/@vue/create-eslint-config/package.json
|
|
1880
|
-
var package_default = {
|
|
1881
|
-
name: "@vue/create-eslint-config",
|
|
1882
|
-
version: "0.9.1",
|
|
1883
|
-
description: "Utility to setup ESLint in Vue.js projects.",
|
|
1884
|
-
type: "module",
|
|
1885
|
-
main: "index.js",
|
|
1886
|
-
bin: {
|
|
1887
|
-
"create-eslint-config": "bin/create-eslint-config.js"
|
|
1888
|
-
},
|
|
1889
|
-
engines: {
|
|
1890
|
-
node: "^16.14.0 || >= 18.0.0"
|
|
1891
|
-
},
|
|
1892
|
-
scripts: {
|
|
1893
|
-
test: 'echo "Error: no test specified" && exit 1',
|
|
1894
|
-
lint: "eslint --fix ."
|
|
1895
|
-
},
|
|
1896
|
-
repository: {
|
|
1897
|
-
type: "git",
|
|
1898
|
-
url: "git+https://github.com/vuejs/create-eslint-config.git"
|
|
1899
|
-
},
|
|
1900
|
-
keywords: [
|
|
1901
|
-
"vue",
|
|
1902
|
-
"eslint",
|
|
1903
|
-
"config"
|
|
1904
|
-
],
|
|
1905
|
-
author: "Haoqun Jiang <haoqunjiang+npm@gmail.com>",
|
|
1906
|
-
license: "MIT",
|
|
1907
|
-
bugs: {
|
|
1908
|
-
url: "https://github.com/vuejs/create-eslint-config/issues"
|
|
1909
|
-
},
|
|
1910
|
-
homepage: "https://github.com/vuejs/create-eslint-config#readme",
|
|
1911
|
-
publishConfig: {
|
|
1912
|
-
access: "public",
|
|
1913
|
-
provenance: true
|
|
1914
|
-
},
|
|
1915
|
-
dependencies: {
|
|
1916
|
-
ejs: "^3.1.10",
|
|
1917
|
-
enquirer: "^2.4.1",
|
|
1918
|
-
kolorist: "^1.8.0"
|
|
1919
|
-
},
|
|
1920
|
-
devDependencies: {
|
|
1921
|
-
"@eslint/js": "^9.21.0",
|
|
1922
|
-
"@types/node": "^22.13.9",
|
|
1923
|
-
"@vue/eslint-config-prettier": "^10.2.0",
|
|
1924
|
-
"@vue/eslint-config-typescript": "^14.5.0",
|
|
1925
|
-
eslint: "^9.21.0",
|
|
1926
|
-
"eslint-plugin-oxlint": "^0.15.13",
|
|
1927
|
-
"eslint-plugin-vue": "~10.0.0",
|
|
1928
|
-
globals: "^16.0.0",
|
|
1929
|
-
jiti: "^2.4.2",
|
|
1930
|
-
"npm-run-all2": "^7.0.2",
|
|
1931
|
-
oxlint: "^0.15.13",
|
|
1932
|
-
prettier: "3.5.3",
|
|
1933
|
-
typescript: "~5.8.2"
|
|
1934
|
-
}
|
|
1935
|
-
};
|
|
1936
|
-
|
|
1937
|
-
// node_modules/.pnpm/@vue+create-eslint-config@0.9.1/node_modules/@vue/create-eslint-config/index.js
|
|
1938
|
-
var versionMap = package_default.devDependencies;
|
|
1939
|
-
function createConfig({
|
|
1940
|
-
styleGuide = "default",
|
|
1941
|
-
// default ~~| airbnb | standard~~ only the default is supported for now
|
|
1942
|
-
hasTypeScript = false,
|
|
1943
|
-
needsPrettier = false,
|
|
1944
|
-
needsOxlint = false,
|
|
1945
|
-
additionalConfigs = []
|
|
1946
|
-
}) {
|
|
1947
|
-
const pickDependencies = (keys) => pickKeysFromObject(versionMap, keys);
|
|
1948
|
-
const pkg = {
|
|
1949
|
-
devDependencies: pickDependencies(["eslint", "eslint-plugin-vue"]),
|
|
1950
|
-
scripts: {}
|
|
1951
|
-
};
|
|
1952
|
-
const fileExtensions = ["vue"];
|
|
1953
|
-
if (hasTypeScript) {
|
|
1954
|
-
fileExtensions.unshift("ts", "mts", "tsx");
|
|
1955
|
-
additionalConfigs.unshift({
|
|
1956
|
-
devDependencies: pickDependencies(["@vue/eslint-config-typescript", "jiti"])
|
|
1957
|
-
});
|
|
1958
|
-
} else {
|
|
1959
|
-
fileExtensions.unshift("js", "mjs", "jsx");
|
|
1960
|
-
additionalConfigs.unshift({
|
|
1961
|
-
devDependencies: pickDependencies(["@eslint/js", "globals"])
|
|
1962
|
-
});
|
|
1963
|
-
}
|
|
1964
|
-
if (needsOxlint) {
|
|
1965
|
-
additionalConfigs.push({
|
|
1966
|
-
devDependencies: pickDependencies([
|
|
1967
|
-
"oxlint",
|
|
1968
|
-
"eslint-plugin-oxlint",
|
|
1969
|
-
"npm-run-all2"
|
|
1970
|
-
]),
|
|
1971
|
-
afterVuePlugin: [
|
|
1972
|
-
{
|
|
1973
|
-
importer: "import oxlint from 'eslint-plugin-oxlint'",
|
|
1974
|
-
content: "...oxlint.configs['flat/recommended'],"
|
|
1975
|
-
}
|
|
1976
|
-
]
|
|
1977
|
-
});
|
|
1978
|
-
pkg.scripts["lint:oxlint"] = "oxlint . --fix -D correctness --ignore-path .gitignore";
|
|
1979
|
-
pkg.scripts["lint:eslint"] = "eslint . --fix";
|
|
1980
|
-
pkg.scripts.lint = "run-s lint:*";
|
|
1981
|
-
} else {
|
|
1982
|
-
pkg.scripts.lint = "eslint . --fix";
|
|
1983
|
-
}
|
|
1984
|
-
if (needsPrettier) {
|
|
1985
|
-
additionalConfigs.push({
|
|
1986
|
-
devDependencies: pickDependencies([
|
|
1987
|
-
"prettier",
|
|
1988
|
-
"@vue/eslint-config-prettier"
|
|
1989
|
-
]),
|
|
1990
|
-
afterVuePlugin: [
|
|
1991
|
-
{
|
|
1992
|
-
importer: "import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'",
|
|
1993
|
-
content: "skipFormatting,"
|
|
1994
|
-
}
|
|
1995
|
-
]
|
|
1996
|
-
});
|
|
1997
|
-
pkg.scripts.format = "prettier --write src/";
|
|
1998
|
-
}
|
|
1999
|
-
const configsBeforeVuePlugin = [], configsAfterVuePlugin = [];
|
|
2000
|
-
for (const config of additionalConfigs) {
|
|
2001
|
-
deepMerge2(pkg.devDependencies, config.devDependencies ?? {});
|
|
2002
|
-
configsBeforeVuePlugin.push(...config.beforeVuePlugin ?? []);
|
|
2003
|
-
configsAfterVuePlugin.push(...config.afterVuePlugin ?? []);
|
|
2004
|
-
}
|
|
2005
|
-
const templateData = {
|
|
2006
|
-
styleGuide,
|
|
2007
|
-
needsPrettier,
|
|
2008
|
-
fileExtensions,
|
|
2009
|
-
configsBeforeVuePlugin,
|
|
2010
|
-
configsAfterVuePlugin
|
|
2011
|
-
};
|
|
2012
|
-
const files = {
|
|
2013
|
-
".editorconfig": renderEjsFile(
|
|
2014
|
-
"./templates/_editorconfig.ejs",
|
|
2015
|
-
templateData
|
|
2016
|
-
)
|
|
2017
|
-
};
|
|
2018
|
-
if (hasTypeScript) {
|
|
2019
|
-
files["eslint.config.ts"] = renderEjsFile(
|
|
2020
|
-
"./templates/eslint.config.ts.ejs",
|
|
2021
|
-
templateData
|
|
2022
|
-
);
|
|
2023
|
-
} else {
|
|
2024
|
-
files["eslint.config.js"] = renderEjsFile(
|
|
2025
|
-
"./templates/eslint.config.js.ejs",
|
|
2026
|
-
templateData
|
|
2027
|
-
);
|
|
2028
|
-
}
|
|
2029
|
-
if (needsPrettier) {
|
|
2030
|
-
files[".prettierrc.json"] = renderEjsFile(
|
|
2031
|
-
"./templates/_prettierrc.json.ejs",
|
|
2032
|
-
templateData
|
|
2033
|
-
);
|
|
2034
|
-
}
|
|
2035
|
-
if (styleGuide !== "standard" || needsPrettier) {
|
|
2036
|
-
files[".gitattributes"] = renderEjsFile("./templates/_gitattributes", {});
|
|
2037
|
-
}
|
|
2038
|
-
return {
|
|
2039
|
-
pkg,
|
|
2040
|
-
files
|
|
2041
|
-
};
|
|
2042
|
-
}
|
|
2043
|
-
function pickKeysFromObject(obj, keys) {
|
|
2044
|
-
return keys.reduce((acc, key) => {
|
|
2045
|
-
if (key in obj) {
|
|
2046
|
-
acc[key] = obj[key];
|
|
2047
|
-
}
|
|
2048
|
-
return acc;
|
|
2049
|
-
}, {});
|
|
2050
|
-
}
|
|
2051
|
-
var isObject2 = (val) => val && typeof val === "object";
|
|
2052
|
-
var mergeArrayWithDedupe2 = (a, b2) => Array.from(/* @__PURE__ */ new Set([...a, ...b2]));
|
|
2053
|
-
function deepMerge2(target, obj) {
|
|
2054
|
-
for (const key of Object.keys(obj)) {
|
|
2055
|
-
const oldVal = target[key];
|
|
2056
|
-
const newVal = obj[key];
|
|
2057
|
-
if (Array.isArray(oldVal) && Array.isArray(newVal)) {
|
|
2058
|
-
target[key] = mergeArrayWithDedupe2(oldVal, newVal);
|
|
2059
|
-
} else if (isObject2(oldVal) && isObject2(newVal)) {
|
|
2060
|
-
target[key] = deepMerge2(oldVal, newVal);
|
|
2061
|
-
} else {
|
|
2062
|
-
target[key] = newVal;
|
|
2063
|
-
}
|
|
2064
|
-
}
|
|
2065
|
-
return target;
|
|
2066
|
-
}
|
|
2067
|
-
|
|
2068
|
-
// template/eslint/package.json
|
|
2069
|
-
var package_default2 = {
|
|
2070
|
-
devDependencies: {
|
|
2071
|
-
"@vitest/eslint-plugin": "^1.1.36",
|
|
2072
|
-
"eslint-plugin-cypress": "^4.2.0",
|
|
2073
|
-
"eslint-plugin-playwright": "^2.2.0"
|
|
2074
|
-
}
|
|
2075
|
-
};
|
|
2076
|
-
|
|
2077
|
-
// utils/renderEslint.ts
|
|
2078
|
-
var eslintDeps = package_default2.devDependencies;
|
|
2079
|
-
function renderEslint(rootDir, {
|
|
2080
|
-
needsTypeScript,
|
|
2081
|
-
needsVitest,
|
|
2082
|
-
needsCypress,
|
|
2083
|
-
needsCypressCT,
|
|
2084
|
-
needsOxlint,
|
|
2085
|
-
needsPrettier,
|
|
2086
|
-
needsPlaywright
|
|
2087
|
-
}) {
|
|
2088
|
-
const additionalConfigs = getAdditionalConfigs({
|
|
2089
|
-
needsTypeScript,
|
|
2090
|
-
needsVitest,
|
|
2091
|
-
needsCypress,
|
|
2092
|
-
needsCypressCT,
|
|
2093
|
-
needsPlaywright
|
|
2094
|
-
});
|
|
2095
|
-
const { pkg, files } = createConfig({
|
|
2096
|
-
styleGuide: "default",
|
|
2097
|
-
hasTypeScript: needsTypeScript,
|
|
2098
|
-
needsOxlint,
|
|
2099
|
-
// Theoretically, we could add Prettier without requring ESLint.
|
|
2100
|
-
// But it doesn't seem to be a good practice, so we just let createESLintConfig handle it.
|
|
2101
|
-
needsPrettier,
|
|
2102
|
-
additionalConfigs
|
|
2103
|
-
});
|
|
2104
|
-
const packageJsonPath = path4.resolve(rootDir, "package.json");
|
|
2105
|
-
const existingPkg = JSON.parse(fs4.readFileSync(packageJsonPath, "utf8"));
|
|
2106
|
-
const updatedPkg = sortDependencies(deepMerge_default(existingPkg, pkg));
|
|
2107
|
-
fs4.writeFileSync(packageJsonPath, JSON.stringify(updatedPkg, null, 2) + "\n", "utf8");
|
|
2108
|
-
for (const [fileName, content] of Object.entries(files)) {
|
|
2109
|
-
const fullPath = path4.resolve(rootDir, fileName);
|
|
2110
|
-
fs4.writeFileSync(fullPath, content, "utf8");
|
|
2111
|
-
}
|
|
2112
|
-
}
|
|
2113
|
-
function getAdditionalConfigs({
|
|
2114
|
-
needsTypeScript,
|
|
2115
|
-
needsVitest,
|
|
2116
|
-
needsCypress,
|
|
2117
|
-
needsCypressCT,
|
|
2118
|
-
needsPlaywright
|
|
2119
|
-
}) {
|
|
2120
|
-
const additionalConfigs = [];
|
|
2121
|
-
if (needsVitest) {
|
|
2122
|
-
additionalConfigs.push({
|
|
2123
|
-
devDependencies: {
|
|
2124
|
-
"@vitest/eslint-plugin": eslintDeps["@vitest/eslint-plugin"]
|
|
2125
|
-
},
|
|
2126
|
-
afterVuePlugin: [
|
|
2127
|
-
{
|
|
2128
|
-
importer: `import pluginVitest from '@vitest/eslint-plugin'`,
|
|
2129
|
-
content: `
|
|
2130
|
-
{
|
|
2131
|
-
...pluginVitest.configs.recommended,
|
|
2132
|
-
files: ['src/**/__tests__/*'],
|
|
2133
|
-
},`
|
|
2134
|
-
}
|
|
2135
|
-
]
|
|
2136
|
-
});
|
|
2137
|
-
}
|
|
2138
|
-
if (needsCypress) {
|
|
2139
|
-
additionalConfigs.push({
|
|
2140
|
-
devDependencies: {
|
|
2141
|
-
"eslint-plugin-cypress": eslintDeps["eslint-plugin-cypress"]
|
|
2142
|
-
},
|
|
2143
|
-
afterVuePlugin: [
|
|
2144
|
-
{
|
|
2145
|
-
importer: (needsTypeScript ? `// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2146
|
-
// @ts-ignore
|
|
2147
|
-
` : "") + "import pluginCypress from 'eslint-plugin-cypress/flat'",
|
|
2148
|
-
content: `
|
|
2149
|
-
{
|
|
2150
|
-
...pluginCypress.configs.recommended,
|
|
2151
|
-
files: [
|
|
2152
|
-
${[
|
|
2153
|
-
...needsCypressCT ? ["**/__tests__/*.{cy,spec}.{js,ts,jsx,tsx}"] : [],
|
|
2154
|
-
"cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}",
|
|
2155
|
-
"cypress/support/**/*.{js,ts,jsx,tsx}"
|
|
2156
|
-
].map(JSON.stringify.bind(JSON)).join(",\n ").replace(
|
|
2157
|
-
/"/g,
|
|
2158
|
-
"'"
|
|
2159
|
-
/* use single quotes as in the other configs */
|
|
2160
|
-
)}
|
|
2161
|
-
],
|
|
2162
|
-
},`
|
|
2163
|
-
}
|
|
2164
|
-
]
|
|
2165
|
-
});
|
|
2166
|
-
}
|
|
2167
|
-
if (needsPlaywright) {
|
|
2168
|
-
additionalConfigs.push({
|
|
2169
|
-
devDependencies: {
|
|
2170
|
-
"eslint-plugin-playwright": eslintDeps["eslint-plugin-playwright"]
|
|
2171
|
-
},
|
|
2172
|
-
afterVuePlugin: [
|
|
2173
|
-
{
|
|
2174
|
-
importer: "import pluginPlaywright from 'eslint-plugin-playwright'",
|
|
2175
|
-
content: `
|
|
2176
|
-
{
|
|
2177
|
-
...pluginPlaywright.configs['flat/recommended'],
|
|
2178
|
-
files: ['e2e/**/*.{test,spec}.{js,ts,jsx,tsx}'],
|
|
2179
|
-
},`
|
|
2180
|
-
}
|
|
2181
|
-
]
|
|
2182
|
-
});
|
|
2183
|
-
}
|
|
2184
|
-
return additionalConfigs;
|
|
2185
|
-
}
|
|
2186
|
-
|
|
2187
|
-
// utils/trimBoilerplate.ts
|
|
2188
|
-
var fs5 = __toESM(require("fs"), 1);
|
|
2189
|
-
var path5 = __toESM(require("path"), 1);
|
|
2190
|
-
function replaceContent(filepath, replacer) {
|
|
2191
|
-
const content = fs5.readFileSync(filepath, "utf8");
|
|
2192
|
-
fs5.writeFileSync(filepath, replacer(content));
|
|
2193
|
-
}
|
|
2194
|
-
function trimBoilerplate(rootDir) {
|
|
2195
|
-
const srcDir = path5.resolve(rootDir, "src");
|
|
2196
|
-
for (const filename of fs5.readdirSync(srcDir)) {
|
|
2197
|
-
if (["main.js", "main.ts", "router", "stores"].includes(filename)) {
|
|
2198
|
-
continue;
|
|
2199
|
-
}
|
|
2200
|
-
const fullpath = path5.resolve(srcDir, filename);
|
|
2201
|
-
fs5.rmSync(fullpath, { recursive: true });
|
|
2202
|
-
}
|
|
2203
|
-
}
|
|
2204
|
-
function removeCSSImport(rootDir, needsTypeScript, needsCypressCT) {
|
|
2205
|
-
const entryPath = path5.resolve(rootDir, needsTypeScript ? "src/main.ts" : "src/main.js");
|
|
2206
|
-
replaceContent(entryPath, (content) => content.replace("import './assets/main.css'\n\n", ""));
|
|
2207
|
-
if (needsCypressCT) {
|
|
2208
|
-
const ctSetupPath = path5.resolve(
|
|
2209
|
-
rootDir,
|
|
2210
|
-
needsTypeScript ? "cypress/support/component.ts" : "cypress/support/component.js"
|
|
2211
|
-
);
|
|
2212
|
-
replaceContent(
|
|
2213
|
-
ctSetupPath,
|
|
2214
|
-
(content) => content.replace("import '@/assets/main.css'", "// import '@/assets/main.css'")
|
|
2215
|
-
);
|
|
2216
|
-
}
|
|
2217
|
-
}
|
|
2218
|
-
function emptyRouterConfig(rootDir, needsTypeScript) {
|
|
2219
|
-
const srcDir = path5.resolve(rootDir, "src");
|
|
2220
|
-
const routerEntry = path5.resolve(srcDir, needsTypeScript ? "router/index.ts" : "router/index.js");
|
|
2221
|
-
replaceContent(
|
|
2222
|
-
routerEntry,
|
|
2223
|
-
(content) => content.replace(`import HomeView from '../views/HomeView.vue'
|
|
2224
|
-
`, "").replace(/routes:\s*\[[\s\S]*?\],/, "routes: [],")
|
|
2225
|
-
);
|
|
2226
|
-
}
|
|
2227
|
-
|
|
2228
|
-
// package.json
|
|
2229
|
-
var package_default3 = {
|
|
2230
|
-
name: "create-vue",
|
|
2231
|
-
version: "3.15.1",
|
|
2232
|
-
description: "\u{1F6E0}\uFE0F The recommended way to start a Vite-powered Vue project",
|
|
2233
|
-
type: "module",
|
|
2234
|
-
packageManager: "pnpm@10.6.1",
|
|
2235
|
-
bin: {
|
|
2236
|
-
"create-vue": "outfile.cjs"
|
|
2237
|
-
},
|
|
2238
|
-
files: [
|
|
2239
|
-
"locales",
|
|
2240
|
-
"outfile.cjs",
|
|
2241
|
-
"template",
|
|
2242
|
-
"!template/**/node_modules/.bin/*"
|
|
2243
|
-
],
|
|
2244
|
-
engines: {
|
|
2245
|
-
node: ">=v18.3.0"
|
|
2246
|
-
},
|
|
2247
|
-
scripts: {
|
|
2248
|
-
prepare: "husky",
|
|
2249
|
-
format: "prettier --write .",
|
|
2250
|
-
build: "zx ./scripts/build.mjs",
|
|
2251
|
-
snapshot: "zx ./scripts/snapshot.mjs",
|
|
2252
|
-
pretest: "pnpm run build && pnpm run snapshot",
|
|
2253
|
-
test: "zx ./scripts/test.mjs",
|
|
2254
|
-
"test:unit": "vitest",
|
|
2255
|
-
postversion: "zx ./scripts/postversion.mjs",
|
|
2256
|
-
prepublishOnly: "pnpm run build"
|
|
2257
|
-
},
|
|
2258
|
-
repository: {
|
|
2259
|
-
type: "git",
|
|
2260
|
-
url: "git+https://github.com/vuejs/create-vue.git"
|
|
2261
|
-
},
|
|
2262
|
-
keywords: [],
|
|
2263
|
-
author: "Haoqun Jiang <npm@haoqun.me>",
|
|
2264
|
-
license: "MIT",
|
|
2265
|
-
bugs: {
|
|
2266
|
-
url: "https://github.com/vuejs/create-vue/issues"
|
|
2267
|
-
},
|
|
2268
|
-
homepage: "https://github.com/vuejs/create-vue#readme",
|
|
2269
|
-
devDependencies: {
|
|
2270
|
-
"@clack/prompts": "^0.10.0",
|
|
2271
|
-
"@tsconfig/node22": "^22.0.0",
|
|
2272
|
-
"@types/eslint": "^9.6.1",
|
|
2273
|
-
"@types/node": "^22.13.9",
|
|
2274
|
-
"@types/prompts": "^2.4.9",
|
|
2275
|
-
"@vue/create-eslint-config": "^0.9.1",
|
|
2276
|
-
"@vue/tsconfig": "^0.7.0",
|
|
2277
|
-
ejs: "^3.1.10",
|
|
2278
|
-
esbuild: "^0.25.0",
|
|
2279
|
-
"esbuild-plugin-license": "^1.2.3",
|
|
2280
|
-
husky: "^9.1.7",
|
|
2281
|
-
"lint-staged": "^15.4.3",
|
|
2282
|
-
picocolors: "^1.1.1",
|
|
2283
|
-
prettier: "3.5.3",
|
|
2284
|
-
vitest: "^3.0.8",
|
|
2285
|
-
zx: "^8.4.0"
|
|
2286
|
-
},
|
|
2287
|
-
"lint-staged": {
|
|
2288
|
-
"*.{js,ts,vue,json}": [
|
|
2289
|
-
"prettier --write"
|
|
2290
|
-
]
|
|
2291
|
-
},
|
|
2292
|
-
publishConfig: {
|
|
2293
|
-
access: "public",
|
|
2294
|
-
provenance: true
|
|
2295
|
-
}
|
|
2296
|
-
};
|
|
2297
|
-
|
|
2298
|
-
// index.ts
|
|
2299
|
-
var language = getLanguage();
|
|
2300
|
-
var FEATURE_FLAGS = [
|
|
2301
|
-
"default",
|
|
2302
|
-
"ts",
|
|
2303
|
-
"typescript",
|
|
2304
|
-
"jsx",
|
|
2305
|
-
"router",
|
|
2306
|
-
"vue-router",
|
|
2307
|
-
"pinia",
|
|
2308
|
-
"tests",
|
|
2309
|
-
"with-tests",
|
|
2310
|
-
"vitest",
|
|
2311
|
-
"cypress",
|
|
2312
|
-
"nightwatch",
|
|
2313
|
-
"playwright",
|
|
2314
|
-
"eslint",
|
|
2315
|
-
"prettier",
|
|
2316
|
-
"eslint-with-oxlint",
|
|
2317
|
-
"eslint-with-prettier"
|
|
2318
|
-
];
|
|
2319
|
-
var FEATURE_OPTIONS = [
|
|
2320
|
-
{
|
|
2321
|
-
value: "typescript",
|
|
2322
|
-
label: language.needsTypeScript.message
|
|
2323
|
-
},
|
|
2324
|
-
{
|
|
2325
|
-
value: "jsx",
|
|
2326
|
-
label: language.needsJsx.message
|
|
2327
|
-
},
|
|
2328
|
-
{
|
|
2329
|
-
value: "router",
|
|
2330
|
-
label: language.needsRouter.message
|
|
2331
|
-
},
|
|
2332
|
-
{
|
|
2333
|
-
value: "pinia",
|
|
2334
|
-
label: language.needsPinia.message
|
|
2335
|
-
},
|
|
2336
|
-
{
|
|
2337
|
-
value: "vitest",
|
|
2338
|
-
label: language.needsVitest.message
|
|
2339
|
-
},
|
|
2340
|
-
{
|
|
2341
|
-
value: "e2e",
|
|
2342
|
-
label: language.needsE2eTesting.message
|
|
2343
|
-
},
|
|
2344
|
-
{
|
|
2345
|
-
value: "eslint",
|
|
2346
|
-
label: language.needsEslint.message
|
|
2347
|
-
},
|
|
2348
|
-
{
|
|
2349
|
-
value: "prettier",
|
|
2350
|
-
label: language.needsPrettier.message
|
|
2351
|
-
}
|
|
2352
|
-
];
|
|
2353
|
-
function isValidPackageName(projectName) {
|
|
2354
|
-
return /^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(projectName);
|
|
2355
|
-
}
|
|
2356
|
-
function toValidPackageName(projectName) {
|
|
2357
|
-
return projectName.trim().toLowerCase().replace(/\s+/g, "-").replace(/^[._]/, "").replace(/[^a-z0-9-~]+/g, "-");
|
|
2358
|
-
}
|
|
2359
|
-
function canSkipEmptying(dir) {
|
|
2360
|
-
if (!fs6.existsSync(dir)) {
|
|
2361
|
-
return true;
|
|
2362
|
-
}
|
|
2363
|
-
const files = fs6.readdirSync(dir);
|
|
2364
|
-
if (files.length === 0) {
|
|
2365
|
-
return true;
|
|
2366
|
-
}
|
|
2367
|
-
if (files.length === 1 && files[0] === ".git") {
|
|
2368
|
-
return true;
|
|
2369
|
-
}
|
|
2370
|
-
return false;
|
|
2371
|
-
}
|
|
2372
|
-
function emptyDir(dir) {
|
|
2373
|
-
if (!fs6.existsSync(dir)) {
|
|
2374
|
-
return;
|
|
2375
|
-
}
|
|
2376
|
-
postOrderDirectoryTraverse(
|
|
2377
|
-
dir,
|
|
2378
|
-
(dir2) => fs6.rmdirSync(dir2),
|
|
2379
|
-
(file) => fs6.unlinkSync(file)
|
|
2380
|
-
);
|
|
2381
|
-
}
|
|
2382
|
-
async function unwrapPrompt(maybeCancelPromise) {
|
|
2383
|
-
const result = await maybeCancelPromise;
|
|
2384
|
-
if (BD(result)) {
|
|
2385
|
-
xe((0, import_picocolors3.red)("\u2716") + ` ${language.errors.operationCancelled}`);
|
|
2386
|
-
process.exit(0);
|
|
2387
|
-
}
|
|
2388
|
-
return result;
|
|
2389
|
-
}
|
|
2390
|
-
var helpMessage = `Usage: create-vue [FEATURE_FLAGS...] [OPTIONS...] [DIRECTORY]
|
|
2391
|
-
|
|
2392
|
-
Create a new Vue.js project.
|
|
2393
|
-
Start the CLI in interactive mode when no FEATURE_FLAGS is provided, or if the DIRECTORY argument is not a valid package name.
|
|
2394
|
-
|
|
2395
|
-
Options:
|
|
2396
|
-
--force
|
|
2397
|
-
Create the project even if the directory is not empty.
|
|
2398
|
-
--bare
|
|
2399
|
-
Create a barebone project without example code.
|
|
2400
|
-
--help
|
|
2401
|
-
Display this help message.
|
|
2402
|
-
--version
|
|
2403
|
-
Display the version number of this CLI.
|
|
2404
|
-
|
|
2405
|
-
Available feature flags:
|
|
2406
|
-
--default
|
|
2407
|
-
Create a project with the default configuration without any additional features.
|
|
2408
|
-
--ts, --typescript
|
|
2409
|
-
Add TypeScript support.
|
|
2410
|
-
--jsx
|
|
2411
|
-
Add JSX support.
|
|
2412
|
-
--router, --vue-router
|
|
2413
|
-
Add Vue Router for SPA development.
|
|
2414
|
-
--pinia
|
|
2415
|
-
Add Pinia for state management.
|
|
2416
|
-
--vitest
|
|
2417
|
-
Add Vitest for unit testing.
|
|
2418
|
-
--cypress
|
|
2419
|
-
Add Cypress for end-to-end testing.
|
|
2420
|
-
If used without ${(0, import_picocolors3.cyan)("--vitest")}, it will also add Cypress Component Testing.
|
|
2421
|
-
--playwright
|
|
2422
|
-
Add Playwright for end-to-end testing.
|
|
2423
|
-
--nightwatch
|
|
2424
|
-
Add Nightwatch for end-to-end testing.
|
|
2425
|
-
If used without ${(0, import_picocolors3.cyan)("--vitest")}, it will also add Nightwatch Component Testing.
|
|
2426
|
-
--eslint
|
|
2427
|
-
Add ESLint for code quality.
|
|
2428
|
-
--eslint-with-oxlint
|
|
2429
|
-
Add ESLint for code quality, and use Oxlint to speed up the linting process.
|
|
2430
|
-
--eslint-with-prettier (Deprecated in favor of ${(0, import_picocolors3.cyan)("--eslint --prettier")})
|
|
2431
|
-
Add Prettier for code formatting in addition to ESLint.
|
|
2432
|
-
--prettier
|
|
2433
|
-
Add Prettier for code formatting.
|
|
2434
|
-
|
|
2435
|
-
Unstable feature flags:
|
|
2436
|
-
--tests, --with-tests
|
|
2437
|
-
Add both unit testing and end-to-end testing support.
|
|
2438
|
-
Currently equivalent to ${(0, import_picocolors3.cyan)("--vitest --cypress")}, but may change in the future.
|
|
2439
|
-
`;
|
|
2440
|
-
async function init() {
|
|
2441
|
-
const cwd = process.cwd();
|
|
2442
|
-
const args = process.argv.slice(2);
|
|
2443
|
-
const flags = [...FEATURE_FLAGS, "force", "bare", "help", "version"];
|
|
2444
|
-
const options = Object.fromEntries(flags.map((key) => [key, { type: "boolean" }]));
|
|
2445
|
-
const { values: argv, positionals } = (0, import_node_util.parseArgs)({
|
|
2446
|
-
args,
|
|
2447
|
-
options,
|
|
2448
|
-
strict: true,
|
|
2449
|
-
allowPositionals: true
|
|
2450
|
-
});
|
|
2451
|
-
if (argv.help) {
|
|
2452
|
-
console.log(helpMessage);
|
|
2453
|
-
process.exit(0);
|
|
2454
|
-
}
|
|
2455
|
-
if (argv.version) {
|
|
2456
|
-
console.log(`${package_default3.name} v${package_default3.version}`);
|
|
2457
|
-
process.exit(0);
|
|
2458
|
-
}
|
|
2459
|
-
const isFeatureFlagsUsed = FEATURE_FLAGS.some((flag) => typeof argv[flag] === "boolean");
|
|
2460
|
-
let targetDir = positionals[0];
|
|
2461
|
-
const defaultProjectName = targetDir || "vue-project";
|
|
2462
|
-
const forceOverwrite = argv.force;
|
|
2463
|
-
const result = {
|
|
2464
|
-
projectName: defaultProjectName,
|
|
2465
|
-
shouldOverwrite: forceOverwrite,
|
|
2466
|
-
packageName: defaultProjectName,
|
|
2467
|
-
features: [],
|
|
2468
|
-
e2eFramework: void 0,
|
|
2469
|
-
experimentOxlint: false
|
|
2470
|
-
};
|
|
2471
|
-
Ie(
|
|
2472
|
-
process.stdout.isTTY && process.stdout.getColorDepth() > 8 ? gradientBanner : defaultBanner
|
|
2473
|
-
);
|
|
2474
|
-
if (!targetDir) {
|
|
2475
|
-
targetDir = result.projectName = result.packageName = await unwrapPrompt(
|
|
2476
|
-
he({
|
|
2477
|
-
message: language.projectName.message,
|
|
2478
|
-
placeholder: defaultProjectName,
|
|
2479
|
-
validate: (value) => value.trim().length > 0 ? void 0 : language.projectName.invalidMessage
|
|
2480
|
-
})
|
|
2481
|
-
);
|
|
2482
|
-
}
|
|
2483
|
-
if (!canSkipEmptying(targetDir) && !forceOverwrite) {
|
|
2484
|
-
result.shouldOverwrite = await unwrapPrompt(
|
|
2485
|
-
ye({
|
|
2486
|
-
message: `${targetDir === "." ? language.shouldOverwrite.dirForPrompts.current : `${language.shouldOverwrite.dirForPrompts.target} "${targetDir}"`} ${language.shouldOverwrite.message}`,
|
|
2487
|
-
initialValue: false
|
|
2488
|
-
})
|
|
2489
|
-
);
|
|
2490
|
-
if (!result.shouldOverwrite) {
|
|
2491
|
-
xe((0, import_picocolors3.red)("\u2716") + ` ${language.errors.operationCancelled}`);
|
|
2492
|
-
process.exit(0);
|
|
2493
|
-
}
|
|
2494
|
-
}
|
|
2495
|
-
if (!isValidPackageName(targetDir)) {
|
|
2496
|
-
result.packageName = await unwrapPrompt(
|
|
2497
|
-
he({
|
|
2498
|
-
message: language.packageName.message,
|
|
2499
|
-
initialValue: toValidPackageName(targetDir),
|
|
2500
|
-
validate: (value) => isValidPackageName(value) ? void 0 : language.packageName.invalidMessage
|
|
2501
|
-
})
|
|
2502
|
-
);
|
|
2503
|
-
}
|
|
2504
|
-
if (!isFeatureFlagsUsed) {
|
|
2505
|
-
result.features = await unwrapPrompt(
|
|
2506
|
-
fe({
|
|
2507
|
-
message: `${language.featureSelection.message} ${(0, import_picocolors3.dim)(language.featureSelection.hint)}`,
|
|
2508
|
-
// @ts-expect-error @clack/prompt's type doesn't support readonly array yet
|
|
2509
|
-
options: FEATURE_OPTIONS,
|
|
2510
|
-
required: false
|
|
2511
|
-
})
|
|
2512
|
-
);
|
|
2513
|
-
if (result.features.includes("e2e")) {
|
|
2514
|
-
const hasVitest = result.features.includes("vitest");
|
|
2515
|
-
result.e2eFramework = await unwrapPrompt(
|
|
2516
|
-
ve({
|
|
2517
|
-
message: `${language.e2eSelection.message} ${(0, import_picocolors3.dim)(language.e2eSelection.hint)}`,
|
|
2518
|
-
options: [
|
|
2519
|
-
{
|
|
2520
|
-
value: "playwright",
|
|
2521
|
-
label: language.e2eSelection.selectOptions.playwright.title,
|
|
2522
|
-
hint: language.e2eSelection.selectOptions.playwright.desc
|
|
2523
|
-
},
|
|
2524
|
-
{
|
|
2525
|
-
value: "cypress",
|
|
2526
|
-
label: language.e2eSelection.selectOptions.cypress.title,
|
|
2527
|
-
hint: hasVitest ? language.e2eSelection.selectOptions.cypress.desc : language.e2eSelection.selectOptions.cypress.hintOnComponentTesting
|
|
2528
|
-
},
|
|
2529
|
-
{
|
|
2530
|
-
value: "nightwatch",
|
|
2531
|
-
label: language.e2eSelection.selectOptions.nightwatch.title,
|
|
2532
|
-
hint: hasVitest ? language.e2eSelection.selectOptions.nightwatch.desc : language.e2eSelection.selectOptions.nightwatch.hintOnComponentTesting
|
|
2533
|
-
}
|
|
2534
|
-
]
|
|
2535
|
-
})
|
|
2536
|
-
);
|
|
2537
|
-
}
|
|
2538
|
-
if (result.features.includes("eslint")) {
|
|
2539
|
-
result.experimentOxlint = await unwrapPrompt(
|
|
2540
|
-
ye({
|
|
2541
|
-
message: language.needsOxlint.message,
|
|
2542
|
-
initialValue: false
|
|
2543
|
-
})
|
|
2544
|
-
);
|
|
2545
|
-
}
|
|
2546
|
-
}
|
|
2547
|
-
const { features } = result;
|
|
2548
|
-
const needsTypeScript = argv.ts || argv.typescript || features.includes("typescript");
|
|
2549
|
-
const needsJsx = argv.jsx || features.includes("jsx");
|
|
2550
|
-
const needsRouter = argv.router || argv["vue-router"] || features.includes("router");
|
|
2551
|
-
const needsPinia = argv.pinia || features.includes("pinia");
|
|
2552
|
-
const needsVitest = argv.vitest || argv.tests || features.includes("vitest");
|
|
2553
|
-
const needsEslint = argv.eslint || argv["eslint-with-oxlint"] || argv["eslint-with-prettier"] || features.includes("eslint");
|
|
2554
|
-
const needsPrettier = argv.prettier || argv["eslint-with-prettier"] || features.includes("prettier");
|
|
2555
|
-
const needsOxlint = argv["eslint-with-oxlint"] || result.experimentOxlint;
|
|
2556
|
-
const { e2eFramework } = result;
|
|
2557
|
-
const needsCypress = argv.cypress || argv.tests || e2eFramework === "cypress";
|
|
2558
|
-
const needsCypressCT = needsCypress && !needsVitest;
|
|
2559
|
-
const needsNightwatch = argv.nightwatch || e2eFramework === "nightwatch";
|
|
2560
|
-
const needsNightwatchCT = needsNightwatch && !needsVitest;
|
|
2561
|
-
const needsPlaywright = argv.playwright || e2eFramework === "playwright";
|
|
2562
|
-
const root = path6.join(cwd, targetDir);
|
|
2563
|
-
if (fs6.existsSync(root) && result.shouldOverwrite) {
|
|
2564
|
-
emptyDir(root);
|
|
2565
|
-
} else if (!fs6.existsSync(root)) {
|
|
2566
|
-
fs6.mkdirSync(root);
|
|
2567
|
-
}
|
|
2568
|
-
console.log(`
|
|
2569
|
-
${language.infos.scaffolding} ${root}...`);
|
|
2570
|
-
const pkg = { name: result.packageName, version: "0.0.0" };
|
|
2571
|
-
fs6.writeFileSync(path6.resolve(root, "package.json"), JSON.stringify(pkg, null, 2));
|
|
2572
|
-
const templateRoot = path6.resolve(__dirname, "template");
|
|
2573
|
-
const callbacks = [];
|
|
2574
|
-
const render = function render2(templateName) {
|
|
2575
|
-
const templateDir = path6.resolve(templateRoot, templateName);
|
|
2576
|
-
renderTemplate_default(templateDir, root, callbacks);
|
|
2577
|
-
};
|
|
2578
|
-
render("base");
|
|
2579
|
-
if (needsJsx) {
|
|
2580
|
-
render("config/jsx");
|
|
2581
|
-
}
|
|
2582
|
-
if (needsRouter) {
|
|
2583
|
-
render("config/router");
|
|
2584
|
-
}
|
|
2585
|
-
if (needsPinia) {
|
|
2586
|
-
render("config/pinia");
|
|
2587
|
-
}
|
|
2588
|
-
if (needsVitest) {
|
|
2589
|
-
render("config/vitest");
|
|
2590
|
-
}
|
|
2591
|
-
if (needsCypress) {
|
|
2592
|
-
render("config/cypress");
|
|
2593
|
-
}
|
|
2594
|
-
if (needsCypressCT) {
|
|
2595
|
-
render("config/cypress-ct");
|
|
2596
|
-
}
|
|
2597
|
-
if (needsNightwatch) {
|
|
2598
|
-
render("config/nightwatch");
|
|
2599
|
-
}
|
|
2600
|
-
if (needsNightwatchCT) {
|
|
2601
|
-
render("config/nightwatch-ct");
|
|
2602
|
-
}
|
|
2603
|
-
if (needsPlaywright) {
|
|
2604
|
-
render("config/playwright");
|
|
2605
|
-
}
|
|
2606
|
-
if (needsTypeScript) {
|
|
2607
|
-
render("config/typescript");
|
|
2608
|
-
render("tsconfig/base");
|
|
2609
|
-
const rootTsConfig = {
|
|
2610
|
-
// It doesn't target any specific files because they are all configured in the referenced ones.
|
|
2611
|
-
files: [],
|
|
2612
|
-
// All templates contain at least a `.node` and a `.app` tsconfig.
|
|
2613
|
-
references: [
|
|
2614
|
-
{
|
|
2615
|
-
path: "./tsconfig.node.json"
|
|
2616
|
-
},
|
|
2617
|
-
{
|
|
2618
|
-
path: "./tsconfig.app.json"
|
|
2619
|
-
}
|
|
2620
|
-
]
|
|
2621
|
-
};
|
|
2622
|
-
if (needsCypress) {
|
|
2623
|
-
render("tsconfig/cypress");
|
|
2624
|
-
rootTsConfig.compilerOptions = {
|
|
2625
|
-
module: "NodeNext"
|
|
2626
|
-
};
|
|
2627
|
-
}
|
|
2628
|
-
if (needsCypressCT) {
|
|
2629
|
-
render("tsconfig/cypress-ct");
|
|
2630
|
-
rootTsConfig.references.push({
|
|
2631
|
-
path: "./tsconfig.cypress-ct.json"
|
|
2632
|
-
});
|
|
2633
|
-
}
|
|
2634
|
-
if (needsPlaywright) {
|
|
2635
|
-
render("tsconfig/playwright");
|
|
2636
|
-
}
|
|
2637
|
-
if (needsVitest) {
|
|
2638
|
-
render("tsconfig/vitest");
|
|
2639
|
-
rootTsConfig.references.push({
|
|
2640
|
-
path: "./tsconfig.vitest.json"
|
|
2641
|
-
});
|
|
2642
|
-
}
|
|
2643
|
-
if (needsNightwatch) {
|
|
2644
|
-
render("tsconfig/nightwatch");
|
|
2645
|
-
rootTsConfig.references.push({
|
|
2646
|
-
path: "./nightwatch/tsconfig.json"
|
|
2647
|
-
});
|
|
2648
|
-
}
|
|
2649
|
-
if (needsNightwatchCT) {
|
|
2650
|
-
render("tsconfig/nightwatch-ct");
|
|
2651
|
-
}
|
|
2652
|
-
fs6.writeFileSync(
|
|
2653
|
-
path6.resolve(root, "tsconfig.json"),
|
|
2654
|
-
JSON.stringify(rootTsConfig, null, 2) + "\n",
|
|
2655
|
-
"utf-8"
|
|
2656
|
-
);
|
|
2657
|
-
}
|
|
2658
|
-
if (needsEslint) {
|
|
2659
|
-
renderEslint(root, {
|
|
2660
|
-
needsTypeScript,
|
|
2661
|
-
needsOxlint,
|
|
2662
|
-
needsVitest,
|
|
2663
|
-
needsCypress,
|
|
2664
|
-
needsCypressCT,
|
|
2665
|
-
needsPrettier,
|
|
2666
|
-
needsPlaywright
|
|
2667
|
-
});
|
|
2668
|
-
render("config/eslint");
|
|
2669
|
-
}
|
|
2670
|
-
if (needsPrettier) {
|
|
2671
|
-
render("config/prettier");
|
|
2672
|
-
}
|
|
2673
|
-
const codeTemplate = (needsTypeScript ? "typescript-" : "") + (needsRouter ? "router" : "default");
|
|
2674
|
-
render(`code/${codeTemplate}`);
|
|
2675
|
-
if (needsPinia && needsRouter) {
|
|
2676
|
-
render("entry/router-and-pinia");
|
|
2677
|
-
} else if (needsPinia) {
|
|
2678
|
-
render("entry/pinia");
|
|
2679
|
-
} else if (needsRouter) {
|
|
2680
|
-
render("entry/router");
|
|
2681
|
-
} else {
|
|
2682
|
-
render("entry/default");
|
|
2683
|
-
}
|
|
2684
|
-
const dataStore = {};
|
|
2685
|
-
for (const cb of callbacks) {
|
|
2686
|
-
await cb(dataStore);
|
|
2687
|
-
}
|
|
2688
|
-
preOrderDirectoryTraverse(
|
|
2689
|
-
root,
|
|
2690
|
-
() => {
|
|
2691
|
-
},
|
|
2692
|
-
(filepath) => {
|
|
2693
|
-
if (filepath.endsWith(".ejs")) {
|
|
2694
|
-
const template = fs6.readFileSync(filepath, "utf-8");
|
|
2695
|
-
const dest = filepath.replace(/\.ejs$/, "");
|
|
2696
|
-
const content = import_ejs2.default.render(template, dataStore[dest]);
|
|
2697
|
-
fs6.writeFileSync(dest, content);
|
|
2698
|
-
fs6.unlinkSync(filepath);
|
|
2699
|
-
}
|
|
2700
|
-
}
|
|
2701
|
-
);
|
|
2702
|
-
if (argv.bare) {
|
|
2703
|
-
trimBoilerplate(root);
|
|
2704
|
-
render("bare/base");
|
|
2705
|
-
if (needsTypeScript) {
|
|
2706
|
-
render("bare/typescript");
|
|
2707
|
-
}
|
|
2708
|
-
if (needsVitest) {
|
|
2709
|
-
render("bare/vitest");
|
|
2710
|
-
}
|
|
2711
|
-
if (needsCypressCT) {
|
|
2712
|
-
render("bare/cypress-ct");
|
|
2713
|
-
}
|
|
2714
|
-
if (needsNightwatchCT) {
|
|
2715
|
-
render("bare/nightwatch-ct");
|
|
2716
|
-
}
|
|
2717
|
-
}
|
|
2718
|
-
if (needsTypeScript) {
|
|
2719
|
-
preOrderDirectoryTraverse(
|
|
2720
|
-
root,
|
|
2721
|
-
() => {
|
|
2722
|
-
},
|
|
2723
|
-
(filepath) => {
|
|
2724
|
-
if (filepath.endsWith(".js") && !filepath.endsWith("eslint.config.js")) {
|
|
2725
|
-
const tsFilePath = filepath.replace(/\.js$/, ".ts");
|
|
2726
|
-
if (fs6.existsSync(tsFilePath)) {
|
|
2727
|
-
fs6.unlinkSync(filepath);
|
|
2728
|
-
} else {
|
|
2729
|
-
fs6.renameSync(filepath, tsFilePath);
|
|
2730
|
-
}
|
|
2731
|
-
} else if (path6.basename(filepath) === "jsconfig.json") {
|
|
2732
|
-
fs6.unlinkSync(filepath);
|
|
2733
|
-
}
|
|
2734
|
-
}
|
|
2735
|
-
);
|
|
2736
|
-
const indexHtmlPath = path6.resolve(root, "index.html");
|
|
2737
|
-
const indexHtmlContent = fs6.readFileSync(indexHtmlPath, "utf8");
|
|
2738
|
-
fs6.writeFileSync(indexHtmlPath, indexHtmlContent.replace("src/main.js", "src/main.ts"));
|
|
2739
|
-
} else {
|
|
2740
|
-
preOrderDirectoryTraverse(
|
|
2741
|
-
root,
|
|
2742
|
-
() => {
|
|
2743
|
-
},
|
|
2744
|
-
(filepath) => {
|
|
2745
|
-
if (filepath.endsWith(".ts")) {
|
|
2746
|
-
fs6.unlinkSync(filepath);
|
|
2747
|
-
}
|
|
2748
|
-
}
|
|
2749
|
-
);
|
|
2750
|
-
}
|
|
2751
|
-
if (argv.bare) {
|
|
2752
|
-
removeCSSImport(root, needsTypeScript, needsCypressCT);
|
|
2753
|
-
if (needsRouter) {
|
|
2754
|
-
emptyRouterConfig(root, needsTypeScript);
|
|
2755
|
-
}
|
|
2756
|
-
}
|
|
2757
|
-
const userAgent = process.env.npm_config_user_agent ?? "";
|
|
2758
|
-
const packageManager = /pnpm/.test(userAgent) ? "pnpm" : /yarn/.test(userAgent) ? "yarn" : /bun/.test(userAgent) ? "bun" : "npm";
|
|
2759
|
-
fs6.writeFileSync(
|
|
2760
|
-
path6.resolve(root, "README.md"),
|
|
2761
|
-
generateReadme({
|
|
2762
|
-
projectName: result.projectName ?? result.packageName ?? defaultProjectName,
|
|
2763
|
-
packageManager,
|
|
2764
|
-
needsTypeScript,
|
|
2765
|
-
needsVitest,
|
|
2766
|
-
needsCypress,
|
|
2767
|
-
needsNightwatch,
|
|
2768
|
-
needsPlaywright,
|
|
2769
|
-
needsNightwatchCT,
|
|
2770
|
-
needsCypressCT,
|
|
2771
|
-
needsEslint
|
|
2772
|
-
})
|
|
2773
|
-
);
|
|
2774
|
-
let outroMessage = `${language.infos.done}
|
|
2775
|
-
|
|
2776
|
-
`;
|
|
2777
|
-
if (root !== cwd) {
|
|
2778
|
-
const cdProjectName = path6.relative(cwd, root);
|
|
2779
|
-
outroMessage += ` ${(0, import_picocolors3.bold)((0, import_picocolors3.green)(`cd ${cdProjectName.includes(" ") ? `"${cdProjectName}"` : cdProjectName}`))}
|
|
2780
|
-
`;
|
|
2781
|
-
}
|
|
2782
|
-
outroMessage += ` ${(0, import_picocolors3.bold)((0, import_picocolors3.green)(getCommand(packageManager, "install")))}
|
|
2783
|
-
`;
|
|
2784
|
-
if (needsPrettier) {
|
|
2785
|
-
outroMessage += ` ${(0, import_picocolors3.bold)((0, import_picocolors3.green)(getCommand(packageManager, "format")))}
|
|
2786
|
-
`;
|
|
2787
|
-
}
|
|
2788
|
-
outroMessage += ` ${(0, import_picocolors3.bold)((0, import_picocolors3.green)(getCommand(packageManager, "dev")))}
|
|
2789
|
-
`;
|
|
2790
|
-
outroMessage += `
|
|
2791
|
-
${(0, import_picocolors3.dim)("|")} ${language.infos.optionalGitCommand}
|
|
2792
|
-
|
|
2793
|
-
${(0, import_picocolors3.bold)((0, import_picocolors3.green)('git init && git add -A && git commit -m "initial commit"'))}`;
|
|
2794
|
-
Se(outroMessage);
|
|
2795
|
-
}
|
|
2796
|
-
init().catch((e2) => {
|
|
2797
|
-
console.error(e2);
|
|
2798
|
-
process.exit(1);
|
|
2799
|
-
});
|
|
2800
|
-
/*! Bundled license information:
|
|
2801
|
-
|
|
2802
|
-
ejs/lib/ejs.js:
|
|
2803
|
-
(**
|
|
2804
|
-
* @file Embedded JavaScript templating engine. {@link http://ejs.co}
|
|
2805
|
-
* @author Matthew Eernisse <mde@fleegix.org>
|
|
2806
|
-
* @author Tiancheng "Timothy" Gu <timothygu99@gmail.com>
|
|
2807
|
-
* @project EJS
|
|
2808
|
-
* @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}
|
|
2809
|
-
*)
|
|
2810
|
-
*/
|