create-vue 3.0.7 → 3.1.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/outfile.cjs +86 -40
- package/package.json +13 -14
- package/template/base/node_modules/.bin/vite +4 -4
- package/template/base/package.json +2 -2
- package/template/{code/default → config/cypress}/cypress/integration/example.spec.js +0 -0
- package/template/config/cypress/cypress/plugins/index.js +0 -5
- package/template/config/cypress/cypress/plugins/index.ts +21 -0
- package/template/config/cypress/cypress.json +1 -5
- package/template/config/cypress/node_modules/.bin/cypress +4 -4
- package/template/config/cypress/package.json +1 -5
- package/template/config/cypress-ct/cypress/plugins/index.js +29 -0
- package/template/config/{typescript → cypress-ct}/cypress/plugins/index.ts +0 -0
- package/template/config/cypress-ct/cypress.json +7 -0
- package/template/config/cypress-ct/node_modules/.bin/cypress +17 -0
- package/template/config/cypress-ct/node_modules/.bin/vite +17 -0
- package/template/config/cypress-ct/package.json +15 -0
- package/template/{code/default → config/cypress-ct}/src/components/__tests__/HelloWorld.spec.js +0 -0
- package/template/config/pinia/package.json +2 -1
- package/template/config/router/package.json +1 -0
- package/template/config/typescript/package.json +1 -1
- package/template/config/vitest/node_modules/.bin/vitest +17 -0
- package/template/config/vitest/package.json +13 -0
- package/template/config/vitest/src/components/__tests__/HelloWorld.spec.js +11 -0
- package/template/config/vuex/package.json +1 -0
- package/template/code/router/cypress/integration/example.spec.js +0 -13
- package/template/code/router/src/components/__tests__/HelloWorld.spec.js +0 -13
- package/template/code/typescript-default/cypress/integration/example.spec.ts +0 -8
- package/template/code/typescript-default/src/components/__tests__/HelloWorld.spec.ts +0 -13
- package/template/code/typescript-router/cypress/integration/example.spec.ts +0 -13
- package/template/code/typescript-router/src/components/__tests__/HelloWorld.spec.ts +0 -13
package/outfile.cjs
CHANGED
|
@@ -3,8 +3,22 @@ var __create = Object.create;
|
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
8
22
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
9
23
|
var __commonJS = (cb, mod) => function __require() {
|
|
10
24
|
return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
@@ -5181,7 +5195,7 @@ var require_lib = __commonJS({
|
|
|
5181
5195
|
for (question of questions) {
|
|
5182
5196
|
({ name, type } = question);
|
|
5183
5197
|
if (typeof type === "function") {
|
|
5184
|
-
type = await type(answer, {
|
|
5198
|
+
type = await type(answer, __spreadValues({}, answers), question);
|
|
5185
5199
|
question["type"] = type;
|
|
5186
5200
|
}
|
|
5187
5201
|
if (!type)
|
|
@@ -5190,7 +5204,7 @@ var require_lib = __commonJS({
|
|
|
5190
5204
|
if (passOn.includes(key))
|
|
5191
5205
|
continue;
|
|
5192
5206
|
let value = question[key];
|
|
5193
|
-
question[key] = typeof value === "function" ? await value(answer, {
|
|
5207
|
+
question[key] = typeof value === "function" ? await value(answer, __spreadValues({}, answers), lastPrompt) : value;
|
|
5194
5208
|
}
|
|
5195
5209
|
lastPrompt = question;
|
|
5196
5210
|
if (typeof question.message !== "string") {
|
|
@@ -5377,10 +5391,7 @@ function sortDependencies(packageJson) {
|
|
|
5377
5391
|
});
|
|
5378
5392
|
}
|
|
5379
5393
|
}
|
|
5380
|
-
return {
|
|
5381
|
-
...packageJson,
|
|
5382
|
-
...sorted
|
|
5383
|
-
};
|
|
5394
|
+
return __spreadValues(__spreadValues({}, packageJson), sorted);
|
|
5384
5395
|
}
|
|
5385
5396
|
|
|
5386
5397
|
// utils/renderTemplate.js
|
|
@@ -5457,7 +5468,7 @@ var sfcTypeSupportDoc = [
|
|
|
5457
5468
|
"",
|
|
5458
5469
|
"TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.",
|
|
5459
5470
|
"",
|
|
5460
|
-
"If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471) that is more performant. You can enable it by the following steps:",
|
|
5471
|
+
"If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:",
|
|
5461
5472
|
"",
|
|
5462
5473
|
"1. Disable the built-in TypeScript Extension",
|
|
5463
5474
|
" 1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette",
|
|
@@ -5469,7 +5480,9 @@ function generateReadme({
|
|
|
5469
5480
|
projectName,
|
|
5470
5481
|
packageManager,
|
|
5471
5482
|
needsTypeScript,
|
|
5472
|
-
|
|
5483
|
+
needsCypress,
|
|
5484
|
+
needsCypressCT,
|
|
5485
|
+
needsVitest,
|
|
5473
5486
|
needsEslint
|
|
5474
5487
|
}) {
|
|
5475
5488
|
let readme = `# ${projectName}
|
|
@@ -5503,14 +5516,26 @@ ${getCommand(packageManager, "dev")}
|
|
|
5503
5516
|
${getCommand(packageManager, "build")}
|
|
5504
5517
|
\`\`\`
|
|
5505
5518
|
`;
|
|
5506
|
-
if (
|
|
5519
|
+
if (needsVitest) {
|
|
5520
|
+
npmScriptsDescriptions += `
|
|
5521
|
+
### Run Unit Tests with [Vitest](https://vitest.dev/)
|
|
5522
|
+
|
|
5523
|
+
\`\`\`sh
|
|
5524
|
+
${getCommand(packageManager, "test:unit")}
|
|
5525
|
+
\`\`\`
|
|
5526
|
+
`;
|
|
5527
|
+
}
|
|
5528
|
+
if (needsCypressCT) {
|
|
5507
5529
|
npmScriptsDescriptions += `
|
|
5508
5530
|
### Run Unit Tests with [Cypress Component Testing](https://docs.cypress.io/guides/component-testing/introduction)
|
|
5509
5531
|
|
|
5510
5532
|
\`\`\`sh
|
|
5511
5533
|
${getCommand(packageManager, "test:unit")} # or \`${getCommand(packageManager, "test:unit:ci")}\` for headless testing
|
|
5512
5534
|
\`\`\`
|
|
5513
|
-
|
|
5535
|
+
`;
|
|
5536
|
+
}
|
|
5537
|
+
if (needsCypress) {
|
|
5538
|
+
npmScriptsDescriptions += `
|
|
5514
5539
|
### Run End-to-End Tests with [Cypress](https://www.cypress.io/)
|
|
5515
5540
|
|
|
5516
5541
|
\`\`\`sh
|
|
@@ -5561,13 +5586,7 @@ var config = {
|
|
|
5561
5586
|
"vue/setup-compiler-macros": true
|
|
5562
5587
|
}
|
|
5563
5588
|
};
|
|
5564
|
-
|
|
5565
|
-
{
|
|
5566
|
-
files: ["**/__tests__/*.spec.{js,ts,jsx,tsx}", "cypress/integration/**.spec.{js,ts,jsx,tsx}"],
|
|
5567
|
-
extends: ["plugin:cypress/recommended"]
|
|
5568
|
-
}
|
|
5569
|
-
];
|
|
5570
|
-
function configureEslint({ language, styleGuide, needsPrettier, needsCypress }) {
|
|
5589
|
+
function configureEslint({ language, styleGuide, needsPrettier, needsCypress, needsCypressCT }) {
|
|
5571
5590
|
switch (`${styleGuide}-${language}`) {
|
|
5572
5591
|
case "default-javascript":
|
|
5573
5592
|
config.extends.push("eslint:recommended");
|
|
@@ -5584,6 +5603,12 @@ function configureEslint({ language, styleGuide, needsPrettier, needsCypress })
|
|
|
5584
5603
|
config.extends.push("@vue/eslint-config-prettier");
|
|
5585
5604
|
}
|
|
5586
5605
|
if (needsCypress) {
|
|
5606
|
+
const cypressOverrides = [
|
|
5607
|
+
{
|
|
5608
|
+
files: needsCypressCT ? ["**/__tests__/*.spec.{js,ts,jsx,tsx}", "cypress/integration/**.spec.{js,ts,jsx,tsx}"] : ["cypress/integration/**.spec.{js,ts,jsx,tsx}"],
|
|
5609
|
+
extends: ["plugin:cypress/recommended"]
|
|
5610
|
+
}
|
|
5611
|
+
];
|
|
5587
5612
|
addEslintDependency("eslint-plugin-cypress");
|
|
5588
5613
|
config.overrides = cypressOverrides;
|
|
5589
5614
|
}
|
|
@@ -5601,12 +5626,13 @@ function configureEslint({ language, styleGuide, needsPrettier, needsCypress })
|
|
|
5601
5626
|
configuration
|
|
5602
5627
|
};
|
|
5603
5628
|
}
|
|
5604
|
-
function renderEslint(rootDir, { needsTypeScript,
|
|
5629
|
+
function renderEslint(rootDir, { needsTypeScript, needsCypress, needsCypressCT, needsPrettier }) {
|
|
5605
5630
|
const { dependencies: dependencies2, configuration } = configureEslint({
|
|
5606
5631
|
language: needsTypeScript ? "typescript" : "javascript",
|
|
5607
5632
|
styleGuide: "default",
|
|
5608
5633
|
needsPrettier,
|
|
5609
|
-
needsCypress
|
|
5634
|
+
needsCypress,
|
|
5635
|
+
needsCypressCT
|
|
5610
5636
|
});
|
|
5611
5637
|
const packageJsonPath = import_path3.default.resolve(rootDir, "package.json");
|
|
5612
5638
|
const existingPkg = JSON.parse(import_fs4.default.readFileSync(packageJsonPath));
|
|
@@ -5636,6 +5662,9 @@ function canSafelyOverwrite(dir) {
|
|
|
5636
5662
|
return !import_fs5.default.existsSync(dir) || import_fs5.default.readdirSync(dir).length === 0;
|
|
5637
5663
|
}
|
|
5638
5664
|
function emptyDir(dir) {
|
|
5665
|
+
if (!import_fs5.default.existsSync(dir)) {
|
|
5666
|
+
return;
|
|
5667
|
+
}
|
|
5639
5668
|
postOrderDirectoryTraverse(dir, (dir2) => import_fs5.default.rmdirSync(dir2), (file) => import_fs5.default.unlinkSync(file));
|
|
5640
5669
|
}
|
|
5641
5670
|
async function init() {
|
|
@@ -5646,12 +5675,12 @@ ${banner_default}
|
|
|
5646
5675
|
const argv = (0, import_minimist.default)(process.argv.slice(2), {
|
|
5647
5676
|
alias: {
|
|
5648
5677
|
typescript: ["ts"],
|
|
5649
|
-
"with-tests": ["tests"
|
|
5678
|
+
"with-tests": ["tests"],
|
|
5650
5679
|
router: ["vue-router"]
|
|
5651
5680
|
},
|
|
5652
5681
|
boolean: true
|
|
5653
5682
|
});
|
|
5654
|
-
const isFeatureFlagsUsed = typeof (argv.default || argv.ts || argv.jsx || argv.router || argv.pinia || argv.tests || argv.eslint) === "boolean";
|
|
5683
|
+
const isFeatureFlagsUsed = typeof (argv.default || argv.ts || argv.jsx || argv.router || argv.pinia || argv.tests || argv.vitest || argv.cypress || argv.eslint) === "boolean";
|
|
5655
5684
|
let targetDir = argv._[0];
|
|
5656
5685
|
const defaultProjectName = !targetDir ? "vue-project" : targetDir;
|
|
5657
5686
|
const forceOverwrite = argv.force;
|
|
@@ -5722,9 +5751,17 @@ ${banner_default}
|
|
|
5722
5751
|
inactive: "No"
|
|
5723
5752
|
},
|
|
5724
5753
|
{
|
|
5725
|
-
name: "
|
|
5754
|
+
name: "needsVitest",
|
|
5755
|
+
type: () => isFeatureFlagsUsed ? null : "toggle",
|
|
5756
|
+
message: "Add Vitest for Unit Testing?",
|
|
5757
|
+
initial: false,
|
|
5758
|
+
active: "Yes",
|
|
5759
|
+
inactive: "No"
|
|
5760
|
+
},
|
|
5761
|
+
{
|
|
5762
|
+
name: "needsCypress",
|
|
5726
5763
|
type: () => isFeatureFlagsUsed ? null : "toggle",
|
|
5727
|
-
message: "Add Cypress for testing?",
|
|
5764
|
+
message: (prev, answers) => answers.needsVitest ? "Add Cypress for End-to-End testing?" : "Add Cypress for both Unit and End-to-End testing?",
|
|
5728
5765
|
initial: false,
|
|
5729
5766
|
active: "Yes",
|
|
5730
5767
|
inactive: "No"
|
|
@@ -5760,18 +5797,21 @@ ${banner_default}
|
|
|
5760
5797
|
process.exit(1);
|
|
5761
5798
|
}
|
|
5762
5799
|
const {
|
|
5763
|
-
|
|
5764
|
-
|
|
5800
|
+
projectName,
|
|
5801
|
+
packageName = projectName,
|
|
5802
|
+
shouldOverwrite = argv.force,
|
|
5765
5803
|
needsJsx = argv.jsx,
|
|
5766
5804
|
needsTypeScript = argv.typescript,
|
|
5767
5805
|
needsRouter = argv.router,
|
|
5768
5806
|
needsPinia = argv.pinia,
|
|
5769
|
-
|
|
5807
|
+
needsCypress = argv.cypress || argv.tests,
|
|
5808
|
+
needsVitest = argv.vitest || argv.tests,
|
|
5770
5809
|
needsEslint = argv.eslint || argv["eslint-with-prettier"],
|
|
5771
5810
|
needsPrettier = argv["eslint-with-prettier"]
|
|
5772
5811
|
} = result;
|
|
5812
|
+
const needsCypressCT = needsCypress && !needsVitest;
|
|
5773
5813
|
const root = import_path4.default.join(cwd, targetDir);
|
|
5774
|
-
if (shouldOverwrite) {
|
|
5814
|
+
if (import_fs5.default.existsSync(root) && shouldOverwrite) {
|
|
5775
5815
|
emptyDir(root);
|
|
5776
5816
|
} else if (!import_fs5.default.existsSync(root)) {
|
|
5777
5817
|
import_fs5.default.mkdirSync(root);
|
|
@@ -5795,14 +5835,20 @@ Scaffolding project in ${root}...`);
|
|
|
5795
5835
|
if (needsPinia) {
|
|
5796
5836
|
render("config/pinia");
|
|
5797
5837
|
}
|
|
5798
|
-
if (
|
|
5838
|
+
if (needsVitest) {
|
|
5839
|
+
render("config/vitest");
|
|
5840
|
+
}
|
|
5841
|
+
if (needsCypress) {
|
|
5799
5842
|
render("config/cypress");
|
|
5800
5843
|
}
|
|
5844
|
+
if (needsCypressCT) {
|
|
5845
|
+
render("config/cypress-ct");
|
|
5846
|
+
}
|
|
5801
5847
|
if (needsTypeScript) {
|
|
5802
5848
|
render("config/typescript");
|
|
5803
5849
|
}
|
|
5804
5850
|
if (needsEslint) {
|
|
5805
|
-
renderEslint(root, { needsTypeScript,
|
|
5851
|
+
renderEslint(root, { needsTypeScript, needsCypress, needsCypressCT, needsPrettier });
|
|
5806
5852
|
}
|
|
5807
5853
|
const codeTemplate = (needsTypeScript ? "typescript-" : "") + (needsRouter ? "router" : "default");
|
|
5808
5854
|
render(`code/${codeTemplate}`);
|
|
@@ -5832,23 +5878,23 @@ Scaffolding project in ${root}...`);
|
|
|
5832
5878
|
const indexHtmlPath = import_path4.default.resolve(root, "index.html");
|
|
5833
5879
|
const indexHtmlContent = import_fs5.default.readFileSync(indexHtmlPath, "utf8");
|
|
5834
5880
|
import_fs5.default.writeFileSync(indexHtmlPath, indexHtmlContent.replace("src/main.js", "src/main.ts"));
|
|
5835
|
-
}
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
import_fs5.default.rmdirSync(dirpath);
|
|
5842
|
-
}
|
|
5843
|
-
}, () => {
|
|
5881
|
+
} else {
|
|
5882
|
+
preOrderDirectoryTraverse(root, () => {
|
|
5883
|
+
}, (filepath) => {
|
|
5884
|
+
if (filepath.endsWith(".ts")) {
|
|
5885
|
+
import_fs5.default.unlinkSync(filepath);
|
|
5886
|
+
}
|
|
5844
5887
|
});
|
|
5845
5888
|
}
|
|
5846
|
-
const
|
|
5889
|
+
const userAgent = process.env.npm_config_user_agent ?? "";
|
|
5890
|
+
const packageManager = /pnpm/.test(userAgent) ? "pnpm" : /yarn/.test(userAgent) ? "yarn" : "npm";
|
|
5847
5891
|
import_fs5.default.writeFileSync(import_path4.default.resolve(root, "README.md"), generateReadme({
|
|
5848
5892
|
projectName: result.projectName || defaultProjectName,
|
|
5849
5893
|
packageManager,
|
|
5850
5894
|
needsTypeScript,
|
|
5851
|
-
|
|
5895
|
+
needsVitest,
|
|
5896
|
+
needsCypress,
|
|
5897
|
+
needsCypressCT,
|
|
5852
5898
|
needsEslint
|
|
5853
5899
|
}));
|
|
5854
5900
|
console.log(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-vue",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "An easy way to start a Vue project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -13,15 +13,6 @@
|
|
|
13
13
|
"engines": {
|
|
14
14
|
"node": "^14.13.1 || >=16.0.0"
|
|
15
15
|
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"prepare": "husky install",
|
|
18
|
-
"format": "prettier --write .",
|
|
19
|
-
"build": "esbuild --bundle index.js --format=cjs --platform=node --outfile=outfile.cjs",
|
|
20
|
-
"snapshot": "node snapshot.js",
|
|
21
|
-
"pretest": "run-s build snapshot",
|
|
22
|
-
"test": "node test.js",
|
|
23
|
-
"prepublishOnly": "zx ./scripts/prepublish.mjs"
|
|
24
|
-
},
|
|
25
16
|
"repository": {
|
|
26
17
|
"type": "git",
|
|
27
18
|
"url": "git+https://github.com/vuejs/create-vue.git"
|
|
@@ -37,16 +28,24 @@
|
|
|
37
28
|
"esbuild": "^0.13.15",
|
|
38
29
|
"husky": "^7.0.4",
|
|
39
30
|
"kolorist": "^1.5.1",
|
|
40
|
-
"lint-staged": "^12.
|
|
31
|
+
"lint-staged": "^12.2.0",
|
|
41
32
|
"minimist": "^1.2.5",
|
|
42
33
|
"npm-run-all": "^4.1.5",
|
|
43
34
|
"prettier": "^2.5.1",
|
|
44
35
|
"prompts": "^2.4.2",
|
|
45
|
-
"zx": "^4.
|
|
36
|
+
"zx": "^4.3.0"
|
|
46
37
|
},
|
|
47
38
|
"lint-staged": {
|
|
48
39
|
"*.{js,ts,vue,json}": [
|
|
49
40
|
"prettier --write"
|
|
50
41
|
]
|
|
51
|
-
}
|
|
52
|
-
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"format": "prettier --write .",
|
|
45
|
+
"build": "esbuild --bundle index.js --format=cjs --platform=node --target=node14 --outfile=outfile.cjs",
|
|
46
|
+
"snapshot": "zx ./scripts/snapshot.mjs",
|
|
47
|
+
"pretest": "run-s build snapshot",
|
|
48
|
+
"test": "zx ./scripts/test.mjs"
|
|
49
|
+
},
|
|
50
|
+
"readme": "# create-vue\n\n[](https://open.vscode.dev/vuejs/create-vue)\n\nAn easy way to start a Vue project\n\n## Usage\n\n```sh\nnpm init vue@3\n```\n\nOr, if you need to support IE11, you can create a Vue 2 project with:\n\n```sh\nnpm init vue@2\n```\n"
|
|
51
|
+
}
|
|
@@ -6,12 +6,12 @@ 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@2.7.
|
|
9
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules/vite/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules/vite/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/base/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
10
10
|
else
|
|
11
|
-
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.
|
|
11
|
+
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules/vite/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules/vite/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/base/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/vite@2.7.
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/vite@2.7.13/node_modules/vite/bin/vite.js" "$@"
|
|
15
15
|
else
|
|
16
|
-
exec node "$basedir/../../../../node_modules/.pnpm/vite@2.7.
|
|
16
|
+
exec node "$basedir/../../../../node_modules/.pnpm/vite@2.7.13/node_modules/vite/bin/vite.js" "$@"
|
|
17
17
|
fi
|
|
File without changes
|
|
@@ -13,8 +13,6 @@
|
|
|
13
13
|
// This function is called when a project is opened or re-opened (e.g. due to
|
|
14
14
|
// the project's config changing)
|
|
15
15
|
|
|
16
|
-
const { startDevServer } = require('@cypress/vite-dev-server')
|
|
17
|
-
|
|
18
16
|
/**
|
|
19
17
|
* @type {Cypress.PluginConfig}
|
|
20
18
|
*/
|
|
@@ -22,8 +20,5 @@ const { startDevServer } = require('@cypress/vite-dev-server')
|
|
|
22
20
|
module.exports = (on, config) => {
|
|
23
21
|
// `on` is used to hook into various events Cypress emits
|
|
24
22
|
// `config` is the resolved Cypress config
|
|
25
|
-
on('dev-server:start', (options) => {
|
|
26
|
-
return startDevServer({ options })
|
|
27
|
-
})
|
|
28
23
|
return config
|
|
29
24
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* eslint-env node */
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="cypress" />
|
|
4
|
+
// ***********************************************************
|
|
5
|
+
// This example plugins/index.ts can be used to load plugins
|
|
6
|
+
//
|
|
7
|
+
// You can change the location of this file or turn off loading
|
|
8
|
+
// the plugins file with the 'pluginsFile' configuration option.
|
|
9
|
+
//
|
|
10
|
+
// You can read more here:
|
|
11
|
+
// https://on.cypress.io/plugins-guide
|
|
12
|
+
// ***********************************************************
|
|
13
|
+
|
|
14
|
+
// This function is called when a project is opened or re-opened (e.g. due to
|
|
15
|
+
// the project's config changing)
|
|
16
|
+
|
|
17
|
+
export default ((on, config) => {
|
|
18
|
+
// `on` is used to hook into various events Cypress emits
|
|
19
|
+
// `config` is the resolved Cypress config
|
|
20
|
+
return config
|
|
21
|
+
}) as Cypress.PluginConfig
|
|
@@ -6,12 +6,12 @@ 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@9.
|
|
9
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/cypress/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
10
10
|
else
|
|
11
|
-
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.
|
|
11
|
+
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/cypress/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/cypress@9.
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/bin/cypress" "$@"
|
|
15
15
|
else
|
|
16
|
-
exec node "$basedir/../../../../../node_modules/.pnpm/cypress@9.
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/bin/cypress" "$@"
|
|
17
17
|
fi
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"scripts": {
|
|
3
|
-
"test:unit": "cypress open-ct",
|
|
4
|
-
"test:unit:ci": "cypress run-ct --quiet --reporter spec",
|
|
5
3
|
"test:e2e": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress open'",
|
|
6
4
|
"test:e2e:ci": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress run'"
|
|
7
5
|
},
|
|
8
6
|
"devDependencies": {
|
|
9
|
-
"
|
|
10
|
-
"@cypress/vue": "^3.1.0",
|
|
11
|
-
"cypress": "^9.2.0",
|
|
7
|
+
"cypress": "^9.3.1",
|
|
12
8
|
"start-server-and-test": "^1.14.0"
|
|
13
9
|
}
|
|
14
10
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* eslint-env node */
|
|
2
|
+
/// <reference types="cypress" />
|
|
3
|
+
// ***********************************************************
|
|
4
|
+
// This example plugins/index.js can be used to load plugins
|
|
5
|
+
//
|
|
6
|
+
// You can change the location of this file or turn off loading
|
|
7
|
+
// the plugins file with the 'pluginsFile' configuration option.
|
|
8
|
+
//
|
|
9
|
+
// You can read more here:
|
|
10
|
+
// https://on.cypress.io/plugins-guide
|
|
11
|
+
// ***********************************************************
|
|
12
|
+
|
|
13
|
+
// This function is called when a project is opened or re-opened (e.g. due to
|
|
14
|
+
// the project's config changing)
|
|
15
|
+
|
|
16
|
+
const { startDevServer } = require('@cypress/vite-dev-server')
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @type {Cypress.PluginConfig}
|
|
20
|
+
*/
|
|
21
|
+
// eslint-disable-next-line no-unused-vars
|
|
22
|
+
module.exports = (on, config) => {
|
|
23
|
+
// `on` is used to hook into various events Cypress emits
|
|
24
|
+
// `config` is the resolved Cypress config
|
|
25
|
+
on('dev-server:start', (options) => {
|
|
26
|
+
return startDevServer({ options })
|
|
27
|
+
})
|
|
28
|
+
return config
|
|
29
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/cypress-ct/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/cypress-ct/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/bin/cypress" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/bin/cypress" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules/vite/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules/vite/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/cypress-ct/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules/vite/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules/vite/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/cypress-ct/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vite@2.7.13/node_modules/vite/bin/vite.js" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/vite@2.7.13/node_modules/vite/bin/vite.js" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scripts": {
|
|
3
|
+
"test:unit": "cypress open-ct",
|
|
4
|
+
"test:unit:ci": "cypress run-ct --quiet --reporter spec"
|
|
5
|
+
},
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"vue": "^3.2.27"
|
|
8
|
+
},
|
|
9
|
+
"devDependencies": {
|
|
10
|
+
"@cypress/vite-dev-server": "^2.2.2",
|
|
11
|
+
"@cypress/vue": "^3.1.0",
|
|
12
|
+
"cypress": "^9.3.1",
|
|
13
|
+
"vite": "^2.7.13"
|
|
14
|
+
}
|
|
15
|
+
}
|
package/template/{code/default → config/cypress-ct}/src/components/__tests__/HelloWorld.spec.js
RENAMED
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vitest@0.1.23_jsdom@19.0.0/node_modules/vitest/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vitest@0.1.23_jsdom@19.0.0/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/vitest/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vitest@0.1.23_jsdom@19.0.0/node_modules/vitest/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vitest@0.1.23_jsdom@19.0.0/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/vitest/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vitest@0.1.23_jsdom@19.0.0/node_modules/vitest/vitest.mjs" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/vitest@0.1.23_jsdom@19.0.0/node_modules/vitest/vitest.mjs" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
|
|
3
|
+
import { mount } from '@vue/test-utils'
|
|
4
|
+
import HelloWorld from '../HelloWorld.vue'
|
|
5
|
+
|
|
6
|
+
describe('HelloWorld', () => {
|
|
7
|
+
it('renders properly', () => {
|
|
8
|
+
const wrapper = mount(HelloWorld, { props: { msg: 'Hello Vitest' } })
|
|
9
|
+
expect(wrapper.text()).toContain('Hello Vitest')
|
|
10
|
+
})
|
|
11
|
+
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// https://docs.cypress.io/api/introduction/api.html
|
|
2
|
-
|
|
3
|
-
describe('My First Test', () => {
|
|
4
|
-
it('visits the app root url', () => {
|
|
5
|
-
cy.visit('/')
|
|
6
|
-
cy.contains('h1', 'You did it!')
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
it('navigates to the about page', () => {
|
|
10
|
-
cy.visit('/about')
|
|
11
|
-
cy.contains('h1', 'This is an about page')
|
|
12
|
-
})
|
|
13
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { mount } from '@cypress/vue'
|
|
2
|
-
import HelloWorld from '../HelloWorld.vue'
|
|
3
|
-
|
|
4
|
-
describe('HelloWorld', () => {
|
|
5
|
-
it('playground', () => {
|
|
6
|
-
mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
it('renders properly', () => {
|
|
10
|
-
mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
|
|
11
|
-
cy.get('h1').should('contain', 'Hello Cypress')
|
|
12
|
-
})
|
|
13
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { mount } from '@cypress/vue'
|
|
2
|
-
import HelloWorld from '../HelloWorld.vue'
|
|
3
|
-
|
|
4
|
-
describe('HelloWorld', () => {
|
|
5
|
-
it('playground', () => {
|
|
6
|
-
mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
it('renders properly', () => {
|
|
10
|
-
mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
|
|
11
|
-
cy.get('h1').should('contain', 'Hello Cypress')
|
|
12
|
-
})
|
|
13
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// https://docs.cypress.io/api/introduction/api.html
|
|
2
|
-
|
|
3
|
-
describe('My First Test', () => {
|
|
4
|
-
it('visits the app root url', () => {
|
|
5
|
-
cy.visit('/')
|
|
6
|
-
cy.contains('h1', 'You did it!')
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
it('navigates to the about page', () => {
|
|
10
|
-
cy.visit('/about')
|
|
11
|
-
cy.contains('h1', 'This is an about page')
|
|
12
|
-
})
|
|
13
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { mount } from '@cypress/vue'
|
|
2
|
-
import HelloWorld from '../HelloWorld.vue'
|
|
3
|
-
|
|
4
|
-
describe('HelloWorld', () => {
|
|
5
|
-
it('playground', () => {
|
|
6
|
-
mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
it('renders properly', () => {
|
|
10
|
-
mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
|
|
11
|
-
cy.get('h1').should('contain', 'Hello Cypress')
|
|
12
|
-
})
|
|
13
|
-
})
|