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

Allow users to set their own npm-like executables such as yarn #13

Merged
merged 2 commits into from
Jul 7, 2020
Merged

Allow users to set their own npm-like executables such as yarn #13

merged 2 commits into from
Jul 7, 2020

Conversation

0xADD1E
Copy link
Contributor

@0xADD1E 0xADD1E commented Jul 5, 2020

Due to the many inefficiencies of npm, a lot of projects out there prefer to use other package managers such as yarn. This adds a builder option that allows you to set your preferred executable to invoke (assuming it responds to the standard npm-like commands)

Some fun hyperfine benchmarks I ran on a personal project:

Benchmark #1: cargo build (using npm)                                                                                                                                                                                
Time (mean ± σ):     29.870 s ±  0.193 s    [User: 33.465 s, System: 6.722 s]                                                                                                                                        
Range (min … max):   29.541 s … 30.207 s    10 runs                                                                                                                                                                  
                                                                                                                                                                                                                     
Benchmark #1: cargo build (using yarn)                                                                                                                                                                               
  Time (mean ± σ):     16.283 s ±  0.125 s    [User: 18.931 s, System: 5.503 s]                                                                                                                                      
  Range (min … max):   15.941 s … 16.369 s    10 runs

@kilork
Copy link
Owner

kilork commented Jul 6, 2020

Thank you @0xADD1E . Yes, we should not stick to single tool. Not sure we should mix all tools to single struct.

But in case of yarn (I am not really familiar with it so far) looks like it can be just drop in replacement.

Will try to merge to new minor version today.

@kilork
Copy link
Owner

kilork commented Jul 6, 2020

I want to add one more extra use case in README, yarn in the npm use case confuses me.

Should I do this in this PR, or better to not mix, what do you think? @0xADD1E

@0xADD1E
Copy link
Contributor Author

0xADD1E commented Jul 6, 2020

I mean I'm fine with any changes.

For my workflow, it's basically using yarn as a drop-in replacement for npm, and the example was just meant to highlight all the possible options. Splitting it up into multiple example usecases might make sense for people not quite as familiar with all the tools though

@kilork
Copy link
Owner

kilork commented Jul 7, 2020

@0xADD1E Can you please check my commit with the use case for yarn? If everything fine, I want to merge this, just waiting for your approval.

@0xADD1E
Copy link
Contributor Author

0xADD1E commented Jul 7, 2020

Yep, that looks exactly like how I'm using it for my use case. Good to merge!

@kilork
Copy link
Owner

kilork commented Jul 7, 2020

Ok, thank you!

@kilork kilork merged commit a0fa4e8 into kilork:master Jul 7, 2020
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.

2 participants