Skip to content

Add --json to app config validate#7065

Merged
dmerand merged 1 commit intomainfrom
dlm-app-validate-json
Mar 26, 2026
Merged

Add --json to app config validate#7065
dmerand merged 1 commit intomainfrom
dlm-app-validate-json

Conversation

@dmerand
Copy link
Copy Markdown
Contributor

@dmerand dmerand commented Mar 20, 2026

What

Add --json to shopify app config validate.

This gives the command a machine-readable mode while keeping the current text output and exit behavior unchanged.

Why

shopify app config validate is useful in shell-based and agent-driven workflows, but today it only exposes human-readable output.

This PR creates a small automation foothold for validation loops and follow-up work on repair flows without changing the underlying validation model yet.

How

  • add --json / -j support to shopify app config validate
  • return JSON on success and failure
  • keep the current non-zero exit behavior for invalid configs
  • leave non-JSON output unchanged

Testing

To test manually in an app project:

  1. Run shopify app config validate --json in a valid app and confirm it prints a valid result object.
  2. Introduce an invalid app or extension config and run shopify app config validate --json again.
  3. Confirm it prints an invalid result object and still exits non-zero.

Copy link
Copy Markdown
Contributor Author

dmerand commented Mar 20, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 20, 2026

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 82.25% 15072/18324
🟡 Branches 74.82% 7435/9937
🟢 Functions 81.31% 3793/4665
🟢 Lines 82.64% 14249/17242

Test suite run success

3985 tests passing in 1527 suites.

Report generated by 🧪jest coverage report action from b9064bc

@dmerand dmerand force-pushed the dlm-app-validate-json branch from 59c4766 to efd8c3d Compare March 20, 2026 18:24
@dmerand dmerand changed the base branch from main to graphite-base/7065 March 20, 2026 19:46
@dmerand dmerand force-pushed the graphite-base/7065 branch from a4d95bf to 91c5478 Compare March 20, 2026 19:46
@dmerand dmerand force-pushed the dlm-app-validate-json branch from efd8c3d to a078db7 Compare March 20, 2026 19:46
@dmerand dmerand changed the base branch from graphite-base/7065 to dlm-json-force-no-color March 20, 2026 19:46
@dmerand dmerand changed the base branch from dlm-json-force-no-color to graphite-base/7065 March 23, 2026 21:16
@dmerand dmerand force-pushed the graphite-base/7065 branch from 91c5478 to 7eff2a7 Compare March 23, 2026 21:30
@dmerand dmerand force-pushed the dlm-app-validate-json branch from a078db7 to d45c41b Compare March 23, 2026 21:30
@dmerand dmerand changed the base branch from graphite-base/7065 to dlm-json-force-no-color March 23, 2026 21:30
@dmerand dmerand force-pushed the dlm-app-validate-json branch 2 times, most recently from e9ef54b to d22a6e8 Compare March 23, 2026 22:58
@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/private/node/constants.d.ts
@@ -8,7 +8,6 @@ export declare const environmentVariables: {
     env: string;
     firstPartyDev: string;
     noAnalytics: string;
-    cliToken: string;
     partnersToken: string;
     runAsUser: string;
     serviceEnv: string;
packages/cli-kit/dist/public/node/environment.d.ts
@@ -10,12 +10,17 @@
  */
 export declare function getEnvironmentVariables(): NodeJS.ProcessEnv;
 /**
- * Returns the value of the SHOPIFY_CLI_TOKEN environment variable,
- * falling back to the deprecated SHOPIFY_CLI_PARTNERS_TOKEN.
+ * Returns the value of the SHOPIFY_CLI_PARTNERS_TOKEN environment variable.
  *
- * @returns The CLI token value, or undefined if neither env var is set.
+ * @returns Current process environment variables.
+ */
+export declare function getPartnersToken(): string | undefined;
+/**
+ * Check if the current proccess is running using the partners token.
+ *
+ * @returns True if the current proccess is running using the partners token.
  */
-export declare function getCliToken(): string | undefined;
+export declare function usePartnersToken(): boolean;
 /**
  * Returns the value of the organization id from the environment variables.
  *
packages/cli-kit/dist/private/node/session/exchange.d.ts
@@ -25,7 +25,7 @@ export declare function exchangeAccessForApplicationTokens(identityToken: Identi
  */
 export declare function refreshAccessToken(currentToken: IdentityToken): Promise<IdentityToken>;
 /**
- * Given a custom CLI token passed as ENV variable, request a valid Partners API token.
+ * Given a custom CLI token passed as ENV variable, request a valid Partners API token
  * This token does not accept extra scopes, just the cli one.
  * @param token - The CLI token passed as ENV variable 
  * @returns An instance with the application access tokens.
@@ -35,7 +35,7 @@ export declare function exchangeCustomPartnerToken(token: string): Promise<{
     userId: string;
 }>;
 /**
- * Given a custom CLI token passed as ENV variable, request a valid App Management API token.
+ * Given a custom CLI token passed as ENV variable, request a valid App Management API token
  * @param token - The CLI token passed as ENV variable 
  * @returns An instance with the application access tokens.
  */
@@ -44,7 +44,7 @@ export declare function exchangeCliTokenForAppManagementAccessToken(token: strin
     userId: string;
 }>;
 /**
- * Given a custom CLI token passed as ENV variable, request a valid Business Platform API token.
+ * Given a custom CLI token passed as ENV variable, request a valid Business Platform API token
  * @param token - The CLI token passed as ENV variable 
  * @returns An instance with the application access tokens.
  */

@dmerand dmerand force-pushed the dlm-json-force-no-color branch from 7eff2a7 to da7fb1e Compare March 25, 2026 15:15
@dmerand dmerand force-pushed the dlm-app-validate-json branch from d22a6e8 to 5828af2 Compare March 25, 2026 15:15
@dmerand dmerand changed the title Add --json to validate Add --json to app config validate Mar 25, 2026
@dmerand dmerand force-pushed the dlm-json-force-no-color branch from da7fb1e to c953d80 Compare March 25, 2026 15:50
@dmerand dmerand force-pushed the dlm-app-validate-json branch from 5828af2 to 7a4c5d2 Compare March 25, 2026 15:50
@dmerand dmerand force-pushed the dlm-app-validate-json branch from 7a4c5d2 to bcfb6e3 Compare March 26, 2026 01:11
@dmerand dmerand force-pushed the dlm-json-force-no-color branch from c953d80 to 085ad44 Compare March 26, 2026 01:11
@dmerand dmerand changed the base branch from dlm-json-force-no-color to graphite-base/7065 March 26, 2026 01:23
@dmerand dmerand marked this pull request as ready for review March 26, 2026 13:38
@dmerand dmerand requested a review from a team as a code owner March 26, 2026 13:38
@dmerand dmerand requested a review from a team as a code owner March 26, 2026 13:38
@github-actions
Copy link
Copy Markdown
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

Caution

DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

First pass, not final agent shape
@dmerand dmerand force-pushed the graphite-base/7065 branch from 085ad44 to ecc2096 Compare March 26, 2026 14:02
@dmerand dmerand force-pushed the dlm-app-validate-json branch from bcfb6e3 to b9064bc Compare March 26, 2026 14:02
@dmerand dmerand changed the base branch from graphite-base/7065 to main March 26, 2026 14:02
@dmerand dmerand added this pull request to the merge queue Mar 26, 2026
Merged via the queue into main with commit dbd5b93 Mar 26, 2026
28 checks passed
@dmerand dmerand deleted the dlm-app-validate-json branch March 26, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants