cli
cli copied to clipboard
[Themes] Feat: Poll for JSON changes when the `themeEditorSync` flag is passed to the `dev` command
WHY are these changes introduced?
- Adds polling for https://github.com/Shopify/develop-advanced-edits/issues/203
WHAT is this pull request doing?
- Fetches checksums from the remote theme
- Performs reconciliations
- Schedules another call the fetch checksums after 3 seconds
How to test your changes?
-
pnpm shopify theme dev --path=<PATH_TO_THEME> --dev-preview --theme-editor-sync
Remote Changes -> should automatically propagate locally
deleting a file in your editor -> should delete locally modifying a file in your editor -> should update local theme creating a file in your editor -> should download locally
Local Changes (No-op)
delete/modify/create a file in your local theme -> do nothing (this will be handled by FS Watcher)
Remote + local Changes
delete/modify/create a file in your local theme that is also changed on remote -> Abort the entire process
https://github.com/Shopify/cli/assets/35415298/d5c1bb70-8c22-4c4d-ac87-5009d3a31fb0
Measuring impact
How do we know this change was effective? Please choose one:
- [ ] n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
- [x] Existing analytics will cater for this addition
- [ ] PR includes analytics changes to measure impact
Checklist
- [ ] I've considered possible cross-platform impacts (Mac, Linux, Windows)
- [x] I've considered possible documentation changes
- [x] I've made sure that any changes to
dev
ordeploy
have been reflected in the internal flowchart.