create-vue 3.6.4 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +211 -1
- package/outfile.cjs +830 -8
- package/package.json +4 -3
- package/template/base/node_modules/.bin/vite +4 -4
- package/template/base/package.json +2 -2
- package/template/base/vite.config.js.data.mjs +9 -0
- package/template/base/{vite.config.js → vite.config.js.ejs} +8 -2
- package/template/code/default/src/components/HelloWorld.vue +1 -0
- package/template/code/router/src/components/HelloWorld.vue +1 -0
- package/template/code/router/src/components/WelcomeItem.vue +1 -0
- package/template/code/typescript-default/src/components/HelloWorld.vue +1 -0
- package/template/code/typescript-default/src/components/WelcomeItem.vue +1 -0
- package/template/code/typescript-router/src/components/HelloWorld.vue +1 -0
- package/template/code/typescript-router/src/components/WelcomeItem.vue +1 -0
- package/template/config/cypress/node_modules/.bin/cypress +4 -4
- package/template/config/cypress/package.json +1 -1
- package/template/config/cypress-ct/node_modules/.bin/cypress +4 -4
- package/template/config/cypress-ct/package.json +2 -2
- package/template/config/jsx/node_modules/.bin/vite +4 -4
- package/template/config/jsx/package.json +2 -2
- package/template/config/jsx/vite.config.js.data.mjs +15 -0
- package/template/config/nightwatch/.vscode/extensions.json +3 -0
- package/template/config/nightwatch/_gitignore +2 -0
- package/template/config/nightwatch/nightwatch/custom-assertions/elementHasCount.js +45 -0
- package/template/config/nightwatch/nightwatch/custom-assertions/elementHasCount.ts +43 -0
- package/template/config/nightwatch/nightwatch/custom-commands/strictClick.js +19 -0
- package/template/config/nightwatch/nightwatch/custom-commands/strictClick.ts +18 -0
- package/template/config/nightwatch/nightwatch/globals.js +23 -0
- package/template/config/nightwatch/nightwatch/nightwatch.d.ts +11 -0
- package/template/config/nightwatch/nightwatch.conf.js +152 -0
- package/template/config/nightwatch/node_modules/.bin/browserslist +17 -0
- package/template/config/nightwatch/node_modules/.bin/chromedriver +17 -0
- package/template/config/nightwatch/node_modules/.bin/geckodriver +17 -0
- package/template/config/nightwatch/node_modules/.bin/nightwatch +17 -0
- package/template/config/nightwatch/node_modules/.bin/ts-node +17 -0
- package/template/config/nightwatch/node_modules/.bin/ts-node-cwd +17 -0
- package/template/config/nightwatch/node_modules/.bin/ts-node-esm +17 -0
- package/template/config/nightwatch/node_modules/.bin/ts-node-script +17 -0
- package/template/config/nightwatch/node_modules/.bin/ts-node-transpile-only +17 -0
- package/template/config/nightwatch/node_modules/.bin/ts-script +17 -0
- package/template/config/nightwatch/node_modules/.bin/tsc +17 -0
- package/template/config/nightwatch/node_modules/.bin/tsserver +17 -0
- package/template/config/nightwatch/node_modules/.bin/vite +17 -0
- package/template/config/nightwatch/node_modules/.bin/wait-on +17 -0
- package/template/config/nightwatch/package.json +15 -0
- package/template/config/nightwatch/tests/e2e/example.js +14 -0
- package/template/config/nightwatch/vite.config.js.data.mjs +12 -0
- package/template/config/nightwatch-ct/nightwatch/index.html +16 -0
- package/template/config/nightwatch-ct/package.json +8 -0
- package/template/config/nightwatch-ct/src/components/__tests__/HelloWorld.spec.js +14 -0
- package/template/config/nightwatch-ct/vite.config.js.data.mjs +16 -0
- package/template/config/pinia/package.json +2 -2
- package/template/config/playwright/node_modules/.bin/playwright +4 -4
- package/template/config/playwright/package.json +1 -1
- package/template/config/router/package.json +2 -2
- package/template/config/typescript/node_modules/.bin/vue-tsc +4 -4
- package/template/config/typescript/package.json +2 -2
- package/template/config/vitest/node_modules/.bin/vitest +4 -4
- package/template/config/vitest/package.json +3 -3
- package/template/config/vitest/vitest.config.js +2 -2
- package/template/tsconfig/base/tsconfig.node.json +7 -1
- package/template/tsconfig/nightwatch/nightwatch/tsconfig.json +16 -0
- package/template/tsconfig/nightwatch/tsconfig.json +17 -0
- package/template/tsconfig/nightwatch-ct/tsconfig.app.json +12 -0
- package/template/tsconfig/nightwatch-ct/tsconfig.json +14 -0
- package/template/config/jsx/vite.config.js +0 -15
package/outfile.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! create-vue v3.
|
|
2
|
+
/*! create-vue v3.7.0 | MIT */
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -2643,6 +2643,725 @@ var require_lib = __commonJS({
|
|
|
2643
2643
|
}
|
|
2644
2644
|
});
|
|
2645
2645
|
|
|
2646
|
+
// node_modules/.pnpm/ejs@3.1.9/node_modules/ejs/lib/utils.js
|
|
2647
|
+
var require_utils = __commonJS({
|
|
2648
|
+
"node_modules/.pnpm/ejs@3.1.9/node_modules/ejs/lib/utils.js"(exports) {
|
|
2649
|
+
"use strict";
|
|
2650
|
+
var regExpChars = /[|\\{}()[\]^$+*?.]/g;
|
|
2651
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2652
|
+
var hasOwn = function(obj, key) {
|
|
2653
|
+
return hasOwnProperty.apply(obj, [key]);
|
|
2654
|
+
};
|
|
2655
|
+
exports.escapeRegExpChars = function(string) {
|
|
2656
|
+
if (!string) {
|
|
2657
|
+
return "";
|
|
2658
|
+
}
|
|
2659
|
+
return String(string).replace(regExpChars, "\\$&");
|
|
2660
|
+
};
|
|
2661
|
+
var _ENCODE_HTML_RULES = {
|
|
2662
|
+
"&": "&",
|
|
2663
|
+
"<": "<",
|
|
2664
|
+
">": ">",
|
|
2665
|
+
'"': """,
|
|
2666
|
+
"'": "'"
|
|
2667
|
+
};
|
|
2668
|
+
var _MATCH_HTML = /[&<>'"]/g;
|
|
2669
|
+
function encode_char(c) {
|
|
2670
|
+
return _ENCODE_HTML_RULES[c] || c;
|
|
2671
|
+
}
|
|
2672
|
+
var escapeFuncStr = `var _ENCODE_HTML_RULES = {
|
|
2673
|
+
"&": "&"
|
|
2674
|
+
, "<": "<"
|
|
2675
|
+
, ">": ">"
|
|
2676
|
+
, '"': """
|
|
2677
|
+
, "'": "'"
|
|
2678
|
+
}
|
|
2679
|
+
, _MATCH_HTML = /[&<>'"]/g;
|
|
2680
|
+
function encode_char(c) {
|
|
2681
|
+
return _ENCODE_HTML_RULES[c] || c;
|
|
2682
|
+
};
|
|
2683
|
+
`;
|
|
2684
|
+
exports.escapeXML = function(markup) {
|
|
2685
|
+
return markup == void 0 ? "" : String(markup).replace(_MATCH_HTML, encode_char);
|
|
2686
|
+
};
|
|
2687
|
+
function escapeXMLToString() {
|
|
2688
|
+
return Function.prototype.toString.call(this) + ";\n" + escapeFuncStr;
|
|
2689
|
+
}
|
|
2690
|
+
try {
|
|
2691
|
+
if (typeof Object.defineProperty === "function") {
|
|
2692
|
+
Object.defineProperty(exports.escapeXML, "toString", { value: escapeXMLToString });
|
|
2693
|
+
} else {
|
|
2694
|
+
exports.escapeXML.toString = escapeXMLToString;
|
|
2695
|
+
}
|
|
2696
|
+
} catch (err) {
|
|
2697
|
+
console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)");
|
|
2698
|
+
}
|
|
2699
|
+
exports.shallowCopy = function(to, from) {
|
|
2700
|
+
from = from || {};
|
|
2701
|
+
if (to !== null && to !== void 0) {
|
|
2702
|
+
for (var p in from) {
|
|
2703
|
+
if (!hasOwn(from, p)) {
|
|
2704
|
+
continue;
|
|
2705
|
+
}
|
|
2706
|
+
if (p === "__proto__" || p === "constructor") {
|
|
2707
|
+
continue;
|
|
2708
|
+
}
|
|
2709
|
+
to[p] = from[p];
|
|
2710
|
+
}
|
|
2711
|
+
}
|
|
2712
|
+
return to;
|
|
2713
|
+
};
|
|
2714
|
+
exports.shallowCopyFromList = function(to, from, list) {
|
|
2715
|
+
list = list || [];
|
|
2716
|
+
from = from || {};
|
|
2717
|
+
if (to !== null && to !== void 0) {
|
|
2718
|
+
for (var i = 0; i < list.length; i++) {
|
|
2719
|
+
var p = list[i];
|
|
2720
|
+
if (typeof from[p] != "undefined") {
|
|
2721
|
+
if (!hasOwn(from, p)) {
|
|
2722
|
+
continue;
|
|
2723
|
+
}
|
|
2724
|
+
if (p === "__proto__" || p === "constructor") {
|
|
2725
|
+
continue;
|
|
2726
|
+
}
|
|
2727
|
+
to[p] = from[p];
|
|
2728
|
+
}
|
|
2729
|
+
}
|
|
2730
|
+
}
|
|
2731
|
+
return to;
|
|
2732
|
+
};
|
|
2733
|
+
exports.cache = {
|
|
2734
|
+
_data: {},
|
|
2735
|
+
set: function(key, val) {
|
|
2736
|
+
this._data[key] = val;
|
|
2737
|
+
},
|
|
2738
|
+
get: function(key) {
|
|
2739
|
+
return this._data[key];
|
|
2740
|
+
},
|
|
2741
|
+
remove: function(key) {
|
|
2742
|
+
delete this._data[key];
|
|
2743
|
+
},
|
|
2744
|
+
reset: function() {
|
|
2745
|
+
this._data = {};
|
|
2746
|
+
}
|
|
2747
|
+
};
|
|
2748
|
+
exports.hyphenToCamel = function(str) {
|
|
2749
|
+
return str.replace(/-[a-z]/g, function(match) {
|
|
2750
|
+
return match[1].toUpperCase();
|
|
2751
|
+
});
|
|
2752
|
+
};
|
|
2753
|
+
exports.createNullProtoObjWherePossible = function() {
|
|
2754
|
+
if (typeof Object.create == "function") {
|
|
2755
|
+
return function() {
|
|
2756
|
+
return /* @__PURE__ */ Object.create(null);
|
|
2757
|
+
};
|
|
2758
|
+
}
|
|
2759
|
+
if (!({ __proto__: null } instanceof Object)) {
|
|
2760
|
+
return function() {
|
|
2761
|
+
return { __proto__: null };
|
|
2762
|
+
};
|
|
2763
|
+
}
|
|
2764
|
+
return function() {
|
|
2765
|
+
return {};
|
|
2766
|
+
};
|
|
2767
|
+
}();
|
|
2768
|
+
}
|
|
2769
|
+
});
|
|
2770
|
+
|
|
2771
|
+
// node_modules/.pnpm/ejs@3.1.9/node_modules/ejs/package.json
|
|
2772
|
+
var require_package = __commonJS({
|
|
2773
|
+
"node_modules/.pnpm/ejs@3.1.9/node_modules/ejs/package.json"(exports, module2) {
|
|
2774
|
+
module2.exports = {
|
|
2775
|
+
name: "ejs",
|
|
2776
|
+
description: "Embedded JavaScript templates",
|
|
2777
|
+
keywords: [
|
|
2778
|
+
"template",
|
|
2779
|
+
"engine",
|
|
2780
|
+
"ejs"
|
|
2781
|
+
],
|
|
2782
|
+
version: "3.1.9",
|
|
2783
|
+
author: "Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)",
|
|
2784
|
+
license: "Apache-2.0",
|
|
2785
|
+
bin: {
|
|
2786
|
+
ejs: "./bin/cli.js"
|
|
2787
|
+
},
|
|
2788
|
+
main: "./lib/ejs.js",
|
|
2789
|
+
jsdelivr: "ejs.min.js",
|
|
2790
|
+
unpkg: "ejs.min.js",
|
|
2791
|
+
repository: {
|
|
2792
|
+
type: "git",
|
|
2793
|
+
url: "git://github.com/mde/ejs.git"
|
|
2794
|
+
},
|
|
2795
|
+
bugs: "https://github.com/mde/ejs/issues",
|
|
2796
|
+
homepage: "https://github.com/mde/ejs",
|
|
2797
|
+
dependencies: {
|
|
2798
|
+
jake: "^10.8.5"
|
|
2799
|
+
},
|
|
2800
|
+
devDependencies: {
|
|
2801
|
+
browserify: "^16.5.1",
|
|
2802
|
+
eslint: "^6.8.0",
|
|
2803
|
+
"git-directory-deploy": "^1.5.1",
|
|
2804
|
+
jsdoc: "^4.0.2",
|
|
2805
|
+
"lru-cache": "^4.0.1",
|
|
2806
|
+
mocha: "^10.2.0",
|
|
2807
|
+
"uglify-js": "^3.3.16"
|
|
2808
|
+
},
|
|
2809
|
+
engines: {
|
|
2810
|
+
node: ">=0.10.0"
|
|
2811
|
+
},
|
|
2812
|
+
scripts: {
|
|
2813
|
+
test: "mocha -u tdd"
|
|
2814
|
+
}
|
|
2815
|
+
};
|
|
2816
|
+
}
|
|
2817
|
+
});
|
|
2818
|
+
|
|
2819
|
+
// node_modules/.pnpm/ejs@3.1.9/node_modules/ejs/lib/ejs.js
|
|
2820
|
+
var require_ejs = __commonJS({
|
|
2821
|
+
"node_modules/.pnpm/ejs@3.1.9/node_modules/ejs/lib/ejs.js"(exports) {
|
|
2822
|
+
"use strict";
|
|
2823
|
+
var fs5 = require("fs");
|
|
2824
|
+
var path5 = require("path");
|
|
2825
|
+
var utils = require_utils();
|
|
2826
|
+
var scopeOptionWarned = false;
|
|
2827
|
+
var _VERSION_STRING = require_package().version;
|
|
2828
|
+
var _DEFAULT_OPEN_DELIMITER = "<";
|
|
2829
|
+
var _DEFAULT_CLOSE_DELIMITER = ">";
|
|
2830
|
+
var _DEFAULT_DELIMITER = "%";
|
|
2831
|
+
var _DEFAULT_LOCALS_NAME = "locals";
|
|
2832
|
+
var _NAME = "ejs";
|
|
2833
|
+
var _REGEX_STRING = "(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)";
|
|
2834
|
+
var _OPTS_PASSABLE_WITH_DATA = [
|
|
2835
|
+
"delimiter",
|
|
2836
|
+
"scope",
|
|
2837
|
+
"context",
|
|
2838
|
+
"debug",
|
|
2839
|
+
"compileDebug",
|
|
2840
|
+
"client",
|
|
2841
|
+
"_with",
|
|
2842
|
+
"rmWhitespace",
|
|
2843
|
+
"strict",
|
|
2844
|
+
"filename",
|
|
2845
|
+
"async"
|
|
2846
|
+
];
|
|
2847
|
+
var _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat("cache");
|
|
2848
|
+
var _BOM = /^\uFEFF/;
|
|
2849
|
+
var _JS_IDENTIFIER = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
|
|
2850
|
+
exports.cache = utils.cache;
|
|
2851
|
+
exports.fileLoader = fs5.readFileSync;
|
|
2852
|
+
exports.localsName = _DEFAULT_LOCALS_NAME;
|
|
2853
|
+
exports.promiseImpl = new Function("return this;")().Promise;
|
|
2854
|
+
exports.resolveInclude = function(name, filename, isDir) {
|
|
2855
|
+
var dirname2 = path5.dirname;
|
|
2856
|
+
var extname = path5.extname;
|
|
2857
|
+
var resolve5 = path5.resolve;
|
|
2858
|
+
var includePath = resolve5(isDir ? filename : dirname2(filename), name);
|
|
2859
|
+
var ext = extname(name);
|
|
2860
|
+
if (!ext) {
|
|
2861
|
+
includePath += ".ejs";
|
|
2862
|
+
}
|
|
2863
|
+
return includePath;
|
|
2864
|
+
};
|
|
2865
|
+
function resolvePaths(name, paths) {
|
|
2866
|
+
var filePath;
|
|
2867
|
+
if (paths.some(function(v) {
|
|
2868
|
+
filePath = exports.resolveInclude(name, v, true);
|
|
2869
|
+
return fs5.existsSync(filePath);
|
|
2870
|
+
})) {
|
|
2871
|
+
return filePath;
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
function getIncludePath(path6, options2) {
|
|
2875
|
+
var includePath;
|
|
2876
|
+
var filePath;
|
|
2877
|
+
var views = options2.views;
|
|
2878
|
+
var match = /^[A-Za-z]+:\\|^\//.exec(path6);
|
|
2879
|
+
if (match && match.length) {
|
|
2880
|
+
path6 = path6.replace(/^\/*/, "");
|
|
2881
|
+
if (Array.isArray(options2.root)) {
|
|
2882
|
+
includePath = resolvePaths(path6, options2.root);
|
|
2883
|
+
} else {
|
|
2884
|
+
includePath = exports.resolveInclude(path6, options2.root || "/", true);
|
|
2885
|
+
}
|
|
2886
|
+
} else {
|
|
2887
|
+
if (options2.filename) {
|
|
2888
|
+
filePath = exports.resolveInclude(path6, options2.filename);
|
|
2889
|
+
if (fs5.existsSync(filePath)) {
|
|
2890
|
+
includePath = filePath;
|
|
2891
|
+
}
|
|
2892
|
+
}
|
|
2893
|
+
if (!includePath && Array.isArray(views)) {
|
|
2894
|
+
includePath = resolvePaths(path6, views);
|
|
2895
|
+
}
|
|
2896
|
+
if (!includePath && typeof options2.includer !== "function") {
|
|
2897
|
+
throw new Error('Could not find the include file "' + options2.escapeFunction(path6) + '"');
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
return includePath;
|
|
2901
|
+
}
|
|
2902
|
+
function handleCache(options2, template) {
|
|
2903
|
+
var func;
|
|
2904
|
+
var filename = options2.filename;
|
|
2905
|
+
var hasTemplate = arguments.length > 1;
|
|
2906
|
+
if (options2.cache) {
|
|
2907
|
+
if (!filename) {
|
|
2908
|
+
throw new Error("cache option requires a filename");
|
|
2909
|
+
}
|
|
2910
|
+
func = exports.cache.get(filename);
|
|
2911
|
+
if (func) {
|
|
2912
|
+
return func;
|
|
2913
|
+
}
|
|
2914
|
+
if (!hasTemplate) {
|
|
2915
|
+
template = fileLoader(filename).toString().replace(_BOM, "");
|
|
2916
|
+
}
|
|
2917
|
+
} else if (!hasTemplate) {
|
|
2918
|
+
if (!filename) {
|
|
2919
|
+
throw new Error("Internal EJS error: no file name or template provided");
|
|
2920
|
+
}
|
|
2921
|
+
template = fileLoader(filename).toString().replace(_BOM, "");
|
|
2922
|
+
}
|
|
2923
|
+
func = exports.compile(template, options2);
|
|
2924
|
+
if (options2.cache) {
|
|
2925
|
+
exports.cache.set(filename, func);
|
|
2926
|
+
}
|
|
2927
|
+
return func;
|
|
2928
|
+
}
|
|
2929
|
+
function tryHandleCache(options2, data, cb) {
|
|
2930
|
+
var result;
|
|
2931
|
+
if (!cb) {
|
|
2932
|
+
if (typeof exports.promiseImpl == "function") {
|
|
2933
|
+
return new exports.promiseImpl(function(resolve5, reject) {
|
|
2934
|
+
try {
|
|
2935
|
+
result = handleCache(options2)(data);
|
|
2936
|
+
resolve5(result);
|
|
2937
|
+
} catch (err) {
|
|
2938
|
+
reject(err);
|
|
2939
|
+
}
|
|
2940
|
+
});
|
|
2941
|
+
} else {
|
|
2942
|
+
throw new Error("Please provide a callback function");
|
|
2943
|
+
}
|
|
2944
|
+
} else {
|
|
2945
|
+
try {
|
|
2946
|
+
result = handleCache(options2)(data);
|
|
2947
|
+
} catch (err) {
|
|
2948
|
+
return cb(err);
|
|
2949
|
+
}
|
|
2950
|
+
cb(null, result);
|
|
2951
|
+
}
|
|
2952
|
+
}
|
|
2953
|
+
function fileLoader(filePath) {
|
|
2954
|
+
return exports.fileLoader(filePath);
|
|
2955
|
+
}
|
|
2956
|
+
function includeFile(path6, options2) {
|
|
2957
|
+
var opts = utils.shallowCopy(utils.createNullProtoObjWherePossible(), options2);
|
|
2958
|
+
opts.filename = getIncludePath(path6, opts);
|
|
2959
|
+
if (typeof options2.includer === "function") {
|
|
2960
|
+
var includerResult = options2.includer(path6, opts.filename);
|
|
2961
|
+
if (includerResult) {
|
|
2962
|
+
if (includerResult.filename) {
|
|
2963
|
+
opts.filename = includerResult.filename;
|
|
2964
|
+
}
|
|
2965
|
+
if (includerResult.template) {
|
|
2966
|
+
return handleCache(opts, includerResult.template);
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2969
|
+
}
|
|
2970
|
+
return handleCache(opts);
|
|
2971
|
+
}
|
|
2972
|
+
function rethrow(err, str, flnm, lineno, esc) {
|
|
2973
|
+
var lines = str.split("\n");
|
|
2974
|
+
var start = Math.max(lineno - 3, 0);
|
|
2975
|
+
var end = Math.min(lines.length, lineno + 3);
|
|
2976
|
+
var filename = esc(flnm);
|
|
2977
|
+
var context = lines.slice(start, end).map(function(line, i) {
|
|
2978
|
+
var curr = i + start + 1;
|
|
2979
|
+
return (curr == lineno ? " >> " : " ") + curr + "| " + line;
|
|
2980
|
+
}).join("\n");
|
|
2981
|
+
err.path = filename;
|
|
2982
|
+
err.message = (filename || "ejs") + ":" + lineno + "\n" + context + "\n\n" + err.message;
|
|
2983
|
+
throw err;
|
|
2984
|
+
}
|
|
2985
|
+
function stripSemi(str) {
|
|
2986
|
+
return str.replace(/;(\s*$)/, "$1");
|
|
2987
|
+
}
|
|
2988
|
+
exports.compile = function compile(template, opts) {
|
|
2989
|
+
var templ;
|
|
2990
|
+
if (opts && opts.scope) {
|
|
2991
|
+
if (!scopeOptionWarned) {
|
|
2992
|
+
console.warn("`scope` option is deprecated and will be removed in EJS 3");
|
|
2993
|
+
scopeOptionWarned = true;
|
|
2994
|
+
}
|
|
2995
|
+
if (!opts.context) {
|
|
2996
|
+
opts.context = opts.scope;
|
|
2997
|
+
}
|
|
2998
|
+
delete opts.scope;
|
|
2999
|
+
}
|
|
3000
|
+
templ = new Template(template, opts);
|
|
3001
|
+
return templ.compile();
|
|
3002
|
+
};
|
|
3003
|
+
exports.render = function(template, d, o) {
|
|
3004
|
+
var data = d || utils.createNullProtoObjWherePossible();
|
|
3005
|
+
var opts = o || utils.createNullProtoObjWherePossible();
|
|
3006
|
+
if (arguments.length == 2) {
|
|
3007
|
+
utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA);
|
|
3008
|
+
}
|
|
3009
|
+
return handleCache(opts, template)(data);
|
|
3010
|
+
};
|
|
3011
|
+
exports.renderFile = function() {
|
|
3012
|
+
var args = Array.prototype.slice.call(arguments);
|
|
3013
|
+
var filename = args.shift();
|
|
3014
|
+
var cb;
|
|
3015
|
+
var opts = { filename };
|
|
3016
|
+
var data;
|
|
3017
|
+
var viewOpts;
|
|
3018
|
+
if (typeof arguments[arguments.length - 1] == "function") {
|
|
3019
|
+
cb = args.pop();
|
|
3020
|
+
}
|
|
3021
|
+
if (args.length) {
|
|
3022
|
+
data = args.shift();
|
|
3023
|
+
if (args.length) {
|
|
3024
|
+
utils.shallowCopy(opts, args.pop());
|
|
3025
|
+
} else {
|
|
3026
|
+
if (data.settings) {
|
|
3027
|
+
if (data.settings.views) {
|
|
3028
|
+
opts.views = data.settings.views;
|
|
3029
|
+
}
|
|
3030
|
+
if (data.settings["view cache"]) {
|
|
3031
|
+
opts.cache = true;
|
|
3032
|
+
}
|
|
3033
|
+
viewOpts = data.settings["view options"];
|
|
3034
|
+
if (viewOpts) {
|
|
3035
|
+
utils.shallowCopy(opts, viewOpts);
|
|
3036
|
+
}
|
|
3037
|
+
}
|
|
3038
|
+
utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA_EXPRESS);
|
|
3039
|
+
}
|
|
3040
|
+
opts.filename = filename;
|
|
3041
|
+
} else {
|
|
3042
|
+
data = utils.createNullProtoObjWherePossible();
|
|
3043
|
+
}
|
|
3044
|
+
return tryHandleCache(opts, data, cb);
|
|
3045
|
+
};
|
|
3046
|
+
exports.Template = Template;
|
|
3047
|
+
exports.clearCache = function() {
|
|
3048
|
+
exports.cache.reset();
|
|
3049
|
+
};
|
|
3050
|
+
function Template(text, opts) {
|
|
3051
|
+
opts = opts || utils.createNullProtoObjWherePossible();
|
|
3052
|
+
var options2 = utils.createNullProtoObjWherePossible();
|
|
3053
|
+
this.templateText = text;
|
|
3054
|
+
this.mode = null;
|
|
3055
|
+
this.truncate = false;
|
|
3056
|
+
this.currentLine = 1;
|
|
3057
|
+
this.source = "";
|
|
3058
|
+
options2.client = opts.client || false;
|
|
3059
|
+
options2.escapeFunction = opts.escape || opts.escapeFunction || utils.escapeXML;
|
|
3060
|
+
options2.compileDebug = opts.compileDebug !== false;
|
|
3061
|
+
options2.debug = !!opts.debug;
|
|
3062
|
+
options2.filename = opts.filename;
|
|
3063
|
+
options2.openDelimiter = opts.openDelimiter || exports.openDelimiter || _DEFAULT_OPEN_DELIMITER;
|
|
3064
|
+
options2.closeDelimiter = opts.closeDelimiter || exports.closeDelimiter || _DEFAULT_CLOSE_DELIMITER;
|
|
3065
|
+
options2.delimiter = opts.delimiter || exports.delimiter || _DEFAULT_DELIMITER;
|
|
3066
|
+
options2.strict = opts.strict || false;
|
|
3067
|
+
options2.context = opts.context;
|
|
3068
|
+
options2.cache = opts.cache || false;
|
|
3069
|
+
options2.rmWhitespace = opts.rmWhitespace;
|
|
3070
|
+
options2.root = opts.root;
|
|
3071
|
+
options2.includer = opts.includer;
|
|
3072
|
+
options2.outputFunctionName = opts.outputFunctionName;
|
|
3073
|
+
options2.localsName = opts.localsName || exports.localsName || _DEFAULT_LOCALS_NAME;
|
|
3074
|
+
options2.views = opts.views;
|
|
3075
|
+
options2.async = opts.async;
|
|
3076
|
+
options2.destructuredLocals = opts.destructuredLocals;
|
|
3077
|
+
options2.legacyInclude = typeof opts.legacyInclude != "undefined" ? !!opts.legacyInclude : true;
|
|
3078
|
+
if (options2.strict) {
|
|
3079
|
+
options2._with = false;
|
|
3080
|
+
} else {
|
|
3081
|
+
options2._with = typeof opts._with != "undefined" ? opts._with : true;
|
|
3082
|
+
}
|
|
3083
|
+
this.opts = options2;
|
|
3084
|
+
this.regex = this.createRegex();
|
|
3085
|
+
}
|
|
3086
|
+
Template.modes = {
|
|
3087
|
+
EVAL: "eval",
|
|
3088
|
+
ESCAPED: "escaped",
|
|
3089
|
+
RAW: "raw",
|
|
3090
|
+
COMMENT: "comment",
|
|
3091
|
+
LITERAL: "literal"
|
|
3092
|
+
};
|
|
3093
|
+
Template.prototype = {
|
|
3094
|
+
createRegex: function() {
|
|
3095
|
+
var str = _REGEX_STRING;
|
|
3096
|
+
var delim = utils.escapeRegExpChars(this.opts.delimiter);
|
|
3097
|
+
var open = utils.escapeRegExpChars(this.opts.openDelimiter);
|
|
3098
|
+
var close = utils.escapeRegExpChars(this.opts.closeDelimiter);
|
|
3099
|
+
str = str.replace(/%/g, delim).replace(/</g, open).replace(/>/g, close);
|
|
3100
|
+
return new RegExp(str);
|
|
3101
|
+
},
|
|
3102
|
+
compile: function() {
|
|
3103
|
+
var src;
|
|
3104
|
+
var fn;
|
|
3105
|
+
var opts = this.opts;
|
|
3106
|
+
var prepended = "";
|
|
3107
|
+
var appended = "";
|
|
3108
|
+
var escapeFn = opts.escapeFunction;
|
|
3109
|
+
var ctor;
|
|
3110
|
+
var sanitizedFilename = opts.filename ? JSON.stringify(opts.filename) : "undefined";
|
|
3111
|
+
if (!this.source) {
|
|
3112
|
+
this.generateSource();
|
|
3113
|
+
prepended += ' var __output = "";\n function __append(s) { if (s !== undefined && s !== null) __output += s }\n';
|
|
3114
|
+
if (opts.outputFunctionName) {
|
|
3115
|
+
if (!_JS_IDENTIFIER.test(opts.outputFunctionName)) {
|
|
3116
|
+
throw new Error("outputFunctionName is not a valid JS identifier.");
|
|
3117
|
+
}
|
|
3118
|
+
prepended += " var " + opts.outputFunctionName + " = __append;\n";
|
|
3119
|
+
}
|
|
3120
|
+
if (opts.localsName && !_JS_IDENTIFIER.test(opts.localsName)) {
|
|
3121
|
+
throw new Error("localsName is not a valid JS identifier.");
|
|
3122
|
+
}
|
|
3123
|
+
if (opts.destructuredLocals && opts.destructuredLocals.length) {
|
|
3124
|
+
var destructuring = " var __locals = (" + opts.localsName + " || {}),\n";
|
|
3125
|
+
for (var i = 0; i < opts.destructuredLocals.length; i++) {
|
|
3126
|
+
var name = opts.destructuredLocals[i];
|
|
3127
|
+
if (!_JS_IDENTIFIER.test(name)) {
|
|
3128
|
+
throw new Error("destructuredLocals[" + i + "] is not a valid JS identifier.");
|
|
3129
|
+
}
|
|
3130
|
+
if (i > 0) {
|
|
3131
|
+
destructuring += ",\n ";
|
|
3132
|
+
}
|
|
3133
|
+
destructuring += name + " = __locals." + name;
|
|
3134
|
+
}
|
|
3135
|
+
prepended += destructuring + ";\n";
|
|
3136
|
+
}
|
|
3137
|
+
if (opts._with !== false) {
|
|
3138
|
+
prepended += " with (" + opts.localsName + " || {}) {\n";
|
|
3139
|
+
appended += " }\n";
|
|
3140
|
+
}
|
|
3141
|
+
appended += " return __output;\n";
|
|
3142
|
+
this.source = prepended + this.source + appended;
|
|
3143
|
+
}
|
|
3144
|
+
if (opts.compileDebug) {
|
|
3145
|
+
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";
|
|
3146
|
+
} else {
|
|
3147
|
+
src = this.source;
|
|
3148
|
+
}
|
|
3149
|
+
if (opts.client) {
|
|
3150
|
+
src = "escapeFn = escapeFn || " + escapeFn.toString() + ";\n" + src;
|
|
3151
|
+
if (opts.compileDebug) {
|
|
3152
|
+
src = "rethrow = rethrow || " + rethrow.toString() + ";\n" + src;
|
|
3153
|
+
}
|
|
3154
|
+
}
|
|
3155
|
+
if (opts.strict) {
|
|
3156
|
+
src = '"use strict";\n' + src;
|
|
3157
|
+
}
|
|
3158
|
+
if (opts.debug) {
|
|
3159
|
+
console.log(src);
|
|
3160
|
+
}
|
|
3161
|
+
if (opts.compileDebug && opts.filename) {
|
|
3162
|
+
src = src + "\n//# sourceURL=" + sanitizedFilename + "\n";
|
|
3163
|
+
}
|
|
3164
|
+
try {
|
|
3165
|
+
if (opts.async) {
|
|
3166
|
+
try {
|
|
3167
|
+
ctor = new Function("return (async function(){}).constructor;")();
|
|
3168
|
+
} catch (e) {
|
|
3169
|
+
if (e instanceof SyntaxError) {
|
|
3170
|
+
throw new Error("This environment does not support async/await");
|
|
3171
|
+
} else {
|
|
3172
|
+
throw e;
|
|
3173
|
+
}
|
|
3174
|
+
}
|
|
3175
|
+
} else {
|
|
3176
|
+
ctor = Function;
|
|
3177
|
+
}
|
|
3178
|
+
fn = new ctor(opts.localsName + ", escapeFn, include, rethrow", src);
|
|
3179
|
+
} catch (e) {
|
|
3180
|
+
if (e instanceof SyntaxError) {
|
|
3181
|
+
if (opts.filename) {
|
|
3182
|
+
e.message += " in " + opts.filename;
|
|
3183
|
+
}
|
|
3184
|
+
e.message += " while compiling ejs\n\n";
|
|
3185
|
+
e.message += "If the above error is not helpful, you may want to try EJS-Lint:\n";
|
|
3186
|
+
e.message += "https://github.com/RyanZim/EJS-Lint";
|
|
3187
|
+
if (!opts.async) {
|
|
3188
|
+
e.message += "\n";
|
|
3189
|
+
e.message += "Or, if you meant to create an async function, pass `async: true` as an option.";
|
|
3190
|
+
}
|
|
3191
|
+
}
|
|
3192
|
+
throw e;
|
|
3193
|
+
}
|
|
3194
|
+
var returnedFn = opts.client ? fn : function anonymous(data) {
|
|
3195
|
+
var include = function(path6, includeData) {
|
|
3196
|
+
var d = utils.shallowCopy(utils.createNullProtoObjWherePossible(), data);
|
|
3197
|
+
if (includeData) {
|
|
3198
|
+
d = utils.shallowCopy(d, includeData);
|
|
3199
|
+
}
|
|
3200
|
+
return includeFile(path6, opts)(d);
|
|
3201
|
+
};
|
|
3202
|
+
return fn.apply(
|
|
3203
|
+
opts.context,
|
|
3204
|
+
[data || utils.createNullProtoObjWherePossible(), escapeFn, include, rethrow]
|
|
3205
|
+
);
|
|
3206
|
+
};
|
|
3207
|
+
if (opts.filename && typeof Object.defineProperty === "function") {
|
|
3208
|
+
var filename = opts.filename;
|
|
3209
|
+
var basename3 = path5.basename(filename, path5.extname(filename));
|
|
3210
|
+
try {
|
|
3211
|
+
Object.defineProperty(returnedFn, "name", {
|
|
3212
|
+
value: basename3,
|
|
3213
|
+
writable: false,
|
|
3214
|
+
enumerable: false,
|
|
3215
|
+
configurable: true
|
|
3216
|
+
});
|
|
3217
|
+
} catch (e) {
|
|
3218
|
+
}
|
|
3219
|
+
}
|
|
3220
|
+
return returnedFn;
|
|
3221
|
+
},
|
|
3222
|
+
generateSource: function() {
|
|
3223
|
+
var opts = this.opts;
|
|
3224
|
+
if (opts.rmWhitespace) {
|
|
3225
|
+
this.templateText = this.templateText.replace(/[\r\n]+/g, "\n").replace(/^\s+|\s+$/gm, "");
|
|
3226
|
+
}
|
|
3227
|
+
this.templateText = this.templateText.replace(/[ \t]*<%_/gm, "<%_").replace(/_%>[ \t]*/gm, "_%>");
|
|
3228
|
+
var self2 = this;
|
|
3229
|
+
var matches = this.parseTemplateText();
|
|
3230
|
+
var d = this.opts.delimiter;
|
|
3231
|
+
var o = this.opts.openDelimiter;
|
|
3232
|
+
var c = this.opts.closeDelimiter;
|
|
3233
|
+
if (matches && matches.length) {
|
|
3234
|
+
matches.forEach(function(line, index) {
|
|
3235
|
+
var closing;
|
|
3236
|
+
if (line.indexOf(o + d) === 0 && line.indexOf(o + d + d) !== 0) {
|
|
3237
|
+
closing = matches[index + 2];
|
|
3238
|
+
if (!(closing == d + c || closing == "-" + d + c || closing == "_" + d + c)) {
|
|
3239
|
+
throw new Error('Could not find matching close tag for "' + line + '".');
|
|
3240
|
+
}
|
|
3241
|
+
}
|
|
3242
|
+
self2.scanLine(line);
|
|
3243
|
+
});
|
|
3244
|
+
}
|
|
3245
|
+
},
|
|
3246
|
+
parseTemplateText: function() {
|
|
3247
|
+
var str = this.templateText;
|
|
3248
|
+
var pat = this.regex;
|
|
3249
|
+
var result = pat.exec(str);
|
|
3250
|
+
var arr = [];
|
|
3251
|
+
var firstPos;
|
|
3252
|
+
while (result) {
|
|
3253
|
+
firstPos = result.index;
|
|
3254
|
+
if (firstPos !== 0) {
|
|
3255
|
+
arr.push(str.substring(0, firstPos));
|
|
3256
|
+
str = str.slice(firstPos);
|
|
3257
|
+
}
|
|
3258
|
+
arr.push(result[0]);
|
|
3259
|
+
str = str.slice(result[0].length);
|
|
3260
|
+
result = pat.exec(str);
|
|
3261
|
+
}
|
|
3262
|
+
if (str) {
|
|
3263
|
+
arr.push(str);
|
|
3264
|
+
}
|
|
3265
|
+
return arr;
|
|
3266
|
+
},
|
|
3267
|
+
_addOutput: function(line) {
|
|
3268
|
+
if (this.truncate) {
|
|
3269
|
+
line = line.replace(/^(?:\r\n|\r|\n)/, "");
|
|
3270
|
+
this.truncate = false;
|
|
3271
|
+
}
|
|
3272
|
+
if (!line) {
|
|
3273
|
+
return line;
|
|
3274
|
+
}
|
|
3275
|
+
line = line.replace(/\\/g, "\\\\");
|
|
3276
|
+
line = line.replace(/\n/g, "\\n");
|
|
3277
|
+
line = line.replace(/\r/g, "\\r");
|
|
3278
|
+
line = line.replace(/"/g, '\\"');
|
|
3279
|
+
this.source += ' ; __append("' + line + '")\n';
|
|
3280
|
+
},
|
|
3281
|
+
scanLine: function(line) {
|
|
3282
|
+
var self2 = this;
|
|
3283
|
+
var d = this.opts.delimiter;
|
|
3284
|
+
var o = this.opts.openDelimiter;
|
|
3285
|
+
var c = this.opts.closeDelimiter;
|
|
3286
|
+
var newLineCount = 0;
|
|
3287
|
+
newLineCount = line.split("\n").length - 1;
|
|
3288
|
+
switch (line) {
|
|
3289
|
+
case o + d:
|
|
3290
|
+
case o + d + "_":
|
|
3291
|
+
this.mode = Template.modes.EVAL;
|
|
3292
|
+
break;
|
|
3293
|
+
case o + d + "=":
|
|
3294
|
+
this.mode = Template.modes.ESCAPED;
|
|
3295
|
+
break;
|
|
3296
|
+
case o + d + "-":
|
|
3297
|
+
this.mode = Template.modes.RAW;
|
|
3298
|
+
break;
|
|
3299
|
+
case o + d + "#":
|
|
3300
|
+
this.mode = Template.modes.COMMENT;
|
|
3301
|
+
break;
|
|
3302
|
+
case o + d + d:
|
|
3303
|
+
this.mode = Template.modes.LITERAL;
|
|
3304
|
+
this.source += ' ; __append("' + line.replace(o + d + d, o + d) + '")\n';
|
|
3305
|
+
break;
|
|
3306
|
+
case d + d + c:
|
|
3307
|
+
this.mode = Template.modes.LITERAL;
|
|
3308
|
+
this.source += ' ; __append("' + line.replace(d + d + c, d + c) + '")\n';
|
|
3309
|
+
break;
|
|
3310
|
+
case d + c:
|
|
3311
|
+
case "-" + d + c:
|
|
3312
|
+
case "_" + d + c:
|
|
3313
|
+
if (this.mode == Template.modes.LITERAL) {
|
|
3314
|
+
this._addOutput(line);
|
|
3315
|
+
}
|
|
3316
|
+
this.mode = null;
|
|
3317
|
+
this.truncate = line.indexOf("-") === 0 || line.indexOf("_") === 0;
|
|
3318
|
+
break;
|
|
3319
|
+
default:
|
|
3320
|
+
if (this.mode) {
|
|
3321
|
+
switch (this.mode) {
|
|
3322
|
+
case Template.modes.EVAL:
|
|
3323
|
+
case Template.modes.ESCAPED:
|
|
3324
|
+
case Template.modes.RAW:
|
|
3325
|
+
if (line.lastIndexOf("//") > line.lastIndexOf("\n")) {
|
|
3326
|
+
line += "\n";
|
|
3327
|
+
}
|
|
3328
|
+
}
|
|
3329
|
+
switch (this.mode) {
|
|
3330
|
+
case Template.modes.EVAL:
|
|
3331
|
+
this.source += " ; " + line + "\n";
|
|
3332
|
+
break;
|
|
3333
|
+
case Template.modes.ESCAPED:
|
|
3334
|
+
this.source += " ; __append(escapeFn(" + stripSemi(line) + "))\n";
|
|
3335
|
+
break;
|
|
3336
|
+
case Template.modes.RAW:
|
|
3337
|
+
this.source += " ; __append(" + stripSemi(line) + ")\n";
|
|
3338
|
+
break;
|
|
3339
|
+
case Template.modes.COMMENT:
|
|
3340
|
+
break;
|
|
3341
|
+
case Template.modes.LITERAL:
|
|
3342
|
+
this._addOutput(line);
|
|
3343
|
+
break;
|
|
3344
|
+
}
|
|
3345
|
+
} else {
|
|
3346
|
+
this._addOutput(line);
|
|
3347
|
+
}
|
|
3348
|
+
}
|
|
3349
|
+
if (self2.opts.compileDebug && newLineCount) {
|
|
3350
|
+
this.currentLine += newLineCount;
|
|
3351
|
+
this.source += " ; __line = " + this.currentLine + "\n";
|
|
3352
|
+
}
|
|
3353
|
+
}
|
|
3354
|
+
};
|
|
3355
|
+
exports.escapeXML = utils.escapeXML;
|
|
3356
|
+
exports.__express = exports.renderFile;
|
|
3357
|
+
exports.VERSION = _VERSION_STRING;
|
|
3358
|
+
exports.name = _NAME;
|
|
3359
|
+
if (typeof window != "undefined") {
|
|
3360
|
+
window.ejs = exports;
|
|
3361
|
+
}
|
|
3362
|
+
}
|
|
3363
|
+
});
|
|
3364
|
+
|
|
2646
3365
|
// node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js
|
|
2647
3366
|
var require_quote = __commonJS({
|
|
2648
3367
|
"node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js"(exports) {
|
|
@@ -3166,7 +3885,7 @@ var require_dist = __commonJS({
|
|
|
3166
3885
|
});
|
|
3167
3886
|
|
|
3168
3887
|
// node_modules/.pnpm/@vue+create-eslint-config@0.2.1/node_modules/@vue/create-eslint-config/package.json
|
|
3169
|
-
var
|
|
3888
|
+
var require_package2 = __commonJS({
|
|
3170
3889
|
"node_modules/.pnpm/@vue+create-eslint-config@0.2.1/node_modules/@vue/create-eslint-config/package.json"(exports, module2) {
|
|
3171
3890
|
module2.exports = {
|
|
3172
3891
|
name: "@vue/create-eslint-config",
|
|
@@ -3227,7 +3946,7 @@ var require_package = __commonJS({
|
|
|
3227
3946
|
// node_modules/.pnpm/@vue+create-eslint-config@0.2.1/node_modules/@vue/create-eslint-config/versionMap.cjs
|
|
3228
3947
|
var require_versionMap = __commonJS({
|
|
3229
3948
|
"node_modules/.pnpm/@vue+create-eslint-config@0.2.1/node_modules/@vue/create-eslint-config/versionMap.cjs"(exports, module2) {
|
|
3230
|
-
module2.exports =
|
|
3949
|
+
module2.exports = require_package2().devDependencies;
|
|
3231
3950
|
}
|
|
3232
3951
|
});
|
|
3233
3952
|
|
|
@@ -3329,6 +4048,9 @@ var bgLightMagenta = kolorist(105, 49);
|
|
|
3329
4048
|
var bgLightCyan = kolorist(106, 49);
|
|
3330
4049
|
var bgLightGray = kolorist(47, 49);
|
|
3331
4050
|
|
|
4051
|
+
// index.ts
|
|
4052
|
+
var import_ejs = __toESM(require_ejs(), 1);
|
|
4053
|
+
|
|
3332
4054
|
// utils/banners.ts
|
|
3333
4055
|
var defaultBanner = "Vue.js - The Progressive JavaScript Framework";
|
|
3334
4056
|
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";
|
|
@@ -3336,6 +4058,7 @@ var gradientBanner = "\x1B[38;2;66;211;146mV\x1B[39m\x1B[38;2;66;211;146mu\x1B[3
|
|
|
3336
4058
|
// utils/renderTemplate.ts
|
|
3337
4059
|
var fs = __toESM(require("fs"), 1);
|
|
3338
4060
|
var path = __toESM(require("path"), 1);
|
|
4061
|
+
var import_node_url = require("url");
|
|
3339
4062
|
|
|
3340
4063
|
// utils/deepMerge.ts
|
|
3341
4064
|
var isObject = (val) => val && typeof val === "object";
|
|
@@ -3375,7 +4098,7 @@ function sortDependencies(packageJson) {
|
|
|
3375
4098
|
}
|
|
3376
4099
|
|
|
3377
4100
|
// utils/renderTemplate.ts
|
|
3378
|
-
function renderTemplate(src, dest) {
|
|
4101
|
+
function renderTemplate(src, dest, callbacks) {
|
|
3379
4102
|
const stats = fs.statSync(src);
|
|
3380
4103
|
if (stats.isDirectory()) {
|
|
3381
4104
|
if (path.basename(src) === "node_modules") {
|
|
@@ -3383,7 +4106,7 @@ function renderTemplate(src, dest) {
|
|
|
3383
4106
|
}
|
|
3384
4107
|
fs.mkdirSync(dest, { recursive: true });
|
|
3385
4108
|
for (const file of fs.readdirSync(src)) {
|
|
3386
|
-
renderTemplate(path.resolve(src, file), path.resolve(dest, file));
|
|
4109
|
+
renderTemplate(path.resolve(src, file), path.resolve(dest, file), callbacks);
|
|
3387
4110
|
}
|
|
3388
4111
|
return;
|
|
3389
4112
|
}
|
|
@@ -3411,6 +4134,16 @@ function renderTemplate(src, dest) {
|
|
|
3411
4134
|
fs.writeFileSync(dest, existing + "\n" + newGitignore);
|
|
3412
4135
|
return;
|
|
3413
4136
|
}
|
|
4137
|
+
if (filename.endsWith(".data.mjs")) {
|
|
4138
|
+
dest = dest.replace(/\.data\.mjs$/, "");
|
|
4139
|
+
callbacks.push(async (dataStore) => {
|
|
4140
|
+
const getData = (await import((0, import_node_url.pathToFileURL)(src).toString())).default;
|
|
4141
|
+
dataStore[dest] = await getData({
|
|
4142
|
+
oldData: dataStore[dest] || {}
|
|
4143
|
+
});
|
|
4144
|
+
});
|
|
4145
|
+
return;
|
|
4146
|
+
}
|
|
3414
4147
|
fs.copyFileSync(src, dest);
|
|
3415
4148
|
}
|
|
3416
4149
|
var renderTemplate_default = renderTemplate;
|
|
@@ -3481,7 +4214,9 @@ function generateReadme({
|
|
|
3481
4214
|
packageManager,
|
|
3482
4215
|
needsTypeScript,
|
|
3483
4216
|
needsCypress,
|
|
4217
|
+
needsNightwatch,
|
|
3484
4218
|
needsCypressCT,
|
|
4219
|
+
needsNightwatchCT,
|
|
3485
4220
|
needsPlaywright,
|
|
3486
4221
|
needsVitest,
|
|
3487
4222
|
needsEslint
|
|
@@ -3553,6 +4288,35 @@ But it's still recommended to test the production build with \`test:e2e\` before
|
|
|
3553
4288
|
${commandFor("build")}
|
|
3554
4289
|
${commandFor("test:e2e")}
|
|
3555
4290
|
\`\`\`
|
|
4291
|
+
`;
|
|
4292
|
+
}
|
|
4293
|
+
if (needsNightwatch) {
|
|
4294
|
+
npmScriptsDescriptions += `
|
|
4295
|
+
### Run End-to-End Tests with [Nightwatch](https://nightwatchjs.org/)
|
|
4296
|
+
|
|
4297
|
+
\`\`\`sh
|
|
4298
|
+
# When using CI, the project must be built first.
|
|
4299
|
+
${commandFor("build")}
|
|
4300
|
+
|
|
4301
|
+
# Runs the end-to-end tests
|
|
4302
|
+
${commandFor("test:e2e")}
|
|
4303
|
+
# Runs the tests only on Chrome
|
|
4304
|
+
${commandFor("test:e2e", "--env chrome")}
|
|
4305
|
+
# Runs the tests of a specific file
|
|
4306
|
+
${commandFor("test:e2e", `tests/e2e/example.${needsTypeScript ? "ts" : "js"}`)}
|
|
4307
|
+
# Runs the tests in debug mode
|
|
4308
|
+
${commandFor("test:e2e", "--debug")}
|
|
4309
|
+
\`\`\`
|
|
4310
|
+
`;
|
|
4311
|
+
}
|
|
4312
|
+
if (needsNightwatch) {
|
|
4313
|
+
npmScriptsDescriptions += `
|
|
4314
|
+
### Run Headed Component Tests with [Nightwatch Component Testing](https://nightwatchjs.org/guide/component-testing/introduction.html)
|
|
4315
|
+
|
|
4316
|
+
\`\`\`sh
|
|
4317
|
+
${commandFor("test:unit")}
|
|
4318
|
+
${commandFor("test:unit -- --headless # for headless testing")}
|
|
4319
|
+
\`\`\`
|
|
3556
4320
|
`;
|
|
3557
4321
|
}
|
|
3558
4322
|
if (needsPlaywright) {
|
|
@@ -3842,6 +4606,13 @@ function renderEslint(rootDir, { needsTypeScript, needsCypress, needsCypressCT,
|
|
|
3842
4606
|
}
|
|
3843
4607
|
}
|
|
3844
4608
|
|
|
4609
|
+
// utils/filterList.ts
|
|
4610
|
+
var FILES_TO_FILTER = [
|
|
4611
|
+
"nightwatch.e2e.conf.js",
|
|
4612
|
+
"nightwatch.component.conf.js",
|
|
4613
|
+
"globals.js"
|
|
4614
|
+
];
|
|
4615
|
+
|
|
3845
4616
|
// index.ts
|
|
3846
4617
|
function isValidPackageName(projectName) {
|
|
3847
4618
|
return /^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(projectName);
|
|
@@ -3889,7 +4660,7 @@ async function init() {
|
|
|
3889
4660
|
// all arguments are treated as booleans
|
|
3890
4661
|
boolean: true
|
|
3891
4662
|
});
|
|
3892
|
-
const isFeatureFlagsUsed = typeof (argv.default ?? argv.ts ?? argv.jsx ?? argv.router ?? argv.pinia ?? argv.tests ?? argv.vitest ?? argv.cypress ?? argv.playwright ?? argv.eslint) === "boolean";
|
|
4663
|
+
const isFeatureFlagsUsed = typeof (argv.default ?? argv.ts ?? argv.jsx ?? argv.router ?? argv.pinia ?? argv.tests ?? argv.vitest ?? argv.cypress ?? argv.nightwatch ?? argv.playwright ?? argv.eslint) === "boolean";
|
|
3893
4664
|
let targetDir = argv._[0];
|
|
3894
4665
|
const defaultProjectName = !targetDir ? "vue-project" : targetDir;
|
|
3895
4666
|
const forceOverwrite = argv.force;
|
|
@@ -3980,6 +4751,11 @@ async function init() {
|
|
|
3980
4751
|
description: answers.needsVitest ? void 0 : "also supports unit testing with Cypress Component Testing",
|
|
3981
4752
|
value: "cypress"
|
|
3982
4753
|
},
|
|
4754
|
+
{
|
|
4755
|
+
title: "Nightwatch",
|
|
4756
|
+
description: answers.needsVitest ? void 0 : "also supports unit testing with Nightwatch Component Testing",
|
|
4757
|
+
value: "nightwatch"
|
|
4758
|
+
},
|
|
3983
4759
|
{
|
|
3984
4760
|
title: "Playwright",
|
|
3985
4761
|
value: "playwright"
|
|
@@ -4033,6 +4809,8 @@ async function init() {
|
|
|
4033
4809
|
const { needsE2eTesting } = result;
|
|
4034
4810
|
const needsCypress = argv.cypress || argv.tests || needsE2eTesting === "cypress";
|
|
4035
4811
|
const needsCypressCT = needsCypress && !needsVitest;
|
|
4812
|
+
const needsNightwatch = argv.nightwatch || argv.tests || needsE2eTesting === "nightwatch";
|
|
4813
|
+
const needsNightwatchCT = needsNightwatch && !needsVitest;
|
|
4036
4814
|
const needsPlaywright = argv.playwright || needsE2eTesting === "playwright";
|
|
4037
4815
|
const root = path4.join(cwd, targetDir);
|
|
4038
4816
|
if (fs4.existsSync(root) && shouldOverwrite) {
|
|
@@ -4045,9 +4823,10 @@ Scaffolding project in ${root}...`);
|
|
|
4045
4823
|
const pkg = { name: packageName, version: "0.0.0" };
|
|
4046
4824
|
fs4.writeFileSync(path4.resolve(root, "package.json"), JSON.stringify(pkg, null, 2));
|
|
4047
4825
|
const templateRoot = path4.resolve(__dirname, "template");
|
|
4826
|
+
const callbacks = [];
|
|
4048
4827
|
const render = function render2(templateName) {
|
|
4049
4828
|
const templateDir = path4.resolve(templateRoot, templateName);
|
|
4050
|
-
renderTemplate_default(templateDir, root);
|
|
4829
|
+
renderTemplate_default(templateDir, root, callbacks);
|
|
4051
4830
|
};
|
|
4052
4831
|
render("base");
|
|
4053
4832
|
if (needsJsx) {
|
|
@@ -4068,6 +4847,12 @@ Scaffolding project in ${root}...`);
|
|
|
4068
4847
|
if (needsCypressCT) {
|
|
4069
4848
|
render("config/cypress-ct");
|
|
4070
4849
|
}
|
|
4850
|
+
if (needsNightwatch) {
|
|
4851
|
+
render("config/nightwatch");
|
|
4852
|
+
}
|
|
4853
|
+
if (needsNightwatchCT) {
|
|
4854
|
+
render("config/nightwatch-ct");
|
|
4855
|
+
}
|
|
4071
4856
|
if (needsPlaywright) {
|
|
4072
4857
|
render("config/playwright");
|
|
4073
4858
|
}
|
|
@@ -4086,6 +4871,12 @@ Scaffolding project in ${root}...`);
|
|
|
4086
4871
|
if (needsVitest) {
|
|
4087
4872
|
render("tsconfig/vitest");
|
|
4088
4873
|
}
|
|
4874
|
+
if (needsNightwatch) {
|
|
4875
|
+
render("tsconfig/nightwatch");
|
|
4876
|
+
}
|
|
4877
|
+
if (needsNightwatchCT) {
|
|
4878
|
+
render("tsconfig/nightwatch-ct");
|
|
4879
|
+
}
|
|
4089
4880
|
}
|
|
4090
4881
|
if (needsEslint) {
|
|
4091
4882
|
renderEslint(root, { needsTypeScript, needsCypress, needsCypressCT, needsPrettier });
|
|
@@ -4101,13 +4892,31 @@ Scaffolding project in ${root}...`);
|
|
|
4101
4892
|
} else {
|
|
4102
4893
|
render("entry/default");
|
|
4103
4894
|
}
|
|
4895
|
+
const dataStore = {};
|
|
4896
|
+
for (const cb of callbacks) {
|
|
4897
|
+
await cb(dataStore);
|
|
4898
|
+
}
|
|
4899
|
+
preOrderDirectoryTraverse(
|
|
4900
|
+
root,
|
|
4901
|
+
() => {
|
|
4902
|
+
},
|
|
4903
|
+
(filepath) => {
|
|
4904
|
+
if (filepath.endsWith(".ejs")) {
|
|
4905
|
+
const template = fs4.readFileSync(filepath, "utf-8");
|
|
4906
|
+
const dest = filepath.replace(/\.ejs$/, "");
|
|
4907
|
+
const content = import_ejs.default.render(template, dataStore[dest]);
|
|
4908
|
+
fs4.writeFileSync(dest, content);
|
|
4909
|
+
fs4.unlinkSync(filepath);
|
|
4910
|
+
}
|
|
4911
|
+
}
|
|
4912
|
+
);
|
|
4104
4913
|
if (needsTypeScript) {
|
|
4105
4914
|
preOrderDirectoryTraverse(
|
|
4106
4915
|
root,
|
|
4107
4916
|
() => {
|
|
4108
4917
|
},
|
|
4109
4918
|
(filepath) => {
|
|
4110
|
-
if (filepath.endsWith(".js")) {
|
|
4919
|
+
if (filepath.endsWith(".js") && !FILES_TO_FILTER.includes(path4.basename(filepath))) {
|
|
4111
4920
|
const tsFilePath = filepath.replace(/\.js$/, ".ts");
|
|
4112
4921
|
if (fs4.existsSync(tsFilePath)) {
|
|
4113
4922
|
fs4.unlinkSync(filepath);
|
|
@@ -4144,7 +4953,9 @@ Scaffolding project in ${root}...`);
|
|
|
4144
4953
|
needsTypeScript,
|
|
4145
4954
|
needsVitest,
|
|
4146
4955
|
needsCypress,
|
|
4956
|
+
needsNightwatch,
|
|
4147
4957
|
needsPlaywright,
|
|
4958
|
+
needsNightwatchCT,
|
|
4148
4959
|
needsCypressCT,
|
|
4149
4960
|
needsEslint
|
|
4150
4961
|
})
|
|
@@ -4168,3 +4979,14 @@ Done. Now run:
|
|
|
4168
4979
|
init().catch((e) => {
|
|
4169
4980
|
console.error(e);
|
|
4170
4981
|
});
|
|
4982
|
+
/*! Bundled license information:
|
|
4983
|
+
|
|
4984
|
+
ejs/lib/ejs.js:
|
|
4985
|
+
(**
|
|
4986
|
+
* @file Embedded JavaScript templating engine. {@link http://ejs.co}
|
|
4987
|
+
* @author Matthew Eernisse <mde@fleegix.org>
|
|
4988
|
+
* @author Tiancheng "Timothy" Gu <timothygu99@gmail.com>
|
|
4989
|
+
* @project EJS
|
|
4990
|
+
* @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}
|
|
4991
|
+
*)
|
|
4992
|
+
*/
|