create-vue 3.12.2 → 3.14.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.
Files changed (76) hide show
  1. package/README.md +6 -1
  2. package/outfile.cjs +299 -106
  3. package/package.json +8 -8
  4. package/template/bare/base/src/App.vue +7 -0
  5. package/template/bare/cypress-ct/src/__tests__/App.cy.js +8 -0
  6. package/template/bare/nightwatch-ct/src/__tests__/App.spec.js +14 -0
  7. package/template/bare/typescript/src/App.vue +7 -0
  8. package/template/bare/vitest/src/__tests__/App.spec.js +11 -0
  9. package/template/base/node_modules/.bin/vite +2 -2
  10. package/template/base/package.json +2 -2
  11. package/template/base/vite.config.js.data.mjs +1 -1
  12. package/template/code/default/src/components/TheWelcome.vue +16 -12
  13. package/template/code/router/src/components/TheWelcome.vue +16 -12
  14. package/template/code/typescript-default/src/components/TheWelcome.vue +16 -12
  15. package/template/code/typescript-router/src/components/TheWelcome.vue +16 -12
  16. package/template/config/cypress/cypress/{e2e/jsconfig.json → jsconfig.json} +2 -1
  17. package/template/config/cypress/node_modules/.bin/cypress +2 -2
  18. package/template/config/cypress/node_modules/.bin/server-test +2 -2
  19. package/template/config/cypress/node_modules/.bin/start-server-and-test +2 -2
  20. package/template/config/cypress/node_modules/.bin/start-test +2 -2
  21. package/template/config/cypress/package.json +2 -2
  22. package/template/config/cypress-ct/node_modules/.bin/cypress +2 -2
  23. package/template/config/cypress-ct/package.json +1 -1
  24. package/template/config/jsx/node_modules/.bin/vite +2 -2
  25. package/template/config/jsx/package.json +1 -1
  26. package/template/config/nightwatch/node_modules/.bin/chromedriver +2 -2
  27. package/template/config/nightwatch/node_modules/.bin/geckodriver +2 -2
  28. package/template/config/nightwatch/node_modules/.bin/nightwatch +2 -2
  29. package/template/config/nightwatch/node_modules/.bin/ts-node +2 -2
  30. package/template/config/nightwatch/node_modules/.bin/ts-node-cwd +2 -2
  31. package/template/config/nightwatch/node_modules/.bin/ts-node-esm +2 -2
  32. package/template/config/nightwatch/node_modules/.bin/ts-node-script +2 -2
  33. package/template/config/nightwatch/node_modules/.bin/ts-node-transpile-only +2 -2
  34. package/template/config/nightwatch/node_modules/.bin/ts-script +2 -2
  35. package/template/config/nightwatch/node_modules/.bin/vite +2 -2
  36. package/template/config/nightwatch/package.json +3 -3
  37. package/template/config/pinia/package.json +1 -1
  38. package/template/config/playwright/node_modules/.bin/playwright +2 -2
  39. package/template/config/playwright/package.json +1 -1
  40. package/template/config/router/package.json +1 -1
  41. package/template/config/typescript/node_modules/.bin/npm-run-all +2 -2
  42. package/template/config/typescript/node_modules/.bin/npm-run-all2 +2 -2
  43. package/template/config/typescript/node_modules/.bin/run-p +2 -2
  44. package/template/config/typescript/node_modules/.bin/run-s +2 -2
  45. package/template/config/typescript/node_modules/.bin/tsc +2 -2
  46. package/template/config/typescript/node_modules/.bin/tsserver +2 -2
  47. package/template/config/typescript/node_modules/.bin/vue-tsc +2 -2
  48. package/template/config/typescript/package.json +4 -4
  49. package/template/config/vitest/node_modules/.bin/vitest +2 -2
  50. package/template/config/vitest/package.json +2 -2
  51. package/template/eslint/package.json +1 -1
  52. package/template/tsconfig/base/tsconfig.app.json +0 -1
  53. package/template/tsconfig/base/tsconfig.node.json +2 -2
  54. package/template/tsconfig/cypress-ct/tsconfig.cypress-ct.json +0 -1
  55. package/template/tsconfig/nightwatch/nightwatch/tsconfig.json +0 -1
  56. package/template/tsconfig/nightwatch-ct/tsconfig.app.json +0 -1
  57. package/template/tsconfig/vitest/tsconfig.vitest.json +1 -1
  58. package/template/base/node_modules/.bin/rollup +0 -17
  59. package/template/base/node_modules/.bin/tsc +0 -17
  60. package/template/base/node_modules/.bin/tsserver +0 -17
  61. package/template/base/node_modules/.vue-global-types/vue_3.5_false.d.ts +0 -119
  62. package/template/config/cypress-ct/node_modules/.bin/tsc +0 -17
  63. package/template/config/cypress-ct/node_modules/.bin/tsserver +0 -17
  64. package/template/config/jsx/node_modules/.bin/browserslist +0 -17
  65. package/template/config/jsx/node_modules/.bin/tsc +0 -17
  66. package/template/config/jsx/node_modules/.bin/tsserver +0 -17
  67. package/template/config/nightwatch/node_modules/.bin/tsc +0 -17
  68. package/template/config/nightwatch/node_modules/.bin/tsserver +0 -17
  69. package/template/config/nightwatch-ct/node_modules/.bin/tsc +0 -17
  70. package/template/config/nightwatch-ct/node_modules/.bin/tsserver +0 -17
  71. package/template/config/pinia/node_modules/.bin/tsc +0 -17
  72. package/template/config/pinia/node_modules/.bin/tsserver +0 -17
  73. package/template/config/router/node_modules/.bin/tsc +0 -17
  74. package/template/config/router/node_modules/.bin/tsserver +0 -17
  75. package/template/config/vitest/node_modules/.bin/tsc +0 -17
  76. package/template/config/vitest/node_modules/.bin/tsserver +0 -17
