Skip to content

[Feature] Add intercepts target capability support - #8345

Merged
henryStelle merged 6 commits into
mainfrom
henry/ui-extension-arbitrary-json-capability
Aug 28, 2026
Merged

[Feature] Add intercepts target capability support#8345
henryStelle merged 6 commits into
mainfrom
henry/ui-extension-arbitrary-json-capability

Conversation

@henryStelle

@henryStelle henryStelle commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Why

UI extension target configurations did not recognize intercepts, so the capability could be removed while parsing extension configuration. The UI extensions server kit also omitted target capabilities from its extension point type.

What

  • Adds an intercepts target capability schema with a string event, boolean blocking, and optional string-array applies_to.
  • Preserves the existing allow_direct_linking target capability validation.
  • Exposes opaque target capabilities on the server kit's ExtensionPoint, separately from extension-level capabilities.
  • Adds parsing, transformation, and schema validation coverage.

Testing

  • pnpm vitest run packages/app/src/cli/models/extensions/schemas.test.ts packages/app/src/cli/models/extensions/specifications/ui_extension.test.ts
  • pnpm nx lint app
  • pnpm nx type-check app
  • pnpm --filter @shopify/ui-extensions-server-kit vitest run
  • pnpm nx lint ui-extensions-server-kit
  • pnpm nx build ui-extensions-server-kit
  • pnpm exec prettier --check packages/app/src/cli/models/extensions/schemas.ts packages/app/src/cli/models/extensions/schemas.test.ts packages/app/src/cli/models/extensions/specifications/ui_extension.test.ts
  • git diff --check

@github-actions github-actions Bot added the Area: @shopify/app @shopify/app package issues label Aug 17, 2026
@github-actions github-actions Bot added Area: @shopify/cli @shopify/cli package issues and removed Area: @shopify/app @shopify/app package issues labels Aug 25, 2026
@henryStelle
henryStelle marked this pull request as ready for review August 25, 2026 19:38
@henryStelle
henryStelle requested a review from a team as a code owner August 25, 2026 19:38
Copilot AI lite review requested due to automatic review settings August 25, 2026 19:38

Copilot AI left a comment

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.

Pull request overview

Adds support for the intercepts target capability in UI extension configuration parsing, and surfaces target-level capabilities through the UI extensions server kit types so the data survives parse/transform and can be consumed downstream.

Changes:

  • Extends the CLI config schema to accept an optional intercepts field under target capabilities.
  • Updates the server kit ExtensionPoint type to expose target-level capabilities as opaque JSON (Record<string, unknown>).
  • Adds/updates tests to verify nested intercepts payloads are retained through parsing and transformation, and includes changeset entries for the impacted packages.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/ui-extensions-server-kit/src/types.ts Adds optional capabilities to ExtensionPoint to expose target-level capabilities as opaque JSON.
packages/app/src/cli/models/extensions/specifications/ui_extension.test.ts Adds coverage asserting nested intercepts configuration is preserved through parsing/transform.
packages/app/src/cli/models/extensions/schemas.ts Updates target capabilities schema to accept intercepts.
.changeset/add-intercepts-capability.md Declares minor bumps for @shopify/app and @shopify/ui-extensions-server-kit for the new capability support.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/app/src/cli/models/extensions/schemas.ts
@vctrchu
vctrchu self-requested a review August 25, 2026 22:35
Comment thread packages/app/src/cli/models/extensions/specifications/ui_extension.test.ts Outdated

vctrchu commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Looks good thanks!

Comment thread packages/app/src/cli/models/extensions/schemas.test.ts
name: string
description?: string
assets?: Record<string, Asset>
capabilities?: Record<string, unknown>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this unknown - can we get the right types?

@henryStelle henryStelle Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes we can. to keep the types in sync I updated the tsconfg to pull the declared types from @shopify/ui-extensions-server-kit but didn't declare it a devDependancy of the app package as there was president and the types were not being re-exported. However, I recognize this might be considered not worth it or maybe it should be a formal dependancy?

@henryStelle
henryStelle force-pushed the henry/ui-extension-arbitrary-json-capability branch from 094f5f4 to b7ee9b1 Compare August 28, 2026 20:50
@henryStelle
henryStelle added this pull request to the merge queue Aug 28, 2026
Merged via the queue into main with commit 833a582 Aug 28, 2026
51 of 55 checks passed
@henryStelle
henryStelle deleted the henry/ui-extension-arbitrary-json-capability branch August 28, 2026 21:47
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.

6 participants