Skip to content

Commit 58e0ab9

Browse files
authored
fix: remove dependence on @cypress/<dep> types (#24415)
* fix: remove dependence on @cypress/<dep> types * I added a patch but didn't wire up patch-package * address comments * remove patch, use updated @vue-test-utils
1 parent b715029 commit 58e0ab9

7 files changed

+44
-96
lines changed

npm/mount-utils/create-rollup-entry.mjs

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import resolve from '@rollup/plugin-node-resolve'
44
import commonjs from '@rollup/plugin-commonjs'
55
import _ from 'lodash'
66
import { readFileSync } from 'fs'
7+
import dts from 'rollup-plugin-dts'
78

89
const pkg = JSON.parse(readFileSync('./package.json'))
910

@@ -33,7 +34,7 @@ export function createEntries (options) {
3334
check: format === 'es',
3435
tsconfigOverride: {
3536
compilerOptions: {
36-
declaration: format === 'es',
37+
declaration: false,
3738
target: 'es6',
3839
module: format === 'cjs' ? 'es2015' : 'esnext',
3940
},
@@ -67,5 +68,10 @@ export function createEntries (options) {
6768
console.log(`Building ${format}: ${finalConfig.output.file}`)
6869

6970
return finalConfig
71+
}).concat({
72+
input,
73+
output: [{ file: 'dist/index.d.ts', format: 'es' }],
74+
plugins: [dts({ respectExternal: true })],
75+
external: config.external || [],
7076
})
7177
}

npm/mount-utils/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"@rollup/plugin-commonjs": "^17.1.0",
1616
"@rollup/plugin-node-resolve": "^11.1.1",
1717
"rollup": "^2.38.5",
18+
"rollup-plugin-dts": "^4.2.3",
1819
"rollup-plugin-typescript2": "^0.29.0",
1920
"typescript": "^4.7.4"
2021
},

npm/vue/inline-types.ts

-69
This file was deleted.

npm/vue/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"cy:open": "node ../../scripts/cypress.js open --component --project ${PWD}",
99
"cy:run": "node ../../scripts/cypress.js run --component --project ${PWD}",
1010
"build": "rimraf dist && rollup -c rollup.config.mjs",
11-
"postbuild": "node --require @packages/ts/register ./inline-types.ts && node ../../scripts/sync-exported-npm-with-cli.js",
11+
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
1212
"typecheck": "yarn tsd && vue-tsc --noEmit",
1313
"test": "yarn cy:run",
1414
"tsd": "yarn build && yarn tsc -p test-tsd/tsconfig.tsd.json",

