Repository navigation
Add typed JSON output to app build - #8801
Conversation
|
/snapit |
|
🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm. Built from Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261006150026Caution After installing, validate the version by running |
a7c4bcd to
6d7e9ec
Compare
|
/snapit |
|
🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm. Built from Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261007111740Caution After installing, validate the version by running |
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/system.d.ts@@ -104,9 +104,9 @@ export declare function sleep(seconds: number): Promise<void>;
*/
export declare function terminalSupportsHyperlinks(): boolean;
/**
- * Check if the standard input and output streams support prompting.
+ * Check if standard input and standard error are terminals that support prompting.
*
- * @returns True if the standard input and output streams support prompting.
+ * @returns True if standard input and standard error support prompting.
*/
export declare function terminalSupportsPrompting(): boolean;
/**
packages/cli-kit/dist/public/node/ui.d.ts@@ -21,6 +21,7 @@ interface UIDebugOptions {
skipTTYCheck?: boolean;
}
export interface RenderConcurrentOptions extends PartialBy<ConcurrentOutputProps, 'abortSignal'> {
+ /** Ink options for terminal UI. Finite JSON output uses the command event channel on stderr instead. */
renderOptions?: RenderOptions;
}
/**
packages/cli-kit/dist/private/node/ui/components/ConcurrentOutput.d.ts@@ -1,4 +1,4 @@
-import { OutputProcess } from '../../../../public/node/output.js';
+import { type OutputProcess } from '../../../../public/node/output.js';
import { AbortSignal } from '../../../../public/node/abort.js';
import { FunctionComponent } from 'react';
export interface ConcurrentOutputProps {
@@ -6,14 +6,21 @@ export interface ConcurrentOutputProps {
prefixColumnSize?: number;
abortSignal: AbortSignal;
showTimestamps?: boolean;
+ /**
+ * Keeps terminal UI running after all processes finish. Defaults to false.
+ * In JSON mode, false uses finite progress/diagnostic events; true retains streaming terminal UI.
+ */
keepRunningAfterProcessesResolve?: boolean;
useAlternativeColorPalette?: boolean;
}
interface ConcurrentOutputContext {
outputPrefix?: string;
+ /** Controls ANSI stripping for terminal output. JSON diagnostics are always unstyled. */
stripAnsi?: boolean;
}
declare function useConcurrentOutputContext<T>(context: ConcurrentOutputContext, callback: () => T): T;
+/** Runs finite processes concurrently and routes their output through the shared diagnostic context. */
+export declare function runConcurrentProcessesForJson({ processes, abortSignal, }: Pick<ConcurrentOutputProps, 'processes' | 'abortSignal'>): Promise<void>;
/**
* Renders output from concurrent processes to the terminal.
* Output will be divided in a three column layout
|
86c02af to
e6126ef
Compare
Co-authored-by: Qlaw <noreply@qlaw.quick.shopify.io>
Co-authored-by: Qlaw <noreply@qlaw.quick.shopify.io>
Co-authored-by: Qlaw <noreply@qlaw.quick.shopify.io>
Co-authored-by: Qlaw <noreply@qlaw.quick.shopify.io>
Co-authored-by: Qlaw <noreply@qlaw.quick.shopify.io>
Co-authored-by: Qlaw <noreply@qlaw.quick.shopify.io>
e6126ef to
bfc346d
Compare
|
/snapit |
|
🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm. Built from Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261009082731Caution After installing, validate the version by running |
WHY are these changes introduced?
Let scripts read the result of
app build. Related to #23668.WHAT is this pull request doing?
Add
--jsonwith a validated{"status":"success"}result after the build completes. Keep the text success message and native artifacts. Send compiler output through the shared diagnostic streams, and use the shared fatal error document on failure.--jsonand--no-inputstay independent.Text:
Example app built!.JSON:
{"status":"success"}.How to manually test your changes?
Use a disposable local app with its dependencies installed.
pnpm shopify app build --path <app> --skip-dependencies-installation. Check the success message and build artifacts.--json --no-input > build.json 2> build.events.jsonl. Check one success object on stdout and JSON events on stderr. Include a JavaScript Function extension to check its compiler output.export const broken = ;, and repeat the JSON command. Expect one error object, a nonzero exit, and valid JSONL on stderr. Runpnpm shopify app build --json-schemato inspect the contract.Validation
72 focused tests passed, with scoped lint, app/CLI build and type checks, Knip, and the command snapshot check. Command and documentation files were regenerated. Real CLI checks covered text and JSON success, plus an invalid UI extension. Both compiler regressions were detected when the old stream behavior was restored.
Other operating systems and real Javy download/optimization were not run locally.
Checklist