Skip to content

Add typed JSON output to app config validate - #8602

Draft
gonzaloriestra wants to merge 1 commit into
mainfrom
gonzalo/json-app-config-validate
Draft

gonzaloriestra wants to merge 1 commit into
mainfrom
gonzalo/json-app-config-validate

Conversation

@gonzaloriestra

@gonzaloriestra gonzaloriestra commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

App configuration validation has JSON output but no declared, discoverable result contract.

WHAT is this pull request doing?

Return typed validation facts and present them through the schema encoder. Preserve existing JSON bytes, terminal messages, analytics and failure exits. Reuse the standard-stream capture helper from #8575 to test the real output boundary.

Normal output:

App configuration 'shopify.app.toml' is valid.

JSON output:

{
  "valid": true,
  "issues": []
}

How to manually test your changes?

pnpm shopify app config validate --path /path/to/app
pnpm shopify app config validate --path /path/to/app --json
pnpm shopify app config validate --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 new public JSON capability

@gonzaloriestra
gonzaloriestra added this pull request to stack #8606 September 21, 2026 08:08
@gonzaloriestra

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Sep 21, 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/testing/output.d.ts
@@ -8,6 +8,19 @@ interface OutputMock {
     error: () => string;
     clear: () => void;
 }
+interface StandardStreamsMock {
+    stdout: () => string;
+    stderr: () => string;
+    restore: () => void;
+}
+/**
+ * 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.
+ * CLI output tests must disable SHOPIFY_UNIT_TEST and reset modules before loading the command.
+ *
+ * @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.
  *

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

Labels

Area: @shopify/cli @shopify/cli package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant