Repository navigation
Allow theme pull command to be called with multiple environments - #6390
Conversation
Coverage report
Show files with reduced coverage 🔻
Test suite run success3324 tests passing in 1384 suites. Report generated by 🧪jest coverage report action from f8df96b |
3a2166a to
9ca7c4c
Compare
|
/snapit |
|
🫰✨ Thanks @dejmedus! Your snapshot has been published to npm. Test the snapshot by installing your package globally: npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/[email protected]Caution After installing, validate the version by running just |
6d903b1 to
e986528
Compare
9ca7c4c to
a1bcedb
Compare
| const downloadTasks = buildDownloadTasks(remoteChecksums, theme, themeFileSystem, session) | ||
|
|
||
| const tasks = [...deleteTasks, ...downloadTasks] | ||
| const tasks = [...deleteTasks, ...downloadTasks, {title: `Theme download complete`, task: async () => {}}] |
There was a problem hiding this comment.
Since multi env progress messages don't disappear I've added a completion message so super quick pulls don't go from 0% progress to displaying results without a message in between
e986528 to
d44bc9e
Compare
a1bcedb to
1e06d5b
Compare
EvilGenius13
left a comment
There was a problem hiding this comment.
🎩 went well, I tried multiple configurations, passing arguments directly into the command and using the toml file for others. The output is really nice. It's easy to see what is happening to each environment.
d44bc9e to
2fbc81e
Compare
b0478c7 to
27dbca2
Compare
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/ui.d.ts@@ -322,6 +322,7 @@ interface RenderTableOptions<T extends ScalarDict> extends TableProps<T> {
export declare function renderTable<T extends ScalarDict>({ renderOptions, ...props }: RenderTableOptions<T>): string | undefined;
interface RenderTasksOptions {
renderOptions?: RenderOptions;
+ noProgressBar?: boolean;
}
/**
* Runs async tasks and displays their progress to the console.
@@ -329,7 +330,7 @@ interface RenderTasksOptions {
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
* Installing dependencies ...
*/
-export declare function renderTasks<TContext>(tasks: Task<TContext>[], { renderOptions }?: RenderTasksOptions): Promise<TContext>;
+export declare function renderTasks<TContext>(tasks: Task<TContext>[], { renderOptions, noProgressBar }?: RenderTasksOptions): Promise<TContext>;
/**
* Awaits a single promise and displays a loading bar while it's in progress. The promise's result is returned.
* @param options - Configuration object
packages/cli-kit/dist/private/node/ui/components/LoadingBar.d.ts@@ -2,6 +2,7 @@ import React from 'react';
interface LoadingBarProps {
title: string;
noColor?: boolean;
+ noProgressBar?: boolean;
}
-declare const LoadingBar: ({ title, noColor }: React.PropsWithChildren<LoadingBarProps>) => JSX.Element;
+declare const LoadingBar: ({ title, noColor, noProgressBar }: React.PropsWithChildren<LoadingBarProps>) => JSX.Element;
export { LoadingBar };
\ No newline at end of file
packages/cli-kit/dist/private/node/ui/components/Tasks.d.ts@@ -14,6 +14,7 @@ interface TasksProps<TContext> {
onComplete?: (ctx: TContext) => void;
abortSignal?: AbortSignal;
noColor?: boolean;
+ noProgressBar?: boolean;
}
-declare function Tasks<TContext>({ tasks, silent, onComplete, abortSignal, noColor, }: React.PropsWithChildren<TasksProps<TContext>>): JSX.Element | null;
+declare function Tasks<TContext>({ tasks, silent, onComplete, abortSignal, noColor, noProgressBar, }: React.PropsWithChildren<TasksProps<TContext>>): JSX.Element | null;
export { Tasks };
\ No newline at end of file
|
Previously, `theme push` could only be run in a single environment at a time. This commit allows `push` to run in multiple environments in a single command run. Output is prefixed with the environment name, when one exists
27dbca2 to
f8df96b
Compare
WHY are these changes introduced?
Previously theme
pullcould only be run with a single--environmentflag. This PR allowspullto be run with multiple environments in a single commandWHAT is this pull request doing?
pullis exported publicly through @shopify/cli to be used by packages like shopkeeper, an auth session is created if one is not passed in from ThemeCommand (as one wouldn't be when pull is used programatically)pull
pull-demo.mov
How to test your changes?
gh pr checkout 6390or install the snapit versionshopify.theme.tomlfileExample toml
pullshould work as expected with no, single, and multiple--environmentflagsMeasuring impact
Checklist