Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Fix for "Keep the remote version" deletes files on new development theme#2463

Merged
mgmanzella merged 1 commit intomainfrom
fix-remote-file-local-delete
Jul 19, 2022
Merged

Fix for "Keep the remote version" deletes files on new development theme#2463
mgmanzella merged 1 commit intomainfrom
fix-remote-file-local-delete

Conversation

@mgmanzella
Copy link
Copy Markdown
Contributor

@mgmanzella mgmanzella commented Jul 14, 2022

WHY are these changes introduced?

Fixes #2433

WHAT is this pull request doing?

  • Adds @created_at_runtime variable that gets set to true if development theme is created
  • Defaults to using local files @created_at_runtime=true

How to test your changes?

New development themes defaults to local files

  • In your partners dashboard, create a new dev store
  • Create a new staff account for your work email if your partners account isn't associated with your work email (you need to do this so you can you use the cli with the new store)
  • Accept invite for staff account
In a new terminal
$ shopify theme init
$ cd <name of theme>
$ git init
$ git add —all
$ git commit -am "init"
$ pwd

Copy the path printed after pwd

In another terminal
$ git fetch
$ git checkout fix-remote-file-local-delete
$ shopify-dev login —store <new store name>
$ shopify-dev theme serve </Path/to/theme/ that you copied> --theme-editor-sync

Confirm local files get uploaded and don't get deleted. Some files do get updated locally though

Existing development theme prompts user for strategy

In the theme directory run git reset --hard to restore the files. In the shopify-cli directory run shopify-dev theme serve </Path/to/theme/> --theme-editor-sync again and confirm you're prompted to pick a sync strategy

Post-release steps

None

Update checklist

  • I've added a CHANGELOG entry for this PR (if the change is public-facing)
  • I've considered possible cross-platform impacts (Mac, Linux, Windows).
  • I've left the version number as is (we'll handle incrementing this when releasing).
  • I've included any post-release steps in the section above (if needed).

@mgmanzella mgmanzella force-pushed the fix-remote-file-local-delete branch 3 times, most recently from f1b28b5 to ef8ba7f Compare July 15, 2022 20:17
@mgmanzella mgmanzella marked this pull request as ready for review July 15, 2022 20:36
@mgmanzella mgmanzella requested review from a team, isaacroldan, jesalerno84, karreiro and ulgut and removed request for a team, isaacroldan and jesalerno84 July 15, 2022 20:36
Copy link
Copy Markdown
Contributor

@karreiro karreiro left a comment

Choose a reason for hiding this comment

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

Thank you, @mgmanzella! Elegant PR 🚀

I've left one minor/optional comment to clarify a detail, but the PR looks good and works fine as well 🎩

Thanks!

Comment thread lib/shopify_cli/theme/syncer.rb Outdated
@mgmanzella mgmanzella force-pushed the fix-remote-file-local-delete branch from ef8ba7f to 583a2b6 Compare July 18, 2022 18:01
Comment thread lib/shopify_cli/theme/development_theme.rb Outdated
@ulgut ulgut self-requested a review July 18, 2022 20:50
@mgmanzella mgmanzella force-pushed the fix-remote-file-local-delete branch from 583a2b6 to 7dc18fd Compare July 19, 2022 15:28
@mgmanzella mgmanzella force-pushed the fix-remote-file-local-delete branch from 0f6f54a to a49ae9c Compare July 19, 2022 15:35
@mgmanzella mgmanzella merged commit 1a8eb63 into main Jul 19, 2022
@mgmanzella mgmanzella deleted the fix-remote-file-local-delete branch July 19, 2022 15:48
Poitrin pushed a commit that referenced this pull request Jan 30, 2023
### WHY are these changes introduced?

Part of https://github.com/Shopify/internal-cli-foundations/issues/509
Is required by Shopify/cli#1169

Issue #2433 was fixed with #2463.
With Shopify/cli#1169, Node CLI needs to pass Ruby CLI a hidden flag to differentiate themes created at runtime.

### WHAT is this pull request doing?

Introduces `--overwrite-json` flag that Node CLI can pass to Ruby CLI.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: shopify --theme-serve "Keep the remote version" deletes files on new development theme

3 participants