From 355480565cd064b015ce8c8c28b054f52dc14d5f Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Mon, 30 Aug 2021 10:58:13 +0800 Subject: [PATCH 1/3] feat!: update cypress to 8.3 and require it to be a peer dependency --- .../cli-plugin-e2e-cypress/generator/index.js | 3 ++ .../@vue/cli-plugin-e2e-cypress/package.json | 5 ++- yarn.lock | 41 +++++-------------- 3 files changed, 17 insertions(+), 32 deletions(-) diff --git a/packages/@vue/cli-plugin-e2e-cypress/generator/index.js b/packages/@vue/cli-plugin-e2e-cypress/generator/index.js index b6978919c1..81c019f22a 100644 --- a/packages/@vue/cli-plugin-e2e-cypress/generator/index.js +++ b/packages/@vue/cli-plugin-e2e-cypress/generator/index.js @@ -5,6 +5,9 @@ module.exports = api => { }) api.extendPackage({ + devDependencies: { + cypress: require('../package.json').devDependencies.cypress + }, scripts: { 'test:e2e': 'vue-cli-service test:e2e' } diff --git a/packages/@vue/cli-plugin-e2e-cypress/package.json b/packages/@vue/cli-plugin-e2e-cypress/package.json index 10e07dacee..c13a63edbb 100644 --- a/packages/@vue/cli-plugin-e2e-cypress/package.json +++ b/packages/@vue/cli-plugin-e2e-cypress/package.json @@ -24,10 +24,13 @@ }, "dependencies": { "@vue/cli-shared-utils": "^5.0.0-beta.3", - "cypress": "^7.1.0", "eslint-plugin-cypress": "^2.11.2" }, + "devDependencies": { + "cypress": "^8.3.0" + }, "peerDependencies": { + "cypress": "*", "@vue/cli-service": "^3.0.0 || ^4.0.0 || ^5.0.0-0" } } diff --git a/yarn.lock b/yarn.lock index 2e70b1ca63..266a121b07 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1204,10 +1204,10 @@ exec-sh "^0.3.2" minimist "^1.2.0" -"@cypress/request@^2.88.5": - version "2.88.5" - resolved "https://registry.yarnpkg.com/@cypress/request/-/request-2.88.5.tgz#8d7ecd17b53a849cfd5ab06d5abe7d84976375d7" - integrity sha512-TzEC1XMi1hJkywWpRfD2clreTa/Z+lOrXDCxxBTBPEcY5azdPi56A6Xw+O4tWJnaJH3iIE7G5aDXZC6JgRZLcA== +"@cypress/request@^2.88.6": + version "2.88.6" + resolved "https://registry.yarnpkg.com/@cypress/request/-/request-2.88.6.tgz#a970dd675befc6bdf8a8921576c01f51cc5798e9" + integrity sha512-z0UxBE/+qaESAHY9p9sM2h8Y4XqtsbDCt0/DPOrqA/RZgKi4PkxdpXyK4wCCnSk1xHqWHZZAE+gV6aDAR6+caQ== dependencies: aws-sign2 "~0.7.0" aws4 "^1.8.0" @@ -1222,13 +1222,12 @@ isstream "~0.1.2" json-stringify-safe "~5.0.1" mime-types "~2.1.19" - oauth-sign "~0.9.0" performance-now "^2.1.0" qs "~6.5.2" safe-buffer "^5.1.2" tough-cookie "~2.5.0" tunnel-agent "^0.6.0" - uuid "^3.3.2" + uuid "^8.3.2" "@cypress/xvfb@^1.2.4": version "1.2.4" @@ -8553,12 +8552,12 @@ cyclist@^1.0.1: resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk= -cypress@^7.1.0: - version "7.7.0" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-7.7.0.tgz#0839ae28e5520536f9667d6c9ae81496b3836e64" - integrity sha512-uYBYXNoI5ym0UxROwhQXWTi8JbUEjpC6l/bzoGZNxoKGsLrC1SDPgIDJMgLX/MeEdPL0UInXLDUWN/rSyZUCjQ== +cypress@^8.3.0: + version "8.3.1" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-8.3.1.tgz#c6760dbb907df2570b0e1ac235fa31c30f9260a6" + integrity sha512-1v6pfx+/5cXhaT5T6QKOvnkawmEHWHLiVzm3MYMoQN1fkX2Ma1C32STd3jBStE9qT5qPSTILjGzypVRxCBi40g== dependencies: - "@cypress/request" "^2.88.5" + "@cypress/request" "^2.88.6" "@cypress/xvfb" "^1.2.4" "@types/node" "^14.14.31" "@types/sinonjs__fake-timers" "^6.0.2" @@ -10151,13 +10150,6 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" -exec-sh@^0.2.0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.2.tgz#2a5e7ffcbd7d0ba2755bdecb16e5a427dfbdec36" - integrity sha512-FIUCJz1RbuS0FKTdaAafAByGS0CPvU3R0MeHxgtl+djzCc//F8HakL8GzmVNZanasTbTAY/3DRFA0KpVqj/eAw== - dependencies: - merge "^1.2.0" - exec-sh@^0.3.2: version "0.3.6" resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.6.tgz#ff264f9e325519a60cb5e273692943483cca63bc" @@ -15411,11 +15403,6 @@ merge2@^1.2.3, merge2@^1.3.0: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -merge@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.1.tgz#38bebf80c3220a8a487b6fcfb3941bb11720c145" - integrity sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ== - meros@1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/meros/-/meros-1.1.4.tgz#c17994d3133db8b23807f62bec7f0cb276cfd948" @@ -22435,14 +22422,6 @@ ware@^1.2.0: dependencies: wrap-fn "^0.1.0" -watch@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/watch/-/watch-1.0.2.tgz#340a717bde765726fa0aa07d721e0147a551df0c" - integrity sha1-NApxe952Vyb6CqB9ch4BR6VR3ww= - dependencies: - exec-sh "^0.2.0" - minimist "^1.2.0" - watchpack-chokidar2@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz#38500072ee6ece66f3769936950ea1771be1c957" From c3acebe5f0021c07aa1f55ed2cb99cf7355b7437 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Mon, 30 Aug 2021 11:03:29 +0800 Subject: [PATCH 2/3] feat: migrator --- .../cli-plugin-e2e-cypress/migrator/index.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 packages/@vue/cli-plugin-e2e-cypress/migrator/index.js diff --git a/packages/@vue/cli-plugin-e2e-cypress/migrator/index.js b/packages/@vue/cli-plugin-e2e-cypress/migrator/index.js new file mode 100644 index 0000000000..10cd9f66f1 --- /dev/null +++ b/packages/@vue/cli-plugin-e2e-cypress/migrator/index.js @@ -0,0 +1,17 @@ +module.exports = api => { + api.extendPackage(pkg => { + const allDeps = { + ...pkg.dependencies, + ...pkg.devDependencies, + ...pkg.optionalDependencies + } + + if (!allDeps.cypress) { + return { + devDependencies: { + cypress: require('../package.json').devDependencies.cypress + } + } + } + }) +} From e746279577e7d1912997593eaab0f0a61dd0f727 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Mon, 30 Aug 2021 11:05:30 +0800 Subject: [PATCH 3/3] docs: documentation update --- docs/migrations/migrate-from-v4.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/migrations/migrate-from-v4.md b/docs/migrations/migrate-from-v4.md index 88a99dfce1..9b28a76863 100644 --- a/docs/migrations/migrate-from-v4.md +++ b/docs/migrations/migrate-from-v4.md @@ -121,7 +121,7 @@ Please consider switching to ESLint. You can check out [`tslint-to-eslint-config ### E2E-Cypress Plugin * Cypress is required as a peer dependency. -* Cypress is updated from v3 to v7. See [Cypress Migration Guide](https://docs.cypress.io/guides/references/migration-guide.html) for detailed instructions of the migration process. +* Cypress is updated from v3 to v8. See [Cypress Migration Guide](https://docs.cypress.io/guides/references/migration-guide.html) for detailed instructions of the migration process. ### E2E-WebDriverIO Plugin