create-vue 3.3.4 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +2 -2
- package/outfile.cjs +85 -29
- package/package.json +6 -5
- package/template/base/index.html +3 -3
- package/template/base/node_modules/.bin/vite +2 -2
- package/template/base/package.json +4 -4
- package/template/base/src/assets/main.css +1 -1
- package/template/code/router/src/components/WelcomeItem.vue +0 -1
- package/template/config/cypress/node_modules/.bin/cypress +2 -2
- package/template/config/cypress/package.json +3 -3
- package/template/config/cypress-ct/node_modules/.bin/cypress +2 -2
- package/template/config/cypress-ct/package.json +4 -4
- package/template/config/jsx/node_modules/.bin/vite +2 -2
- package/template/config/jsx/package.json +2 -2
- package/template/config/pinia/package.json +2 -2
- package/template/config/playwright/_gitignore +2 -0
- package/template/config/playwright/e2e/vue.spec.js +8 -0
- package/template/config/playwright/e2e/vue.spec.ts +8 -0
- package/template/config/playwright/node_modules/.bin/playwright +17 -0
- package/template/config/playwright/package.json +8 -0
- package/template/config/playwright/playwright.config.js +112 -0
- package/template/config/playwright/playwright.config.ts +112 -0
- package/template/config/router/package.json +1 -1
- package/template/config/typescript/node_modules/.bin/vue-tsc +2 -2
- package/template/config/typescript/package.json +2 -2
- package/template/config/vitest/node_modules/.bin/vitest +2 -2
- package/template/config/vitest/package.json +5 -5
- package/template/tsconfig/base/tsconfig.config.json +1 -1
package/LICENSE
CHANGED
|
@@ -150,7 +150,7 @@ Repository: git+https://github.com/marvinhagemeister/kolorist.git
|
|
|
150
150
|
|
|
151
151
|
License: MIT
|
|
152
152
|
By: James Halliday
|
|
153
|
-
Repository: git://github.com/
|
|
153
|
+
Repository: git://github.com/minimistjs/minimist.git
|
|
154
154
|
|
|
155
155
|
> This software is released under the MIT license:
|
|
156
156
|
>
|
package/README.md
CHANGED
|
@@ -9,13 +9,13 @@ The recommended way to start a Vite-powered Vue project
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
npm
|
|
12
|
+
npm create vue@3
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
Or, if you need to support IE11, you can create a Vue 2 project with:
|
|
16
16
|
|
|
17
17
|
```sh
|
|
18
|
-
npm
|
|
18
|
+
npm create vue@2
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Note that the version number (`@3` or `@2`) MUST NOT be omitted, otherwise `npm` may resolve to a cached and outdated version of the package.
|
package/outfile.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! create-vue v3.
|
|
2
|
+
/*! create-vue v3.4.0 | MIT */
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
// node_modules/.pnpm/minimist@1.2.
|
|
33
|
+
// node_modules/.pnpm/minimist@1.2.7/node_modules/minimist/index.js
|
|
34
34
|
var require_minimist = __commonJS({
|
|
35
|
-
"node_modules/.pnpm/minimist@1.2.
|
|
35
|
+
"node_modules/.pnpm/minimist@1.2.7/node_modules/minimist/index.js"(exports, module2) {
|
|
36
36
|
module2.exports = function(args, opts) {
|
|
37
37
|
if (!opts)
|
|
38
38
|
opts = {};
|
|
@@ -3325,7 +3325,7 @@ var path4 = __toESM(require("path"), 1);
|
|
|
3325
3325
|
var import_minimist = __toESM(require_minimist(), 1);
|
|
3326
3326
|
var import_prompts = __toESM(require_lib(), 1);
|
|
3327
3327
|
|
|
3328
|
-
// node_modules/.pnpm/kolorist@1.
|
|
3328
|
+
// node_modules/.pnpm/kolorist@1.6.0/node_modules/kolorist/dist/esm/index.mjs
|
|
3329
3329
|
var enabled = true;
|
|
3330
3330
|
var globalVar = typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {};
|
|
3331
3331
|
var supportLevel = 0;
|
|
@@ -3472,6 +3472,12 @@ function renderTemplate(src, dest) {
|
|
|
3472
3472
|
if (filename.startsWith("_")) {
|
|
3473
3473
|
dest = path.resolve(path.dirname(dest), filename.replace(/^_/, "."));
|
|
3474
3474
|
}
|
|
3475
|
+
if (filename === "_gitignore" && fs.existsSync(dest)) {
|
|
3476
|
+
const existing = fs.readFileSync(dest, "utf8");
|
|
3477
|
+
const newGitignore = fs.readFileSync(src, "utf8");
|
|
3478
|
+
fs.writeFileSync(dest, existing + "\n" + newGitignore);
|
|
3479
|
+
return;
|
|
3480
|
+
}
|
|
3475
3481
|
fs.copyFileSync(src, dest);
|
|
3476
3482
|
}
|
|
3477
3483
|
var renderTemplate_default = renderTemplate;
|
|
@@ -3511,11 +3517,15 @@ function postOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
|
|
|
3511
3517
|
}
|
|
3512
3518
|
|
|
3513
3519
|
// utils/getCommand.ts
|
|
3514
|
-
function getCommand(packageManager, scriptName) {
|
|
3520
|
+
function getCommand(packageManager, scriptName, args) {
|
|
3515
3521
|
if (scriptName === "install") {
|
|
3516
3522
|
return packageManager === "yarn" ? "yarn" : `${packageManager} install`;
|
|
3517
3523
|
}
|
|
3518
|
-
|
|
3524
|
+
if (args) {
|
|
3525
|
+
return packageManager === "npm" ? `npm run ${scriptName} -- ${args}` : `${packageManager} ${scriptName} ${args}`;
|
|
3526
|
+
} else {
|
|
3527
|
+
return packageManager === "npm" ? `npm run ${scriptName}` : `${packageManager} ${scriptName}`;
|
|
3528
|
+
}
|
|
3519
3529
|
}
|
|
3520
3530
|
|
|
3521
3531
|
// utils/generateReadme.ts
|
|
@@ -3539,9 +3549,11 @@ function generateReadme({
|
|
|
3539
3549
|
needsTypeScript,
|
|
3540
3550
|
needsCypress,
|
|
3541
3551
|
needsCypressCT,
|
|
3552
|
+
needsPlaywright,
|
|
3542
3553
|
needsVitest,
|
|
3543
3554
|
needsEslint
|
|
3544
3555
|
}) {
|
|
3556
|
+
const commandFor = (scriptName, args) => getCommand(packageManager, scriptName, args);
|
|
3545
3557
|
let readme = `# ${projectName}
|
|
3546
3558
|
|
|
3547
3559
|
This template should help get you started developing with Vue 3 in Vite.
|
|
@@ -3558,19 +3570,19 @@ See [Vite Configuration Reference](https://vitejs.dev/config/).
|
|
|
3558
3570
|
|
|
3559
3571
|
`;
|
|
3560
3572
|
let npmScriptsDescriptions = `\`\`\`sh
|
|
3561
|
-
${
|
|
3573
|
+
${commandFor("install")}
|
|
3562
3574
|
\`\`\`
|
|
3563
3575
|
|
|
3564
3576
|
### Compile and Hot-Reload for Development
|
|
3565
3577
|
|
|
3566
3578
|
\`\`\`sh
|
|
3567
|
-
${
|
|
3579
|
+
${commandFor("dev")}
|
|
3568
3580
|
\`\`\`
|
|
3569
3581
|
|
|
3570
3582
|
### ${needsTypeScript ? "Type-Check, " : ""}Compile and Minify for Production
|
|
3571
3583
|
|
|
3572
3584
|
\`\`\`sh
|
|
3573
|
-
${
|
|
3585
|
+
${commandFor("build")}
|
|
3574
3586
|
\`\`\`
|
|
3575
3587
|
`;
|
|
3576
3588
|
if (needsVitest) {
|
|
@@ -3578,7 +3590,7 @@ ${getCommand(packageManager, "build")}
|
|
|
3578
3590
|
### Run Unit Tests with [Vitest](https://vitest.dev/)
|
|
3579
3591
|
|
|
3580
3592
|
\`\`\`sh
|
|
3581
|
-
${
|
|
3593
|
+
${commandFor("test:unit")}
|
|
3582
3594
|
\`\`\`
|
|
3583
3595
|
`;
|
|
3584
3596
|
}
|
|
@@ -3587,10 +3599,7 @@ ${getCommand(packageManager, "test:unit")}
|
|
|
3587
3599
|
### Run Headed Component Tests with [Cypress Component Testing](https://on.cypress.io/component)
|
|
3588
3600
|
|
|
3589
3601
|
\`\`\`sh
|
|
3590
|
-
${
|
|
3591
|
-
packageManager,
|
|
3592
|
-
"test:unit:ci"
|
|
3593
|
-
)}\` for headless testing
|
|
3602
|
+
${commandFor("test:unit:dev")} # or \`${commandFor("test:unit")}\` for headless testing
|
|
3594
3603
|
\`\`\`
|
|
3595
3604
|
`;
|
|
3596
3605
|
}
|
|
@@ -3599,11 +3608,39 @@ ${getCommand(packageManager, "test:unit")} # or \`${getCommand(
|
|
|
3599
3608
|
### Run End-to-End Tests with [Cypress](https://www.cypress.io/)
|
|
3600
3609
|
|
|
3601
3610
|
\`\`\`sh
|
|
3602
|
-
${
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3611
|
+
${commandFor("test:e2e:dev")}
|
|
3612
|
+
\`\`\`
|
|
3613
|
+
|
|
3614
|
+
This runs the end-to-end tests against the Vite development server.
|
|
3615
|
+
It is much faster than the production build.
|
|
3616
|
+
|
|
3617
|
+
But it's still recommended to test the production build with \`test:e2e\` before deploying (e.g. in CI environments):
|
|
3618
|
+
|
|
3619
|
+
\`\`\`sh
|
|
3620
|
+
${commandFor("build")}
|
|
3621
|
+
${commandFor("test:e2e")}
|
|
3622
|
+
\`\`\`
|
|
3623
|
+
`;
|
|
3624
|
+
}
|
|
3625
|
+
if (needsPlaywright) {
|
|
3626
|
+
npmScriptsDescriptions += `
|
|
3627
|
+
### Run End-to-End Tests with [Playwright](https://playwright.dev)
|
|
3628
|
+
|
|
3629
|
+
\`\`\`sh
|
|
3630
|
+
# Install browsers for the first run
|
|
3631
|
+
npx playwright install
|
|
3632
|
+
|
|
3633
|
+
# When testing on CI, must build the project first
|
|
3634
|
+
${commandFor("build")}
|
|
3635
|
+
|
|
3636
|
+
# Runs the end-to-end tests
|
|
3637
|
+
${commandFor("test:e2e")}
|
|
3638
|
+
# Runs the tests only on Chromium
|
|
3639
|
+
${commandFor("test:e2e", "--project=chromium")}
|
|
3640
|
+
# Runs the tests of a specific file
|
|
3641
|
+
${commandFor("test:e2e", "tests/example.spec.ts")}
|
|
3642
|
+
# Runs the tests in debug mode
|
|
3643
|
+
${commandFor("test:e2e", "--debug")}
|
|
3607
3644
|
\`\`\`
|
|
3608
3645
|
`;
|
|
3609
3646
|
}
|
|
@@ -3612,7 +3649,7 @@ ${getCommand(packageManager, "test:e2e")} # or \`${getCommand(
|
|
|
3612
3649
|
### Lint with [ESLint](https://eslint.org/)
|
|
3613
3650
|
|
|
3614
3651
|
\`\`\`sh
|
|
3615
|
-
${
|
|
3652
|
+
${commandFor("lint")}
|
|
3616
3653
|
\`\`\`
|
|
3617
3654
|
`;
|
|
3618
3655
|
}
|
|
@@ -3776,7 +3813,10 @@ function renderEslint(rootDir, { needsTypeScript, needsCypress, needsCypressCT,
|
|
|
3776
3813
|
if (needsCypress) {
|
|
3777
3814
|
additionalConfig.overrides = [
|
|
3778
3815
|
{
|
|
3779
|
-
files: needsCypressCT ? [
|
|
3816
|
+
files: needsCypressCT ? [
|
|
3817
|
+
"**/__tests__/*.{cy,spec}.{js,ts,jsx,tsx}",
|
|
3818
|
+
"cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}"
|
|
3819
|
+
] : ["cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}"],
|
|
3780
3820
|
extends: ["plugin:cypress/recommended"]
|
|
3781
3821
|
}
|
|
3782
3822
|
];
|
|
@@ -3853,7 +3893,7 @@ ${banner_default}
|
|
|
3853
3893
|
},
|
|
3854
3894
|
boolean: true
|
|
3855
3895
|
});
|
|
3856
|
-
const isFeatureFlagsUsed = typeof (argv.default ?? argv.ts ?? argv.jsx ?? argv.router ?? argv.pinia ?? argv.tests ?? argv.vitest ?? argv.cypress ?? argv.eslint) === "boolean";
|
|
3896
|
+
const isFeatureFlagsUsed = typeof (argv.default ?? argv.ts ?? argv.jsx ?? argv.router ?? argv.pinia ?? argv.tests ?? argv.vitest ?? argv.cypress ?? argv.playwright ?? argv.eslint) === "boolean";
|
|
3857
3897
|
let targetDir = argv._[0];
|
|
3858
3898
|
const defaultProjectName = !targetDir ? "vue-project" : targetDir;
|
|
3859
3899
|
const forceOverwrite = argv.force;
|
|
@@ -3933,12 +3973,22 @@ ${banner_default}
|
|
|
3933
3973
|
inactive: "No"
|
|
3934
3974
|
},
|
|
3935
3975
|
{
|
|
3936
|
-
name: "
|
|
3937
|
-
type: () => isFeatureFlagsUsed ? null : "
|
|
3938
|
-
message:
|
|
3939
|
-
initial:
|
|
3940
|
-
|
|
3941
|
-
|
|
3976
|
+
name: "needsE2eTesting",
|
|
3977
|
+
type: () => isFeatureFlagsUsed ? null : "select",
|
|
3978
|
+
message: "Add an End-to-End Testing Solution?",
|
|
3979
|
+
initial: 0,
|
|
3980
|
+
choices: (prev, anwsers) => [
|
|
3981
|
+
{ title: "No", value: false },
|
|
3982
|
+
{
|
|
3983
|
+
title: "Cypress",
|
|
3984
|
+
description: anwsers.needsVitest ? void 0 : "also supports unit testing with Cypress Component Testing",
|
|
3985
|
+
value: "cypress"
|
|
3986
|
+
},
|
|
3987
|
+
{
|
|
3988
|
+
title: "Playwright",
|
|
3989
|
+
value: "playwright"
|
|
3990
|
+
}
|
|
3991
|
+
]
|
|
3942
3992
|
},
|
|
3943
3993
|
{
|
|
3944
3994
|
name: "needsEslint",
|
|
@@ -3980,12 +4030,14 @@ ${banner_default}
|
|
|
3980
4030
|
needsTypeScript = argv.typescript,
|
|
3981
4031
|
needsRouter = argv.router,
|
|
3982
4032
|
needsPinia = argv.pinia,
|
|
3983
|
-
needsCypress = argv.cypress || argv.tests,
|
|
3984
4033
|
needsVitest = argv.vitest || argv.tests,
|
|
3985
4034
|
needsEslint = argv.eslint || argv["eslint-with-prettier"],
|
|
3986
4035
|
needsPrettier = argv["eslint-with-prettier"]
|
|
3987
4036
|
} = result;
|
|
4037
|
+
const { needsE2eTesting } = result;
|
|
4038
|
+
const needsCypress = argv.cypress || argv.tests || needsE2eTesting === "cypress";
|
|
3988
4039
|
const needsCypressCT = needsCypress && !needsVitest;
|
|
4040
|
+
const needsPlaywright = argv.playwright || needsE2eTesting === "playwright";
|
|
3989
4041
|
const root = path4.join(cwd, targetDir);
|
|
3990
4042
|
if (fs4.existsSync(root) && shouldOverwrite) {
|
|
3991
4043
|
emptyDir(root);
|
|
@@ -4020,6 +4072,9 @@ Scaffolding project in ${root}...`);
|
|
|
4020
4072
|
if (needsCypressCT) {
|
|
4021
4073
|
render("config/cypress-ct");
|
|
4022
4074
|
}
|
|
4075
|
+
if (needsPlaywright) {
|
|
4076
|
+
render("config/playwright");
|
|
4077
|
+
}
|
|
4023
4078
|
if (needsTypeScript) {
|
|
4024
4079
|
render("config/typescript");
|
|
4025
4080
|
render("tsconfig/base");
|
|
@@ -4090,6 +4145,7 @@ Scaffolding project in ${root}...`);
|
|
|
4090
4145
|
needsTypeScript,
|
|
4091
4146
|
needsVitest,
|
|
4092
4147
|
needsCypress,
|
|
4148
|
+
needsPlaywright,
|
|
4093
4149
|
needsCypressCT,
|
|
4094
4150
|
needsEslint
|
|
4095
4151
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-vue",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "An easy way to start a Vue project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -25,16 +25,17 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/vuejs/create-vue#readme",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@types/eslint": "^8.4.
|
|
29
|
-
"@types/
|
|
28
|
+
"@types/eslint": "^8.4.7",
|
|
29
|
+
"@types/node": "^16.11.68",
|
|
30
|
+
"@types/prompts": "^2.4.1",
|
|
30
31
|
"@vue/create-eslint-config": "^0.1.3",
|
|
31
32
|
"@vue/tsconfig": "^0.1.3",
|
|
32
33
|
"esbuild": "^0.14.53",
|
|
33
34
|
"esbuild-plugin-license": "^1.2.2",
|
|
34
35
|
"husky": "^8.0.1",
|
|
35
|
-
"kolorist": "^1.
|
|
36
|
+
"kolorist": "^1.6.0",
|
|
36
37
|
"lint-staged": "^13.0.3",
|
|
37
|
-
"minimist": "^1.2.
|
|
38
|
+
"minimist": "^1.2.7",
|
|
38
39
|
"npm-run-all": "^4.1.5",
|
|
39
40
|
"prettier": "^2.7.1",
|
|
40
41
|
"prompts": "^2.4.2",
|
package/template/base/index.html
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
-
<meta charset="UTF-8"
|
|
5
|
-
<link rel="icon" href="/favicon.ico"
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0"
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<link rel="icon" href="/favicon.ico">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<title>Vite App</title>
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
@@ -11,7 +11,7 @@ else
|
|
|
11
11
|
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/vite@3.
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/vite@3.1.8/node_modules/vite/bin/vite.js" "$@"
|
|
15
15
|
else
|
|
16
|
-
exec node "$basedir/../../../../node_modules/.pnpm/vite@3.
|
|
16
|
+
exec node "$basedir/../../../../node_modules/.pnpm/vite@3.1.8/node_modules/vite/bin/vite.js" "$@"
|
|
17
17
|
fi
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
"scripts": {
|
|
3
3
|
"dev": "vite",
|
|
4
4
|
"build": "vite build",
|
|
5
|
-
"preview": "vite preview
|
|
5
|
+
"preview": "vite preview"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"vue": "^3.2.
|
|
8
|
+
"vue": "^3.2.41"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
|
-
"@vitejs/plugin-vue": "^3.
|
|
12
|
-
"vite": "^3.
|
|
11
|
+
"@vitejs/plugin-vue": "^3.1.2",
|
|
12
|
+
"vite": "^3.1.8"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -11,7 +11,7 @@ else
|
|
|
11
11
|
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/cypress@10.
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/cypress@10.10.0/node_modules/cypress/bin/cypress" "$@"
|
|
15
15
|
else
|
|
16
|
-
exec node "$basedir/../../../../../node_modules/.pnpm/cypress@10.
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/cypress@10.10.0/node_modules/cypress/bin/cypress" "$@"
|
|
17
17
|
fi
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"scripts": {
|
|
3
|
-
"test:e2e": "start-server-and-test preview
|
|
4
|
-
"test:e2e:
|
|
3
|
+
"test:e2e": "start-server-and-test preview :4173 'cypress run --e2e'",
|
|
4
|
+
"test:e2e:dev": "start-server-and-test 'vite dev --port 4173' :4173 'cypress open --e2e'"
|
|
5
5
|
},
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"cypress": "^10.
|
|
7
|
+
"cypress": "^10.10.0",
|
|
8
8
|
"start-server-and-test": "^1.14.0"
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -11,7 +11,7 @@ else
|
|
|
11
11
|
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/cypress@10.
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/cypress@10.10.0/node_modules/cypress/bin/cypress" "$@"
|
|
15
15
|
else
|
|
16
|
-
exec node "$basedir/../../../../../node_modules/.pnpm/cypress@10.
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/cypress@10.10.0/node_modules/cypress/bin/cypress" "$@"
|
|
17
17
|
fi
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"scripts": {
|
|
3
|
-
"test:unit": "cypress
|
|
4
|
-
"test:unit:
|
|
3
|
+
"test:unit": "cypress run --component",
|
|
4
|
+
"test:unit:dev": "cypress open --component"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"vue": "^3.2.
|
|
7
|
+
"vue": "^3.2.41"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"cypress": "^10.
|
|
10
|
+
"cypress": "^10.10.0"
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -11,7 +11,7 @@ else
|
|
|
11
11
|
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vite@3.
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vite@3.1.8/node_modules/vite/bin/vite.js" "$@"
|
|
15
15
|
else
|
|
16
|
-
exec node "$basedir/../../../../../node_modules/.pnpm/vite@3.
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/vite@3.1.8/node_modules/vite/bin/vite.js" "$@"
|
|
17
17
|
fi
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const { test, expect } = require('@playwright/test');
|
|
2
|
+
|
|
3
|
+
// See here how to get started:
|
|
4
|
+
// https://playwright.dev/docs/intro
|
|
5
|
+
test('visits the app root url', async ({ page }) => {
|
|
6
|
+
await page.goto('/');
|
|
7
|
+
await expect(page.locator('div.greetings > h1')).toHaveText('You did it!');
|
|
8
|
+
})
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { test, expect } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
// See here how to get started:
|
|
4
|
+
// https://playwright.dev/docs/intro
|
|
5
|
+
test('visits the app root url', async ({ page }) => {
|
|
6
|
+
await page.goto('/');
|
|
7
|
+
await expect(page.locator('div.greetings > h1')).toHaveText('You did it!');
|
|
8
|
+
})
|
|
@@ -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/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/@playwright+test@1.27.1/node_modules/@playwright/test/cli.js" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/@playwright+test@1.27.1/node_modules/@playwright/test/cli.js" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
const { devices } = require('@playwright/test')
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Read environment variables from file.
|
|
6
|
+
* https://github.com/motdotla/dotenv
|
|
7
|
+
*/
|
|
8
|
+
// require('dotenv').config();
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @see https://playwright.dev/docs/test-configuration
|
|
12
|
+
* @type {import('@playwright/test').PlaywrightTestConfig}
|
|
13
|
+
*/
|
|
14
|
+
const config = {
|
|
15
|
+
testDir: './e2e',
|
|
16
|
+
/* Maximum time one test can run for. */
|
|
17
|
+
timeout: 30 * 1000,
|
|
18
|
+
expect: {
|
|
19
|
+
/**
|
|
20
|
+
* Maximum time expect() should wait for the condition to be met.
|
|
21
|
+
* For example in `await expect(locator).toHaveText();`
|
|
22
|
+
*/
|
|
23
|
+
timeout: 5000
|
|
24
|
+
},
|
|
25
|
+
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
|
26
|
+
forbidOnly: !!process.env.CI,
|
|
27
|
+
/* Retry on CI only */
|
|
28
|
+
retries: process.env.CI ? 2 : 0,
|
|
29
|
+
/* Opt out of parallel tests on CI. */
|
|
30
|
+
workers: process.env.CI ? 1 : undefined,
|
|
31
|
+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
|
32
|
+
reporter: 'html',
|
|
33
|
+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
|
34
|
+
use: {
|
|
35
|
+
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
|
|
36
|
+
actionTimeout: 0,
|
|
37
|
+
/* Base URL to use in actions like `await page.goto('/')`. */
|
|
38
|
+
baseURL: 'http://localhost:5173',
|
|
39
|
+
|
|
40
|
+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
|
41
|
+
trace: 'on-first-retry',
|
|
42
|
+
|
|
43
|
+
/* Only on CI systems run the tests headless */
|
|
44
|
+
headless: !!process.env.CI
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
/* Configure projects for major browsers */
|
|
48
|
+
projects: [
|
|
49
|
+
{
|
|
50
|
+
name: 'chromium',
|
|
51
|
+
use: {
|
|
52
|
+
...devices['Desktop Chrome']
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'firefox',
|
|
57
|
+
use: {
|
|
58
|
+
...devices['Desktop Firefox']
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'webkit',
|
|
63
|
+
use: {
|
|
64
|
+
...devices['Desktop Safari']
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Test against mobile viewports. */
|
|
69
|
+
// {
|
|
70
|
+
// name: 'Mobile Chrome',
|
|
71
|
+
// use: {
|
|
72
|
+
// ...devices['Pixel 5'],
|
|
73
|
+
// },
|
|
74
|
+
// },
|
|
75
|
+
// {
|
|
76
|
+
// name: 'Mobile Safari',
|
|
77
|
+
// use: {
|
|
78
|
+
// ...devices['iPhone 12'],
|
|
79
|
+
// },
|
|
80
|
+
// },
|
|
81
|
+
|
|
82
|
+
/* Test against branded browsers. */
|
|
83
|
+
// {
|
|
84
|
+
// name: 'Microsoft Edge',
|
|
85
|
+
// use: {
|
|
86
|
+
// channel: 'msedge',
|
|
87
|
+
// },
|
|
88
|
+
// },
|
|
89
|
+
// {
|
|
90
|
+
// name: 'Google Chrome',
|
|
91
|
+
// use: {
|
|
92
|
+
// channel: 'chrome',
|
|
93
|
+
// },
|
|
94
|
+
// },
|
|
95
|
+
],
|
|
96
|
+
|
|
97
|
+
/* Folder for test artifacts such as screenshots, videos, traces, etc. */
|
|
98
|
+
// outputDir: 'test-results/',
|
|
99
|
+
|
|
100
|
+
/* Run your local dev server before starting the tests */
|
|
101
|
+
webServer: {
|
|
102
|
+
/**
|
|
103
|
+
* Use the dev server by default for faster feedback loop.
|
|
104
|
+
* Use the preview server on CI for more realistic testing.
|
|
105
|
+
*/
|
|
106
|
+
command: process.env.CI ? 'vite preview --port 5173' : 'vite dev',
|
|
107
|
+
port: 5173,
|
|
108
|
+
reuseExistingServer: !process.env.CI
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
module.exports = config
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { PlaywrightTestConfig } from '@playwright/test'
|
|
2
|
+
import { devices } from '@playwright/test'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Read environment variables from file.
|
|
6
|
+
* https://github.com/motdotla/dotenv
|
|
7
|
+
*/
|
|
8
|
+
// require('dotenv').config();
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* See https://playwright.dev/docs/test-configuration.
|
|
12
|
+
*/
|
|
13
|
+
const config: PlaywrightTestConfig = {
|
|
14
|
+
testDir: './e2e',
|
|
15
|
+
/* Maximum time one test can run for. */
|
|
16
|
+
timeout: 30 * 1000,
|
|
17
|
+
expect: {
|
|
18
|
+
/**
|
|
19
|
+
* Maximum time expect() should wait for the condition to be met.
|
|
20
|
+
* For example in `await expect(locator).toHaveText();`
|
|
21
|
+
*/
|
|
22
|
+
timeout: 5000
|
|
23
|
+
},
|
|
24
|
+
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
|
25
|
+
forbidOnly: !!process.env.CI,
|
|
26
|
+
/* Retry on CI only */
|
|
27
|
+
retries: process.env.CI ? 2 : 0,
|
|
28
|
+
/* Opt out of parallel tests on CI. */
|
|
29
|
+
workers: process.env.CI ? 1 : undefined,
|
|
30
|
+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
|
31
|
+
reporter: 'html',
|
|
32
|
+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
|
33
|
+
use: {
|
|
34
|
+
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
|
|
35
|
+
actionTimeout: 0,
|
|
36
|
+
/* Base URL to use in actions like `await page.goto('/')`. */
|
|
37
|
+
baseURL: 'http://localhost:5173',
|
|
38
|
+
|
|
39
|
+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
|
40
|
+
trace: 'on-first-retry',
|
|
41
|
+
|
|
42
|
+
/* Only on CI systems run the tests headless */
|
|
43
|
+
headless: !!process.env.CI
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
/* Configure projects for major browsers */
|
|
47
|
+
projects: [
|
|
48
|
+
{
|
|
49
|
+
name: 'chromium',
|
|
50
|
+
use: {
|
|
51
|
+
...devices['Desktop Chrome']
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'firefox',
|
|
56
|
+
use: {
|
|
57
|
+
...devices['Desktop Firefox']
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'webkit',
|
|
62
|
+
use: {
|
|
63
|
+
...devices['Desktop Safari']
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* Test against mobile viewports. */
|
|
68
|
+
// {
|
|
69
|
+
// name: 'Mobile Chrome',
|
|
70
|
+
// use: {
|
|
71
|
+
// ...devices['Pixel 5'],
|
|
72
|
+
// },
|
|
73
|
+
// },
|
|
74
|
+
// {
|
|
75
|
+
// name: 'Mobile Safari',
|
|
76
|
+
// use: {
|
|
77
|
+
// ...devices['iPhone 12'],
|
|
78
|
+
// },
|
|
79
|
+
// },
|
|
80
|
+
|
|
81
|
+
/* Test against branded browsers. */
|
|
82
|
+
// {
|
|
83
|
+
// name: 'Microsoft Edge',
|
|
84
|
+
// use: {
|
|
85
|
+
// channel: 'msedge',
|
|
86
|
+
// },
|
|
87
|
+
// },
|
|
88
|
+
// {
|
|
89
|
+
// name: 'Google Chrome',
|
|
90
|
+
// use: {
|
|
91
|
+
// channel: 'chrome',
|
|
92
|
+
// },
|
|
93
|
+
// },
|
|
94
|
+
],
|
|
95
|
+
|
|
96
|
+
/* Folder for test artifacts such as screenshots, videos, traces, etc. */
|
|
97
|
+
// outputDir: 'test-results/',
|
|
98
|
+
|
|
99
|
+
/* Run your local dev server before starting the tests */
|
|
100
|
+
webServer: {
|
|
101
|
+
/**
|
|
102
|
+
* Use the dev server by default for faster feedback loop.
|
|
103
|
+
* Use the preview server on CI for more realistic testing.
|
|
104
|
+
Playwright will re-use the local server if there is already a dev-server running.
|
|
105
|
+
*/
|
|
106
|
+
command: process.env.CI ? 'vite preview --port 5173' : 'vite dev',
|
|
107
|
+
port: 5173,
|
|
108
|
+
reuseExistingServer: !process.env.CI
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export default config
|
|
@@ -11,7 +11,7 @@ else
|
|
|
11
11
|
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vue-tsc@0.
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vue-tsc@1.0.8_typescript@4.7.4/node_modules/vue-tsc/bin/vue-tsc.js" "$@"
|
|
15
15
|
else
|
|
16
|
-
exec node "$basedir/../../../../../node_modules/.pnpm/vue-tsc@0.
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/vue-tsc@1.0.8_typescript@4.7.4/node_modules/vue-tsc/bin/vue-tsc.js" "$@"
|
|
17
17
|
fi
|
|
@@ -11,7 +11,7 @@ else
|
|
|
11
11
|
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vitest@0.
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vitest@0.24.3_jsdom@20.0.1/node_modules/vitest/vitest.mjs" "$@"
|
|
15
15
|
else
|
|
16
|
-
exec node "$basedir/../../../../../node_modules/.pnpm/vitest@0.
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/vitest@0.24.3_jsdom@20.0.1/node_modules/vitest/vitest.mjs" "$@"
|
|
17
17
|
fi
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"scripts": {
|
|
3
|
-
"test:unit": "vitest --environment jsdom"
|
|
3
|
+
"test:unit": "vitest --environment jsdom --root src/"
|
|
4
4
|
},
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"vue": "^3.2.
|
|
6
|
+
"vue": "^3.2.41"
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
|
-
"@vue/test-utils": "^2.0
|
|
10
|
-
"jsdom": "^20.0.
|
|
11
|
-
"vitest": "^0.
|
|
9
|
+
"@vue/test-utils": "^2.1.0",
|
|
10
|
+
"jsdom": "^20.0.1",
|
|
11
|
+
"vitest": "^0.24.3"
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "@vue/tsconfig/tsconfig.node.json",
|
|
3
|
-
"include": ["vite.config.*", "vitest.config.*", "cypress.config.*"],
|
|
3
|
+
"include": ["vite.config.*", "vitest.config.*", "cypress.config.*", "playwright.config.*"],
|
|
4
4
|
"compilerOptions": {
|
|
5
5
|
"composite": true,
|
|
6
6
|
"types": ["node"]
|