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

[legacy-framework] Print helpful error if try to use CLI commands outside of blitz app #203

Merged
merged 13 commits into from
Apr 28, 2020

Conversation

Zeko369
Copy link
Collaborator

@Zeko369 Zeko369 commented Apr 23, 2020

Pull Request Type

  • Feature
  • Bug fix
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Tests related changes
  • Other (please describe): Dependency updates

What's the reason for the change? ❓

Closes: blitz-js/legacy-framework#892

What are the changes and their implications? ⚙️

Check if inside of blitz app

Does this introduce a breaking change? ⚠️

  • Yes
  • No

Other information

I made it so it checks you're in the root of the project, because although some commands can work throughout the project structure, some fail so we should encourage people to just run it from the root path

image

@Zeko369 Zeko369 requested a review from flybayer as a code owner April 23, 2020 15:52
@Zeko369
Copy link
Collaborator Author

Zeko369 commented Apr 23, 2020

Closes blitz-js/legacy-framework#892

@flybayer flybayer marked this pull request as draft April 25, 2020 04:25
@Zeko369 Zeko369 self-assigned this Apr 25, 2020
@Zeko369 Zeko369 marked this pull request as ready for review April 26, 2020 10:08
@Zeko369 Zeko369 requested a review from flybayer April 26, 2020 10:22
@flybayer
Copy link
Member

Sweeet! Two things:

  1. Can you use the pkg-dir package that's already installed instead of find-package-json?
  2. Could you add a detailed comment in the utils file describing the blitz app detection and all the possible outcomes?

Thank you so much!

@flybayer flybayer marked this pull request as draft April 27, 2020 05:59
@Zeko369 Zeko369 marked this pull request as ready for review April 27, 2020 23:54
@flybayer flybayer requested a review from aem as a code owner April 28, 2020 14:19
@flybayer
Copy link
Member

This is beautiful — great work!!!

@flybayer flybayer changed the title Exit gracefully if outside of blitz app Print helpful error if try to use CLI commands outside of blitz app Apr 28, 2020
@flybayer flybayer merged commit e8f68a5 into blitz-js:canary Apr 28, 2020
@aem
Copy link
Collaborator

aem commented Apr 28, 2020

@Zeko369 i think we have commands that check for this manually, can you follow up and convert those usages to use the new utils?

@Zeko369
Copy link
Collaborator Author

Zeko369 commented Apr 28, 2020

@aem you pushed the new utils?

@aem
Copy link
Collaborator

aem commented Apr 28, 2020

Ah sorry my comment was a bit unclear. Since this hook/util you added handles it for all commands, can you remove any checks for blitz.config in existing commands?

aem added a commit that referenced this pull request Apr 28, 2020
merelinguist pushed a commit that referenced this pull request Apr 28, 2020
@itsdillon itsdillon changed the title Print helpful error if try to use CLI commands outside of blitz app [legacy-framework] Print helpful error if try to use CLI commands outside of blitz app Jul 7, 2022
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.

Exit gracefully and show helpful message when running the blitz cli outside a blitz app
3 participants