Conversation
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/doctor/types.d.ts@@ -14,6 +14,7 @@ export interface TestResult {
}
export interface DoctorContext {
workingDirectory: string;
+ cliCommand: string;
data: {
[key: string]: unknown;
};
|
|
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |
Coverage report
Test suite run success3785 tests passing in 1457 suites. Report generated by 🧪jest coverage report action from 9b64ce0 |
| export function detectCliCommand(commandHandle?: string, argv: string[] = process.argv): string { | ||
| const defaultCommand = 'shopify' | ||
|
|
||
| if (!commandHandle) return defaultCommand | ||
|
|
||
| const firstTopic = commandHandle.split(':')[0] | ||
| if (!firstTopic) return defaultCommand | ||
|
|
||
| const index = argv.findIndex((arg) => arg === firstTopic) | ||
|
|
||
| if (index <= 0) return defaultCommand | ||
|
|
||
| return argv.slice(0, index).join(' ') | ||
| } |
There was a problem hiding this comment.
@EvilGenius13 do you think this might be too fragile? I am not sure if we should just make a new arg passed in from the user.
If i were to steelman this approach, this would work in CI if we'd launch theme-doctor theme from a CI environment if it used npx shopify instead of shopify

WHY are these changes introduced?
shopify-dev theme-doctor themeorpnpm shopify theme-doctor themeon local environment, i want it to run the development CLI, not the production oneWHAT is this pull request doing?
How to test your changes?
export SHOPIFY_CLI_DOCTOR=1)Measuring impact
How do we know this change was effective? Please choose one:
Checklist