[Feature] Add intercepts target capability support - #8345
Conversation
There was a problem hiding this comment.
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
interceptsfield under target capabilities. - Updates the server kit
ExtensionPointtype to expose target-levelcapabilitiesas opaque JSON (Record<string, unknown>). - Adds/updates tests to verify nested
interceptspayloads 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.
|
Looks good thanks! |
| name: string | ||
| description?: string | ||
| assets?: Record<string, Asset> | ||
| capabilities?: Record<string, unknown> |
There was a problem hiding this comment.
Why is this unknown - can we get the right types?
There was a problem hiding this comment.
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?
Assisted-By: devx/e5cddb80-0e3c-436a-875b-f96ba8a73082
094f5f4 to
b7ee9b1
Compare
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
interceptstarget capability schema with a stringevent, booleanblocking, and optional string-arrayapplies_to.allow_direct_linkingtarget capability validation.ExtensionPoint, separately from extension-level capabilities.Testing
pnpm vitest run packages/app/src/cli/models/extensions/schemas.test.ts packages/app/src/cli/models/extensions/specifications/ui_extension.test.tspnpm nx lint apppnpm nx type-check apppnpm --filter @shopify/ui-extensions-server-kit vitest runpnpm nx lint ui-extensions-server-kitpnpm nx build ui-extensions-server-kitpnpm 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.tsgit diff --check