create-vue 3.7.5 → 3.8.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/README.md +1 -1
- package/locales/en-US.json +62 -0
- package/locales/fr-FR.json +62 -0
- package/locales/zh-CN.json +62 -0
- package/outfile.cjs +138 -111
- package/package.json +7 -6
- package/template/base/node_modules/.bin/vite +2 -2
- package/template/base/package.json +2 -2
- package/template/config/cypress/node_modules/.bin/cypress +2 -2
- package/template/config/cypress/node_modules/.bin/server-test +2 -2
- package/template/config/cypress/node_modules/.bin/start-server-and-test +2 -2
- package/template/config/cypress/node_modules/.bin/start-test +2 -2
- package/template/config/cypress/package.json +2 -2
- package/template/config/cypress-ct/node_modules/.bin/cypress +2 -2
- package/template/config/cypress-ct/package.json +1 -1
- package/template/config/jsx/node_modules/.bin/vite +2 -2
- package/template/config/jsx/package.json +1 -1
- package/template/config/nightwatch/node_modules/.bin/chromedriver +2 -2
- package/template/config/nightwatch/node_modules/.bin/nightwatch +2 -2
- package/template/config/nightwatch/node_modules/.bin/ts-node +2 -2
- package/template/config/nightwatch/node_modules/.bin/ts-node-cwd +2 -2
- package/template/config/nightwatch/node_modules/.bin/ts-node-esm +2 -2
- package/template/config/nightwatch/node_modules/.bin/ts-node-script +2 -2
- package/template/config/nightwatch/node_modules/.bin/ts-node-transpile-only +2 -2
- package/template/config/nightwatch/node_modules/.bin/ts-script +2 -2
- package/template/config/nightwatch/node_modules/.bin/tsc +4 -4
- package/template/config/nightwatch/node_modules/.bin/tsserver +4 -4
- package/template/config/nightwatch/node_modules/.bin/vite +4 -4
- package/template/config/nightwatch/package.json +4 -4
- package/template/config/pinia/package.json +1 -1
- package/template/config/playwright/node_modules/.bin/playwright +2 -2
- package/template/config/playwright/package.json +1 -1
- package/template/config/router/package.json +1 -1
- package/template/config/typescript/node_modules/.bin/npm-run-all +2 -2
- package/template/config/typescript/node_modules/.bin/npm-run-all2 +17 -0
- package/template/config/typescript/node_modules/.bin/run-p +2 -2
- package/template/config/typescript/node_modules/.bin/run-s +2 -2
- package/template/config/typescript/node_modules/.bin/vue-tsc +2 -2
- package/template/config/typescript/package.json +3 -3
- package/template/config/vitest/node_modules/.bin/vitest +2 -2
- package/template/config/vitest/package.json +1 -1
package/outfile.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! create-vue v3.
|
|
2
|
+
/*! create-vue v3.8.0 | MIT */
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -2820,8 +2820,8 @@ var require_package = __commonJS({
|
|
|
2820
2820
|
var require_ejs = __commonJS({
|
|
2821
2821
|
"node_modules/.pnpm/ejs@3.1.9/node_modules/ejs/lib/ejs.js"(exports) {
|
|
2822
2822
|
"use strict";
|
|
2823
|
-
var
|
|
2824
|
-
var
|
|
2823
|
+
var fs6 = require("fs");
|
|
2824
|
+
var path6 = require("path");
|
|
2825
2825
|
var utils = require_utils();
|
|
2826
2826
|
var scopeOptionWarned = false;
|
|
2827
2827
|
var _VERSION_STRING = require_package().version;
|
|
@@ -2848,14 +2848,14 @@ var require_ejs = __commonJS({
|
|
|
2848
2848
|
var _BOM = /^\uFEFF/;
|
|
2849
2849
|
var _JS_IDENTIFIER = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
|
|
2850
2850
|
exports.cache = utils.cache;
|
|
2851
|
-
exports.fileLoader =
|
|
2851
|
+
exports.fileLoader = fs6.readFileSync;
|
|
2852
2852
|
exports.localsName = _DEFAULT_LOCALS_NAME;
|
|
2853
2853
|
exports.promiseImpl = new Function("return this;")().Promise;
|
|
2854
2854
|
exports.resolveInclude = function(name, filename, isDir) {
|
|
2855
|
-
var dirname2 =
|
|
2856
|
-
var extname =
|
|
2857
|
-
var
|
|
2858
|
-
var includePath =
|
|
2855
|
+
var dirname2 = path6.dirname;
|
|
2856
|
+
var extname = path6.extname;
|
|
2857
|
+
var resolve6 = path6.resolve;
|
|
2858
|
+
var includePath = resolve6(isDir ? filename : dirname2(filename), name);
|
|
2859
2859
|
var ext = extname(name);
|
|
2860
2860
|
if (!ext) {
|
|
2861
2861
|
includePath += ".ejs";
|
|
@@ -2866,35 +2866,35 @@ var require_ejs = __commonJS({
|
|
|
2866
2866
|
var filePath;
|
|
2867
2867
|
if (paths.some(function(v) {
|
|
2868
2868
|
filePath = exports.resolveInclude(name, v, true);
|
|
2869
|
-
return
|
|
2869
|
+
return fs6.existsSync(filePath);
|
|
2870
2870
|
})) {
|
|
2871
2871
|
return filePath;
|
|
2872
2872
|
}
|
|
2873
2873
|
}
|
|
2874
|
-
function getIncludePath(
|
|
2874
|
+
function getIncludePath(path7, options2) {
|
|
2875
2875
|
var includePath;
|
|
2876
2876
|
var filePath;
|
|
2877
2877
|
var views = options2.views;
|
|
2878
|
-
var match = /^[A-Za-z]+:\\|^\//.exec(
|
|
2878
|
+
var match = /^[A-Za-z]+:\\|^\//.exec(path7);
|
|
2879
2879
|
if (match && match.length) {
|
|
2880
|
-
|
|
2880
|
+
path7 = path7.replace(/^\/*/, "");
|
|
2881
2881
|
if (Array.isArray(options2.root)) {
|
|
2882
|
-
includePath = resolvePaths(
|
|
2882
|
+
includePath = resolvePaths(path7, options2.root);
|
|
2883
2883
|
} else {
|
|
2884
|
-
includePath = exports.resolveInclude(
|
|
2884
|
+
includePath = exports.resolveInclude(path7, options2.root || "/", true);
|
|
2885
2885
|
}
|
|
2886
2886
|
} else {
|
|
2887
2887
|
if (options2.filename) {
|
|
2888
|
-
filePath = exports.resolveInclude(
|
|
2889
|
-
if (
|
|
2888
|
+
filePath = exports.resolveInclude(path7, options2.filename);
|
|
2889
|
+
if (fs6.existsSync(filePath)) {
|
|
2890
2890
|
includePath = filePath;
|
|
2891
2891
|
}
|
|
2892
2892
|
}
|
|
2893
2893
|
if (!includePath && Array.isArray(views)) {
|
|
2894
|
-
includePath = resolvePaths(
|
|
2894
|
+
includePath = resolvePaths(path7, views);
|
|
2895
2895
|
}
|
|
2896
2896
|
if (!includePath && typeof options2.includer !== "function") {
|
|
2897
|
-
throw new Error('Could not find the include file "' + options2.escapeFunction(
|
|
2897
|
+
throw new Error('Could not find the include file "' + options2.escapeFunction(path7) + '"');
|
|
2898
2898
|
}
|
|
2899
2899
|
}
|
|
2900
2900
|
return includePath;
|
|
@@ -2930,10 +2930,10 @@ var require_ejs = __commonJS({
|
|
|
2930
2930
|
var result;
|
|
2931
2931
|
if (!cb) {
|
|
2932
2932
|
if (typeof exports.promiseImpl == "function") {
|
|
2933
|
-
return new exports.promiseImpl(function(
|
|
2933
|
+
return new exports.promiseImpl(function(resolve6, reject) {
|
|
2934
2934
|
try {
|
|
2935
2935
|
result = handleCache(options2)(data);
|
|
2936
|
-
|
|
2936
|
+
resolve6(result);
|
|
2937
2937
|
} catch (err) {
|
|
2938
2938
|
reject(err);
|
|
2939
2939
|
}
|
|
@@ -2953,11 +2953,11 @@ var require_ejs = __commonJS({
|
|
|
2953
2953
|
function fileLoader(filePath) {
|
|
2954
2954
|
return exports.fileLoader(filePath);
|
|
2955
2955
|
}
|
|
2956
|
-
function includeFile(
|
|
2956
|
+
function includeFile(path7, options2) {
|
|
2957
2957
|
var opts = utils.shallowCopy(utils.createNullProtoObjWherePossible(), options2);
|
|
2958
|
-
opts.filename = getIncludePath(
|
|
2958
|
+
opts.filename = getIncludePath(path7, opts);
|
|
2959
2959
|
if (typeof options2.includer === "function") {
|
|
2960
|
-
var includerResult = options2.includer(
|
|
2960
|
+
var includerResult = options2.includer(path7, opts.filename);
|
|
2961
2961
|
if (includerResult) {
|
|
2962
2962
|
if (includerResult.filename) {
|
|
2963
2963
|
opts.filename = includerResult.filename;
|
|
@@ -3192,12 +3192,12 @@ var require_ejs = __commonJS({
|
|
|
3192
3192
|
throw e;
|
|
3193
3193
|
}
|
|
3194
3194
|
var returnedFn = opts.client ? fn : function anonymous(data) {
|
|
3195
|
-
var include = function(
|
|
3195
|
+
var include = function(path7, includeData) {
|
|
3196
3196
|
var d = utils.shallowCopy(utils.createNullProtoObjWherePossible(), data);
|
|
3197
3197
|
if (includeData) {
|
|
3198
3198
|
d = utils.shallowCopy(d, includeData);
|
|
3199
3199
|
}
|
|
3200
|
-
return includeFile(
|
|
3200
|
+
return includeFile(path7, opts)(d);
|
|
3201
3201
|
};
|
|
3202
3202
|
return fn.apply(
|
|
3203
3203
|
opts.context,
|
|
@@ -3206,7 +3206,7 @@ var require_ejs = __commonJS({
|
|
|
3206
3206
|
};
|
|
3207
3207
|
if (opts.filename && typeof Object.defineProperty === "function") {
|
|
3208
3208
|
var filename = opts.filename;
|
|
3209
|
-
var basename3 =
|
|
3209
|
+
var basename3 = path6.basename(filename, path6.extname(filename));
|
|
3210
3210
|
try {
|
|
3211
3211
|
Object.defineProperty(returnedFn, "name", {
|
|
3212
3212
|
value: basename3,
|
|
@@ -3396,9 +3396,9 @@ var require_quote = __commonJS({
|
|
|
3396
3396
|
return isValidVariableName(key) ? key : next(key);
|
|
3397
3397
|
}
|
|
3398
3398
|
exports.quoteKey = quoteKey;
|
|
3399
|
-
function stringifyPath(
|
|
3399
|
+
function stringifyPath(path6, next) {
|
|
3400
3400
|
let result = "";
|
|
3401
|
-
for (const key of
|
|
3401
|
+
for (const key of path6) {
|
|
3402
3402
|
if (isValidVariableName(key)) {
|
|
3403
3403
|
result += `.${key}`;
|
|
3404
3404
|
} else {
|
|
@@ -3821,7 +3821,7 @@ var require_dist = __commonJS({
|
|
|
3821
3821
|
var ROOT_SENTINEL = Symbol("root");
|
|
3822
3822
|
function stringify2(value, replacer, indent, options2 = {}) {
|
|
3823
3823
|
const space = typeof indent === "string" ? indent : " ".repeat(indent || 0);
|
|
3824
|
-
const
|
|
3824
|
+
const path6 = [];
|
|
3825
3825
|
const stack = /* @__PURE__ */ new Set();
|
|
3826
3826
|
const tracking = /* @__PURE__ */ new Map();
|
|
3827
3827
|
const unpack = /* @__PURE__ */ new Map();
|
|
@@ -3833,22 +3833,22 @@ var require_dist = __commonJS({
|
|
|
3833
3833
|
return;
|
|
3834
3834
|
if (skipUndefinedProperties && value2 === void 0)
|
|
3835
3835
|
return;
|
|
3836
|
-
if (
|
|
3836
|
+
if (path6.length > maxDepth)
|
|
3837
3837
|
return;
|
|
3838
3838
|
if (key === void 0)
|
|
3839
3839
|
return valueToString(value2, space, onNext, key);
|
|
3840
|
-
|
|
3840
|
+
path6.push(key);
|
|
3841
3841
|
const result2 = builder(value2, key === ROOT_SENTINEL ? void 0 : key);
|
|
3842
|
-
|
|
3842
|
+
path6.pop();
|
|
3843
3843
|
return result2;
|
|
3844
3844
|
};
|
|
3845
3845
|
const builder = references ? (value2, key) => {
|
|
3846
3846
|
if (value2 !== null && (typeof value2 === "object" || typeof value2 === "function" || typeof value2 === "symbol")) {
|
|
3847
3847
|
if (tracking.has(value2)) {
|
|
3848
|
-
unpack.set(
|
|
3848
|
+
unpack.set(path6.slice(1), tracking.get(value2));
|
|
3849
3849
|
return valueToString(void 0, space, onNext, key);
|
|
3850
3850
|
}
|
|
3851
|
-
tracking.set(value2,
|
|
3851
|
+
tracking.set(value2, path6.slice(1));
|
|
3852
3852
|
}
|
|
3853
3853
|
return valueToString(value2, space, onNext, key);
|
|
3854
3854
|
} : (value2, key) => {
|
|
@@ -3951,8 +3951,8 @@ var require_versionMap = __commonJS({
|
|
|
3951
3951
|
});
|
|
3952
3952
|
|
|
3953
3953
|
// index.ts
|
|
3954
|
-
var
|
|
3955
|
-
var
|
|
3954
|
+
var fs5 = __toESM(require("fs"), 1);
|
|
3955
|
+
var path5 = __toESM(require("path"), 1);
|
|
3956
3956
|
var import_minimist = __toESM(require_minimist(), 1);
|
|
3957
3957
|
var import_prompts = __toESM(require_lib(), 1);
|
|
3958
3958
|
|
|
@@ -4354,9 +4354,29 @@ ${commandFor("lint")}
|
|
|
4354
4354
|
return readme;
|
|
4355
4355
|
}
|
|
4356
4356
|
|
|
4357
|
-
// utils/
|
|
4357
|
+
// utils/getLanguage.ts
|
|
4358
4358
|
var fs3 = __toESM(require("fs"), 1);
|
|
4359
4359
|
var path3 = __toESM(require("path"), 1);
|
|
4360
|
+
function getLocale() {
|
|
4361
|
+
const shellLocale = Intl.DateTimeFormat().resolvedOptions().locale || // Built-in ECMA-402 support
|
|
4362
|
+
process.env.LC_ALL || // POSIX locale environment variables
|
|
4363
|
+
process.env.LC_MESSAGES || process.env.LANG || // TODO: Windows support if needed, could consider https://www.npmjs.com/package/os-locale
|
|
4364
|
+
"en-US";
|
|
4365
|
+
const locale = shellLocale.split(".")[0].replace("_", "-");
|
|
4366
|
+
return locale;
|
|
4367
|
+
}
|
|
4368
|
+
function getLanguage() {
|
|
4369
|
+
const locale = getLocale();
|
|
4370
|
+
const localesRoot = path3.resolve(__dirname, "locales");
|
|
4371
|
+
const languageFilePath = path3.resolve(localesRoot, `${locale}.json`);
|
|
4372
|
+
const doesLanguageExist = fs3.existsSync(languageFilePath);
|
|
4373
|
+
const lang = doesLanguageExist ? require(languageFilePath) : require(path3.resolve(localesRoot, "en-US.json"));
|
|
4374
|
+
return lang;
|
|
4375
|
+
}
|
|
4376
|
+
|
|
4377
|
+
// utils/renderEslint.ts
|
|
4378
|
+
var fs4 = __toESM(require("fs"), 1);
|
|
4379
|
+
var path4 = __toESM(require("path"), 1);
|
|
4360
4380
|
|
|
4361
4381
|
// node_modules/.pnpm/@vue+create-eslint-config@0.3.2/node_modules/@vue/create-eslint-config/index.js
|
|
4362
4382
|
var import_javascript_stringify = __toESM(require_dist(), 1);
|
|
@@ -4590,21 +4610,21 @@ function renderEslint(rootDir, { needsTypeScript, needsCypress, needsCypressCT,
|
|
|
4590
4610
|
if (needsPrettier) {
|
|
4591
4611
|
scripts.format = "prettier --write src/";
|
|
4592
4612
|
}
|
|
4593
|
-
const packageJsonPath =
|
|
4594
|
-
const existingPkg = JSON.parse(
|
|
4613
|
+
const packageJsonPath = path4.resolve(rootDir, "package.json");
|
|
4614
|
+
const existingPkg = JSON.parse(fs4.readFileSync(packageJsonPath, "utf8"));
|
|
4595
4615
|
const updatedPkg = sortDependencies(deepMerge_default(deepMerge_default(existingPkg, pkg), { scripts }));
|
|
4596
|
-
|
|
4616
|
+
fs4.writeFileSync(packageJsonPath, JSON.stringify(updatedPkg, null, 2) + "\n", "utf-8");
|
|
4597
4617
|
for (const [fileName, content] of Object.entries(files)) {
|
|
4598
|
-
const fullPath =
|
|
4599
|
-
|
|
4618
|
+
const fullPath = path4.resolve(rootDir, fileName);
|
|
4619
|
+
fs4.writeFileSync(fullPath, content, "utf-8");
|
|
4600
4620
|
}
|
|
4601
|
-
const extensionsJsonPath =
|
|
4602
|
-
const existingExtensions = JSON.parse(
|
|
4621
|
+
const extensionsJsonPath = path4.resolve(rootDir, ".vscode/extensions.json");
|
|
4622
|
+
const existingExtensions = JSON.parse(fs4.readFileSync(extensionsJsonPath, "utf8"));
|
|
4603
4623
|
existingExtensions.recommendations.push("dbaeumer.vscode-eslint");
|
|
4604
4624
|
if (needsPrettier) {
|
|
4605
4625
|
existingExtensions.recommendations.push("esbenp.prettier-vscode");
|
|
4606
4626
|
}
|
|
4607
|
-
|
|
4627
|
+
fs4.writeFileSync(extensionsJsonPath, JSON.stringify(existingExtensions, null, 2) + "\n", "utf-8");
|
|
4608
4628
|
}
|
|
4609
4629
|
|
|
4610
4630
|
// utils/filterList.ts
|
|
@@ -4622,10 +4642,10 @@ function toValidPackageName(projectName) {
|
|
|
4622
4642
|
return projectName.trim().toLowerCase().replace(/\s+/g, "-").replace(/^[._]/, "").replace(/[^a-z0-9-~]+/g, "-");
|
|
4623
4643
|
}
|
|
4624
4644
|
function canSkipEmptying(dir) {
|
|
4625
|
-
if (!
|
|
4645
|
+
if (!fs5.existsSync(dir)) {
|
|
4626
4646
|
return true;
|
|
4627
4647
|
}
|
|
4628
|
-
const files =
|
|
4648
|
+
const files = fs5.readdirSync(dir);
|
|
4629
4649
|
if (files.length === 0) {
|
|
4630
4650
|
return true;
|
|
4631
4651
|
}
|
|
@@ -4635,13 +4655,13 @@ function canSkipEmptying(dir) {
|
|
|
4635
4655
|
return false;
|
|
4636
4656
|
}
|
|
4637
4657
|
function emptyDir(dir) {
|
|
4638
|
-
if (!
|
|
4658
|
+
if (!fs5.existsSync(dir)) {
|
|
4639
4659
|
return;
|
|
4640
4660
|
}
|
|
4641
4661
|
postOrderDirectoryTraverse(
|
|
4642
4662
|
dir,
|
|
4643
|
-
(dir2) =>
|
|
4644
|
-
(file) =>
|
|
4663
|
+
(dir2) => fs5.rmdirSync(dir2),
|
|
4664
|
+
(file) => fs5.unlinkSync(file)
|
|
4645
4665
|
);
|
|
4646
4666
|
}
|
|
4647
4667
|
async function init() {
|
|
@@ -4665,6 +4685,7 @@ async function init() {
|
|
|
4665
4685
|
let targetDir = argv._[0];
|
|
4666
4686
|
const defaultProjectName = !targetDir ? "vue-project" : targetDir;
|
|
4667
4687
|
const forceOverwrite = argv.force;
|
|
4688
|
+
const language = getLanguage();
|
|
4668
4689
|
let result = {};
|
|
4669
4690
|
try {
|
|
4670
4691
|
result = await (0, import_prompts.default)(
|
|
@@ -4672,23 +4693,26 @@ async function init() {
|
|
|
4672
4693
|
{
|
|
4673
4694
|
name: "projectName",
|
|
4674
4695
|
type: targetDir ? null : "text",
|
|
4675
|
-
message:
|
|
4696
|
+
message: language.projectName.message,
|
|
4676
4697
|
initial: defaultProjectName,
|
|
4677
4698
|
onState: (state) => targetDir = String(state.value).trim() || defaultProjectName
|
|
4678
4699
|
},
|
|
4679
4700
|
{
|
|
4680
4701
|
name: "shouldOverwrite",
|
|
4681
|
-
type: () => canSkipEmptying(targetDir) || forceOverwrite ? null : "
|
|
4702
|
+
type: () => canSkipEmptying(targetDir) || forceOverwrite ? null : "toggle",
|
|
4682
4703
|
message: () => {
|
|
4683
|
-
const dirForPrompt = targetDir === "." ?
|
|
4684
|
-
return `${dirForPrompt}
|
|
4685
|
-
}
|
|
4704
|
+
const dirForPrompt = targetDir === "." ? language.shouldOverwrite.dirForPrompts.current : `${language.shouldOverwrite.dirForPrompts.target} "${targetDir}"`;
|
|
4705
|
+
return `${dirForPrompt} ${language.shouldOverwrite.message}`;
|
|
4706
|
+
},
|
|
4707
|
+
initial: true,
|
|
4708
|
+
active: language.defaultToggleOptions.active,
|
|
4709
|
+
inactive: language.defaultToggleOptions.inactive
|
|
4686
4710
|
},
|
|
4687
4711
|
{
|
|
4688
4712
|
name: "overwriteChecker",
|
|
4689
4713
|
type: (prev, values) => {
|
|
4690
4714
|
if (values.shouldOverwrite === false) {
|
|
4691
|
-
throw new Error(red("\u2716") +
|
|
4715
|
+
throw new Error(red("\u2716") + ` ${language.errors.operationCancelled}`);
|
|
4692
4716
|
}
|
|
4693
4717
|
return null;
|
|
4694
4718
|
}
|
|
@@ -4696,69 +4720,72 @@ async function init() {
|
|
|
4696
4720
|
{
|
|
4697
4721
|
name: "packageName",
|
|
4698
4722
|
type: () => isValidPackageName(targetDir) ? null : "text",
|
|
4699
|
-
message:
|
|
4723
|
+
message: language.packageName.message,
|
|
4700
4724
|
initial: () => toValidPackageName(targetDir),
|
|
4701
4725
|
validate: (dir) => isValidPackageName(dir) || "Invalid package.json name"
|
|
4702
4726
|
},
|
|
4703
4727
|
{
|
|
4704
4728
|
name: "needsTypeScript",
|
|
4705
4729
|
type: () => isFeatureFlagsUsed ? null : "toggle",
|
|
4706
|
-
message:
|
|
4730
|
+
message: language.needsTypeScript.message,
|
|
4707
4731
|
initial: false,
|
|
4708
|
-
active:
|
|
4709
|
-
inactive:
|
|
4732
|
+
active: language.defaultToggleOptions.active,
|
|
4733
|
+
inactive: language.defaultToggleOptions.inactive
|
|
4710
4734
|
},
|
|
4711
4735
|
{
|
|
4712
4736
|
name: "needsJsx",
|
|
4713
4737
|
type: () => isFeatureFlagsUsed ? null : "toggle",
|
|
4714
|
-
message:
|
|
4738
|
+
message: language.needsJsx.message,
|
|
4715
4739
|
initial: false,
|
|
4716
|
-
active:
|
|
4717
|
-
inactive:
|
|
4740
|
+
active: language.defaultToggleOptions.active,
|
|
4741
|
+
inactive: language.defaultToggleOptions.inactive
|
|
4718
4742
|
},
|
|
4719
4743
|
{
|
|
4720
4744
|
name: "needsRouter",
|
|
4721
4745
|
type: () => isFeatureFlagsUsed ? null : "toggle",
|
|
4722
|
-
message:
|
|
4746
|
+
message: language.needsRouter.message,
|
|
4723
4747
|
initial: false,
|
|
4724
|
-
active:
|
|
4725
|
-
inactive:
|
|
4748
|
+
active: language.defaultToggleOptions.active,
|
|
4749
|
+
inactive: language.defaultToggleOptions.inactive
|
|
4726
4750
|
},
|
|
4727
4751
|
{
|
|
4728
4752
|
name: "needsPinia",
|
|
4729
4753
|
type: () => isFeatureFlagsUsed ? null : "toggle",
|
|
4730
|
-
message:
|
|
4754
|
+
message: language.needsPinia.message,
|
|
4731
4755
|
initial: false,
|
|
4732
|
-
active:
|
|
4733
|
-
inactive:
|
|
4756
|
+
active: language.defaultToggleOptions.active,
|
|
4757
|
+
inactive: language.defaultToggleOptions.inactive
|
|
4734
4758
|
},
|
|
4735
4759
|
{
|
|
4736
4760
|
name: "needsVitest",
|
|
4737
4761
|
type: () => isFeatureFlagsUsed ? null : "toggle",
|
|
4738
|
-
message:
|
|
4762
|
+
message: language.needsVitest.message,
|
|
4739
4763
|
initial: false,
|
|
4740
|
-
active:
|
|
4741
|
-
inactive:
|
|
4764
|
+
active: language.defaultToggleOptions.active,
|
|
4765
|
+
inactive: language.defaultToggleOptions.inactive
|
|
4742
4766
|
},
|
|
4743
4767
|
{
|
|
4744
4768
|
name: "needsE2eTesting",
|
|
4745
4769
|
type: () => isFeatureFlagsUsed ? null : "select",
|
|
4746
|
-
message:
|
|
4770
|
+
message: language.needsE2eTesting.message,
|
|
4747
4771
|
initial: 0,
|
|
4748
4772
|
choices: (prev, answers) => [
|
|
4749
|
-
{ title: "No", value: false },
|
|
4750
4773
|
{
|
|
4751
|
-
title:
|
|
4752
|
-
|
|
4774
|
+
title: language.needsE2eTesting.selectOptions.negative.title,
|
|
4775
|
+
value: false
|
|
4776
|
+
},
|
|
4777
|
+
{
|
|
4778
|
+
title: language.needsE2eTesting.selectOptions.cypress.title,
|
|
4779
|
+
description: answers.needsVitest ? void 0 : language.needsE2eTesting.selectOptions.cypress.desc,
|
|
4753
4780
|
value: "cypress"
|
|
4754
4781
|
},
|
|
4755
4782
|
{
|
|
4756
|
-
title:
|
|
4757
|
-
description: answers.needsVitest ? void 0 :
|
|
4783
|
+
title: language.needsE2eTesting.selectOptions.nightwatch.title,
|
|
4784
|
+
description: answers.needsVitest ? void 0 : language.needsE2eTesting.selectOptions.nightwatch.desc,
|
|
4758
4785
|
value: "nightwatch"
|
|
4759
4786
|
},
|
|
4760
4787
|
{
|
|
4761
|
-
title:
|
|
4788
|
+
title: language.needsE2eTesting.selectOptions.playwright.title,
|
|
4762
4789
|
value: "playwright"
|
|
4763
4790
|
}
|
|
4764
4791
|
]
|
|
@@ -4766,10 +4793,10 @@ async function init() {
|
|
|
4766
4793
|
{
|
|
4767
4794
|
name: "needsEslint",
|
|
4768
4795
|
type: () => isFeatureFlagsUsed ? null : "toggle",
|
|
4769
|
-
message:
|
|
4796
|
+
message: language.needsEslint.message,
|
|
4770
4797
|
initial: false,
|
|
4771
|
-
active:
|
|
4772
|
-
inactive:
|
|
4798
|
+
active: language.defaultToggleOptions.active,
|
|
4799
|
+
inactive: language.defaultToggleOptions.inactive
|
|
4773
4800
|
},
|
|
4774
4801
|
{
|
|
4775
4802
|
name: "needsPrettier",
|
|
@@ -4779,15 +4806,15 @@ async function init() {
|
|
|
4779
4806
|
}
|
|
4780
4807
|
return "toggle";
|
|
4781
4808
|
},
|
|
4782
|
-
message:
|
|
4809
|
+
message: language.needsPrettier.message,
|
|
4783
4810
|
initial: false,
|
|
4784
|
-
active:
|
|
4785
|
-
inactive:
|
|
4811
|
+
active: language.defaultToggleOptions.active,
|
|
4812
|
+
inactive: language.defaultToggleOptions.inactive
|
|
4786
4813
|
}
|
|
4787
4814
|
],
|
|
4788
4815
|
{
|
|
4789
4816
|
onCancel: () => {
|
|
4790
|
-
throw new Error(red("\u2716") +
|
|
4817
|
+
throw new Error(red("\u2716") + ` ${language.errors.operationCancelled}`);
|
|
4791
4818
|
}
|
|
4792
4819
|
}
|
|
4793
4820
|
);
|
|
@@ -4813,20 +4840,20 @@ async function init() {
|
|
|
4813
4840
|
const needsNightwatch = argv.nightwatch || needsE2eTesting === "nightwatch";
|
|
4814
4841
|
const needsNightwatchCT = needsNightwatch && !needsVitest;
|
|
4815
4842
|
const needsPlaywright = argv.playwright || needsE2eTesting === "playwright";
|
|
4816
|
-
const root =
|
|
4817
|
-
if (
|
|
4843
|
+
const root = path5.join(cwd, targetDir);
|
|
4844
|
+
if (fs5.existsSync(root) && shouldOverwrite) {
|
|
4818
4845
|
emptyDir(root);
|
|
4819
|
-
} else if (!
|
|
4820
|
-
|
|
4846
|
+
} else if (!fs5.existsSync(root)) {
|
|
4847
|
+
fs5.mkdirSync(root);
|
|
4821
4848
|
}
|
|
4822
4849
|
console.log(`
|
|
4823
|
-
|
|
4850
|
+
${language.infos.scaffolding} ${root}...`);
|
|
4824
4851
|
const pkg = { name: packageName, version: "0.0.0" };
|
|
4825
|
-
|
|
4826
|
-
const templateRoot =
|
|
4852
|
+
fs5.writeFileSync(path5.resolve(root, "package.json"), JSON.stringify(pkg, null, 2));
|
|
4853
|
+
const templateRoot = path5.resolve(__dirname, "template");
|
|
4827
4854
|
const callbacks = [];
|
|
4828
4855
|
const render = function render2(templateName) {
|
|
4829
|
-
const templateDir =
|
|
4856
|
+
const templateDir = path5.resolve(templateRoot, templateName);
|
|
4830
4857
|
renderTemplate_default(templateDir, root, callbacks);
|
|
4831
4858
|
};
|
|
4832
4859
|
render("base");
|
|
@@ -4903,11 +4930,11 @@ Scaffolding project in ${root}...`);
|
|
|
4903
4930
|
},
|
|
4904
4931
|
(filepath) => {
|
|
4905
4932
|
if (filepath.endsWith(".ejs")) {
|
|
4906
|
-
const template =
|
|
4933
|
+
const template = fs5.readFileSync(filepath, "utf-8");
|
|
4907
4934
|
const dest = filepath.replace(/\.ejs$/, "");
|
|
4908
4935
|
const content = import_ejs.default.render(template, dataStore[dest]);
|
|
4909
|
-
|
|
4910
|
-
|
|
4936
|
+
fs5.writeFileSync(dest, content);
|
|
4937
|
+
fs5.unlinkSync(filepath);
|
|
4911
4938
|
}
|
|
4912
4939
|
}
|
|
4913
4940
|
);
|
|
@@ -4917,21 +4944,21 @@ Scaffolding project in ${root}...`);
|
|
|
4917
4944
|
() => {
|
|
4918
4945
|
},
|
|
4919
4946
|
(filepath) => {
|
|
4920
|
-
if (filepath.endsWith(".js") && !FILES_TO_FILTER.includes(
|
|
4947
|
+
if (filepath.endsWith(".js") && !FILES_TO_FILTER.includes(path5.basename(filepath))) {
|
|
4921
4948
|
const tsFilePath = filepath.replace(/\.js$/, ".ts");
|
|
4922
|
-
if (
|
|
4923
|
-
|
|
4949
|
+
if (fs5.existsSync(tsFilePath)) {
|
|
4950
|
+
fs5.unlinkSync(filepath);
|
|
4924
4951
|
} else {
|
|
4925
|
-
|
|
4952
|
+
fs5.renameSync(filepath, tsFilePath);
|
|
4926
4953
|
}
|
|
4927
|
-
} else if (
|
|
4928
|
-
|
|
4954
|
+
} else if (path5.basename(filepath) === "jsconfig.json") {
|
|
4955
|
+
fs5.unlinkSync(filepath);
|
|
4929
4956
|
}
|
|
4930
4957
|
}
|
|
4931
4958
|
);
|
|
4932
|
-
const indexHtmlPath =
|
|
4933
|
-
const indexHtmlContent =
|
|
4934
|
-
|
|
4959
|
+
const indexHtmlPath = path5.resolve(root, "index.html");
|
|
4960
|
+
const indexHtmlContent = fs5.readFileSync(indexHtmlPath, "utf8");
|
|
4961
|
+
fs5.writeFileSync(indexHtmlPath, indexHtmlContent.replace("src/main.js", "src/main.ts"));
|
|
4935
4962
|
} else {
|
|
4936
4963
|
preOrderDirectoryTraverse(
|
|
4937
4964
|
root,
|
|
@@ -4939,15 +4966,15 @@ Scaffolding project in ${root}...`);
|
|
|
4939
4966
|
},
|
|
4940
4967
|
(filepath) => {
|
|
4941
4968
|
if (filepath.endsWith(".ts")) {
|
|
4942
|
-
|
|
4969
|
+
fs5.unlinkSync(filepath);
|
|
4943
4970
|
}
|
|
4944
4971
|
}
|
|
4945
4972
|
);
|
|
4946
4973
|
}
|
|
4947
4974
|
const userAgent = process.env.npm_config_user_agent ?? "";
|
|
4948
4975
|
const packageManager = /pnpm/.test(userAgent) ? "pnpm" : /yarn/.test(userAgent) ? "yarn" : "npm";
|
|
4949
|
-
|
|
4950
|
-
|
|
4976
|
+
fs5.writeFileSync(
|
|
4977
|
+
path5.resolve(root, "README.md"),
|
|
4951
4978
|
generateReadme({
|
|
4952
4979
|
projectName: result.projectName ?? result.packageName ?? defaultProjectName,
|
|
4953
4980
|
packageManager,
|
|
@@ -4962,10 +4989,10 @@ Scaffolding project in ${root}...`);
|
|
|
4962
4989
|
})
|
|
4963
4990
|
);
|
|
4964
4991
|
console.log(`
|
|
4965
|
-
|
|
4992
|
+
${language.infos.done}
|
|
4966
4993
|
`);
|
|
4967
4994
|
if (root !== cwd) {
|
|
4968
|
-
const cdProjectName =
|
|
4995
|
+
const cdProjectName = path5.relative(cwd, root);
|
|
4969
4996
|
console.log(
|
|
4970
4997
|
` ${bold(green(`cd ${cdProjectName.includes(" ") ? `"${cdProjectName}"` : cdProjectName}`))}`
|
|
4971
4998
|
);
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-vue",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.0",
|
|
4
4
|
"description": "An easy way to start a Vue project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"create-vue": "outfile.cjs"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
|
+
"locales",
|
|
10
11
|
"outfile.cjs",
|
|
11
12
|
"template"
|
|
12
13
|
],
|
|
@@ -26,9 +27,9 @@
|
|
|
26
27
|
"homepage": "https://github.com/vuejs/create-vue#readme",
|
|
27
28
|
"devDependencies": {
|
|
28
29
|
"@tsconfig/node18": "^18.2.2",
|
|
29
|
-
"@types/eslint": "^8.44.
|
|
30
|
-
"@types/node": "^18.
|
|
31
|
-
"@types/prompts": "^2.4.
|
|
30
|
+
"@types/eslint": "^8.44.4",
|
|
31
|
+
"@types/node": "^18.18.5",
|
|
32
|
+
"@types/prompts": "^2.4.6",
|
|
32
33
|
"@vue/create-eslint-config": "^0.3.2",
|
|
33
34
|
"@vue/tsconfig": "^0.4.0",
|
|
34
35
|
"ejs": "^3.1.9",
|
|
@@ -36,9 +37,9 @@
|
|
|
36
37
|
"esbuild-plugin-license": "^1.2.2",
|
|
37
38
|
"husky": "^8.0.3",
|
|
38
39
|
"kolorist": "^1.8.0",
|
|
39
|
-
"lint-staged": "^
|
|
40
|
+
"lint-staged": "^15.0.1",
|
|
40
41
|
"minimist": "^1.2.8",
|
|
41
|
-
"npm-run-all2": "^6.
|
|
42
|
+
"npm-run-all2": "^6.1.1",
|
|
42
43
|
"prettier": "^3.0.3",
|
|
43
44
|
"prompts": "^2.4.2",
|
|
44
45
|
"zx": "^7.2.3"
|
|
@@ -6,9 +6,9 @@ case `uname` in
|
|
|
6
6
|
esac
|
|
7
7
|
|
|
8
8
|
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.4.
|
|
9
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.4.11_@types+node@18.18.5/node_modules/vite/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.4.11_@types+node@18.18.5/node_modules/vite/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.4.11_@types+node@18.18.5/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules"
|
|
10
10
|
else
|
|
11
|
-
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.4.
|
|
11
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.4.11_@types+node@18.18.5/node_modules/vite/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.4.11_@types+node@18.18.5/node_modules/vite/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.4.11_@types+node@18.18.5/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
14
|
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
|
|
@@ -6,9 +6,9 @@ case `uname` in
|
|
|
6
6
|
esac
|
|
7
7
|
|
|
8
8
|
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@13.
|
|
9
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@13.3.1/node_modules/cypress/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@13.3.1/node_modules/cypress/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@13.3.1/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules"
|
|
10
10
|
else
|
|
11
|
-
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@13.
|
|
11
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@13.3.1/node_modules/cypress/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@13.3.1/node_modules/cypress/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@13.3.1/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
14
|
exec "$basedir/node" "$basedir/../cypress/bin/cypress" "$@"
|