Repository navigation
Add typed JSON output to theme push - #8647
Conversation
16e4ae7 to
c3100fb
Compare
96095dc to
ff21d01
Compare
ff21d01 to
4f412b3
Compare
a17bb51 to
e719f0c
Compare
8afadb0 to
5c4a5e5
Compare
5c4a5e5 to
8b08bde
Compare
8b08bde to
03e1631
Compare
a9620d2 to
0212668
Compare
0212668 to
d3a64d0
Compare
4be0587 to
23b8b0b
Compare
23b8b0b to
40b233b
Compare
isaacroldan
left a comment
There was a problem hiding this comment.
Found two issues with upload diagnostics and single-environment prompts.
🤖 Generated by the review-pr skill
| previewUrl: theme.preview_url || null, | ||
| }, | ||
| issues: Object.entries(errors).flatMap(([file, messages]) => | ||
| messages.map((message) => ({filePath: resolvePath(result.directory ?? cwd(), file), message})), |
There was a problem hiding this comment.
Can we resolve this to the file that was uploaded? With --listing demo, templates/index.json can come from listings/demo/templates/index.json. I reproduced an upload error with different contents in those files: filePath points at the base file, although the uploaded content comes from the listing. Please retain the source path when mapping upload issues.
🤖 Generated by the review-pr skill
| ], | ||
| }) | ||
| return false | ||
| throw new AbortError(`Can't push theme files to the live theme on ${storeFqdn}. Use the --allow-live flag.`) |
There was a problem hiding this comment.
Adding --json changes the live-theme confirmation for one named environment. ThemeCommand.runConcurrent passes multiEnvironment=true even for -e staging, so JSON fails with Use --allow-live while the same text command asks for confirmation and can push. This also makes pull/share skip their directory confirmation. Can we keep single-environment interactivity while still returning {environments: [...]}?
🤖 Generated by the review-pr skill
|
| Changeset | Package |
|---|---|
theme-duplicate-json-contract.md |
'@shopify/cli': major |
theme-info-json-contract.md |
'@shopify/cli': major |
theme-list-json-contract.md |
'@shopify/cli': major |
theme-open-json-contract.md |
'@shopify/cli': major |
theme-push-json-contract.md |
"@shopify/cli": major |
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/base-command.d.ts@@ -35,6 +35,7 @@ declare abstract class BaseCommand extends Command {
argv: string[];
}>;
protected environmentsFilename(): string | undefined;
+ protected validateNonTTYFlags(flags: FlagOutput): void;
protected failMissingNonTTYFlags(flags: FlagOutput, requiredFlags: string[]): void;
private failMissingNonTTYFlagRequirements;
private applicableNonTTYFlagRequirements;
packages/cli-kit/dist/public/node/themes/theme-manager.d.ts@@ -11,5 +11,12 @@ export declare abstract class ThemeManager {
findOrCreate(name?: string, role?: Role): Promise<Theme>;
fetch(name?: string, role?: Role): Promise<Theme | undefined>;
generateThemeName(context: string): string;
- create(themeRole?: Role, themeName?: string): Promise<Theme>;
+ create(themeRole?: Role, themeName?: string): Promise<{
+ createdAtRuntime: boolean;
+ id: number;
+ name: string;
+ processing: boolean;
+ role: string;
+ src?: string;
+ }>;
}
\ No newline at end of file
|
WHY are these changes introduced?
Upload JSON currently uses inconsistent field names and drops environment outcomes.
WHAT is this pull request doing?
Project string IDs, camelCase links and absolute-path upload issues. Report partial uploads with a nonzero exit, retain skipped/cancelled outcomes and every requested environment, and route failed operations through the shared error envelope.
The public output follows
docs/cli/json-output.md; explicitly named environments use one{environments: [...]}object.How to manually test your changes?
Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add