Skip to content

Commit

Permalink
fix: remove dependence on @cypress/<dep> types (#24415)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ZachJW34 committed Oct 31, 2022
1 parent b715029 commit 58e0ab9
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 96 deletions.
8 changes: 7 additions & 1 deletion npm/mount-utils/create-rollup-entry.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import _ from 'lodash'
import { readFileSync } from 'fs'
import dts from 'rollup-plugin-dts'

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

Expand Down Expand Up @@ -33,7 +34,7 @@ export function createEntries (options) {
check: format === 'es',
tsconfigOverride: {
compilerOptions: {
declaration: format === 'es',
declaration: false,
target: 'es6',
module: format === 'cjs' ? 'es2015' : 'esnext',
},
Expand Down Expand Up @@ -67,5 +68,10 @@ export function createEntries (options) {
console.log(`Building ${format}: ${finalConfig.output.file}`)

return finalConfig
}).concat({
input,
output: [{ file: 'dist/index.d.ts', format: 'es' }],
plugins: [dts({ respectExternal: true })],
external: config.external || [],
})
}
1 change: 1 addition & 0 deletions npm/mount-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-node-resolve": "^11.1.1",
"rollup": "^2.38.5",
"rollup-plugin-dts": "^4.2.3",
"rollup-plugin-typescript2": "^0.29.0",
"typescript": "^4.7.4"
},
Expand Down
69 changes: 0 additions & 69 deletions npm/vue/inline-types.ts

This file was deleted.

2 changes: 1 addition & 1 deletion npm/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"cy:open": "node ../../scripts/cypress.js open --component --project ${PWD}",
"cy:run": "node ../../scripts/cypress.js run --component --project ${PWD}",
"build": "rimraf dist && rollup -c rollup.config.mjs",
"postbuild": "node --require @packages/ts/register ./inline-types.ts && node ../../scripts/sync-exported-npm-with-cli.js",
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
"typecheck": "yarn tsd && vue-tsc --noEmit",
"test": "yarn cy:run",
"tsd": "yarn build && yarn tsc -p test-tsd/tsconfig.tsd.json",
Expand Down
4 changes: 1 addition & 3 deletions npm/vue2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@
"test": "echo \"Tests for @cypress/vue2 are run from system-tests\"",
"watch": "yarn build --watch --watch.exclude ./dist/**/*"
},
"dependencies": {
"@vue/test-utils": "^1.1.3"
},
"devDependencies": {
"@cypress/mount-utils": "0.0.0-development",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-replace": "^2.3.1",
"@vue/test-utils": "^1.3.1",
"tslib": "^2.1.0",
"typescript": "^4.7.4",
"vue": "2.6.12"
Expand Down
3 changes: 3 additions & 0 deletions scripts/sync-exported-npm-with-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ packlist({ path: currentPackageDir })
const exportName = currentPackageConfig.name.replace('@cypress/', '')
const outDir = path.join(cliPath, exportName)

// Remove output directory to clean up old files before building
fs.removeSync(outDir)

// 3. For each file, mkdir if not exists, and then copy the dist'd assets over
// to write to the `cliPackageConfig` at the end
files.forEach((f) => {
Expand Down
53 changes: 31 additions & 22 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -824,12 +824,12 @@
dependencies:
"@babel/highlight" "^7.8.3"

"@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":
version "7.16.7"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789"
integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==
"@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":
version "7.18.6"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a"
integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==
dependencies:
"@babel/highlight" "^7.16.7"
"@babel/highlight" "^7.18.6"

"@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":
version "7.17.7"
Expand Down Expand Up @@ -1101,10 +1101,10 @@
dependencies:
"@babel/types" "^7.16.7"

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

"@babel/helper-validator-option@^7.12.17", "@babel/helper-validator-option@^7.16.7":
version "7.16.7"
Expand All @@ -1130,12 +1130,12 @@
"@babel/traverse" "^7.17.9"
"@babel/types" "^7.17.0"

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

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

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

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

Expand Down Expand Up @@ -29606,6 +29606,15 @@ rollup-plugin-copy@3.4.0:
globby "10.0.1"
is-plain-object "^3.0.0"

rollup-plugin-dts@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/rollup-plugin-dts/-/rollup-plugin-dts-4.2.3.tgz#04c3615df1ffab4228aa9d540697eaca61e01f47"
integrity sha512-jlcpItqM2efqfIiKzDB/IKOS9E9fDvbkJSGw5GtK/PqPGS9eC3R3JKyw2VvpTktZA+TNgJRMu1NTv244aTUzzQ==
dependencies:
magic-string "^0.26.6"
optionalDependencies:
"@babel/code-frame" "^7.18.6"

rollup-plugin-node-builtins@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/rollup-plugin-node-builtins/-/rollup-plugin-node-builtins-2.1.2.tgz#24a1fed4a43257b6b64371d8abc6ce1ab14597e9"
Expand Down

0 comments on commit 58e0ab9

Please sign in to comment.