Skip to content

Commit 0f2fe30

Browse files
authored
feat: mark TsCompiler and TsJestCompiler as legacy (#3457)
BREAKING CHANGE - Any imports `ts-jest/dist/compiler/ts-compiler` should change to `ts-jest/dist/legacy/compiler/ts-compiler` - Any imports `ts-jest/dist/compiler/ts-jest-compiler` should change to `ts-jest/dist/legacy/compiler/ts-jest-compiler`
1 parent a986729 commit 0f2fe30

11 files changed

Lines changed: 16 additions & 16 deletions

File tree

src/__helpers__/fakers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { resolve } from 'path'
33
import type { Config } from '@jest/types'
44
import type { Logger } from 'bs-logger'
55

6-
import { TsCompiler } from '../compiler'
6+
import { TsCompiler } from '../legacy/compiler'
77
import { ConfigSet } from '../legacy/config/config-set'
88
import type { StringMap, TsJestGlobalOptions } from '../types'
99
import type { ImportReasons } from '../utils/messages'

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { TsJestTransformer } from './legacy'
22

33
export * from './legacy'
44
export * from './constants'
5-
export * from './compiler'
5+
export * from './legacy/compiler'
66
export * from './config'
77
export * from './presets/create-jest-preset'
88
export * from './utils'

src/compiler/__snapshots__/ts-compiler.spec.ts.snap renamed to src/legacy/compiler/__snapshots__/ts-compiler.spec.ts.snap

File renamed without changes.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { basename, join, normalize } from 'path'
33

44
import { CompilerOptions, DiagnosticCategory, EmitOutput, TranspileOutput } from 'typescript'
55

6-
import { createConfigSet, makeCompiler } from '../__helpers__/fakers'
7-
import type { DepGraphInfo } from '../types'
8-
import { Errors, interpolate } from '../utils/messages'
6+
import { createConfigSet, makeCompiler } from '../../__helpers__/fakers'
7+
import type { DepGraphInfo } from '../../types'
8+
import { Errors, interpolate } from '../../utils/messages'
99

1010
import { TsCompiler } from './ts-compiler'
1111

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ import type {
2323
TranspileOutput,
2424
} from 'typescript'
2525

26-
import { LINE_FEED, TS_TSX_REGEX } from '../constants'
27-
import type { ConfigSet } from '../legacy/config/config-set'
26+
import { LINE_FEED, TS_TSX_REGEX } from '../../constants'
2827
import type {
2928
DepGraphInfo,
3029
StringMap,
3130
TsCompilerInstance,
3231
TsJestAstTransformer,
3332
TsJestCompileOptions,
3433
TTypeScript,
35-
} from '../types'
36-
import { rootLogger } from '../utils'
37-
import { Errors, interpolate } from '../utils/messages'
34+
} from '../../types'
35+
import { rootLogger } from '../../utils'
36+
import { Errors, interpolate } from '../../utils/messages'
37+
import type { ConfigSet } from '../config/config-set'
3838

3939
export class TsCompiler implements TsCompilerInstance {
4040
protected readonly _logger: Logger

src/compiler/ts-jest-compiler.spec.ts renamed to src/legacy/compiler/ts-jest-compiler.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createConfigSet } from '../__helpers__/fakers'
1+
import { createConfigSet } from '../../__helpers__/fakers'
22

33
import { TsCompiler } from './ts-compiler'
44
import { TsJestCompiler } from './ts-jest-compiler'
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { TransformedSource } from '@jest/transform'
22

3-
import type { ConfigSet } from '../legacy/config/config-set'
4-
import type { CompilerInstance, StringMap, TsJestCompileOptions } from '../types'
3+
import type { CompilerInstance, StringMap, TsJestCompileOptions } from '../../types'
4+
import type { ConfigSet } from '../config/config-set'
55

66
import { TsCompiler } from './ts-compiler'
77

src/legacy/ts-jest-transformer.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import { removeSync, writeFileSync } from 'fs-extra'
66

77
import { createConfigSet } from '../__helpers__/fakers'
88
import { logTargetMock } from '../__helpers__/mocks'
9-
import { TsJestCompiler } from '../compiler'
109
import type { DepGraphInfo } from '../types'
1110
import { stringify } from '../utils'
1211
import { importer } from '../utils/importer'
1312
import { sha1 } from '../utils/sha1'
1413

14+
import { TsJestCompiler } from './compiler'
1515
import { CACHE_KEY_EL_SEPARATOR, TsJestTransformer } from './ts-jest-transformer'
1616

1717
const SOURCE_MAPPING_PREFIX = 'sourceMappingURL='

src/legacy/ts-jest-transformer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import path from 'path'
44
import type { SyncTransformer, TransformedSource } from '@jest/transform'
55
import type { Logger } from 'bs-logger'
66

7-
import { TsJestCompiler } from '../compiler'
87
import { DECLARATION_TYPE_EXT, JS_JSX_REGEX, TS_TSX_REGEX } from '../constants'
98
import type { CompilerInstance, DepGraphInfo, ProjectConfigTsJest, TransformOptionsTsJest } from '../types'
109
import { parse, stringify, JsonableValue, rootLogger } from '../utils'
@@ -13,6 +12,7 @@ import { Deprecations, Errors, interpolate } from '../utils/messages'
1312
import { sha1 } from '../utils/sha1'
1413
import { VersionCheckers } from '../utils/version-checkers'
1514

15+
import { TsJestCompiler } from './compiler'
1616
import { ConfigSet } from './config/config-set'
1717

1818
interface CachedConfigSet {

0 commit comments

Comments
 (0)