Skip to content
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

Enable password flag for theme dev #953

Merged
merged 6 commits into from
Dec 20, 2022
Merged

Enable password flag for theme dev #953

merged 6 commits into from
Dec 20, 2022

Conversation

gonzaloriestra
Copy link
Contributor

@gonzaloriestra gonzaloriestra commented Dec 19, 2022

WHY are these changes introduced?

Related to https://github.com/Shopify/internal-cli-foundations/issues/332

Since #325, most theme commands were already working with Theme Access passwords, but the dev theme command required additional work. Now it's ready and we can enable the password flag for that command it as well.

WHAT is this pull request doing?

  • Allows password flag/env variable for theme dev command
  • Upgrades theme-check to get intelligent code completion

How to test your changes?

  • pnpm shopify theme dev --store your-store --password your-password --path /your/theme/path
  • SHOPIFY_FLAG_STORE=your-store SHOPIFY_CLI_THEME_TOKEN=your-password pnpm shopify theme dev

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've made sure that any changes to dev or deploy have been reflected in the internal flowchart.

@github-actions
Copy link
Contributor

Thanks for your contribution!

Depending on what you are working on, you may want to request a review from a Shopify team:

  • Themes: @shopify/theme-developer-tools
  • UI extensions: @shopify/ui-extensions-cli
    • Checkout UI extensions: @shopify/checkout-ui-extensions-api-stewardship
  • Hydrogen: @shopify/hydrogen
  • Other: @shopify/cli-foundations

@github-actions
Copy link
Contributor

github-actions bot commented Dec 19, 2022

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
68.02% (+0.01% 🔼)
3556/5228
🟡 Branches
62.18% (+0.04% 🔼)
1151/1851
🟡 Functions 66.15% 901/1362
🟡 Lines
68.17% (+0.01% 🔼)
3380/4958

Test suite run success

871 tests passing in 443 suites.

Report generated by 🧪jest coverage report action from 3b37c67

@gonzaloriestra gonzaloriestra changed the title Upgrade CLI 2.0 and theme-check dependencies Enable password flag for theme dev Dec 19, 2022
@@ -357,7 +357,7 @@ export function getOutputUpdateCLIReminder(
const versionMessage = `💡 Version ${version} available!`
if (!packageManager || packageManager === 'unknown') return versionMessage

const updateCommand = token.packagejsonScript(packageManager, 'shopify', 'upgrade')
const updateCommand = token.packagejsonScript(packageManager, 'shopify upgrade')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was showing something like Run npm run shopify -- upgrade for npm.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not wrong I think that's necessary with npm because otherwise it treats those flags and arguments as npm's

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean. In this case, upgrade is not a flag, but part of the command, so we don't need the -- separator. The third argument is used for flags, which do need the separator for npm.

We are doing the same in other places: https://github.com/Shopify/cli/blob/upgrade-cli2/packages/cli-hydrogen/src/cli/services/preview.ts#L23

@gonzaloriestra gonzaloriestra marked this pull request as ready for review December 19, 2022 17:43
@gonzaloriestra gonzaloriestra requested review from a team, amcaplan, alvaro-shopify, mgmanzella and karreiro and removed request for a team December 19, 2022 17:44
@gonzaloriestra
Copy link
Contributor Author

@shainaraskas could you please update the documentation here to add the password flag (like the one in the list command, for example)? 🙏

@shopify-shipit shopify-shipit bot temporarily deployed to production December 22, 2022 11:12 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants