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 programmatic usage #4

Closed
danburzo opened this issue Sep 28, 2018 · 4 comments
Closed

Allow programmatic usage #4

danburzo opened this issue Sep 28, 2018 · 4 comments
Labels
Available This issue is up for grabs Feature New feature or enhancement

Comments

@danburzo
Copy link
Owner

No description provided.

@danburzo danburzo added Available This issue is up for grabs Feature New feature or enhancement labels Sep 28, 2018
@phenax
Copy link
Contributor

phenax commented Oct 13, 2018

Can I work on this issue?

This was referenced Oct 15, 2018
@danburzo
Copy link
Owner Author

Yes, that would be great! Let's outline how we can move some things around in an interface that makes sense. I guess we can start by having a separate cli.js file for the CLI and leave index.js for exporting the bundle and cleanup methods.

In the future, I see more of the steps as being configurable. I'll get back on this thread once the thought crystallizes.

@phenax
Copy link
Contributor

phenax commented Oct 15, 2018

Awesome!
I'll start by moving the commander stuff to a cli.js and get a PR ready.
Btw, I feel like a node api shouldn't log to the console so we should remove the console.log's out of the api by either splitting the function into smaller parts so the cli can add console logs in between and the node api will export a non-console log version of it. Or it can return an instance of an event emitter in which case the node api will emit lifecycle events and the cli will console log on those events.
Either way, it is an enhancement deserving another PR. What do you think?

@danburzo
Copy link
Owner Author

Btw, I feel like a node api shouldn't log to the console so we should remove the console.log's out of the api by either splitting the function into smaller parts so the cli can add console logs in between and the node api will export a non-console log version of it.

Agreed. The only really useful output from the program is the path to the temporary HTML. As we figure out how programmatic usage will look like, we may have the opportunity of either having the library expose a log() method or, as you said, an event emitter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Available This issue is up for grabs Feature New feature or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants