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

Re-enable using commands as api #243

Merged
merged 4 commits into from
Feb 1, 2022

Conversation

zwaldowski
Copy link
Contributor

This PR fixes using the named exports build and preview by other packages. For completeness, it also adds init. A test is added for using build this way.

The exports were first made available in #52. They were broken after #96, because the subcommands ran their parsing at the top level of the file. Just importing the methods would run the command parser and exit the process, ignoring the arguments passed in.

The named exports build, preview, and init are moved to separate files. The new files specifically don’t import commander so that they work with tree-shaking tools.

@CLAassistant
Copy link

CLAassistant commented Jan 25, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@spring-raining spring-raining left a comment

Choose a reason for hiding this comment

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

@zwaldowski Thank you for the PR. This API abstraction is definitely better than the previous one! Please check this.

src/build.ts Show resolved Hide resolved
@zwaldowski zwaldowski changed the title fix: re-enable using commands as api Re-enable using commands as api Feb 1, 2022
Copy link
Member

@spring-raining spring-raining left a comment

Choose a reason for hiding this comment

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

👍

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.

None yet

3 participants