ts-jest 28.0.0-next.3 → 28.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.ts-jest-digest CHANGED
@@ -1 +1 @@
1
- fbf09f35f81a3ca3c5993075f6e3bd4218b3feb0
1
+ 8007ad9f9353d20ce73d8e3f7fa082461be9f084
package/CHANGELOG.md CHANGED
@@ -1,56 +1,36 @@
1
- # [28.0.0-next.3](https://github.com/kulshekhar/ts-jest/compare/v28.0.0-next.2...v28.0.0-next.3) (2022-04-29)
1
+ ## [28.0.2](https://github.com/kulshekhar/ts-jest/compare/v28.0.1...v28.0.2) (2022-05-07)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * **compiler:** bring back compiled output with inline sourcemap ([#3483](https://github.com/kulshekhar/ts-jest/issues/3483)) ([e96d5b3](https://github.com/kulshekhar/ts-jest/commit/e96d5b3c94348774011ac76e91bf746a3429ade0)), closes [#3482](https://github.com/kulshekhar/ts-jest/issues/3482)
6
+ * **transformers:** use `Array.sort` in hoisting transformer ([#3498](https://github.com/kulshekhar/ts-jest/issues/3498)) ([e400a6e](https://github.com/kulshekhar/ts-jest/commit/e400a6ec0e4706f606ae9b1e2897b0bb1cff6343)), closes [#3476](https://github.com/kulshekhar/ts-jest/issues/3476)
7
7
 
8
8
 
9
9
 
10
- # [28.0.0-next.2](https://github.com/kulshekhar/ts-jest/compare/v28.0.0-next.1...v28.0.0-next.2) (2022-04-27)
10
+ ## [28.0.1](https://github.com/kulshekhar/ts-jest/compare/v28.0.0...v28.0.1) (2022-05-03)
11
11
 
12
12
 
13
13
  ### Bug Fixes
14
14
 
15
- * revert deprecation message for `TsJestTransformer` ([#3466](https://github.com/kulshekhar/ts-jest/issues/3466)) ([cefa0da](https://github.com/kulshekhar/ts-jest/commit/cefa0da660c4f99cf6595e253981af6855bcc80c))
15
+ * lower the required node version to ^16.10 ([#3495](https://github.com/kulshekhar/ts-jest/issues/3495)) ([3a4e48a](https://github.com/kulshekhar/ts-jest/commit/3a4e48afffa56f76efb98f48ad3e07a92731748e)), closes [#3494](https://github.com/kulshekhar/ts-jest/issues/3494)
16
16
 
17
17
 
18
- ### Features
19
18
 
20
- * **presets:** add presets for legacy mode ([#3465](https://github.com/kulshekhar/ts-jest/issues/3465)) ([543b4ad](https://github.com/kulshekhar/ts-jest/commit/543b4ad729d20fbd46a2de5cd4660dc50b94ebe7))
19
+ # [28.0.0](https://github.com/kulshekhar/ts-jest/compare/v28.0.0-next.3...v28.0.0) (2022-05-02)
21
20
 
22
21
 
22
+ ### Bug Fixes
23
23
 
24
- # [28.0.0-next.1](https://github.com/kulshekhar/ts-jest/compare/v28.0.0-next.0...v28.0.0-next.1) (2022-04-26)
24
+ * **legacy** invoke Babel `processAsync` for `babel-jest` in ESM mode instead of `process` ([#3430](https://github.com/kulshekhar/ts-jest/issues/3430)) ([0d7356c](https://github.com/kulshekhar/ts-jest/commit/0d7356cd767a924e5b57e3a93679eef4ca8fae51))
25
25
 
26
26
 
27
27
  ### Features
28
28
 
29
+ * **presets:** add presets for legacy mode ([#3465](https://github.com/kulshekhar/ts-jest/issues/3465)) ([543b4ad](https://github.com/kulshekhar/ts-jest/commit/543b4ad729d20fbd46a2de5cd4660dc50b94ebe7))
29
30
  * mark `ConfigSet` as legacy ([#3456](https://github.com/kulshekhar/ts-jest/issues/3456)) ([a986729](https://github.com/kulshekhar/ts-jest/commit/a98672977a679d1ed882605a3e71ed405432ffdc))
30
31
  * mark `TsCompiler` and `TsJestCompiler` as legacy ([#3457](https://github.com/kulshekhar/ts-jest/issues/3457)) ([0f2fe30](https://github.com/kulshekhar/ts-jest/commit/0f2fe306762d8549bd29737becd4aed14a650427))
31
32
  * remove `path-mapping` AST transformer ([#3455](https://github.com/kulshekhar/ts-jest/issues/3455)) ([f566869](https://github.com/kulshekhar/ts-jest/commit/f5668698f8fab78b3008d936aa5001f134f530e2))
32
33
  * set Jest peer dependencies to v28 ([#3454](https://github.com/kulshekhar/ts-jest/issues/3454)) ([1e880ff](https://github.com/kulshekhar/ts-jest/commit/1e880fffe82bca231d1d23f6508f4ab4bc31e03e))
33
-
34
-
35
- ### BREAKING CHANGES
36
-
37
- * `path-mapping` AST transformer is no longer shipped in `ts-jest` v28. Please use an alternative one like https://github.com/LeDDGroup/typescript-transform-paths instead.
38
- * Any imports `ts-jest/dist/compiler/ts-compiler` should change to `ts-jest/dist/legacy/compiler/ts-compiler`
39
- * Any imports `ts-jest/dist/compiler/ts-jest-compiler` should change to `ts-jest/dist/legacy/compiler/ts-jest-compiler`
40
- * Any imports `ts-jest/dist/config/config-set` should change to `ts-jest/dist/legacy/config/config-set
41
-
42
-
43
-
44
- # [28.0.0-next.0](https://github.com/kulshekhar/ts-jest/compare/v27.1.3...v28.0.0-next.0) (2022-04-24)
45
-
46
-
47
- ### Bug Fixes
48
-
49
- * **legacy** invoke Babel `processAsync` for `babel-jest` in ESM mode instead of `process` ([#3430](https://github.com/kulshekhar/ts-jest/issues/3430)) ([0d7356c](https://github.com/kulshekhar/ts-jest/commit/0d7356cd767a924e5b57e3a93679eef4ca8fae51))
50
-
51
-
52
- ### Features
53
-
54
34
  * **core:** drop support for Node.js 10 ([#3332](https://github.com/kulshekhar/ts-jest/issues/3332)) ([7a9aa61](https://github.com/kulshekhar/ts-jest/commit/7a9aa615ea0be881105676a17d5bd655afdc27f5))
55
35
  * **core:** remove `mocked` testing util ([#3333](https://github.com/kulshekhar/ts-jest/issues/3333)) ([2d9017d](https://github.com/kulshekhar/ts-jest/commit/2d9017ddfea39f45aa991876b314d1dbe4a36aad))
56
36
  * **core:** remove `ts-jest/utils` sub path export ([#3334](https://github.com/kulshekhar/ts-jest/issues/3334)) ([9f253d3](https://github.com/kulshekhar/ts-jest/commit/9f253d31dfcefa35ae00049d0d2dc4a3fe1b2f34))
@@ -59,23 +39,15 @@
59
39
 
60
40
  ### BREAKING CHANGES
61
41
 
62
- * Minimum support TypeScript version is now **4.3** since Jest 28 requires it
63
- * Jest 28 is required
42
+ * `path-mapping` AST transformer is no longer shipped in `ts-jest` v28. Please use an alternative one like https://github.com/LeDDGroup/typescript-transform-paths instead.
43
+ * Any imports `ts-jest/dist/compiler/ts-compiler` should change to `ts-jest/dist/legacy/compiler/ts-compiler`
44
+ * Any imports `ts-jest/dist/compiler/ts-jest-compiler` should change to `ts-jest/dist/legacy/compiler/ts-jest-compiler`
45
+ * Any imports `ts-jest/dist/config/config-set` should change to `ts-jest/dist/legacy/config/config-set`
46
+ * Minimum support `TypeScript` version is now **4.3** since Jest 28 requires it.
47
+ * **Jest 28** is required.
64
48
  * **core:** Any imports `ts-jest/utils` should be replaced with `ts-jest`.
65
49
  * **core:** Starting from Jest 27.4, `mocked` has been integrated into Jest repo.
66
- * **core:** Support for Node.js v10 has been removed as Jest drops support for it
67
- * All presets now will they are preserved for refactored codes. If you wish to use the old codes, please do the following
68
- *
69
- ```diff
70
- // jest.config.js
71
- module.exports = {
72
- // [...]
73
- - preset: 'ts-jest', // or 'js-with-babel'/'js-with-ts'
74
- + transform: {
75
- '^.+\\.tsx?$': 'ts-jest/legacy' // or '^.+\\.[tj]sx?$': 'ts-jest' to use legacy codes
76
- }
77
- }
78
- ```
50
+ * **core:** Support for Node.js v10 has been removed as Jest drops support for it.
79
51
 
80
52
 
81
53
 
@@ -50,21 +50,12 @@ function factory(_a) {
50
50
  if (statements.length <= 1) {
51
51
  return statements;
52
52
  }
53
- var pivot = statements[0];
54
- var leftPart = [];
55
- var rightPart = [];
56
- for (var i = 1; i < statements.length; i++) {
57
- var currentStatement = statements[i];
58
- if (isJestGlobalImport(currentStatement)) {
59
- leftPart.push(currentStatement);
60
- }
61
- else {
62
- isHoistableStatement(currentStatement) && !isHoistableStatement(pivot) && !isJestGlobalImport(pivot)
63
- ? leftPart.push(currentStatement)
64
- : rightPart.push(currentStatement);
65
- }
66
- }
67
- return sortStatements(leftPart).concat(pivot, sortStatements(rightPart));
53
+ return statements.sort(function (stmtA, stmtB) {
54
+ return isJestGlobalImport(stmtA) ||
55
+ (isHoistableStatement(stmtA) && !isHoistableStatement(stmtB) && !isJestGlobalImport(stmtB))
56
+ ? -1
57
+ : 1;
58
+ });
68
59
  };
69
60
  var createVisitor = function (ctx, _) {
70
61
  var visitor = function (node) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-jest",
3
- "version": "28.0.0-next.3",
3
+ "version": "28.0.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "bin": {
@@ -102,7 +102,7 @@
102
102
  "@types/lodash.memoize": "4.x",
103
103
  "@types/lodash.set": "4.x",
104
104
  "@types/micromatch": "4.x",
105
- "@types/node": "17.0.29",
105
+ "@types/node": "17.0.31",
106
106
  "@types/node-fetch": "^3.0.3",
107
107
  "@types/react": "18.x",
108
108
  "@types/rimraf": "^3.0.2",
@@ -144,6 +144,6 @@
144
144
  ]
145
145
  },
146
146
  "engines": {
147
- "node": "^12.13.0 || ^14.15.0 || ^16.13.0 || >=17.0.0"
147
+ "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0"
148
148
  }
149
149
  }