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

improve sandbox command error handling and debugging #18869

Merged
merged 3 commits into from
Aug 9, 2022

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Aug 4, 2022

What I did

The yarn sandbox command was failing silently when the sandbox folder didn't exist. This PR does:

  • Ensure sandbox folder always exists before doing anything
  • Replace shelljs implementation with execa
  • Add "debug" flag so users can get full output, which is set to false by default to all steps but yarn storybook. The result is nice:

image

Additionally, if you pass a wrong value to the possible values of a flag, you get a much better response now:

image

How to test

  1. have no sandbox folder
  2. run yarn sandbox
  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

@yannbf yannbf added the maintenance User-facing maintenance tasks label Aug 4, 2022
@yannbf yannbf requested a review from tmeasday August 4, 2022 11:19
Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

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

Love the debug flag. I think the execa call needs to actually error and also maybe show the output when it fails though.

scripts/utils/exec.ts Outdated Show resolved Hide resolved
scripts/sandbox.ts Show resolved Hide resolved
@yannbf yannbf requested a review from tmeasday August 8, 2022 16:37
Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

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

Awesome!

@tmeasday tmeasday merged commit 308de76 into next Aug 9, 2022
@tmeasday tmeasday deleted the yann/sb-635-command-silently-fails-if-sandbox-doesnt branch August 9, 2022 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants