-
Notifications
You must be signed in to change notification settings - Fork 260
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 deprecated flag warning to build #609
Conversation
This comment has been minimized.
This comment has been minimized.
df040ed
to
822fbf4
Compare
This solution forces the banners to render individually, if we wanted a different experience, we might want to add a const DEPRECATED_FLAGS = [...]
async catch(error: Error & {args?: string[]}) {
if (error?.args?.some((flag) => DEPRECATED_FLAGS.includes(flag))) {
renderInfo({
headline: `The ${colors.bold(
error.args.join(' '),
)} flags are deprecated and will be removed in a future version of Shopify CLI.`,
});
throw error;
} My feeling is that 90% of the time users will hit this error when moving from H1 to H2 and not updating the |
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.
Great idea!
Can we add this to the dev
command as well for the --entry
flag?
I think it's fine if we render the banners separately, it's just a warning that shouldn't come up often.
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.
✅
@pepicrft @matteodepalo maybe something like this should make it's way into the cli-kit 🤔 I could see this being a common pattern. |
Interesting! Definitely something that we could add to cli-kit. |
WHY are these changes introduced?
This PR adds a helper that we can add to the commands whose flags have changed from going from v1 to v2. Currently the CLI will fail if an unsupported flag is passed without much indication of why. For example:
I saw the above example come up in Discord.
WHAT is this pull request doing?
There are a few ways we can address this, but I chose to create a small helper we can add to the Command's flag object. In this PR I've added it to some of the deprecated
build
flags.HOW to test your changes?
Run the CLI locally with a flag from H1 (ie: --entry).
Post-merge steps
Checklist