npm/vue2/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@
1111
"test": "echo \"Tests for @cypress/vue2 are run from system-tests\"",
1212
"watch": "yarn build --watch --watch.exclude ./dist/**/*"
1313
},
14-
"dependencies": {
15-
"@vue/test-utils": "^1.1.3"
16-
},
1714
"devDependencies": {
1815
"@cypress/mount-utils": "0.0.0-development",
1916
"@rollup/plugin-json": "^4.1.0",
2017
"@rollup/plugin-replace": "^2.3.1",
18+
"@vue/test-utils": "^1.3.1",
2119
"tslib": "^2.1.0",
2220
"typescript": "^4.7.4",
2321
"vue": "2.6.12"

scripts/sync-exported-npm-with-cli.js

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ packlist({ path: currentPackageDir })
2929
const exportName = currentPackageConfig.name.replace('@cypress/', '')
3030
const outDir = path.join(cliPath, exportName)
3131

32+
// Remove output directory to clean up old files before building
33+
fs.removeSync(outDir)
34+
3235
// 3. For each file, mkdir if not exists, and then copy the dist'd assets over
3336
// to write to the `cliPackageConfig` at the end
3437
files.forEach((f) => {

yarn.lock

+31-22
Original file line numberDiff line numberDiff line change
@@ -824,12 +824,12 @@
824824
dependencies:
825825
"@babel/highlight" "^7.8.3"
826826

827-
"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.14.5", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.5.5", "@babel/code-frame@^7.8.3":
828-
version "7.16.7"
829-
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789"
830-
integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==
827+
"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.14.5", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.5.5", "@babel/code-frame@^7.8.3":
828+
version "7.18.6"
829+
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a"
830+
integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==
831831
dependencies:
832-
"@babel/highlight" "^7.16.7"
832+
"@babel/highlight" "^7.18.6"
833833

834834
"@babel/compat-data@^7.13.0", "@babel/compat-data@^7.13.11", "@babel/compat-data@^7.13.5", "@babel/compat-data@^7.16.4", "@babel/compat-data@^7.16.8", "@babel/compat-data@^7.17.7", "@babel/compat-data@^7.9.0":
835835
version "7.17.7"
@@ -1101,10 +1101,10 @@
11011101
dependencies:
11021102
"@babel/types" "^7.16.7"
11031103

1104-
"@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.16.7":
1105-
version "7.16.7"
1106-
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad"
1107-
integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==
1104+
"@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.16.7", "@babel/helper-validator-identifier@^7.18.6":
1105+
version "7.19.1"
1106+
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2"
1107+
integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==
11081108

11091109
"@babel/helper-validator-option@^7.12.17", "@babel/helper-validator-option@^7.16.7":
11101110
version "7.16.7"
@@ -1130,12 +1130,12 @@
11301130
"@babel/traverse" "^7.17.9"
11311131
"@babel/types" "^7.17.0"
11321132

1133-
"@babel/highlight@^7.0.0", "@babel/highlight@^7.10.4", "@babel/highlight@^7.16.7", "@babel/highlight@^7.8.3":
1134-
version "7.16.10"
1135-
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.10.tgz#744f2eb81579d6eea753c227b0f570ad785aba88"
1136-
integrity sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==
1133+
"@babel/highlight@^7.0.0", "@babel/highlight@^7.10.4", "@babel/highlight@^7.18.6", "@babel/highlight@^7.8.3":
1134+
version "7.18.6"
1135+
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf"
1136+
integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==
11371137
dependencies:
1138-
"@babel/helper-validator-identifier" "^7.16.7"
1138+
"@babel/helper-validator-identifier" "^7.18.6"
11391139
chalk "^2.0.0"
11401140
js-tokens "^4.0.0"
11411141

@@ -7658,10 +7658,10 @@
76587658
resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-2.0.2.tgz#0b5edd683366153d5bc5a91edc62f292118710eb"
76597659
integrity sha512-E2P4oXSaWDqTZNbmKZFVLrNN/siVN78YkEqs7pHryWerrlZR9bBFLWdJwRoguX45Ru6HxIflzKl4vQvwRMwm5g==
76607660

7661-
"@vue/test-utils@^1.1.3":
7662-
version "1.3.0"
7663-
resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-1.3.0.tgz#d563decdcd9c68a7bca151d4179a2bfd6d5c3e15"
7664-
integrity sha512-Xk2Xiyj2k5dFb8eYUKkcN9PzqZSppTlx7LaQWBbdA8tqh3jHr/KHX2/YLhNFc/xwDrgeLybqd+4ZCPJSGPIqeA==
7661+
"@vue/test-utils@^1.3.1":
7662+
version "1.3.1"
7663+
resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-1.3.1.tgz#be181387f4dc19f17c2bbd451b0f97ed48329642"
7664+
integrity sha512-99MBPPGBx/Dfe1kHE8eqjDmFjKSC1LZiNbHcece/sm56NppNEm4qk13vFAqHdXJp9snrR5CVQaBeBj9eYNNhjQ==
76657665
dependencies:
76667666
dom-event-types "^1.0.0"
76677667
lodash "^4.17.15"
@@ -22937,10 +22937,10 @@ magic-string@^0.25.5, magic-string@^0.25.7:
2293722937
dependencies:
2293822938
sourcemap-codec "^1.4.4"
2293922939

22940-
magic-string@^0.26.1, magic-string@^0.26.2:
22941-
version "0.26.3"
22942-
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.26.3.tgz#25840b875140f7b4785ab06bddc384270b7dd452"
22943-
integrity sha512-u1Po0NDyFcwdg2nzHT88wSK0+Rih0N1M+Ph1Sp08k8yvFFU3KR72wryS7e1qMPJypt99WB7fIFVCA92mQrMjrg==
22940+
magic-string@^0.26.1, magic-string@^0.26.2, magic-string@^0.26.6:
22941+
version "0.26.7"
22942+
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.26.7.tgz#caf7daf61b34e9982f8228c4527474dac8981d6f"
22943+
integrity sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow==
2294422944
dependencies:
2294522945
sourcemap-codec "^1.4.8"
2294622946

@@ -29606,6 +29606,15 @@ rollup-plugin-copy@3.4.0:
2960629606
globby "10.0.1"
2960729607
is-plain-object "^3.0.0"
2960829608

29609+
rollup-plugin-dts@^4.2.3:
29610+
version "4.2.3"
29611+
resolved "https://registry.yarnpkg.com/rollup-plugin-dts/-/rollup-plugin-dts-4.2.3.tgz#04c3615df1ffab4228aa9d540697eaca61e01f47"
29612+
integrity sha512-jlcpItqM2efqfIiKzDB/IKOS9E9fDvbkJSGw5GtK/PqPGS9eC3R3JKyw2VvpTktZA+TNgJRMu1NTv244aTUzzQ==
29613+
dependencies:
29614+
magic-string "^0.26.6"
29615+
optionalDependencies:
29616+
"@babel/code-frame" "^7.18.6"
29617+
2960929618
rollup-plugin-node-builtins@^2.1.2:
2961029619
version "2.1.2"
2961129620
resolved "https://registry.yarnpkg.com/rollup-plugin-node-builtins/-/rollup-plugin-node-builtins-2.1.2.tgz#24a1fed4a43257b6b64371d8abc6ce1ab14597e9"

0 commit comments

Comments
 (0)