Skip to content

Commit d8f6b96

Browse files
authored
refactor(transformers): deprecate path-mapping AST transformer (#3088)
DEPRECATION `path-mapping` AST transformer is deprecated. One should use alternative one like https://github.com/LeDDGroup/typescript-transform-paths instead
1 parent f316352 commit d8f6b96

18 files changed

+3
-199
lines changed

e2e/__tests__/ast-transformers.test.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,6 @@ const executeTest = (testDir: string): void => {
2121
})
2222
}
2323

24-
describe('path-mapping', () => {
25-
const PATH_MAPPING_DIR_NAME = 'path-mapping'
26-
27-
describe('ts-4.5+', () => {
28-
executeTest(`${AST_TRANSFORMERS_DIR_NAME}/${PATH_MAPPING_DIR_NAME}/ts-4.5+`)
29-
})
30-
31-
describe('ts-4.5-', () => {
32-
const DIR = path.join(__dirname, '..', AST_TRANSFORMERS_DIR_NAME, PATH_MAPPING_DIR_NAME, 'ts-4.5-')
33-
34-
beforeAll(() => {
35-
runNpmInstall(DIR)
36-
execa.sync('npm', ['install', '--no-package-lock', '--no-shrinkwrap', '--no-save', tsJestBundle], {
37-
cwd: DIR,
38-
})
39-
})
40-
41-
executeTest(`${AST_TRANSFORMERS_DIR_NAME}/${PATH_MAPPING_DIR_NAME}/ts-4.5-`)
42-
})
43-
})
44-
4524
describe('transformer-options', () => {
4625
const TRANSFORM_OPT_DIR_NAME = 'transformer-options'
4726

e2e/ast-transformers/path-mapping/__tests__/direct-import.spec.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

e2e/ast-transformers/path-mapping/__tests__/dynamic-import.spec.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

e2e/ast-transformers/path-mapping/__tests__/export.spec.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

e2e/ast-transformers/path-mapping/__tests__/import-default.spec.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

e2e/ast-transformers/path-mapping/__tests__/import-legacy.spec.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

e2e/ast-transformers/path-mapping/__tests__/import-require.spec.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

e2e/ast-transformers/path-mapping/__tests__/import-star.spec.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

e2e/ast-transformers/path-mapping/__tests__/import-type.spec.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

e2e/ast-transformers/path-mapping/share/export.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

e2e/ast-transformers/path-mapping/share/foo.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

e2e/ast-transformers/path-mapping/ts-4.5+/jest-isolated.config.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

e2e/ast-transformers/path-mapping/ts-4.5+/package.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

e2e/ast-transformers/path-mapping/ts-4.5-/jest-isolated.config.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

e2e/ast-transformers/path-mapping/ts-4.5-/package-lock.json

Lines changed: 0 additions & 31 deletions
This file was deleted.

e2e/ast-transformers/path-mapping/ts-4.5-/package.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

e2e/ast-transformers/path-mapping/tsconfig.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/transformers/path-mapping.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ export function factory({
2828
configSet,
2929
}: TsCompilerInstance): (ctx: _ts.TransformationContext) => _ts.Transformer<_ts.SourceFile> {
3030
const logger = configSet.logger.child({ namespace: name })
31+
logger.warn(
32+
'path-mapping AST transformer is deprecated and will be removed in `ts-jest` v28. Please use an alternative one, like https://github.com/LeDDGroup/typescript-transform-paths instead',
33+
)
3134
const ts = configSet.compilerModule
3235
const tsFactory = ts.factory ? ts.factory : ts
3336
const compilerOptions = configSet.parsedTsConfig.options

0 commit comments

Comments
 (0)