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

refactor: create mason_cli #156

Closed
passsy opened this issue Nov 16, 2021 · 2 comments · Fixed by #162
Closed

refactor: create mason_cli #156

passsy opened this issue Nov 16, 2021 · 2 comments · Fixed by #162
Assignees
Labels
refactor Refactor an existing implementation

Comments

@passsy
Copy link

passsy commented Nov 16, 2021

I'm using mason to ship templates with my cli. The APIs I'm using in the cli are MasonBundle.fromJson, MasonGenerator.fromBundle and MasonGenerator.generate.

There are dependencies in the current mason package that might cause unnecessary conflicts. Unnecessary because they aren't required for mason to generate templates, but only for the cli part of the package:

dependencies:
  args: ^2.1.0
  http: ^0.13.3
  pub_updater: ^0.2.1
  universal_io: ^2.0.4

mason should be split into two packages:

  • One for the cli part (with /bin directory)
  • One for the tempalte/generation part with minimal dependencies

This split allows the CLI to use and ship the latest dependencies while allowing wide dependency ranges for packages which use mason as dependency.

While it sounds like a duplicate of #91, I think this split alone is easier to achieve and it fixes a realworld problem.

@passsy passsy added the refactor Refactor an existing implementation label Nov 16, 2021
@felangel
Copy link
Owner

Hi @passsy 👋
Thanks for opening an issue!

I agree it would make sense to decouple the CLI from the generator (similar to #91). My only comments are:

  • universal_io would still be a dependency for the generator because of the I/O and logging (stdout, stderr)
  • I'm still not sure if it'd be better to rename mason to mason_cli and keep mason as the generator or whether to keep mason as the cli and create mason_core/mason_generator/mason_engine to contain the generator.

Do you prefer having mason and mason_cli?

Thanks again!

@felangel felangel self-assigned this Nov 16, 2021
@passsy
Copy link
Author

passsy commented Nov 16, 2021

I prefer mason_cli and mason as the generator. Although it is a breaking change, but that is ok for version 0.0.1-dev 😉

Alternatively mason and mason_generator would be fine too 🤷

@felangel felangel changed the title refactor: Separate mason-cli refactor: create mason_cli Nov 16, 2021
alestiago pushed a commit to alestiago/mason that referenced this issue Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Refactor an existing implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants