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

Feat/parse only single file #187

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

saimonnozaki
Copy link

Overview

This is a feature request.

Our project appreciates this awesome project, because its has so many class style components.
By the way, we want to migrate .vue file one by one checking passing unit tests.

So, this feature request proposes that vue-class-migrator can parse CLI option -f same as -d.

Design

vue-class-migrator...

  • can parse an option of single file migration
    • Add migrate function of entry point
  • can parse -d option same as before
    • partially generalized migration promise
  • force select either -f or -d
    • Add OptionParser class to force option selection

Checks

I checked that...

  • -f option works
  • adding unit tests and existing tests does not break


const program = new Command()
.requiredOption('-d, --directory <string>', 'Directory to migrate')
.option('-d, --directory <string>', 'Directory to migrate. Either directory or file should be provided, not both or none.')
Copy link
Author

Choose a reason for hiding this comment

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

OptionParser guarantees option requirements

@saimonnozaki
Copy link
Author

@victorcuena

Hello, thank you for such an awesome project.

Would you please review this feature request?

@victorcuena
Copy link
Collaborator

Thanks a lot for the PR, I just added a comment, the rest looks good to me.

@saimonnozaki
Copy link
Author

@victorcuena

Thank you checking my PR. Sorry but, I cannot see where your comment is. Did you leave comment on the code diff?

src/migrator-cli.ts Outdated Show resolved Hide resolved
Co-authored-by: Victor Cuena Garcia <[email protected]>
@saimonnozaki
Copy link
Author

@victorcuena

Thanks alot for your review! I fixed it, would you please review this again?

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