-
Notifications
You must be signed in to change notification settings - Fork 228
fix missing json output for theme info command when dev and theme flags are missing #6905
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@shopify/cli': patch | ||
| --- | ||
|
|
||
| fix missing json output for theme info when no theme or dev flag is present |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,15 @@ interface ThemeInfoOptions { | |
| json?: boolean | ||
| } | ||
|
|
||
| interface DevInfo { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we rename this to |
||
| store: string | ||
| development_theme_id: string | null | ||
| cli_version: string | ||
| os: string | ||
| shell: string | ||
| node_version: string | ||
| } | ||
|
|
||
| export function themeInfoJSON(theme: Theme, adminSession: AdminSession): ThemeInfo { | ||
| return { | ||
| theme: { | ||
|
|
@@ -41,6 +50,19 @@ export function themeInfoJSON(theme: Theme, adminSession: AdminSession): ThemeIn | |
| } | ||
| } | ||
|
|
||
| export function devInfoJSON(config: {cliVersion: string}): DevInfo { | ||
| const {platform, arch} = platformAndArch() | ||
| const store = getThemeStore() | ||
| return { | ||
| store: store ?? 'Not configured', | ||
| development_theme_id: store ? getDevelopmentTheme() ?? null : null, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This took me a minute to understand. If you don't want to make it more verbose can we wrap the first part in |
||
| cli_version: config.cliVersion, | ||
| os: `${platform}-${arch}`, | ||
| shell: process.env.SHELL ?? 'unknown', | ||
| node_version: process.version, | ||
| } | ||
| } | ||
|
|
||
| export async function fetchThemeInfo( | ||
| adminSession: AdminSession, | ||
| options: ThemeInfoOptions, | ||
|
|
||
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.
It looks like we're calling
flags.jsontwice now. Can you look into merging that logic?