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

Theme Development Workflow - Template JSON Settings #1430

@celsowhite

Description

@celsowhite

Issue summary

It seems that the shopify theme push command leads to json data overwrites in theme files. Previously when using themekit I would ignore the config/settings_data.json file so I can easily push code to any theme without overwriting the settings saved from the customizer. In reading the cli documentation and commands, it isn't clear how to manage conflicts between the customizer settings and code pushes. There are likely a few workarounds but it would be great to know Shopify's recommended approach.

Expected behavior

Settings separated from section configuration

The ideal expected behavior is that any settings data from the customizer be stored in their own files outside of code logic and configuration. So we can universally ignore .json settings files via the .shopifyignore file. Our templates/json files can be safely pushed and pulled from any theme environment.

--noupdate Parameter

Given that the cli and structure for Dawn is already built I imagine the above solution is very hard to achieve and would require a refactor. So another solution would be to provide a push parameter called --noupdate where we can specify which files we don't want to update when doing a push. In that scenario, I would do an initial push of my core templates/json files and then any future pushes I can specify what I do/don't want to update.

I realize we can use .shopifyignore to ignore those files but that brings up a few other issues where the files in .shopifyignore don't show up in dev environments.

Actual behavior

shopify theme push overwrites templates/json file settings data.

Steps to reproduce the problem

  1. I make a few updates via the customizer to my 'Production' theme (live theme in my dev store). The settings are saved in my templates/index.json file.
  2. I work on code locally using 'shopify theme serve'.
  3. Once the code is ready to go I do shopify theme push --themeid:[production-theme-id].
  4. I go back into the site and see the changes I made via the customizer overwritten with the data I had in my codes templates/index.json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions