Skip to content

Commit

Permalink
feat: mark TsCompiler and TsJestCompiler as legacy (#3457)
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
ahnpnl committed Apr 25, 2022
1 parent a986729 commit 0f2fe30
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/__helpers__/fakers.ts
Expand Up @@ -3,7 +3,7 @@ import { resolve } from 'path'
import type { Config } from '@jest/types'
import type { Logger } from 'bs-logger'

import { TsCompiler } from '../compiler'
import { TsCompiler } from '../legacy/compiler'
import { ConfigSet } from '../legacy/config/config-set'
import type { StringMap, TsJestGlobalOptions } from '../types'
import type { ImportReasons } from '../utils/messages'
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Expand Up @@ -2,7 +2,7 @@ import { TsJestTransformer } from './legacy'

export * from './legacy'
export * from './constants'
export * from './compiler'
export * from './legacy/compiler'
export * from './config'
export * from './presets/create-jest-preset'
export * from './utils'
Expand Down
File renamed without changes.
Expand Up @@ -3,9 +3,9 @@ import { basename, join, normalize } from 'path'

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

import { createConfigSet, makeCompiler } from '../__helpers__/fakers'
import type { DepGraphInfo } from '../types'
import { Errors, interpolate } from '../utils/messages'
import { createConfigSet, makeCompiler } from '../../__helpers__/fakers'
import type { DepGraphInfo } from '../../types'
import { Errors, interpolate } from '../../utils/messages'

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

Expand Down
Expand Up @@ -23,18 +23,18 @@ import type {
TranspileOutput,
} from 'typescript'

import { LINE_FEED, TS_TSX_REGEX } from '../constants'
import type { ConfigSet } from '../legacy/config/config-set'
import { LINE_FEED, TS_TSX_REGEX } from '../../constants'
import type {
DepGraphInfo,
StringMap,
TsCompilerInstance,
TsJestAstTransformer,
TsJestCompileOptions,
TTypeScript,
} from '../types'
import { rootLogger } from '../utils'
import { Errors, interpolate } from '../utils/messages'
} from '../../types'
import { rootLogger } from '../../utils'
import { Errors, interpolate } from '../../utils/messages'
import type { ConfigSet } from '../config/config-set'

export class TsCompiler implements TsCompilerInstance {
protected readonly _logger: Logger
Expand Down
@@ -1,4 +1,4 @@
import { createConfigSet } from '../__helpers__/fakers'
import { createConfigSet } from '../../__helpers__/fakers'

import { TsCompiler } from './ts-compiler'
import { TsJestCompiler } from './ts-jest-compiler'
Expand Down
@@ -1,7 +1,7 @@
import type { TransformedSource } from '@jest/transform'

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

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

Expand Down
2 changes: 1 addition & 1 deletion src/legacy/ts-jest-transformer.spec.ts
Expand Up @@ -6,12 +6,12 @@ import { removeSync, writeFileSync } from 'fs-extra'

import { createConfigSet } from '../__helpers__/fakers'
import { logTargetMock } from '../__helpers__/mocks'
import { TsJestCompiler } from '../compiler'
import type { DepGraphInfo } from '../types'
import { stringify } from '../utils'
import { importer } from '../utils/importer'
import { sha1 } from '../utils/sha1'

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

const SOURCE_MAPPING_PREFIX = 'sourceMappingURL='
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/ts-jest-transformer.ts
Expand Up @@ -4,7 +4,6 @@ import path from 'path'
import type { SyncTransformer, TransformedSource } from '@jest/transform'
import type { Logger } from 'bs-logger'

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

import { TsJestCompiler } from './compiler'
import { ConfigSet } from './config/config-set'

interface CachedConfigSet {
Expand Down
2 changes: 1 addition & 1 deletion src/transformers/path-mapping.spec.ts
Expand Up @@ -3,7 +3,7 @@ import path from 'path'
import ts from 'typescript'

import { createConfigSet, makeCompiler } from '../__helpers__/fakers'
import { TsCompiler } from '../compiler'
import { TsCompiler } from '../legacy/compiler'
import { normalizeSlashes } from '../utils/normalize-slashes'

import { factory as pathMapping, name, version } from './path-mapping'
Expand Down

0 comments on commit 0f2fe30

Please sign in to comment.