tsdoc icon indicating copy to clipboard operation
tsdoc copied to clipboard

Ship only production runtime files

Open osher opened this issue 1 year ago • 6 comments

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 avatar May 05 '24 18:05 osher

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 avatar May 05 '24 18:05 osher

@microsoft-github-policy-service agree

osher avatar May 05 '24 18:05 osher

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

osher avatar May 13 '24 08:05 osher

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

iclanton avatar May 28 '24 08:05 iclanton

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.

iclanton avatar May 28 '24 08:05 iclanton

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.

iclanton avatar May 28 '24 08:05 iclanton