Skip to content

Conversation

@chrisberthe
Copy link
Contributor

@chrisberthe chrisberthe commented Jun 23, 2025

Follow up to #6002.

WHY are these changes introduced?

Shopify introduced new requirements for the Shopify Theme Store that require themes with multiple presets to include a /listings directory in their theme zip submissions. However, developers need a way to preview and test these specific theme presets during development and deployment.

WHAT is this pull request doing?

  • Added --listing flag to shopify theme dev, shopify theme push, and shopify theme share commands
  • Implemented "file overlay" to serve listing-specific templates and sections when available
  • Updated theme file watching to monitor the active listing directories during development
  • Added config/settings_data.json preset switching, i.e. "current" key, based on listing name

How to test your changes?

  1. Create a theme with a listings/ directory:

    theme/
    ├── listings/
    │   ├── preset-name-one/
    │   │   ├── templates/
    │   │   │   └── *.json
    │   │   └── sections/ (optional)
    │   │       └── *.json
    │   └── another-preset-name/
    │       ├── templates/
    │       │   └── *.json
    │       └── sections/ (optional)
    │           └── *.json
    
  2. Test development with listing:

    shopify theme dev --listing preset-name-one
  3. Test push with listing:

    shopify theme push --listing another-preset-name
  4. Test share with listing:

    shopify theme share --listing preset-name-one
  5. Verify that listing-specific files are served when they exist, and base theme files are used as fallbacks when they don't

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
  • 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)
  • I've considered possible documentation changes

@chrisberthe chrisberthe requested review from a team as code owners June 23, 2025 19:37
@chrisberthe chrisberthe changed the title Add listing flag to dev, push, and share commands Add "listing" flag support to theme commands Jun 23, 2025
@chrisberthe chrisberthe force-pushed the add/listing-flag-to-theme-commands branch from 5a32b1e to 881d68a Compare June 25, 2025 15:31
Copy link
Contributor

@graygilmore graygilmore left a comment

Choose a reason for hiding this comment

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

Testing this out with theme dev worked well! Very neat! Couple of pieces of feedback and I'll ping the rest of the team to get one more set of eyes because I'm not too familiar with some of the pieces in here.

@chrisberthe chrisberthe force-pushed the add/listing-flag-to-theme-commands branch 2 times, most recently from d6d3181 to 202158a Compare July 2, 2025 14:31
Copy link
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 for this PR, @chrisberthe! Excellent work! 🚀

I’ve tested it, and most workflows are working quite reliably. However, one workflow isn’t behaving as expected:

shopify theme dev --listing example --theme-editor-sync

When we run the command with the --theme-editor-sync flag, we expect that changes made in the theme editor are automatically downloaded. Currently, with the new flag, those changes seem to be lost.

If supporting these flags together turns out to be too challenging, we could consider throwing an early error when both are used at the same time. Ideally, though, it would be great to make them work together if possible. Please let me know your thoughts.

Thanks again for all your work on this PR!

@chrisberthe
Copy link
Contributor Author

Thanks @karreiro. I'm taking vacation so I'll look into this once I'm back in a week or so. Could you share some thoughts on this point?

@github-actions
Copy link
Contributor

This PR seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action.
→ If there's no activity within a week, then a bot will automatically close this.
Thanks for helping to improve Shopify's dev tooling and experience.

@anastis
Copy link

anastis commented Aug 25, 2025

Commenting so that this won't get closed automatically.
It's still relevant and needed for theme development, waiting feedback from @chrisberthe and @karreiro

@github-actions
Copy link
Contributor

This PR seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action.
→ If there's no activity within a week, then a bot will automatically close this.
Thanks for helping to improve Shopify's dev tooling and experience.

@anastis
Copy link

anastis commented Sep 26, 2025

Any progress on this?

@chrisberthe chrisberthe force-pushed the add/listing-flag-to-theme-commands branch from 5a88ae9 to db3c204 Compare October 1, 2025 21:06
@chrisberthe
Copy link
Contributor Author

Any progress on this?

This fell by the wayside. Will look into the remaining feedback and address.

@chrisberthe
Copy link
Contributor Author

@karreiro Going to need your input on --theme-editor-sync with --listing. Thinking of two options here:

  • Always sync JSON files to listings/<preset>/.... This keeps things isolated per preset but also generates lots of, potentially unwanted, files per preset.
  • If a JSON file exists in listings/<preset>/..., sync to that folder, otherwise sync to the theme's base templates/ or sections/ folders. Example: if listings/<preset>/templates/index.json exists, sync to this folder, but if that file didn't exist, sync to templates/index.json.

Personally, leaning towards the latter. What do you think?

@chrisberthe chrisberthe force-pushed the add/listing-flag-to-theme-commands branch from db3c204 to 33c5271 Compare October 2, 2025 17:54
@chrisberthe chrisberthe force-pushed the add/listing-flag-to-theme-commands branch from f19b1db to f64660c Compare October 6, 2025 14:40
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

This PR seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action.
→ If there's no activity within a week, then a bot will automatically close this.
Thanks for helping to improve Shopify's dev tooling and experience.

@anastis
Copy link

anastis commented Nov 6, 2025

Still relevant.
@chrisberthe waiting feedback from @karreiro

@chrisberthe
Copy link
Contributor Author

Can't say when this will be merged @anastis, but I can say that having to repeatedly rebase this is getting annoying 😛

@github-actions
Copy link
Contributor

This PR seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action.
→ If there's no activity within a week, then a bot will automatically close this.
Thanks for helping to improve Shopify's dev tooling and experience.

@chrisberthe
Copy link
Contributor Author

Still relevant.

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.

4 participants