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

Specify package manager default by ENV var not flag #3309

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

amcaplan
Copy link
Contributor

WHY are these changes introduced?

Previously, oclif treated --flag=a --flag=b as the second overriding the first. In v3, though, oclif treats that as an invalid condition.

We use this double-specification in bin/create-test-app.js, where the default is --package-manager=npm but we override with --package-manager=yarn. Hence:

Screenshot 2024-01-25 at 13 59 40

WHAT is this pull request doing?

Use an ENV var to specify the npm default instead.

How to test your changes?

node bin/create-test-app.js -p yarn should work without seeing a failure.

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.

Previously, oclif treated --flag=a --flag=b as the second overriding the
first. Now, though, oclif treats that as an invalid condition. So we use
an ENV var to specify the npm default instead, and users can override by
passing `--package-manager=yarn` as we do in `bin/create-test-app.js`.
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/advanced-edits
  • UI extensions: @shopify/ui-extensions-cli
    • Checkout UI extensions: @shopify/checkout-ui-extensions-api-stewardship
  • Hydrogen: @shopify/hydrogen
  • Other: @shopify/cli-foundations

Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
73.75% (-0.03% 🔻)
6584/8927
🟡 Branches
70.8% (-0.06% 🔻)
3195/4513
🟡 Functions 73.25% 1725/2355
🟡 Lines
74.85% (-0.02% 🔻)
6218/8307
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / app.ts
89.17%
79.1% (-1.49% 🔻)
90.48% 90.48%
🟢
... / loader.ts
92.91%
85.51% (-0.72% 🔻)
94.94% 93.89%
🔴
... / select-app.ts
16.67% (-2.08% 🔻)
33.33% (-16.67% 🔻)
33.33%
12.5% (-0.83% 🔻)

Test suite run success

1556 tests passing in 730 suites.

Report generated by 🧪jest coverage report action from ad9739f

@amcaplan amcaplan added this pull request to the merge queue Jan 30, 2024
Merged via the queue into main with commit fc5f8d7 Jan 30, 2024
@amcaplan amcaplan deleted the fix-package-manager-double-specification branch January 30, 2024 10:22
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