ts-jest 29.1.3 → 29.1.5

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
- 119b6863ec1b60a4ccead1725443bf8562134c2a
1
+ fe39dee3cf86e90246fb615ac0e030c5cd17b1ee
package/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## [29.1.5](https://github.com/kulshekhar/ts-jest/compare/v29.1.4...v29.1.5) (2024-06-16)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * build(deps-dev): bump braces ([5560334](https://github.com/kulshekhar/ts-jest/commit/5560334)), ([59026b4](https://github.com/kulshekhar/ts-jest/commit/59026b4)), ([0d9e359](https://github.com/kulshekhar/ts-jest/commit/0d9e359))
7
+
8
+
9
+
10
+ ## [29.1.4](https://github.com/kulshekhar/ts-jest/compare/v29.1.3...v29.1.4) (2024-05-28)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * fix(transformer): allow transforming of .cts/.mts extensions. ([b8f6eaa](https://github.com/kulshekhar/ts-jest/commit/b8f6eaa)), closes [#3996](https://github.com/kulshekhar/ts-jest/issues/3996)
16
+
17
+
18
+ ### Features
19
+
20
+ * feat: make cli generate esm config based on `type: "module"` ([81a5f64](https://github.com/kulshekhar/ts-jest/commit/81a5f64)), closes [#4210](https://github.com/kulshekhar/ts-jest/issues/4210) [#4012](https://github.com/kulshekhar/ts-jest/issues/4012)
21
+
22
+
23
+
1
24
  ## [29.1.3](https://github.com/kulshekhar/ts-jest/compare/v29.1.2...v29.1.3) (2024-05-21)
2
25
 
3
26
 
@@ -77,7 +77,7 @@ var presets_1 = require("../helpers/presets");
77
77
  * @internal
78
78
  */
79
79
  var run = function (args /* , logger: Logger */) { return __awaiter(void 0, void 0, void 0, function () {
80
- var file, filePath, name, isPackage, exists, pkgFile, hasPackage, _a, jestPreset, askedTsconfig, force, jsdom, tsconfig, pkgJson, jsFilesProcessor, shouldPostProcessWithBabel, preset, body, jestConfig, transformerConfig, content;
80
+ var file, filePath, name, isPackage, exists, pkgFile, hasPackage, _a, jestPreset, askedTsconfig, force, jsdom, tsconfig, pkgJson, jsFilesProcessor, shouldPostProcessWithBabel, preset, body, jestConfig, transformerConfig, content, usesModules;
81
81
  var _b, _c, _d;
82
82
  return __generator(this, function (_e) {
83
83
  file = (_c = (_b = args._[0]) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : 'jest.config.js';
@@ -157,7 +157,8 @@ var run = function (args /* , logger: Logger */) { return __awaiter(void 0, void
157
157
  content.push("".concat(preset.jsImport('tsjPreset'), ";"), '');
158
158
  }
159
159
  content.push("/** @type {import('ts-jest').JestConfigWithTsJest} */");
160
- content.push('module.exports = {');
160
+ usesModules = pkgJson.type === 'module';
161
+ content.push(usesModules ? 'export default {' : 'module.exports = {');
161
162
  if (jestPreset) {
162
163
  content.push(" preset: '".concat(preset.name, "',"));
163
164
  }
package/dist/constants.js CHANGED
@@ -4,8 +4,8 @@ exports.DEFAULT_JEST_TEST_MATCH = exports.JS_EXT_TO_TREAT_AS_ESM = exports.TS_EX
4
4
  exports.LINE_FEED = '\n';
5
5
  exports.DECLARATION_TYPE_EXT = '.d.ts';
6
6
  exports.JS_JSX_EXTENSIONS = ['.js', '.jsx'];
7
- exports.TS_TSX_REGEX = /\.m?tsx?$/;
8
- exports.JS_JSX_REGEX = /\.m?jsx?$/;
7
+ exports.TS_TSX_REGEX = /\.[cm]?tsx?$/;
8
+ exports.JS_JSX_REGEX = /\.[cm]?jsx?$/;
9
9
  // `extensionsToTreatAsEsm` will throw error with `.mjs`
10
10
  exports.TS_EXT_TO_TREAT_AS_ESM = ['.ts', '.tsx', '.mts'];
11
11
  exports.JS_EXT_TO_TREAT_AS_ESM = ['.jsx'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-jest",
3
- "version": "29.1.3",
3
+ "version": "29.1.5",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "bin": {
@@ -93,8 +93,8 @@
93
93
  }
94
94
  },
95
95
  "devDependencies": {
96
- "@commitlint/cli": "17.x",
97
- "@commitlint/config-angular": "^17.6.5",
96
+ "@commitlint/cli": "^19.3.0",
97
+ "@commitlint/config-angular": "^19.3.0",
98
98
  "@jest/transform": "^29.7.0",
99
99
  "@jest/types": "^29.6.3",
100
100
  "@types/babel__core": "7.20.5",
@@ -105,39 +105,38 @@
105
105
  "@types/lodash.memoize": "4.1.9",
106
106
  "@types/lodash.set": "4.3.9",
107
107
  "@types/micromatch": "4.0.7",
108
- "@types/node": "18.19.33",
108
+ "@types/node": "20.14.2",
109
109
  "@types/react": "18.x",
110
- "@types/rimraf": "^3.0.2",
111
110
  "@types/semver": "latest",
112
111
  "@types/yargs": "latest",
113
112
  "@types/yargs-parser": "21.0.3",
114
- "@typescript-eslint/eslint-plugin": "^5.62.0",
115
- "@typescript-eslint/parser": "^5.62.0",
113
+ "@typescript-eslint/eslint-plugin": "^7.13.0",
114
+ "@typescript-eslint/parser": "^7.13.0",
116
115
  "babel-jest": "^29.7.0",
117
- "conventional-changelog-cli": "2.2.2",
116
+ "conventional-changelog-cli": "^5.0.0",
118
117
  "cross-spawn": "latest",
119
- "esbuild": "~0.17.19",
120
- "eslint": "^8.42.0",
121
- "eslint-config-prettier": "latest",
122
- "eslint-plugin-import": "latest",
123
- "eslint-plugin-jest": "latest",
124
- "eslint-plugin-jsdoc": "latest",
125
- "eslint-plugin-prefer-arrow": "latest",
126
- "eslint-plugin-prettier": "latest",
118
+ "esbuild": "~0.21.5",
119
+ "eslint": "^8.57.0",
120
+ "eslint-config-prettier": "^9.1.0",
121
+ "eslint-plugin-import": "^2.29.1",
122
+ "eslint-plugin-jest": "^28.6.0",
123
+ "eslint-plugin-jsdoc": "^48.2.12",
124
+ "eslint-plugin-prefer-arrow": "^1.2.3",
125
+ "eslint-plugin-prettier": "^5.1.3",
127
126
  "execa": "5.1.1",
128
- "fs-extra": "11.x",
127
+ "fs-extra": "11.2.0",
129
128
  "glob": "^10.2.6",
130
129
  "glob-gitignore": "latest",
131
130
  "husky": "4.x",
132
131
  "jest": "^29.7.0",
133
132
  "jest-snapshot-serializer-raw": "^1.2.0",
134
133
  "js-yaml": "latest",
135
- "json-schema-to-typescript": "^13.0.2",
134
+ "json-schema-to-typescript": "^13.1.2",
136
135
  "lint-staged": "latest",
137
136
  "lodash.camelcase": "^4.3.0",
138
137
  "lodash.set": "^4.3.2",
139
138
  "node-fetch": "^3.3.2",
140
- "prettier": "^2.8.8",
139
+ "prettier": "^3.3.2",
141
140
  "typescript": "~5.1.3"
142
141
  },
143
142
  "lint-staged": {