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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate CLI? #436

Closed
ben-eb opened this issue Oct 6, 2015 · 16 comments
Closed

Separate CLI? #436

ben-eb opened this issue Oct 6, 2015 · 16 comments

Comments

@ben-eb
Copy link
Contributor

ben-eb commented Oct 6, 2015

SVGO has a lot of dependents - it would be nice to extract the CLI into a separate module so that consumers of the JS API don't have to download coa, mkdirp et al. 馃槃

@TrySound
Copy link
Member

TrySound commented Oct 6, 2015

馃憤

@GreLI
Copy link
Member

GreLI commented Oct 7, 2015

Can you provide an example of such a package? How to provide CLI in such a way?

@ben-eb
Copy link
Contributor Author

ben-eb commented Oct 7, 2015

Essentially it means removing the binary and associated dependencies/code from this module, out to a new module, say svgo-cli. Then svgo-cli would depend on svgo, and be its own package with its own tests etc.

cssnano/cssnano@8f4db22

@TrySound
Copy link
Member

@GreLI Any thoughts?

@GreLI
Copy link
Member

GreLI commented Oct 23, 2015

That's a major change, and I'm not sure, that it really worth it.

@TrySound
Copy link
Member

@GreLI You can firstly just make svgo-cli which will be dependent on svgo. Dependencies will be deduped.

@GreLI
Copy link
Member

GreLI commented Oct 23, 2015

Why do you think that dependendecies are such a big problem? Perhaps, svgo will reutilize them in the future 馃槣.
Besides, users are got used to just do npm install svgo and I don't think that breaking this pattern is a good idea either.

@ben-eb
Copy link
Contributor Author

ben-eb commented Oct 23, 2015

After reading @sindresorhus' reasoning on this (sindresorhus/ama#17 (comment)) I thought it was a good practice to have a separate CLI. It makes sense for those wrapper modules that will not make use of the command line, and therefore don't need the dependencies. This way the package is leaner overall. 馃槃

The why is simple; extra calls to npm & more to download means slower build times. Less is more.

@sindresorhus
Copy link
Contributor

馃憤 In addition, it makes the readmes neater, as you don't have to fit both CLI and API docs into one readme.

@GreLI
Copy link
Member

GreLI commented Oct 24, 2015

Is it a big issue? I don't think so.

@TrySound
Copy link
Member

@GreLI For you it's not a big issue. For us yes. Web should be small in every ways.

@wtgtybhertgeghgtwtg
Copy link

Would you accept a PR for this?

@GreLI
Copy link
Member

GreLI commented Oct 27, 2016

I afraid this goes beyond a simple PR.

@wtgtybhertgeghgtwtg
Copy link

Sorry, a PR and an svgo-cli repository. Or a PR and an svgo-core repository. Whichever way it would be.

@GreLI
Copy link
Member

GreLI commented Nov 19, 2016

I'm hardly imagine such a request, but you can try make so.

@GreLI GreLI closed this as completed Nov 19, 2016
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

No branches or pull requests

5 participants