-
Notifications
You must be signed in to change notification settings - Fork 147
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
Add base infrastructure and first command for multi-environment commands #5284
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
Coverage report
Show files with reduced coverage 🔻
Test suite run success2033 tests passing in 909 suites. Report generated by 🧪jest coverage report action from b2ab0f9 |
const {flags} = await this.parse(List) | ||
const store = ensureThemeStore(flags) | ||
const adminSession = await ensureAuthenticatedThemes(store, flags.password) | ||
static multiEnvironmentsFlags = ['store', 'password'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These flags are the necessary flags the toml file would need to run. For instance, in a push or pull theme, you would be adding the theme flag to this array.
45a5994
to
5b8453d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this PR, @EvilGenius13! I've left only one minor comment regarding how we present each environment.
Also, I've noticed that if I remove the password flag, we get this message (with the password flag duplicated):
Thanks again for this PR, @EvilGenius13 🔥 🚀
@@ -31,6 +31,8 @@ export async function list(adminSession: AdminSession, options: Options) { | |||
storeThemes = filterThemes(store, storeThemes, filter) | |||
} | |||
|
|||
outputInfo(`Store: ${store}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we could break a line here and show the environment as an user input, as we may have multiple environments in the same store.
I added the environment to the flag message so instead of only showing the error once, we state which environment(s) it's missing from |
This commit adds the groundwork to use commands when passing multiple environments. We are starting with the list command
c1be9b1
to
c6205cf
Compare
ca508cf
to
b2ab0f9
Compare
WHY are these changes introduced?
Developers working on multiple stores keep a
shopify.toml
file that can contain data for multiple stores such as themes, passwords etc. Any theme command they run would have to be run separately for each store they want to access.WHAT is this pull request doing?
This PR introduces the framework for multi environment support. the
environment
flag now accepts an array instead of a string allowing us to parse multiple stores at once. A newmulti-run
function handles commands dynamically, and allows them to run concurrently.This PR is shipping with the
theme list
command available and follow up PR's will add more commands.Example
theme list
command with single environment:Example
theme list
command with multiple environments:How to test your changes?
shopify.theme.toml
fileNote: You will need to create an access token through your shop(s) to bypass the need to login during theme commands.
The most basic example of the structure needed would be this:
Run
theme list -e env1 -e env2
or whatever you named your environments.Look for all your stores themes to be rendered on your terminal. The order may differ from your input (i.e you might have put env1, env2 but the output is env2, env1) due to the commands running concurrently.
Post-release steps
Post release steps will mostly revolve around follow up PR's for the other commands.
Measuring impact
How do we know this change was effective? Please choose one:
Checklist