package/outfile.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- /*! create-vue v3.12.2 | MIT */
2
+ /*! create-vue v3.14.0 | MIT */
3
3
  var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -2511,8 +2511,8 @@ var require_package = __commonJS({
2511
2511
  var require_ejs = __commonJS({
2512
2512
  "node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/lib/ejs.js"(exports2) {
2513
2513
  "use strict";
2514
- var fs6 = require("fs");
2515
- var path6 = require("path");
2514
+ var fs7 = require("fs");
2515
+ var path7 = require("path");
2516
2516
  var utils = require_utils();
2517
2517
  var scopeOptionWarned = false;
2518
2518
  var _VERSION_STRING = require_package().version;
@@ -2539,14 +2539,14 @@ var require_ejs = __commonJS({
2539
2539
  var _BOM = /^\uFEFF/;
2540
2540
  var _JS_IDENTIFIER = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
2541
2541
  exports2.cache = utils.cache;
2542
- exports2.fileLoader = fs6.readFileSync;
2542
+ exports2.fileLoader = fs7.readFileSync;
2543
2543
  exports2.localsName = _DEFAULT_LOCALS_NAME;
2544
2544
  exports2.promiseImpl = new Function("return this;")().Promise;
2545
2545
  exports2.resolveInclude = function(name, filename, isDir) {
2546
- var dirname2 = path6.dirname;
2547
- var extname = path6.extname;
2548
- var resolve6 = path6.resolve;
2549
- var includePath = resolve6(isDir ? filename : dirname2(filename), name);
2546
+ var dirname2 = path7.dirname;
2547
+ var extname = path7.extname;
2548
+ var resolve7 = path7.resolve;
2549
+ var includePath = resolve7(isDir ? filename : dirname2(filename), name);
2550
2550
  var ext = extname(name);
2551
2551
  if (!ext) {
2552
2552
  includePath += ".ejs";
@@ -2557,35 +2557,35 @@ var require_ejs = __commonJS({
2557
2557
  var filePath;
2558
2558
  if (paths.some(function(v) {
2559
2559
  filePath = exports2.resolveInclude(name, v, true);
2560
- return fs6.existsSync(filePath);
2560
+ return fs7.existsSync(filePath);
2561
2561
  })) {
2562
2562
  return filePath;
2563
2563
  }
2564
2564
  }
2565
- function getIncludePath(path7, options) {
2565
+ function getIncludePath(path8, options) {
2566
2566
  var includePath;
2567
2567
  var filePath;
2568
2568
  var views = options.views;
2569
- var match = /^[A-Za-z]+:\\|^\//.exec(path7);
2569
+ var match = /^[A-Za-z]+:\\|^\//.exec(path8);
2570
2570
  if (match && match.length) {
2571
- path7 = path7.replace(/^\/*/, "");
2571
+ path8 = path8.replace(/^\/*/, "");
2572
2572
  if (Array.isArray(options.root)) {
2573
- includePath = resolvePaths(path7, options.root);
2573
+ includePath = resolvePaths(path8, options.root);
2574
2574
  } else {
2575
- includePath = exports2.resolveInclude(path7, options.root || "/", true);
2575
+ includePath = exports2.resolveInclude(path8, options.root || "/", true);
2576
2576
  }
2577
2577
  } else {
2578
2578
  if (options.filename) {
2579
- filePath = exports2.resolveInclude(path7, options.filename);
2580
- if (fs6.existsSync(filePath)) {
2579
+ filePath = exports2.resolveInclude(path8, options.filename);
2580
+ if (fs7.existsSync(filePath)) {
2581
2581
  includePath = filePath;
2582
2582
  }
2583
2583
  }
2584
2584
  if (!includePath && Array.isArray(views)) {
2585
- includePath = resolvePaths(path7, views);
2585
+ includePath = resolvePaths(path8, views);
2586
2586
  }
2587
2587
  if (!includePath && typeof options.includer !== "function") {
2588
- throw new Error('Could not find the include file "' + options.escapeFunction(path7) + '"');
2588
+ throw new Error('Could not find the include file "' + options.escapeFunction(path8) + '"');
2589
2589
  }
2590
2590
  }
2591
2591
  return includePath;
@@ -2621,10 +2621,10 @@ var require_ejs = __commonJS({
2621
2621
  var result;
2622
2622
  if (!cb) {
2623
2623
  if (typeof exports2.promiseImpl == "function") {
2624
- return new exports2.promiseImpl(function(resolve6, reject) {
2624
+ return new exports2.promiseImpl(function(resolve7, reject) {
2625
2625
  try {
2626
2626
  result = handleCache(options)(data);
2627
- resolve6(result);
2627
+ resolve7(result);
2628
2628
  } catch (err) {
2629
2629
  reject(err);
2630
2630
  }
@@ -2644,11 +2644,11 @@ var require_ejs = __commonJS({
2644
2644
  function fileLoader(filePath) {
2645
2645
  return exports2.fileLoader(filePath);
2646
2646
  }
2647
- function includeFile(path7, options) {
2647
+ function includeFile(path8, options) {
2648
2648
  var opts = utils.shallowCopy(utils.createNullProtoObjWherePossible(), options);
2649
- opts.filename = getIncludePath(path7, opts);
2649
+ opts.filename = getIncludePath(path8, opts);
2650
2650
  if (typeof options.includer === "function") {
2651
- var includerResult = options.includer(path7, opts.filename);
2651
+ var includerResult = options.includer(path8, opts.filename);
2652
2652
  if (includerResult) {
2653
2653
  if (includerResult.filename) {
2654
2654
  opts.filename = includerResult.filename;
@@ -2883,12 +2883,12 @@ var require_ejs = __commonJS({
2883
2883
  throw e;
2884
2884
  }
2885
2885
  var returnedFn = opts.client ? fn : function anonymous(data) {
2886
- var include = function(path7, includeData) {
2886
+ var include = function(path8, includeData) {
2887
2887
  var d = utils.shallowCopy(utils.createNullProtoObjWherePossible(), data);
2888
2888
  if (includeData) {
2889
2889
  d = utils.shallowCopy(d, includeData);
2890
2890
  }
2891
- return includeFile(path7, opts)(d);
2891
+ return includeFile(path8, opts)(d);
2892
2892
  };
2893
2893
  return fn.apply(
2894
2894
  opts.context,
@@ -2897,7 +2897,7 @@ var require_ejs = __commonJS({
2897
2897
  };
2898
2898
  if (opts.filename && typeof Object.defineProperty === "function") {
2899
2899
  var filename = opts.filename;
2900
- var basename3 = path6.basename(filename, path6.extname(filename));
2900
+ var basename3 = path7.basename(filename, path7.extname(filename));
2901
2901
  try {
2902
2902
  Object.defineProperty(returnedFn, "name", {
2903
2903
  value: basename3,
@@ -3058,8 +3058,8 @@ var require_ejs = __commonJS({
3058
3058
  });
3059
3059
 
3060
3060
  // index.ts
3061
- var fs5 = __toESM(require("fs"), 1);
3062
- var path5 = __toESM(require("path"), 1);
3061
+ var fs6 = __toESM(require("fs"), 1);
3062
+ var path6 = __toESM(require("path"), 1);
3063
3063
  var import_node_util = require("util");
3064
3064
  var import_prompts = __toESM(require_lib(), 1);
3065
3065
 
@@ -3424,11 +3424,14 @@ ${commandFor("lint")}
3424
3424
  var fs3 = __toESM(require("fs"), 1);
3425
3425
  var path3 = __toESM(require("path"), 1);
3426
3426
  function linkLocale(locale) {
3427
+ if (locale === "C") {
3428
+ return "en-US";
3429
+ }
3427
3430
  let linkedLocale;
3428
3431
  try {
3429
3432
  linkedLocale = Intl.getCanonicalLocales(locale)[0];
3430
3433
  } catch (error) {
3431
- console.log(`${error.toString()}
3434
+ console.log(`${error.toString()}, invalid language tag: "${locale}"
3432
3435
  `);
3433
3436
  }
3434
3437
  switch (linkedLocale) {
@@ -3465,9 +3468,9 @@ function getLanguage() {
3465
3468
  var fs4 = __toESM(require("fs"), 1);
3466
3469
  var path4 = __toESM(require("path"), 1);
3467
3470
 
3468
- // node_modules/.pnpm/@vue+create-eslint-config@0.6.1/node_modules/@vue/create-eslint-config/renderEjsFile.js
3471
+ // node_modules/.pnpm/@vue+create-eslint-config@0.7.2/node_modules/@vue/create-eslint-config/renderEjsFile.js
3469
3472
  var import_ejs = __toESM(require_ejs(), 1);
3470
- var templates = { "./templates/_editorconfig.ejs": "[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}]\ncharset = utf-8\nindent_size = 2\nindent_style = space\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n<%_ if (styleGuide === 'airbnb') { _%>\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// so we only configure them for airbnb style\n%>\nend_of_line = lf\nmax_line_length = 100\n<%_ } _%>\n", "./templates/_prettierrc.json.ejs": `<%_ if (styleGuide === 'airbnb') { _%>
3473
+ var templates = { "./templates/_editorconfig.ejs": "[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}]\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') { _%>
3471
3474
  {
3472
3475
  "$schema": "https://json.schemastore.org/prettierrc",
3473
3476
  "printWidth": 100,
@@ -3493,15 +3496,15 @@ var templates = { "./templates/_editorconfig.ejs": "[*.{js,jsx,mjs,cjs,ts,tsx,mt
3493
3496
  "printWidth": 100
3494
3497
  }
3495
3498
  <%_ } _%>
3496
- `, "./templates/eslint.config.js.ejs": "<%_ for (const { importer } of configsBeforeVuePlugin) { _%>\n<%- importer %>\n<%_ } _%>\nimport pluginVue from 'eslint-plugin-vue'\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 <%_ for (const { content } of configsBeforeVuePlugin) { _%>\n <%- content %><%# TODO: auto-indent if content's multi-line %>\n <%_ } _%>\n ...pluginVue.configs['flat/essential'],\n <%_ for (const { content } of configsAfterVuePlugin) { _%>\n <%- content %><%# TODO: auto-indent if content's multi-line %>\n <%_ } _%>\n]\n" };
3499
+ `, "./templates/eslint.config.js.ejs": "<%_ for (const { importer } of configsBeforeVuePlugin) { _%>\n<%- importer %>\n<%_ } _%>\nimport js from '@eslint/js'\nimport pluginVue from 'eslint-plugin-vue'\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<%_ 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" };
3497
3500
  function renderEjsFile(filePath, data) {
3498
3501
  return import_ejs.default.render(templates[filePath], data, {});
3499
3502
  }
3500
3503
 
3501
- // node_modules/.pnpm/@vue+create-eslint-config@0.6.1/node_modules/@vue/create-eslint-config/package.json
3504
+ // node_modules/.pnpm/@vue+create-eslint-config@0.7.2/node_modules/@vue/create-eslint-config/package.json
3502
3505
  var package_default = {
3503
3506
  name: "@vue/create-eslint-config",
3504
- version: "0.6.1",
3507
+ version: "0.7.2",
3505
3508
  description: "Utility to setup ESLint in Vue.js projects.",
3506
3509
  type: "module",
3507
3510
  main: "index.js",
@@ -3511,6 +3514,10 @@ var package_default = {
3511
3514
  engines: {
3512
3515
  node: "^16.14.0 || >= 18.0.0"
3513
3516
  },
3517
+ scripts: {
3518
+ test: 'echo "Error: no test specified" && exit 1',
3519
+ lint: "eslint --fix ."
3520
+ },
3514
3521
  repository: {
3515
3522
  type: "git",
3516
3523
  url: "git+https://github.com/vuejs/create-eslint-config.git"
@@ -3527,7 +3534,8 @@ var package_default = {
3527
3534
  },
3528
3535
  homepage: "https://github.com/vuejs/create-eslint-config#readme",
3529
3536
  publishConfig: {
3530
- access: "public"
3537
+ access: "public",
3538
+ provenance: true
3531
3539
  },
3532
3540
  dependencies: {
3533
3541
  ejs: "^3.1.10",
@@ -3535,25 +3543,22 @@ var package_default = {
3535
3543
  kolorist: "^1.8.0"
3536
3544
  },
3537
3545
  devDependencies: {
3538
- "@eslint/js": "^9.14.0",
3539
- "@types/node": "^22.8.7",
3546
+ "@eslint/js": "^9.18.0",
3547
+ "@types/node": "^22.10.6",
3540
3548
  "@vue/eslint-config-prettier": "^10.1.0",
3541
- "@vue/eslint-config-typescript": "^14.1.3",
3542
- eslint: "^9.14.0",
3543
- "eslint-plugin-oxlint": "^0.11.0",
3544
- "eslint-plugin-vue": "^9.30.0",
3545
- "npm-run-all2": "^7.0.1",
3546
- oxlint: "^0.11.0",
3547
- prettier: "^3.3.3",
3548
- typescript: "~5.6.0"
3549
- },
3550
- scripts: {
3551
- test: 'echo "Error: no test specified" && exit 1',
3552
- lint: "eslint --fix ."
3549
+ "@vue/eslint-config-typescript": "^14.3.0",
3550
+ eslint: "^9.18.0",
3551
+ "eslint-plugin-oxlint": "^0.15.6",
3552
+ "eslint-plugin-vue": "^9.32.0",
3553
+ jiti: "^2.4.2",
3554
+ "npm-run-all2": "^7.0.2",
3555
+ oxlint: "^0.15.6",
3556
+ prettier: "^3.4.2",
3557
+ typescript: "~5.7.0"
3553
3558
  }
3554
3559
  };
3555
3560
 
3556
- // node_modules/.pnpm/@vue+create-eslint-config@0.6.1/node_modules/@vue/create-eslint-config/index.js
3561
+ // node_modules/.pnpm/@vue+create-eslint-config@0.7.2/node_modules/@vue/create-eslint-config/index.js
3557
3562
  var versionMap = package_default.devDependencies;
3558
3563
  function createConfig({
3559
3564
  styleGuide = "default",
@@ -3572,25 +3577,12 @@ function createConfig({
3572
3577
  if (hasTypeScript) {
3573
3578
  fileExtensions.unshift("ts", "mts", "tsx");
3574
3579
  additionalConfigs.unshift({
3575
- devDependencies: pickDependencies(["@vue/eslint-config-typescript"]),
3576
- afterVuePlugin: [
3577
- {
3578
- importer: "import vueTsEslintConfig from '@vue/eslint-config-typescript'",
3579
- // TODO: supportedScriptLangs
3580
- content: "...vueTsEslintConfig(),"
3581
- }
3582
- ]
3580
+ devDependencies: pickDependencies(["@vue/eslint-config-typescript", "jiti"])
3583
3581
  });
3584
3582
  } else {
3585
3583
  fileExtensions.unshift("js", "mjs", "jsx");
3586
3584
  additionalConfigs.unshift({
3587
- devDependencies: pickDependencies(["@eslint/js"]),
3588
- beforeVuePlugin: [
3589
- {
3590
- importer: "import js from '@eslint/js'",
3591
- content: "js.configs.recommended,"
3592
- }
3593
- ]
3585
+ devDependencies: pickDependencies(["@eslint/js"])
3594
3586
  });
3595
3587
  }
3596
3588
  if (needsOxlint) {
@@ -3636,26 +3628,37 @@ function createConfig({
3636
3628
  }
3637
3629
  const templateData = {
3638
3630
  styleGuide,
3631
+ needsPrettier,
3639
3632
  fileExtensions,
3640
3633
  configsBeforeVuePlugin,
3641
3634
  configsAfterVuePlugin
3642
3635
  };
3643
3636
  const files = {
3644
- "eslint.config.js": renderEjsFile(
3645
- "./templates/eslint.config.js.ejs",
3646
- templateData
3647
- ),
3648
3637
  ".editorconfig": renderEjsFile(
3649
3638
  "./templates/_editorconfig.ejs",
3650
3639
  templateData
3651
3640
  )
3652
3641
  };
3642
+ if (hasTypeScript) {
3643
+ files["eslint.config.ts"] = renderEjsFile(
3644
+ "./templates/eslint.config.ts.ejs",
3645
+ templateData
3646
+ );
3647
+ } else {
3648
+ files["eslint.config.js"] = renderEjsFile(
3649
+ "./templates/eslint.config.js.ejs",
3650
+ templateData
3651
+ );
3652
+ }
3653
3653
  if (needsPrettier) {
3654
3654
  files[".prettierrc.json"] = renderEjsFile(
3655
3655
  "./templates/_prettierrc.json.ejs",
3656
3656
  templateData
3657
3657
  );
3658
3658
  }
3659
+ if (styleGuide !== "standard" || needsPrettier) {
3660
+ files[".gitattributes"] = renderEjsFile("./templates/_gitattributes", {});
3661
+ }
3659
3662
  return {
3660
3663
  pkg,
3661
3664
  files
@@ -3689,7 +3692,7 @@ function deepMerge2(target, obj) {
3689
3692
  // template/eslint/package.json
3690
3693
  var package_default2 = {
3691
3694
  devDependencies: {
3692
- "@vitest/eslint-plugin": "1.1.10",
3695
+ "@vitest/eslint-plugin": "1.1.25",
3693
3696
  "eslint-plugin-cypress": "^4.1.0",
3694
3697
  "eslint-plugin-playwright": "^2.1.0"
3695
3698
  }
@@ -3707,6 +3710,7 @@ function renderEslint(rootDir, {
3707
3710
  needsPlaywright
3708
3711
  }) {
3709
3712
  const additionalConfigs = getAdditionalConfigs({
3713
+ needsTypeScript,
3710
3714
  needsVitest,
3711
3715
  needsCypress,
3712
3716
  needsCypressCT,
@@ -3731,6 +3735,7 @@ function renderEslint(rootDir, {
3731
3735
  }
3732
3736
  }
3733
3737
  function getAdditionalConfigs({
3738
+ needsTypeScript,
3734
3739
  needsVitest,
3735
3740
  needsCypress,
3736
3741
  needsCypressCT,
@@ -3761,13 +3766,15 @@ function getAdditionalConfigs({
3761
3766
  },
3762
3767
  afterVuePlugin: [
3763
3768
  {
3764
- importer: "import pluginCypress from 'eslint-plugin-cypress/flat'",
3769
+ importer: (needsTypeScript ? `// eslint-disable-next-line @typescript-eslint/ban-ts-comment
3770
+ // @ts-ignore
3771
+ ` : "") + "import pluginCypress from 'eslint-plugin-cypress/flat'",
3765
3772
  content: `
3766
3773
  {
3767
3774
  ...pluginCypress.configs.recommended,
3768
3775
  files: [
3769
3776
  ${[
3770
- ...needsCypressCT ? ["'**/__tests__/*.{cy,spec}.{js,ts,jsx,tsx}',"] : [],
3777
+ ...needsCypressCT ? ["**/__tests__/*.{cy,spec}.{js,ts,jsx,tsx}"] : [],
3771
3778
  "cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}",
3772
3779
  "cypress/support/**/*.{js,ts,jsx,tsx}"
3773
3780
  ].map(JSON.stringify.bind(JSON)).join(",\n ").replace(
@@ -3801,6 +3808,116 @@ function getAdditionalConfigs({
3801
3808
  return additionalConfigs;
3802
3809
  }
3803
3810
 
3811
+ // utils/trimBoilerplate.ts
3812
+ var fs5 = __toESM(require("fs"), 1);
3813
+ var path5 = __toESM(require("path"), 1);
3814
+ function replaceContent(filepath, replacer) {
3815
+ const content = fs5.readFileSync(filepath, "utf8");
3816
+ fs5.writeFileSync(filepath, replacer(content));
3817
+ }
3818
+ function trimBoilerplate(rootDir) {
3819
+ const srcDir = path5.resolve(rootDir, "src");
3820
+ for (const filename of fs5.readdirSync(srcDir)) {
3821
+ if (["main.js", "main.ts", "router", "stores"].includes(filename)) {
3822
+ continue;
3823
+ }
3824
+ const fullpath = path5.resolve(srcDir, filename);
3825
+ fs5.rmSync(fullpath, { recursive: true });
3826
+ }
3827
+ }
3828
+ function removeCSSImport(rootDir, needsTypeScript, needsCypressCT) {
3829
+ const entryPath = path5.resolve(rootDir, needsTypeScript ? "src/main.ts" : "src/main.js");
3830
+ replaceContent(entryPath, (content) => content.replace("import './assets/main.css'\n\n", ""));
3831
+ if (needsCypressCT) {
3832
+ const ctSetupPath = path5.resolve(
3833
+ rootDir,
3834
+ needsTypeScript ? "cypress/support/component.ts" : "cypress/support/component.js"
3835
+ );
3836
+ replaceContent(
3837
+ ctSetupPath,
3838
+ (content) => content.replace("import '@/assets/main.css'", "// import '@/assets/main.css'")
3839
+ );
3840
+ }
3841
+ }
3842
+ function emptyRouterConfig(rootDir, needsTypeScript) {
3843
+ const srcDir = path5.resolve(rootDir, "src");
3844
+ const routerEntry = path5.resolve(srcDir, needsTypeScript ? "router/index.ts" : "router/index.js");
3845
+ replaceContent(
3846
+ routerEntry,
3847
+ (content) => content.replace(`import HomeView from '../views/HomeView.vue'
3848
+ `, "").replace(/routes:\s*\[[\s\S]*?\],/, "routes: [],")
3849
+ );
3850
+ }
3851
+
3852
+ // package.json
3853
+ var package_default3 = {
3854
+ name: "create-vue",
3855
+ version: "3.14.0",
3856
+ description: "\u{1F6E0}\uFE0F The recommended way to start a Vite-powered Vue project",
3857
+ type: "module",
3858
+ packageManager: "pnpm@9.15.4",
3859
+ bin: {
3860
+ "create-vue": "outfile.cjs"
3861
+ },
3862
+ files: [
3863
+ "locales",
3864
+ "outfile.cjs",
3865
+ "template"
3866
+ ],
3867
+ engines: {
3868
+ node: ">=v18.3.0"
3869
+ },
3870
+ scripts: {
3871
+ prepare: "husky",
3872
+ format: "prettier --write .",
3873
+ build: "zx ./scripts/build.mjs",
3874
+ snapshot: "zx ./scripts/snapshot.mjs",
3875
+ pretest: "pnpm run build && pnpm run snapshot",
3876
+ test: "zx ./scripts/test.mjs",
3877
+ "test:unit": "vitest",
3878
+ postversion: "zx ./scripts/postversion.mjs",
3879
+ prepublishOnly: "pnpm run build"
3880
+ },
3881
+ repository: {
3882
+ type: "git",
3883
+ url: "git+https://github.com/vuejs/create-vue.git"
3884
+ },
3885
+ keywords: [],
3886
+ author: "Haoqun Jiang <npm@haoqun.me>",
3887
+ license: "MIT",
3888
+ bugs: {
3889
+ url: "https://github.com/vuejs/create-vue/issues"
3890
+ },
3891
+ homepage: "https://github.com/vuejs/create-vue#readme",
3892
+ devDependencies: {
3893
+ "@tsconfig/node22": "^22.0.0",
3894
+ "@types/eslint": "^9.6.1",
3895
+ "@types/node": "^22.10.7",
3896
+ "@types/prompts": "^2.4.9",
3897
+ "@vue/create-eslint-config": "^0.7.2",
3898
+ "@vue/tsconfig": "^0.7.0",
3899
+ ejs: "^3.1.10",
3900
+ esbuild: "^0.24.2",
3901
+ "esbuild-plugin-license": "^1.2.3",
3902
+ husky: "^9.1.7",
3903
+ kleur: "^4.1.5",
3904
+ "lint-staged": "^15.4.1",
3905
+ prettier: "^3.4.2",
3906
+ prompts: "^2.4.2",
3907
+ vitest: "^3.0.2",
3908
+ zx: "^8.3.0"
3909
+ },
3910
+ "lint-staged": {
3911
+ "*.{js,ts,vue,json}": [
3912
+ "prettier --write"
3913
+ ]
3914
+ },
3915
+ publishConfig: {
3916
+ access: "public",
3917
+ provenance: true
3918
+ }
3919
+ };
3920
+
3804
3921
  // index.ts
3805
3922
  function isValidPackageName(projectName) {
3806
3923
  return /^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(projectName);
@@ -3809,10 +3926,10 @@ function toValidPackageName(projectName) {
3809
3926
  return projectName.trim().toLowerCase().replace(/\s+/g, "-").replace(/^[._]/, "").replace(/[^a-z0-9-~]+/g, "-");
3810
3927
  }
3811
3928
  function canSkipEmptying(dir) {
3812
- if (!fs5.existsSync(dir)) {
3929
+ if (!fs6.existsSync(dir)) {
3813
3930
  return true;
3814
3931
  }
3815
- const files = fs5.readdirSync(dir);
3932
+ const files = fs6.readdirSync(dir);
3816
3933
  if (files.length === 0) {
3817
3934
  return true;
3818
3935
  }
@@ -3822,21 +3939,62 @@ function canSkipEmptying(dir) {
3822
3939
  return false;
3823
3940
  }
3824
3941
  function emptyDir(dir) {
3825
- if (!fs5.existsSync(dir)) {
3942
+ if (!fs6.existsSync(dir)) {
3826
3943
  return;
3827
3944
  }
3828
3945
  postOrderDirectoryTraverse(
3829
3946
  dir,
3830
- (dir2) => fs5.rmdirSync(dir2),
3831
- (file) => fs5.unlinkSync(file)
3947
+ (dir2) => fs6.rmdirSync(dir2),
3948
+ (file) => fs6.unlinkSync(file)
3832
3949
  );
3833
3950
  }
3951
+ var helpMessage = `Usage: create-vue [FEATURE_FLAGS...] [OPTIONS...] [DIRECTORY]
3952
+
3953
+ Create a new Vue.js project.
3954
+ Start the CLI in interactive mode when no FEATURE_FLAGS is provided, or if the DIRECTORY argument is not a valid package name.
3955
+
3956
+ Options:
3957
+ --force
3958
+ Create the project even if the directory is not empty.
3959
+ --bare
3960
+ Create a barebone project without example code.
3961
+ --help
3962
+ Display this help message.
3963
+ --version
3964
+ Display the version number of this CLI.
3965
+
3966
+ Available feature flags:
3967
+ --default
3968
+ Create a project with the default configuration without any additional features.
3969
+ --ts, --typescript
3970
+ Add TypeScript support.
3971
+ --jsx
3972
+ Add JSX support.
3973
+ --router, --vue-router
3974
+ Add Vue Router for SPA development.
3975
+ --pinia
3976
+ Add Pinia for state management.
3977
+ --vitest
3978
+ Add Vitest for unit testing.
3979
+ --cypress
3980
+ Add Cypress for end-to-end testing.
3981
+ If used without ${cyan("--vitest")}, it will also add Cypress Component Testing.
3982
+ --playwright
3983
+ Add Playwright for end-to-end testing.
3984
+ --nightwatch
3985
+ Add Nightwatch for end-to-end testing.
3986
+ If used without ${cyan("--vitest")}, it will also add Nightwatch Component Testing.
3987
+ --eslint
3988
+ Add ESLint for code quality.
3989
+ --eslint-with-prettier
3990
+ Add Prettier for code formatting in addition to ESLint.
3991
+
3992
+ Unstable feature flags:
3993
+ --tests, --with-tests
3994
+ Add both unit testing and end-to-end testing support.
3995
+ Currently equivalent to ${cyan("--vitest --cypress")}, but may change in the future.
3996
+ `;
3834
3997
  async function init2() {
3835
- console.log();
3836
- console.log(
3837
- process.stdout.isTTY && process.stdout.getColorDepth() > 8 ? gradientBanner : defaultBanner
3838
- );
3839
- console.log();
3840
3998
  const cwd = process.cwd();
3841
3999
  const args = process.argv.slice(2);
3842
4000
  const options = {
@@ -3852,12 +4010,25 @@ async function init2() {
3852
4010
  options,
3853
4011
  strict: false
3854
4012
  });
4013
+ if (argv.help) {
4014
+ console.log(helpMessage);
4015
+ process.exit(0);
4016
+ }
4017
+ if (argv.version) {
4018
+ console.log(`${package_default3.name} v${package_default3.version}`);
4019
+ process.exit(0);
4020
+ }
3855
4021
  const isFeatureFlagsUsed = typeof (argv.default ?? (argv.ts || argv.typescript) ?? argv.jsx ?? (argv.router || argv["vue-router"]) ?? argv.pinia ?? (argv.tests || argv["with-tests"]) ?? argv.vitest ?? argv.cypress ?? argv.nightwatch ?? argv.playwright ?? argv.eslint ?? argv["eslint-with-prettier"]) === "boolean";
3856
4022
  let targetDir = positionals[0];
3857
4023
  const defaultProjectName = !targetDir ? "vue-project" : targetDir;
3858
4024
  const forceOverwrite = argv.force;
3859
4025
  const language = getLanguage();
3860
4026
  let result = {};
4027
+ console.log();
4028
+ console.log(
4029
+ process.stdout.isTTY && process.stdout.getColorDepth() > 8 ? gradientBanner : defaultBanner
4030
+ );
4031
+ console.log();
3861
4032
  try {
3862
4033
  result = await (0, import_prompts.default)(
3863
4034
  [
@@ -4025,20 +4196,20 @@ async function init2() {
4025
4196
  const needsNightwatch = argv.nightwatch || needsE2eTesting === "nightwatch";
4026
4197
  const needsNightwatchCT = needsNightwatch && !needsVitest;
4027
4198
  const needsPlaywright = argv.playwright || needsE2eTesting === "playwright";
4028
- const root = path5.join(cwd, targetDir);
4029
- if (fs5.existsSync(root) && shouldOverwrite) {
4199
+ const root = path6.join(cwd, targetDir);
4200
+ if (fs6.existsSync(root) && shouldOverwrite) {
4030
4201
  emptyDir(root);
4031
- } else if (!fs5.existsSync(root)) {
4032
- fs5.mkdirSync(root);
4202
+ } else if (!fs6.existsSync(root)) {
4203
+ fs6.mkdirSync(root);
4033
4204
  }
4034
4205
  console.log(`
4035
4206
  ${language.infos.scaffolding} ${root}...`);
4036
4207
  const pkg = { name: packageName, version: "0.0.0" };
4037
- fs5.writeFileSync(path5.resolve(root, "package.json"), JSON.stringify(pkg, null, 2));
4038
- const templateRoot = path5.resolve(__dirname, "template");
4208
+ fs6.writeFileSync(path6.resolve(root, "package.json"), JSON.stringify(pkg, null, 2));
4209
+ const templateRoot = path6.resolve(__dirname, "template");
4039
4210
  const callbacks = [];
4040
4211
  const render = function render2(templateName) {
4041
- const templateDir = path5.resolve(templateRoot, templateName);
4212
+ const templateDir = path6.resolve(templateRoot, templateName);
4042
4213
  renderTemplate_default(templateDir, root, callbacks);
4043
4214
  };
4044
4215
  render("base");
@@ -4115,8 +4286,8 @@ ${language.infos.scaffolding} ${root}...`);
4115
4286
  if (needsNightwatchCT) {
4116
4287
  render("tsconfig/nightwatch-ct");
4117
4288
  }
4118
- fs5.writeFileSync(
4119
- path5.resolve(root, "tsconfig.json"),
4289
+ fs6.writeFileSync(
4290
+ path6.resolve(root, "tsconfig.json"),
4120
4291
  JSON.stringify(rootTsConfig, null, 2) + "\n",
4121
4292
  "utf-8"
4122
4293
  );
@@ -4157,14 +4328,30 @@ ${language.infos.scaffolding} ${root}...`);
4157
4328
  },
4158
4329
  (filepath) => {
4159
4330
  if (filepath.endsWith(".ejs")) {
4160
- const template = fs5.readFileSync(filepath, "utf-8");
4331
+ const template = fs6.readFileSync(filepath, "utf-8");
4161
4332
  const dest = filepath.replace(/\.ejs$/, "");
4162
4333
  const content = import_ejs2.default.render(template, dataStore[dest]);
4163
- fs5.writeFileSync(dest, content);
4164
- fs5.unlinkSync(filepath);
4334
+ fs6.writeFileSync(dest, content);
4335
+ fs6.unlinkSync(filepath);
4165
4336
  }
4166
4337
  }
4167
4338
  );
4339
+ if (argv.bare) {
4340
+ trimBoilerplate(root);
4341
+ render("bare/base");
4342
+ if (needsTypeScript) {
4343
+ render("bare/typescript");
4344
+ }
4345
+ if (needsVitest) {
4346
+ render("bare/vitest");
4347
+ }
4348
+ if (needsCypressCT) {
4349
+ render("bare/cypress-ct");
4350
+ }
4351
+ if (needsNightwatchCT) {
4352
+ render("bare/nightwatch-ct");
4353
+ }
4354
+ }
4168
4355
  if (needsTypeScript) {
4169
4356
  preOrderDirectoryTraverse(
4170
4357
  root,
@@ -4173,19 +4360,19 @@ ${language.infos.scaffolding} ${root}...`);
4173
4360
  (filepath) => {
4174
4361
  if (filepath.endsWith(".js") && !filepath.endsWith("eslint.config.js")) {
4175
4362
  const tsFilePath = filepath.replace(/\.js$/, ".ts");
4176
- if (fs5.existsSync(tsFilePath)) {
4177
- fs5.unlinkSync(filepath);
4363
+ if (fs6.existsSync(tsFilePath)) {
4364
+ fs6.unlinkSync(filepath);
4178
4365
  } else {
4179
- fs5.renameSync(filepath, tsFilePath);
4366
+ fs6.renameSync(filepath, tsFilePath);
4180
4367
  }
4181
- } else if (path5.basename(filepath) === "jsconfig.json") {
4182
- fs5.unlinkSync(filepath);
4368
+ } else if (path6.basename(filepath) === "jsconfig.json") {
4369
+ fs6.unlinkSync(filepath);
4183
4370
  }
4184
4371
  }
4185
4372
  );
4186
- const indexHtmlPath = path5.resolve(root, "index.html");
4187
- const indexHtmlContent = fs5.readFileSync(indexHtmlPath, "utf8");
4188
- fs5.writeFileSync(indexHtmlPath, indexHtmlContent.replace("src/main.js", "src/main.ts"));
4373
+ const indexHtmlPath = path6.resolve(root, "index.html");
4374
+ const indexHtmlContent = fs6.readFileSync(indexHtmlPath, "utf8");
4375
+ fs6.writeFileSync(indexHtmlPath, indexHtmlContent.replace("src/main.js", "src/main.ts"));
4189
4376
  } else {
4190
4377
  preOrderDirectoryTraverse(
4191
4378
  root,
@@ -4193,15 +4380,21 @@ ${language.infos.scaffolding} ${root}...`);
4193
4380
  },
4194
4381
  (filepath) => {
4195
4382
  if (filepath.endsWith(".ts")) {
4196
- fs5.unlinkSync(filepath);
4383
+ fs6.unlinkSync(filepath);
4197
4384
  }
4198
4385
  }
4199
4386
  );
4200
4387
  }
4388
+ if (argv.bare) {
4389
+ removeCSSImport(root, needsTypeScript, needsCypressCT);
4390
+ if (needsRouter) {
4391
+ emptyRouterConfig(root, needsTypeScript);
4392
+ }
4393
+ }
4201
4394
  const userAgent = process.env.npm_config_user_agent ?? "";
4202
4395
  const packageManager = /pnpm/.test(userAgent) ? "pnpm" : /yarn/.test(userAgent) ? "yarn" : /bun/.test(userAgent) ? "bun" : "npm";
4203
- fs5.writeFileSync(
4204
- path5.resolve(root, "README.md"),
4396
+ fs6.writeFileSync(
4397
+ path6.resolve(root, "README.md"),
4205
4398
  generateReadme({
4206
4399
  projectName: result.projectName ?? result.packageName ?? defaultProjectName,
4207
4400
  packageManager,
@@ -4219,7 +4412,7 @@ ${language.infos.scaffolding} ${root}...`);
4219
4412
  ${language.infos.done}
4220
4413
  `);
4221
4414
  if (root !== cwd) {
4222
- const cdProjectName = path5.relative(cwd, root);
4415
+ const cdProjectName = path6.relative(cwd, root);
4223
4416
  console.log(
4224
4417
  ` ${bold(green(`cd ${cdProjectName.includes(" ") ? `"${cdProjectName}"` : cdProjectName}`))}`
4225
4418
  );