From f776624a7c50ec04307609bf67c7b103857caec2 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Sat, 2 May 2020 10:28:03 +0200 Subject: [PATCH] chore: require minimum typescript@3.8 (#9823) --- .github/workflows/nodejs.yml | 2 - CHANGELOG.md | 1 + package.json | 3 -- packages/babel-jest/package.json | 7 ---- packages/babel-plugin-jest-hoist/package.json | 7 ---- packages/diff-sequences/package.json | 7 ---- packages/expect/package.json | 7 ---- packages/jest-changed-files/package.json | 7 ---- packages/jest-circus/package.json | 7 ---- packages/jest-cli/package.json | 7 ---- packages/jest-config/package.json | 7 ---- packages/jest-console/package.json | 7 ---- packages/jest-console/src/CustomConsole.ts | 3 +- packages/jest-core/package.json | 7 ---- packages/jest-diff/package.json | 7 ---- packages/jest-docblock/package.json | 7 ---- packages/jest-each/package.json | 7 ---- packages/jest-environment-jsdom/package.json | 7 ---- packages/jest-environment-node/package.json | 7 ---- packages/jest-environment/package.json | 7 ---- packages/jest-fake-timers/package.json | 7 ---- packages/jest-get-type/package.json | 7 ---- packages/jest-globals/package.json | 7 ---- packages/jest-haste-map/package.json | 7 ---- packages/jest-jasmine2/package.json | 7 ---- packages/jest-leak-detector/package.json | 7 ---- packages/jest-matcher-utils/package.json | 7 ---- packages/jest-message-util/package.json | 7 ---- packages/jest-mock/package.json | 7 ---- packages/jest-phabricator/package.json | 7 ---- packages/jest-regex-util/package.json | 7 ---- packages/jest-repl/package.json | 7 ---- packages/jest-reporters/package.json | 7 ---- .../jest-resolve-dependencies/package.json | 7 ---- packages/jest-resolve/package.json | 7 ---- packages/jest-runner/package.json | 7 ---- packages/jest-runtime/package.json | 7 ---- packages/jest-serializer/package.json | 7 ---- packages/jest-snapshot/package.json | 7 ---- packages/jest-source-map/package.json | 7 ---- packages/jest-test-result/package.json | 7 ---- packages/jest-test-sequencer/package.json | 7 ---- packages/jest-transform/package.json | 7 ---- packages/jest-transform/src/types.ts | 5 +-- packages/jest-types/package.json | 7 ---- packages/jest-types/src/Global.ts | 9 ++--- packages/jest-util/package.json | 7 ---- packages/jest-validate/package.json | 7 ---- packages/jest-watcher/package.json | 7 ---- packages/jest-worker/package.json | 7 ---- packages/jest/package.json | 7 ---- packages/pretty-format/package.json | 7 ---- packages/test-utils/package.json | 7 ---- scripts/buildTs.js | 39 ++++--------------- yarn.lock | 10 +---- 55 files changed, 15 insertions(+), 386 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 5df30a9d3bc7..e38bbbd905b4 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -41,8 +41,6 @@ jobs: run: node scripts/build.js - name: run tsc run: yarn build:ts - - name: verify ts 3.4 compatibility - run: yarn verify-old-ts - name: run eslint run: yarn lint - name: run prettier diff --git a/CHANGELOG.md b/CHANGELOG.md index 80d3a97e863d..91ec3a7baa3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ### Chore & Maintenance +- `[*]` [**BREAKING**] TypeScript definitions requires a minimum of TypeScript v3.8 ([#9823](https://github.com/facebook/jest/pull/9823)) - `[jest-runtime]` [**BREAKING**] Remove long-deprecated `require.requireActual` and `require.requireMock` methods ([#9854](https://github.com/facebook/jest/pull/9854)) - `[expect, jest-mock, pretty-format]` [**BREAKING**] Remove `build-es5` from package ([#9945](https://github.com/facebook/jest/pull/9945)) diff --git a/package.json b/package.json index e560e0355b7e..f0f5a3be9a1b 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "codecov": "^3.0.0", "debug": "^4.0.1", "dedent": "^0.7.0", - "downlevel-dts": "^0.4.0", "eslint": "^6.2.2", "eslint-config-prettier": "^6.1.0", "eslint-plugin-babel": "^5.1.0", @@ -76,7 +75,6 @@ "string-length": "^3.1.0", "strip-ansi": "^6.0.0", "tempy": "~0.3.0", - "throat": "^5.0.0", "typescript": "^3.8.2", "which": "^2.0.1" }, @@ -102,7 +100,6 @@ "test-pretty-format-perf": "node packages/pretty-format/perf/test.js", "test-leak": "yarn jest -i --detectLeaks jest-mock jest-diff jest-repl", "test": "yarn lint && yarn jest", - "verify-old-ts": "node ./scripts/verifyOldTs.js", "watch": "yarn build && node ./scripts/watch.js", "watch:ts": "yarn build:ts --watch" }, diff --git a/packages/babel-jest/package.json b/packages/babel-jest/package.json index 890ca9a6a0ab..3e502141f332 100644 --- a/packages/babel-jest/package.json +++ b/packages/babel-jest/package.json @@ -10,13 +10,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/transform": "^25.5.1", "@jest/types": "^25.5.0", diff --git a/packages/babel-plugin-jest-hoist/package.json b/packages/babel-plugin-jest-hoist/package.json index ae5ecc0fbba7..a7b5973e3a7e 100644 --- a/packages/babel-plugin-jest-hoist/package.json +++ b/packages/babel-plugin-jest-hoist/package.json @@ -12,13 +12,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@babel/template": "^7.3.3", "@babel/types": "^7.3.3", diff --git a/packages/diff-sequences/package.json b/packages/diff-sequences/package.json index 7912d18f0d65..c1ca52cae128 100644 --- a/packages/diff-sequences/package.json +++ b/packages/diff-sequences/package.json @@ -20,13 +20,6 @@ }, "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "scripts": { "perf": "node --expose-gc perf/index.js" }, diff --git a/packages/expect/package.json b/packages/expect/package.json index 18101b026061..192ca431789a 100644 --- a/packages/expect/package.json +++ b/packages/expect/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/types": "^25.5.0", "ansi-styles": "^4.0.0", diff --git a/packages/jest-changed-files/package.json b/packages/jest-changed-files/package.json index 78fbeb4263bb..66135646dc44 100644 --- a/packages/jest-changed-files/package.json +++ b/packages/jest-changed-files/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/types": "^25.5.0", "execa": "^3.2.0", diff --git a/packages/jest-circus/package.json b/packages/jest-circus/package.json index bcdfe2bfa998..4936defbf169 100644 --- a/packages/jest-circus/package.json +++ b/packages/jest-circus/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@babel/traverse": "^7.1.0", "@jest/environment": "^25.5.0", diff --git a/packages/jest-cli/package.json b/packages/jest-cli/package.json index cac8d7b90e05..909a8f1e3398 100644 --- a/packages/jest-cli/package.json +++ b/packages/jest-cli/package.json @@ -4,13 +4,6 @@ "version": "25.5.4", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/core": "^25.5.4", "@jest/test-result": "^25.5.0", diff --git a/packages/jest-config/package.json b/packages/jest-config/package.json index 0f1e74f3bced..0391417fccc0 100644 --- a/packages/jest-config/package.json +++ b/packages/jest-config/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@babel/core": "^7.1.0", "@jest/test-sequencer": "^25.5.4", diff --git a/packages/jest-console/package.json b/packages/jest-console/package.json index 80b76d9c1b96..10323ae96373 100644 --- a/packages/jest-console/package.json +++ b/packages/jest-console/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/types": "^25.5.0", "chalk": "^3.0.0", diff --git a/packages/jest-console/src/CustomConsole.ts b/packages/jest-console/src/CustomConsole.ts index 1bd27f3ac923..59a7e8441d7a 100644 --- a/packages/jest-console/src/CustomConsole.ts +++ b/packages/jest-console/src/CustomConsole.ts @@ -51,8 +51,7 @@ export default class CustomConsole extends Console { ); } - // use `asserts` when https://github.com/sandersn/downlevel-dts/issues/32 is fixed - assert(value: unknown, message?: string | Error): void { + assert(value: unknown, message?: string | Error): asserts value { try { assert(value, message); } catch (error) { diff --git a/packages/jest-core/package.json b/packages/jest-core/package.json index e8f63659e764..47a2bc29bdc1 100644 --- a/packages/jest-core/package.json +++ b/packages/jest-core/package.json @@ -4,13 +4,6 @@ "version": "25.5.4", "main": "build/jest.js", "types": "build/jest.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/console": "^25.5.0", "@jest/reporters": "^25.5.1", diff --git a/packages/jest-diff/package.json b/packages/jest-diff/package.json index 4b05af5f8479..8bceb6695c8e 100644 --- a/packages/jest-diff/package.json +++ b/packages/jest-diff/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "chalk": "^3.0.0", "diff-sequences": "^25.2.6", diff --git a/packages/jest-docblock/package.json b/packages/jest-docblock/package.json index 8264e146ade3..411507e2fd51 100644 --- a/packages/jest-docblock/package.json +++ b/packages/jest-docblock/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "detect-newline": "^3.0.0" }, diff --git a/packages/jest-each/package.json b/packages/jest-each/package.json index 0268d2dcd54f..90cc9181adfe 100644 --- a/packages/jest-each/package.json +++ b/packages/jest-each/package.json @@ -4,13 +4,6 @@ "description": "Parameterised tests for Jest", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "repository": { "type": "git", "url": "https://github.com/facebook/jest.git", diff --git a/packages/jest-environment-jsdom/package.json b/packages/jest-environment-jsdom/package.json index c25da57ea444..4dc983922ad4 100644 --- a/packages/jest-environment-jsdom/package.json +++ b/packages/jest-environment-jsdom/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/environment": "^25.5.0", "@jest/fake-timers": "^25.5.0", diff --git a/packages/jest-environment-node/package.json b/packages/jest-environment-node/package.json index c4f32f2c0310..50fc83adb9d1 100644 --- a/packages/jest-environment-node/package.json +++ b/packages/jest-environment-node/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/environment": "^25.5.0", "@jest/fake-timers": "^25.5.0", diff --git a/packages/jest-environment/package.json b/packages/jest-environment/package.json index 21b3b2da18f0..212cac54db82 100644 --- a/packages/jest-environment/package.json +++ b/packages/jest-environment/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/fake-timers": "^25.5.0", "@jest/types": "^25.5.0", diff --git a/packages/jest-fake-timers/package.json b/packages/jest-fake-timers/package.json index 9c114fe73b1e..0e4850b19041 100644 --- a/packages/jest-fake-timers/package.json +++ b/packages/jest-fake-timers/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/types": "^25.5.0", "jest-message-util": "^25.5.0", diff --git a/packages/jest-get-type/package.json b/packages/jest-get-type/package.json index ae0524cb5af4..d752bcdc2c57 100644 --- a/packages/jest-get-type/package.json +++ b/packages/jest-get-type/package.json @@ -13,13 +13,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "publishConfig": { "access": "public" }, diff --git a/packages/jest-globals/package.json b/packages/jest-globals/package.json index 024d7d52fa17..93617a4fae85 100644 --- a/packages/jest-globals/package.json +++ b/packages/jest-globals/package.json @@ -12,13 +12,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/environment": "^25.5.0", "@jest/types": "^25.5.0", diff --git a/packages/jest-haste-map/package.json b/packages/jest-haste-map/package.json index 7b6deebf45df..f4dafcf41ba0 100644 --- a/packages/jest-haste-map/package.json +++ b/packages/jest-haste-map/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/types": "^25.5.0", "@types/graceful-fs": "^4.1.2", diff --git a/packages/jest-jasmine2/package.json b/packages/jest-jasmine2/package.json index 972777670d70..0afca1f54a1f 100644 --- a/packages/jest-jasmine2/package.json +++ b/packages/jest-jasmine2/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@babel/traverse": "^7.1.0", "@jest/environment": "^25.5.0", diff --git a/packages/jest-leak-detector/package.json b/packages/jest-leak-detector/package.json index d769aec2a2ad..190e31f8cec9 100644 --- a/packages/jest-leak-detector/package.json +++ b/packages/jest-leak-detector/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "jest-get-type": "^25.2.6", "pretty-format": "^25.5.0" diff --git a/packages/jest-matcher-utils/package.json b/packages/jest-matcher-utils/package.json index 51c5b5ad316d..009b9b870f7e 100644 --- a/packages/jest-matcher-utils/package.json +++ b/packages/jest-matcher-utils/package.json @@ -13,13 +13,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "chalk": "^3.0.0", "jest-diff": "^25.5.0", diff --git a/packages/jest-message-util/package.json b/packages/jest-message-util/package.json index ec63967c9fd4..091c69afe882 100644 --- a/packages/jest-message-util/package.json +++ b/packages/jest-message-util/package.json @@ -12,13 +12,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@babel/code-frame": "^7.0.0", "@jest/types": "^25.5.0", diff --git a/packages/jest-mock/package.json b/packages/jest-mock/package.json index 33e5455da8ac..d69c11f518f4 100644 --- a/packages/jest-mock/package.json +++ b/packages/jest-mock/package.json @@ -18,13 +18,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "publishConfig": { "access": "public" }, diff --git a/packages/jest-phabricator/package.json b/packages/jest-phabricator/package.json index 27f161c7a5df..1df1b1093872 100644 --- a/packages/jest-phabricator/package.json +++ b/packages/jest-phabricator/package.json @@ -7,13 +7,6 @@ "directory": "packages/jest-phabricator" }, "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/test-result": "^25.5.0" }, diff --git a/packages/jest-regex-util/package.json b/packages/jest-regex-util/package.json index e7b7206e03eb..641872644187 100644 --- a/packages/jest-regex-util/package.json +++ b/packages/jest-regex-util/package.json @@ -15,13 +15,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "publishConfig": { "access": "public" }, diff --git a/packages/jest-repl/package.json b/packages/jest-repl/package.json index 46d95b897e0d..f58e7ef48f1a 100644 --- a/packages/jest-repl/package.json +++ b/packages/jest-repl/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/transform": "^25.5.1", "@jest/types": "^25.5.0", diff --git a/packages/jest-reporters/package.json b/packages/jest-reporters/package.json index db46b54c84d6..aec7082bcefa 100644 --- a/packages/jest-reporters/package.json +++ b/packages/jest-reporters/package.json @@ -4,13 +4,6 @@ "version": "25.5.1", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@bcoe/v8-coverage": "^0.2.3", "@jest/console": "^25.5.0", diff --git a/packages/jest-resolve-dependencies/package.json b/packages/jest-resolve-dependencies/package.json index fdd77539838a..5435835f909d 100644 --- a/packages/jest-resolve-dependencies/package.json +++ b/packages/jest-resolve-dependencies/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/types": "^25.5.0", "jest-regex-util": "^25.2.6", diff --git a/packages/jest-resolve/package.json b/packages/jest-resolve/package.json index 5645f2741d8b..d5d7d9519630 100644 --- a/packages/jest-resolve/package.json +++ b/packages/jest-resolve/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/types": "^25.5.0", "chalk": "^3.0.0", diff --git a/packages/jest-runner/package.json b/packages/jest-runner/package.json index be0f557e0b4a..3113997eed45 100644 --- a/packages/jest-runner/package.json +++ b/packages/jest-runner/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/console": "^25.5.0", "@jest/environment": "^25.5.0", diff --git a/packages/jest-runtime/package.json b/packages/jest-runtime/package.json index bbdc4d714a54..fbf9987acdcb 100644 --- a/packages/jest-runtime/package.json +++ b/packages/jest-runtime/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/console": "^25.5.0", "@jest/environment": "^25.5.0", diff --git a/packages/jest-serializer/package.json b/packages/jest-serializer/package.json index c2a1f6db1ea5..3e5fbe5e0975 100644 --- a/packages/jest-serializer/package.json +++ b/packages/jest-serializer/package.json @@ -19,13 +19,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "publishConfig": { "access": "public" }, diff --git a/packages/jest-snapshot/package.json b/packages/jest-snapshot/package.json index a0b502a2a48d..dbf49e75795f 100644 --- a/packages/jest-snapshot/package.json +++ b/packages/jest-snapshot/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@babel/types": "^7.0.0", "@jest/types": "^25.5.0", diff --git a/packages/jest-source-map/package.json b/packages/jest-source-map/package.json index adef54f96044..56c7a89c2b55 100644 --- a/packages/jest-source-map/package.json +++ b/packages/jest-source-map/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "callsites": "^3.0.0", "graceful-fs": "^4.2.4", diff --git a/packages/jest-test-result/package.json b/packages/jest-test-result/package.json index d3d77ac88207..94b3d15c0ecc 100644 --- a/packages/jest-test-result/package.json +++ b/packages/jest-test-result/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/console": "^25.5.0", "@jest/types": "^25.5.0", diff --git a/packages/jest-test-sequencer/package.json b/packages/jest-test-sequencer/package.json index 2672d8352b42..53870f3044ab 100644 --- a/packages/jest-test-sequencer/package.json +++ b/packages/jest-test-sequencer/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/test-result": "^25.5.0", "graceful-fs": "^4.2.4", diff --git a/packages/jest-transform/package.json b/packages/jest-transform/package.json index a4bb71051a1d..b164e245e300 100644 --- a/packages/jest-transform/package.json +++ b/packages/jest-transform/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@babel/core": "^7.1.0", "@jest/types": "^25.5.0", diff --git a/packages/jest-transform/src/types.ts b/packages/jest-transform/src/types.ts index b984980e1112..483c8e6cc9a4 100644 --- a/packages/jest-transform/src/types.ts +++ b/packages/jest-transform/src/types.ts @@ -27,11 +27,8 @@ export type Options = ShouldInstrumentOptions & supportsStaticESM: boolean; }>; -// extends directly after https://github.com/sandersn/downlevel-dts/issues/33 is fixed -type SourceMapWithVersion = Omit; - // This is fixed in source-map@0.7.x, but we can't upgrade yet since it's async -interface FixedRawSourceMap extends SourceMapWithVersion { +interface FixedRawSourceMap extends Omit { version: number; } diff --git a/packages/jest-types/package.json b/packages/jest-types/package.json index c08c41db7f8d..cbe5cca4bf10 100644 --- a/packages/jest-types/package.json +++ b/packages/jest-types/package.json @@ -12,13 +12,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^1.1.1", diff --git a/packages/jest-types/src/Global.ts b/packages/jest-types/src/Global.ts index f4c0c327ead4..df96271c126a 100644 --- a/packages/jest-types/src/Global.ts +++ b/packages/jest-types/src/Global.ts @@ -93,10 +93,9 @@ export interface GlobalAdditions extends TestFrameworkGlobals { spyOnProperty: () => void; } -// TODO: Maybe add `| Window` in the future? -// extends directly after https://github.com/sandersn/downlevel-dts/issues/33 is fixed -type NodeGlobalWithoutAdditions = Omit; - -export interface Global extends GlobalAdditions, NodeGlobalWithoutAdditions { +export interface Global + extends GlobalAdditions, + // TODO: Maybe add `| Window` in the future? + Omit { [extras: string]: any; } diff --git a/packages/jest-util/package.json b/packages/jest-util/package.json index 49c5ddbc68d2..e802af44e54c 100644 --- a/packages/jest-util/package.json +++ b/packages/jest-util/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/types": "^25.5.0", "chalk": "^3.0.0", diff --git a/packages/jest-validate/package.json b/packages/jest-validate/package.json index 6aee18c8fd0a..cf1c6a4264d2 100644 --- a/packages/jest-validate/package.json +++ b/packages/jest-validate/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/types": "^25.5.0", "camelcase": "^5.3.1", diff --git a/packages/jest-watcher/package.json b/packages/jest-watcher/package.json index e5a677970b31..af6d9af43e3d 100644 --- a/packages/jest-watcher/package.json +++ b/packages/jest-watcher/package.json @@ -4,13 +4,6 @@ "version": "25.5.0", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/test-result": "^25.5.0", "@jest/types": "^25.5.0", diff --git a/packages/jest-worker/package.json b/packages/jest-worker/package.json index da50ed5ed656..cb9e664c2b9b 100644 --- a/packages/jest-worker/package.json +++ b/packages/jest-worker/package.json @@ -9,13 +9,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "merge-stream": "^2.0.0", "supports-color": "^7.0.0" diff --git a/packages/jest/package.json b/packages/jest/package.json index 5964b69fb1c1..7e5bd40a521f 100644 --- a/packages/jest/package.json +++ b/packages/jest/package.json @@ -4,13 +4,6 @@ "version": "25.5.4", "main": "build/jest.js", "types": "build/jest.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@jest/core": "^25.5.4", "import-local": "^3.0.2", diff --git a/packages/pretty-format/package.json b/packages/pretty-format/package.json index 66ea7d8b2c16..70c610ec602a 100644 --- a/packages/pretty-format/package.json +++ b/packages/pretty-format/package.json @@ -10,13 +10,6 @@ "description": "Stringify any JavaScript value.", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "author": "James Kyle ", "dependencies": { "@jest/types": "^25.5.0", diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 51046831e16a..00efbdd9a18f 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -5,13 +5,6 @@ "license": "MIT", "main": "build/index.js", "types": "build/index.d.ts", - "typesVersions": { - "<3.8": { - "build/*": [ - "build/ts3.4/*" - ] - } - }, "dependencies": { "@types/jest": "*", "@types/node": "*", diff --git a/scripts/buildTs.js b/scripts/buildTs.js index 9f8ed9c3c7cb..93af2fefe385 100644 --- a/scripts/buildTs.js +++ b/scripts/buildTs.js @@ -16,7 +16,6 @@ const util = require('util'); const chalk = require('chalk'); const execa = require('execa'); const globby = require('globby'); -const rimraf = require('rimraf'); const throat = require('throat'); const {getPackages} = require('./buildUtils'); @@ -111,34 +110,10 @@ Promise.all( } }), ), -) - .then(() => { - const downlevelArgs = ['--silent', 'downlevel-dts', 'build', 'build/ts3.4']; - - console.log(chalk.inverse(' Downleveling TypeScript definition files ')); - - return Promise.all( - packagesWithTs.map( - throat(cpus, pkgDir => { - // otherwise we get nested `ts3.4` directories - rimraf.sync(path.resolve(pkgDir, 'build/ts3.4')); - - return execa('yarn', downlevelArgs, {cwd: pkgDir, stdio: 'inherit'}); - }), - ), - ); - }) - .then(() => { - console.log( - chalk.inverse.green( - ' Successfully downleveled TypeScript definition files ', - ), - ); - }) - .catch(e => { - console.error( - chalk.inverse.red(' Unable to downlevel TypeScript definition files '), - ); - console.error(e.stack); - process.exitCode = 1; - }); +).catch(e => { + console.error( + chalk.inverse.red(' Unable to validate TypeScript definition files '), + ); + console.error(e.stack); + process.exitCode = 1; +}); diff --git a/yarn.lock b/yarn.lock index 972ca1c18448..b8c4f335b98e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5674,14 +5674,6 @@ dot-prop@^5.2.0: dependencies: is-obj "^2.0.0" -downlevel-dts@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/downlevel-dts/-/downlevel-dts-0.4.0.tgz#43f9f649c8b137373d76b4ee396d5a0227c10ddb" - integrity sha512-nh5vM3n2pRhPwZqh0iWo5gpItPAYEGEWw9yd0YpI+lO60B7A3A6iJlxDbt7kKVNbqBXKsptL+jwE/Yg5Go66WQ== - dependencies: - shelljs "^0.8.3" - typescript "^3.8.0-dev.20200111" - download@^6.2.2: version "6.2.5" resolved "https://registry.yarnpkg.com/download/-/download-6.2.5.tgz#acd6a542e4cd0bb42ca70cfc98c9e43b07039714" @@ -14386,7 +14378,7 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@*, typescript@^3.8.0-dev.20200111, typescript@^3.8.2: +typescript@*, typescript@^3.8.2: version "3.8.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061" integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==