shashkovdanil / clean-publish

Removing configuration files and fields in package.json before publishing to npm

Home Page:https://www.npmjs.com/package/clean-publish

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dry run mode (like `npm publish --dry-run`)

igorkamyshev opened this issue · comments

Hello! I've read about this package in @ai's twitter and tried to check the difference of published size for my package.

So, I use npm publish --dry-run to check the list of file to publish and the final size of package. I think, the same mode for this package can be useful to emphasize difference between native publish and this package.

Example of dry-mod in npm:

➜  eslint-plugin-effector git:(master) ✗ npm publish --dry-run        
npm notice 📦  eslint-plugin-effector@0.3.1
npm notice === Tarball Contents === 
...
npm notice 2.0kB rules/no-ambiguity-target/no-ambiguity-target.js                                        
...                                                             
npm notice === Tarball Details === 
npm notice name:          eslint-plugin-effector                  
npm notice version:       0.3.1                                   
npm notice package size:  8.4 kB                                  
npm notice unpacked size: 34.8 kB                                 
...
npm notice total files:   32                                      

We have --no-publish mode. Should we add alias to --dry-mode?

--no-publish just creates a folder and doesn't write an info about it in terminal 🤔

I tried to check the size of the result directory by myself, but results weren't correct (because it should respect .npmignore for example).

Yeap, for --dry-run we can call npm publish --dry-run on temporary directory.

Can I ask you to send PR.

Yeah, I'll do it.

Should we remove temporary directory after npm publish --dry-run call?

Should we remove temporary directory after npm publish --dry-run call?

Yeap