Add theme dev reconciliation strategy flag#7634
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
bc8df22 to
c635c86
Compare
b73773b to
8f6ca1c
Compare
17976d9 to
a727f50
Compare
8f6ca1c to
fee06e6
Compare
cf17902 to
f1bd642
Compare
fee06e6 to
ad55535
Compare
f1bd642 to
e4069c5
Compare
ad55535 to
8d70823
Compare
e4069c5 to
c5d2d3f
Compare
c5d2d3f to
2b45cf7
Compare
1202d52 to
c22f504
Compare
2b45cf7 to
3fcd3c1
Compare
c22f504 to
155a4b3
Compare
3fcd3c1 to
e4ccca0
Compare
155a4b3 to
bc9aaca
Compare
e4ccca0 to
469f7c2
Compare
bc9aaca to
b1b95a3
Compare
karreiro
left a comment
There was a problem hiding this comment.
Thank you for this PR, @gonzaloriestra!
What if we repurpose the --theme-editor-sync flag, since we're defining the sync strategy? We could have something like this:
shopify theme dev --theme-editor-sync ask [default]
shopify theme dev --theme-editor-sync keep-local
shopify theme dev --theme-editor-sync keep-remote
shopify theme dev --theme-editor-sync abort
This would be a backward-compatible change, since ask would be the default value. It also reduces the blast radius of the change and keeps the dev command simpler.
Thanks again for the PR!
|
@karreiro I like the idea, but Oclif doesn't support default values like that. A default value can be used when the flag is omitted, but if you just add Maybe there's a hacky way to do it, but I think I prefer to just add an additional flag. Wdyt? |
278d226 to
b016c6e
Compare
1e98f09 to
167ff71
Compare
b016c6e to
f3e0e23
Compare
37116bd to
6c7775b
Compare
f3e0e23 to
6a3739f
Compare
6c7775b to
d840f99
Compare
65d4a29 to
c8f3233
Compare
21264f3 to
0141b85
Compare
c8f3233 to
21d20b2
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/private/node/constants.d.ts@@ -6,6 +6,7 @@ export declare const environmentVariables: {
doctor: string;
enableCliRedirect: string;
env: string;
+ firstPartyDev: string;
noAnalytics: string;
optOutInstrumentation: string;
appAutomationToken: string;
packages/cli-kit/dist/public/node/context/local.d.ts@@ -63,6 +63,13 @@ export declare function alwaysLogAnalytics(env?: NodeJS.ProcessEnv): boolean;
* @returns True if SHOPIFY_CLI_ALWAYS_LOG_METRICS is truthy.
*/
export declare function alwaysLogMetrics(env?: NodeJS.ProcessEnv): boolean;
+/**
+ * Returns true if the CLI User is 1P.
+ *
+ * @param env - The environment variables from the environment of the current process.
+ * @returns True if SHOPIFY_CLI_1P is truthy.
+ */
+export declare function firstPartyDev(env?: NodeJS.ProcessEnv): boolean;
/**
* Returns true if the CLI can run the "doctor-release" command.
*
|
karreiro
left a comment
There was a problem hiding this comment.
Thank you for this PR, @gonzaloriestra!
I looked into it, and the alternatives for implementing the single-flag approach are indeed hacky. It also reveals that having union types (boolean | string) in CLI flags might not be the ideal pattern. So, from my side, +1 for proceeding with this approach.
Thanks again for this PR!
21d20b2 to
722bab8
Compare
0a8a2d3 to
42c3570
Compare
722bab8 to
ea966f3
Compare
42c3570 to
8d0d5a2
Compare
ea966f3 to
eb2c7e6
Compare
8d0d5a2 to
4f7a225
Compare
eb2c7e6 to
84b78ef
Compare
4f7a225 to
6de9f11
Compare

WHY are these changes introduced?
Fixes https://github.com/shop/issues-develop/issues/22873
The interactivity audit found that theme dev with --theme-editor-sync could still prompt when JSON files needed reconciliation.
WHAT is this pull request doing?
How to test your changes?
Make a change in a theme file (like templates/404.json) locally and remotely and run:
Checklist