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(shorebird_cli): improve "shorebird not initialized" error messages #1779

Merged
merged 3 commits into from
Mar 7, 2024

Conversation

bryanoltman
Copy link
Contributor

Description

When a user is running a shorebird command outside of a shorebird directory, or if a user's pubspec.yaml is missing shorebird.yaml as a flutter asset, we print the error message Shorebird is not initialized. Did you run "shorebird init"?, which is confusing to users (see https://discord.com/channels/1030243211995791380/1215306109137584128).

This change updates the error message to help the user pinpoint the problem more quickly. If no shorebird.yaml is found, it now tells them:

Unable to find shorebird.yaml. Are you in a shorebird app directory?
If you have not yet initialized your app, run shorebird init to get started.

If the pubspec is missing shorebird.yaml as a flutter asset, it tells them:

Your pubspec.yaml does not have shorebird.yaml as a flutter asset.
To fix, update your pubspec.yaml to include the following:

  flutter:
    assets:
      - shorebird.yaml # Add this line

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@bryanoltman bryanoltman requested review from eseidel and felangel March 7, 2024 16:04
Copy link

codecov bot commented Mar 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (c0a2323) to head (c73ec8f).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1779   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          167       167           
  Lines         5191      5197    +6     
=========================================
+ Hits          5191      5197    +6     
Flag Coverage Δ
shorebird_cli 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@eseidel eseidel left a comment

Choose a reason for hiding this comment

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

And this is why we hang out with our customers on discord :)

@bryanoltman bryanoltman merged commit 94c4b69 into main Mar 7, 2024
8 checks passed
@bryanoltman bryanoltman deleted the bo/shorebird-yaml-error-messages branch March 7, 2024 17:13
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