Conversation
|
Thanks for your contribution! Depending on what you are working on, you may want to request a review from a Shopify team:
|
Coverage report
Show new covered files 🐣
Test suite run success995 tests passing in 518 suites. Report generated by 🧪jest coverage report action from 0ec8ec8 |
Benchmark reportThe following table contains a summary of the startup time for all commands.
|
65d92fe to
752fb8a
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Thank you for the updates, @Poitrin! 🚀
I've tried the PR and almost everything is working as expected. I've noticed a minor regression on this issue Shopify/shopify-cli#2433 / Shopify/shopify-cli#2463.
For fixing that scenario, I believe may rely on a hidden flag in the CL2 to differentiate themes created at runtime. Feel free to reach out if you need any extra context tho :)
Thanks again for this PR!
Phew, good to have you as a reviewer, to think of all these sneaky regressions 😥.
→ Shopify/shopify-cli#2724 + I updated this PR’s code and instructions |
### WHY are these changes introduced? Part of https://github.com/Shopify/internal-cli-foundations/issues/509 Is required by Shopify/cli#1169 Issue #2433 was fixed with #2463. With Shopify/cli#1169, Node CLI needs to pass Ruby CLI a hidden flag to differentiate themes created at runtime. ### WHAT is this pull request doing? Introduces `--overwrite-json` flag that Node CLI can pass to Ruby CLI.
| flags = { | ||
| ...flags, | ||
| theme, | ||
| 'overwrite-json': Boolean(flags['theme-editor-sync']), |
There was a problem hiding this comment.
When the development theme is not new, and (at the Ruby CLI level) developers select that they want to keep the remote version, the CLI shouldn't set the overwrite-json as true.
In other words, to cover that scenario, this line should be something like:
'overwrite-json': Boolean(flags['theme-editor-sync']) && theme.isCreatedAtRuntime(),
We may solve this minor issue in a separate PR tho #1263
There was a problem hiding this comment.
It was in the end such a small change that I decided to include it in this PR.
Moreover, as you suggested to make my changes "ready for host theme changes", I moved parts of them into this PR.
| '**/public/node/plugins/tunnel.ts', | ||
| '**/public/node/presets.ts', | ||
| '**/public/node/result.ts', | ||
| '**/public/node/themes/**/*', |
WHY are these changes introduced?
Fixes https://github.com/Shopify/internal-cli-foundations/issues/509
Fixes #1084
Fixes #1263
Requires Shopify/shopify-cli#2724
WHAT is this pull request doing?
shopify themecommand: passes ID of generated theme to Ruby CLI for further processing.How to test your changes?
Make sure that your local Ruby CLI uses changes from Shopify/shopify-cli#2724
(pnpm run )shopify theme infosaysDevelopment Theme ID Not setshopify theme dev --path="./my-theme"shopify theme infonow displays the ID for the created dev themeshopify theme open -dopens the dev theme (with the correct ID)shopify theme delete -ddeletes the dev theme (after you confirm the deletion)shopify theme infosaysDevelopment Theme ID Not setagainshopify theme pull -d --path="./my-theme"throws the errorNo development theme ID has been set. Please create a development theme first.shopify theme push -d --path="./my-theme"creates a new development theme.shopify theme infonow displays the ID for the created dev themeshopify theme dev --path="./my-theme"uses the correct IDshopify(-dev) theme delete <your ID>shopify theme dev --path="./my-theme"still works, but has created a new IDshopify theme pull -d --path="./my-theme"throws the errorDevelopment theme <old ID> could not be found. Please create a new development theme.--theme-editor-syncshopify theme inita new theme.shopify theme dev --store="…" --path="./draft" --theme-editor-syncKeep Development Theme ID when switching stores
shopify theme dev --path="./my-theme" --store=<store 1>and stop the servershopify theme dev --path="./my-theme" --store=<store 2>and stop the servershopify theme dev --path="./my-theme" --store=<store 1>againshopify theme dev --path="./my-theme" --store=<store 2>and stop the serverMeasuring impact
How do we know this change was effective? Please choose one:
Checklist
devordeployhave been reflected in the internal flowchart.