-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ensure all packages correctly downlevel TS files (#9715)
- Loading branch information
Showing
15 changed files
with
155 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,8 +24,11 @@ export type Options = ShouldInstrumentOptions & | |
isInternalModule: boolean; | ||
}>; | ||
|
||
// extends directly after https://github.com/sandersn/downlevel-dts/issues/33 is fixed | ||
type SourceMapWithVersion = Omit<RawSourceMap, 'version'>; | ||
|
||
// This is fixed in [email protected], but we can't upgrade yet since it's async | ||
interface FixedRawSourceMap extends Omit<RawSourceMap, 'version'> { | ||
interface FixedRawSourceMap extends SourceMapWithVersion { | ||
version: number; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const chalk = require('chalk'); | ||
const execa = require('execa'); | ||
const rimraf = require('rimraf'); | ||
const tempy = require('tempy'); | ||
|
||
const jestDirectory = path.resolve(__dirname, '../packages/jest'); | ||
|
||
const tsConfig = { | ||
compilerOptions: { | ||
esModuleInterop: false, | ||
lib: ['es2018'], | ||
module: 'commonjs', | ||
moduleResolution: 'node', | ||
noEmit: true, | ||
strict: true, | ||
target: 'es5', | ||
}, | ||
}; | ||
const cwd = tempy.directory(); | ||
|
||
try { | ||
execa.sync('yarn', ['init', '--yes'], {cwd, stdio: 'inherit'}); | ||
execa.sync('yarn', ['add', 'typescript@~3.4'], {cwd, stdio: 'inherit'}); | ||
fs.writeFileSync( | ||
path.join(cwd, 'tsconfig.json'), | ||
JSON.stringify(tsConfig, null, 2) | ||
); | ||
fs.writeFileSync( | ||
path.join(cwd, 'index.ts'), | ||
`import jest = require('${jestDirectory}');` | ||
); | ||
execa.sync('yarn', ['tsc', '--project', '.'], {cwd, stdio: 'inherit'}); | ||
|
||
console.log( | ||
chalk.inverse.green(' Successfully compiled Jest with TypeScript 3.4 ') | ||
); | ||
} finally { | ||
rimraf.sync(cwd); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4931,6 +4931,11 @@ crypto-browserify@^3.11.0: | |
randombytes "^2.0.0" | ||
randomfill "^1.0.3" | ||
|
||
crypto-random-string@^1.0.0: | ||
version "1.0.0" | ||
resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" | ||
integrity sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4= | ||
|
||
[email protected], css-color-names@^0.0.4: | ||
version "0.0.4" | ||
resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.4.tgz#808adc2e79cf84738069b646cb20ec27beb629e0" | ||
|
@@ -13908,6 +13913,15 @@ tempfile@^2.0.0: | |
temp-dir "^1.0.0" | ||
uuid "^3.0.1" | ||
|
||
tempy@~0.3.0: | ||
version "0.3.0" | ||
resolved "https://registry.yarnpkg.com/tempy/-/tempy-0.3.0.tgz#6f6c5b295695a16130996ad5ab01a8bd726e8bf8" | ||
integrity sha512-WrH/pui8YCwmeiAoxV+lpRH9HpRtgBhSR2ViBPgpGb/wnYDzp21R4MN45fsCGvLROvY67o3byhJRYRONJyImVQ== | ||
dependencies: | ||
temp-dir "^1.0.0" | ||
type-fest "^0.3.1" | ||
unique-string "^1.0.0" | ||
|
||
terminal-link@^2.0.0: | ||
version "2.1.1" | ||
resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994" | ||
|
@@ -14245,7 +14259,7 @@ type-fest@^0.11.0: | |
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" | ||
integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== | ||
|
||
type-fest@^0.3.0: | ||
type-fest@^0.3.0, type-fest@^0.3.1: | ||
version "0.3.1" | ||
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.3.1.tgz#63d00d204e059474fe5e1b7c011112bbd1dc29e1" | ||
integrity sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ== | ||
|
@@ -14411,6 +14425,13 @@ unique-slug@^2.0.0: | |
dependencies: | ||
imurmurhash "^0.1.4" | ||
|
||
unique-string@^1.0.0: | ||
version "1.0.0" | ||
resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" | ||
integrity sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo= | ||
dependencies: | ||
crypto-random-string "^1.0.0" | ||
|
||
unist-util-is@^3.0.0: | ||
version "3.0.0" | ||
resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-3.0.0.tgz#d9e84381c2468e82629e4a5be9d7d05a2dd324cd" | ||
|