cli icon indicating copy to clipboard operation
cli copied to clipboard

Extract `dev clean` logic to a service file

Open isaacroldan opened this issue 9 months ago β€’ 3 comments

WHY are these changes introduced?

To improve error handling when stopping app previews and to refactor the dev clean functionality into a service.

WHAT is this pull request doing?

  • Extracts the app preview cleanup logic from the DevClean command into a new service function devClean
  • Adds proper error handling for the devSessionDelete API call
  • Improves the success message formatting with proper command styling

How to test your changes?

  1. Create an app preview with shopify app dev
  2. Run shopify app dev clean to stop the preview
  3. Verify that the success message is properly formatted
  4. Try to reproduce an error scenario (if possible) to verify the error handling works correctly

Measuring impact

How do we know this change was effective? Please choose one:

  • [x] n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix

Checklist

  • [x] I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • [x] I've considered possible documentation changes

isaacroldan avatar May 06 '25 15:05 isaacroldan

This stack of pull requests is managed by Graphite. Learn more about stacking.

isaacroldan avatar May 06 '25 15:05 isaacroldan

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟑 Statements
76.65% (+0.03% πŸ”Ό)
9596/12519
🟑 Branches
71.9% (+0.02% πŸ”Ό)
4731/6580
🟑 Functions
76.57% (+0.01% πŸ”Ό)
2487/3248
🟑 Lines
77.16% (+0.03% πŸ”Ό)
9068/11752
Show new covered files 🐣
St.:grey_question:
File Statements Branches Functions Lines
🟒
... / dev-clean.ts
100% 100% 100% 100%
Show files with reduced coverage πŸ”»
St.:grey_question:
File Statements Branches Functions Lines
🟒
... / Dev.tsx
93.02% (+0.08% πŸ”Ό)
77.59% (-0.99% πŸ”»)
90.91%
93.83% (+0.08% πŸ”Ό)
🟒
... / ConcurrentOutput.tsx
98.36% (-1.64% πŸ”»)
88% (-4% πŸ”»)
100%
98.33% (-1.67% πŸ”»)

Test suite run success

2254 tests passing in 983 suites.

Report generated by πŸ§ͺjest coverage report action from 9d52719b0de9e8f1427947adf2683b335188cd0b

github-actions[bot] avatar May 06 '25 15:05 github-actions[bot]

We detected some changes at packages/*/src and there are no updates in the .changeset. If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

[!CAUTION] DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

github-actions[bot] avatar May 06 '25 15:05 github-actions[bot]