-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: Theme command to load the default environment #4692
Comments
@jamesmengo @graygilmore I believe this issue illustrates well how Shopify CLI aims to support multiple-store development (mentioning this, because I've noticed you're investigating #3509). |
Related: |
I second the addition of a default environment with the Specifically in the case of #3509 and #4431, it's great to have all the CLI details in an environment and then only change a single value In Shopkeeper, we manipulate the current env via a If a default environment was implemented, we'd probably make our default bucket match in name to remove the additional piece of config. Some extra context if it's helpful. |
@cesarho This is great idea and must-have feature for the freelancers that works on multiple "single" stores. |
What area(s) will this request affect?
Theme
What type of change do you want to see?
New feature
Overview
The Shopify CLI already supports environment settings through
shopify.theme.toml
. I propose a small tweak to improve the default behavior by automatically loading the default environment if it is available.Proposed Change
Modify the default behavior of shopify theme related command to load the environment configuration by default. Specifically:
shopify theme dev
, the CLI would effectively executeshopify theme dev -e default
in the background.shopify.theme.toml
file with the default store settings, the command will automatically load these settings.shopify.theme.toml
file doesn’t exist or doesn't contain default environment, the CLI would continue to work as it currently does —without any breaking changes.Example Configuration
With this change, developers could avoid unexpected deployment issues and simplify their workflow, particularly when switching between different stores.
How do you feel about this feature enhancement? If this makes sense, I’d be happy to go ahead and raise a PR to implement it.
Motivation
Currently, the Shopify CLI remembers the last store that was worked on and keeps this stored for future sessions. However, this behavior can lead to unexpected issues: when a developer switches to another project folder and runs
shopify theme dev
, the CLI mistakenly uploads files to the previous working store instead of the intended one. This can cause significant, unintended trouble, especially if the developer is unaware of this stored preference.Although there are alternatives, such as setting the environment variable manually or writing scripts to ensure the correct store information is set, I believe the CLI could handle this more seamlessly by improving the default behavior. A solution that prevents accidental deployment to the wrong store would benefit everyone and make the experience smoother and safer for all users.
The text was updated successfully, but these errors were encountered: