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

[dnm] Prototype store execute command #4493

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

shauns
Copy link
Contributor

@shauns shauns commented Sep 20, 2024

No description provided.

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/app-inner-loop

Copy link
Contributor

Unused files (1)

example-script.js

Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
72.88% (-0.14% 🔻)
8389/11510
🟡 Branches
69.5% (-0.04% 🔻)
4091/5886
🟡 Functions
71.7% (-0.11% 🔻)
2179/3039
🟡 Lines
73.22% (-0.15% 🔻)
7938/10841
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🔴
... / execute.ts
0% 100% 0% 0%
🔴
... / execute.ts
0% 0% 0% 0%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🔴
... / marketing_activity.ts
25% (-75% 🔻)
100%
0% (-100% 🔻)
25% (-75% 🔻)
🟢
... / ConcurrentOutput.tsx
98.39% (-1.61% 🔻)
90.91% (-4.55% 🔻)
100%
98.33% (-1.67% 🔻)

Test suite run success

1889 tests passing in 857 suites.

Report generated by 🧪jest coverage report action from 6eb8cd2

Copy link
Contributor

@gonzaloriestra gonzaloriestra left a comment

Choose a reason for hiding this comment

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

I think it will be quite useful!

}),
shop: Flags.string({
description: 'The shop domain to execute the script against',
required: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

What about making this flag optional and listing the available stores when it's not present?

required: true,
env: 'SHOPIFY_FLAG_SCRIPT_FILE',
}),
shop: Flags.string({
Copy link
Contributor

Choose a reason for hiding this comment

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

We call it store in other places

Comment on lines +9 to +19
if (!store) {
throw new Error('STORE_FQDN environment variable is not set')
}

if (!accessToken) {
throw new Error('ACCESS_TOKEN environment variable is not set')
}

if (!apiVersion) {
throw new Error('API_VERSION environment variable is not set')
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need so many checks when we are running this script and setting the variables ourselves.


static flags = {
...globalFlags,
'script-file': Flags.string({
Copy link
Contributor

Choose a reason for hiding this comment

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

What about calling it script to simplify?

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this is the best place, but I'd definitely add a few examples somewhere with the most common operations.

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