Skip to content

standalone cli #89

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 10 commits into from
Jan 1, 2022

Conversation

romainmenke
Copy link
Member

@romainmenke romainmenke commented Dec 23, 2021

  • includes all plugins, including postcss-preset-env
  • no package specific cli's that existed before and were documented have been removed
  • sourcemaps have been removed to reduce package size

This is intended to be a non-breaking change.
So hopefully I did not overlook anything.

To test :

npm ci
npm run build
npm install

cd plugin-packs/csstools-cli
npm run csstools-cli
npm run csstools-cli css-has-pseudo
...

last install might not be needed, unsure


The goal here is to reduce the package size of all plugins:

before

📦  postcss-logical@5.0.1
=== Tarball Contents === 
1.8kB  CHANGELOG.md      
3.6kB  INSTALL.md        
6.8kB  LICENSE.md        
6.8kB  README.md         
97.5kB dist/cli.mjs      
13.3kB dist/index.cjs    
45.9kB dist/index.cjs.map
13.2kB dist/index.mjs    
45.9kB dist/index.mjs.map
1.7kB  package.json      
=== Tarball Details === 
name:          postcss-logical                         
version:       5.0.1                                   
filename:      postcss-logical-5.0.1.tgz               
package size:  56.0 kB                                 
unpacked size: 236.5 kB                                
shasum:        9768a13aeef1b93d1dca9aa60870901210b89aa8
integrity:     sha512-O72zxfN+cNczW[...]ignKn16Rhi2NQ==
total files:   10                                                                          
  • sourcemaps can be removed (bug reports never include stack traces)
  • cli could be a standalone

after

📦  postcss-logical@5.0.1
=== Tarball Contents === 
1.8kB  CHANGELOG.md  
3.6kB  INSTALL.md    
6.8kB  LICENSE.md    
6.8kB  README.md     
13.2kB dist/index.cjs
13.1kB dist/index.mjs
1.7kB  package.json  
=== Tarball Details === 
name:          postcss-logical                         
version:       5.0.1                                   
filename:      postcss-logical-5.0.1.tgz               
package size:  12.4 kB                                 
unpacked size: 47.1 kB                                 
shasum:        139557203a1ab9e193781494e3ccd022f2ab0b13
integrity:     sha512-bH7OIjcMnP5V3[...]yViG9+nO29WTw==
total files:   7    
- package size:  56.0 kB
- unpacked size: 236.5 kB
+ package size:  12.4 kB
+ unpacked size: 47.1 kB

update : I also excluded INSTALL.md from the published package, saves another ±5kB

@romainmenke romainmenke marked this pull request as ready for review December 30, 2021 12:55
@@ -0,0 +1 @@
v16.13.1
Copy link
Member

Choose a reason for hiding this comment

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

Slightly nit and potentially unrelated but should we just add 16?

Copy link
Member Author

Choose a reason for hiding this comment

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

16 sounds good.

We can change it in a different PR, or straight to main.

@@ -8,8 +8,8 @@ export function packageJavascript() {
{
input: 'src/index.js',
output: [
{ file: 'dist/index.cjs', format: 'cjs', sourcemap: true, exports: 'auto' },
{ file: 'dist/index.mjs', format: 'esm', sourcemap: true, exports: 'auto' },
{ file: 'dist/index.cjs', format: 'cjs', sourcemap: false, exports: 'auto' },
Copy link
Member

Choose a reason for hiding this comment

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

❤️ that you've disabled sourcemaps here too! Thanks

Copy link
Member

@Antonio-Laguna Antonio-Laguna left a comment

Choose a reason for hiding this comment

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

Impressive work! Will merge soon :)

@Antonio-Laguna
Copy link
Member

Can you add the CLI to the autolabeler too?

@Antonio-Laguna Antonio-Laguna merged commit 4859f6b into main Jan 1, 2022
@Antonio-Laguna Antonio-Laguna deleted the standalone-cli--compassionate-burmese-d76145e3f4 branch January 1, 2022 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment