Skip to content

Commit 65f7015

Browse files
46ki75mrgrain
andauthored
fix(cli): remove unnecessary dom lib from default TypeScript config created with cdk init (#295)
Fixes #294 This change also removes `"dom"` from the `tsconfig.json` files of additional packages that are all intended to run in a Node.js environment, not in the browser. Since these packages are not expected to use any web runtime-specific APIs, removing `"dom"` helps prevent accidental use of browser-only types across the codebase. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license --------- Co-authored-by: Momo Kornher <kornherm@amazon.co.uk>
1 parent 3085cfc commit 65f7015

File tree

22 files changed

+21
-49
lines changed

22 files changed

+21
-49
lines changed

.github/workflows/codecov.yml

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

.projenrc.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const CLI_SDK_V3_RANGE = '^3';
9292
const defaultTsOptions: NonNullable<TypeScriptWorkspaceOptions['tsconfig']>['compilerOptions'] = {
9393
target: 'ES2020',
9494
module: 'commonjs',
95-
lib: ['es2020', 'dom'],
95+
lib: ['es2020'],
9696
incremental: true,
9797
esModuleInterop: false,
9898
skipLibCheck: true,
@@ -1586,6 +1586,7 @@ const integRunner = configureProject(
15861586
tsconfig: {
15871587
compilerOptions: {
15881588
...defaultTsOptions,
1589+
lib: ['es2020', 'dom'],
15891590
},
15901591
},
15911592
jestOptions: jestOptionsForProject({

packages/@aws-cdk/cdk-cli-wrapper/tsconfig.dev.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.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 & 2 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/tsconfig.dev.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-plugin-contract/tsconfig.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/cloudformation-diff/tsconfig.dev.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/cloudformation-diff/tsconfig.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/node-bundle/tsconfig.dev.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/node-bundle/tsconfig.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/user-input-gen/tsconfig.dev.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/user-input-gen/tsconfig.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/lib/init-templates/app/typescript/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"target": "ES2020",
44
"module": "commonjs",
55
"lib": [
6-
"es2020",
7-
"dom"
6+
"es2020"
87
],
98
"declaration": true,
109
"strict": true,

packages/aws-cdk/lib/init-templates/lib/typescript/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"target": "ES2020",
44
"module": "commonjs",
55
"lib": [
6-
"es2020",
7-
"dom"
6+
"es2020"
87
],
98
"declaration": true,
109
"strict": true,

packages/aws-cdk/lib/init-templates/sample-app/javascript/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"target": "ES2020",
44
"module": "commonjs",
55
"lib": [
6-
"es2020",
7-
"dom"
6+
"es2020"
87
],
98
"declaration": true,
109
"strict": true,

packages/aws-cdk/lib/init-templates/sample-app/typescript/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"target": "ES2020",
44
"module": "commonjs",
55
"lib": [
6-
"es2020",
7-
"dom"
6+
"es2020"
87
],
98
"declaration": true,
109
"strict": true,

packages/cdk-assets/tsconfig.dev.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/cdk-assets/tsconfig.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/cdk/tsconfig.dev.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/cdk/tsconfig.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.

projenrc/codecov.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,6 @@ export class CodeCovWorkflow extends Component {
5454
fail_ci_if_error: true,
5555
flags: 'suite.unit',
5656
use_oidc: true,
57-
58-
// Version of CodeCov CLI to download and run.
59-
//
60-
// 'latest' if this is omitted, but we're seeing v10.4.0 producing the following error:
61-
// ```
62-
// -> Token of length 0 detected
63-
// error - 2025-04-08 13:34:06,401 -- Upload failed: {"message":"Token required because branch is protected"}
64-
// ```
65-
version: 'v10.3.0',
6657
},
6758
},
6859
],

0 commit comments

Comments
 (0)