Skip to content

Add typed JSON output to app config pull - #8604

Draft
gonzaloriestra wants to merge 4 commits into
gonzalo/json-app-config-linkfrom
gonzalo/json-app-config-pull
Draft

gonzaloriestra wants to merge 4 commits into
gonzalo/json-app-config-linkfrom
gonzalo/json-app-config-pull

Conversation

@gonzaloriestra

@gonzaloriestra gonzaloriestra commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Related to https://github.com/shop/issues-develop/issues/23665

Refreshing app configuration needs a machine-readable result.

WHAT is this pull request doing?

Add JSON output using the shared config-link projection: absolute written path, native configuration content, and public app metadata. Reuse the strict schema and preserve text presentation.

How to manually test your changes?

pnpm shopify app config pull --path /path/to/app --json
pnpm shopify app config pull --json-schema

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • Added a minor changeset for the public JSON contract.

@gonzaloriestra
gonzaloriestra added this pull request to stack #8606 September 21, 2026 08:08
@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Sep 21, 2026
@gonzaloriestra

Copy link
Copy Markdown
Contributor Author

/snapit

@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-app-config-pull branch from 22106c9 to 4ee8147 Compare September 21, 2026 08:11
@gonzaloriestra

Copy link
Copy Markdown
Contributor Author

/snapit

@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-app-config-pull branch from 4ee8147 to c2f717a Compare September 22, 2026 11:23
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-app-config-pull branch from c2f717a to 03dbe5c Compare September 22, 2026 12:28
@github-actions github-actions Bot added no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. and removed Area: @shopify/cli @shopify/cli package issues labels Sep 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Differences in type declarations

We 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:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/context/local.d.ts
@@ -11,6 +11,12 @@ export declare function isTerminalInteractive(): boolean;
  * @returns The path to the user's home directory.
  */
 export declare function homeDirectory(): string;
+/**
+ * Clears the memoized result of isUnitTest so the environment variable is re-read.
+ *
+ * Only intended for test helpers that temporarily toggle unit-test detection.
+ */
+export declare function resetMemoizedIsUnitTest(): void;
 /**
  * Returns true if the CLI is running in debug mode.
  *
packages/cli-kit/dist/public/node/testing/output.d.ts
@@ -8,6 +8,36 @@ interface OutputMock {
     error: () => string;
     clear: () => void;
 }
+interface StandardStreamsMock {
+    stdout: () => string;
+    stderr: () => string;
+    restore: () => void;
+}
+export interface CapturedStandardStreams {
+    stdout: () => string;
+    stderr: () => string;
+}
+/**
+ * Runs a callback with process stdout/stderr captured and unit-test output suppression disabled,
+ * so tests can assert on what a command actually writes to the standard streams.
+ *
+ * The callback receives accessors instead of the function returning captured output so that
+ * assertions remain possible when the callback throws (for example commands that abort).
+ * Streams, console.warn and unit-test detection are restored afterwards.
+ * Not safe for concurrent tests.
+ *
+ * @param run - Callback receiving accessors for the captured stdout and stderr.
+ * @returns The value returned by the callback.
+ */
+export declare function withCapturedStandardStreams<T>(run: (streams: CapturedStandardStreams) => T | Promise<T>): Promise<T>;
+/**
+ * Captures writes to stdout and stderr, including console warnings intercepted by Vitest.
+ * Call restore in a finally block. This replaces process globals and must not be used in concurrent tests.
+ * Prefer withCapturedStandardStreams, which also disables unit-test output suppression while it runs.
+ *
+ * @returns Captured output and a function to restore the original writers.
+ */
+export declare function mockAndCaptureStandardStreams(): StandardStreamsMock;
 /**
  * Returns a set of functions to get the outputs ocurred during a test run.
  *

@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-app-config-pull branch from 03dbe5c to acfe298 Compare September 23, 2026 08:21
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-app-config-pull branch from acfe298 to bfd28c4 Compare September 23, 2026 12:14
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-app-config-pull branch from bfd28c4 to bc9b942 Compare September 29, 2026 14:43
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-app-config-pull branch from bc9b942 to 49cbecb Compare October 6, 2026 12:21
@github-actions github-actions Bot added Area: @shopify/cli @shopify/cli package issues and removed no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. labels Oct 6, 2026
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-app-config-pull branch from 49cbecb to dd7117d Compare October 6, 2026 13:46
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-app-config-pull branch from dd7117d to c8676b4 Compare October 6, 2026 13:53
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-app-config-pull branch from c8676b4 to f4692da Compare October 6, 2026 13:56
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ Potential Breaking Changes Detected

This PR contains changes that may break the existing contract.

@shopify/dev_experience — this PR contains breaking changes that require coordination for the next major release.

📦 Major Version Changesets

The following changesets request a major version bump:

Changeset Package
typed-app-config-validate.md '@shopify/cli': major

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant