Skip to content

Commit e9c24a6

Browse files
mrgrainrix0rrr
andauthored
chore: use isolatedModules tsconfig everywhere (#620)
Replaces the deprecated `ts-jest` config of the same name. Also includes some small alignments of `tsconfig.dev.json` files with their corresponding parent, where previously missed. Also removes `dom` from `integ-runner` since this is not needed. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license --------- Co-authored-by: Rico Hermans <[email protected]>
1 parent 3f8110f commit e9c24a6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+64
-69
lines changed

.projenrc.ts

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ const defaultTsOptions: NonNullable<TypeScriptWorkspaceOptions['tsconfig']>['com
8282
incremental: true,
8383
esModuleInterop: false,
8484
skipLibCheck: true,
85+
isolatedModules: true,
8586
};
8687

8788
/**
@@ -302,11 +303,6 @@ function genericCdkProps(props: GenericProps = {}) {
302303
authorUrl: 'https://aws.amazon.com',
303304
authorOrganization: true,
304305
releasableCommits: pj.ReleasableCommits.featuresAndFixes('.'),
305-
tsJestOptions: {
306-
transformOptions: {
307-
isolatedModules: true,
308-
},
309-
},
310306
jestOptions: {
311307
configFilePath: 'jest.config.json',
312308
junitReporting: false,
@@ -322,6 +318,11 @@ function genericCdkProps(props: GenericProps = {}) {
322318
trailingComma: pj.javascript.TrailingComma.ALL,
323319
},
324320
},
321+
tsconfig: {
322+
compilerOptions: {
323+
...defaultTsOptions,
324+
},
325+
},
325326
typescriptVersion: TYPESCRIPT_VERSION,
326327
checkLicenses: props.private ? undefined : {
327328
allow: ['Apache-2.0', 'MIT', 'ISC', 'BSD-3-Clause', '0BSD'],
@@ -684,18 +685,21 @@ const TOOLKIT_LIB_EXCLUDE_PATTERNS = [
684685
'lib/init-templates/*/typescript/*/*.template.ts',
685686
];
686687

688+
const toolkitLibTsCompilerOptions = {
689+
...defaultTsOptions,
690+
target: 'es2022',
691+
lib: ['es2022', 'esnext.disposable'],
692+
module: 'NodeNext',
693+
declarationMap: true,
694+
};
695+
687696
const toolkitLib = configureProject(
688697
new yarn.TypeScriptWorkspace({
689698
...genericCdkProps(),
690699
parent: repo,
691700
name: '@aws-cdk/toolkit-lib',
692701
description: 'AWS CDK Programmatic Toolkit Library',
693702
srcdir: 'lib',
694-
tsconfigDev: {
695-
compilerOptions: {
696-
rootDir: '.', // shouldn't be required but something broke... check again once we have gotten rid of the tmpToolkitHelpers package
697-
},
698-
},
699703
peerDeps: [
700704
cliPluginContract.customizeReference({ versionType: 'any-minor' }), // allow consumers to easily de-depulicate this
701705
],
@@ -791,17 +795,13 @@ const toolkitLib = configureProject(
791795
}),
792796
tsconfig: {
793797
compilerOptions: {
794-
...defaultTsOptions,
795-
target: 'es2022',
796-
lib: ['es2022', 'esnext.disposable'],
797-
module: 'NodeNext',
798-
isolatedModules: true,
799-
declarationMap: true,
798+
...toolkitLibTsCompilerOptions,
800799
},
801800
},
802-
tsJestOptions: {
803-
transformOptions: {
804-
isolatedModules: false, // we use the respective tsc setting
801+
tsconfigDev: {
802+
compilerOptions: {
803+
...toolkitLibTsCompilerOptions,
804+
rootDir: '.', // shouldn't be required but something broke... check again once we have gotten rid of the tmpToolkitHelpers package
805805
},
806806
},
807807
majorVersion: 1,
@@ -1070,12 +1070,6 @@ const cli = configureProject(
10701070
'yaml@^1',
10711071
'yargs@^15',
10721072
],
1073-
tsJestOptions: {
1074-
transformOptions: {
1075-
// Skips type checking, otherwise tests take too long
1076-
isolatedModules: true,
1077-
},
1078-
},
10791073
tsconfig: {
10801074
compilerOptions: {
10811075
...defaultTsOptions,
@@ -1096,7 +1090,6 @@ const cli = configureProject(
10961090
esModuleInterop: false,
10971091
skipLibCheck: true,
10981092
},
1099-
11001093
},
11011094
eslintOptions: {
11021095
dirs: ['lib'],
@@ -1466,13 +1459,6 @@ const integRunner = configureProject(
14661459
tsconfig: {
14671460
compilerOptions: {
14681461
...defaultTsOptions,
1469-
lib: ['es2020', 'dom'],
1470-
isolatedModules: true,
1471-
},
1472-
},
1473-
tsJestOptions: {
1474-
transformOptions: {
1475-
isolatedModules: false, // we use the respective tsc setting
14761462
},
14771463
},
14781464
jestOptions: jestOptionsForProject({

packages/@aws-cdk-testing/cli-integ/jest.config.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/cli-integ/tsconfig.dev.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/cli-integ/tsconfig.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/cdk-cli-wrapper/jest.config.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/cdk-cli-wrapper/tsconfig.dev.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/cdk-cli-wrapper/tsconfig.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/cli-lib-alpha/jest.config.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/cli-lib-alpha/tsconfig.dev.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/cli-plugin-contract/jest.config.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)