ts-jest 29.0.0 → 29.0.1

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
- f9fb4e4bd207c5c42e82ee8e8107b923ea6a903b
1
+ 039bf2bc4c11e2e3341df450e4af7ab945a9404d
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [29.0.1](https://github.com/kulshekhar/ts-jest/compare/v29.0.0...v29.0.1) (2022-09-13)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **legacy:** include existing globals config in cached config ([#3803](https://github.com/kulshekhar/ts-jest/issues/3803)) ([e79be47](https://github.com/kulshekhar/ts-jest/commit/e79be47d2b81a677d0dd39d84328a38ca0f0ffc6))
7
+
8
+
9
+ ### Features
10
+
11
+ * add typings for `ts-jest` options via `transform` config ([#3805](https://github.com/kulshekhar/ts-jest/issues/3805)) ([664b0f2](https://github.com/kulshekhar/ts-jest/commit/664b0f2b446a36dd7661f4840ca3dd7722f1f6ff))
12
+
13
+
14
+
1
15
  # [29.0.0](https://github.com/kulshekhar/ts-jest/compare/v29.0.0-next.1...v29.0.0) (2022-09-08)
2
16
 
3
17
 
@@ -102,7 +102,7 @@ var TsJestTransformer = (function () {
102
102
  process.env.TS_JEST = '1';
103
103
  }
104
104
  TsJestTransformer.prototype._configsFor = function (transformOptions) {
105
- var _a;
105
+ var _a, _b;
106
106
  var config = transformOptions.config, cacheFS = transformOptions.cacheFS;
107
107
  var ccs = TsJestTransformer._cachedConfigSets.find(function (cs) { return cs.jestConfig.value === config; });
108
108
  var configSet;
@@ -131,11 +131,10 @@ var TsJestTransformer = (function () {
131
131
  if ((_a = config.globals) === null || _a === void 0 ? void 0 : _a['ts-jest']) {
132
132
  this._logger.warn("Define `ts-jest` config under `globals` is deprecated. Please do\ntransform: {\n <transform_regex>: ['ts-jest', { /* ts-jest config goes here in Jest */ }],\n},");
133
133
  }
134
- configSet = this._createConfigSet(this.tsJestConfig
135
- ? __assign(__assign({}, config), { globals: {
136
- 'ts-jest': this.tsJestConfig,
137
- } }) : config);
138
- var jest_1 = __assign({}, config);
134
+ var migratedConfig = this.tsJestConfig
135
+ ? __assign(__assign({}, config), { globals: __assign(__assign({}, ((_b = config.globals) !== null && _b !== void 0 ? _b : Object.create(null))), { 'ts-jest': this.tsJestConfig }) }) : config;
136
+ configSet = this._createConfigSet(migratedConfig);
137
+ var jest_1 = __assign({}, migratedConfig);
139
138
  jest_1.cacheDirectory = undefined;
140
139
  this._transformCfgStr = "".concat(new utils_1.JsonableValue(jest_1).serialized).concat(configSet.cacheSuffix);
141
140
  this._createCompiler(configSet, cacheFS);
package/dist/types.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import type { TransformedSource, TransformOptions } from '@jest/transform';
2
2
  import type { Config } from '@jest/types';
3
- import type * as babelJest from 'babel-jest';
4
3
  import type * as _babel from 'babel__core';
5
4
  import type * as _ts from 'typescript';
6
5
  import type { ConfigSet } from './legacy/config/config-set';
@@ -12,18 +11,7 @@ declare module '@jest/types' {
12
11
  }
13
12
  }
14
13
  }
15
- export declare type TBabelJest = typeof babelJest;
16
14
  export declare type TTypeScript = typeof _ts;
17
- export interface TEsBuild {
18
- transformSync(input: string, options?: {
19
- loader: 'ts' | 'js';
20
- format: 'cjs' | 'esm';
21
- target: string;
22
- }): {
23
- code: string;
24
- map: string;
25
- };
26
- }
27
15
  export declare type BabelConfig = _babel.TransformOptions;
28
16
  export declare type TsJestPresets = Pick<Config.InitialOptions, 'extensionsToTreatAsEsm' | 'moduleFileExtensions' | 'transform' | 'testMatch'>;
29
17
  export interface AstTransformer<T = Record<string, unknown>> {
@@ -50,13 +38,6 @@ export interface TsJestGlobalOptions {
50
38
  stringifyContentPathRegex?: string | RegExp;
51
39
  useESM?: boolean;
52
40
  }
53
- export interface TsJestDiagnosticsCfg {
54
- pretty: boolean;
55
- ignoreCodes: number[];
56
- exclude: string[];
57
- throws: boolean;
58
- warnOnly?: boolean;
59
- }
60
41
  export interface ProjectConfigTsJest extends Config.ProjectConfig {
61
42
  globals: GlobalConfigTsJest;
62
43
  }
@@ -69,11 +50,13 @@ export interface GlobalConfigTsJest extends Config.ConfigGlobals {
69
50
  export interface InitialOptionsTsJest extends Config.InitialOptions {
70
51
  globals?: GlobalConfigTsJest;
71
52
  }
72
- export declare type StringMap = Map<string, string>;
73
- export interface DepGraphInfo {
74
- fileContent: string;
75
- resolvedModuleNames: string[];
53
+ declare type TsJestTransformerOptions = TsJestGlobalOptions;
54
+ export interface JestConfigWithTsJest extends Partial<Omit<Config.ProjectConfig, 'transform'>> {
55
+ transform: {
56
+ [regex: string]: 'ts-jest' | ['ts-jest', TsJestTransformerOptions] | string | [string, Record<string, unknown>];
57
+ };
76
58
  }
59
+ export declare type StringMap = Map<string, string>;
77
60
  export interface TsJestCompileOptions {
78
61
  depGraphs: Map<string, DepGraphInfo>;
79
62
  watchMode: boolean;
@@ -101,3 +84,4 @@ export interface TsJestAstTransformer {
101
84
  after: AstTransformerDesc[];
102
85
  afterDeclarations: AstTransformerDesc[];
103
86
  }
87
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-jest",
3
- "version": "29.0.0",
3
+ "version": "29.0.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "bin": {
@@ -91,8 +91,8 @@
91
91
  "devDependencies": {
92
92
  "@commitlint/cli": "17.x",
93
93
  "@commitlint/config-angular": "^17.1.0",
94
- "@jest/transform": "^29.0.2",
95
- "@jest/types": "^29.0.2",
94
+ "@jest/transform": "^29.0.3",
95
+ "@jest/types": "^29.0.3",
96
96
  "@types/babel__core": "7.x",
97
97
  "@types/cross-spawn": "latest",
98
98
  "@types/fs-extra": "latest",
@@ -108,13 +108,13 @@
108
108
  "@types/semver": "latest",
109
109
  "@types/yargs": "latest",
110
110
  "@types/yargs-parser": "21.x",
111
- "@typescript-eslint/eslint-plugin": "^5.36.2",
112
- "@typescript-eslint/parser": "^5.36.2",
113
- "babel-jest": "^29.0.2",
111
+ "@typescript-eslint/eslint-plugin": "^5.37.0",
112
+ "@typescript-eslint/parser": "^5.37.0",
113
+ "babel-jest": "^29.0.3",
114
114
  "conventional-changelog-cli": "2.x",
115
115
  "cross-spawn": "latest",
116
116
  "esbuild": "~0.15.7",
117
- "eslint": "^8.23.0",
117
+ "eslint": "^8.23.1",
118
118
  "eslint-config-prettier": "latest",
119
119
  "eslint-plugin-import": "latest",
120
120
  "eslint-plugin-jest": "latest",
@@ -126,7 +126,7 @@
126
126
  "glob": "^8.0.3",
127
127
  "glob-gitignore": "latest",
128
128
  "husky": "4.x",
129
- "jest": "^29.0.2",
129
+ "jest": "^29.0.3",
130
130
  "jest-snapshot-serializer-raw": "^1.2.0",
131
131
  "js-yaml": "latest",
132
132
  "json-schema-to-typescript": "^11.0.2",
@@ -135,7 +135,7 @@
135
135
  "lodash.set": "^4.3.2",
136
136
  "node-fetch": "^3.2.10",
137
137
  "prettier": "^2.7.1",
138
- "typescript": "~4.8.2"
138
+ "typescript": "~4.8.3"
139
139
  },
140
140
  "lint-staged": {
141
141
  "*.{ts,tsx,js,jsx}": [