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 only valid options for commands #1467

Merged
merged 7 commits into from
Nov 12, 2020
Merged

Allow only valid options for commands #1467

merged 7 commits into from
Nov 12, 2020

Conversation

prateekbh
Copy link
Member

What kind of change does this PR introduce?

This now throws error if the user passes invalid argument around build, create or watch.

Did you add tests for your changes?

Yes

Summary

Sample

$ mypreact watch --refresher
✖ ERROR Invalid argument refresher passed to watch. Please refer to 'preact watch --help' for full list of options.

$ mypreact build --no-service-worker
✖ ERROR Invalid argument service-worker passed to build. Please refer to 'preact build --help' for full list of options.

Does this PR introduce a breaking change?
No.

@prateekbh prateekbh requested a review from a team as a code owner October 31, 2020 08:22
@changeset-bot
Copy link

changeset-bot bot commented Oct 31, 2020

🦋 Changeset detected

Latest commit: ec760ab

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
preact-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@prateekbh prateekbh changed the title Allow only valid options Allow only valid options for cdommands Oct 31, 2020
@prateekbh prateekbh changed the title Allow only valid options for cdommands Allow only valid options for commands Oct 31, 2020
description: 'Launch interactive Analyzer to inspect production bundle(s)',
},
{
name: '--prerenderUrls',
Copy link
Member

Choose a reason for hiding this comment

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

We allow --prerender-urls too right?

Copy link
Member

Choose a reason for hiding this comment

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

I don't know if camel case is really something a cli should use, but seems like that's what we had before and only that

Copy link
Member Author

Choose a reason for hiding this comment

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

seems like we don't allow --prerender-urls as of now. So technically changing this would be a breaking change.

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