Skip to content

fix(cli): remove unnecessary dom lib from default TypeScript config created with cdk init #295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 22, 2025

Conversation

46ki75
Copy link
Contributor

@46ki75 46ki75 commented Mar 29, 2025

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

@rix0rrr
Copy link
Contributor

rix0rrr commented Apr 1, 2025

I expect this build to fail, since I explicitly included all the dom libraries to make the definition of Transferable available everywhere which is required by @types/workerpool.

But we'll see...

@codecov-commenter
Copy link

codecov-commenter commented Apr 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.53%. Comparing base (a1d5af9) to head (56b5209).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #295      +/-   ##
==========================================
+ Coverage   85.28%   85.53%   +0.24%     
==========================================
  Files         222      222              
  Lines       36926    36926              
  Branches     4437     4480      +43     
==========================================
+ Hits        31492    31583      +91     
+ Misses       5339     5247      -92     
- Partials       95       96       +1     
Flag Coverage Δ
suite.unit 85.53% <ø> (+0.24%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

auto-merge was automatically disabled April 1, 2025 17:33

Head branch was pushed to by a user without write access

@46ki75 46ki75 force-pushed the fix/remove-dom-from-tsconfig branch from b99190b to 178a366 Compare April 1, 2025 17:33
@rix0rrr
Copy link
Contributor

rix0rrr commented Apr 1, 2025

Oh I see you're not making changes through projen. Those will be erased away automatically. All project config (TypeScript, eslint, everything) goes through the .projenrc.ts file at the root of the package.

@46ki75
Copy link
Contributor Author

46ki75 commented Apr 1, 2025

Thanks for pointing that out!

I confirmed that another package also relies on lib.dom.d.ts due to the workerpool dependency. Since only integ-runner uses workerpool, I updated the projen configuration to add dom to the lib field in integ-runner's tsconfig, and regenerated the files accordingly.

Also, since main had been updated, I took the opportunity to rebase onto the latest main.

@mrgrain mrgrain changed the title chore(tsconfig): remove unnecessary "dom" from Node.js packages fix(cli): remove unnecessary dom lib from default TypeScript config created with cdk init Apr 2, 2025
@mrgrain mrgrain temporarily deployed to integ-approval April 22, 2025 09:21 — with GitHub Actions Inactive
@mrgrain
Copy link
Contributor

mrgrain commented Apr 22, 2025

force merging because codecov failures are unrelated to this PR

@mrgrain mrgrain enabled auto-merge April 22, 2025 10:45
@mrgrain mrgrain disabled auto-merge April 22, 2025 10:45
@mrgrain mrgrain temporarily deployed to integ-approval April 22, 2025 10:47 — with GitHub Actions Inactive
@mrgrain mrgrain added this pull request to the merge queue Apr 22, 2025
Merged via the queue into aws:main with commit 65f7015 Apr 22, 2025
19 of 20 checks passed
@mrgrain mrgrain self-assigned this Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-cdk-cli): TypeScript template includes "dom" in lib, which is unnecessary for Node.js CDK apps
4 participants