Skip to content

Add typed JSON output to app import custom-data-definitions - #8815

Open
isaacroldan wants to merge 8 commits into
mainfrom
codex/json-app-custom-data
Open

isaacroldan wants to merge 8 commits into
mainfrom
codex/json-app-custom-data

Conversation

@isaacroldan

@isaacroldan isaacroldan commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Let scripts read suggested custom-data definitions. Related to #23958.

WHAT is this pull request doing?

Add --json to the command and its deprecated alias. Return converted counts, native TOML, and sections skipped for missing scopes. Use a canonical storeDomain, or null when unavailable. Keep the existing text output and leave the app TOML unchanged.

Text: Converted 1 metafields and 0 metaobjects from test-shop.myshopify.com into TOML, ready for you to copy.
JSON: {"status":"success","storeDomain":"test-shop.myshopify.com","metafieldCount":1,"metaobjectCount":0,"toml":"# namespace: $app key: color owner_type: PRODUCT\n[product.metafields.app.color]\ntype = \"single_line_text_field\"\n","skippedSections":[]}.

How to manually test your changes?

Use a linked app and its development store.

  1. Run shopify app import custom-data-definitions --store <store>.myshopify.com --json --no-input > definitions.json. Check one result with counts and suggested TOML. Check that the app TOML is unchanged.
  2. Repeat without --json to compare the summary and TOML. Use --include-existing to include already-declared definitions.
  3. Run shopify app import custom-data-definitions --json-schema to inspect the contract. The deprecated app import-custom-data-definitions command exposes the same result.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered documentation changes
  • I've considered analytics changes to measure impact
  • Added the required changeset

@github-actions github-actions Bot added shopify.dev preview Area: @shopify/cli @shopify/cli package issues labels Oct 7, 2026
@isaacroldan

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm.

Built from 9aee6405b8be71ca8d4d8aef04566995d4e2c962. Workflow run.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261007114628

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@isaacroldan
isaacroldan force-pushed the codex/json-app-custom-data branch from fb3360a to 3f1529d Compare October 7, 2026 13:32
@isaacroldan

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm.

Built from 3f1529dad0a557901500f1b7339894a15297f10f. Workflow run.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261007133852

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@isaacroldan

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm.

Built from 6fed5ab0642971e4387f224b312a4dc18504a8b8. Workflow run.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261007140359

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@isaacroldan
isaacroldan force-pushed the codex/json-app-custom-data branch from 6fed5ab to 4d86055 Compare October 8, 2026 15:50
@isaacroldan
isaacroldan marked this pull request as ready for review October 8, 2026 16:02
@isaacroldan
isaacroldan requested review from a team as code owners October 8, 2026 16:02
@isaacroldan

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm.

Built from 49ae50e73bc5ad15db0faeca1f7d905ab4997e06. Workflow run.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261009084758

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@isaacroldan

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm.

Built from 8b847734702c4afb274e4bf49dc722167e12c84f. Workflow run.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261009114709

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

status: zod.literal('success'),
storeDomain: zod
.string()
.regex(/^[a-z0-9][a-z0-9-]*\.myshopify\.com$/)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar comment to a previous PR here, maybe we just accept strings 🤷🏼

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.

2 participants