Updating NPM dependencies
This commit is contained in:
2
node_modules/ts-jest/.ts-jest-digest
generated
vendored
2
node_modules/ts-jest/.ts-jest-digest
generated
vendored
@@ -1 +1 @@
|
||||
e2c1d8a30f4a1fa691815687145c378201aba86a
|
||||
a9a5dc2939780dca25d373663e916519b0ac2dfb
|
||||
449
node_modules/ts-jest/CHANGELOG.md
generated
vendored
449
node_modules/ts-jest/CHANGELOG.md
generated
vendored
@@ -1,3 +1,398 @@
|
||||
## [26.4.4](https://github.com/kulshekhar/ts-jest/compare/v26.4.3...v26.4.4) (2020-11-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* revert usage of `@jest/create-cache-key-function` ([#2108](https://github.com/kulshekhar/ts-jest/issues/2108)) ([dee8231](https://github.com/kulshekhar/ts-jest/commit/dee823172ce1e8eb9e0b2dd3aeed1ab4033bd0d9)), closes [#2080](https://github.com/kulshekhar/ts-jest/issues/2080) [#2090](https://github.com/kulshekhar/ts-jest/issues/2090) [#2104](https://github.com/kulshekhar/ts-jest/issues/2104)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **testing:** expose all types for util `mocked` ([#2096](https://github.com/kulshekhar/ts-jest/issues/2096)) ([b1d072b](https://github.com/kulshekhar/ts-jest/commit/b1d072b52b9a7665b3a6914b0895f84f6ee3f8c0)), closes [#2086](https://github.com/kulshekhar/ts-jest/issues/2086)
|
||||
|
||||
|
||||
|
||||
## [26.4.3](https://github.com/kulshekhar/ts-jest/compare/v26.4.2...v26.4.3) (2020-10-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **compiler:** only exclude test files when initializing compiler ([#2062](https://github.com/kulshekhar/ts-jest/issues/2062)) ([7264c13](https://github.com/kulshekhar/ts-jest/commit/7264c137114b6dd895624e3476dd7ec57b64ee13)), closes [#2061](https://github.com/kulshekhar/ts-jest/issues/2061), [#2068](https://github.com/kulshekhar/ts-jest/issues/2068), [#2072](https://github.com/kulshekhar/ts-jest/issues/2072), [#2073](https://github.com/kulshekhar/ts-jest/issues/2073)
|
||||
* **config:** resolve `.babelrc` file path before attempting to read it ([#2071](https://github.com/kulshekhar/ts-jest/issues/2071)) ([681bfef](https://github.com/kulshekhar/ts-jest/commit/681bfef41744f09cd50b71072f4d001cb58da82e)), closes [#2064](https://github.com/kulshekhar/ts-jest/issues/2064)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **config:** allow to override resolve tsconfig behavior ([#2063](https://github.com/kulshekhar/ts-jest/issues/2063)) ([9f46ace](https://github.com/kulshekhar/ts-jest/commit/9f46acefceb1fa71ee2e8b3b3c172ceb0544b4c4))
|
||||
|
||||
|
||||
|
||||
## [26.4.2](https://github.com/kulshekhar/ts-jest/compare/v26.4.1...v26.4.2) (2020-10-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **config:** expose several typings as public apis ([#2054](https://github.com/kulshekhar/ts-jest/issues/2054)) ([3b6b705](https://github.com/kulshekhar/ts-jest/commit/3b6b7055e2b9c74e81fb91596c807ace02ab77a1))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **compiler:** speed up bootstrap time for `isolatedModules:false` ([#2055](https://github.com/kulshekhar/ts-jest/issues/2055)) ([230b5dd](https://github.com/kulshekhar/ts-jest/commit/230b5ddbee55357d25dd190cd45aa8a30d7f31e0))
|
||||
|
||||
|
||||
### DEPRECATIONS
|
||||
|
||||
* **config**: deprecate `tsConfig` in favor of `tsconfig` ([#1997](https://github.com/kulshekhar/ts-jest/pull/1997))
|
||||
* **config**: deprecate `packageJson` since internal codes don't use it anymore ([#2034](https://github.com/kulshekhar/ts-jest/pull/2034))
|
||||
|
||||
|
||||
|
||||
## [26.4.1](https://github.com/kulshekhar/ts-jest/compare/v26.4.0...v26.4.1) (2020-09-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **utils:** `MaybeMockedConstructor` returns T ([#1976](https://github.com/kulshekhar/ts-jest/issues/1976)) ([b7712b2](https://github.com/kulshekhar/ts-jest/commit/b7712b2055d8f32dd97999de1d94e8f3515d79e8))
|
||||
* **utils:** revert `path.join` and add check on prefix ends with `/` ([#1989](https://github.com/kulshekhar/ts-jest/issues/1989)) ([3d9035b](https://github.com/kulshekhar/ts-jest/commit/3d9035bd70dc087d4c5a943bb2fe2af2d0822875)), closes [#1982](https://github.com/kulshekhar/ts-jest/issues/1982)
|
||||
|
||||
|
||||
|
||||
# [26.4.0](https://github.com/kulshekhar/ts-jest/compare/v26.3.0...v26.4.0) (2020-09-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **utils:** `pathsToModuleNameMapper` resolve path mapping with `path.join` ([#1969](https://github.com/kulshekhar/ts-jest/issues/1969)) ([81fce4c](https://github.com/kulshekhar/ts-jest/commit/81fce4c090811a1cc071579a99dc193fb976b117)), closes [#1968](https://github.com/kulshekhar/ts-jest/issues/1968)
|
||||
* set minimum `jest-util` version at 26.1.0 ([#1914](https://github.com/kulshekhar/ts-jest/issues/1914)) ([f00414c](https://github.com/kulshekhar/ts-jest/commit/f00414c6fbf8fc5413fd33d0a271c4a164c50d45)), closes [#1913](https://github.com/kulshekhar/ts-jest/issues/1913)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **config:** allow custom options in custom transformers ([#1966](https://github.com/kulshekhar/ts-jest/issues/1966)) ([1452ce4](https://github.com/kulshekhar/ts-jest/commit/1452ce4afcd36049cddd0db0861f1ac26b66f8c1)), closes [#1942](https://github.com/kulshekhar/ts-jest/issues/1942)
|
||||
* **transformers:** support hoisting when using `@jest/globals` ([#1937](https://github.com/kulshekhar/ts-jest/issues/1937)) ([0e5be15](https://github.com/kulshekhar/ts-jest/commit/0e5be1597d755fed11869f67df05eeea54b3106f)), closes [#1593](https://github.com/kulshekhar/ts-jest/issues/1593)
|
||||
* **transformers:** add `path-mapping` custom AST transformer ([#1927](https://github.com/kulshekhar/ts-jest/issues/1927)) ([3325186](https://github.com/kulshekhar/ts-jest/commit/3325186b6e55f41eb9bf7d81e092a358fc402b13))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **compiler:** remove `createProgram` for `isolatedModules: true` to boost startup speed ([#1941](https://github.com/kulshekhar/ts-jest/issues/1941)) ([dd84534](https://github.com/kulshekhar/ts-jest/commit/dd8453401840862186f991e2d514e0d328a67987))
|
||||
|
||||
|
||||
|
||||
# [26.3.0](https://github.com/kulshekhar/ts-jest/compare/v26.2.0...v26.3.0) (2020-08-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **config:** compute cache key without reading `package.json` ([#1893](https://github.com/kulshekhar/ts-jest/issues/1893)) ([4875a58](https://github.com/kulshekhar/ts-jest/commit/4875a58345666e0407f9f5b3f95049ae2c9d056d)), closes [#1892](https://github.com/kulshekhar/ts-jest/issues/1892)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* support TypeScript 4.0 ([#1889](https://github.com/kulshekhar/ts-jest/issues/1889)) ([f070e93](https://github.com/kulshekhar/ts-jest/commit/f070e9334a9cf31fa6f0d73b3f69d805be72601d))
|
||||
|
||||
|
||||
|
||||
# [26.2.0](https://github.com/kulshekhar/ts-jest/compare/v26.1.4...v26.2.0) (2020-08-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* move `@types/jest` to dependencies to work well with yarn 2 ([#1859](https://github.com/kulshekhar/ts-jest/issues/1859)) ([5eb1389](https://github.com/kulshekhar/ts-jest/commit/5eb1389caaa0431e49ae6ca26b18e290208e0a0a)), closes [#1857](https://github.com/kulshekhar/ts-jest/issues/1857)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **config:** support `after` and `afterDeclarations` AST transformers ([#1831](https://github.com/kulshekhar/ts-jest/issues/1831)) ([be20a7c](https://github.com/kulshekhar/ts-jest/commit/be20a7c78c97027b33aec178da0f533095790871))
|
||||
* allow opt-out version warning message by environment variable `TS_JEST_DISABLE_VER_CHECKER` ([#1821](https://github.com/kulshekhar/ts-jest/issues/1821)) ([e6b42fc](https://github.com/kulshekhar/ts-jest/commit/e6b42fcd7a75c7b14e636a45cda04de18a46908b)), closes [#1774](https://github.com/kulshekhar/ts-jest/issues/1774)
|
||||
|
||||
|
||||
|
||||
## [26.1.4](https://github.com/kulshekhar/ts-jest/compare/v26.1.3...v26.1.4) (2020-07-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **compiler:** check if test file exists before doing type check ([#1827](https://github.com/kulshekhar/ts-jest/issues/1827)) ([cc89d5b](https://github.com/kulshekhar/ts-jest/commit/cc89d5b1f912975cd29114c5b3b0bf18426816da)), closes [#1506](https://github.com/kulshekhar/ts-jest/issues/1506)
|
||||
|
||||
|
||||
|
||||
## [26.1.3](https://github.com/kulshekhar/ts-jest/compare/v26.1.2...v26.1.3) (2020-07-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* revert [#1793](https://github.com/kulshekhar/ts-jest/issues/1793) ([#1804](https://github.com/kulshekhar/ts-jest/issues/1804)) ([5095525](https://github.com/kulshekhar/ts-jest/commit/5095525333c8579c9c5e7f3149294b31f28d6774))
|
||||
|
||||
|
||||
|
||||
## [26.1.2](https://github.com/kulshekhar/ts-jest/compare/v26.1.1...v26.1.2) (2020-07-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **compiler:** use `resolveModuleNames` TypeScript API to get resolved modules for test files ([#1784](https://github.com/kulshekhar/ts-jest/issues/1784)) ([5f26054](https://github.com/kulshekhar/ts-jest/commit/5f2605457e94b548bd7b9b28fc968554f7eefa91)), closes [#1747](https://github.com/kulshekhar/ts-jest/issues/1747)
|
||||
* **config:** invalidate cache when other options in `tsconfig` change ([#1788](https://github.com/kulshekhar/ts-jest/issues/1788)) ([6948855](https://github.com/kulshekhar/ts-jest/commit/69488552eca2846f3fc6ba86ab49d7893caaf521))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **compiler:** cache module resolution for `isolatedModules: false` ([#1786](https://github.com/kulshekhar/ts-jest/issues/1786)) ([7f731ed](https://github.com/kulshekhar/ts-jest/commit/7f731ed8a02755aeb41ecb27df4eaf16db2ddd95))
|
||||
* **compiler:** use `globsToMatcher` from `jest-util` ([#1754](https://github.com/kulshekhar/ts-jest/issues/1754)) ([44f3913](https://github.com/kulshekhar/ts-jest/commit/44f3913c2a017734ed87346b1c5fbec639d02062))
|
||||
|
||||
|
||||
|
||||
<a name="26.1.1"></a>
|
||||
## [26.1.1](https://github.com/kulshekhar/ts-jest/compare/v26.1.0...v26.1.1) (2020-06-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **compiler:** generate source map correctly when tsconfig `mapRoot` is set ([#1741](https://github.com/kulshekhar/ts-jest/issues/1741)) ([01ac417](https://github.com/kulshekhar/ts-jest/commit/01ac417)), closes [#1718](https://github.com/kulshekhar/ts-jest/issues/1718)
|
||||
* **config:** show version warning when using ts-jest without babel ([#1729](https://github.com/kulshekhar/ts-jest/issues/1729)) ([e512bc0](https://github.com/kulshekhar/ts-jest/commit/e512bc0)), fixes [#1678-issuecomment-641930332](https://github.com//github.com/kulshekhar/ts-jest/pull/1678/issues/issuecomment-641930332), [#1678-issuecomment-639528993](https://github.com//github.com/kulshekhar/ts-jest/pull/1678/issues/issuecomment-639528993)
|
||||
|
||||
|
||||
|
||||
<a name="26.1.0"></a>
|
||||
# [26.1.0](https://github.com/kulshekhar/ts-jest/compare/v26.0.0...v26.1.0) (2020-05-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **typing:** don't mark `BabelConfig` as internal type ([#1667](https://github.com/kulshekhar/ts-jest/issues/1667)) ([558c307](https://github.com/kulshekhar/ts-jest/commit/558c307)), closes [#1666](https://github.com/kulshekhar/ts-jest/issues/1666)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **config:** show a warning message when TypeScript `target` version doesn't match with recommended NodeJs version ([#1678](https://github.com/kulshekhar/ts-jest/issues/1678)) ([085bdf5](https://github.com/kulshekhar/ts-jest/commit/085bdf5))
|
||||
* **config:** support multiple paths for `pathsToModuleNameMapper` ([#1690](https://github.com/kulshekhar/ts-jest/issues/1690)) ([a727bd5](https://github.com/kulshekhar/ts-jest/commit/a727bd5))
|
||||
* support TypeScript 3.9 ([#1653](https://github.com/kulshekhar/ts-jest/issues/1653)) ([fc3d5ad](https://github.com/kulshekhar/ts-jest/commit/fc3d5ad))
|
||||
|
||||
|
||||
|
||||
<a name="26.0.0"></a>
|
||||
# [26.0.0](https://github.com/kulshekhar/ts-jest/compare/v25.5.1...v26.0.0) (2020-05-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **compiler:** return `undefined` for `getScriptVersion` when a file doesn't exist in memory cache ([#1641](https://github.com/kulshekhar/ts-jest/issues/1641)) ([6851b8e](https://github.com/kulshekhar/ts-jest/commit/6851b8e))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* support Jest v26 ([#1602](https://github.com/kulshekhar/ts-jest/issues/1602)) ([23b7741](https://github.com/kulshekhar/ts-jest/commit/23b7741))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* Requires a minimum of TypeScript v3.8
|
||||
* Drop support for Node 8
|
||||
|
||||
|
||||
<a name="25.5.1"></a>
|
||||
## [25.5.1](https://github.com/kulshekhar/ts-jest/compare/v25.5.0...v25.5.1) (2020-05-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **compiler:** don't resolve files from build folder for `projectReferences` ([#1614](https://github.com/kulshekhar/ts-jest/issues/1614)) ([74b92d3](https://github.com/kulshekhar/ts-jest/commit/74b92d3))
|
||||
* **config:** don't set `include` value of `tsconfig` to empty array ([#1606](https://github.com/kulshekhar/ts-jest/issues/1606)) ([8a29aaa](https://github.com/kulshekhar/ts-jest/commit/8a29aaa))
|
||||
|
||||
|
||||
|
||||
<a name="25.5.0"></a>
|
||||
# [25.5.0](https://github.com/kulshekhar/ts-jest/compare/v25.4.0...v25.5.0) (2020-05-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **compiler:** make `projectReferences` work with `isolatedModules: false` ([#1541](https://github.com/kulshekhar/ts-jest/issues/1541)) ([3e8efbe](https://github.com/kulshekhar/ts-jest/commit/3e8efbe))
|
||||
* **compiler:** allow using `files` provided by `tsconfig` ([#1562](https://github.com/kulshekhar/ts-jest/issues/1562)) ([a9f02bd](https://github.com/kulshekhar/ts-jest/commit/a9f02bd))
|
||||
* **config:** verify `testMatchPatterns` contain RegExp instance or string type values ([#1569](https://github.com/kulshekhar/ts-jest/issues/1569)) ([7f85bab](https://github.com/kulshekhar/ts-jest/commit/7f85bab))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **config:** add `tsconfig` alias to `tsConfig` option ([#1565](https://github.com/kulshekhar/ts-jest/issues/1565)) ([c10eb6d](https://github.com/kulshekhar/ts-jest/commit/c10eb6d))
|
||||
* **config:** define 'ts-jest' on `ConfigGlobals` interface of `@jest/types` ([#1592](https://github.com/kulshekhar/ts-jest/issues/1592)) ([4526392](https://github.com/kulshekhar/ts-jest/commit/4526392))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **compiler:** don’t write compile output to file system but rely on jest cache ([#1561](https://github.com/kulshekhar/ts-jest/issues/1561)) ([d11a4ea](https://github.com/kulshekhar/ts-jest/commit/d11a4ea))
|
||||
* **compiler:** improve performance for `isolatedModules: false` ([#1558](https://github.com/kulshekhar/ts-jest/issues/1558)) ([85c09e3](https://github.com/kulshekhar/ts-jest/commit/85c09e3))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* Any custom typing files or files which are needed to be compiled and intended to use with `jest` need to be defined in `files` option of `tsconfig`.
|
||||
|
||||
For example:
|
||||
```
|
||||
// tsconfig.json
|
||||
{
|
||||
// ...other configs
|
||||
"files": [
|
||||
"my-custom-typings.d.ts",
|
||||
"my-global-module.ts"
|
||||
]
|
||||
}
|
||||
```
|
||||
* **compiler:** `incremental` and `compilerHost` options are no longer available. Please remove it from your `ts-jest` config.
|
||||
|
||||
|
||||
|
||||
<a name="25.5.0-beta.0"></a>
|
||||
# [25.5.0-beta.0](https://github.com/kulshekhar/ts-jest/compare/v25.5.0-alpha.0...v25.5.0-beta.0) (2020-04-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **compiler:** allow using `files` provided by `tsconfig` ([#1562](https://github.com/kulshekhar/ts-jest/issues/1562)) ([907a280](https://github.com/kulshekhar/ts-jest/commit/907a280))
|
||||
* **config:** verify `testMatchPatterns` contain `RegExp` instance or `string` type values ([#1569](https://github.com/kulshekhar/ts-jest/issues/1569)) ([7f85bab](https://github.com/kulshekhar/ts-jest/commit/7f85bab))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **config:** add `tsconfig` alias to `tsConfig` option ([#1565](https://github.com/kulshekhar/ts-jest/issues/1565)) ([c10eb6d](https://github.com/kulshekhar/ts-jest/commit/c10eb6d))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **compiler:** don’t write compile output to file system but rely on `jest` cache ([#1561](https://github.com/kulshekhar/ts-jest/issues/1561)) ([07b5f62](https://github.com/kulshekhar/ts-jest/commit/07b5f62))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* Any custom typing files or files which are needed to be compiled and intended to use with `jest` need to be defined in `files` option of `tsconfig`.
|
||||
|
||||
For example
|
||||
```
|
||||
// tsconfig.json
|
||||
{
|
||||
// ...other configs
|
||||
"files": [
|
||||
"my-custom-typings.d.ts".
|
||||
"my-global-module.ts"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
<a name="25.5.0-alpha.0"></a>
|
||||
# [25.5.0-alpha.0](https://github.com/kulshekhar/ts-jest/compare/v25.4.0...v25.5.0-alpha.0) (2020-04-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **compiler:** make `projectReferences` work with `isolatedModules: false` ([#1541](https://github.com/kulshekhar/ts-jest/issues/1541)) ([3e8efbe](https://github.com/kulshekhar/ts-jest/commit/3e8efbe))
|
||||
|
||||
### Performance
|
||||
|
||||
* **compiler:** improve performance for `isolatedModules: false` ([#1558](https://github.com/kulshekhar/ts-jest/issues/1558)) ([85c09e3](https://github.com/kulshekhar/ts-jest/commit/85c09e3))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* **config:** `compilerHost` and `incremental` options are no longer available
|
||||
|
||||
|
||||
|
||||
<a name="25.4.0"></a>
|
||||
# [25.4.0](https://github.com/kulshekhar/ts-jest/compare/v25.3.1...v25.4.0) (2020-04-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **compiler:** make `projectReferences` work with `isolatedModules: true` ([#1527](https://github.com/kulshekhar/ts-jest/issues/1527)) ([aa6b74c](https://github.com/kulshekhar/ts-jest/commit/aa6b74c))
|
||||
* **compiler:** make sure `LanguageService` updated with test file information before getting diagnostics for test file ([#1507](https://github.com/kulshekhar/ts-jest/issues/1507)) ([311eaeb](https://github.com/kulshekhar/ts-jest/commit/311eaeb))
|
||||
* **config:** set default `outDir` when `allowJs` is true and no `outDir` in `tsconfig` ([#1502](https://github.com/kulshekhar/ts-jest/issues/1502)) ([1a287ad](https://github.com/kulshekhar/ts-jest/commit/1a287ad))
|
||||
* **config:** use original jest config object instead of stringified config ([#1511](https://github.com/kulshekhar/ts-jest/issues/1511)) ([4f0bb33](https://github.com/kulshekhar/ts-jest/commit/4f0bb33))
|
||||
|
||||
|
||||
|
||||
<a name="25.3.1"></a>
|
||||
## [25.3.1](https://github.com/kulshekhar/ts-jest/compare/v25.3.0...v25.3.1) (2020-04-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* only do type checking while compiling file ([#1483](https://github.com/kulshekhar/ts-jest/issues/1483)) ([dbc0a08](https://github.com/kulshekhar/ts-jest/commit/dbc0a08))
|
||||
* **config:** set default outDir for enabled allowJs without outDir ([#1472](https://github.com/kulshekhar/ts-jest/issues/1472)) ([57c7af0](https://github.com/kulshekhar/ts-jest/commit/57c7af0))
|
||||
|
||||
|
||||
|
||||
<a name="25.3.0"></a>
|
||||
# [25.3.0](https://github.com/kulshekhar/ts-jest/compare/25.2.1...v25.3.0) (2020-03-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add `jest-config` to dependencies list ([6d9e0d8](https://github.com/kulshekhar/ts-jest/commit/6d9e0d8))
|
||||
* always do type check for all files provided to ts-jest transformer for non-watch mode ([#1450](https://github.com/kulshekhar/ts-jest/issues/1450)) ([107e062](https://github.com/kulshekhar/ts-jest/commit/107e062))
|
||||
|
||||
|
||||
### Chores
|
||||
|
||||
* **docs:** add `TROUBLESHOOTING` ([96cd9b3](https://github.com/kulshekhar/ts-jest/commit/b8ebf36))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **compiler:** expose internal ts `Program` via ConfigSet `TsCompiler` ([#1433](https://github.com/kulshekhar/ts-jest/issues/1433)) ([7153246](https://github.com/kulshekhar/ts-jest/commit/7153246))
|
||||
* **config:** add incremental option ([#1418](https://github.com/kulshekhar/ts-jest/issues/1418)) ([5a69bce](https://github.com/kulshekhar/ts-jest/commit/5a69bce))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* **config:** improve diagnostics message ([#1444](https://github.com/kulshekhar/ts-jest/issues/1444)) ([96cd9b3](https://github.com/kulshekhar/ts-jest/commit/96cd9b3)). This will affect to any snapshots or assertion against diagnostics messages
|
||||
|
||||
|
||||
|
||||
<a name="25.2.1"></a>
|
||||
# [25.2.1](https://github.com/kulshekhar/ts-jest/compare/25.2.0...25.2.1) (2020-02-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **compiler:** allow transformation of typescript files in node_modules ([#1385](https://github.com/kulshekhar/ts-jest/issues/1385)) ([814405e](https://github.com/kulshekhar/ts-jest/commit/814405e))
|
||||
* **docs:** fixing slack link and some minor typos in documenation ([#1404](https://github.com/kulshekhar/ts-jest/issues/1404)) ([3e2e008](https://github.com/kulshekhar/ts-jest/commit/3e2e008))
|
||||
* **transformer:** add deepUnmock to hoist method list ([#1372](https://github.com/kulshekhar/ts-jest/issues/1372)) ([0fbbc00](https://github.com/kulshekhar/ts-jest/commit/0fbbc00))
|
||||
* **util:** use resolve package typescript package in yarn workspaces ([#1377](https://github.com/kulshekhar/ts-jest/issues/1377)) ([a63808c](https://github.com/kulshekhar/ts-jest/commit/a63808c))
|
||||
|
||||
|
||||
|
||||
<a name="25.2.0"></a>
|
||||
# [25.2.0](https://github.com/kulshekhar/ts-jest/compare/v25.1.0...v25.2.0) (2020-02-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **config:** let babel-jest handle loading babel config ([#1370](https://github.com/kulshekhar/ts-jest/issues/1370))
|
||||
|
||||
|
||||
|
||||
<a name="25.1.0"></a>
|
||||
# [25.1.0](https://github.com/kulshekhar/ts-jest/compare/v25.0.0...v25.1.0) (2020-01-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* jest 25 type definitions ([#1363](https://github.com/kulshekhar/ts-jest/issues/1363)) ([ba82a9e](https://github.com/kulshekhar/ts-jest/commit/ba82a9e))
|
||||
|
||||
|
||||
|
||||
<a name="25.0.0"></a>
|
||||
# [25.0.0](https://github.com/kulshekhar/ts-jest/compare/v24.3.0...v25.0.0) (2020-01-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* support Jest 25 ([#1355](https://github.com/kulshekhar/ts-jest/issues/1355))
|
||||
|
||||
|
||||
|
||||
<a name="24.3.0"></a>
|
||||
# [24.3.0](https://github.com/kulshekhar/ts-jest/compare/v24.2.0...v24.3.0) (2020-01-07)
|
||||
|
||||
@@ -14,9 +409,9 @@
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* typescript serviceHost cache miss on Windows operating systems ([26ee731](https://github.com/kulshekhar/ts-jest/commit/26ee731))
|
||||
* **compiler:** pass filename to sha function instead of file extension ([ac1ac97](https://github.com/kulshekhar/ts-jest/commit/ac1ac97))
|
||||
* **transformers:** hoist jest.enableAutomock and jest.disableAutomock ([ac50bc3](https://github.com/kulshekhar/ts-jest/commit/ac50bc3))
|
||||
* typescript serviceHost cache miss on Windows operating systems ([26ee731](https://github.com/kulshekhar/ts-jest/commit/26ee731))
|
||||
|
||||
|
||||
|
||||
@@ -26,9 +421,9 @@
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **perf:** add cache for fs calls ([#908](https://github.com/kulshekhar/ts-jest/issues/908)) ([3dada81](https://github.com/kulshekhar/ts-jest/commit/3dada81))
|
||||
* [#825](https://github.com/kulshekhar/ts-jest/issues/825) handle symlinked modules (ala pnpm) correctly ([e190b23](https://github.com/kulshekhar/ts-jest/commit/e190b23))
|
||||
* handle tsBuildInfoFile option ([f9583e9](https://github.com/kulshekhar/ts-jest/commit/f9583e9)), closes [#1095](https://github.com/kulshekhar/ts-jest/issues/1095)
|
||||
* **perf:** add cache for fs calls ([#908](https://github.com/kulshekhar/ts-jest/issues/908)) ([3dada81](https://github.com/kulshekhar/ts-jest/commit/3dada81))
|
||||
* **types:** unforce esModuleInterop in tsconfig.json ([c2d39b6](https://github.com/kulshekhar/ts-jest/commit/c2d39b6))
|
||||
|
||||
|
||||
@@ -240,6 +635,10 @@
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ci:** can't use runInBand for e2e: cache collision ([db650f4](https://github.com/kulshekhar/ts-jest/commit/db650f4))
|
||||
* **ci:** do not run e2e sub-tests in band ([18ad865](https://github.com/kulshekhar/ts-jest/commit/18ad865))
|
||||
* **ci:** ensure npm is present with ci ([edb6eda](https://github.com/kulshekhar/ts-jest/commit/edb6eda))
|
||||
* **logger:** removes cyclic imports ([5ef980f](https://github.com/kulshekhar/ts-jest/commit/5ef980f))
|
||||
* babel-config + adds test ([12146c3](https://github.com/kulshekhar/ts-jest/commit/12146c3))
|
||||
* fixes js style to be node < 10 compatible ([83d7517](https://github.com/kulshekhar/ts-jest/commit/83d7517))
|
||||
* hoisting per level + memoize fix ([31847b0](https://github.com/kulshekhar/ts-jest/commit/31847b0))
|
||||
@@ -247,53 +646,49 @@
|
||||
* makes node 6 happy ([f6f82b8](https://github.com/kulshekhar/ts-jest/commit/f6f82b8))
|
||||
* makes node6 happy ([f170285](https://github.com/kulshekhar/ts-jest/commit/f170285))
|
||||
* makes window happy ([36fbebe](https://github.com/kulshekhar/ts-jest/commit/36fbebe))
|
||||
* **ci:** can't use runInBand for e2e: cache collision ([db650f4](https://github.com/kulshekhar/ts-jest/commit/db650f4))
|
||||
* **ci:** do not run e2e sub-tests in band ([18ad865](https://github.com/kulshekhar/ts-jest/commit/18ad865))
|
||||
* **ci:** ensure npm is present with ci ([edb6eda](https://github.com/kulshekhar/ts-jest/commit/edb6eda))
|
||||
* **logger:** removes cyclic imports ([5ef980f](https://github.com/kulshekhar/ts-jest/commit/5ef980f))
|
||||
* **tests:** detect npm version to use or not ci ([683a1e5](https://github.com/kulshekhar/ts-jest/commit/683a1e5))
|
||||
* node 6 unhappy again... ([703ad0b](https://github.com/kulshekhar/ts-jest/commit/703ad0b))
|
||||
* **tests:** CI fixes ([34a41ea](https://github.com/kulshekhar/ts-jest/commit/34a41ea))
|
||||
* **tests:** do not use babel in our tests + new API for simple ([3e4de3e](https://github.com/kulshekhar/ts-jest/commit/3e4de3e))
|
||||
* normalizes bundle hash on any node version ([ce7afaf](https://github.com/kulshekhar/ts-jest/commit/ce7afaf))
|
||||
* npm coming with node 6 doesn't talk `ci` ([b87198d](https://github.com/kulshekhar/ts-jest/commit/b87198d))
|
||||
* source maps ([89a30c9](https://github.com/kulshekhar/ts-jest/commit/89a30c9))
|
||||
* typos + node 6 compat ([0ed1587](https://github.com/kulshekhar/ts-jest/commit/0ed1587))
|
||||
* **tests:** more sanitizing for windows compat ([faae274](https://github.com/kulshekhar/ts-jest/commit/faae274))
|
||||
* updates templates ([f2e1da2](https://github.com/kulshekhar/ts-jest/commit/f2e1da2))
|
||||
* uses cross-platform spawn + fix pkg versions ([ac1599c](https://github.com/kulshekhar/ts-jest/commit/ac1599c))
|
||||
* we are not writing files, use normalized EOL ([47fff43](https://github.com/kulshekhar/ts-jest/commit/47fff43))
|
||||
* **tests:** CI fixes ([34a41ea](https://github.com/kulshekhar/ts-jest/commit/34a41ea))
|
||||
* **tests:** detect npm version to use or not ci ([683a1e5](https://github.com/kulshekhar/ts-jest/commit/683a1e5))
|
||||
* **tests:** do not use babel in our tests + new API for simple ([3e4de3e](https://github.com/kulshekhar/ts-jest/commit/3e4de3e))
|
||||
* **tests:** more sanitizing for windows compat ([faae274](https://github.com/kulshekhar/ts-jest/commit/faae274))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* diagnostics, different compilers, ... ([f26ebf0](https://github.com/kulshekhar/ts-jest/commit/f26ebf0))
|
||||
* **config:** adds a helper to build moduleNameMapper from paths ([7b8598e](https://github.com/kulshekhar/ts-jest/commit/7b8598e)), closes [#364](https://github.com/kulshekhar/ts-jest/issues/364)
|
||||
* **logging:** improves log messages + tests ([5d03c4d](https://github.com/kulshekhar/ts-jest/commit/5d03c4d))
|
||||
* jest preset ([beb50b5](https://github.com/kulshekhar/ts-jest/commit/beb50b5))
|
||||
* **test:** jest serializers ([dfa9c0f](https://github.com/kulshekhar/ts-jest/commit/dfa9c0f))
|
||||
* adds logging + better hashing ([4322701](https://github.com/kulshekhar/ts-jest/commit/4322701))
|
||||
* **tests:** more test tools + adds test related to debuggin issues ([8dcafca](https://github.com/kulshekhar/ts-jest/commit/8dcafca))
|
||||
* allow env var to add diagnostic codes to ignore ([777edf5](https://github.com/kulshekhar/ts-jest/commit/777edf5))
|
||||
* cache key + tests ([bd55448](https://github.com/kulshekhar/ts-jest/commit/bd55448))
|
||||
* diagnostics, different compilers, ... ([f26ebf0](https://github.com/kulshekhar/ts-jest/commit/f26ebf0))
|
||||
* directly writes to stdio so jest does not swallow ([6a7f01f](https://github.com/kulshekhar/ts-jest/commit/6a7f01f))
|
||||
* handles stringifyContentPathRegex ([3fcb4bd](https://github.com/kulshekhar/ts-jest/commit/3fcb4bd))
|
||||
* hoisting + tests + many other things ([6186e84](https://github.com/kulshekhar/ts-jest/commit/6186e84))
|
||||
* io serializer + other test utils ([d03e0e7](https://github.com/kulshekhar/ts-jest/commit/d03e0e7))
|
||||
* jest preset ([beb50b5](https://github.com/kulshekhar/ts-jest/commit/beb50b5))
|
||||
* warn about unsupported versions ([1103071](https://github.com/kulshekhar/ts-jest/commit/1103071))
|
||||
* **test:** jest serializers ([dfa9c0f](https://github.com/kulshekhar/ts-jest/commit/dfa9c0f))
|
||||
* **tests:** more test tools + adds test related to debuggin issues ([8dcafca](https://github.com/kulshekhar/ts-jest/commit/8dcafca))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* detects changes in templates and bundle ([2a3da21](https://github.com/kulshekhar/ts-jest/commit/2a3da21))
|
||||
* **babel:** uses babel-jest cache key as part of ours ([f51c4a7](https://github.com/kulshekhar/ts-jest/commit/f51c4a7))
|
||||
* **cache:** share config-sets for parallel test running ([090ca7b](https://github.com/kulshekhar/ts-jest/commit/090ca7b))
|
||||
* **tests:** run e2e tests in band ([b3e94ff](https://github.com/kulshekhar/ts-jest/commit/b3e94ff))
|
||||
* detects changes in templates and bundle ([2a3da21](https://github.com/kulshekhar/ts-jest/commit/2a3da21))
|
||||
* do not type check if fileName doesn't match ([cc45adc](https://github.com/kulshekhar/ts-jest/commit/cc45adc))
|
||||
* faster tests ([37a0187](https://github.com/kulshekhar/ts-jest/commit/37a0187))
|
||||
* improves speed of local test after 1st run ([cc04021](https://github.com/kulshekhar/ts-jest/commit/cc04021))
|
||||
* more cleaning ([c48f7b8](https://github.com/kulshekhar/ts-jest/commit/c48f7b8))
|
||||
* trying to improve travis-ci conf ([e4b4d95](https://github.com/kulshekhar/ts-jest/commit/e4b4d95))
|
||||
* **cache:** share config-sets for parallel test running ([090ca7b](https://github.com/kulshekhar/ts-jest/commit/090ca7b))
|
||||
* **tests:** run e2e tests in band ([b3e94ff](https://github.com/kulshekhar/ts-jest/commit/b3e94ff))
|
||||
|
||||
|
||||
|
||||
@@ -303,21 +698,21 @@
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **html:** correctly transforms html source when needed ([9a2d74f](https://github.com/kulshekhar/ts-jest/commit/9a2d74f))
|
||||
* **lint:** fixes tslint script & lint issues ([60ab36e](https://github.com/kulshekhar/ts-jest/commit/60ab36e))
|
||||
* **package:** update fs-extra to version 6.0.1 ([7e73536](https://github.com/kulshekhar/ts-jest/commit/7e73536))
|
||||
* allow (but deprecate) use of old preprocessor.js ([a65079f](https://github.com/kulshekhar/ts-jest/commit/a65079f))
|
||||
* big refactor + fixes (mainly cache key + coverage) ([e46caae](https://github.com/kulshekhar/ts-jest/commit/e46caae))
|
||||
* fixes coverage and tests ([09500c2](https://github.com/kulshekhar/ts-jest/commit/09500c2))
|
||||
* gracefully load [@babel](https://github.com/babel)/core or babel-core ([98b2410](https://github.com/kulshekhar/ts-jest/commit/98b2410))
|
||||
* hack for babel < 6 so that breakpoints do work ([90c74ef](https://github.com/kulshekhar/ts-jest/commit/90c74ef)), closes [#627](https://github.com/kulshekhar/ts-jest/issues/627)
|
||||
* **package:** update pkg-dir to version 3.0.0 ([3fb8f9f](https://github.com/kulshekhar/ts-jest/commit/3fb8f9f))
|
||||
* **package:** update yargs to version 12.0.1 ([390ffcd](https://github.com/kulshekhar/ts-jest/commit/390ffcd))
|
||||
* resolves correctly config file path (fix [#636](https://github.com/kulshekhar/ts-jest/issues/636)) ([5ab100c](https://github.com/kulshekhar/ts-jest/commit/5ab100c))
|
||||
* test rootDir to handle preset-angular ([8a6a8f7](https://github.com/kulshekhar/ts-jest/commit/8a6a8f7))
|
||||
* Typo in utils.ts ([#534](https://github.com/kulshekhar/ts-jest/issues/534)) ([a650260](https://github.com/kulshekhar/ts-jest/commit/a650260))
|
||||
* **source-maps:** fix source maps options/calls ([76e27c1](https://github.com/kulshekhar/ts-jest/commit/76e27c1))
|
||||
* wrong error message ([c955083](https://github.com/kulshekhar/ts-jest/commit/c955083))
|
||||
* **html:** correctly transforms html source when needed ([9a2d74f](https://github.com/kulshekhar/ts-jest/commit/9a2d74f))
|
||||
* **lint:** fixes tslint script & lint issues ([60ab36e](https://github.com/kulshekhar/ts-jest/commit/60ab36e))
|
||||
* **package:** update fs-extra to version 6.0.1 ([7e73536](https://github.com/kulshekhar/ts-jest/commit/7e73536))
|
||||
* **package:** update pkg-dir to version 3.0.0 ([3fb8f9f](https://github.com/kulshekhar/ts-jest/commit/3fb8f9f))
|
||||
* **package:** update yargs to version 12.0.1 ([390ffcd](https://github.com/kulshekhar/ts-jest/commit/390ffcd))
|
||||
* **source-maps:** fix source maps options/calls ([76e27c1](https://github.com/kulshekhar/ts-jest/commit/76e27c1))
|
||||
* Typo in utils.ts ([#534](https://github.com/kulshekhar/ts-jest/issues/534)) ([a650260](https://github.com/kulshekhar/ts-jest/commit/a650260))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
@@ -338,9 +733,9 @@
|
||||
### Bug Fixes
|
||||
|
||||
* **package:** update source-map-support to version 0.5.0 ([f0aab12](https://github.com/kulshekhar/ts-jest/commit/f0aab12))
|
||||
* add startDir to if-clause ([eed5311](https://github.com/kulshekhar/ts-jest/commit/eed5311))
|
||||
* **package:** update yargs to version 10.0.3 ([5cdf969](https://github.com/kulshekhar/ts-jest/commit/5cdf969))
|
||||
* **package:** update yargs to version 11.0.0 ([7e9ce40](https://github.com/kulshekhar/ts-jest/commit/7e9ce40))
|
||||
* add startDir to if-clause ([eed5311](https://github.com/kulshekhar/ts-jest/commit/eed5311))
|
||||
* **package:** update yargs to version 9.0.1 ([#326](https://github.com/kulshekhar/ts-jest/issues/326)) ([8bf9924](https://github.com/kulshekhar/ts-jest/commit/8bf9924))
|
||||
|
||||
|
||||
@@ -396,10 +791,10 @@
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **package:** update fs-extra to version 3.0.0 ([906be12](https://github.com/kulshekhar/ts-jest/commit/906be12))
|
||||
* **package:** update yargs to version 8.0.1 ([0b2ea98](https://github.com/kulshekhar/ts-jest/commit/0b2ea98))
|
||||
* peer dependency against Typescript 2.x ([cb08128](https://github.com/kulshekhar/ts-jest/commit/cb08128))
|
||||
* remove outDir when collecting coverage ([c076956](https://github.com/kulshekhar/ts-jest/commit/c076956))
|
||||
* **package:** update fs-extra to version 3.0.0 ([906be12](https://github.com/kulshekhar/ts-jest/commit/906be12))
|
||||
* **package:** update yargs to version 8.0.1 ([0b2ea98](https://github.com/kulshekhar/ts-jest/commit/0b2ea98))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
2
node_modules/ts-jest/CONTRIBUTING.md
generated
vendored
2
node_modules/ts-jest/CONTRIBUTING.md
generated
vendored
@@ -1,6 +1,6 @@
|
||||
# Contributing
|
||||
|
||||
When contributing to this repository, please first discuss the change you wish to make via [slack](https://bit.ly/ts-jest-slack) or [issue](https://github.com/kulshekhar/ts-jest/issues) with the owners of this repository before making a change.
|
||||
When contributing to this repository, please first discuss the change you wish to make via [slack](https://bit.ly/3bRHFPQ) or [issue](https://github.com/kulshekhar/ts-jest/issues) with the owners of this repository before making a change.
|
||||
|
||||
Please note we have a code of conduct, please follow it in all your interactions with the project.
|
||||
|
||||
|
||||
22
node_modules/ts-jest/README.md
generated
vendored
22
node_modules/ts-jest/README.md
generated
vendored
@@ -1,9 +1,19 @@
|
||||
# ts-jest [](https://badge.fury.io/js/ts-jest) [](https://npmjs.org/package/ts-jest) [](https://snyk.io/test/github/kulshekhar/ts-jest) [](https://coveralls.io/github/kulshekhar/ts-jest?branch=master) [](https://dependabot.com) [](https://travis-ci.org/kulshekhar/ts-jest) [](https://ci.appveyor.com/project/kulshekhar/ts-jest/branch/master)
|
||||
<h1 align="center">ts-jest</h1>
|
||||
|
||||
<p align="center">A TypeScript preprocessor with source map support for Jest that lets you use Jest to test projects written in TypeScript.</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/package/ts-jest"><img src="https://img.shields.io/npm/v/ts-jest/latest.svg?style=flat-square" alt="NPM version" /> </a>
|
||||
<a href="https://www.npmjs.com/package/ts-jest"><img src="https://img.shields.io/npm/dm/ts-jest.svg?style=flat-square" alt="NPM downloads"/> </a>
|
||||
<a href="https://snyk.io/test/github/kulshekhar/ts-jest"><img src="https://snyk.io/test/github/kulshekhar/ts-jest/badge.svg?style=flat-square" alt="Known vulnerabilities"/> </a>
|
||||
<a href="https://coveralls.io/github/kulshekhar/ts-jest?branch=master"><img src="https://coveralls.io/repos/github/kulshekhar/ts-jest/badge.svg?branch=master" alt="Coverage status"/> </a>
|
||||
<a href="https://travis-ci.com/kulshekhar/ts-jest"><img src="https://travis-ci.com/kulshekhar/ts-jest.svg?branch=master" alt="Build status"/> </a>
|
||||
<a href="https://actions-badge.atrox.dev/kulshekhar/ts-jest/goto?ref=master"><img alt="GitHub actions" src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fkulshekhar%2Fts-jest%2Fbadge%3Fref%3Dmaster&style=flat-square" /> </a>
|
||||
<a href="https://github.com/kulshekhar/ts-jest/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/ts-jest.svg?style=flat-square" alt="GitHub license"/> </a>
|
||||
</p>
|
||||
|
||||
<img src="./icon.png" align="right" title="ts-jest Logo" width="128" height="128">
|
||||
|
||||
**`ts-jest`** is a TypeScript preprocessor with source map support for Jest that lets you use Jest to test projects written in TypeScript.
|
||||
|
||||
It supports all features of TypeScript including type-checking. [Read more about Babel7 + `preset-typescript` **vs** TypeScript (and `ts-jest`)](https://kulshekhar.github.io/ts-jest/user/babel7-or-ts).
|
||||
|
||||
---
|
||||
@@ -13,11 +23,9 @@ It supports all features of TypeScript including type-checking. [Read more about
|
||||
|
||||
[<img src="./docs/assets/img/documentation.png" align="left" height="24"> View the online documentation (usage & technical)](https://kulshekhar.github.io/ts-jest)
|
||||
|
||||
[<img src="./docs/assets/img/slack.png" align="left" height="24"> Ask for some help in the `ts-jest` community of Slack](https://bit.ly/ts-jest-slack)
|
||||
[<img src="./docs/assets/img/slack.png" align="left" height="24"> Ask for some help in the `ts-jest` community of Slack](https://bit.ly/3bRHFPQ)
|
||||
|
||||
<!--
|
||||
[<img src="./docs/assets/img/troubleshooting.png" align="left" height="24"> Before reporting any issue, be sure to check the troubleshooting page](https://kulshekhar.github.io/ts-jest/user/troubleshooting)
|
||||
-->
|
||||
[<img src="./docs/assets/img/troubleshooting.png" align="left" height="24"> Before reporting any issue, be sure to check the troubleshooting page](TROUBLESHOOTING.md)
|
||||
|
||||
[<img src="./docs/assets/img/pull-request.png" align="left" height="24"> We're looking for collaborators! Want to help improve `ts-jest`?](https://github.com/kulshekhar/ts-jest/issues/223)
|
||||
|
||||
|
||||
41
node_modules/ts-jest/TROUBLESHOOTING.md
generated
vendored
Normal file
41
node_modules/ts-jest/TROUBLESHOOTING.md
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
# Troubleshooting
|
||||
|
||||
## Running ts-jest on CI tools
|
||||
|
||||
### PROBLEM
|
||||
|
||||
Cannot find module "" from ""
|
||||
|
||||
### SOLUTION
|
||||
|
||||
- Check if `rootDir` is referenced correctly. If not add this on your existing jest configuration.
|
||||
|
||||
```javascipt
|
||||
module.exports = {
|
||||
...
|
||||
roots: ["<rootDir>"]
|
||||
}
|
||||
```
|
||||
|
||||
- Check if module directories are included on your jest configuration. If not add this on your existing jest configuration.
|
||||
|
||||
```javascipt
|
||||
module.exports = {
|
||||
...
|
||||
moduleDirectories: ["node_modules","<module-directory>"],
|
||||
modulePaths: ["<path-of-module>"],
|
||||
}
|
||||
```
|
||||
|
||||
- Check if module name is properly mapped and can be referenced by jest. If not, you can define moduleNameMapper for your jest configuration.
|
||||
|
||||
```javascipt
|
||||
module.exports = {
|
||||
...
|
||||
moduleNameMapper: {
|
||||
"<import-path>": "<rootDir>/<real-physical-path>",
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
- Check github folder names if its identical to you local folder names. Sometimes github never updates your folder names even if you rename it locally. If this happens rename your folders via github or use this command `git mv <source> <destination>` and commit changes.
|
||||
11
node_modules/ts-jest/dist/cli/config/init.js
generated
vendored
11
node_modules/ts-jest/dist/cli/config/init.js
generated
vendored
@@ -47,6 +47,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
}
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.help = exports.run = void 0;
|
||||
var fs_1 = require("fs");
|
||||
var json5_1 = require("json5");
|
||||
var path_1 = require("path");
|
||||
@@ -122,19 +123,19 @@ exports.run = function (args) { return __awaiter(void 0, void 0, void 0, functio
|
||||
content.push(" preset: '" + preset.name + "',");
|
||||
}
|
||||
else {
|
||||
content.push(" ...tsjPreset,");
|
||||
content.push(' ...tsjPreset,');
|
||||
}
|
||||
if (!jsdom)
|
||||
content.push(" testEnvironment: 'node',");
|
||||
if (tsconfig || shouldPostProcessWithBabel) {
|
||||
content.push(" globals: {");
|
||||
content.push(' globals: {');
|
||||
content.push(" 'ts-jest': {");
|
||||
if (tsconfig)
|
||||
content.push(" tsconfig: " + json5_1.stringify(tsconfig) + ",");
|
||||
if (shouldPostProcessWithBabel)
|
||||
content.push(" babelConfig: true,");
|
||||
content.push(" },");
|
||||
content.push(" },");
|
||||
content.push(' babelConfig: true,');
|
||||
content.push(' },');
|
||||
content.push(' },');
|
||||
}
|
||||
content.push('};');
|
||||
body = content.join('\n');
|
||||
|
||||
27
node_modules/ts-jest/dist/cli/config/migrate.js
generated
vendored
27
node_modules/ts-jest/dist/cli/config/migrate.js
generated
vendored
@@ -56,12 +56,13 @@ var __spread = (this && this.__spread) || function () {
|
||||
return ar;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.help = exports.run = void 0;
|
||||
var bs_logger_1 = require("bs-logger");
|
||||
var stringifyJson = require("fast-json-stable-stringify");
|
||||
var stableStringify = require("fast-json-stable-stringify");
|
||||
var fs_1 = require("fs");
|
||||
var json5_1 = require("json5");
|
||||
var path_1 = require("path");
|
||||
var backports_1 = require("../../util/backports");
|
||||
var backports_1 = require("../../utils/backports");
|
||||
var presets_1 = require("../helpers/presets");
|
||||
exports.run = function (args) { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var nullLogger, file, filePath, footNotes, name, isPackage, actualConfig, migratedConfig, presetName, preset, jsTransformers, jsWithTs, jsWithBabel, presetValue, migratedValue, presetValue, migratedValue, before, after, stringify, prefix;
|
||||
@@ -87,7 +88,7 @@ exports.run = function (args) { return __awaiter(void 0, void 0, void 0, functio
|
||||
migratedConfig = backports_1.backportJestConfig(nullLogger, actualConfig);
|
||||
if (!migratedConfig.preset && args.jestPreset) {
|
||||
if (args.js) {
|
||||
presetName = args.js === 'babel' ? presets_1.JestPresetNames.jsWIthBabel : presets_1.JestPresetNames.jsWithTs;
|
||||
presetName = args.js === 'babel' ? "ts-jest/presets/js-with-babel" : "ts-jest/presets/js-with-ts";
|
||||
}
|
||||
else {
|
||||
jsTransformers = Object.keys(migratedConfig.transform || {}).reduce(function (list, pattern) {
|
||||
@@ -104,16 +105,16 @@ exports.run = function (args) { return __awaiter(void 0, void 0, void 0, functio
|
||||
jsWithTs = jsTransformers.includes('ts-jest');
|
||||
jsWithBabel = jsTransformers.includes('babel-jest');
|
||||
if (jsWithBabel && !jsWithTs) {
|
||||
presetName = presets_1.JestPresetNames.jsWIthBabel;
|
||||
presetName = "ts-jest/presets/js-with-babel";
|
||||
}
|
||||
else if (jsWithTs && !jsWithBabel) {
|
||||
presetName = presets_1.JestPresetNames.jsWithTs;
|
||||
presetName = "ts-jest/presets/js-with-ts";
|
||||
}
|
||||
else {
|
||||
presetName = presets_1.JestPresetNames.default;
|
||||
presetName = "ts-jest/presets/default";
|
||||
}
|
||||
}
|
||||
presetName = presetName || presets_1.JestPresetNames.default;
|
||||
presetName = presetName || "ts-jest/presets/default";
|
||||
preset = presets_1.allPresets[presetName];
|
||||
footNotes.push("Detected preset '" + preset.label + "' as the best matching preset for your configuration.\nVisit https://kulshekhar.github.io/ts-jest/user/config/#jest-preset for more information about presets.\n");
|
||||
}
|
||||
@@ -155,19 +156,19 @@ exports.run = function (args) { return __awaiter(void 0, void 0, void 0, functio
|
||||
}
|
||||
if (preset &&
|
||||
migratedConfig.transform &&
|
||||
stringifyJson(migratedConfig.transform) === stringifyJson(preset.value.transform)) {
|
||||
stableStringify(migratedConfig.transform) === stableStringify(preset.value.transform)) {
|
||||
delete migratedConfig.transform;
|
||||
}
|
||||
cleanupConfig(actualConfig);
|
||||
cleanupConfig(migratedConfig);
|
||||
before = stringifyJson(actualConfig);
|
||||
after = stringifyJson(migratedConfig);
|
||||
before = stableStringify(actualConfig);
|
||||
after = stableStringify(migratedConfig);
|
||||
if (after === before) {
|
||||
process.stderr.write("\nNo migration needed for given Jest configuration\n ");
|
||||
return [2];
|
||||
}
|
||||
stringify = /\.json$/.test(file) ? JSON.stringify : json5_1.stringify;
|
||||
prefix = /\.json$/.test(file) ? '"jest": ' : 'module.exports = ';
|
||||
stringify = file.endsWith('.json') ? JSON.stringify : json5_1.stringify;
|
||||
prefix = file.endsWith('.json') ? '"jest": ' : 'module.exports = ';
|
||||
if (preset && migratedConfig.transform) {
|
||||
footNotes.push("\nI couldn't check if your \"transform\" value is the same as mine which is: " + stringify(preset.value.transform, undefined, ' ') + "\nIf it is the case, you can safely remove the \"transform\" from what I've migrated.\n");
|
||||
}
|
||||
@@ -201,7 +202,7 @@ function cleanupConfig(config) {
|
||||
if (config.testMatch.length === 0)
|
||||
delete config.testMatch;
|
||||
}
|
||||
if (config.preset === presets_1.JestPresetNames.default)
|
||||
if (config.preset === "ts-jest/presets/default")
|
||||
config.preset = presets_1.defaults.name;
|
||||
}
|
||||
function dedupSort(arr) {
|
||||
|
||||
1
node_modules/ts-jest/dist/cli/help.js
generated
vendored
1
node_modules/ts-jest/dist/cli/help.js
generated
vendored
@@ -36,6 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
}
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.help = exports.run = void 0;
|
||||
exports.run = function (_) { return __awaiter(void 0, void 0, void 0, function () {
|
||||
return __generator(this, function (_a) {
|
||||
process.stdout.write("\nUsage:\n ts-jest command [options] [...args]\n\nCommands:\n config:init Creates initial Jest configuration\n config:migrate Migrates a given Jest configuration\n help [command] Show this help, or help about a command\n\nExample:\n ts-jest help config:migrate\n");
|
||||
|
||||
24
node_modules/ts-jest/dist/cli/helpers/presets.js
generated
vendored
24
node_modules/ts-jest/dist/cli/helpers/presets.js
generated
vendored
@@ -1,11 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var JestPresetNames;
|
||||
(function (JestPresetNames) {
|
||||
JestPresetNames["default"] = "ts-jest/presets/default";
|
||||
JestPresetNames["jsWithTs"] = "ts-jest/presets/js-with-ts";
|
||||
JestPresetNames["jsWIthBabel"] = "ts-jest/presets/js-with-babel";
|
||||
})(JestPresetNames = exports.JestPresetNames || (exports.JestPresetNames = {}));
|
||||
exports.jsWIthBabel = exports.jsWithTs = exports.defaults = exports.allPresets = void 0;
|
||||
var definePreset = function (fullName) { return ({
|
||||
fullName: fullName,
|
||||
get name() {
|
||||
@@ -17,10 +12,11 @@ var definePreset = function (fullName) { return ({
|
||||
get jsVarName() {
|
||||
return this.isDefault
|
||||
? 'defaults'
|
||||
: fullName
|
||||
.split('/')
|
||||
.pop()
|
||||
.replace(/\-([a-z])/g, function (_, l) { return l.toUpperCase(); });
|
||||
:
|
||||
fullName
|
||||
.split('/')
|
||||
.pop()
|
||||
.replace(/\-([a-z])/g, function (_, l) { return l.toUpperCase(); });
|
||||
},
|
||||
get value() {
|
||||
return require("../../../" + fullName.replace(/^ts-jest\//, '') + "/jest-preset");
|
||||
@@ -30,10 +26,10 @@ var definePreset = function (fullName) { return ({
|
||||
return "const { " + this.jsVarName + ": " + varName + " } = require('ts-jest/presets')";
|
||||
},
|
||||
get isDefault() {
|
||||
return fullName === JestPresetNames.default;
|
||||
return fullName === "ts-jest/presets/default";
|
||||
},
|
||||
}); };
|
||||
exports.allPresets = {};
|
||||
exports.defaults = (exports.allPresets[JestPresetNames.default] = definePreset(JestPresetNames.default));
|
||||
exports.jsWithTs = (exports.allPresets[JestPresetNames.jsWithTs] = definePreset(JestPresetNames.jsWithTs));
|
||||
exports.jsWIthBabel = (exports.allPresets[JestPresetNames.jsWIthBabel] = definePreset(JestPresetNames.jsWIthBabel));
|
||||
exports.defaults = (exports.allPresets["ts-jest/presets/default"] = definePreset("ts-jest/presets/default"));
|
||||
exports.jsWithTs = (exports.allPresets["ts-jest/presets/js-with-ts"] = definePreset("ts-jest/presets/js-with-ts"));
|
||||
exports.jsWIthBabel = (exports.allPresets["ts-jest/presets/js-with-babel"] = definePreset("ts-jest/presets/js-with-babel"));
|
||||
|
||||
10
node_modules/ts-jest/dist/cli/index.js
generated
vendored
10
node_modules/ts-jest/dist/cli/index.js
generated
vendored
@@ -35,18 +35,22 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.processArgv = void 0;
|
||||
var bs_logger_1 = require("bs-logger");
|
||||
var yargsParser = require("yargs-parser");
|
||||
var logger_1 = require("../util/logger");
|
||||
var yargs_parser_1 = __importDefault(require("yargs-parser"));
|
||||
var logger_1 = require("../utils/logger");
|
||||
var VALID_COMMANDS = ['help', 'config:migrate', 'config:init'];
|
||||
var logger = logger_1.rootLogger.child((_a = {}, _a[bs_logger_1.LogContexts.namespace] = 'cli', _a[bs_logger_1.LogContexts.application] = 'ts-jest', _a));
|
||||
function cli(args) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var parsedArgv, command, isHelp, _a, run, help, cmd;
|
||||
return __generator(this, function (_b) {
|
||||
parsedArgv = yargsParser(args, {
|
||||
parsedArgv = yargs_parser_1.default(args, {
|
||||
boolean: ['dry-run', 'jest-preset', 'allow-js', 'diff', 'babel', 'force', 'jsdom'],
|
||||
string: ['tsconfig', 'js'],
|
||||
count: ['verbose'],
|
||||
|
||||
235
node_modules/ts-jest/dist/compiler.js
generated
vendored
235
node_modules/ts-jest/dist/compiler.js
generated
vendored
@@ -1,235 +0,0 @@
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var bs_logger_1 = require("bs-logger");
|
||||
var bufferFrom = require("buffer-from");
|
||||
var stableStringify = require("fast-json-stable-stringify");
|
||||
var fs_1 = require("fs");
|
||||
var memoize = require("lodash.memoize");
|
||||
var mkdirp = require("mkdirp");
|
||||
var path_1 = require("path");
|
||||
var messages_1 = require("./util/messages");
|
||||
var sha1_1 = require("./util/sha1");
|
||||
var hasOwn = Object.prototype.hasOwnProperty;
|
||||
function createCompiler(configs) {
|
||||
var e_1, _a, _b, _c;
|
||||
var logger = configs.logger.child({ namespace: 'ts-compiler' });
|
||||
logger.debug('creating typescript compiler', configs.tsJest.isolatedModules ? '(isolated modules)' : '(language service)');
|
||||
var cachedir = configs.tsCacheDir;
|
||||
var memoryCache = {
|
||||
contents: Object.create(null),
|
||||
versions: Object.create(null),
|
||||
outputs: Object.create(null),
|
||||
};
|
||||
var ts = configs.compilerModule;
|
||||
var cwd = configs.cwd;
|
||||
var extensions = ['.ts', '.tsx'];
|
||||
var _d = configs.typescript, compilerOptions = _d.options, fileNames = _d.fileNames;
|
||||
if (compilerOptions.allowJs) {
|
||||
extensions.push('.js');
|
||||
extensions.push('.jsx');
|
||||
}
|
||||
try {
|
||||
for (var fileNames_1 = __values(fileNames), fileNames_1_1 = fileNames_1.next(); !fileNames_1_1.done; fileNames_1_1 = fileNames_1.next()) {
|
||||
var path = fileNames_1_1.value;
|
||||
memoryCache.versions[path] = 1;
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (fileNames_1_1 && !fileNames_1_1.done && (_a = fileNames_1.return)) _a.call(fileNames_1);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
var getExtension = compilerOptions.jsx === ts.JsxEmit.Preserve
|
||||
? function (path) { return (/\.[tj]sx$/.test(path) ? '.jsx' : '.js'); }
|
||||
: function (_) { return '.js'; };
|
||||
var transformers = configs.tsCustomTransformers;
|
||||
var getOutput = function (code, fileName) {
|
||||
logger.debug({ fileName: fileName }, 'getOutput(): compiling as isolated module');
|
||||
var result = ts.transpileModule(code, {
|
||||
fileName: fileName,
|
||||
transformers: transformers,
|
||||
compilerOptions: compilerOptions,
|
||||
reportDiagnostics: configs.shouldReportDiagnostic(fileName),
|
||||
});
|
||||
if (result.diagnostics)
|
||||
configs.raiseDiagnostics(result.diagnostics, fileName, logger);
|
||||
return [result.outputText, result.sourceMapText];
|
||||
};
|
||||
var getTypeInfo = function (_code, _fileName, _position) {
|
||||
throw new TypeError(messages_1.Errors.TypesUnavailableWithoutTypeCheck);
|
||||
};
|
||||
if (!configs.tsJest.isolatedModules) {
|
||||
var updateMemoryCache_1 = function (code, fileName) {
|
||||
logger.debug({ fileName: fileName }, "updateMemoryCache()");
|
||||
if (memoryCache.contents[fileName] !== code) {
|
||||
memoryCache.contents[fileName] = code;
|
||||
memoryCache.versions[fileName] = (memoryCache.versions[fileName] || 0) + 1;
|
||||
}
|
||||
};
|
||||
var serviceHostDebugCtx = (_b = {},
|
||||
_b[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.debug,
|
||||
_b.namespace = 'ts:serviceHost',
|
||||
_b.call = null,
|
||||
_b);
|
||||
var serviceHostTraceCtx = __assign(__assign({}, serviceHostDebugCtx), (_c = {}, _c[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.trace, _c));
|
||||
var serviceHost = {
|
||||
getScriptFileNames: function () { return Object.keys(memoryCache.versions); },
|
||||
getScriptVersion: function (fileName) {
|
||||
var normalizedFileName = path_1.normalize(fileName);
|
||||
var version = memoryCache.versions[normalizedFileName];
|
||||
return version === undefined ? undefined : String(version);
|
||||
},
|
||||
getScriptSnapshot: function (fileName) {
|
||||
var normalizedFileName = path_1.normalize(fileName);
|
||||
var hit = hasOwn.call(memoryCache.contents, normalizedFileName);
|
||||
logger.trace({ normalizedFileName: normalizedFileName, cacheHit: hit }, "getScriptSnapshot():", 'cache', hit ? 'hit' : 'miss');
|
||||
if (!hit) {
|
||||
memoryCache.contents[normalizedFileName] = ts.sys.readFile(normalizedFileName);
|
||||
}
|
||||
var contents = memoryCache.contents[normalizedFileName];
|
||||
if (contents === undefined) {
|
||||
return;
|
||||
}
|
||||
return ts.ScriptSnapshot.fromString(contents);
|
||||
},
|
||||
fileExists: memoize(ts.sys.fileExists),
|
||||
readFile: logger.wrap(serviceHostTraceCtx, 'readFile', memoize(ts.sys.readFile)),
|
||||
readDirectory: memoize(ts.sys.readDirectory),
|
||||
getDirectories: memoize(ts.sys.getDirectories),
|
||||
directoryExists: memoize(ts.sys.directoryExists),
|
||||
realpath: memoize(ts.sys.realpath),
|
||||
getNewLine: function () { return '\n'; },
|
||||
getCurrentDirectory: function () { return cwd; },
|
||||
getCompilationSettings: function () { return compilerOptions; },
|
||||
getDefaultLibFileName: function () { return ts.getDefaultLibFilePath(compilerOptions); },
|
||||
getCustomTransformers: function () { return transformers; },
|
||||
};
|
||||
logger.debug('creating language service');
|
||||
var service_1 = ts.createLanguageService(serviceHost);
|
||||
getOutput = function (code, fileName) {
|
||||
logger.debug({ fileName: fileName }, 'getOutput(): compiling using language service');
|
||||
updateMemoryCache_1(code, fileName);
|
||||
var output = service_1.getEmitOutput(fileName);
|
||||
if (configs.shouldReportDiagnostic(fileName)) {
|
||||
logger.debug({ fileName: fileName }, 'getOutput(): computing diagnostics');
|
||||
var diagnostics = service_1
|
||||
.getCompilerOptionsDiagnostics()
|
||||
.concat(service_1.getSyntacticDiagnostics(fileName))
|
||||
.concat(service_1.getSemanticDiagnostics(fileName));
|
||||
configs.raiseDiagnostics(diagnostics, fileName, logger);
|
||||
}
|
||||
if (output.emitSkipped) {
|
||||
throw new TypeError(path_1.relative(cwd, fileName) + ": Emit skipped");
|
||||
}
|
||||
if (output.outputFiles.length === 0) {
|
||||
throw new TypeError(messages_1.interpolate(messages_1.Errors.UnableToRequireDefinitionFile, {
|
||||
file: path_1.basename(fileName),
|
||||
}));
|
||||
}
|
||||
return [output.outputFiles[1].text, output.outputFiles[0].text];
|
||||
};
|
||||
getTypeInfo = function (code, fileName, position) {
|
||||
updateMemoryCache_1(code, fileName);
|
||||
var info = service_1.getQuickInfoAtPosition(fileName, position);
|
||||
var name = ts.displayPartsToString(info ? info.displayParts : []);
|
||||
var comment = ts.displayPartsToString(info ? info.documentation : []);
|
||||
return { name: name, comment: comment };
|
||||
};
|
||||
}
|
||||
var compile = readThrough(cachedir, memoryCache, getOutput, getExtension, cwd, logger);
|
||||
return { cwd: cwd, compile: compile, getTypeInfo: getTypeInfo, extensions: extensions, cachedir: cachedir, ts: ts };
|
||||
}
|
||||
exports.createCompiler = createCompiler;
|
||||
function readThrough(cachedir, memoryCache, compile, getExtension, cwd, logger) {
|
||||
if (!cachedir) {
|
||||
return function (code, fileName, lineOffset) {
|
||||
logger.debug({ fileName: fileName }, 'readThrough(): no cache');
|
||||
var _a = __read(compile(code, fileName, lineOffset), 2), value = _a[0], sourceMap = _a[1];
|
||||
var output = updateOutput(value, fileName, sourceMap, getExtension, cwd);
|
||||
memoryCache.outputs[fileName] = output;
|
||||
return output;
|
||||
};
|
||||
}
|
||||
mkdirp.sync(cachedir);
|
||||
return function (code, fileName, lineOffset) {
|
||||
var cachePath = path_1.join(cachedir, getCacheName(code, fileName));
|
||||
var extension = getExtension(fileName);
|
||||
var outputPath = "" + cachePath + extension;
|
||||
try {
|
||||
var output_1 = fs_1.readFileSync(outputPath, 'utf8');
|
||||
if (isValidCacheContent(output_1)) {
|
||||
logger.debug({ fileName: fileName }, 'readThrough(): cache hit');
|
||||
memoryCache.outputs[fileName] = output_1;
|
||||
return output_1;
|
||||
}
|
||||
}
|
||||
catch (err) { }
|
||||
logger.debug({ fileName: fileName }, 'readThrough(): cache miss');
|
||||
var _a = __read(compile(code, fileName, lineOffset), 2), value = _a[0], sourceMap = _a[1];
|
||||
var output = updateOutput(value, fileName, sourceMap, getExtension, cwd);
|
||||
logger.debug({ fileName: fileName, outputPath: outputPath }, 'readThrough(): writing caches');
|
||||
memoryCache.outputs[fileName] = output;
|
||||
fs_1.writeFileSync(outputPath, output);
|
||||
return output;
|
||||
};
|
||||
}
|
||||
function updateOutput(outputText, fileName, sourceMap, getExtension, sourceRoot) {
|
||||
var base = path_1.basename(fileName);
|
||||
var base64Map = bufferFrom(updateSourceMap(sourceMap, fileName, sourceRoot), 'utf8').toString('base64');
|
||||
var sourceMapContent = "data:application/json;charset=utf-8;base64," + base64Map;
|
||||
var sourceMapLength = (base + ".map").length + (getExtension(fileName).length - path_1.extname(fileName).length);
|
||||
return outputText.slice(0, -sourceMapLength) + sourceMapContent;
|
||||
}
|
||||
function updateSourceMap(sourceMapText, fileName, _sourceRoot) {
|
||||
var sourceMap = JSON.parse(sourceMapText);
|
||||
sourceMap.file = fileName;
|
||||
sourceMap.sources = [fileName];
|
||||
delete sourceMap.sourceRoot;
|
||||
return stableStringify(sourceMap);
|
||||
}
|
||||
function getCacheName(sourceCode, fileName) {
|
||||
return sha1_1.sha1(fileName, '\x00', sourceCode);
|
||||
}
|
||||
function isValidCacheContent(contents) {
|
||||
return /(?:9|0=|Q==)$/.test(contents.slice(-3));
|
||||
}
|
||||
2
node_modules/ts-jest/dist/compiler/instance.d.ts
generated
vendored
Normal file
2
node_modules/ts-jest/dist/compiler/instance.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export declare const SOURCE_MAPPING_PREFIX = "sourceMappingURL=";
|
||||
export declare function updateOutput(outputText: string, normalizedFileName: string, sourceMap: string): string;
|
||||
55
node_modules/ts-jest/dist/compiler/instance.js
generated
vendored
Normal file
55
node_modules/ts-jest/dist/compiler/instance.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createCompilerInstance = exports.updateOutput = exports.SOURCE_MAPPING_PREFIX = void 0;
|
||||
var language_service_1 = require("./language-service");
|
||||
var transpiler_1 = require("./transpiler");
|
||||
var json_1 = require("../utils/json");
|
||||
exports.SOURCE_MAPPING_PREFIX = 'sourceMappingURL=';
|
||||
function updateOutput(outputText, normalizedFileName, sourceMap) {
|
||||
var base64Map = Buffer.from(updateSourceMap(sourceMap, normalizedFileName), 'utf8').toString('base64');
|
||||
var sourceMapContent = "data:application/json;charset=utf-8;base64," + base64Map;
|
||||
return (outputText.slice(0, outputText.lastIndexOf(exports.SOURCE_MAPPING_PREFIX) + exports.SOURCE_MAPPING_PREFIX.length) + sourceMapContent);
|
||||
}
|
||||
exports.updateOutput = updateOutput;
|
||||
var updateSourceMap = function (sourceMapText, normalizedFileName) {
|
||||
var sourceMap = JSON.parse(sourceMapText);
|
||||
sourceMap.file = normalizedFileName;
|
||||
sourceMap.sources = [normalizedFileName];
|
||||
delete sourceMap.sourceRoot;
|
||||
return json_1.stringify(sourceMap);
|
||||
};
|
||||
var compileAndUpdateOutput = function (compileFn, logger) { return function (code, fileName, lineOffset) {
|
||||
logger.debug({ fileName: fileName }, 'compileAndUpdateOutput(): get compile output');
|
||||
var _a = __read(compileFn(code, fileName, lineOffset), 2), value = _a[0], sourceMap = _a[1];
|
||||
return updateOutput(value, fileName, sourceMap);
|
||||
}; };
|
||||
exports.createCompilerInstance = function (configs) {
|
||||
var logger = configs.logger.child({ namespace: 'ts-compiler' });
|
||||
var compilerOptions = configs.parsedTsConfig.options;
|
||||
var extensions = ['.ts', '.tsx'];
|
||||
if (compilerOptions.allowJs) {
|
||||
extensions.push('.js');
|
||||
extensions.push('.jsx');
|
||||
}
|
||||
var compilerInstance = !configs.isolatedModules
|
||||
? language_service_1.initializeLanguageServiceInstance(configs, logger)
|
||||
: transpiler_1.initializeTranspilerInstance(configs, logger);
|
||||
var compile = compileAndUpdateOutput(compilerInstance.compileFn, logger);
|
||||
return { cwd: configs.cwd, compile: compile, program: compilerInstance.program };
|
||||
};
|
||||
280
node_modules/ts-jest/dist/compiler/language-service.js
generated
vendored
Normal file
280
node_modules/ts-jest/dist/compiler/language-service.js
generated
vendored
Normal file
@@ -0,0 +1,280 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spread = (this && this.__spread) || function () {
|
||||
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
|
||||
return ar;
|
||||
};
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.initializeLanguageServiceInstance = void 0;
|
||||
var bs_logger_1 = require("bs-logger");
|
||||
var fs_1 = require("fs");
|
||||
var path_1 = require("path");
|
||||
var memoize = require("lodash.memoize");
|
||||
var mkdirp = require("mkdirp");
|
||||
var constants_1 = require("../constants");
|
||||
var messages_1 = require("../utils/messages");
|
||||
var json_1 = require("../utils/json");
|
||||
var sha1_1 = require("../utils/sha1");
|
||||
function doTypeChecking(configs, diagnosedFiles, fileName, service, logger) {
|
||||
if (configs.shouldReportDiagnostics(fileName)) {
|
||||
var diagnostics = service.getSemanticDiagnostics(fileName).concat(service.getSyntacticDiagnostics(fileName));
|
||||
diagnosedFiles.push(fileName);
|
||||
configs.raiseDiagnostics(diagnostics, fileName, logger);
|
||||
}
|
||||
}
|
||||
exports.initializeLanguageServiceInstance = function (configs, logger) {
|
||||
var _a;
|
||||
logger.debug('initializeLanguageServiceInstance(): create typescript compiler');
|
||||
var ts = configs.compilerModule;
|
||||
var cwd = configs.cwd;
|
||||
var cacheDir = configs.tsCacheDir;
|
||||
var _b = configs.parsedTsConfig, options = _b.options, fileNames = _b.fileNames;
|
||||
var diagnosedFiles = [];
|
||||
var serviceHostTraceCtx = (_a = {
|
||||
namespace: 'ts:serviceHost',
|
||||
call: null
|
||||
},
|
||||
_a[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.trace,
|
||||
_a);
|
||||
var memoryCache = {
|
||||
files: new Map(),
|
||||
resolvedModules: new Map(),
|
||||
};
|
||||
var tsResolvedModulesCachePath;
|
||||
if (cacheDir) {
|
||||
mkdirp.sync(cacheDir);
|
||||
tsResolvedModulesCachePath = path_1.join(cacheDir, sha1_1.sha1('ts-jest-resolved-modules', '\x00'));
|
||||
try {
|
||||
var cachedTSResolvedModules = fs_1.readFileSync(tsResolvedModulesCachePath, 'utf-8');
|
||||
memoryCache.resolvedModules = new Map(json_1.parse(cachedTSResolvedModules));
|
||||
}
|
||||
catch (e) { }
|
||||
}
|
||||
configs.parsedTsConfig.fileNames
|
||||
.filter(function (fileName) { return !configs.isTestFile(fileName); })
|
||||
.forEach(function (fileName) {
|
||||
memoryCache.files.set(fileName, {
|
||||
version: 0,
|
||||
});
|
||||
});
|
||||
function isFileInCache(fileName) {
|
||||
return memoryCache.files.has(fileName) && memoryCache.files.get(fileName).version !== 0;
|
||||
}
|
||||
var cacheReadFile = logger.wrap(serviceHostTraceCtx, 'readFile', memoize(ts.sys.readFile));
|
||||
var moduleResolutionHost = {
|
||||
fileExists: memoize(ts.sys.fileExists),
|
||||
readFile: cacheReadFile,
|
||||
directoryExists: memoize(ts.sys.directoryExists),
|
||||
getCurrentDirectory: function () { return cwd; },
|
||||
realpath: ts.sys.realpath && memoize(ts.sys.realpath),
|
||||
getDirectories: memoize(ts.sys.getDirectories),
|
||||
};
|
||||
var moduleResolutionCache = ts.createModuleResolutionCache(cwd, function (x) { return x; }, options);
|
||||
function resolveModuleNames(moduleNames, containingFile) {
|
||||
var _a;
|
||||
var normalizedContainingFile = path_1.normalize(containingFile);
|
||||
var currentResolvedModules = (_a = memoryCache.resolvedModules.get(normalizedContainingFile)) !== null && _a !== void 0 ? _a : [];
|
||||
return moduleNames.map(function (moduleName) {
|
||||
var resolveModuleName = ts.resolveModuleName(moduleName, containingFile, options, moduleResolutionHost, moduleResolutionCache);
|
||||
var resolvedModule = resolveModuleName.resolvedModule;
|
||||
if (configs.isTestFile(normalizedContainingFile) && resolvedModule) {
|
||||
var normalizedResolvedFileName = path_1.normalize(resolvedModule.resolvedFileName);
|
||||
if (!currentResolvedModules.includes(normalizedResolvedFileName)) {
|
||||
currentResolvedModules.push(normalizedResolvedFileName);
|
||||
memoryCache.resolvedModules.set(normalizedContainingFile, currentResolvedModules);
|
||||
}
|
||||
}
|
||||
return resolvedModule;
|
||||
});
|
||||
}
|
||||
var projectVersion = 1;
|
||||
var updateMemoryCache = function (contents, fileName) {
|
||||
logger.debug({ fileName: fileName }, 'updateMemoryCache(): update memory cache for language service');
|
||||
var shouldIncrementProjectVersion = false;
|
||||
var hit = isFileInCache(fileName);
|
||||
if (!hit) {
|
||||
memoryCache.files.set(fileName, {
|
||||
text: contents,
|
||||
version: 1,
|
||||
});
|
||||
shouldIncrementProjectVersion = true;
|
||||
}
|
||||
else {
|
||||
var previousContents = memoryCache.files.get(fileName).text;
|
||||
if (previousContents !== contents) {
|
||||
memoryCache.files.set(fileName, {
|
||||
text: contents,
|
||||
version: memoryCache.files.get(fileName).version + 1,
|
||||
});
|
||||
if (hit)
|
||||
shouldIncrementProjectVersion = true;
|
||||
}
|
||||
if (!fileNames.includes(fileName)) {
|
||||
shouldIncrementProjectVersion = true;
|
||||
}
|
||||
}
|
||||
if (shouldIncrementProjectVersion)
|
||||
projectVersion++;
|
||||
};
|
||||
var serviceHost = {
|
||||
getProjectVersion: function () { return String(projectVersion); },
|
||||
getScriptFileNames: function () { return __spread(memoryCache.files.keys()); },
|
||||
getScriptVersion: function (fileName) {
|
||||
var _a;
|
||||
var normalizedFileName = path_1.normalize(fileName);
|
||||
var version = (_a = memoryCache.files.get(normalizedFileName)) === null || _a === void 0 ? void 0 : _a.version;
|
||||
return version === undefined ? undefined : String(version);
|
||||
},
|
||||
getScriptSnapshot: function (fileName) {
|
||||
var _a;
|
||||
var normalizedFileName = path_1.normalize(fileName);
|
||||
var hit = isFileInCache(normalizedFileName);
|
||||
logger.trace({ normalizedFileName: normalizedFileName, cacheHit: hit }, 'getScriptSnapshot():', 'cache', hit ? 'hit' : 'miss');
|
||||
if (!hit) {
|
||||
memoryCache.files.set(normalizedFileName, {
|
||||
text: cacheReadFile(normalizedFileName),
|
||||
version: 1,
|
||||
});
|
||||
}
|
||||
var contents = (_a = memoryCache.files.get(normalizedFileName)) === null || _a === void 0 ? void 0 : _a.text;
|
||||
if (contents === undefined)
|
||||
return;
|
||||
return ts.ScriptSnapshot.fromString(contents);
|
||||
},
|
||||
fileExists: memoize(ts.sys.fileExists),
|
||||
readFile: cacheReadFile,
|
||||
readDirectory: memoize(ts.sys.readDirectory),
|
||||
getDirectories: memoize(ts.sys.getDirectories),
|
||||
directoryExists: memoize(ts.sys.directoryExists),
|
||||
realpath: ts.sys.realpath && memoize(ts.sys.realpath),
|
||||
getNewLine: function () { return constants_1.LINE_FEED; },
|
||||
getCurrentDirectory: function () { return cwd; },
|
||||
getCompilationSettings: function () { return options; },
|
||||
getDefaultLibFileName: function () { return ts.getDefaultLibFilePath(options); },
|
||||
getCustomTransformers: function () { return configs.customTransformers; },
|
||||
resolveModuleNames: resolveModuleNames,
|
||||
};
|
||||
logger.debug('initializeLanguageServiceInstance(): creating language service');
|
||||
var service = ts.createLanguageService(serviceHost, ts.createDocumentRegistry());
|
||||
return {
|
||||
compileFn: function (code, fileName) {
|
||||
var e_1, _a;
|
||||
var _b;
|
||||
logger.debug({ fileName: fileName }, 'compileFn(): compiling using language service');
|
||||
updateMemoryCache(code, fileName);
|
||||
var output = service.getEmitOutput(fileName);
|
||||
if (tsResolvedModulesCachePath) {
|
||||
void (function () { return __awaiter(void 0, void 0, void 0, function () {
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4, fs_1.writeFile(tsResolvedModulesCachePath, json_1.stringify(__spread(memoryCache.resolvedModules)), function () { })];
|
||||
case 1:
|
||||
_a.sent();
|
||||
return [2];
|
||||
}
|
||||
});
|
||||
}); })();
|
||||
}
|
||||
if (!diagnosedFiles.includes(fileName)) {
|
||||
logger.debug({ fileName: fileName }, 'compileFn(): computing diagnostics using language service');
|
||||
doTypeChecking(configs, diagnosedFiles, fileName, service, logger);
|
||||
}
|
||||
if (!configs.isTestFile(fileName)) {
|
||||
try {
|
||||
for (var _c = __values(memoryCache.resolvedModules.entries()), _d = _c.next(); !_d.done; _d = _c.next()) {
|
||||
var _e = __read(_d.value, 2), testFileName = _e[0], resolvedModules = _e[1];
|
||||
if (resolvedModules.includes(fileName) &&
|
||||
!diagnosedFiles.includes(testFileName) &&
|
||||
fs_1.existsSync(testFileName)) {
|
||||
var testFileContent = (_b = memoryCache.files.get(testFileName)) === null || _b === void 0 ? void 0 : _b.text;
|
||||
if (!testFileContent) {
|
||||
updateMemoryCache(cacheReadFile(testFileName), testFileName);
|
||||
}
|
||||
logger.debug({ testFileName: testFileName }, 'compileFn(): computing diagnostics using language service for test file which uses the module');
|
||||
doTypeChecking(configs, diagnosedFiles, testFileName, service, logger);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
}
|
||||
if (output.emitSkipped) {
|
||||
throw new TypeError(path_1.relative(cwd, fileName) + ": Emit skipped for language service");
|
||||
}
|
||||
if (!output.outputFiles.length) {
|
||||
throw new TypeError(messages_1.interpolate("Unable to require `.d.ts` file for file: {{file}}.\nThis is usually the result of a faulty configuration or import. Make sure there is a `.js`, `.json` or another executable extension available alongside `{{file}}`.", {
|
||||
file: path_1.basename(fileName),
|
||||
}));
|
||||
}
|
||||
return [output.outputFiles[1].text, output.outputFiles[0].text];
|
||||
},
|
||||
program: service.getProgram(),
|
||||
};
|
||||
};
|
||||
24
node_modules/ts-jest/dist/compiler/transpiler.js
generated
vendored
Normal file
24
node_modules/ts-jest/dist/compiler/transpiler.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.initializeTranspilerInstance = void 0;
|
||||
exports.initializeTranspilerInstance = function (configs, logger) {
|
||||
logger.debug('initializeTranspilerInstance(): create typescript compiler');
|
||||
var options = configs.parsedTsConfig.options;
|
||||
var ts = configs.compilerModule;
|
||||
return {
|
||||
compileFn: function (code, fileName) {
|
||||
logger.debug({ fileName: fileName }, 'compileFn(): compiling as isolated module');
|
||||
var result = ts.transpileModule(code, {
|
||||
fileName: fileName,
|
||||
transformers: configs.customTransformers,
|
||||
compilerOptions: options,
|
||||
reportDiagnostics: configs.shouldReportDiagnostics(fileName),
|
||||
});
|
||||
if (result.diagnostics && configs.shouldReportDiagnostics(fileName)) {
|
||||
configs.raiseDiagnostics(result.diagnostics, fileName, logger);
|
||||
}
|
||||
return [result.outputText, result.sourceMapText];
|
||||
},
|
||||
program: undefined,
|
||||
};
|
||||
};
|
||||
46
node_modules/ts-jest/dist/config/config-set.d.ts
generated
vendored
46
node_modules/ts-jest/dist/config/config-set.d.ts
generated
vendored
@@ -1,34 +1,24 @@
|
||||
/// <reference types="jest" />
|
||||
import type { Config } from '@jest/types';
|
||||
import { Logger } from 'bs-logger';
|
||||
import { CompilerOptions, CustomTransformers, ParsedCommandLine } from 'typescript';
|
||||
import { AstTransformerDesc, BabelConfig, BabelJestTransformer, TTypeScript, TsCompiler, TsJestConfig, TsJestGlobalOptions, TsJestHooksMap } from '../types';
|
||||
import { CompilerOptions, CustomTransformers, Diagnostic, ParsedCommandLine } from 'typescript';
|
||||
import type { TTypeScript } from '../types';
|
||||
export declare class ConfigSet {
|
||||
readonly parentOptions?: TsJestGlobalOptions | undefined;
|
||||
get projectPackageJson(): Record<string, any>;
|
||||
get projectDependencies(): Record<string, string>;
|
||||
get jest(): jest.ProjectConfig;
|
||||
get tsJest(): TsJestConfig;
|
||||
get typescript(): ParsedCommandLine;
|
||||
get tsconfig(): any;
|
||||
get versions(): Record<string, string>;
|
||||
private static loadConfig;
|
||||
get babel(): BabelConfig | undefined;
|
||||
get compilerModule(): TTypeScript;
|
||||
get babelJestTransformer(): BabelJestTransformer | undefined;
|
||||
get tsCompiler(): TsCompiler;
|
||||
get astTransformers(): AstTransformerDesc[];
|
||||
get tsCustomTransformers(): CustomTransformers;
|
||||
get hooks(): TsJestHooksMap;
|
||||
get shouldReportDiagnostic(): (filePath: string) => boolean;
|
||||
get shouldStringifyContent(): (filePath: string) => boolean;
|
||||
get tsCacheDir(): string | undefined;
|
||||
get overriddenCompilerOptions(): Partial<CompilerOptions>;
|
||||
get rootDir(): string;
|
||||
get cwd(): string;
|
||||
get tsJestDigest(): string;
|
||||
get cacheKey(): string;
|
||||
readonly logger: Logger;
|
||||
constructor(jestConfig: jest.ProjectConfig, parentOptions?: TsJestGlobalOptions | undefined, parentLogger?: Logger);
|
||||
readonly compilerModule: TTypeScript;
|
||||
readonly isolatedModules: boolean;
|
||||
readonly cwd: string;
|
||||
tsCacheDir: string | undefined;
|
||||
parsedTsConfig: ParsedCommandLine | Record<string, any>;
|
||||
customTransformers: CustomTransformers;
|
||||
readonly rootDir: string;
|
||||
protected _overriddenCompilerOptions: Partial<CompilerOptions>;
|
||||
constructor(jestConfig: Config.ProjectConfig, parentLogger?: Logger | undefined);
|
||||
protected _resolveTsConfig(compilerOptions?: CompilerOptions, resolvedConfigFile?: string): Record<string, any>;
|
||||
get tsJestDigest(): string;
|
||||
get isTestFile(): (fileName: string) => boolean;
|
||||
shouldStringifyContent(filePath: string): boolean;
|
||||
raiseDiagnostics(diagnostics: Diagnostic[], filePath?: string, logger?: Logger): void;
|
||||
shouldReportDiagnostics(filePath: string): boolean;
|
||||
resolvePath(inputPath: string, { throwIfMissing, nodeResolve }?: {
|
||||
throwIfMissing?: boolean;
|
||||
nodeResolve?: boolean;
|
||||
|
||||
963
node_modules/ts-jest/dist/config/config-set.js
generated
vendored
963
node_modules/ts-jest/dist/config/config-set.js
generated
vendored
File diff suppressed because it is too large
Load Diff
10
node_modules/ts-jest/dist/config/create-jest-preset.d.ts
generated
vendored
10
node_modules/ts-jest/dist/config/create-jest-preset.d.ts
generated
vendored
@@ -1,10 +0,0 @@
|
||||
/// <reference types="jest" />
|
||||
export interface TsJestPresets {
|
||||
transform: Record<string, string>;
|
||||
testMatch?: string[];
|
||||
moduleFileExtensions?: string[];
|
||||
}
|
||||
export interface CreateJestPresetOptions {
|
||||
allowJs?: boolean;
|
||||
}
|
||||
export declare function createJestPreset({ allowJs }?: CreateJestPresetOptions, from?: jest.InitialOptions): TsJestPresets;
|
||||
9
node_modules/ts-jest/dist/config/paths-to-module-name-mapper.d.ts
generated
vendored
9
node_modules/ts-jest/dist/config/paths-to-module-name-mapper.d.ts
generated
vendored
@@ -1,5 +1,6 @@
|
||||
import type { Config } from '@jest/types';
|
||||
declare type JestPathMapping = Config.InitialOptions['moduleNameMapper'];
|
||||
export declare const pathsToModuleNameMapper: (mapping: import("typescript").MapLike<string[]>, { prefix }?: {
|
||||
prefix?: string | undefined;
|
||||
}) => {
|
||||
[key: string]: string;
|
||||
} | undefined;
|
||||
prefix: string;
|
||||
}) => JestPathMapping;
|
||||
export {};
|
||||
|
||||
31
node_modules/ts-jest/dist/config/paths-to-module-name-mapper.js
generated
vendored
31
node_modules/ts-jest/dist/config/paths-to-module-name-mapper.js
generated
vendored
@@ -12,14 +12,15 @@ var __values = (this && this.__values) || function(o) {
|
||||
};
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.pathsToModuleNameMapper = void 0;
|
||||
var bs_logger_1 = require("bs-logger");
|
||||
var logger_1 = require("../util/logger");
|
||||
var messages_1 = require("../util/messages");
|
||||
var logger_1 = require("../utils/logger");
|
||||
var messages_1 = require("../utils/messages");
|
||||
var escapeRegex = function (str) { return str.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&'); };
|
||||
var logger = logger_1.rootLogger.child((_a = {}, _a[bs_logger_1.LogContexts.namespace] = 'path-mapper', _a));
|
||||
exports.pathsToModuleNameMapper = function (mapping, _a) {
|
||||
var e_1, _b;
|
||||
var _c = (_a === void 0 ? {} : _a).prefix, prefix = _c === void 0 ? '' : _c;
|
||||
var _c = (_a === void 0 ? Object.create(null) : _a).prefix, prefix = _c === void 0 ? '' : _c;
|
||||
var jestMap = {};
|
||||
try {
|
||||
for (var _d = __values(Object.keys(mapping)), _e = _d.next(); !_e.done; _e = _d.next()) {
|
||||
@@ -27,28 +28,28 @@ exports.pathsToModuleNameMapper = function (mapping, _a) {
|
||||
var pattern = void 0;
|
||||
var toPaths = mapping[fromPath];
|
||||
if (toPaths.length === 0) {
|
||||
logger.warn(messages_1.interpolate(messages_1.Errors.NotMappingPathWithEmptyMap, { path: fromPath }));
|
||||
logger.warn(messages_1.interpolate("Not mapping \"{{path}}\" because it has no target.", { path: fromPath }));
|
||||
continue;
|
||||
}
|
||||
else if (toPaths.length > 1) {
|
||||
logger.warn(messages_1.interpolate(messages_1.Errors.MappingOnlyFirstTargetOfPath, {
|
||||
path: fromPath,
|
||||
count: toPaths.length,
|
||||
}));
|
||||
}
|
||||
var target = toPaths[0];
|
||||
var segments = fromPath.split(/\*/g);
|
||||
if (segments.length === 1) {
|
||||
var paths = toPaths.map(function (target) {
|
||||
var enrichedPrefix = prefix !== '' && !prefix.endsWith('/') ? prefix + "/" : prefix;
|
||||
return "" + enrichedPrefix + target;
|
||||
});
|
||||
pattern = "^" + escapeRegex(fromPath) + "$";
|
||||
jestMap[pattern] = "" + prefix + target;
|
||||
jestMap[pattern] = paths.length === 1 ? paths[0] : paths;
|
||||
}
|
||||
else if (segments.length === 2) {
|
||||
var paths = toPaths.map(function (target) {
|
||||
var enrichedPrefix = prefix !== '' && !prefix.endsWith('/') ? prefix + "/" : prefix;
|
||||
return "" + enrichedPrefix + target.replace(/\*/g, '$1');
|
||||
});
|
||||
pattern = "^" + escapeRegex(segments[0]) + "(.*)" + escapeRegex(segments[1]) + "$";
|
||||
jestMap[pattern] = "" + prefix + target.replace(/\*/g, '$1');
|
||||
jestMap[pattern] = paths.length === 1 ? paths[0] : paths;
|
||||
}
|
||||
else {
|
||||
logger.warn(messages_1.interpolate(messages_1.Errors.NotMappingMultiStarPath, { path: fromPath }));
|
||||
continue;
|
||||
logger.warn(messages_1.interpolate("Not mapping \"{{path}}\" because it has more than one star (`*`).", { path: fromPath }));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
4
node_modules/ts-jest/dist/constants.d.ts
generated
vendored
Normal file
4
node_modules/ts-jest/dist/constants.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export declare const LINE_FEED = "\n";
|
||||
export declare const TS_TSX_REGEX: RegExp;
|
||||
export declare const JS_JSX_REGEX: RegExp;
|
||||
export declare const DECLARATION_TYPE_EXT = ".d.ts";
|
||||
8
node_modules/ts-jest/dist/constants.js
generated
vendored
Normal file
8
node_modules/ts-jest/dist/constants.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DEFAULT_JEST_TEST_MATCH = exports.DECLARATION_TYPE_EXT = exports.JS_JSX_REGEX = exports.TS_TSX_REGEX = exports.LINE_FEED = void 0;
|
||||
exports.LINE_FEED = '\n';
|
||||
exports.TS_TSX_REGEX = /\.tsx?$/;
|
||||
exports.JS_JSX_REGEX = /\.jsx?$/;
|
||||
exports.DECLARATION_TYPE_EXT = '.d.ts';
|
||||
exports.DEFAULT_JEST_TEST_MATCH = ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'];
|
||||
23
node_modules/ts-jest/dist/index.d.ts
generated
vendored
23
node_modules/ts-jest/dist/index.d.ts
generated
vendored
@@ -1,16 +1,19 @@
|
||||
import { createJestPreset as createJestPresetCore } from './config/create-jest-preset';
|
||||
import { createJestPreset as createJestPresetCore } from './presets/create-jest-preset';
|
||||
import { TsJestTransformer } from './ts-jest-transformer';
|
||||
import { TsJestGlobalOptions } from './types';
|
||||
import { mocked as mockedCore } from './util/testing';
|
||||
import type { TsJestGlobalOptions } from './types';
|
||||
import { mocked as mockedCore } from './utils/testing';
|
||||
declare module '@jest/types' {
|
||||
namespace Config {
|
||||
interface ConfigGlobals {
|
||||
'ts-jest': TsJestGlobalOptions;
|
||||
}
|
||||
}
|
||||
}
|
||||
export declare const mocked: typeof mockedCore;
|
||||
export declare const createJestPreset: typeof createJestPresetCore;
|
||||
export declare const pathsToModuleNameMapper: (mapping: import("typescript").MapLike<string[]>, { prefix }?: {
|
||||
prefix?: string | undefined;
|
||||
prefix: string;
|
||||
}) => {
|
||||
[key: string]: string;
|
||||
[key: string]: string | string[];
|
||||
} | undefined;
|
||||
export declare const version: string;
|
||||
export declare const digest: string;
|
||||
export declare function createTransformer(baseConfig?: TsJestGlobalOptions): TsJestTransformer;
|
||||
declare const jestPreset: import("./config/create-jest-preset").TsJestPresets;
|
||||
export { jestPreset, };
|
||||
export declare function createTransformer(): TsJestTransformer;
|
||||
|
||||
68
node_modules/ts-jest/dist/index.js
generated
vendored
68
node_modules/ts-jest/dist/index.js
generated
vendored
@@ -1,74 +1,24 @@
|
||||
"use strict";
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spread = (this && this.__spread) || function () {
|
||||
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
|
||||
return ar;
|
||||
};
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createTransformer = exports.pathsToModuleNameMapper = exports.createJestPreset = exports.mocked = void 0;
|
||||
var bs_logger_1 = require("bs-logger");
|
||||
var fs_1 = require("fs");
|
||||
var path_1 = require("path");
|
||||
var create_jest_preset_1 = require("./config/create-jest-preset");
|
||||
var create_jest_preset_1 = require("./presets/create-jest-preset");
|
||||
var paths_to_module_name_mapper_1 = require("./config/paths-to-module-name-mapper");
|
||||
var ts_jest_transformer_1 = require("./ts-jest-transformer");
|
||||
var logger_1 = require("./util/logger");
|
||||
var messages_1 = require("./util/messages");
|
||||
var testing_1 = require("./util/testing");
|
||||
var version_checkers_1 = require("./util/version-checkers");
|
||||
var logger_1 = require("./utils/logger");
|
||||
var messages_1 = require("./utils/messages");
|
||||
var testing_1 = require("./utils/testing");
|
||||
var version_checkers_1 = require("./utils/version-checkers");
|
||||
var warn = logger_1.rootLogger.child((_a = {}, _a[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.warn, _a));
|
||||
var helperMoved = function (name, helper) {
|
||||
return warn.wrap(messages_1.interpolate(messages_1.Deprecateds.HelperMovedToUtils, { helper: name }), helper);
|
||||
return warn.wrap(messages_1.interpolate("The `{{helper}}` helper has been moved to `ts-jest/utils`. Use `import { {{helper}} } from 'ts-jest/utils'` instead.", { helper: name }), helper);
|
||||
};
|
||||
exports.mocked = helperMoved('mocked', testing_1.mocked);
|
||||
exports.createJestPreset = helperMoved('createJestPreset', create_jest_preset_1.createJestPreset);
|
||||
exports.pathsToModuleNameMapper = helperMoved('pathsToModuleNameMapper', paths_to_module_name_mapper_1.pathsToModuleNameMapper);
|
||||
exports.version = require('../package.json').version;
|
||||
exports.digest = fs_1.readFileSync(path_1.resolve(__dirname, '..', '.ts-jest-digest'), 'utf8');
|
||||
var transformer;
|
||||
function defaultTransformer() {
|
||||
return transformer || (transformer = createTransformer());
|
||||
}
|
||||
function createTransformer(baseConfig) {
|
||||
function createTransformer() {
|
||||
version_checkers_1.VersionCheckers.jest.warn();
|
||||
return new ts_jest_transformer_1.TsJestTransformer(baseConfig);
|
||||
return new ts_jest_transformer_1.TsJestTransformer();
|
||||
}
|
||||
exports.createTransformer = createTransformer;
|
||||
function process() {
|
||||
var _a;
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
return (_a = defaultTransformer()).process.apply(_a, __spread(args));
|
||||
}
|
||||
exports.process = process;
|
||||
function getCacheKey() {
|
||||
var _a;
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
return (_a = defaultTransformer()).getCacheKey.apply(_a, __spread(args));
|
||||
}
|
||||
exports.getCacheKey = getCacheKey;
|
||||
exports.canInstrument = false;
|
||||
var jestPreset = create_jest_preset_1.createJestPreset();
|
||||
exports.jestPreset = jestPreset;
|
||||
exports.__singleton = function () { return transformer; };
|
||||
exports.__resetModule = function () { return (transformer = undefined); };
|
||||
|
||||
7
node_modules/ts-jest/dist/presets/create-jest-preset.d.ts
generated
vendored
Normal file
7
node_modules/ts-jest/dist/presets/create-jest-preset.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { Config } from '@jest/types';
|
||||
export declare type TsJestPresets = Pick<Config.InitialOptions, 'moduleFileExtensions' | 'transform' | 'testMatch'>;
|
||||
interface CreateJestPresetOptions {
|
||||
allowJs?: boolean;
|
||||
}
|
||||
export declare function createJestPreset({ allowJs }?: CreateJestPresetOptions, from?: Config.InitialOptions): TsJestPresets;
|
||||
export {};
|
||||
@@ -11,7 +11,8 @@ var __assign = (this && this.__assign) || function () {
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var logger_1 = require("../util/logger");
|
||||
exports.createJestPreset = void 0;
|
||||
var logger_1 = require("../utils/logger");
|
||||
var logger = logger_1.rootLogger.child({ namespace: 'jest-preset' });
|
||||
function createJestPreset(_a, from) {
|
||||
var _b;
|
||||
75
node_modules/ts-jest/dist/transformers/hoist-jest.js
generated
vendored
75
node_modules/ts-jest/dist/transformers/hoist-jest.js
generated
vendored
@@ -1,4 +1,15 @@
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
@@ -20,21 +31,43 @@ var __spread = (this && this.__spread) || function () {
|
||||
return ar;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.factory = exports.version = exports.name = void 0;
|
||||
var bs_logger_1 = require("bs-logger");
|
||||
var HOIST_METHODS = ['mock', 'unmock', 'enableAutomock', 'disableAutomock'];
|
||||
var HOIST_METHODS = ['mock', 'unmock', 'enableAutomock', 'disableAutomock', 'deepUnmock'];
|
||||
var JEST_GLOBALS_MODULE_NAME = '@jest/globals';
|
||||
var JEST_GLOBAL_NAME = 'jest';
|
||||
var ROOT_LEVEL_AST = 1;
|
||||
exports.name = 'hoisting-jest-mock';
|
||||
exports.version = 1;
|
||||
exports.version = 4;
|
||||
function factory(cs) {
|
||||
var logger = cs.logger.child({ namespace: 'ts-hoisting' });
|
||||
var ts = cs.compilerModule;
|
||||
var importNames = [];
|
||||
function shouldHoistExpression(node) {
|
||||
if (ts.isCallExpression(node) &&
|
||||
ts.isPropertyAccessExpression(node.expression) &&
|
||||
HOIST_METHODS.includes(node.expression.name.text)) {
|
||||
if (importNames.length) {
|
||||
return ((ts.isIdentifier(node.expression.expression) && importNames.includes(node.expression.expression.text)) ||
|
||||
(ts.isPropertyAccessExpression(node.expression.expression) &&
|
||||
ts.isIdentifier(node.expression.expression.expression) &&
|
||||
importNames.includes(node.expression.expression.expression.text)) ||
|
||||
shouldHoistExpression(node.expression.expression));
|
||||
}
|
||||
else {
|
||||
return ((ts.isIdentifier(node.expression.expression) && node.expression.expression.text === JEST_GLOBAL_NAME) ||
|
||||
shouldHoistExpression(node.expression.expression));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function shouldHoistNode(node) {
|
||||
return (ts.isExpressionStatement(node) &&
|
||||
ts.isCallExpression(node.expression) &&
|
||||
ts.isPropertyAccessExpression(node.expression.expression) &&
|
||||
ts.isIdentifier(node.expression.expression.expression) &&
|
||||
node.expression.expression.expression.text === 'jest' &&
|
||||
ts.isIdentifier(node.expression.expression.name) &&
|
||||
HOIST_METHODS.includes(node.expression.expression.name.text));
|
||||
return ts.isExpressionStatement(node) && shouldHoistExpression(node.expression);
|
||||
}
|
||||
function isJestGlobalImport(node) {
|
||||
return (ts.isImportDeclaration(node) &&
|
||||
ts.isStringLiteral(node.moduleSpecifier) &&
|
||||
node.moduleSpecifier.text === JEST_GLOBALS_MODULE_NAME);
|
||||
}
|
||||
function createVisitor(ctx, _) {
|
||||
var level = 0;
|
||||
@@ -55,14 +88,32 @@ function factory(cs) {
|
||||
}
|
||||
};
|
||||
var visitor = function (node) {
|
||||
var _a, _b;
|
||||
enter();
|
||||
var resultNode = ts.visitEachChild(node, visitor, ctx);
|
||||
if (isJestGlobalImport(resultNode) && ((_a = resultNode.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings) &&
|
||||
(ts.isNamespaceImport(resultNode.importClause.namedBindings) ||
|
||||
ts.isNamedImports(resultNode.importClause.namedBindings))) {
|
||||
var namedBindings = resultNode.importClause.namedBindings;
|
||||
var jestImportName = ts.isNamespaceImport(namedBindings)
|
||||
? namedBindings.name.text
|
||||
: (_b = namedBindings.elements.find(function (element) { var _a; return element.name.text === JEST_GLOBAL_NAME || ((_a = element.propertyName) === null || _a === void 0 ? void 0 : _a.text) === JEST_GLOBAL_NAME; })) === null || _b === void 0 ? void 0 : _b.name.text;
|
||||
if (jestImportName) {
|
||||
importNames.push(jestImportName);
|
||||
}
|
||||
}
|
||||
if (hoisted[level] && hoisted[level].length) {
|
||||
var hoistedStmts_1 = hoisted[level];
|
||||
var otherStmts = resultNode.statements.filter(function (s) { return !hoistedStmts_1.includes(s); });
|
||||
var otherStmts = resultNode.statements.filter(function (s) { return !hoistedStmts_1.includes(s) && !isJestGlobalImport(s); });
|
||||
var newNode = ts.getMutableClone(resultNode);
|
||||
newNode.statements = ts.createNodeArray(__spread(hoistedStmts_1, otherStmts));
|
||||
resultNode = newNode;
|
||||
var newStatements = __spread(hoistedStmts_1, otherStmts);
|
||||
if (level === ROOT_LEVEL_AST) {
|
||||
var jestGlobalsImportStmts = resultNode.statements.filter(function (s) { return isJestGlobalImport(s); });
|
||||
resultNode = __assign(__assign({}, newNode), { statements: ts.createNodeArray(__spread(jestGlobalsImportStmts, newStatements)) });
|
||||
}
|
||||
else {
|
||||
resultNode = __assign(__assign({}, newNode), { statements: ts.createNodeArray(newStatements) });
|
||||
}
|
||||
}
|
||||
exit();
|
||||
if (shouldHoistNode(resultNode)) {
|
||||
|
||||
22
node_modules/ts-jest/dist/transformers/index.js
generated
vendored
22
node_modules/ts-jest/dist/transformers/index.js
generated
vendored
@@ -1,4 +1,24 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var hoisting = require("./hoist-jest");
|
||||
exports.internals = void 0;
|
||||
var hoisting = __importStar(require("./hoist-jest"));
|
||||
exports.internals = [hoisting];
|
||||
|
||||
3
node_modules/ts-jest/dist/transformers/path-mapping.d.ts
generated
vendored
Normal file
3
node_modules/ts-jest/dist/transformers/path-mapping.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type * as _ts from 'typescript';
|
||||
import type { ConfigSet } from '../config/config-set';
|
||||
export declare function factory(cs: ConfigSet): (ctx: _ts.TransformationContext) => _ts.Transformer<_ts.SourceFile>;
|
||||
121
node_modules/ts-jest/dist/transformers/path-mapping.js
generated
vendored
Normal file
121
node_modules/ts-jest/dist/transformers/path-mapping.js
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.factory = exports.version = exports.name = void 0;
|
||||
var bs_logger_1 = require("bs-logger");
|
||||
var path_1 = require("path");
|
||||
exports.name = 'path-mapping';
|
||||
exports.version = 1;
|
||||
var isBaseDir = function (base, dir) { var _a; return !((_a = path_1.relative(base, dir)) === null || _a === void 0 ? void 0 : _a.startsWith('.')); };
|
||||
function factory(cs) {
|
||||
var _a;
|
||||
var logger = cs.logger.child({ namespace: 'ts-path-mapping' });
|
||||
var ts = cs.compilerModule;
|
||||
var compilerOptions = cs.parsedTsConfig.options;
|
||||
var rootDirs = (_a = compilerOptions.rootDirs) === null || _a === void 0 ? void 0 : _a.filter(path_1.isAbsolute);
|
||||
var isDynamicImport = function (node) {
|
||||
return ts.isCallExpression(node) && node.expression.kind === ts.SyntaxKind.ImportKeyword;
|
||||
};
|
||||
var isRequire = function (node) {
|
||||
return ts.isCallExpression(node) &&
|
||||
ts.isIdentifier(node.expression) &&
|
||||
node.expression.text === 'require' &&
|
||||
ts.isStringLiteral(node.arguments[0]) &&
|
||||
node.arguments.length === 1;
|
||||
};
|
||||
var createVisitor = function (ctx, sf) {
|
||||
var fileName = sf.fileName;
|
||||
var fileDir = path_1.normalize(path_1.dirname(fileName));
|
||||
var rewritePath = function (importPath) {
|
||||
var e_1, _a;
|
||||
var p = importPath;
|
||||
var resolvedModule = ts.resolveModuleName(importPath, fileName, compilerOptions, ts.sys).resolvedModule;
|
||||
if (resolvedModule) {
|
||||
var resolvedFileName = resolvedModule.resolvedFileName;
|
||||
var filePath = fileDir;
|
||||
var modulePath = path_1.dirname(resolvedFileName);
|
||||
if (rootDirs) {
|
||||
var fileRootDir = '';
|
||||
var moduleRootDir = '';
|
||||
try {
|
||||
for (var rootDirs_1 = __values(rootDirs), rootDirs_1_1 = rootDirs_1.next(); !rootDirs_1_1.done; rootDirs_1_1 = rootDirs_1.next()) {
|
||||
var rootDir = rootDirs_1_1.value;
|
||||
if (isBaseDir(rootDir, resolvedFileName) && rootDir.length > moduleRootDir.length)
|
||||
moduleRootDir = rootDir;
|
||||
if (isBaseDir(rootDir, fileName) && rootDir.length > fileRootDir.length)
|
||||
fileRootDir = rootDir;
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (rootDirs_1_1 && !rootDirs_1_1.done && (_a = rootDirs_1.return)) _a.call(rootDirs_1);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
if (fileRootDir && moduleRootDir) {
|
||||
filePath = path_1.relative(fileRootDir, filePath);
|
||||
modulePath = path_1.relative(moduleRootDir, modulePath);
|
||||
}
|
||||
}
|
||||
p = path_1.normalize(path_1.join(path_1.relative(filePath, modulePath), path_1.basename(resolvedFileName)));
|
||||
p = p.startsWith('.') ? p : "./" + p;
|
||||
}
|
||||
return p;
|
||||
};
|
||||
var visitor = function (node) {
|
||||
var rewrittenPath;
|
||||
var newNode = ts.getMutableClone(node);
|
||||
if (isDynamicImport(node) || isRequire(node)) {
|
||||
rewrittenPath = rewritePath(node.arguments[0].text);
|
||||
return __assign(__assign({}, newNode), { arguments: ts.createNodeArray([ts.createStringLiteral(rewrittenPath)]) });
|
||||
}
|
||||
if (ts.isExternalModuleReference(node) && ts.isStringLiteral(node.expression)) {
|
||||
rewrittenPath = rewritePath(node.expression.text);
|
||||
return ts.updateExternalModuleReference(newNode, ts.createLiteral(rewrittenPath));
|
||||
}
|
||||
if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) {
|
||||
rewrittenPath = rewritePath(node.moduleSpecifier.text);
|
||||
return __assign(__assign({}, newNode), { moduleSpecifier: ts.createLiteral(rewrittenPath) });
|
||||
}
|
||||
if (ts.isExportDeclaration(node) && node.moduleSpecifier && ts.isStringLiteral(node.moduleSpecifier)) {
|
||||
rewrittenPath = rewritePath(node.moduleSpecifier.text);
|
||||
return __assign(__assign({}, newNode), { moduleSpecifier: ts.createLiteral(rewrittenPath) });
|
||||
}
|
||||
if (ts.isImportTypeNode(node) &&
|
||||
ts.isLiteralTypeNode(node.argument) &&
|
||||
ts.isStringLiteral(node.argument.literal)) {
|
||||
rewrittenPath = rewritePath(node.argument.literal.text);
|
||||
return __assign(__assign({}, newNode), { argument: ts.createLiteralTypeNode(ts.createStringLiteral(rewrittenPath)) });
|
||||
}
|
||||
return ts.visitEachChild(node, visitor, ctx);
|
||||
};
|
||||
return visitor;
|
||||
};
|
||||
return function (ctx) {
|
||||
var _a;
|
||||
return logger.wrap((_a = {}, _a[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.debug, _a.call = null, _a), 'visitSourceFileNode(): path mapping', function (sf) { return ts.visitNode(sf, createVisitor(ctx, sf)); });
|
||||
};
|
||||
}
|
||||
exports.factory = factory;
|
||||
25
node_modules/ts-jest/dist/ts-jest-transformer.d.ts
generated
vendored
25
node_modules/ts-jest/dist/ts-jest-transformer.d.ts
generated
vendored
@@ -1,17 +1,12 @@
|
||||
/// <reference types="jest" />
|
||||
import { Logger } from 'bs-logger';
|
||||
import type { CacheKeyOptions, TransformedSource, Transformer, TransformOptions } from '@jest/transform';
|
||||
import type { Config } from '@jest/types';
|
||||
import type { Logger } from 'bs-logger';
|
||||
import { ConfigSet } from './config/config-set';
|
||||
import { TsJestGlobalOptions } from './types';
|
||||
export declare class TsJestTransformer implements jest.Transformer {
|
||||
static get lastTransformerId(): number;
|
||||
readonly logger: Logger;
|
||||
readonly id: number;
|
||||
readonly options: TsJestGlobalOptions;
|
||||
constructor(baseOptions?: TsJestGlobalOptions);
|
||||
configsFor(jestConfig: jest.ProjectConfig | string): ConfigSet;
|
||||
process(input: string, filePath: jest.Path, jestConfig: jest.ProjectConfig, transformOptions?: jest.TransformOptions): jest.TransformedSource | string;
|
||||
getCacheKey(fileContent: string, filePath: string, jestConfigStr: string, transformOptions?: {
|
||||
instrument?: boolean;
|
||||
rootDir?: string;
|
||||
}): string;
|
||||
export declare class TsJestTransformer implements Transformer {
|
||||
protected readonly logger: Logger;
|
||||
protected _transformCfgStr: string;
|
||||
constructor();
|
||||
configsFor(jestConfig: Config.ProjectConfig): ConfigSet;
|
||||
process(input: string, filePath: Config.Path, jestConfig: Config.ProjectConfig, transformOptions?: TransformOptions): TransformedSource | string;
|
||||
getCacheKey(fileContent: string, filePath: string, _jestConfigStr: string, transformOptions: CacheKeyOptions): string;
|
||||
}
|
||||
|
||||
124
node_modules/ts-jest/dist/ts-jest-transformer.js
generated
vendored
124
node_modules/ts-jest/dist/ts-jest-transformer.js
generated
vendored
@@ -11,69 +11,53 @@ var __assign = (this && this.__assign) || function () {
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var util_1 = require("util");
|
||||
exports.TsJestTransformer = void 0;
|
||||
var config_set_1 = require("./config/config-set");
|
||||
var json_1 = require("./util/json");
|
||||
var jsonable_value_1 = require("./util/jsonable-value");
|
||||
var logger_1 = require("./util/logger");
|
||||
var messages_1 = require("./util/messages");
|
||||
var sha1_1 = require("./util/sha1");
|
||||
exports.INSPECT_CUSTOM = util_1.inspect.custom || 'inspect';
|
||||
var constants_1 = require("./constants");
|
||||
var json_1 = require("./utils/json");
|
||||
var jsonable_value_1 = require("./utils/jsonable-value");
|
||||
var logger_1 = require("./utils/logger");
|
||||
var messages_1 = require("./utils/messages");
|
||||
var sha1_1 = require("./utils/sha1");
|
||||
var TsJestTransformer = (function () {
|
||||
function TsJestTransformer(baseOptions) {
|
||||
if (baseOptions === void 0) { baseOptions = {}; }
|
||||
this.options = __assign({}, baseOptions);
|
||||
this.id = TsJestTransformer._nextTransformerId;
|
||||
this.logger = logger_1.rootLogger.child({
|
||||
transformerId: this.id,
|
||||
namespace: 'jest-transformer',
|
||||
});
|
||||
this.logger.debug({ baseOptions: baseOptions }, 'created new transformer');
|
||||
function TsJestTransformer() {
|
||||
this.logger = logger_1.rootLogger.child({ namespace: 'ts-jest-transformer' });
|
||||
this.logger.debug('created new transformer');
|
||||
}
|
||||
Object.defineProperty(TsJestTransformer, "lastTransformerId", {
|
||||
get: function () {
|
||||
return TsJestTransformer._lastTransformerId;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(TsJestTransformer, "_nextTransformerId", {
|
||||
get: function () {
|
||||
return ++TsJestTransformer._lastTransformerId;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
TsJestTransformer.prototype[exports.INSPECT_CUSTOM] = function () {
|
||||
return "[object TsJestTransformer<#" + this.id + ">]";
|
||||
};
|
||||
TsJestTransformer.prototype.configsFor = function (jestConfig) {
|
||||
var csi;
|
||||
var jestConfigObj;
|
||||
if (typeof jestConfig === 'string') {
|
||||
csi = TsJestTransformer._configSetsIndex.find(function (cs) { return cs.jestConfig.serialized === jestConfig; });
|
||||
if (csi)
|
||||
return csi.configSet;
|
||||
jestConfigObj = json_1.parse(jestConfig);
|
||||
var ccs = TsJestTransformer._cachedConfigSets.find(function (cs) { return cs.jestConfig.value === jestConfig; });
|
||||
var configSet;
|
||||
if (ccs) {
|
||||
this._transformCfgStr = ccs.transformerCfgStr;
|
||||
configSet = ccs.configSet;
|
||||
}
|
||||
else {
|
||||
csi = TsJestTransformer._configSetsIndex.find(function (cs) { return cs.jestConfig.value === jestConfig; });
|
||||
if (csi)
|
||||
return csi.configSet;
|
||||
var serialized_1 = json_1.stringify(jestConfig);
|
||||
csi = TsJestTransformer._configSetsIndex.find(function (cs) { return cs.jestConfig.serialized === serialized_1; });
|
||||
if (csi) {
|
||||
csi.jestConfig.value = jestConfig;
|
||||
return csi.configSet;
|
||||
var serializedJestCfg_1 = json_1.stringify(jestConfig);
|
||||
var serializedCcs = TsJestTransformer._cachedConfigSets.find(function (cs) { return cs.jestConfig.serialized === serializedJestCfg_1; });
|
||||
if (serializedCcs) {
|
||||
serializedCcs.jestConfig.value = jestConfig;
|
||||
this._transformCfgStr = serializedCcs.transformerCfgStr;
|
||||
configSet = serializedCcs.configSet;
|
||||
}
|
||||
else {
|
||||
this.logger.info('no matching config-set found, creating a new one');
|
||||
configSet = new config_set_1.ConfigSet(jestConfig);
|
||||
var jest_1 = __assign({}, jestConfig);
|
||||
var globals = (jest_1.globals = __assign({}, jest_1.globals));
|
||||
jest_1.name = undefined;
|
||||
jest_1.cacheDirectory = undefined;
|
||||
delete globals['ts-jest'];
|
||||
this._transformCfgStr = new jsonable_value_1.JsonableValue(__assign(__assign({ digest: configSet.tsJestDigest, babel: configSet.babelConfig }, jest_1), { tsconfig: {
|
||||
options: configSet.parsedTsConfig.options,
|
||||
raw: configSet.parsedTsConfig.raw,
|
||||
} })).serialized;
|
||||
TsJestTransformer._cachedConfigSets.push({
|
||||
jestConfig: new jsonable_value_1.JsonableValue(jestConfig),
|
||||
configSet: configSet,
|
||||
transformerCfgStr: this._transformCfgStr,
|
||||
});
|
||||
}
|
||||
jestConfigObj = jestConfig;
|
||||
}
|
||||
this.logger.info("no matching config-set found, creating a new one");
|
||||
var configSet = new config_set_1.ConfigSet(jestConfigObj, this.options, this.logger);
|
||||
TsJestTransformer._configSetsIndex.push({
|
||||
jestConfig: new jsonable_value_1.JsonableValue(jestConfigObj),
|
||||
configSet: configSet,
|
||||
});
|
||||
return configSet;
|
||||
};
|
||||
TsJestTransformer.prototype.process = function (input, filePath, jestConfig, transformOptions) {
|
||||
@@ -82,26 +66,26 @@ var TsJestTransformer = (function () {
|
||||
var source = input;
|
||||
var configs = this.configsFor(jestConfig);
|
||||
var hooks = configs.hooks;
|
||||
var stringify = configs.shouldStringifyContent(filePath);
|
||||
var babelJest = stringify ? undefined : configs.babelJestTransformer;
|
||||
var isDefinitionFile = filePath.endsWith('.d.ts');
|
||||
var isJsFile = !isDefinitionFile && /\.jsx?$/.test(filePath);
|
||||
var isTsFile = isDefinitionFile || /\.tsx?$/.test(filePath);
|
||||
if (stringify) {
|
||||
result = "module.exports=" + JSON.stringify(source);
|
||||
var shouldStringifyContent = configs.shouldStringifyContent(filePath);
|
||||
var babelJest = shouldStringifyContent ? undefined : configs.babelJestTransformer;
|
||||
var isDefinitionFile = filePath.endsWith(constants_1.DECLARATION_TYPE_EXT);
|
||||
var isJsFile = constants_1.JS_JSX_REGEX.test(filePath);
|
||||
var isTsFile = !isDefinitionFile && constants_1.TS_TSX_REGEX.test(filePath);
|
||||
if (shouldStringifyContent) {
|
||||
result = "module.exports=" + json_1.stringify(source);
|
||||
}
|
||||
else if (isDefinitionFile) {
|
||||
result = '';
|
||||
}
|
||||
else if (!configs.typescript.options.allowJs && isJsFile) {
|
||||
this.logger.warn({ fileName: filePath }, messages_1.interpolate(messages_1.Errors.GotJsFileButAllowJsFalse, { path: filePath }));
|
||||
else if (!configs.parsedTsConfig.options.allowJs && isJsFile) {
|
||||
this.logger.warn({ fileName: filePath }, messages_1.interpolate("Got a `.js` file to compile while `allowJs` option is not set to `true` (file: {{path}}). To fix this:\n - if you want TypeScript to process JS files, set `allowJs` to `true` in your TypeScript config (usually tsconfig.json)\n - if you do not want TypeScript to process your `.js` files, in your Jest config change the `transform` key which value is `ts-jest` so that it does not match `.js` files anymore", { path: filePath }));
|
||||
result = source;
|
||||
}
|
||||
else if (isJsFile || isTsFile) {
|
||||
result = configs.tsCompiler.compile(source, filePath);
|
||||
}
|
||||
else {
|
||||
var message = babelJest ? messages_1.Errors.GotUnknownFileTypeWithBabel : messages_1.Errors.GotUnknownFileTypeWithoutBabel;
|
||||
var message = babelJest ? "Got a unknown file type to compile (file: {{path}}). To fix this, in your Jest config change the `transform` key which value is `ts-jest` so that it does not match this kind of files anymore. If you still want Babel to process it, add another entry to the `transform` option with value `babel-jest` which key matches this type of files." : "Got a unknown file type to compile (file: {{path}}). To fix this, in your Jest config change the `transform` key which value is `ts-jest` so that it does not match this kind of files anymore.";
|
||||
this.logger.warn({ fileName: filePath }, messages_1.interpolate(message, { path: filePath }));
|
||||
result = source;
|
||||
}
|
||||
@@ -118,15 +102,13 @@ var TsJestTransformer = (function () {
|
||||
}
|
||||
return result;
|
||||
};
|
||||
TsJestTransformer.prototype.getCacheKey = function (fileContent, filePath, jestConfigStr, transformOptions) {
|
||||
if (transformOptions === void 0) { transformOptions = {}; }
|
||||
TsJestTransformer.prototype.getCacheKey = function (fileContent, filePath, _jestConfigStr, transformOptions) {
|
||||
var configs = this.configsFor(transformOptions.config);
|
||||
this.logger.debug({ fileName: filePath, transformOptions: transformOptions }, 'computing cache key for', filePath);
|
||||
var configs = this.configsFor(jestConfigStr);
|
||||
var _a = transformOptions.instrument, instrument = _a === void 0 ? false : _a, _b = transformOptions.rootDir, rootDir = _b === void 0 ? configs.rootDir : _b;
|
||||
return sha1_1.sha1(configs.cacheKey, '\x00', rootDir, '\x00', "instrument:" + (instrument ? 'on' : 'off'), '\x00', fileContent, '\x00', filePath);
|
||||
return sha1_1.sha1(this._transformCfgStr, '\x00', rootDir, '\x00', "instrument:" + (instrument ? 'on' : 'off'), '\x00', fileContent, '\x00', filePath);
|
||||
};
|
||||
TsJestTransformer._configSetsIndex = [];
|
||||
TsJestTransformer._lastTransformerId = 0;
|
||||
TsJestTransformer._cachedConfigSets = [];
|
||||
return TsJestTransformer;
|
||||
}());
|
||||
exports.TsJestTransformer = TsJestTransformer;
|
||||
|
||||
112
node_modules/ts-jest/dist/types.d.ts
generated
vendored
112
node_modules/ts-jest/dist/types.d.ts
generated
vendored
@@ -1,113 +1,39 @@
|
||||
/// <reference types="jest" />
|
||||
import * as _babel from 'babel__core';
|
||||
import { CompilerOptions, SourceFile, TransformerFactory } from 'typescript';
|
||||
import * as _ts from 'typescript';
|
||||
import { ConfigSet } from './config/config-set';
|
||||
export declare type TBabelCore = typeof _babel;
|
||||
import type * as _babel from 'babel__core';
|
||||
import type * as _ts from 'typescript';
|
||||
export declare type TTypeScript = typeof _ts;
|
||||
export declare type TBabelJest = Required<jest.Transformer>;
|
||||
export declare type BabelJestTransformer = {
|
||||
[K in Exclude<keyof jest.Transformer, 'createTransformer'>]: Exclude<jest.Transformer[K], undefined>;
|
||||
};
|
||||
export declare type BabelConfig = _babel.TransformOptions;
|
||||
export interface AstTransformer<T = Record<string, unknown>> {
|
||||
path: string;
|
||||
options?: T;
|
||||
}
|
||||
export interface ConfigCustomTransformer {
|
||||
before?: (string | AstTransformer)[];
|
||||
after?: (string | AstTransformer)[];
|
||||
afterDeclarations?: (string | AstTransformer)[];
|
||||
}
|
||||
export interface TsJestGlobalOptions {
|
||||
tsConfig?: boolean | string | CompilerOptions;
|
||||
packageJson?: boolean | string | object;
|
||||
tsConfig?: boolean | string | _ts.CompilerOptions;
|
||||
tsconfig?: boolean | string | _ts.CompilerOptions;
|
||||
packageJson?: boolean | string | Record<string, unknown>;
|
||||
isolatedModules?: boolean;
|
||||
compiler?: string;
|
||||
astTransformers?: string[];
|
||||
astTransformers?: string[] | ConfigCustomTransformer;
|
||||
diagnostics?: boolean | {
|
||||
pretty?: boolean;
|
||||
ignoreCodes?: number | string | Array<number | string>;
|
||||
ignoreCodes?: number | string | (number | string)[];
|
||||
pathRegex?: RegExp | string;
|
||||
warnOnly?: boolean;
|
||||
};
|
||||
babelConfig?: boolean | string | BabelConfig;
|
||||
stringifyContentPathRegex?: string | RegExp;
|
||||
}
|
||||
interface TsJestConfig$tsConfig$file {
|
||||
kind: 'file';
|
||||
value: string | undefined;
|
||||
}
|
||||
interface TsJestConfig$tsConfig$inline {
|
||||
kind: 'inline';
|
||||
value: CompilerOptions;
|
||||
}
|
||||
declare type TsJestConfig$tsConfig = TsJestConfig$tsConfig$file | TsJestConfig$tsConfig$inline | undefined;
|
||||
interface TsJestConfig$diagnostics {
|
||||
export interface TsJestDiagnosticsCfg {
|
||||
pretty: boolean;
|
||||
ignoreCodes: number[];
|
||||
pathRegex?: string | undefined;
|
||||
throws: boolean;
|
||||
}
|
||||
interface TsJestConfig$babelConfig$file {
|
||||
kind: 'file';
|
||||
value: string | undefined;
|
||||
}
|
||||
interface TsJestConfig$babelConfig$inline {
|
||||
kind: 'inline';
|
||||
value: BabelConfig;
|
||||
}
|
||||
declare type TsJestConfig$babelConfig = TsJestConfig$babelConfig$file | TsJestConfig$babelConfig$inline | undefined;
|
||||
interface TsJestConfig$packageJson$file {
|
||||
kind: 'file';
|
||||
value: string | undefined;
|
||||
}
|
||||
interface TsJestConfig$packageJson$inline {
|
||||
kind: 'inline';
|
||||
value: any;
|
||||
}
|
||||
declare type TsJestConfig$packageJson = TsJestConfig$packageJson$file | TsJestConfig$packageJson$inline | undefined;
|
||||
declare type TsJestConfig$stringifyContentPathRegex = string | undefined;
|
||||
export interface TsJestConfig {
|
||||
tsConfig: TsJestConfig$tsConfig;
|
||||
packageJson: TsJestConfig$packageJson;
|
||||
isolatedModules: boolean;
|
||||
compiler: string;
|
||||
diagnostics: TsJestConfig$diagnostics;
|
||||
babelConfig: TsJestConfig$babelConfig;
|
||||
transformers: string[];
|
||||
stringifyContentPathRegex: TsJestConfig$stringifyContentPathRegex;
|
||||
}
|
||||
export interface TsJestHooksMap {
|
||||
afterProcess?(args: any[], result: string | jest.TransformedSource): string | jest.TransformedSource | void;
|
||||
}
|
||||
export interface TSCommon {
|
||||
version: typeof _ts.version;
|
||||
sys: typeof _ts.sys;
|
||||
ScriptSnapshot: typeof _ts.ScriptSnapshot;
|
||||
displayPartsToString: typeof _ts.displayPartsToString;
|
||||
createLanguageService: typeof _ts.createLanguageService;
|
||||
getDefaultLibFilePath: typeof _ts.getDefaultLibFilePath;
|
||||
getPreEmitDiagnostics: typeof _ts.getPreEmitDiagnostics;
|
||||
flattenDiagnosticMessageText: typeof _ts.flattenDiagnosticMessageText;
|
||||
transpileModule: typeof _ts.transpileModule;
|
||||
ModuleKind: typeof _ts.ModuleKind;
|
||||
ScriptTarget: typeof _ts.ScriptTarget;
|
||||
findConfigFile: typeof _ts.findConfigFile;
|
||||
readConfigFile: typeof _ts.readConfigFile;
|
||||
parseJsonConfigFileContent: typeof _ts.parseJsonConfigFileContent;
|
||||
formatDiagnostics: typeof _ts.formatDiagnostics;
|
||||
formatDiagnosticsWithColorAndContext: typeof _ts.formatDiagnosticsWithColorAndContext;
|
||||
}
|
||||
export interface TypeInfo {
|
||||
name: string;
|
||||
comment: string;
|
||||
warnOnly?: boolean;
|
||||
}
|
||||
export interface TsCompiler {
|
||||
cwd: string;
|
||||
extensions: string[];
|
||||
cachedir: string | undefined;
|
||||
ts: TSCommon;
|
||||
compile(code: string, fileName: string, lineOffset?: number): string;
|
||||
getTypeInfo(code: string, fileName: string, position: number): TypeInfo;
|
||||
program: _ts.Program | undefined;
|
||||
}
|
||||
export interface AstTransformerDesc {
|
||||
name: string;
|
||||
version: number;
|
||||
factory(cs: ConfigSet): TransformerFactory<SourceFile>;
|
||||
}
|
||||
export interface IPackageJson {
|
||||
main: string;
|
||||
}
|
||||
export {};
|
||||
|
||||
3
node_modules/ts-jest/dist/util/exported.d.ts
generated
vendored
3
node_modules/ts-jest/dist/util/exported.d.ts
generated
vendored
@@ -1,3 +0,0 @@
|
||||
export { mocked } from './testing';
|
||||
export { createJestPreset } from '../config/create-jest-preset';
|
||||
export { pathsToModuleNameMapper } from '../config/paths-to-module-name-mapper';
|
||||
8
node_modules/ts-jest/dist/util/exported.js
generated
vendored
8
node_modules/ts-jest/dist/util/exported.js
generated
vendored
@@ -1,8 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var testing_1 = require("./testing");
|
||||
exports.mocked = testing_1.mocked;
|
||||
var create_jest_preset_1 = require("../config/create-jest-preset");
|
||||
exports.createJestPreset = create_jest_preset_1.createJestPreset;
|
||||
var paths_to_module_name_mapper_1 = require("../config/paths-to-module-name-mapper");
|
||||
exports.pathsToModuleNameMapper = paths_to_module_name_mapper_1.pathsToModuleNameMapper;
|
||||
47
node_modules/ts-jest/dist/util/messages.js
generated
vendored
47
node_modules/ts-jest/dist/util/messages.js
generated
vendored
@@ -1,47 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Errors;
|
||||
(function (Errors) {
|
||||
Errors["LoadingModuleFailed"] = "Loading module {{module}} failed with error: {{error}}";
|
||||
Errors["UnableToLoadOneModule"] = "Unable to load the module {{module}}. {{reason}} To fix it:\n{{fix}}";
|
||||
Errors["UnableToLoadAnyModule"] = "Unable to load any of these modules: {{module}}. {{reason}}. To fix it:\n{{fix}}";
|
||||
Errors["TypesUnavailableWithoutTypeCheck"] = "Type information is unavailable with \"isolatedModules\"";
|
||||
Errors["UnableToRequireDefinitionFile"] = "Unable to require `.d.ts` file.\nThis is usually the result of a faulty configuration or import. Make sure there is a `.js`, `.json` or another executable extension available alongside `{{file}}`.";
|
||||
Errors["FileNotFound"] = "File not found: {{inputPath}} (resolved as: {{resolvedPath}})";
|
||||
Errors["UntestedDependencyVersion"] = "Version {{actualVersion}} of {{module}} installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version ({{expectedVersion}}). Please do not report issues in ts-jest if you are using unsupported versions.";
|
||||
Errors["MissingDependency"] = "Module {{module}} is not installed. If you're experiencing issues, consider installing a supported version ({{expectedVersion}}).";
|
||||
Errors["UnableToCompileTypeScript"] = "TypeScript diagnostics ({{help}}):\n{{diagnostics}}";
|
||||
Errors["NotMappingMultiStarPath"] = "Not mapping \"{{path}}\" because it has more than one star (`*`).";
|
||||
Errors["NotMappingPathWithEmptyMap"] = "Not mapping \"{{path}}\" because it has no target.";
|
||||
Errors["MappingOnlyFirstTargetOfPath"] = "Mapping only to first target of \"{{path}}\" because it has more than one ({{count}}).";
|
||||
Errors["GotJsFileButAllowJsFalse"] = "Got a `.js` file to compile while `allowJs` option is not set to `true` (file: {{path}}). To fix this:\n - if you want TypeScript to process JS files, set `allowJs` to `true` in your TypeScript config (usually tsconfig.json)\n - if you do not want TypeScript to process your `.js` files, in your Jest config change the `transform` key which value is `ts-jest` so that it does not match `.js` files anymore";
|
||||
Errors["GotUnknownFileTypeWithoutBabel"] = "Got a unknown file type to compile (file: {{path}}). To fix this, in your Jest config change the `transform` key which value is `ts-jest` so that it does not match this kind of files anymore.";
|
||||
Errors["GotUnknownFileTypeWithBabel"] = "Got a unknown file type to compile (file: {{path}}). To fix this, in your Jest config change the `transform` key which value is `ts-jest` so that it does not match this kind of files anymore. If you still want Babel to process it, add another entry to the `transform` option with value `babel-jest` which key matches this type of files.";
|
||||
Errors["ConfigNoModuleInterop"] = "If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.";
|
||||
Errors["UnableToFindProjectRoot"] = "Unable to find the root of the project where ts-jest has been installed.";
|
||||
Errors["UnableToResolveJestConfig"] = "Unable to resolve jest-config. Ensure Jest is properly installed.";
|
||||
})(Errors = exports.Errors || (exports.Errors = {}));
|
||||
var Helps;
|
||||
(function (Helps) {
|
||||
Helps["FixMissingModule"] = "{{label}}: `npm i -D {{module}}` (or `yarn add --dev {{module}}`)";
|
||||
Helps["IgnoreDiagnosticCode"] = "customize using `[jest-config].globals.ts-jest.diagnostics` option";
|
||||
Helps["MigrateConfigUsingCLI"] = "Your Jest configuration is outdated. Use the CLI to help migrating it: ts-jest config:migrate <config-file>.";
|
||||
})(Helps = exports.Helps || (exports.Helps = {}));
|
||||
var Deprecateds;
|
||||
(function (Deprecateds) {
|
||||
Deprecateds["EnvVar"] = "Using env. var \"{{old}}\" is deprecated, use \"{{new}}\" instead.";
|
||||
Deprecateds["ConfigOption"] = "\"[jest-config].{{oldPath}}\" is deprecated, use \"[jest-config].{{newPath}}\" instead.";
|
||||
Deprecateds["ConfigOptionWithNote"] = "\"[jest-config].{{oldPath}}\" is deprecated, use \"[jest-config].{{newPath}}\" instead.\n \u21B3 {{note}}";
|
||||
Deprecateds["ConfigOptionUseBabelRcNote"] = "See `babel-jest` related issue: https://github.com/facebook/jest/issues/3845";
|
||||
Deprecateds["HelperMovedToUtils"] = "The `{{helper}}` helper has been moved to `ts-jest/utils`. Use `import { {{helper}} } from 'ts-jest/utils'` instead.";
|
||||
})(Deprecateds = exports.Deprecateds || (exports.Deprecateds = {}));
|
||||
var ImportReasons;
|
||||
(function (ImportReasons) {
|
||||
ImportReasons["TsJest"] = "Using \"ts-jest\" requires this package to be installed.";
|
||||
ImportReasons["BabelJest"] = "Using \"babel-jest\" requires this package to be installed.";
|
||||
})(ImportReasons = exports.ImportReasons || (exports.ImportReasons = {}));
|
||||
function interpolate(msg, vars) {
|
||||
if (vars === void 0) { vars = {}; }
|
||||
return msg.replace(/\{\{([^\}]+)\}\}/g, function (_, key) { return (key in vars ? vars[key] : _); });
|
||||
}
|
||||
exports.interpolate = interpolate;
|
||||
63
node_modules/ts-jest/dist/util/version-checkers.js
generated
vendored
63
node_modules/ts-jest/dist/util/version-checkers.js
generated
vendored
@@ -1,63 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var semver_1 = require("semver");
|
||||
var get_package_version_1 = require("./get-package-version");
|
||||
var logger_1 = require("./logger");
|
||||
var messages_1 = require("./messages");
|
||||
var logger = logger_1.rootLogger.child({ namespace: 'versions' });
|
||||
var ExpectedVersions;
|
||||
(function (ExpectedVersions) {
|
||||
ExpectedVersions["Jest"] = ">=24 <25";
|
||||
ExpectedVersions["TypeScript"] = ">=2.7 <4";
|
||||
ExpectedVersions["BabelJest"] = ">=24 <25";
|
||||
ExpectedVersions["BabelCore"] = ">=7.0.0-beta.0 <8";
|
||||
})(ExpectedVersions = exports.ExpectedVersions || (exports.ExpectedVersions = {}));
|
||||
exports.VersionCheckers = {
|
||||
jest: createVersionChecker('jest', ExpectedVersions.Jest),
|
||||
typescript: createVersionChecker('typescript', ExpectedVersions.TypeScript),
|
||||
babelJest: createVersionChecker('babel-jest', ExpectedVersions.BabelJest),
|
||||
babelCore: createVersionChecker('@babel/core', ExpectedVersions.BabelCore),
|
||||
};
|
||||
function checkVersion(name, expectedRange, action) {
|
||||
if (action === void 0) { action = 'warn'; }
|
||||
var version = get_package_version_1.getPackageVersion(name);
|
||||
var success = !!version && semver_1.satisfies(version, expectedRange);
|
||||
logger.debug({
|
||||
actualVersion: version,
|
||||
expectedVersion: expectedRange,
|
||||
}, 'checking version of %s: %s', name, success ? 'OK' : 'NOT OK');
|
||||
if (!action || success)
|
||||
return success;
|
||||
var message = messages_1.interpolate(version ? messages_1.Errors.UntestedDependencyVersion : messages_1.Errors.MissingDependency, {
|
||||
module: name,
|
||||
actualVersion: version || '??',
|
||||
expectedVersion: rangeToHumanString(expectedRange),
|
||||
});
|
||||
if (action === 'warn') {
|
||||
logger.warn(message);
|
||||
}
|
||||
else if (action === 'throw') {
|
||||
logger.fatal(message);
|
||||
throw new RangeError(message);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
function rangeToHumanString(versionRange) {
|
||||
return new semver_1.Range(versionRange).toString();
|
||||
}
|
||||
function createVersionChecker(moduleName, expectedVersion) {
|
||||
var memo;
|
||||
var warn = function () {
|
||||
if (memo !== undefined)
|
||||
return memo;
|
||||
return (memo = checkVersion(moduleName, expectedVersion, 'warn'));
|
||||
};
|
||||
var raise = function () { return checkVersion(moduleName, expectedVersion, 'throw'); };
|
||||
return {
|
||||
raise: raise,
|
||||
warn: warn,
|
||||
forget: function () {
|
||||
memo = undefined;
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -12,6 +12,7 @@ var __assign = (this && this.__assign) || function () {
|
||||
};
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.backportTsJestDebugEnvVar = exports.backportJestConfig = void 0;
|
||||
var bs_logger_1 = require("bs-logger");
|
||||
var messages_1 = require("./messages");
|
||||
var context = (_a = {}, _a[bs_logger_1.LogContexts.namespace] = 'backports', _a);
|
||||
@@ -23,7 +24,7 @@ exports.backportJestConfig = function (logger, config) {
|
||||
var hadWarnings = false;
|
||||
var warnConfig = function (oldPath, newPath, note) {
|
||||
hadWarnings = true;
|
||||
logger.warn(context, messages_1.interpolate(note ? messages_1.Deprecateds.ConfigOptionWithNote : messages_1.Deprecateds.ConfigOption, {
|
||||
logger.warn(context, messages_1.interpolate(note ? "\"[jest-config].{{oldPath}}\" is deprecated, use \"[jest-config].{{newPath}}\" instead.\n \u21B3 {{note}}" : "\"[jest-config].{{oldPath}}\" is deprecated, use \"[jest-config].{{newPath}}\" instead.", {
|
||||
oldPath: oldPath,
|
||||
newPath: newPath,
|
||||
note: note,
|
||||
@@ -68,7 +69,7 @@ exports.backportJestConfig = function (logger, config) {
|
||||
delete tsJest.enableTsDiagnostics;
|
||||
}
|
||||
if ('useBabelrc' in tsJest) {
|
||||
warnConfig('globals.ts-jest.useBabelrc', 'globals.ts-jest.babelConfig', messages_1.Deprecateds.ConfigOptionUseBabelRcNote);
|
||||
warnConfig('globals.ts-jest.useBabelrc', 'globals.ts-jest.babelConfig', "See `babel-jest` related issue: https://github.com/facebook/jest/issues/3845");
|
||||
if (tsJest.useBabelrc != null) {
|
||||
mergeTsJest.babelConfig = tsJest.useBabelrc ? true : {};
|
||||
}
|
||||
@@ -82,7 +83,7 @@ exports.backportJestConfig = function (logger, config) {
|
||||
delete tsJest.skipBabel;
|
||||
}
|
||||
if (hadWarnings) {
|
||||
logger.warn(context, messages_1.Helps.MigrateConfigUsingCLI);
|
||||
logger.warn(context, "Your Jest configuration is outdated. Use the CLI to help migrating it: ts-jest config:migrate <config-file>.");
|
||||
}
|
||||
return __assign(__assign({}, config), { globals: __assign(__assign({}, globals), { 'ts-jest': __assign(__assign({}, mergeTsJest), tsJest) }) });
|
||||
};
|
||||
@@ -91,9 +92,9 @@ exports.backportTsJestDebugEnvVar = function (logger) {
|
||||
var shouldLog = !/^\s*(?:0|f(?:alse)?|no?|disabled?|off|)\s*$/i.test(process.env.TS_JEST_DEBUG || '');
|
||||
delete process.env.TS_JEST_DEBUG;
|
||||
if (shouldLog) {
|
||||
process.env.TS_JEST_LOG = "ts-jest.log,stderr:warn";
|
||||
process.env.TS_JEST_LOG = 'ts-jest.log,stderr:warn';
|
||||
}
|
||||
logger.warn(context, messages_1.interpolate(messages_1.Deprecateds.EnvVar, {
|
||||
logger.warn(context, messages_1.interpolate("Using env. var \"{{old}}\" is deprecated, use \"{{new}}\" instead.", {
|
||||
old: 'TS_JEST_DEBUG',
|
||||
new: 'TS_JEST_LOG',
|
||||
}));
|
||||
@@ -1,5 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getPackageVersion = void 0;
|
||||
function getPackageVersion(moduleName) {
|
||||
try {
|
||||
return require(moduleName + "/package.json").version;
|
||||
22
node_modules/ts-jest/dist/util/importer.js → node_modules/ts-jest/dist/utils/importer.js
generated
vendored
22
node_modules/ts-jest/dist/util/importer.js → node_modules/ts-jest/dist/utils/importer.js
generated
vendored
@@ -37,6 +37,7 @@ var __spread = (this && this.__spread) || function () {
|
||||
return ar;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.__requireModule = exports.importer = exports.Importer = void 0;
|
||||
var logger_1 = require("./logger");
|
||||
var memoize_1 = require("./memoize");
|
||||
var messages_1 = require("./messages");
|
||||
@@ -61,7 +62,7 @@ var Importer = (function () {
|
||||
jest: [passThru(version_checkers_1.VersionCheckers.jest.warn)],
|
||||
});
|
||||
},
|
||||
enumerable: true,
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
Importer.prototype.babelJest = function (why) {
|
||||
@@ -128,17 +129,15 @@ var Importer = (function () {
|
||||
if (res && res.exists) {
|
||||
if (!res.error)
|
||||
return res.exports;
|
||||
throw new Error(messages_1.interpolate(messages_1.Errors.LoadingModuleFailed, { module: res.given, error: res.error.message }));
|
||||
throw new Error(messages_1.interpolate("Loading module {{module}} failed with error: {{error}}", { module: res.given, error: res.error.message }));
|
||||
}
|
||||
var msg = alternatives.length ? messages_1.Errors.UnableToLoadAnyModule : messages_1.Errors.UnableToLoadOneModule;
|
||||
var msg = alternatives.length ? "Unable to load any of these modules: {{module}}. {{reason}}. To fix it:\n{{fix}}" : "Unable to load the module {{module}}. {{reason}} To fix it:\n{{fix}}";
|
||||
var loadModule = __spread([moduleName], alternatives).map(function (m) { return "\"" + m + "\""; }).join(', ');
|
||||
if (typeof installTip === 'string') {
|
||||
installTip = [{ module: installTip, label: "install \"" + installTip + "\"" }];
|
||||
}
|
||||
var fix = installTip
|
||||
.map(function (tip) {
|
||||
return " " + (installTip.length === 1 ? '↳' : '•') + " " + messages_1.interpolate(messages_1.Helps.FixMissingModule, tip);
|
||||
})
|
||||
.map(function (tip) { return " " + (installTip.length === 1 ? '↳' : '•') + " " + messages_1.interpolate("{{label}}: `npm i -D {{module}}` (or `yarn add --dev {{module}}`)", tip); })
|
||||
.join('\n');
|
||||
throw new Error(messages_1.interpolate(msg, {
|
||||
module: loadModule,
|
||||
@@ -177,15 +176,20 @@ function requireWrapper(moduleName) {
|
||||
}
|
||||
var result = { exists: exists, path: path, given: moduleName };
|
||||
try {
|
||||
result.exports = requireModule(moduleName);
|
||||
result.exports = requireModule(path);
|
||||
}
|
||||
catch (error) {
|
||||
result.error = error;
|
||||
try {
|
||||
result.exports = requireModule(moduleName);
|
||||
}
|
||||
catch (error) {
|
||||
result.error = error;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
var requireModule = function (mod) { return require(mod); };
|
||||
var resolveModule = function (mod) { return require.resolve(mod); };
|
||||
var resolveModule = function (mod) { return require.resolve(mod, { paths: [process.cwd(), __dirname] }); };
|
||||
function __requireModule(localRequire, localResolve) {
|
||||
requireModule = localRequire;
|
||||
resolveModule = localResolve;
|
||||
2
node_modules/ts-jest/dist/utils/json.d.ts
generated
vendored
Normal file
2
node_modules/ts-jest/dist/utils/json.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export declare function stringify(input: unknown): string;
|
||||
export declare function parse(input: string): any;
|
||||
1
node_modules/ts-jest/dist/util/json.js → node_modules/ts-jest/dist/utils/json.js
generated
vendored
1
node_modules/ts-jest/dist/util/json.js → node_modules/ts-jest/dist/utils/json.js
generated
vendored
@@ -1,5 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.normalize = exports.parse = exports.stringify = void 0;
|
||||
var stableStringify = require("fast-json-stable-stringify");
|
||||
var UNDEFINED = 'undefined';
|
||||
function stringify(input) {
|
||||
10
node_modules/ts-jest/dist/utils/jsonable-value.d.ts
generated
vendored
Normal file
10
node_modules/ts-jest/dist/utils/jsonable-value.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
export declare class JsonableValue<V = Record<string, any>> {
|
||||
private _serialized;
|
||||
private _value;
|
||||
constructor(value: V);
|
||||
set value(value: V);
|
||||
get value(): V;
|
||||
get serialized(): string;
|
||||
valueOf(): V;
|
||||
toString(): string;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.JsonableValue = void 0;
|
||||
var json_1 = require("./json");
|
||||
var JsonableValue = (function () {
|
||||
function JsonableValue(value) {
|
||||
@@ -13,14 +14,14 @@ var JsonableValue = (function () {
|
||||
this._value = value;
|
||||
this._serialized = json_1.stringify(value);
|
||||
},
|
||||
enumerable: true,
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(JsonableValue.prototype, "serialized", {
|
||||
get: function () {
|
||||
return this._serialized;
|
||||
},
|
||||
enumerable: true,
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
JsonableValue.prototype.valueOf = function () {
|
||||
1
node_modules/ts-jest/dist/util/logger.js → node_modules/ts-jest/dist/utils/logger.js
generated
vendored
1
node_modules/ts-jest/dist/util/logger.js → node_modules/ts-jest/dist/utils/logger.js
generated
vendored
@@ -1,5 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.rootLogger = void 0;
|
||||
var bs_logger_1 = require("bs-logger");
|
||||
var backports_1 = require("./backports");
|
||||
var original = process.env.TS_JEST_LOG;
|
||||
@@ -1,5 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Memoize = void 0;
|
||||
var cacheProp = Symbol.for('[memoize]');
|
||||
function Memoize(keyBuilder) {
|
||||
return function (_, propertyKey, descriptor) {
|
||||
8
node_modules/ts-jest/dist/utils/messages.js
generated
vendored
Normal file
8
node_modules/ts-jest/dist/utils/messages.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.interpolate = void 0;
|
||||
function interpolate(msg, vars) {
|
||||
if (vars === void 0) { vars = {}; }
|
||||
return msg.replace(/\{\{([^\}]+)\}\}/g, function (_, key) { return (key in vars ? vars[key] : _); });
|
||||
}
|
||||
exports.interpolate = interpolate;
|
||||
@@ -1,5 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.normalizeSlashes = void 0;
|
||||
function normalizeSlashes(value) {
|
||||
return value.replace(/\\/g, '/');
|
||||
}
|
||||
0
node_modules/ts-jest/dist/util/sha1.d.ts → node_modules/ts-jest/dist/utils/sha1.d.ts
generated
vendored
0
node_modules/ts-jest/dist/util/sha1.d.ts → node_modules/ts-jest/dist/utils/sha1.d.ts
generated
vendored
1
node_modules/ts-jest/dist/util/sha1.js → node_modules/ts-jest/dist/utils/sha1.js
generated
vendored
1
node_modules/ts-jest/dist/util/sha1.js → node_modules/ts-jest/dist/utils/sha1.js
generated
vendored
@@ -1,5 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.sha1 = exports.cache = void 0;
|
||||
var crypto_1 = require("crypto");
|
||||
exports.cache = Object.create(null);
|
||||
function sha1() {
|
||||
@@ -1,28 +1,28 @@
|
||||
/// <reference types="jest" />
|
||||
declare type MockableFunction = (...args: any[]) => any;
|
||||
declare type MethodKeysOf<T> = {
|
||||
export declare type MockableFunction = (...args: any[]) => any;
|
||||
export declare type MethodKeysOf<T> = {
|
||||
[K in keyof T]: T[K] extends MockableFunction ? K : never;
|
||||
}[keyof T];
|
||||
declare type PropertyKeysOf<T> = {
|
||||
export declare type PropertyKeysOf<T> = {
|
||||
[K in keyof T]: T[K] extends MockableFunction ? never : K;
|
||||
}[keyof T];
|
||||
declare type ArgumentsOf<T> = T extends (...args: infer A) => any ? A : never;
|
||||
declare type ConstructorArgumentsOf<T> = T extends new (...args: infer A) => any ? A : never;
|
||||
interface MockWithArgs<T extends MockableFunction> extends jest.MockInstance<ReturnType<T>, ArgumentsOf<T>> {
|
||||
export declare type ArgumentsOf<T> = T extends (...args: infer A) => any ? A : never;
|
||||
export declare type ConstructorArgumentsOf<T> = T extends new (...args: infer A) => any ? A : never;
|
||||
export interface MockWithArgs<T extends MockableFunction> extends jest.MockInstance<ReturnType<T>, ArgumentsOf<T>> {
|
||||
new (...args: ConstructorArgumentsOf<T>): T;
|
||||
(...args: ArgumentsOf<T>): ReturnType<T>;
|
||||
}
|
||||
declare type MaybeMockedConstructor<T> = T extends new (...args: any[]) => infer R ? jest.MockInstance<R, ConstructorArgumentsOf<T>> : {};
|
||||
declare type MockedFunction<T extends MockableFunction> = MockWithArgs<T> & {
|
||||
export declare type MaybeMockedConstructor<T> = T extends new (...args: any[]) => infer R ? jest.MockInstance<R, ConstructorArgumentsOf<T>> : T;
|
||||
export declare type MockedFunction<T extends MockableFunction> = MockWithArgs<T> & {
|
||||
[K in keyof T]: T[K];
|
||||
};
|
||||
declare type MockedFunctionDeep<T extends MockableFunction> = MockWithArgs<T> & MockedObjectDeep<T>;
|
||||
declare type MockedObject<T> = MaybeMockedConstructor<T> & {
|
||||
export declare type MockedFunctionDeep<T extends MockableFunction> = MockWithArgs<T> & MockedObjectDeep<T>;
|
||||
export declare type MockedObject<T> = MaybeMockedConstructor<T> & {
|
||||
[K in MethodKeysOf<T>]: T[K] extends MockableFunction ? MockedFunction<T[K]> : T[K];
|
||||
} & {
|
||||
[K in PropertyKeysOf<T>]: T[K];
|
||||
};
|
||||
declare type MockedObjectDeep<T> = MaybeMockedConstructor<T> & {
|
||||
export declare type MockedObjectDeep<T> = MaybeMockedConstructor<T> & {
|
||||
[K in MethodKeysOf<T>]: T[K] extends MockableFunction ? MockedFunctionDeep<T[K]> : T[K];
|
||||
} & {
|
||||
[K in PropertyKeysOf<T>]: MaybeMockedDeep<T[K]>;
|
||||
@@ -31,4 +31,3 @@ export declare type MaybeMockedDeep<T> = T extends MockableFunction ? MockedFunc
|
||||
export declare type MaybeMocked<T> = T extends MockableFunction ? MockedFunction<T> : T extends object ? MockedObject<T> : T;
|
||||
export declare function mocked<T>(item: T, deep?: false): MaybeMocked<T>;
|
||||
export declare function mocked<T>(item: T, deep: true): MaybeMockedDeep<T>;
|
||||
export {};
|
||||
@@ -1,5 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.mocked = void 0;
|
||||
function mocked(item, _deep) {
|
||||
if (_deep === void 0) { _deep = false; }
|
||||
return item;
|
||||
@@ -3,7 +3,7 @@ var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
@@ -13,6 +13,7 @@ var __extends = (this && this.__extends) || (function () {
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TSError = exports.INSPECT_CUSTOM = void 0;
|
||||
var make_error_1 = require("make-error");
|
||||
var util_1 = require("util");
|
||||
var logger_1 = require("./logger");
|
||||
@@ -22,9 +23,8 @@ exports.INSPECT_CUSTOM = util_1.inspect.custom || 'inspect';
|
||||
var TSError = (function (_super) {
|
||||
__extends(TSError, _super);
|
||||
function TSError(diagnosticText, diagnosticCodes) {
|
||||
var _this = _super.call(this, messages_1.interpolate(messages_1.Errors.UnableToCompileTypeScript, {
|
||||
var _this = _super.call(this, messages_1.interpolate("{{diagnostics}}", {
|
||||
diagnostics: diagnosticText.trim(),
|
||||
help: messages_1.Helps.IgnoreDiagnosticCode,
|
||||
})) || this;
|
||||
_this.diagnosticText = diagnosticText;
|
||||
_this.diagnosticCodes = diagnosticCodes;
|
||||
60
node_modules/ts-jest/dist/utils/version-checkers.js
generated
vendored
Normal file
60
node_modules/ts-jest/dist/utils/version-checkers.js
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.VersionCheckers = void 0;
|
||||
var semver_1 = require("semver");
|
||||
var get_package_version_1 = require("./get-package-version");
|
||||
var logger_1 = require("./logger");
|
||||
var messages_1 = require("./messages");
|
||||
var logger = logger_1.rootLogger.child({ namespace: 'versions' });
|
||||
exports.VersionCheckers = {
|
||||
jest: createVersionChecker('jest', ">=26 <27"),
|
||||
typescript: createVersionChecker('typescript', ">=3.8 <5"),
|
||||
babelJest: createVersionChecker('babel-jest', ">=26 <27"),
|
||||
babelCore: createVersionChecker('@babel/core', ">=7.0.0-beta.0 <8"),
|
||||
};
|
||||
function checkVersion(name, expectedRange, action) {
|
||||
if (action === void 0) { action = 'warn'; }
|
||||
var success = true;
|
||||
if (!('TS_JEST_DISABLE_VER_CHECKER' in process.env)) {
|
||||
var version = get_package_version_1.getPackageVersion(name);
|
||||
success = !!version && semver_1.satisfies(version, expectedRange);
|
||||
logger.debug({
|
||||
actualVersion: version,
|
||||
expectedVersion: expectedRange,
|
||||
}, 'checking version of %s: %s', name, success ? 'OK' : 'NOT OK');
|
||||
if (!action || success)
|
||||
return success;
|
||||
var message = messages_1.interpolate(version ? "Version {{actualVersion}} of {{module}} installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version ({{expectedVersion}}). Please do not report issues in ts-jest if you are using unsupported versions." : "Module {{module}} is not installed. If you're experiencing issues, consider installing a supported version ({{expectedVersion}}).", {
|
||||
module: name,
|
||||
actualVersion: version || '??',
|
||||
expectedVersion: rangeToHumanString(expectedRange),
|
||||
});
|
||||
if (action === 'warn') {
|
||||
logger.warn(message);
|
||||
}
|
||||
else if (action === 'throw') {
|
||||
logger.fatal(message);
|
||||
throw new RangeError(message);
|
||||
}
|
||||
}
|
||||
return success;
|
||||
}
|
||||
function rangeToHumanString(versionRange) {
|
||||
return new semver_1.Range(versionRange).toString();
|
||||
}
|
||||
function createVersionChecker(moduleName, expectedVersion) {
|
||||
var memo;
|
||||
var warn = function () {
|
||||
if (memo !== undefined)
|
||||
return memo;
|
||||
return (memo = checkVersion(moduleName, expectedVersion, 'warn'));
|
||||
};
|
||||
var raise = function () { return checkVersion(moduleName, expectedVersion, 'throw'); };
|
||||
return {
|
||||
raise: raise,
|
||||
warn: warn,
|
||||
forget: function () {
|
||||
memo = undefined;
|
||||
},
|
||||
};
|
||||
}
|
||||
2
node_modules/ts-jest/jest-preset.js
generated
vendored
2
node_modules/ts-jest/jest-preset.js
generated
vendored
@@ -1 +1 @@
|
||||
module.exports = require('./presets/default/jest-preset')
|
||||
module.exports = require('./presets').defaults
|
||||
|
||||
1
node_modules/ts-jest/node_modules/.bin/semver
generated
vendored
Symbolic link
1
node_modules/ts-jest/node_modules/.bin/semver
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../semver/bin/semver.js
|
||||
@@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
191
node_modules/ts-jest/node_modules/@jest/types/build/Circus.d.ts
generated
vendored
Normal file
191
node_modules/ts-jest/node_modules/@jest/types/build/Circus.d.ts
generated
vendored
Normal file
@@ -0,0 +1,191 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import type * as Global from './Global';
|
||||
declare type Process = NodeJS.Process;
|
||||
export declare type DoneFn = Global.DoneFn;
|
||||
export declare type BlockFn = Global.BlockFn;
|
||||
export declare type BlockName = Global.BlockName;
|
||||
export declare type BlockMode = void | 'skip' | 'only' | 'todo';
|
||||
export declare type TestMode = BlockMode;
|
||||
export declare type TestName = Global.TestName;
|
||||
export declare type TestFn = Global.TestFn;
|
||||
export declare type HookFn = Global.HookFn;
|
||||
export declare type AsyncFn = TestFn | HookFn;
|
||||
export declare type SharedHookType = 'afterAll' | 'beforeAll';
|
||||
export declare type HookType = SharedHookType | 'afterEach' | 'beforeEach';
|
||||
export declare type TestContext = Record<string, unknown>;
|
||||
export declare type Exception = any;
|
||||
export declare type FormattedError = string;
|
||||
export declare type Hook = {
|
||||
asyncError: Error;
|
||||
fn: HookFn;
|
||||
type: HookType;
|
||||
parent: DescribeBlock;
|
||||
timeout: number | undefined | null;
|
||||
};
|
||||
export interface EventHandler {
|
||||
(event: AsyncEvent, state: State): void | Promise<void>;
|
||||
(event: SyncEvent, state: State): void;
|
||||
}
|
||||
export declare type Event = SyncEvent | AsyncEvent;
|
||||
interface JestGlobals extends Global.TestFrameworkGlobals {
|
||||
expect: unknown;
|
||||
}
|
||||
export declare type SyncEvent = {
|
||||
asyncError: Error;
|
||||
mode: BlockMode;
|
||||
name: 'start_describe_definition';
|
||||
blockName: BlockName;
|
||||
} | {
|
||||
mode: BlockMode;
|
||||
name: 'finish_describe_definition';
|
||||
blockName: BlockName;
|
||||
} | {
|
||||
asyncError: Error;
|
||||
name: 'add_hook';
|
||||
hookType: HookType;
|
||||
fn: HookFn;
|
||||
timeout: number | undefined;
|
||||
} | {
|
||||
asyncError: Error;
|
||||
name: 'add_test';
|
||||
testName: TestName;
|
||||
fn: TestFn;
|
||||
mode?: TestMode;
|
||||
timeout: number | undefined;
|
||||
} | {
|
||||
name: 'error';
|
||||
error: Exception;
|
||||
};
|
||||
export declare type AsyncEvent = {
|
||||
name: 'setup';
|
||||
testNamePattern?: string;
|
||||
runtimeGlobals: JestGlobals;
|
||||
parentProcess: Process;
|
||||
} | {
|
||||
name: 'include_test_location_in_result';
|
||||
} | {
|
||||
name: 'hook_start';
|
||||
hook: Hook;
|
||||
} | {
|
||||
name: 'hook_success';
|
||||
describeBlock?: DescribeBlock;
|
||||
test?: TestEntry;
|
||||
hook: Hook;
|
||||
} | {
|
||||
name: 'hook_failure';
|
||||
error: string | Exception;
|
||||
describeBlock?: DescribeBlock;
|
||||
test?: TestEntry;
|
||||
hook: Hook;
|
||||
} | {
|
||||
name: 'test_fn_start';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_fn_success';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_fn_failure';
|
||||
error: Exception;
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_retry';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_start';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_skip';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_todo';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_done';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'run_describe_start';
|
||||
describeBlock: DescribeBlock;
|
||||
} | {
|
||||
name: 'run_describe_finish';
|
||||
describeBlock: DescribeBlock;
|
||||
} | {
|
||||
name: 'run_start';
|
||||
} | {
|
||||
name: 'run_finish';
|
||||
} | {
|
||||
name: 'teardown';
|
||||
};
|
||||
export declare type MatcherResults = {
|
||||
actual: unknown;
|
||||
expected: unknown;
|
||||
name: string;
|
||||
pass: boolean;
|
||||
};
|
||||
export declare type TestStatus = 'skip' | 'done' | 'todo';
|
||||
export declare type TestResult = {
|
||||
duration?: number | null;
|
||||
errors: Array<FormattedError>;
|
||||
errorsDetailed: Array<MatcherResults | unknown>;
|
||||
invocations: number;
|
||||
status: TestStatus;
|
||||
location?: {
|
||||
column: number;
|
||||
line: number;
|
||||
} | null;
|
||||
testPath: Array<TestName | BlockName>;
|
||||
};
|
||||
export declare type RunResult = {
|
||||
unhandledErrors: Array<FormattedError>;
|
||||
testResults: TestResults;
|
||||
};
|
||||
export declare type TestResults = Array<TestResult>;
|
||||
export declare type GlobalErrorHandlers = {
|
||||
uncaughtException: Array<(exception: Exception) => void>;
|
||||
unhandledRejection: Array<(exception: Exception, promise: Promise<unknown>) => void>;
|
||||
};
|
||||
export declare type State = {
|
||||
currentDescribeBlock: DescribeBlock;
|
||||
currentlyRunningTest?: TestEntry | null;
|
||||
expand?: boolean;
|
||||
hasFocusedTests: boolean;
|
||||
hasStarted: boolean;
|
||||
originalGlobalErrorHandlers?: GlobalErrorHandlers;
|
||||
parentProcess: Process | null;
|
||||
rootDescribeBlock: DescribeBlock;
|
||||
testNamePattern?: RegExp | null;
|
||||
testTimeout: number;
|
||||
unhandledErrors: Array<Exception>;
|
||||
includeTestLocationInResult: boolean;
|
||||
};
|
||||
export declare type DescribeBlock = {
|
||||
type: 'describeBlock';
|
||||
children: Array<DescribeBlock | TestEntry>;
|
||||
hooks: Array<Hook>;
|
||||
mode: BlockMode;
|
||||
name: BlockName;
|
||||
parent?: DescribeBlock;
|
||||
/** @deprecated Please get from `children` array instead */
|
||||
tests: Array<TestEntry>;
|
||||
};
|
||||
export declare type TestError = Exception | [Exception | undefined, Exception];
|
||||
export declare type TestEntry = {
|
||||
type: 'test';
|
||||
asyncError: Exception;
|
||||
errors: Array<TestError>;
|
||||
fn: TestFn;
|
||||
invocations: number;
|
||||
mode: TestMode;
|
||||
name: TestName;
|
||||
parent: DescribeBlock;
|
||||
startedAt?: number | null;
|
||||
duration?: number | null;
|
||||
status?: TestStatus | null;
|
||||
timeout?: number;
|
||||
};
|
||||
export {};
|
||||
1
node_modules/ts-jest/node_modules/@jest/types/build/Circus.js
generated
vendored
Normal file
1
node_modules/ts-jest/node_modules/@jest/types/build/Circus.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
'use strict';
|
||||
433
node_modules/ts-jest/node_modules/@jest/types/build/Config.d.ts
generated
vendored
Normal file
433
node_modules/ts-jest/node_modules/@jest/types/build/Config.d.ts
generated
vendored
Normal file
@@ -0,0 +1,433 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import type { ForegroundColor } from 'chalk';
|
||||
import type { ReportOptions } from 'istanbul-reports';
|
||||
import type { Arguments } from 'yargs';
|
||||
declare type CoverageProvider = 'babel' | 'v8';
|
||||
declare type Timers = 'real' | 'fake' | 'modern' | 'legacy';
|
||||
export declare type Path = string;
|
||||
export declare type Glob = string;
|
||||
export declare type HasteConfig = {
|
||||
/** Whether to hash files using SHA-1. */
|
||||
computeSha1?: boolean;
|
||||
/** The platform to use as the default, e.g. 'ios'. */
|
||||
defaultPlatform?: string | null;
|
||||
/** Path to a custom implementation of Haste. */
|
||||
hasteImplModulePath?: string;
|
||||
/** All platforms to target, e.g ['ios', 'android']. */
|
||||
platforms?: Array<string>;
|
||||
/** Whether to throw on error on module collision. */
|
||||
throwOnModuleCollision?: boolean;
|
||||
};
|
||||
export declare type CoverageReporterName = keyof ReportOptions;
|
||||
export declare type CoverageReporterWithOptions<K = CoverageReporterName> = K extends CoverageReporterName ? ReportOptions[K] extends never ? never : [K, Partial<ReportOptions[K]>] : never;
|
||||
export declare type CoverageReporters = Array<CoverageReporterName | CoverageReporterWithOptions>;
|
||||
export declare type ReporterConfig = [string, Record<string, unknown>];
|
||||
export declare type TransformerConfig = [string, Record<string, unknown>];
|
||||
export interface ConfigGlobals {
|
||||
[K: string]: unknown;
|
||||
}
|
||||
export declare type DefaultOptions = {
|
||||
automock: boolean;
|
||||
bail: number;
|
||||
cache: boolean;
|
||||
cacheDirectory: Path;
|
||||
changedFilesWithAncestor: boolean;
|
||||
clearMocks: boolean;
|
||||
collectCoverage: boolean;
|
||||
coveragePathIgnorePatterns: Array<string>;
|
||||
coverageReporters: Array<CoverageReporterName>;
|
||||
coverageProvider: CoverageProvider;
|
||||
errorOnDeprecated: boolean;
|
||||
expand: boolean;
|
||||
forceCoverageMatch: Array<Glob>;
|
||||
globals: ConfigGlobals;
|
||||
haste: HasteConfig;
|
||||
injectGlobals: boolean;
|
||||
maxConcurrency: number;
|
||||
maxWorkers: number | string;
|
||||
moduleDirectories: Array<string>;
|
||||
moduleFileExtensions: Array<string>;
|
||||
moduleNameMapper: Record<string, string | Array<string>>;
|
||||
modulePathIgnorePatterns: Array<string>;
|
||||
noStackTrace: boolean;
|
||||
notify: boolean;
|
||||
notifyMode: NotifyMode;
|
||||
prettierPath: string;
|
||||
resetMocks: boolean;
|
||||
resetModules: boolean;
|
||||
restoreMocks: boolean;
|
||||
roots: Array<Path>;
|
||||
runTestsByPath: boolean;
|
||||
runner: 'jest-runner';
|
||||
setupFiles: Array<Path>;
|
||||
setupFilesAfterEnv: Array<Path>;
|
||||
skipFilter: boolean;
|
||||
slowTestThreshold: number;
|
||||
snapshotSerializers: Array<Path>;
|
||||
testEnvironment: string;
|
||||
testEnvironmentOptions: Record<string, unknown>;
|
||||
testFailureExitCode: string | number;
|
||||
testLocationInResults: boolean;
|
||||
testMatch: Array<Glob>;
|
||||
testPathIgnorePatterns: Array<string>;
|
||||
testRegex: Array<string>;
|
||||
testRunner: string;
|
||||
testSequencer: string;
|
||||
testURL: string;
|
||||
timers: Timers;
|
||||
transformIgnorePatterns: Array<Glob>;
|
||||
useStderr: boolean;
|
||||
watch: boolean;
|
||||
watchPathIgnorePatterns: Array<string>;
|
||||
watchman: boolean;
|
||||
};
|
||||
export declare type DisplayName = {
|
||||
name: string;
|
||||
color: typeof ForegroundColor;
|
||||
};
|
||||
export declare type InitialOptionsWithRootDir = InitialOptions & Required<Pick<InitialOptions, 'rootDir'>>;
|
||||
export declare type InitialOptions = Partial<{
|
||||
automock: boolean;
|
||||
bail: boolean | number;
|
||||
cache: boolean;
|
||||
cacheDirectory: Path;
|
||||
clearMocks: boolean;
|
||||
changedFilesWithAncestor: boolean;
|
||||
changedSince: string;
|
||||
collectCoverage: boolean;
|
||||
collectCoverageFrom: Array<Glob>;
|
||||
collectCoverageOnlyFrom: {
|
||||
[key: string]: boolean;
|
||||
};
|
||||
coverageDirectory: string;
|
||||
coveragePathIgnorePatterns: Array<string>;
|
||||
coverageProvider: CoverageProvider;
|
||||
coverageReporters: CoverageReporters;
|
||||
coverageThreshold: {
|
||||
global: {
|
||||
[key: string]: number;
|
||||
};
|
||||
};
|
||||
dependencyExtractor: string;
|
||||
detectLeaks: boolean;
|
||||
detectOpenHandles: boolean;
|
||||
displayName: string | DisplayName;
|
||||
expand: boolean;
|
||||
extraGlobals: Array<string>;
|
||||
filter: Path;
|
||||
findRelatedTests: boolean;
|
||||
forceCoverageMatch: Array<Glob>;
|
||||
forceExit: boolean;
|
||||
json: boolean;
|
||||
globals: ConfigGlobals;
|
||||
globalSetup: string | null | undefined;
|
||||
globalTeardown: string | null | undefined;
|
||||
haste: HasteConfig;
|
||||
injectGlobals: boolean;
|
||||
reporters: Array<string | ReporterConfig>;
|
||||
logHeapUsage: boolean;
|
||||
lastCommit: boolean;
|
||||
listTests: boolean;
|
||||
mapCoverage: boolean;
|
||||
maxConcurrency: number;
|
||||
maxWorkers: number | string;
|
||||
moduleDirectories: Array<string>;
|
||||
moduleFileExtensions: Array<string>;
|
||||
moduleLoader: Path;
|
||||
moduleNameMapper: {
|
||||
[key: string]: string | Array<string>;
|
||||
};
|
||||
modulePathIgnorePatterns: Array<string>;
|
||||
modulePaths: Array<string>;
|
||||
name: string;
|
||||
noStackTrace: boolean;
|
||||
notify: boolean;
|
||||
notifyMode: string;
|
||||
onlyChanged: boolean;
|
||||
onlyFailures: boolean;
|
||||
outputFile: Path;
|
||||
passWithNoTests: boolean;
|
||||
preprocessorIgnorePatterns: Array<Glob>;
|
||||
preset: string | null | undefined;
|
||||
prettierPath: string | null | undefined;
|
||||
projects: Array<Glob>;
|
||||
replname: string | null | undefined;
|
||||
resetMocks: boolean;
|
||||
resetModules: boolean;
|
||||
resolver: Path | null | undefined;
|
||||
restoreMocks: boolean;
|
||||
rootDir: Path;
|
||||
roots: Array<Path>;
|
||||
runner: string;
|
||||
runTestsByPath: boolean;
|
||||
scriptPreprocessor: string;
|
||||
setupFiles: Array<Path>;
|
||||
setupTestFrameworkScriptFile: Path;
|
||||
setupFilesAfterEnv: Array<Path>;
|
||||
silent: boolean;
|
||||
skipFilter: boolean;
|
||||
skipNodeResolution: boolean;
|
||||
slowTestThreshold: number;
|
||||
snapshotResolver: Path;
|
||||
snapshotSerializers: Array<Path>;
|
||||
errorOnDeprecated: boolean;
|
||||
testEnvironment: string;
|
||||
testEnvironmentOptions: Record<string, unknown>;
|
||||
testFailureExitCode: string | number;
|
||||
testLocationInResults: boolean;
|
||||
testMatch: Array<Glob>;
|
||||
testNamePattern: string;
|
||||
testPathDirs: Array<Path>;
|
||||
testPathIgnorePatterns: Array<string>;
|
||||
testRegex: string | Array<string>;
|
||||
testResultsProcessor: string;
|
||||
testRunner: string;
|
||||
testSequencer: string;
|
||||
testURL: string;
|
||||
testTimeout: number;
|
||||
timers: Timers;
|
||||
transform: {
|
||||
[regex: string]: Path | TransformerConfig;
|
||||
};
|
||||
transformIgnorePatterns: Array<Glob>;
|
||||
watchPathIgnorePatterns: Array<string>;
|
||||
unmockedModulePathPatterns: Array<string>;
|
||||
updateSnapshot: boolean;
|
||||
useStderr: boolean;
|
||||
verbose?: boolean;
|
||||
watch: boolean;
|
||||
watchAll: boolean;
|
||||
watchman: boolean;
|
||||
watchPlugins: Array<string | [string, Record<string, unknown>]>;
|
||||
}>;
|
||||
export declare type SnapshotUpdateState = 'all' | 'new' | 'none';
|
||||
declare type NotifyMode = 'always' | 'failure' | 'success' | 'change' | 'success-change' | 'failure-change';
|
||||
export declare type CoverageThresholdValue = {
|
||||
branches?: number;
|
||||
functions?: number;
|
||||
lines?: number;
|
||||
statements?: number;
|
||||
};
|
||||
declare type CoverageThreshold = {
|
||||
[path: string]: CoverageThresholdValue;
|
||||
global: CoverageThresholdValue;
|
||||
};
|
||||
export declare type GlobalConfig = {
|
||||
bail: number;
|
||||
changedSince?: string;
|
||||
changedFilesWithAncestor: boolean;
|
||||
collectCoverage: boolean;
|
||||
collectCoverageFrom: Array<Glob>;
|
||||
collectCoverageOnlyFrom?: {
|
||||
[key: string]: boolean;
|
||||
};
|
||||
coverageDirectory: string;
|
||||
coveragePathIgnorePatterns?: Array<string>;
|
||||
coverageProvider: CoverageProvider;
|
||||
coverageReporters: CoverageReporters;
|
||||
coverageThreshold?: CoverageThreshold;
|
||||
detectLeaks: boolean;
|
||||
detectOpenHandles: boolean;
|
||||
enabledTestsMap?: {
|
||||
[key: string]: {
|
||||
[key: string]: boolean;
|
||||
};
|
||||
};
|
||||
expand: boolean;
|
||||
filter?: Path;
|
||||
findRelatedTests: boolean;
|
||||
forceExit: boolean;
|
||||
json: boolean;
|
||||
globalSetup?: string;
|
||||
globalTeardown?: string;
|
||||
lastCommit: boolean;
|
||||
logHeapUsage: boolean;
|
||||
listTests: boolean;
|
||||
maxConcurrency: number;
|
||||
maxWorkers: number;
|
||||
noStackTrace: boolean;
|
||||
nonFlagArgs: Array<string>;
|
||||
noSCM?: boolean;
|
||||
notify: boolean;
|
||||
notifyMode: NotifyMode;
|
||||
outputFile?: Path;
|
||||
onlyChanged: boolean;
|
||||
onlyFailures: boolean;
|
||||
passWithNoTests: boolean;
|
||||
projects: Array<Glob>;
|
||||
replname?: string;
|
||||
reporters?: Array<string | ReporterConfig>;
|
||||
runTestsByPath: boolean;
|
||||
rootDir: Path;
|
||||
silent?: boolean;
|
||||
skipFilter: boolean;
|
||||
errorOnDeprecated: boolean;
|
||||
testFailureExitCode: number;
|
||||
testNamePattern?: string;
|
||||
testPathPattern: string;
|
||||
testResultsProcessor?: string;
|
||||
testSequencer: string;
|
||||
testTimeout?: number;
|
||||
updateSnapshot: SnapshotUpdateState;
|
||||
useStderr: boolean;
|
||||
verbose?: boolean;
|
||||
watch: boolean;
|
||||
watchAll: boolean;
|
||||
watchman: boolean;
|
||||
watchPlugins?: Array<{
|
||||
path: string;
|
||||
config: Record<string, unknown>;
|
||||
}> | null;
|
||||
};
|
||||
export declare type ProjectConfig = {
|
||||
automock: boolean;
|
||||
cache: boolean;
|
||||
cacheDirectory: Path;
|
||||
clearMocks: boolean;
|
||||
coveragePathIgnorePatterns: Array<string>;
|
||||
cwd: Path;
|
||||
dependencyExtractor?: string;
|
||||
detectLeaks: boolean;
|
||||
detectOpenHandles: boolean;
|
||||
displayName?: DisplayName;
|
||||
errorOnDeprecated: boolean;
|
||||
extraGlobals: Array<keyof NodeJS.Global>;
|
||||
filter?: Path;
|
||||
forceCoverageMatch: Array<Glob>;
|
||||
globalSetup?: string;
|
||||
globalTeardown?: string;
|
||||
globals: ConfigGlobals;
|
||||
haste: HasteConfig;
|
||||
injectGlobals: boolean;
|
||||
moduleDirectories: Array<string>;
|
||||
moduleFileExtensions: Array<string>;
|
||||
moduleLoader?: Path;
|
||||
moduleNameMapper: Array<[string, string]>;
|
||||
modulePathIgnorePatterns: Array<string>;
|
||||
modulePaths?: Array<string>;
|
||||
name: string;
|
||||
prettierPath: string;
|
||||
resetMocks: boolean;
|
||||
resetModules: boolean;
|
||||
resolver?: Path;
|
||||
restoreMocks: boolean;
|
||||
rootDir: Path;
|
||||
roots: Array<Path>;
|
||||
runner: string;
|
||||
setupFiles: Array<Path>;
|
||||
setupFilesAfterEnv: Array<Path>;
|
||||
skipFilter: boolean;
|
||||
skipNodeResolution?: boolean;
|
||||
slowTestThreshold: number;
|
||||
snapshotResolver?: Path;
|
||||
snapshotSerializers: Array<Path>;
|
||||
testEnvironment: string;
|
||||
testEnvironmentOptions: Record<string, unknown>;
|
||||
testMatch: Array<Glob>;
|
||||
testLocationInResults: boolean;
|
||||
testPathIgnorePatterns: Array<string>;
|
||||
testRegex: Array<string | RegExp>;
|
||||
testRunner: string;
|
||||
testURL: string;
|
||||
timers: Timers;
|
||||
transform: Array<[string, Path, Record<string, unknown>]>;
|
||||
transformIgnorePatterns: Array<Glob>;
|
||||
watchPathIgnorePatterns: Array<string>;
|
||||
unmockedModulePathPatterns?: Array<string>;
|
||||
};
|
||||
export declare type Argv = Arguments<Partial<{
|
||||
all: boolean;
|
||||
automock: boolean;
|
||||
bail: boolean | number;
|
||||
cache: boolean;
|
||||
cacheDirectory: string;
|
||||
changedFilesWithAncestor: boolean;
|
||||
changedSince: string;
|
||||
ci: boolean;
|
||||
clearCache: boolean;
|
||||
clearMocks: boolean;
|
||||
collectCoverage: boolean;
|
||||
collectCoverageFrom: string;
|
||||
collectCoverageOnlyFrom: Array<string>;
|
||||
color: boolean;
|
||||
colors: boolean;
|
||||
config: string;
|
||||
coverage: boolean;
|
||||
coverageDirectory: string;
|
||||
coveragePathIgnorePatterns: Array<string>;
|
||||
coverageReporters: Array<string>;
|
||||
coverageThreshold: string;
|
||||
debug: boolean;
|
||||
env: string;
|
||||
expand: boolean;
|
||||
findRelatedTests: boolean;
|
||||
forceExit: boolean;
|
||||
globals: string;
|
||||
globalSetup: string | null | undefined;
|
||||
globalTeardown: string | null | undefined;
|
||||
haste: string;
|
||||
init: boolean;
|
||||
injectGlobals: boolean;
|
||||
json: boolean;
|
||||
lastCommit: boolean;
|
||||
logHeapUsage: boolean;
|
||||
maxWorkers: number | string;
|
||||
moduleDirectories: Array<string>;
|
||||
moduleFileExtensions: Array<string>;
|
||||
moduleNameMapper: string;
|
||||
modulePathIgnorePatterns: Array<string>;
|
||||
modulePaths: Array<string>;
|
||||
noStackTrace: boolean;
|
||||
notify: boolean;
|
||||
notifyMode: string;
|
||||
onlyChanged: boolean;
|
||||
onlyFailures: boolean;
|
||||
outputFile: string;
|
||||
preset: string | null | undefined;
|
||||
projects: Array<string>;
|
||||
prettierPath: string | null | undefined;
|
||||
resetMocks: boolean;
|
||||
resetModules: boolean;
|
||||
resolver: string | null | undefined;
|
||||
restoreMocks: boolean;
|
||||
rootDir: string;
|
||||
roots: Array<string>;
|
||||
runInBand: boolean;
|
||||
selectProjects: Array<string>;
|
||||
setupFiles: Array<string>;
|
||||
setupFilesAfterEnv: Array<string>;
|
||||
showConfig: boolean;
|
||||
silent: boolean;
|
||||
snapshotSerializers: Array<string>;
|
||||
testEnvironment: string;
|
||||
testFailureExitCode: string | null | undefined;
|
||||
testMatch: Array<string>;
|
||||
testNamePattern: string;
|
||||
testPathIgnorePatterns: Array<string>;
|
||||
testPathPattern: Array<string>;
|
||||
testRegex: string | Array<string>;
|
||||
testResultsProcessor: string;
|
||||
testRunner: string;
|
||||
testSequencer: string;
|
||||
testURL: string;
|
||||
testTimeout: number | null | undefined;
|
||||
timers: string;
|
||||
transform: string;
|
||||
transformIgnorePatterns: Array<string>;
|
||||
unmockedModulePathPatterns: Array<string> | null | undefined;
|
||||
updateSnapshot: boolean;
|
||||
useStderr: boolean;
|
||||
verbose: boolean;
|
||||
version: boolean;
|
||||
watch: boolean;
|
||||
watchAll: boolean;
|
||||
watchman: boolean;
|
||||
watchPathIgnorePatterns: Array<string>;
|
||||
}>>;
|
||||
export {};
|
||||
1
node_modules/ts-jest/node_modules/@jest/types/build/Config.js
generated
vendored
Normal file
1
node_modules/ts-jest/node_modules/@jest/types/build/Config.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
'use strict';
|
||||
88
node_modules/ts-jest/node_modules/@jest/types/build/Global.d.ts
generated
vendored
Normal file
88
node_modules/ts-jest/node_modules/@jest/types/build/Global.d.ts
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import type { CoverageMapData } from 'istanbul-lib-coverage';
|
||||
export declare type DoneFn = (reason?: string | Error) => void;
|
||||
export declare type TestName = string;
|
||||
export declare type TestFn = (done?: DoneFn) => Promise<void | undefined | unknown> | void | undefined;
|
||||
export declare type ConcurrentTestFn = (done?: DoneFn) => Promise<void | undefined | unknown>;
|
||||
export declare type BlockFn = () => void;
|
||||
export declare type BlockName = string;
|
||||
export declare type HookFn = TestFn;
|
||||
export declare type Col = unknown;
|
||||
export declare type Row = Array<Col>;
|
||||
export declare type Table = Array<Row>;
|
||||
export declare type ArrayTable = Table | Row;
|
||||
export declare type TemplateTable = TemplateStringsArray;
|
||||
export declare type TemplateData = Array<unknown>;
|
||||
export declare type EachTable = ArrayTable | TemplateTable;
|
||||
export declare type TestCallback = BlockFn | TestFn | ConcurrentTestFn;
|
||||
export declare type EachTestFn<EachCallback extends TestCallback> = (...args: Array<any>) => ReturnType<EachCallback>;
|
||||
declare type Jasmine = {
|
||||
_DEFAULT_TIMEOUT_INTERVAL?: number;
|
||||
addMatchers: (matchers: Record<string, unknown>) => void;
|
||||
};
|
||||
declare type Each<EachCallback extends TestCallback> = ((table: EachTable, ...taggedTemplateData: Array<unknown>) => (title: string, test: EachTestFn<EachCallback>, timeout?: number) => void) | (() => () => void);
|
||||
export interface HookBase {
|
||||
(fn: HookFn, timeout?: number): void;
|
||||
}
|
||||
export interface ItBase {
|
||||
(testName: TestName, fn: TestFn, timeout?: number): void;
|
||||
each: Each<TestFn>;
|
||||
}
|
||||
export interface It extends ItBase {
|
||||
only: ItBase;
|
||||
skip: ItBase;
|
||||
todo: (testName: TestName) => void;
|
||||
}
|
||||
export interface ItConcurrentBase {
|
||||
(testName: string, testFn: ConcurrentTestFn, timeout?: number): void;
|
||||
each: Each<ConcurrentTestFn>;
|
||||
}
|
||||
export interface ItConcurrentExtended extends ItConcurrentBase {
|
||||
only: ItConcurrentBase;
|
||||
skip: ItConcurrentBase;
|
||||
}
|
||||
export interface ItConcurrent extends It {
|
||||
concurrent: ItConcurrentExtended;
|
||||
}
|
||||
export interface DescribeBase {
|
||||
(blockName: BlockName, blockFn: BlockFn): void;
|
||||
each: Each<BlockFn>;
|
||||
}
|
||||
export interface Describe extends DescribeBase {
|
||||
only: DescribeBase;
|
||||
skip: DescribeBase;
|
||||
}
|
||||
export interface TestFrameworkGlobals {
|
||||
it: ItConcurrent;
|
||||
test: ItConcurrent;
|
||||
fit: ItBase & {
|
||||
concurrent?: ItConcurrentBase;
|
||||
};
|
||||
xit: ItBase;
|
||||
xtest: ItBase;
|
||||
describe: Describe;
|
||||
xdescribe: DescribeBase;
|
||||
fdescribe: DescribeBase;
|
||||
beforeAll: HookBase;
|
||||
beforeEach: HookBase;
|
||||
afterEach: HookBase;
|
||||
afterAll: HookBase;
|
||||
}
|
||||
export interface GlobalAdditions extends TestFrameworkGlobals {
|
||||
__coverage__: CoverageMapData;
|
||||
jasmine: Jasmine;
|
||||
fail: () => void;
|
||||
pending: () => void;
|
||||
spyOn: () => void;
|
||||
spyOnProperty: () => void;
|
||||
}
|
||||
export interface Global extends GlobalAdditions, Omit<NodeJS.Global, keyof GlobalAdditions> {
|
||||
[extras: string]: unknown;
|
||||
}
|
||||
export {};
|
||||
1
node_modules/ts-jest/node_modules/@jest/types/build/Global.js
generated
vendored
Normal file
1
node_modules/ts-jest/node_modules/@jest/types/build/Global.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
'use strict';
|
||||
31
node_modules/ts-jest/node_modules/@jest/types/build/TestResult.d.ts
generated
vendored
Normal file
31
node_modules/ts-jest/node_modules/@jest/types/build/TestResult.d.ts
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
export declare type Milliseconds = number;
|
||||
declare type Status = 'passed' | 'failed' | 'skipped' | 'pending' | 'todo' | 'disabled';
|
||||
declare type Callsite = {
|
||||
column: number;
|
||||
line: number;
|
||||
};
|
||||
export declare type AssertionResult = {
|
||||
ancestorTitles: Array<string>;
|
||||
duration?: Milliseconds | null;
|
||||
failureDetails: Array<unknown>;
|
||||
failureMessages: Array<string>;
|
||||
fullName: string;
|
||||
invocations?: number;
|
||||
location?: Callsite | null;
|
||||
numPassingAsserts: number;
|
||||
status: Status;
|
||||
title: string;
|
||||
};
|
||||
export declare type SerializableError = {
|
||||
code?: unknown;
|
||||
message: string;
|
||||
stack: string | null | undefined;
|
||||
type?: string;
|
||||
};
|
||||
export {};
|
||||
1
node_modules/ts-jest/node_modules/@jest/types/build/TestResult.js
generated
vendored
Normal file
1
node_modules/ts-jest/node_modules/@jest/types/build/TestResult.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
'use strict';
|
||||
12
node_modules/ts-jest/node_modules/@jest/types/build/Transform.d.ts
generated
vendored
Normal file
12
node_modules/ts-jest/node_modules/@jest/types/build/Transform.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
export declare type TransformResult = {
|
||||
code: string;
|
||||
originalCode: string;
|
||||
mapCoverage?: boolean;
|
||||
sourceMapPath: string | null;
|
||||
};
|
||||
1
node_modules/ts-jest/node_modules/@jest/types/build/Transform.js
generated
vendored
Normal file
1
node_modules/ts-jest/node_modules/@jest/types/build/Transform.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
'use strict';
|
||||
12
node_modules/ts-jest/node_modules/@jest/types/build/index.d.ts
generated
vendored
Normal file
12
node_modules/ts-jest/node_modules/@jest/types/build/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
import type * as Circus from './Circus';
|
||||
import type * as Config from './Config';
|
||||
import type * as Global from './Global';
|
||||
import type * as TestResult from './TestResult';
|
||||
import type * as TransformTypes from './Transform';
|
||||
export type { Circus, Config, Global, TestResult, TransformTypes };
|
||||
1
node_modules/ts-jest/node_modules/@jest/types/build/index.js
generated
vendored
Normal file
1
node_modules/ts-jest/node_modules/@jest/types/build/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
'use strict';
|
||||
56
node_modules/ts-jest/node_modules/@jest/types/package.json
generated
vendored
Normal file
56
node_modules/ts-jest/node_modules/@jest/types/package.json
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"_from": "@jest/types@^26.6.2",
|
||||
"_id": "@jest/types@26.6.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==",
|
||||
"_location": "/ts-jest/@jest/types",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@jest/types@^26.6.2",
|
||||
"name": "@jest/types",
|
||||
"escapedName": "@jest%2ftypes",
|
||||
"scope": "@jest",
|
||||
"rawSpec": "^26.6.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^26.6.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/ts-jest/pretty-format"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz",
|
||||
"_shasum": "bef5a532030e1d88a2f5a6d933f84e97226ed48e",
|
||||
"_spec": "@jest/types@^26.6.2",
|
||||
"_where": "/home/codespace/workspace/upload-google-play/node_modules/ts-jest/node_modules/pretty-format",
|
||||
"bugs": {
|
||||
"url": "https://github.com/facebook/jest/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@types/istanbul-lib-coverage": "^2.0.0",
|
||||
"@types/istanbul-reports": "^3.0.0",
|
||||
"@types/node": "*",
|
||||
"@types/yargs": "^15.0.0",
|
||||
"chalk": "^4.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"engines": {
|
||||
"node": ">= 10.14.2"
|
||||
},
|
||||
"gitHead": "4c46930615602cbf983fb7e8e82884c282a624d5",
|
||||
"homepage": "https://github.com/facebook/jest#readme",
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"name": "@jest/types",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/facebook/jest.git",
|
||||
"directory": "packages/jest-types"
|
||||
},
|
||||
"types": "build/index.d.ts",
|
||||
"version": "26.6.2"
|
||||
}
|
||||
21
node_modules/ts-jest/node_modules/@types/istanbul-reports/LICENSE
generated
vendored
Normal file
21
node_modules/ts-jest/node_modules/@types/istanbul-reports/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
16
node_modules/ts-jest/node_modules/@types/istanbul-reports/README.md
generated
vendored
Normal file
16
node_modules/ts-jest/node_modules/@types/istanbul-reports/README.md
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# Installation
|
||||
> `npm install --save @types/istanbul-reports`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for istanbul-reports (https://github.com/istanbuljs/istanbuljs).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-reports.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Mon, 20 Jul 2020 21:55:27 GMT
|
||||
* Dependencies: [@types/istanbul-lib-report](https://npmjs.com/package/@types/istanbul-lib-report)
|
||||
* Global values: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Jason Cheatham](https://github.com/jason0x43), and [Elena Shcherbakova](https://github.com/not-a-doctor).
|
||||
74
node_modules/ts-jest/node_modules/@types/istanbul-reports/index.d.ts
generated
vendored
Normal file
74
node_modules/ts-jest/node_modules/@types/istanbul-reports/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
// Type definitions for istanbul-reports 3.0
|
||||
// Project: https://github.com/istanbuljs/istanbuljs, https://istanbul.js.org
|
||||
// Definitions by: Jason Cheatham <https://github.com/jason0x43>
|
||||
// Elena Shcherbakova <https://github.com/not-a-doctor>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
import { Node, Visitor } from 'istanbul-lib-report';
|
||||
|
||||
export function create<T extends keyof ReportOptions>(name: T, options?: Partial<ReportOptions[T]>): Visitor;
|
||||
|
||||
export interface FileOptions {
|
||||
file: string;
|
||||
}
|
||||
|
||||
export interface ProjectOptions {
|
||||
projectRoot: string;
|
||||
}
|
||||
|
||||
export interface ReportOptions {
|
||||
clover: CloverOptions;
|
||||
cobertura: CoberturaOptions;
|
||||
'html-spa': HtmlSpaOptions;
|
||||
html: HtmlOptions;
|
||||
json: JsonOptions;
|
||||
'json-summary': JsonSummaryOptions;
|
||||
lcov: LcovOptions;
|
||||
lcovonly: LcovOnlyOptions;
|
||||
none: never;
|
||||
teamcity: TeamcityOptions;
|
||||
text: TextOptions;
|
||||
'text-lcov': TextLcovOptions;
|
||||
'text-summary': TextSummaryOptions;
|
||||
}
|
||||
|
||||
export type ReportType = keyof ReportOptions;
|
||||
|
||||
export interface CloverOptions extends FileOptions, ProjectOptions {}
|
||||
|
||||
export interface CoberturaOptions extends FileOptions, ProjectOptions {}
|
||||
|
||||
export interface HtmlSpaOptions extends HtmlOptions {
|
||||
metricsToShow: Array<'lines' | 'branches' | 'functions' | 'statements'>;
|
||||
}
|
||||
export interface HtmlOptions {
|
||||
verbose: boolean;
|
||||
skipEmpty: boolean;
|
||||
subdir: string;
|
||||
linkMapper: LinkMapper;
|
||||
}
|
||||
|
||||
export type JsonOptions = FileOptions;
|
||||
export type JsonSummaryOptions = FileOptions;
|
||||
|
||||
export interface LcovOptions extends FileOptions, ProjectOptions {}
|
||||
export interface LcovOnlyOptions extends FileOptions, ProjectOptions {}
|
||||
|
||||
export interface TeamcityOptions extends FileOptions {
|
||||
blockName: string;
|
||||
}
|
||||
|
||||
export interface TextOptions extends FileOptions {
|
||||
maxCols: number;
|
||||
skipEmpty: boolean;
|
||||
skipFull: boolean;
|
||||
}
|
||||
export type TextLcovOptions = ProjectOptions;
|
||||
export type TextSummaryOptions = FileOptions;
|
||||
|
||||
export interface LinkMapper {
|
||||
getPath(node: string | Node): string;
|
||||
relativePath(source: string | Node, target: string | Node): string;
|
||||
assetPath(node: Node, name: string): string;
|
||||
}
|
||||
59
node_modules/ts-jest/node_modules/@types/istanbul-reports/package.json
generated
vendored
Normal file
59
node_modules/ts-jest/node_modules/@types/istanbul-reports/package.json
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"_from": "@types/istanbul-reports@^3.0.0",
|
||||
"_id": "@types/istanbul-reports@3.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
|
||||
"_location": "/ts-jest/@types/istanbul-reports",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@types/istanbul-reports@^3.0.0",
|
||||
"name": "@types/istanbul-reports",
|
||||
"escapedName": "@types%2fistanbul-reports",
|
||||
"scope": "@types",
|
||||
"rawSpec": "^3.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^3.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/ts-jest/@jest/types"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
|
||||
"_shasum": "508b13aa344fa4976234e75dddcc34925737d821",
|
||||
"_spec": "@types/istanbul-reports@^3.0.0",
|
||||
"_where": "/home/codespace/workspace/upload-google-play/node_modules/ts-jest/node_modules/@jest/types",
|
||||
"bugs": {
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Jason Cheatham",
|
||||
"url": "https://github.com/jason0x43"
|
||||
},
|
||||
{
|
||||
"name": "Elena Shcherbakova",
|
||||
"url": "https://github.com/not-a-doctor"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"@types/istanbul-lib-report": "*"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "TypeScript definitions for istanbul-reports",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
|
||||
"license": "MIT",
|
||||
"main": "",
|
||||
"name": "@types/istanbul-reports",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/istanbul-reports"
|
||||
},
|
||||
"scripts": {},
|
||||
"typeScriptVersion": "3.0",
|
||||
"types": "index.d.ts",
|
||||
"typesPublisherContentHash": "71342edcc57e7212d17e794fa519955e496dd3b6696e2738904679ef3aa59d70",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
21
node_modules/ts-jest/node_modules/@types/jest/LICENSE
generated
vendored
Normal file
21
node_modules/ts-jest/node_modules/@types/jest/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
17
node_modules/ts-jest/node_modules/@types/jest/README.md
generated
vendored
Normal file
17
node_modules/ts-jest/node_modules/@types/jest/README.md
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# Installation
|
||||
> `npm install --save @types/jest`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for Jest (https://jestjs.io/).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jest.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 20 Oct 2020 07:15:43 GMT
|
||||
* Dependencies: [@types/jest-diff](https://npmjs.com/package/@types/jest-diff), [@types/pretty-format](https://npmjs.com/package/@types/pretty-format)
|
||||
* Global values: `afterAll`, `afterEach`, `beforeAll`, `beforeEach`, `describe`, `expect`, `fail`, `fdescribe`, `fit`, `it`, `jasmine`, `jest`, `pending`, `spyOn`, `test`, `xdescribe`, `xit`, `xtest`
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Asana (https://asana.com)
|
||||
// Ivo Stratev](https://github.com/NoHomey), [jwbay](https://github.com/jwbay), [Alexey Svetliakov](https://github.com/asvetliakov), [Alex Jover Morales](https://github.com/alexjoverm), [Allan Lukwago](https://github.com/epicallan), [Ika](https://github.com/ikatyang), [Waseem Dahman](https://github.com/wsmd), [Jamie Mason](https://github.com/JamieMason), [Douglas Duteil](https://github.com/douglasduteil), [Ahn](https://github.com/ahnpnl), [Josh Goldberg](https://github.com/joshuakgoldberg), [Jeff Lau](https://github.com/UselessPickles), [Andrew Makarov](https://github.com/r3nya), [Martin Hochel](https://github.com/hotell), [Sebastian Sebald](https://github.com/sebald), [Andy](https://github.com/andys8), [Antoine Brault](https://github.com/antoinebrault), [Gregor Stamać](https://github.com/gstamac), [ExE Boss](https://github.com/ExE-Boss), [Alex Bolenok](https://github.com/quassnoi), [Mario Beltrán Alarcón](https://github.com/Belco90), [Tony Hallett](https://github.com/tonyhallett), [Jason Yu](https://github.com/ycmjason), [Devansh Jethmalani](https://github.com/devanshj), [Pawel Fajfer](https://github.com/pawfa), and [Regev Brody](https://github.com/regevbr).
|
||||
1540
node_modules/ts-jest/node_modules/@types/jest/index.d.ts
generated
vendored
Normal file
1540
node_modules/ts-jest/node_modules/@types/jest/index.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
156
node_modules/ts-jest/node_modules/@types/jest/package.json
generated
vendored
Normal file
156
node_modules/ts-jest/node_modules/@types/jest/package.json
generated
vendored
Normal file
@@ -0,0 +1,156 @@
|
||||
{
|
||||
"_from": "@types/jest@26.x",
|
||||
"_id": "@types/jest@26.0.15",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-s2VMReFXRg9XXxV+CW9e5Nz8fH2K1aEhwgjUqPPbQd7g95T0laAcvLv032EhFHIa5GHsZ8W7iJEQVaJq6k3Gog==",
|
||||
"_location": "/ts-jest/@types/jest",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@types/jest@26.x",
|
||||
"name": "@types/jest",
|
||||
"escapedName": "@types%2fjest",
|
||||
"scope": "@types",
|
||||
"rawSpec": "26.x",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "26.x"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/ts-jest"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.15.tgz",
|
||||
"_shasum": "12e02c0372ad0548e07b9f4e19132b834cb1effe",
|
||||
"_spec": "@types/jest@26.x",
|
||||
"_where": "/home/codespace/workspace/upload-google-play/node_modules/ts-jest",
|
||||
"bugs": {
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Asana",
|
||||
"url": "https://asana.com"
|
||||
},
|
||||
{
|
||||
"name": "jwbay",
|
||||
"url": "https://github.com/jwbay"
|
||||
},
|
||||
{
|
||||
"name": "Alexey Svetliakov",
|
||||
"url": "https://github.com/asvetliakov"
|
||||
},
|
||||
{
|
||||
"name": "Alex Jover Morales",
|
||||
"url": "https://github.com/alexjoverm"
|
||||
},
|
||||
{
|
||||
"name": "Allan Lukwago",
|
||||
"url": "https://github.com/epicallan"
|
||||
},
|
||||
{
|
||||
"name": "Ika",
|
||||
"url": "https://github.com/ikatyang"
|
||||
},
|
||||
{
|
||||
"name": "Waseem Dahman",
|
||||
"url": "https://github.com/wsmd"
|
||||
},
|
||||
{
|
||||
"name": "Jamie Mason",
|
||||
"url": "https://github.com/JamieMason"
|
||||
},
|
||||
{
|
||||
"name": "Douglas Duteil",
|
||||
"url": "https://github.com/douglasduteil"
|
||||
},
|
||||
{
|
||||
"name": "Ahn",
|
||||
"url": "https://github.com/ahnpnl"
|
||||
},
|
||||
{
|
||||
"name": "Josh Goldberg",
|
||||
"url": "https://github.com/joshuakgoldberg"
|
||||
},
|
||||
{
|
||||
"name": "Jeff Lau",
|
||||
"url": "https://github.com/UselessPickles"
|
||||
},
|
||||
{
|
||||
"name": "Andrew Makarov",
|
||||
"url": "https://github.com/r3nya"
|
||||
},
|
||||
{
|
||||
"name": "Martin Hochel",
|
||||
"url": "https://github.com/hotell"
|
||||
},
|
||||
{
|
||||
"name": "Sebastian Sebald",
|
||||
"url": "https://github.com/sebald"
|
||||
},
|
||||
{
|
||||
"name": "Andy",
|
||||
"url": "https://github.com/andys8"
|
||||
},
|
||||
{
|
||||
"name": "Antoine Brault",
|
||||
"url": "https://github.com/antoinebrault"
|
||||
},
|
||||
{
|
||||
"name": "Gregor Stamać",
|
||||
"url": "https://github.com/gstamac"
|
||||
},
|
||||
{
|
||||
"name": "ExE Boss",
|
||||
"url": "https://github.com/ExE-Boss"
|
||||
},
|
||||
{
|
||||
"name": "Alex Bolenok",
|
||||
"url": "https://github.com/quassnoi"
|
||||
},
|
||||
{
|
||||
"name": "Mario Beltrán Alarcón",
|
||||
"url": "https://github.com/Belco90"
|
||||
},
|
||||
{
|
||||
"name": "Tony Hallett",
|
||||
"url": "https://github.com/tonyhallett"
|
||||
},
|
||||
{
|
||||
"name": "Jason Yu",
|
||||
"url": "https://github.com/ycmjason"
|
||||
},
|
||||
{
|
||||
"name": "Devansh Jethmalani",
|
||||
"url": "https://github.com/devanshj"
|
||||
},
|
||||
{
|
||||
"name": "Pawel Fajfer",
|
||||
"url": "https://github.com/pawfa"
|
||||
},
|
||||
{
|
||||
"name": "Regev Brody",
|
||||
"url": "https://github.com/regevbr"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"jest-diff": "^26.0.0",
|
||||
"pretty-format": "^26.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "TypeScript definitions for Jest",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
|
||||
"license": "MIT",
|
||||
"main": "",
|
||||
"name": "@types/jest",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/jest"
|
||||
},
|
||||
"scripts": {},
|
||||
"typeScriptVersion": "3.8",
|
||||
"types": "index.d.ts",
|
||||
"typesPublisherContentHash": "b3cd189f33cef63f256a72fd8fe3bf961ad6649c77c5bd8a3023823a23411726",
|
||||
"version": "26.0.15"
|
||||
}
|
||||
21
node_modules/ts-jest/node_modules/@types/yargs/LICENSE
generated
vendored
Normal file
21
node_modules/ts-jest/node_modules/@types/yargs/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
16
node_modules/ts-jest/node_modules/@types/yargs/README.md
generated
vendored
Normal file
16
node_modules/ts-jest/node_modules/@types/yargs/README.md
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# Installation
|
||||
> `npm install --save @types/yargs`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for yargs (https://github.com/chevex/yargs).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Fri, 16 Oct 2020 15:34:53 GMT
|
||||
* Dependencies: [@types/yargs-parser](https://npmjs.com/package/@types/yargs-parser)
|
||||
* Global values: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Martin Poelstra](https://github.com/poelstra), [Mizunashi Mana](https://github.com/mizunashi-mana), [Jeffery Grajkowski](https://github.com/pushplay), [Jimi (Dimitris) Charalampidis](https://github.com/JimiC), [Steffen Viken Valvåg](https://github.com/steffenvv), [Emily Marigold Klassen](https://github.com/forivall), [ExE Boss](https://github.com/ExE-Boss), and [Aankhen](https://github.com/Aankhen).
|
||||
835
node_modules/ts-jest/node_modules/@types/yargs/index.d.ts
generated
vendored
Normal file
835
node_modules/ts-jest/node_modules/@types/yargs/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,835 @@
|
||||
// Type definitions for yargs 15.0
|
||||
// Project: https://github.com/chevex/yargs, https://yargs.js.org
|
||||
// Definitions by: Martin Poelstra <https://github.com/poelstra>
|
||||
// Mizunashi Mana <https://github.com/mizunashi-mana>
|
||||
// Jeffery Grajkowski <https://github.com/pushplay>
|
||||
// Jimi (Dimitris) Charalampidis <https://github.com/JimiC>
|
||||
// Steffen Viken Valvåg <https://github.com/steffenvv>
|
||||
// Emily Marigold Klassen <https://github.com/forivall>
|
||||
// ExE Boss <https://github.com/ExE-Boss>
|
||||
// Aankhen <https://github.com/Aankhen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.0
|
||||
|
||||
// The following TSLint rules have been disabled:
|
||||
// unified-signatures: Because there is useful information in the argument names of the overloaded signatures
|
||||
|
||||
// Convention:
|
||||
// Use 'union types' when:
|
||||
// - parameter types have similar signature type (i.e. 'string | ReadonlyArray<string>')
|
||||
// - parameter names have the same semantic meaning (i.e. ['command', 'commands'] , ['key', 'keys'])
|
||||
// An example for not using 'union types' is the declaration of 'env' where `prefix` and `enable` parameters
|
||||
// have different semantics. On the other hand, in the declaration of 'usage', a `command: string` parameter
|
||||
// has the same semantic meaning with declaring an overload method by using `commands: ReadonlyArray<string>`,
|
||||
// thus it's preferred to use `command: string | ReadonlyArray<string>`
|
||||
// Use parameterless declaration instead of declaring all parameters optional,
|
||||
// when all parameters are optional and more than one
|
||||
|
||||
import { DetailedArguments, Configuration } from 'yargs-parser';
|
||||
|
||||
declare namespace yargs {
|
||||
type BuilderCallback<T, R> = ((args: Argv<T>) => PromiseLike<Argv<R>>) | ((args: Argv<T>) => Argv<R>) | ((args: Argv<T>) => void);
|
||||
|
||||
type ParserConfigurationOptions = Configuration & {
|
||||
/** Sort commands alphabetically. Default is `false` */
|
||||
'sort-commands': boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* The type parameter `T` is the expected shape of the parsed options.
|
||||
* `Arguments<T>` is those options plus `_` and `$0`, and an indexer falling
|
||||
* back to `unknown` for unknown options.
|
||||
*
|
||||
* For the return type / `argv` property, we create a mapped type over
|
||||
* `Arguments<T>` to simplify the inferred type signature in client code.
|
||||
*/
|
||||
interface Argv<T = {}> {
|
||||
(): { [key in keyof Arguments<T>]: Arguments<T>[key] };
|
||||
(args: ReadonlyArray<string>, cwd?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Set key names as equivalent such that updates to a key will propagate to aliases and vice-versa.
|
||||
*
|
||||
* Optionally `.alias()` can take an object that maps keys to aliases.
|
||||
* Each key of this object should be the canonical version of the option, and each value should be a string or an array of strings.
|
||||
*/
|
||||
// Aliases for previously declared options can inherit the types of those options.
|
||||
alias<K1 extends keyof T, K2 extends string>(shortName: K1, longName: K2 | ReadonlyArray<K2>): Argv<T & { [key in K2]: T[K1] }>;
|
||||
alias<K1 extends keyof T, K2 extends string>(shortName: K2, longName: K1 | ReadonlyArray<K1>): Argv<T & { [key in K2]: T[K1] }>;
|
||||
alias(shortName: string | ReadonlyArray<string>, longName: string | ReadonlyArray<string>): Argv<T>;
|
||||
alias(aliases: { [shortName: string]: string | ReadonlyArray<string> }): Argv<T>;
|
||||
|
||||
/**
|
||||
* Get the arguments as a plain old object.
|
||||
*
|
||||
* Arguments without a corresponding flag show up in the `argv._` array.
|
||||
*
|
||||
* The script name or node command is available at `argv.$0` similarly to how `$0` works in bash or perl.
|
||||
*
|
||||
* If `yargs` is executed in an environment that embeds node and there's no script name (e.g. Electron or nw.js),
|
||||
* it will ignore the first parameter since it expects it to be the script name. In order to override
|
||||
* this behavior, use `.parse(process.argv.slice(1))` instead of .argv and the first parameter won't be ignored.
|
||||
*/
|
||||
argv: { [key in keyof Arguments<T>]: Arguments<T>[key] };
|
||||
|
||||
/**
|
||||
* Tell the parser to interpret `key` as an array.
|
||||
* If `.array('foo')` is set, `--foo foo bar` will be parsed as `['foo', 'bar']` rather than as `'foo'`.
|
||||
* Also, if you use the option multiple times all the values will be flattened in one array so `--foo foo --foo bar` will be parsed as `['foo', 'bar']`
|
||||
*
|
||||
* When the option is used with a positional, use `--` to tell `yargs` to stop adding values to the array.
|
||||
*/
|
||||
array<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToArray<T[key]> }>;
|
||||
array<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: Array<string | number> | undefined }>;
|
||||
|
||||
/**
|
||||
* Interpret `key` as a boolean. If a non-flag option follows `key` in `process.argv`, that string won't get set as the value of `key`.
|
||||
*
|
||||
* `key` will default to `false`, unless a `default(key, undefined)` is explicitly set.
|
||||
*
|
||||
* If `key` is an array, interpret all the elements as booleans.
|
||||
*/
|
||||
boolean<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: boolean | undefined }>;
|
||||
boolean<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: boolean | undefined }>;
|
||||
|
||||
/**
|
||||
* Check that certain conditions are met in the provided arguments.
|
||||
* @param func Called with two arguments, the parsed `argv` hash and an array of options and their aliases.
|
||||
* If `func` throws or returns a non-truthy value, show the thrown error, usage information, and exit.
|
||||
* @param global Indicates whether `check()` should be enabled both at the top-level and for each sub-command.
|
||||
*/
|
||||
check(func: (argv: Arguments<T>, aliases: { [alias: string]: string }) => any, global?: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Limit valid values for key to a predefined set of choices, given as an array or as an individual value.
|
||||
* If this method is called multiple times, all enumerated values will be merged together.
|
||||
* Choices are generally strings or numbers, and value matching is case-sensitive.
|
||||
*
|
||||
* Optionally `.choices()` can take an object that maps multiple keys to their choices.
|
||||
*
|
||||
* Choices can also be specified as choices in the object given to `option()`.
|
||||
*/
|
||||
choices<K extends keyof T, C extends ReadonlyArray<any>>(key: K, values: C): Argv<Omit<T, K> & { [key in K]: C[number] | undefined }>;
|
||||
choices<K extends string, C extends ReadonlyArray<any>>(key: K, values: C): Argv<T & { [key in K]: C[number] | undefined }>;
|
||||
choices<C extends { [key: string]: ReadonlyArray<any> }>(choices: C): Argv<Omit<T, keyof C> & { [key in keyof C]: C[key][number] | undefined }>;
|
||||
|
||||
/**
|
||||
* Provide a synchronous function to coerce or transform the value(s) given on the command line for `key`.
|
||||
*
|
||||
* The coercion function should accept one argument, representing the parsed value from the command line, and should return a new value or throw an error.
|
||||
* The returned value will be used as the value for `key` (or one of its aliases) in `argv`.
|
||||
*
|
||||
* If the function throws, the error will be treated as a validation failure, delegating to either a custom `.fail()` handler or printing the error message in the console.
|
||||
*
|
||||
* Coercion will be applied to a value after all other modifications, such as `.normalize()`.
|
||||
*
|
||||
* Optionally `.coerce()` can take an object that maps several keys to their respective coercion function.
|
||||
*
|
||||
* You can also map the same function to several keys at one time. Just pass an array of keys as the first argument to `.coerce()`.
|
||||
*
|
||||
* If you are using dot-notion or arrays, .e.g., `user.email` and `user.password`, coercion will be applied to the final object that has been parsed
|
||||
*/
|
||||
coerce<K extends keyof T, V>(key: K | ReadonlyArray<K>, func: (arg: any) => V): Argv<Omit<T, K> & { [key in K]: V | undefined }>;
|
||||
coerce<K extends string, V>(key: K | ReadonlyArray<K>, func: (arg: any) => V): Argv<T & { [key in K]: V | undefined }>;
|
||||
coerce<O extends { [key: string]: (arg: any) => any }>(opts: O): Argv<Omit<T, keyof O> & { [key in keyof O]: ReturnType<O[key]> | undefined }>;
|
||||
|
||||
/**
|
||||
* Define the commands exposed by your application.
|
||||
* @param command Should be a string representing the command or an array of strings representing the command and its aliases.
|
||||
* @param description Use to provide a description for each command your application accepts (the values stored in `argv._`).
|
||||
* Set `description` to false to create a hidden command. Hidden commands don't show up in the help output and aren't available for completion.
|
||||
* @param [builder] Object to give hints about the options that your command accepts.
|
||||
* Can also be a function. This function is executed with a yargs instance, and can be used to provide advanced command specific help.
|
||||
*
|
||||
* Note that when `void` is returned, the handler `argv` object type will not include command-specific arguments.
|
||||
* @param [handler] Function, which will be executed with the parsed `argv` object.
|
||||
*/
|
||||
command<U = T>(
|
||||
command: string | ReadonlyArray<string>,
|
||||
description: string,
|
||||
builder?: BuilderCallback<T, U>,
|
||||
handler?: (args: Arguments<U>) => void,
|
||||
middlewares?: MiddlewareFunction[],
|
||||
deprecated?: boolean | string,
|
||||
): Argv<U>;
|
||||
command<O extends { [key: string]: Options }>(
|
||||
command: string | ReadonlyArray<string>,
|
||||
description: string,
|
||||
builder?: O,
|
||||
handler?: (args: Arguments<InferredOptionTypes<O>>) => void,
|
||||
middlewares?: MiddlewareFunction[],
|
||||
deprecated?: boolean | string,
|
||||
): Argv<T>;
|
||||
command<U>(command: string | ReadonlyArray<string>, description: string, module: CommandModule<T, U>): Argv<U>;
|
||||
command<U = T>(
|
||||
command: string | ReadonlyArray<string>,
|
||||
showInHelp: false,
|
||||
builder?: BuilderCallback<T, U>,
|
||||
handler?: (args: Arguments<U>) => void,
|
||||
middlewares?: MiddlewareFunction[],
|
||||
deprecated?: boolean | string,
|
||||
): Argv<T>;
|
||||
command<O extends { [key: string]: Options }>(
|
||||
command: string | ReadonlyArray<string>,
|
||||
showInHelp: false,
|
||||
builder?: O,
|
||||
handler?: (args: Arguments<InferredOptionTypes<O>>) => void,
|
||||
): Argv<T>;
|
||||
command<U>(command: string | ReadonlyArray<string>, showInHelp: false, module: CommandModule<T, U>): Argv<U>;
|
||||
command<U>(module: CommandModule<T, U>): Argv<U>;
|
||||
|
||||
// Advanced API
|
||||
/** Apply command modules from a directory relative to the module calling this method. */
|
||||
commandDir(dir: string, opts?: RequireDirectoryOptions): Argv<T>;
|
||||
|
||||
/**
|
||||
* Enable bash/zsh-completion shortcuts for commands and options.
|
||||
*
|
||||
* If invoked without parameters, `.completion()` will make completion the command to output the completion script.
|
||||
*
|
||||
* @param [cmd] When present in `argv._`, will result in the `.bashrc` or `.zshrc` completion script being outputted.
|
||||
* To enable bash/zsh completions, concat the generated script to your `.bashrc` or `.bash_profile` (or `.zshrc` for zsh).
|
||||
* @param [description] Provide a description in your usage instructions for the command that generates the completion scripts.
|
||||
* @param [func] Rather than relying on yargs' default completion functionality, which shiver me timbers is pretty awesome, you can provide your own completion method.
|
||||
*/
|
||||
completion(): Argv<T>;
|
||||
completion(cmd: string, func?: AsyncCompletionFunction): Argv<T>;
|
||||
completion(cmd: string, func?: SyncCompletionFunction): Argv<T>;
|
||||
completion(cmd: string, func?: PromiseCompletionFunction): Argv<T>;
|
||||
completion(cmd: string, description?: string | false, func?: AsyncCompletionFunction): Argv<T>;
|
||||
completion(cmd: string, description?: string | false, func?: SyncCompletionFunction): Argv<T>;
|
||||
completion(cmd: string, description?: string | false, func?: PromiseCompletionFunction): Argv<T>;
|
||||
|
||||
/**
|
||||
* Tells the parser that if the option specified by `key` is passed in, it should be interpreted as a path to a JSON config file.
|
||||
* The file is loaded and parsed, and its properties are set as arguments.
|
||||
* Because the file is loaded using Node's require(), the filename MUST end in `.json` to be interpreted correctly.
|
||||
*
|
||||
* If invoked without parameters, `.config()` will make --config the option to pass the JSON config file.
|
||||
*
|
||||
* @param [description] Provided to customize the config (`key`) option in the usage string.
|
||||
* @param [explicitConfigurationObject] An explicit configuration `object`
|
||||
*/
|
||||
config(): Argv<T>;
|
||||
config(key: string | ReadonlyArray<string>, description?: string, parseFn?: (configPath: string) => object): Argv<T>;
|
||||
config(key: string | ReadonlyArray<string>, parseFn: (configPath: string) => object): Argv<T>;
|
||||
config(explicitConfigurationObject: object): Argv<T>;
|
||||
|
||||
/**
|
||||
* Given the key `x` is set, the key `y` must not be set. `y` can either be a single string or an array of argument names that `x` conflicts with.
|
||||
*
|
||||
* Optionally `.conflicts()` can accept an object specifying multiple conflicting keys.
|
||||
*/
|
||||
conflicts(key: string, value: string | ReadonlyArray<string>): Argv<T>;
|
||||
conflicts(conflicts: { [key: string]: string | ReadonlyArray<string> }): Argv<T>;
|
||||
|
||||
/**
|
||||
* Interpret `key` as a boolean flag, but set its parsed value to the number of flag occurrences rather than `true` or `false`. Default value is thus `0`.
|
||||
*/
|
||||
count<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: number }>;
|
||||
count<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: number }>;
|
||||
|
||||
/**
|
||||
* Set `argv[key]` to `value` if no option was specified in `process.argv`.
|
||||
*
|
||||
* Optionally `.default()` can take an object that maps keys to default values.
|
||||
*
|
||||
* The default value can be a `function` which returns a value. The name of the function will be used in the usage string.
|
||||
*
|
||||
* Optionally, `description` can also be provided and will take precedence over displaying the value in the usage instructions.
|
||||
*/
|
||||
default<K extends keyof T, V>(key: K, value: V, description?: string): Argv<Omit<T, K> & { [key in K]: V }>;
|
||||
default<K extends string, V>(key: K, value: V, description?: string): Argv<T & { [key in K]: V }>;
|
||||
default<D extends { [key: string]: any }>(defaults: D, description?: string): Argv<Omit<T, keyof D> & D>;
|
||||
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use '.demandCommand()' or '.demandOption()' instead
|
||||
*/
|
||||
demand<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>;
|
||||
demand<K extends string>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<T & { [key in K]: unknown }>;
|
||||
demand(key: string | ReadonlyArray<string>, required?: boolean): Argv<T>;
|
||||
demand(positionals: number, msg: string): Argv<T>;
|
||||
demand(positionals: number, required?: boolean): Argv<T>;
|
||||
demand(positionals: number, max: number, msg?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* @param key If is a string, show the usage information and exit if key wasn't specified in `process.argv`.
|
||||
* If is an array, demand each element.
|
||||
* @param msg If string is given, it will be printed when the argument is missing, instead of the standard error message.
|
||||
* @param demand Controls whether the option is demanded; this is useful when using .options() to specify command line parameters.
|
||||
*/
|
||||
demandOption<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>;
|
||||
demandOption<K extends string>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<T & { [key in K]: unknown }>;
|
||||
demandOption(key: string | ReadonlyArray<string>, demand?: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Demand in context of commands.
|
||||
* You can demand a minimum and a maximum number a user can have within your program, as well as provide corresponding error messages if either of the demands is not met.
|
||||
*/
|
||||
demandCommand(): Argv<T>;
|
||||
demandCommand(min: number, minMsg?: string): Argv<T>;
|
||||
demandCommand(min: number, max?: number, minMsg?: string, maxMsg?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Shows a [deprecated] notice in front of the option
|
||||
*/
|
||||
deprecateOption(option: string, msg?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Describe a `key` for the generated usage information.
|
||||
*
|
||||
* Optionally `.describe()` can take an object that maps keys to descriptions.
|
||||
*/
|
||||
describe(key: string | ReadonlyArray<string>, description: string): Argv<T>;
|
||||
describe(descriptions: { [key: string]: string }): Argv<T>;
|
||||
|
||||
/** Should yargs attempt to detect the os' locale? Defaults to `true`. */
|
||||
detectLocale(detect: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Tell yargs to parse environment variables matching the given prefix and apply them to argv as though they were command line arguments.
|
||||
*
|
||||
* Use the "__" separator in the environment variable to indicate nested options. (e.g. prefix_nested__foo => nested.foo)
|
||||
*
|
||||
* If this method is called with no argument or with an empty string or with true, then all env vars will be applied to argv.
|
||||
*
|
||||
* Program arguments are defined in this order of precedence:
|
||||
* 1. Command line args
|
||||
* 2. Env vars
|
||||
* 3. Config file/objects
|
||||
* 4. Configured defaults
|
||||
*
|
||||
* Env var parsing is disabled by default, but you can also explicitly disable it by calling `.env(false)`, e.g. if you need to undo previous configuration.
|
||||
*/
|
||||
env(): Argv<T>;
|
||||
env(prefix: string): Argv<T>;
|
||||
env(enable: boolean): Argv<T>;
|
||||
|
||||
/** A message to print at the end of the usage instructions */
|
||||
epilog(msg: string): Argv<T>;
|
||||
/** A message to print at the end of the usage instructions */
|
||||
epilogue(msg: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Give some example invocations of your program.
|
||||
* Inside `cmd`, the string `$0` will get interpolated to the current script name or node command for the present script similar to how `$0` works in bash or perl.
|
||||
* Examples will be printed out as part of the help message.
|
||||
*/
|
||||
example(command: string, description: string): Argv<T>;
|
||||
example(command: ReadonlyArray<[string, string?]>): Argv<T>;
|
||||
|
||||
/** Manually indicate that the program should exit, and provide context about why we wanted to exit. Follows the behavior set by `.exitProcess().` */
|
||||
exit(code: number, err: Error): void;
|
||||
|
||||
/**
|
||||
* By default, yargs exits the process when the user passes a help flag, the user uses the `.version` functionality, validation fails, or the command handler fails.
|
||||
* Calling `.exitProcess(false)` disables this behavior, enabling further actions after yargs have been validated.
|
||||
*/
|
||||
exitProcess(enabled: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Method to execute when a failure occurs, rather than printing the failure message.
|
||||
* @param func Is called with the failure message that would have been printed, the Error instance originally thrown and yargs state when the failure occurred.
|
||||
*/
|
||||
fail(func: (msg: string, err: Error, yargs: Argv<T>) => any): Argv<T>;
|
||||
|
||||
/**
|
||||
* Allows to programmatically get completion choices for any line.
|
||||
* @param args An array of the words in the command line to complete.
|
||||
* @param done The callback to be called with the resulting completions.
|
||||
*/
|
||||
getCompletion(args: ReadonlyArray<string>, done: (completions: ReadonlyArray<string>) => void): Argv<T>;
|
||||
|
||||
/**
|
||||
* Indicate that an option (or group of options) should not be reset when a command is executed
|
||||
*
|
||||
* Options default to being global.
|
||||
*/
|
||||
global(key: string | ReadonlyArray<string>): Argv<T>;
|
||||
|
||||
/** Given a key, or an array of keys, places options under an alternative heading when displaying usage instructions */
|
||||
group(key: string | ReadonlyArray<string>, groupName: string): Argv<T>;
|
||||
|
||||
/** Hides a key from the generated usage information. Unless a `--show-hidden` option is also passed with `--help` (see `showHidden()`). */
|
||||
hide(key: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Configure an (e.g. `--help`) and implicit command that displays the usage string and exits the process.
|
||||
* By default yargs enables help on the `--help` option.
|
||||
*
|
||||
* Note that any multi-char aliases (e.g. `help`) used for the help option will also be used for the implicit command.
|
||||
* If there are no multi-char aliases (e.g. `h`), then all single-char aliases will be used for the command.
|
||||
*
|
||||
* If invoked without parameters, `.help()` will use `--help` as the option and help as the implicit command to trigger help output.
|
||||
*
|
||||
* @param [description] Customizes the description of the help option in the usage string.
|
||||
* @param [enableExplicit] If `false` is provided, it will disable --help.
|
||||
*/
|
||||
help(): Argv<T>;
|
||||
help(enableExplicit: boolean): Argv<T>;
|
||||
help(option: string, enableExplicit: boolean): Argv<T>;
|
||||
help(option: string, description?: string, enableExplicit?: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Given the key `x` is set, it is required that the key `y` is set.
|
||||
* y` can either be the name of an argument to imply, a number indicating the position of an argument or an array of multiple implications to associate with `x`.
|
||||
*
|
||||
* Optionally `.implies()` can accept an object specifying multiple implications.
|
||||
*/
|
||||
implies(key: string, value: string | ReadonlyArray<string>): Argv<T>;
|
||||
implies(implies: { [key: string]: string | ReadonlyArray<string> }): Argv<T>;
|
||||
|
||||
/**
|
||||
* Return the locale that yargs is currently using.
|
||||
*
|
||||
* By default, yargs will auto-detect the operating system's locale so that yargs-generated help content will display in the user's language.
|
||||
*/
|
||||
locale(): string;
|
||||
/**
|
||||
* Override the auto-detected locale from the user's operating system with a static locale.
|
||||
* Note that the OS locale can be modified by setting/exporting the `LC_ALL` environment variable.
|
||||
*/
|
||||
locale(loc: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Define global middleware functions to be called first, in list order, for all cli command.
|
||||
* @param callbacks Can be a function or a list of functions. Each callback gets passed a reference to argv.
|
||||
* @param [applyBeforeValidation] Set to `true` to apply middleware before validation. This will execute the middleware prior to validation checks, but after parsing.
|
||||
*/
|
||||
middleware(callbacks: MiddlewareFunction<T> | ReadonlyArray<MiddlewareFunction<T>>, applyBeforeValidation?: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* The number of arguments that should be consumed after a key. This can be a useful hint to prevent parsing ambiguity.
|
||||
*
|
||||
* Optionally `.nargs()` can take an object of `key`/`narg` pairs.
|
||||
*/
|
||||
nargs(key: string, count: number): Argv<T>;
|
||||
nargs(nargs: { [key: string]: number }): Argv<T>;
|
||||
|
||||
/** The key provided represents a path and should have `path.normalize()` applied. */
|
||||
normalize<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToString<T[key]> }>;
|
||||
normalize<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: string | undefined }>;
|
||||
|
||||
/**
|
||||
* Tell the parser to always interpret key as a number.
|
||||
*
|
||||
* If `key` is an array, all elements will be parsed as numbers.
|
||||
*
|
||||
* If the option is given on the command line without a value, `argv` will be populated with `undefined`.
|
||||
*
|
||||
* If the value given on the command line cannot be parsed as a number, `argv` will be populated with `NaN`.
|
||||
*
|
||||
* Note that decimals, hexadecimals, and scientific notation are all accepted.
|
||||
*/
|
||||
number<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToNumber<T[key]> }>;
|
||||
number<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: number | undefined }>;
|
||||
|
||||
/**
|
||||
* Method to execute when a command finishes successfully.
|
||||
* @param func Is called with the successful result of the command that finished.
|
||||
*/
|
||||
onFinishCommand(func: (result: any) => void): Argv<T>;
|
||||
|
||||
/**
|
||||
* This method can be used to make yargs aware of options that could exist.
|
||||
* You can also pass an opt object which can hold further customization, like `.alias()`, `.demandOption()` etc. for that option.
|
||||
*/
|
||||
option<K extends keyof T, O extends Options>(key: K, options: O): Argv<Omit<T, K> & { [key in K]: InferredOptionType<O> }>;
|
||||
option<K extends string, O extends Options>(key: K, options: O): Argv<T & { [key in K]: InferredOptionType<O> }>;
|
||||
option<O extends { [key: string]: Options }>(options: O): Argv<Omit<T, keyof O> & InferredOptionTypes<O>>;
|
||||
|
||||
/**
|
||||
* This method can be used to make yargs aware of options that could exist.
|
||||
* You can also pass an opt object which can hold further customization, like `.alias()`, `.demandOption()` etc. for that option.
|
||||
*/
|
||||
options<K extends keyof T, O extends Options>(key: K, options: O): Argv<Omit<T, K> & { [key in K]: InferredOptionType<O> }>;
|
||||
options<K extends string, O extends Options>(key: K, options: O): Argv<T & { [key in K]: InferredOptionType<O> }>;
|
||||
options<O extends { [key: string]: Options }>(options: O): Argv<Omit<T, keyof O> & InferredOptionTypes<O>>;
|
||||
|
||||
/**
|
||||
* Parse `args` instead of `process.argv`. Returns the `argv` object. `args` may either be a pre-processed argv array, or a raw argument string.
|
||||
*
|
||||
* Note: Providing a callback to parse() disables the `exitProcess` setting until after the callback is invoked.
|
||||
* @param [context] Provides a useful mechanism for passing state information to commands
|
||||
*/
|
||||
parse(): { [key in keyof Arguments<T>]: Arguments<T>[key] };
|
||||
parse(arg: string | ReadonlyArray<string>, context?: object, parseCallback?: ParseCallback<T>): { [key in keyof Arguments<T>]: Arguments<T>[key] };
|
||||
|
||||
/**
|
||||
* If the arguments have not been parsed, this property is `false`.
|
||||
*
|
||||
* If the arguments have been parsed, this contain detailed parsed arguments.
|
||||
*/
|
||||
parsed: DetailedArguments | false;
|
||||
|
||||
/** Allows to configure advanced yargs features. */
|
||||
parserConfiguration(configuration: Partial<ParserConfigurationOptions>): Argv<T>;
|
||||
|
||||
/**
|
||||
* Similar to `config()`, indicates that yargs should interpret the object from the specified key in package.json as a configuration object.
|
||||
* @param [cwd] If provided, the package.json will be read from this location
|
||||
*/
|
||||
pkgConf(key: string | ReadonlyArray<string>, cwd?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Allows you to configure a command's positional arguments with an API similar to `.option()`.
|
||||
* `.positional()` should be called in a command's builder function, and is not available on the top-level yargs instance. If so, it will throw an error.
|
||||
*/
|
||||
positional<K extends keyof T, O extends PositionalOptions>(key: K, opt: O): Argv<Omit<T, K> & { [key in K]: InferredOptionType<O> }>;
|
||||
positional<K extends string, O extends PositionalOptions>(key: K, opt: O): Argv<T & { [key in K]: InferredOptionType<O> }>;
|
||||
|
||||
/** Should yargs provide suggestions regarding similar commands if no matching command is found? */
|
||||
recommendCommands(): Argv<T>;
|
||||
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use '.demandCommand()' or '.demandOption()' instead
|
||||
*/
|
||||
require<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>;
|
||||
require(key: string, msg: string): Argv<T>;
|
||||
require(key: string, required: boolean): Argv<T>;
|
||||
require(keys: ReadonlyArray<number>, msg: string): Argv<T>;
|
||||
require(keys: ReadonlyArray<number>, required: boolean): Argv<T>;
|
||||
require(positionals: number, required: boolean): Argv<T>;
|
||||
require(positionals: number, msg: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use '.demandCommand()' or '.demandOption()' instead
|
||||
*/
|
||||
required<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>;
|
||||
required(key: string, msg: string): Argv<T>;
|
||||
required(key: string, required: boolean): Argv<T>;
|
||||
required(keys: ReadonlyArray<number>, msg: string): Argv<T>;
|
||||
required(keys: ReadonlyArray<number>, required: boolean): Argv<T>;
|
||||
required(positionals: number, required: boolean): Argv<T>;
|
||||
required(positionals: number, msg: string): Argv<T>;
|
||||
|
||||
requiresArg(key: string | ReadonlyArray<string>): Argv<T>;
|
||||
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use '.global()' instead
|
||||
*/
|
||||
reset(): Argv<T>;
|
||||
|
||||
/** Set the name of your script ($0). Default is the base filename executed by node (`process.argv[1]`) */
|
||||
scriptName($0: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Generate a bash completion script.
|
||||
* Users of your application can install this script in their `.bashrc`, and yargs will provide completion shortcuts for commands and options.
|
||||
*/
|
||||
showCompletionScript(): Argv<T>;
|
||||
|
||||
/**
|
||||
* Configure the `--show-hidden` option that displays the hidden keys (see `hide()`).
|
||||
* @param option If `boolean`, it enables/disables this option altogether. i.e. hidden keys will be permanently hidden if first argument is `false`.
|
||||
* If `string` it changes the key name ("--show-hidden").
|
||||
* @param description Changes the default description ("Show hidden options")
|
||||
*/
|
||||
showHidden(option?: string | boolean): Argv<T>;
|
||||
showHidden(option: string, description?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Print the usage data using the console function consoleLevel for printing.
|
||||
* @param [consoleLevel='error']
|
||||
*/
|
||||
showHelp(consoleLevel?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Provide the usage data as a string.
|
||||
* @param printCallback a function with a single argument.
|
||||
*/
|
||||
showHelp(printCallback: (s: string) => void): Argv<T>;
|
||||
|
||||
/**
|
||||
* By default, yargs outputs a usage string if any error is detected.
|
||||
* Use the `.showHelpOnFail()` method to customize this behavior.
|
||||
* @param enable If `false`, the usage string is not output.
|
||||
* @param [message] Message that is output after the error message.
|
||||
*/
|
||||
showHelpOnFail(enable: boolean, message?: string): Argv<T>;
|
||||
|
||||
/** Specifies either a single option key (string), or an array of options. If any of the options is present, yargs validation is skipped. */
|
||||
skipValidation(key: string | ReadonlyArray<string>): Argv<T>;
|
||||
|
||||
/**
|
||||
* Any command-line argument given that is not demanded, or does not have a corresponding description, will be reported as an error.
|
||||
*
|
||||
* Unrecognized commands will also be reported as errors.
|
||||
*/
|
||||
strict(): Argv<T>;
|
||||
strict(enabled: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Similar to `.strict()`, except that it only applies to unrecognized options. A
|
||||
* user can still provide arbitrary positional options, but unknown options
|
||||
* will raise an error.
|
||||
*/
|
||||
strictOptions(): Argv<T>;
|
||||
strictOptions(enabled: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Tell the parser logic not to interpret `key` as a number or boolean. This can be useful if you need to preserve leading zeros in an input.
|
||||
*
|
||||
* If `key` is an array, interpret all the elements as strings.
|
||||
*
|
||||
* `.string('_')` will result in non-hyphenated arguments being interpreted as strings, regardless of whether they resemble numbers.
|
||||
*/
|
||||
string<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToString<T[key]> }>;
|
||||
string<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: string | undefined }>;
|
||||
|
||||
// Intended to be used with '.wrap()'
|
||||
terminalWidth(): number;
|
||||
|
||||
updateLocale(obj: { [key: string]: string }): Argv<T>;
|
||||
|
||||
/**
|
||||
* Override the default strings used by yargs with the key/value pairs provided in obj
|
||||
*
|
||||
* If you explicitly specify a locale(), you should do so before calling `updateStrings()`.
|
||||
*/
|
||||
updateStrings(obj: { [key: string]: string }): Argv<T>;
|
||||
|
||||
/**
|
||||
* Set a usage message to show which commands to use.
|
||||
* Inside `message`, the string `$0` will get interpolated to the current script name or node command for the present script similar to how `$0` works in bash or perl.
|
||||
*
|
||||
* If the optional `description`/`builder`/`handler` are provided, `.usage()` acts an an alias for `.command()`.
|
||||
* This allows you to use `.usage()` to configure the default command that will be run as an entry-point to your application
|
||||
* and allows you to provide configuration for the positional arguments accepted by your program:
|
||||
*/
|
||||
usage(message: string): Argv<T>;
|
||||
usage<U>(command: string | ReadonlyArray<string>, description: string, builder?: (args: Argv<T>) => Argv<U>, handler?: (args: Arguments<U>) => void): Argv<T>;
|
||||
usage<U>(command: string | ReadonlyArray<string>, showInHelp: boolean, builder?: (args: Argv<T>) => Argv<U>, handler?: (args: Arguments<U>) => void): Argv<T>;
|
||||
usage<O extends { [key: string]: Options }>(command: string | ReadonlyArray<string>, description: string, builder?: O, handler?: (args: Arguments<InferredOptionTypes<O>>) => void): Argv<T>;
|
||||
usage<O extends { [key: string]: Options }>(command: string | ReadonlyArray<string>, showInHelp: boolean, builder?: O, handler?: (args: Arguments<InferredOptionTypes<O>>) => void): Argv<T>;
|
||||
|
||||
/**
|
||||
* Add an option (e.g. `--version`) that displays the version number (given by the version parameter) and exits the process.
|
||||
* By default yargs enables version for the `--version` option.
|
||||
*
|
||||
* If no arguments are passed to version (`.version()`), yargs will parse the package.json of your module and use its version value.
|
||||
*
|
||||
* If the boolean argument `false` is provided, it will disable `--version`.
|
||||
*/
|
||||
version(): Argv<T>;
|
||||
version(version: string): Argv<T>;
|
||||
version(enable: boolean): Argv<T>;
|
||||
version(optionKey: string, version: string): Argv<T>;
|
||||
version(optionKey: string, description: string, version: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Format usage output to wrap at columns many columns.
|
||||
*
|
||||
* By default wrap will be set to `Math.min(80, windowWidth)`. Use `.wrap(null)` to specify no column limit (no right-align).
|
||||
* Use `.wrap(yargs.terminalWidth())` to maximize the width of yargs' usage instructions.
|
||||
*/
|
||||
wrap(columns: number | null): Argv<T>;
|
||||
}
|
||||
|
||||
type Arguments<T = {}> = T & {
|
||||
/** Non-option arguments */
|
||||
_: string[];
|
||||
/** The script name or node command */
|
||||
$0: string;
|
||||
/** All remaining options */
|
||||
[argName: string]: unknown;
|
||||
};
|
||||
|
||||
interface RequireDirectoryOptions {
|
||||
/** Look for command modules in all subdirectories and apply them as a flattened (non-hierarchical) list. */
|
||||
recurse?: boolean;
|
||||
/** The types of files to look for when requiring command modules. */
|
||||
extensions?: ReadonlyArray<string>;
|
||||
/**
|
||||
* A synchronous function called for each command module encountered.
|
||||
* Accepts `commandObject`, `pathToFile`, and `filename` as arguments.
|
||||
* Returns `commandObject` to include the command; any falsy value to exclude/skip it.
|
||||
*/
|
||||
visit?: (commandObject: any, pathToFile?: string, filename?: string) => any;
|
||||
/** Whitelist certain modules */
|
||||
include?: RegExp | ((pathToFile: string) => boolean);
|
||||
/** Blacklist certain modules. */
|
||||
exclude?: RegExp | ((pathToFile: string) => boolean);
|
||||
}
|
||||
|
||||
interface Options {
|
||||
/** string or array of strings, alias(es) for the canonical option key, see `alias()` */
|
||||
alias?: string | ReadonlyArray<string>;
|
||||
/** boolean, interpret option as an array, see `array()` */
|
||||
array?: boolean;
|
||||
/** boolean, interpret option as a boolean flag, see `boolean()` */
|
||||
boolean?: boolean;
|
||||
/** value or array of values, limit valid option arguments to a predefined set, see `choices()` */
|
||||
choices?: Choices;
|
||||
/** function, coerce or transform parsed command line values into another value, see `coerce()` */
|
||||
coerce?: (arg: any) => any;
|
||||
/** boolean, interpret option as a path to a JSON config file, see `config()` */
|
||||
config?: boolean;
|
||||
/** function, provide a custom config parsing function, see `config()` */
|
||||
configParser?: (configPath: string) => object;
|
||||
/** string or object, require certain keys not to be set, see `conflicts()` */
|
||||
conflicts?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> };
|
||||
/** boolean, interpret option as a count of boolean flags, see `count()` */
|
||||
count?: boolean;
|
||||
/** value, set a default value for the option, see `default()` */
|
||||
default?: any;
|
||||
/** string, use this description for the default value in help content, see `default()` */
|
||||
defaultDescription?: string;
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use 'demandOption' instead
|
||||
*/
|
||||
demand?: boolean | string;
|
||||
/** boolean or string, mark the argument as deprecated, see `deprecateOption()` */
|
||||
deprecate?: boolean | string;
|
||||
/** boolean or string, mark the argument as deprecated, see `deprecateOption()` */
|
||||
deprecated?: boolean | string;
|
||||
/** boolean or string, demand the option be given, with optional error message, see `demandOption()` */
|
||||
demandOption?: boolean | string;
|
||||
/** string, the option description for help content, see `describe()` */
|
||||
desc?: string;
|
||||
/** string, the option description for help content, see `describe()` */
|
||||
describe?: string;
|
||||
/** string, the option description for help content, see `describe()` */
|
||||
description?: string;
|
||||
/** boolean, indicate that this key should not be reset when a command is invoked, see `global()` */
|
||||
global?: boolean;
|
||||
/** string, when displaying usage instructions place the option under an alternative group heading, see `group()` */
|
||||
group?: string;
|
||||
/** don't display option in help output. */
|
||||
hidden?: boolean;
|
||||
/** string or object, require certain keys to be set, see `implies()` */
|
||||
implies?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> };
|
||||
/** number, specify how many arguments should be consumed for the option, see `nargs()` */
|
||||
nargs?: number;
|
||||
/** boolean, apply path.normalize() to the option, see `normalize()` */
|
||||
normalize?: boolean;
|
||||
/** boolean, interpret option as a number, `number()` */
|
||||
number?: boolean;
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use 'demandOption' instead
|
||||
*/
|
||||
require?: boolean | string;
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use 'demandOption' instead
|
||||
*/
|
||||
required?: boolean | string;
|
||||
/** boolean, require the option be specified with a value, see `requiresArg()` */
|
||||
requiresArg?: boolean;
|
||||
/** boolean, skips validation if the option is present, see `skipValidation()` */
|
||||
skipValidation?: boolean;
|
||||
/** boolean, interpret option as a string, see `string()` */
|
||||
string?: boolean;
|
||||
type?: "array" | "count" | PositionalOptionsType;
|
||||
}
|
||||
|
||||
interface PositionalOptions {
|
||||
/** string or array of strings, see `alias()` */
|
||||
alias?: string | ReadonlyArray<string>;
|
||||
/** boolean, interpret option as an array, see `array()` */
|
||||
array?: boolean;
|
||||
/** value or array of values, limit valid option arguments to a predefined set, see `choices()` */
|
||||
choices?: Choices;
|
||||
/** function, coerce or transform parsed command line values into another value, see `coerce()` */
|
||||
coerce?: (arg: any) => any;
|
||||
/** string or object, require certain keys not to be set, see `conflicts()` */
|
||||
conflicts?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> };
|
||||
/** value, set a default value for the option, see `default()` */
|
||||
default?: any;
|
||||
/** boolean or string, demand the option be given, with optional error message, see `demandOption()` */
|
||||
demandOption?: boolean | string;
|
||||
/** string, the option description for help content, see `describe()` */
|
||||
desc?: string;
|
||||
/** string, the option description for help content, see `describe()` */
|
||||
describe?: string;
|
||||
/** string, the option description for help content, see `describe()` */
|
||||
description?: string;
|
||||
/** string or object, require certain keys to be set, see `implies()` */
|
||||
implies?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> };
|
||||
/** boolean, apply path.normalize() to the option, see normalize() */
|
||||
normalize?: boolean;
|
||||
type?: PositionalOptionsType;
|
||||
}
|
||||
|
||||
/** Remove keys K in T */
|
||||
type Omit<T, K> = { [key in Exclude<keyof T, K>]: T[key] };
|
||||
|
||||
/** Remove undefined as a possible value for keys K in T */
|
||||
type Defined<T, K extends keyof T> = Omit<T, K> & { [key in K]: Exclude<T[key], undefined> };
|
||||
|
||||
/** Convert T to T[] and T | undefined to T[] | undefined */
|
||||
type ToArray<T> = Array<Exclude<T, undefined>> | Extract<T, undefined>;
|
||||
|
||||
/** Gives string[] if T is an array type, otherwise string. Preserves | undefined. */
|
||||
type ToString<T> = (Exclude<T, undefined> extends any[] ? string[] : string) | Extract<T, undefined>;
|
||||
|
||||
/** Gives number[] if T is an array type, otherwise number. Preserves | undefined. */
|
||||
type ToNumber<T> = (Exclude<T, undefined> extends any[] ? number[] : number) | Extract<T, undefined>;
|
||||
|
||||
type InferredOptionType<O extends Options | PositionalOptions> =
|
||||
O extends { default: infer D } ? D :
|
||||
O extends { type: "count" } ? number :
|
||||
O extends { count: true } ? number :
|
||||
O extends { required: string | true } ? RequiredOptionType<O> :
|
||||
O extends { require: string | true } ? RequiredOptionType<O> :
|
||||
O extends { demand: string | true } ? RequiredOptionType<O> :
|
||||
O extends { demandOption: string | true } ? RequiredOptionType<O> :
|
||||
RequiredOptionType<O> | undefined;
|
||||
|
||||
type RequiredOptionType<O extends Options | PositionalOptions> =
|
||||
O extends { type: "array", string: true } ? string[] :
|
||||
O extends { type: "array", number: true } ? number[] :
|
||||
O extends { type: "array", normalize: true } ? string[] :
|
||||
O extends { type: "string", array: true } ? string[] :
|
||||
O extends { type: "number", array: true } ? number[] :
|
||||
O extends { string: true, array: true } ? string[] :
|
||||
O extends { number: true, array: true } ? number[] :
|
||||
O extends { normalize: true, array: true } ? string[] :
|
||||
O extends { type: "array" } ? Array<string | number> :
|
||||
O extends { type: "boolean" } ? boolean :
|
||||
O extends { type: "number" } ? number :
|
||||
O extends { type: "string" } ? string :
|
||||
O extends { array: true } ? Array<string | number> :
|
||||
O extends { boolean: true } ? boolean :
|
||||
O extends { number: true } ? number :
|
||||
O extends { string: true } ? string :
|
||||
O extends { normalize: true } ? string :
|
||||
O extends { choices: ReadonlyArray<infer C> } ? C :
|
||||
O extends { coerce: (arg: any) => infer T } ? T :
|
||||
unknown;
|
||||
|
||||
type InferredOptionTypes<O extends { [key: string]: Options }> = { [key in keyof O]: InferredOptionType<O[key]> };
|
||||
|
||||
interface CommandModule<T = {}, U = {}> {
|
||||
/** array of strings (or a single string) representing aliases of `exports.command`, positional args defined in an alias are ignored */
|
||||
aliases?: ReadonlyArray<string> | string;
|
||||
/** object declaring the options the command accepts, or a function accepting and returning a yargs instance */
|
||||
builder?: CommandBuilder<T, U>;
|
||||
/** string (or array of strings) that executes this command when given on the command line, first string may contain positional args */
|
||||
command?: ReadonlyArray<string> | string;
|
||||
/** boolean (or string) to show deprecation notice */
|
||||
deprecated?: boolean | string;
|
||||
/** string used as the description for the command in help text, use `false` for a hidden command */
|
||||
describe?: string | false;
|
||||
/** a function which will be passed the parsed argv. */
|
||||
handler: (args: Arguments<U>) => void;
|
||||
}
|
||||
|
||||
type ParseCallback<T = {}> = (err: Error | undefined, argv: Arguments<T>, output: string) => void;
|
||||
type CommandBuilder<T = {}, U = {}> = { [key: string]: Options } | ((args: Argv<T>) => Argv<U>) | ((args: Argv<T>) => PromiseLike<Argv<U>>);
|
||||
type SyncCompletionFunction = (current: string, argv: any) => string[];
|
||||
type AsyncCompletionFunction = (current: string, argv: any, done: (completion: ReadonlyArray<string>) => void) => void;
|
||||
type PromiseCompletionFunction = (current: string, argv: any) => Promise<string[]>;
|
||||
type MiddlewareFunction<T = {}> = (args: Arguments<T>) => void;
|
||||
type Choices = ReadonlyArray<string | number | true | undefined>;
|
||||
type PositionalOptionsType = "boolean" | "number" | "string";
|
||||
}
|
||||
|
||||
declare var yargs: yargs.Argv;
|
||||
export = yargs;
|
||||
83
node_modules/ts-jest/node_modules/@types/yargs/package.json
generated
vendored
Normal file
83
node_modules/ts-jest/node_modules/@types/yargs/package.json
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"_from": "@types/yargs@^15.0.0",
|
||||
"_id": "@types/yargs@15.0.9",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-HmU8SeIRhZCWcnRskCs36Q1Q00KBV6Cqh/ora8WN1+22dY07AZdn6Gel8QZ3t26XYPImtcL8WV/eqjhVmMEw4g==",
|
||||
"_location": "/ts-jest/@types/yargs",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@types/yargs@^15.0.0",
|
||||
"name": "@types/yargs",
|
||||
"escapedName": "@types%2fyargs",
|
||||
"scope": "@types",
|
||||
"rawSpec": "^15.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^15.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/ts-jest/@jest/types"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.9.tgz",
|
||||
"_shasum": "524cd7998fe810cdb02f26101b699cccd156ff19",
|
||||
"_spec": "@types/yargs@^15.0.0",
|
||||
"_where": "/home/codespace/workspace/upload-google-play/node_modules/ts-jest/node_modules/@jest/types",
|
||||
"bugs": {
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Martin Poelstra",
|
||||
"url": "https://github.com/poelstra"
|
||||
},
|
||||
{
|
||||
"name": "Mizunashi Mana",
|
||||
"url": "https://github.com/mizunashi-mana"
|
||||
},
|
||||
{
|
||||
"name": "Jeffery Grajkowski",
|
||||
"url": "https://github.com/pushplay"
|
||||
},
|
||||
{
|
||||
"name": "Jimi",
|
||||
"url": "Dimitris"
|
||||
},
|
||||
{
|
||||
"name": "Steffen Viken Valvåg",
|
||||
"url": "https://github.com/steffenvv"
|
||||
},
|
||||
{
|
||||
"name": "Emily Marigold Klassen",
|
||||
"url": "https://github.com/forivall"
|
||||
},
|
||||
{
|
||||
"name": "ExE Boss",
|
||||
"url": "https://github.com/ExE-Boss"
|
||||
},
|
||||
{
|
||||
"name": "Aankhen",
|
||||
"url": "https://github.com/Aankhen"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"@types/yargs-parser": "*"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "TypeScript definitions for yargs",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
|
||||
"license": "MIT",
|
||||
"main": "",
|
||||
"name": "@types/yargs",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/yargs"
|
||||
},
|
||||
"scripts": {},
|
||||
"typeScriptVersion": "3.2",
|
||||
"types": "index.d.ts",
|
||||
"typesPublisherContentHash": "4594ba115356a9ffac78ebfc7bb6880e4c7401ac75a560a444a935955eb1d274",
|
||||
"version": "15.0.9"
|
||||
}
|
||||
9
node_modules/ts-jest/node_modules/@types/yargs/yargs.d.ts
generated
vendored
Normal file
9
node_modules/ts-jest/node_modules/@types/yargs/yargs.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Argv } from '.';
|
||||
|
||||
export = Yargs;
|
||||
|
||||
declare function Yargs(
|
||||
processArgs?: ReadonlyArray<string>,
|
||||
cwd?: string,
|
||||
parentRequire?: NodeRequire,
|
||||
): Argv;
|
||||
37
node_modules/ts-jest/node_modules/ansi-regex/index.d.ts
generated
vendored
Normal file
37
node_modules/ts-jest/node_modules/ansi-regex/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
declare namespace ansiRegex {
|
||||
interface Options {
|
||||
/**
|
||||
Match only the first ANSI escape.
|
||||
|
||||
@default false
|
||||
*/
|
||||
onlyFirst: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Regular expression for matching ANSI escape codes.
|
||||
|
||||
@example
|
||||
```
|
||||
import ansiRegex = require('ansi-regex');
|
||||
|
||||
ansiRegex().test('\u001B[4mcake\u001B[0m');
|
||||
//=> true
|
||||
|
||||
ansiRegex().test('cake');
|
||||
//=> false
|
||||
|
||||
'\u001B[4mcake\u001B[0m'.match(ansiRegex());
|
||||
//=> ['\u001B[4m', '\u001B[0m']
|
||||
|
||||
'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
|
||||
//=> ['\u001B[4m']
|
||||
|
||||
'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
|
||||
//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
|
||||
```
|
||||
*/
|
||||
declare function ansiRegex(options?: ansiRegex.Options): RegExp;
|
||||
|
||||
export = ansiRegex;
|
||||
10
node_modules/ts-jest/node_modules/ansi-regex/index.js
generated
vendored
Normal file
10
node_modules/ts-jest/node_modules/ansi-regex/index.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = ({onlyFirst = false} = {}) => {
|
||||
const pattern = [
|
||||
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
|
||||
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
|
||||
].join('|');
|
||||
|
||||
return new RegExp(pattern, onlyFirst ? undefined : 'g');
|
||||
};
|
||||
9
node_modules/ts-jest/node_modules/ansi-regex/license
generated
vendored
Normal file
9
node_modules/ts-jest/node_modules/ansi-regex/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
87
node_modules/ts-jest/node_modules/ansi-regex/package.json
generated
vendored
Normal file
87
node_modules/ts-jest/node_modules/ansi-regex/package.json
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
{
|
||||
"_from": "ansi-regex@^5.0.0",
|
||||
"_id": "ansi-regex@5.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
|
||||
"_location": "/ts-jest/ansi-regex",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "ansi-regex@^5.0.0",
|
||||
"name": "ansi-regex",
|
||||
"escapedName": "ansi-regex",
|
||||
"rawSpec": "^5.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^5.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/ts-jest/pretty-format"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
|
||||
"_shasum": "388539f55179bf39339c81af30a654d69f87cb75",
|
||||
"_spec": "ansi-regex@^5.0.0",
|
||||
"_where": "/home/codespace/workspace/upload-google-play/node_modules/ts-jest/node_modules/pretty-format",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/chalk/ansi-regex/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Regular expression for matching ANSI escape codes",
|
||||
"devDependencies": {
|
||||
"ava": "^2.4.0",
|
||||
"tsd": "^0.9.0",
|
||||
"xo": "^0.25.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"homepage": "https://github.com/chalk/ansi-regex#readme",
|
||||
"keywords": [
|
||||
"ansi",
|
||||
"styles",
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"string",
|
||||
"tty",
|
||||
"escape",
|
||||
"formatting",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"command-line",
|
||||
"text",
|
||||
"regex",
|
||||
"regexp",
|
||||
"re",
|
||||
"match",
|
||||
"test",
|
||||
"find",
|
||||
"pattern"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "ansi-regex",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/chalk/ansi-regex.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd",
|
||||
"view-supported": "node fixtures/view-codes.js"
|
||||
},
|
||||
"version": "5.0.0"
|
||||
}
|
||||
78
node_modules/ts-jest/node_modules/ansi-regex/readme.md
generated
vendored
Normal file
78
node_modules/ts-jest/node_modules/ansi-regex/readme.md
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
# ansi-regex [](https://travis-ci.org/chalk/ansi-regex)
|
||||
|
||||
> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install ansi-regex
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const ansiRegex = require('ansi-regex');
|
||||
|
||||
ansiRegex().test('\u001B[4mcake\u001B[0m');
|
||||
//=> true
|
||||
|
||||
ansiRegex().test('cake');
|
||||
//=> false
|
||||
|
||||
'\u001B[4mcake\u001B[0m'.match(ansiRegex());
|
||||
//=> ['\u001B[4m', '\u001B[0m']
|
||||
|
||||
'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
|
||||
//=> ['\u001B[4m']
|
||||
|
||||
'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
|
||||
//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### ansiRegex(options?)
|
||||
|
||||
Returns a regex for matching ANSI escape codes.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### onlyFirst
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false` *(Matches any ANSI escape codes in a string)*
|
||||
|
||||
Match only the first ANSI escape.
|
||||
|
||||
|
||||
## FAQ
|
||||
|
||||
### Why do you test for codes not in the ECMA 48 standard?
|
||||
|
||||
Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them.
|
||||
|
||||
On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out.
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-ansi-regex?utm_source=npm-ansi-regex&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
345
node_modules/ts-jest/node_modules/ansi-styles/index.d.ts
generated
vendored
Normal file
345
node_modules/ts-jest/node_modules/ansi-styles/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,345 @@
|
||||
declare type CSSColor =
|
||||
| 'aliceblue'
|
||||
| 'antiquewhite'
|
||||
| 'aqua'
|
||||
| 'aquamarine'
|
||||
| 'azure'
|
||||
| 'beige'
|
||||
| 'bisque'
|
||||
| 'black'
|
||||
| 'blanchedalmond'
|
||||
| 'blue'
|
||||
| 'blueviolet'
|
||||
| 'brown'
|
||||
| 'burlywood'
|
||||
| 'cadetblue'
|
||||
| 'chartreuse'
|
||||
| 'chocolate'
|
||||
| 'coral'
|
||||
| 'cornflowerblue'
|
||||
| 'cornsilk'
|
||||
| 'crimson'
|
||||
| 'cyan'
|
||||
| 'darkblue'
|
||||
| 'darkcyan'
|
||||
| 'darkgoldenrod'
|
||||
| 'darkgray'
|
||||
| 'darkgreen'
|
||||
| 'darkgrey'
|
||||
| 'darkkhaki'
|
||||
| 'darkmagenta'
|
||||
| 'darkolivegreen'
|
||||
| 'darkorange'
|
||||
| 'darkorchid'
|
||||
| 'darkred'
|
||||
| 'darksalmon'
|
||||
| 'darkseagreen'
|
||||
| 'darkslateblue'
|
||||
| 'darkslategray'
|
||||
| 'darkslategrey'
|
||||
| 'darkturquoise'
|
||||
| 'darkviolet'
|
||||
| 'deeppink'
|
||||
| 'deepskyblue'
|
||||
| 'dimgray'
|
||||
| 'dimgrey'
|
||||
| 'dodgerblue'
|
||||
| 'firebrick'
|
||||
| 'floralwhite'
|
||||
| 'forestgreen'
|
||||
| 'fuchsia'
|
||||
| 'gainsboro'
|
||||
| 'ghostwhite'
|
||||
| 'gold'
|
||||
| 'goldenrod'
|
||||
| 'gray'
|
||||
| 'green'
|
||||
| 'greenyellow'
|
||||
| 'grey'
|
||||
| 'honeydew'
|
||||
| 'hotpink'
|
||||
| 'indianred'
|
||||
| 'indigo'
|
||||
| 'ivory'
|
||||
| 'khaki'
|
||||
| 'lavender'
|
||||
| 'lavenderblush'
|
||||
| 'lawngreen'
|
||||
| 'lemonchiffon'
|
||||
| 'lightblue'
|
||||
| 'lightcoral'
|
||||
| 'lightcyan'
|
||||
| 'lightgoldenrodyellow'
|
||||
| 'lightgray'
|
||||
| 'lightgreen'
|
||||
| 'lightgrey'
|
||||
| 'lightpink'
|
||||
| 'lightsalmon'
|
||||
| 'lightseagreen'
|
||||
| 'lightskyblue'
|
||||
| 'lightslategray'
|
||||
| 'lightslategrey'
|
||||
| 'lightsteelblue'
|
||||
| 'lightyellow'
|
||||
| 'lime'
|
||||
| 'limegreen'
|
||||
| 'linen'
|
||||
| 'magenta'
|
||||
| 'maroon'
|
||||
| 'mediumaquamarine'
|
||||
| 'mediumblue'
|
||||
| 'mediumorchid'
|
||||
| 'mediumpurple'
|
||||
| 'mediumseagreen'
|
||||
| 'mediumslateblue'
|
||||
| 'mediumspringgreen'
|
||||
| 'mediumturquoise'
|
||||
| 'mediumvioletred'
|
||||
| 'midnightblue'
|
||||
| 'mintcream'
|
||||
| 'mistyrose'
|
||||
| 'moccasin'
|
||||
| 'navajowhite'
|
||||
| 'navy'
|
||||
| 'oldlace'
|
||||
| 'olive'
|
||||
| 'olivedrab'
|
||||
| 'orange'
|
||||
| 'orangered'
|
||||
| 'orchid'
|
||||
| 'palegoldenrod'
|
||||
| 'palegreen'
|
||||
| 'paleturquoise'
|
||||
| 'palevioletred'
|
||||
| 'papayawhip'
|
||||
| 'peachpuff'
|
||||
| 'peru'
|
||||
| 'pink'
|
||||
| 'plum'
|
||||
| 'powderblue'
|
||||
| 'purple'
|
||||
| 'rebeccapurple'
|
||||
| 'red'
|
||||
| 'rosybrown'
|
||||
| 'royalblue'
|
||||
| 'saddlebrown'
|
||||
| 'salmon'
|
||||
| 'sandybrown'
|
||||
| 'seagreen'
|
||||
| 'seashell'
|
||||
| 'sienna'
|
||||
| 'silver'
|
||||
| 'skyblue'
|
||||
| 'slateblue'
|
||||
| 'slategray'
|
||||
| 'slategrey'
|
||||
| 'snow'
|
||||
| 'springgreen'
|
||||
| 'steelblue'
|
||||
| 'tan'
|
||||
| 'teal'
|
||||
| 'thistle'
|
||||
| 'tomato'
|
||||
| 'turquoise'
|
||||
| 'violet'
|
||||
| 'wheat'
|
||||
| 'white'
|
||||
| 'whitesmoke'
|
||||
| 'yellow'
|
||||
| 'yellowgreen';
|
||||
|
||||
declare namespace ansiStyles {
|
||||
interface ColorConvert {
|
||||
/**
|
||||
The RGB color space.
|
||||
|
||||
@param red - (`0`-`255`)
|
||||
@param green - (`0`-`255`)
|
||||
@param blue - (`0`-`255`)
|
||||
*/
|
||||
rgb(red: number, green: number, blue: number): string;
|
||||
|
||||
/**
|
||||
The RGB HEX color space.
|
||||
|
||||
@param hex - A hexadecimal string containing RGB data.
|
||||
*/
|
||||
hex(hex: string): string;
|
||||
|
||||
/**
|
||||
@param keyword - A CSS color name.
|
||||
*/
|
||||
keyword(keyword: CSSColor): string;
|
||||
|
||||
/**
|
||||
The HSL color space.
|
||||
|
||||
@param hue - (`0`-`360`)
|
||||
@param saturation - (`0`-`100`)
|
||||
@param lightness - (`0`-`100`)
|
||||
*/
|
||||
hsl(hue: number, saturation: number, lightness: number): string;
|
||||
|
||||
/**
|
||||
The HSV color space.
|
||||
|
||||
@param hue - (`0`-`360`)
|
||||
@param saturation - (`0`-`100`)
|
||||
@param value - (`0`-`100`)
|
||||
*/
|
||||
hsv(hue: number, saturation: number, value: number): string;
|
||||
|
||||
/**
|
||||
The HSV color space.
|
||||
|
||||
@param hue - (`0`-`360`)
|
||||
@param whiteness - (`0`-`100`)
|
||||
@param blackness - (`0`-`100`)
|
||||
*/
|
||||
hwb(hue: number, whiteness: number, blackness: number): string;
|
||||
|
||||
/**
|
||||
Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color.
|
||||
*/
|
||||
ansi(ansi: number): string;
|
||||
|
||||
/**
|
||||
Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color.
|
||||
*/
|
||||
ansi256(ansi: number): string;
|
||||
}
|
||||
|
||||
interface CSPair {
|
||||
/**
|
||||
The ANSI terminal control sequence for starting this style.
|
||||
*/
|
||||
readonly open: string;
|
||||
|
||||
/**
|
||||
The ANSI terminal control sequence for ending this style.
|
||||
*/
|
||||
readonly close: string;
|
||||
}
|
||||
|
||||
interface ColorBase {
|
||||
readonly ansi: ColorConvert;
|
||||
readonly ansi256: ColorConvert;
|
||||
readonly ansi16m: ColorConvert;
|
||||
|
||||
/**
|
||||
The ANSI terminal control sequence for ending this color.
|
||||
*/
|
||||
readonly close: string;
|
||||
}
|
||||
|
||||
interface Modifier {
|
||||
/**
|
||||
Resets the current color chain.
|
||||
*/
|
||||
readonly reset: CSPair;
|
||||
|
||||
/**
|
||||
Make text bold.
|
||||
*/
|
||||
readonly bold: CSPair;
|
||||
|
||||
/**
|
||||
Emitting only a small amount of light.
|
||||
*/
|
||||
readonly dim: CSPair;
|
||||
|
||||
/**
|
||||
Make text italic. (Not widely supported)
|
||||
*/
|
||||
readonly italic: CSPair;
|
||||
|
||||
/**
|
||||
Make text underline. (Not widely supported)
|
||||
*/
|
||||
readonly underline: CSPair;
|
||||
|
||||
/**
|
||||
Inverse background and foreground colors.
|
||||
*/
|
||||
readonly inverse: CSPair;
|
||||
|
||||
/**
|
||||
Prints the text, but makes it invisible.
|
||||
*/
|
||||
readonly hidden: CSPair;
|
||||
|
||||
/**
|
||||
Puts a horizontal line through the center of the text. (Not widely supported)
|
||||
*/
|
||||
readonly strikethrough: CSPair;
|
||||
}
|
||||
|
||||
interface ForegroundColor {
|
||||
readonly black: CSPair;
|
||||
readonly red: CSPair;
|
||||
readonly green: CSPair;
|
||||
readonly yellow: CSPair;
|
||||
readonly blue: CSPair;
|
||||
readonly cyan: CSPair;
|
||||
readonly magenta: CSPair;
|
||||
readonly white: CSPair;
|
||||
|
||||
/**
|
||||
Alias for `blackBright`.
|
||||
*/
|
||||
readonly gray: CSPair;
|
||||
|
||||
/**
|
||||
Alias for `blackBright`.
|
||||
*/
|
||||
readonly grey: CSPair;
|
||||
|
||||
readonly blackBright: CSPair;
|
||||
readonly redBright: CSPair;
|
||||
readonly greenBright: CSPair;
|
||||
readonly yellowBright: CSPair;
|
||||
readonly blueBright: CSPair;
|
||||
readonly cyanBright: CSPair;
|
||||
readonly magentaBright: CSPair;
|
||||
readonly whiteBright: CSPair;
|
||||
}
|
||||
|
||||
interface BackgroundColor {
|
||||
readonly bgBlack: CSPair;
|
||||
readonly bgRed: CSPair;
|
||||
readonly bgGreen: CSPair;
|
||||
readonly bgYellow: CSPair;
|
||||
readonly bgBlue: CSPair;
|
||||
readonly bgCyan: CSPair;
|
||||
readonly bgMagenta: CSPair;
|
||||
readonly bgWhite: CSPair;
|
||||
|
||||
/**
|
||||
Alias for `bgBlackBright`.
|
||||
*/
|
||||
readonly bgGray: CSPair;
|
||||
|
||||
/**
|
||||
Alias for `bgBlackBright`.
|
||||
*/
|
||||
readonly bgGrey: CSPair;
|
||||
|
||||
readonly bgBlackBright: CSPair;
|
||||
readonly bgRedBright: CSPair;
|
||||
readonly bgGreenBright: CSPair;
|
||||
readonly bgYellowBright: CSPair;
|
||||
readonly bgBlueBright: CSPair;
|
||||
readonly bgCyanBright: CSPair;
|
||||
readonly bgMagentaBright: CSPair;
|
||||
readonly bgWhiteBright: CSPair;
|
||||
}
|
||||
}
|
||||
|
||||
declare const ansiStyles: {
|
||||
readonly modifier: ansiStyles.Modifier;
|
||||
readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase;
|
||||
readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase;
|
||||
readonly codes: ReadonlyMap<number, number>;
|
||||
} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier;
|
||||
|
||||
export = ansiStyles;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user