Skip to content
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

Ship only production runtime files #378

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

osher
Copy link

@osher osher commented May 5, 2024

this will reduce your on-disk node_modules footprint from ~500K to ~80K.

$ du -ahd 1 node_modules/@microsoft/tsdoc-config/lib
12.0K   node_modules/@microsoft/tsdoc-config/lib/TSDocConfigFile.d.ts
4.0K    node_modules/@microsoft/tsdoc-config/lib/index.js
4.0K    node_modules/@microsoft/tsdoc-config/lib/TSDocConfigFile.d.ts.map
420.0K  node_modules/@microsoft/tsdoc-config/lib/__tests__
4.0K    node_modules/@microsoft/tsdoc-config/lib/index.d.ts
4.0K    node_modules/@microsoft/tsdoc-config/lib/index.d.ts.map
28.0K   node_modules/@microsoft/tsdoc-config/lib/TSDocConfigFile.js
4.0K    node_modules/@microsoft/tsdoc-config/lib/index.js.map
44.0K   node_modules/@microsoft/tsdoc-config/lib/TSDocConfigFile.js.map
528.0K  node_modules/@microsoft/tsdoc-config/lib

I mean, good work with the tests and all, but don't ship them...

You also don't need to ship map files for ts.

P.S.
I would put more accurate numbers like I did for resolve - (which BTW affects you too!), but npm i fails...
I saw you use a different toolchain, but could not get started with this rush. all kinds of wierd errors... :P I had to give up.

@osher
Copy link
Author

osher commented May 5, 2024

oh. there's more diet to do...

28K     @microsoft/tsdoc/lib-commonjs/__tests__ 
36K     @microsoft/tsdoc/lib-commonjs/beta/__tests__ 
12K     @microsoft/tsdoc/lib-commonjs/emitters/__tests__ 
120K    @microsoft/tsdoc/lib-commonjs/parser/__tests__ 
52K     @microsoft/tsdoc/lib/__tests__ 
40K     @microsoft/tsdoc/lib/beta/__tests__ 
20K     @microsoft/tsdoc/lib/emitters/__tests__ 
232K    @microsoft/tsdoc/lib/parser/__tests__ 

note that it's all shipped twice 😛 - just the __tests__ thingy

@osher
Copy link
Author

osher commented May 5, 2024

@microsoft-github-policy-service agree

@osher
Copy link
Author

osher commented May 13, 2024

@iclanton - the CI seems stuck... help?

@iclanton
Copy link
Member

@osher - I'll take a look this week.

@iclanton
Copy link
Member

You need to run rush change, and we should try to eliminate the .npmignore files if we're going to move to the "files" package.json field.

Comment on lines +23 to +24
"lib-commonjs/*.js",
"lib-commonjs/*.js.map",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These (and the patterns for lib) only match files in the root of the lib-commonjs folder. This project has files that are in nested folders.

@iclanton
Copy link
Member

You also don't need to ship map files for ts.

.ts.map files are useful for mapping declaration issues back to the location in source, but we aren't embedding the source in those files, so shipping them is indeed not all that useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants