-
Notifications
You must be signed in to change notification settings - Fork 125
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
[Themes] - Refactor pull
command to prepare for public themes API
#4500
base: main
Are you sure you want to change the base?
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
Test suite run success1894 tests passing in 860 suites. Report generated by 🧪jest coverage report action from c2bceec |
pull
command for public themes API
We detected some changes at either packages/*/src or packages/cli-kit/assets/cli-ruby/** and there are no updates in the .changeset. |
@@ -34,6 +35,12 @@ const COMMANDS = { | |||
'theme:share': Share, | |||
} | |||
|
|||
const PUBLIC_COMMANDS = { |
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've added these to a const
here for now, but we're not consuming this in packages/cli/src/index.ts
just yet.
Replacing the COMMANDS
constant with these new public commands affects the oclif
manifests for the CLI (it removes the commands from the base README
and oclif.manifest.json
.
I will look into this more deeply next week, but any leads are appreciated!
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.
Thank you, @jamesmengo! The PR is on an excellent direction. I've left only one comment about the documentation in the public API :)
|
||
return | ||
const pullFlags: PullFlags = { | ||
path: flags.path, |
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.
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 like this idea!
95b6b11
to
58e4ee5
Compare
@karreiro
I think we could consider making some of the arguments required, but I would like to spin my wheels on that and introduce those changes in a followup |
pull
command for public themes APIpull
command to prepare for public themes API
@@ -16,7 +21,116 @@ interface PullOptions { | |||
ignore?: string[] | |||
} | |||
|
|||
export async function pull(theme: Theme, session: AdminSession, options: PullOptions) { | |||
export interface PullFlags { |
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.
Update tests Move + fix CLI2 tests Remove pull command test Remove CLI2 Invocation + Tests Remove legacy flag Add JSDoc to pull export Export public pull service from themes package Revert change to theme-command
Re-arrange + export ThemeCommand helpers
WHY are these changes introduced?
Fixes https://github.com/Shopify/develop-advanced-edits/issues/341
Fixes https://github.com/Shopify/develop-advanced-edits/issues/342
Allows users to call
pull
programatically by providing the flags as argumentsWHAT is this pull request doing?
pull
which allows users to provide command flags as argspull
method argsHow to test your changes?
pull
inpackages/theme/src/cli/commands/theme/pull.ts
to see the Docsshopify-dev theme pull
with and without the--legacy
flag. Everything should work as beforeMeasuring impact
How do we know this change was effective? Please choose one:
Checklist