Skip to content

Commit ccb533f

Browse files
feat: Add Typescript types (cypress-io/cypress-webpack-preprocessor#72)
* feat: typings * fix: revert cypress version change * make eslint plugin happy, but also don't lint types file * chore: update yarn.lock Co-authored-by: Chris Breiding <[email protected]>
1 parent aebd27b commit ccb533f

File tree

4 files changed

+97
-35
lines changed

4 files changed

+97
-35
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
test/_test-output
22
cypress/tests/e2e/compile-error.js
33
test/fixtures
4+
*.ts

index.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import * as webpack from 'webpack';
2+
import Cypress from 'cypress';
3+
4+
declare namespace CypressWebpackPreProcessor {
5+
export type Options = { webpackOptions: webpack.Configuration };
6+
export type FilePreprocessor = (file: Cypress.FileObject) => string | Promise<string>;
7+
}
8+
9+
declare module "@cypress/webpack-preprocessor" {
10+
const _default: (options: CypressWebpackPreProcessor.Options) => CypressWebpackPreProcessor.FilePreprocessor;
11+
12+
export = _default;
13+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"ban": "ban",
88
"deps": "deps-ok && dependency-check --no-dev .",
99
"license": "license-checker --production --onlyunknown --csv",
10-
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json .",
10+
"lint": "eslint --ext .js,.jsx,.json .",
1111
"lint-fix": "yarn lint --fix",
1212
"secure": "nsp check",
1313
"semantic-release": "semantic-release",
@@ -27,6 +27,8 @@
2727
"@babel/core": "^7.0.1",
2828
"@babel/preset-env": "^7.0.0",
2929
"@cypress/eslint-plugin-dev": "5.0.0",
30+
"@typescript-eslint/eslint-plugin": "2.27.0",
31+
"@typescript-eslint/parser": "2.27.0",
3032
"babel-loader": "^8.0.2",
3133
"ban-sensitive-files": "1.9.0",
3234
"chai": "4.1.2",
@@ -60,6 +62,7 @@
6062
"files": [
6163
"*.js"
6264
],
65+
"types": "index.d.ts",
6366
"license": "MIT",
6467
"repository": {
6568
"type": "git",

yarn.lock

Lines changed: 79 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -964,6 +964,11 @@
964964
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
965965
integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==
966966

967+
"@types/eslint-visitor-keys@^1.0.0":
968+
version "1.0.0"
969+
resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d"
970+
integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==
971+
967972
"@types/events@*":
968973
version "3.0.0"
969974
resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7"
@@ -978,6 +983,11 @@
978983
"@types/minimatch" "*"
979984
"@types/node" "*"
980985

986+
"@types/json-schema@^7.0.3":
987+
version "7.0.4"
988+
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339"
989+
integrity sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==
990+
981991
"@types/minimatch@*":
982992
version "3.0.3"
983993
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
@@ -1013,6 +1023,49 @@
10131023
resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.2.tgz#a811b8c18e2babab7d542b3365887ae2e4d9de47"
10141024
integrity sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg==
10151025

1026+
"@typescript-eslint/[email protected]":
1027+
version "2.27.0"
1028+
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.27.0.tgz#e479cdc4c9cf46f96b4c287755733311b0d0ba4b"
1029+
integrity sha512-/my+vVHRN7zYgcp0n4z5A6HAK7bvKGBiswaM5zIlOQczsxj/aiD7RcgD+dvVFuwFaGh5+kM7XA6Q6PN0bvb1tw==
1030+
dependencies:
1031+
"@typescript-eslint/experimental-utils" "2.27.0"
1032+
functional-red-black-tree "^1.0.1"
1033+
regexpp "^3.0.0"
1034+
tsutils "^3.17.1"
1035+
1036+
"@typescript-eslint/[email protected]":
1037+
version "2.27.0"
1038+
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.27.0.tgz#801a952c10b58e486c9a0b36cf21e2aab1e9e01a"
1039+
integrity sha512-vOsYzjwJlY6E0NJRXPTeCGqjv5OHgRU1kzxHKWJVPjDYGbPgLudBXjIlc+OD1hDBZ4l1DLbOc5VjofKahsu9Jw==
1040+
dependencies:
1041+
"@types/json-schema" "^7.0.3"
1042+
"@typescript-eslint/typescript-estree" "2.27.0"
1043+
eslint-scope "^5.0.0"
1044+
eslint-utils "^2.0.0"
1045+
1046+
"@typescript-eslint/[email protected]":
1047+
version "2.27.0"
1048+
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.27.0.tgz#d91664335b2c46584294e42eb4ff35838c427287"
1049+
integrity sha512-HFUXZY+EdwrJXZo31DW4IS1ujQW3krzlRjBrFRrJcMDh0zCu107/nRfhk/uBasO8m0NVDbBF5WZKcIUMRO7vPg==
1050+
dependencies:
1051+
"@types/eslint-visitor-keys" "^1.0.0"
1052+
"@typescript-eslint/experimental-utils" "2.27.0"
1053+
"@typescript-eslint/typescript-estree" "2.27.0"
1054+
eslint-visitor-keys "^1.1.0"
1055+
1056+
"@typescript-eslint/[email protected]":
1057+
version "2.27.0"
1058+
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.27.0.tgz#a288e54605412da8b81f1660b56c8b2e42966ce8"
1059+
integrity sha512-t2miCCJIb/FU8yArjAvxllxbTiyNqaXJag7UOpB5DVoM3+xnjeOngtqlJkLRnMtzaRcJhe3CIR9RmL40omubhg==
1060+
dependencies:
1061+
debug "^4.1.1"
1062+
eslint-visitor-keys "^1.1.0"
1063+
glob "^7.1.6"
1064+
is-glob "^4.0.1"
1065+
lodash "^4.17.15"
1066+
semver "^6.3.0"
1067+
tsutils "^3.17.1"
1068+
10161069
"@webassemblyjs/[email protected]":
10171070
version "1.8.5"
10181071
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359"
@@ -2921,7 +2974,7 @@ debug@4, [email protected], debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1:
29212974
dependencies:
29222975
ms "^2.1.1"
29232976

2924-
debuglog@*, debuglog@^1.0.1:
2977+
debuglog@^1.0.1:
29252978
version "1.0.1"
29262979
resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492"
29272980
integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=
@@ -3409,6 +3462,13 @@ eslint-utils@^1.4.3:
34093462
dependencies:
34103463
eslint-visitor-keys "^1.1.0"
34113464

3465+
eslint-utils@^2.0.0:
3466+
version "2.0.0"
3467+
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.0.0.tgz#7be1cc70f27a72a76cd14aa698bcabed6890e1cd"
3468+
integrity sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==
3469+
dependencies:
3470+
eslint-visitor-keys "^1.1.0"
3471+
34123472
eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0:
34133473
version "1.1.0"
34143474
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2"
@@ -4737,7 +4797,7 @@ import-lazy@^2.1.0:
47374797
resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43"
47384798
integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=
47394799

4740-
imurmurhash@*, imurmurhash@^0.1.4:
4800+
imurmurhash@^0.1.4:
47414801
version "0.1.4"
47424802
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
47434803
integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
@@ -5793,11 +5853,6 @@ lockfile@^1.0.4:
57935853
dependencies:
57945854
signal-exit "^3.0.2"
57955855

5796-
lodash._baseindexof@*:
5797-
version "3.1.0"
5798-
resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c"
5799-
integrity sha1-/lK1OhxnYeQmGNZU5KJXie1hgiw=
5800-
58015856
lodash._baseuniq@~4.6.0:
58025857
version "4.6.0"
58035858
resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8"
@@ -5806,33 +5861,11 @@ lodash._baseuniq@~4.6.0:
58065861
lodash._createset "~4.0.0"
58075862
lodash._root "~3.0.0"
58085863

5809-
lodash._bindcallback@*:
5810-
version "3.0.1"
5811-
resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e"
5812-
integrity sha1-5THCdkTPi1epnhftlbNcdIeJOS4=
5813-
5814-
lodash._cacheindexof@*:
5815-
version "3.0.2"
5816-
resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92"
5817-
integrity sha1-PcaayCSY0u5ePOVgkbr9Ktx73pI=
5818-
5819-
lodash._createcache@*:
5820-
version "3.1.2"
5821-
resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093"
5822-
integrity sha1-VtagZAF2JeeevKa4AY4XRAvc8JM=
5823-
dependencies:
5824-
lodash._getnative "^3.0.0"
5825-
58265864
lodash._createset@~4.0.0:
58275865
version "4.0.3"
58285866
resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26"
58295867
integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY=
58305868

5831-
lodash._getnative@*, lodash._getnative@^3.0.0:
5832-
version "3.9.1"
5833-
resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
5834-
integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=
5835-
58365869
lodash._root@~3.0.0:
58375870
version "3.0.1"
58385871
resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692"
@@ -5888,11 +5921,6 @@ lodash.once@^4.1.1:
58885921
resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac"
58895922
integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=
58905923

5891-
lodash.restparam@*:
5892-
version "3.6.1"
5893-
resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805"
5894-
integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=
5895-
58965924
lodash.toarray@^4.4.0:
58975925
version "4.4.0"
58985926
resolved "https://registry.yarnpkg.com/lodash.toarray/-/lodash.toarray-4.4.0.tgz#24c4bfcd6b2fba38bfd0594db1179d8e9b656561"
@@ -8138,6 +8166,11 @@ regexpp@^2.0.1:
81388166
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f"
81398167
integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==
81408168

8169+
regexpp@^3.0.0:
8170+
version "3.1.0"
8171+
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2"
8172+
integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==
8173+
81418174
regexpu-core@^4.6.0:
81428175
version "4.6.0"
81438176
resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.6.0.tgz#2037c18b327cfce8a6fea2a4ec441f2432afb8b6"
@@ -9546,11 +9579,23 @@ trim-off-newlines@^1.0.0:
95469579
resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3"
95479580
integrity sha1-n5up2e+odkw4dpi8v+sshI8RrbM=
95489581

9582+
tslib@^1.8.1:
9583+
version "1.11.1"
9584+
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35"
9585+
integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==
9586+
95499587
tslib@^1.9.0:
95509588
version "1.10.0"
95519589
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
95529590
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
95539591

9592+
tsutils@^3.17.1:
9593+
version "3.17.1"
9594+
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759"
9595+
integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==
9596+
dependencies:
9597+
tslib "^1.8.1"
9598+
95549599
95559600
version "0.0.0"
95569601
resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"

0 commit comments

Comments
 (0)