-
Notifications
You must be signed in to change notification settings - Fork 583
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
chore(scripts): add script to downlevel-dts and strip comments #2834
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2834 +/- ##
=======================================
Coverage 60.41% 60.41%
=======================================
Files 554 554
Lines 28885 28885
Branches 7072 7072
=======================================
Hits 17452 17452
Misses 11433 11433 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how long this step takes, if it takes minutes, we should use cluster
module. I'm also looking for good 3-p library wrapping it.
Tested on # Ensured that ts3.4 folders are removed from all workspaces by running the followings script
$ foreach dir ("lib" "packages" "clients" "protocol_tests")
for d in $dir/* ;do (cd "$d" && rm -rf dist/types/ts3.4); done
end
$ time yarn downlevel-dts
yarn run v1.22.11
$ node ./scripts/downlevel-dts
Done in 699.06s.
yarn downlevel-dts 1165.78s user 64.57s system 175% cpu 11:39.19 total
I'll post a different PR to perform the operations in parallel. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Issue
Description
Runs downlevel-dts npm script (if present) in each workspace of monorepo, and strips comments from
*.d.ts
files. The npm install size is reduced by~6%
.Script
Rename
.txt
to.js
before runningnpmInstallSizes.txt
Before
Total size: 834.16 MB
before.md
After
Total size: 789.60 MB
after.md
Testing
Verified that comments are removed from
*.d.ts
files.Tested by running manually running local
downlevel-dts
inpackages/abort-controller
followed by running globaldownlevel-dts
:Before
After
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.