ts-jest 29.4.7 → 29.4.8
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/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/.opencode/archive/sessions/ses_2bfd9d52bffeFFWDJAjOaEp37I/.last.sha256 +0 -1
- package/.opencode/archive/sessions/ses_2bfd9d52bffeFFWDJAjOaEp37I/2026-03-31T07-18-10.759Z.json +0 -14293
- package/.opencode/archive/sessions/ses_2bfd9d52bffeFFWDJAjOaEp37I/2026-03-31T07-18-10.759Z.md +0 -13422
- package/.opencode/plans/pr1.md +0 -337
- package/.opencode/plans/pr2.md +0 -280
- package/.opencode/plans/pr3.md +0 -127
- package/.opencode/plans/pr4.md +0 -229
- package/.opencode/plans/pr5.md +0 -211
- package/.opencode/plans/pr6.md +0 -178
package/.opencode/plans/pr6.md
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
# PR 6 — Promote + Cleanup
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
Promotes the new transformer as the default. Swaps `src/index.ts` so `createTransformer` uses
|
|
6
|
-
the new transformer by default. Adds a deprecation path for `future.v30_newTransformer: false`.
|
|
7
|
-
Also fixes the ESM interop false-positive warning in the legacy config and removes long-deprecated
|
|
8
|
-
type aliases.
|
|
9
|
-
|
|
10
|
-
**User-visible change**: YES — default behavior changes
|
|
11
|
-
**Depends on**: PR 5
|
|
12
|
-
**Files modified**: `src/index.ts`, `src/legacy/config/config-set.ts`, `src/types.ts`
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## Files to Modify
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
src/index.ts — swap default; add legacy deprecation warning
|
|
20
|
-
src/legacy/config/config-set.ts — fix ESM interop false-positive
|
|
21
|
-
src/types.ts — remove deprecated type aliases
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## Requirements
|
|
27
|
-
|
|
28
|
-
### `src/index.ts` — Default swap
|
|
29
|
-
|
|
30
|
-
```ts
|
|
31
|
-
export const createTransformer = (tsJestConfig?: TsJestTransformerOptions) => {
|
|
32
|
-
if (tsJestConfig?.future?.v30_newTransformer === false) {
|
|
33
|
-
// Explicit opt-out — use legacy with deprecation warning
|
|
34
|
-
logger.warn(
|
|
35
|
-
'future.v30_newTransformer: false is deprecated. ' +
|
|
36
|
-
'The v30 transformer is now the default. ' +
|
|
37
|
-
'Use ts-jest/legacy if you need the legacy transformer.',
|
|
38
|
-
)
|
|
39
|
-
return new TsJestTransformer(tsJestConfig)
|
|
40
|
-
}
|
|
41
|
-
// Default: new transformer
|
|
42
|
-
const { NewTsJestTransformer } = require('./experimental/transformer/transformer')
|
|
43
|
-
return new NewTsJestTransformer(tsJestConfig)
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
`ts-jest/legacy` entry point stays unchanged as a permanent escape hatch.
|
|
48
|
-
`future.v30_newTransformer: true` still works silently (no warning, same as default now).
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
### `src/legacy/config/config-set.ts` — ESM interop false-positive fix
|
|
53
|
-
|
|
54
|
-
**Location**: lines 487–500 (ESM interop warning block)
|
|
55
|
-
|
|
56
|
-
**Current condition** (warns for these module kinds):
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
NOT in [CommonJS, Node16, NodeNext]
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
**Fixed condition** (also exclude modern ESM kinds that don't need the warning):
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
NOT in [CommonJS, Node16, NodeNext, ESNext, ES2015, ES2016, ES2017, ES2018, ES2019, ES2020, ES2021, ES2022]
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
This is the only change to `config-set.ts`. The fix applies to the **legacy** transformer as well
|
|
69
|
-
(not just the new one) since it's a genuine false positive.
|
|
70
|
-
|
|
71
|
-
**Rationale**: Projects using `module: ESNext` in modern setups with `"type": "module"` in
|
|
72
|
-
package.json get a spurious warning even though ESM interop is not needed. ESNext/ES2015–ES2022
|
|
73
|
-
modules handle default imports correctly.
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
### `src/types.ts` — Remove deprecated type aliases
|
|
78
|
-
|
|
79
|
-
Remove the following aliases that have been deprecated since v28:
|
|
80
|
-
|
|
81
|
-
```ts
|
|
82
|
-
// REMOVE these deprecated aliases:
|
|
83
|
-
/** @deprecated use TsJestTransformerOptions */
|
|
84
|
-
export type TsJestGlobalOptions = TsJestTransformerOptions
|
|
85
|
-
|
|
86
|
-
/** @deprecated use Config.ProjectConfig */
|
|
87
|
-
export type ProjectConfigTsJest = Config.ProjectConfig
|
|
88
|
-
|
|
89
|
-
/** @deprecated use Config.InitialOptions */
|
|
90
|
-
export type InitialOptionsTsJest = Config.InitialOptions
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
**Note**: `TsJestTransformerOptions` itself (the non-alias) is kept unchanged.
|
|
94
|
-
Do not remove `TsJestCompileOptions`, `CompiledOutput`, `AstTransformerDesc`, `CompilerInstance`,
|
|
95
|
-
or `TsCompilerInstance`.
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## Migration Guide (to include in PR description)
|
|
100
|
-
|
|
101
|
-
### Users of `ts-jest` (no config change needed)
|
|
102
|
-
|
|
103
|
-
The new transformer is now the default. If you encounter issues:
|
|
104
|
-
|
|
105
|
-
```js
|
|
106
|
-
// Temporary escape hatch
|
|
107
|
-
transform: { '^.+\\.tsx?$': 'ts-jest/legacy' }
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Users of `future.v30_newTransformer: true`
|
|
111
|
-
|
|
112
|
-
Remove the flag — it's now the default and will be cleaned up in v31.
|
|
113
|
-
|
|
114
|
-
### Users of `future.v30_newTransformer: false`
|
|
115
|
-
|
|
116
|
-
Switch to `ts-jest/legacy` explicitly. The `false` value emits a deprecation warning.
|
|
117
|
-
|
|
118
|
-
### Users of `diagnostics: false`
|
|
119
|
-
|
|
120
|
-
Replace with `noCheck: true` in your tsconfig:
|
|
121
|
-
|
|
122
|
-
```json
|
|
123
|
-
{ "compilerOptions": { "noCheck": true } }
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
### Users of `isolatedModules: true` (ts-jest option)
|
|
127
|
-
|
|
128
|
-
Move it to tsconfig:
|
|
129
|
-
|
|
130
|
-
```json
|
|
131
|
-
{ "compilerOptions": { "isolatedModules": true } }
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
Type checking now works correctly with `isolatedModules: true` (this was a bug in the old transformer).
|
|
135
|
-
|
|
136
|
-
### Users of deprecated type aliases
|
|
137
|
-
|
|
138
|
-
| Old | New |
|
|
139
|
-
| ---------------------- | -------------------------- |
|
|
140
|
-
| `TsJestGlobalOptions` | `TsJestTransformerOptions` |
|
|
141
|
-
| `ProjectConfigTsJest` | `Config.ProjectConfig` |
|
|
142
|
-
| `InitialOptionsTsJest` | `Config.InitialOptions` |
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
## Test Requirements
|
|
147
|
-
|
|
148
|
-
- Update `src/index.spec.ts` to verify:
|
|
149
|
-
|
|
150
|
-
- No `future` flag → new transformer instantiated
|
|
151
|
-
- `future.v30_newTransformer: true` → new transformer (no warning)
|
|
152
|
-
- `future.v30_newTransformer: false` → legacy transformer + deprecation warning
|
|
153
|
-
|
|
154
|
-
- Update `src/legacy/config/config-set.spec.ts` for ESM interop warning fix:
|
|
155
|
-
|
|
156
|
-
- `module: ESNext` → no warning emitted
|
|
157
|
-
- `module: ES2020` → no warning emitted
|
|
158
|
-
- `module: AMD` → warning still emitted (not in exclusion list)
|
|
159
|
-
|
|
160
|
-
- All existing e2e tests must remain green (legacy behavior unchanged for `ts-jest/legacy` users)
|
|
161
|
-
|
|
162
|
-
- Add e2e scenario: `e2e/v30-default/` — verifies that bare `ts-jest` (no future flag) uses new
|
|
163
|
-
transformer and produces correct output
|
|
164
|
-
|
|
165
|
-
---
|
|
166
|
-
|
|
167
|
-
## Acceptance Criteria
|
|
168
|
-
|
|
169
|
-
- [ ] `createTransformer()` with no options → new transformer
|
|
170
|
-
- [ ] `future.v30_newTransformer: false` → legacy transformer + deprecation warning in stderr
|
|
171
|
-
- [ ] `ts-jest/legacy` → legacy transformer, no warning
|
|
172
|
-
- [ ] `module: ESNext` in tsconfig → no ESM interop warning (legacy fix)
|
|
173
|
-
- [ ] `module: ES2020` in tsconfig → no ESM interop warning (legacy fix)
|
|
174
|
-
- [ ] `module: AMD` in tsconfig → ESM interop warning still fires
|
|
175
|
-
- [ ] Deprecated type aliases `TsJestGlobalOptions`, `ProjectConfigTsJest`, `InitialOptionsTsJest` removed
|
|
176
|
-
- [ ] All e2e tests pass
|
|
177
|
-
- [ ] `tsc --noEmit` passes
|
|
178
|
-
- [ ] `CHANGELOG` updated with migration notes
|