Add shopify/Discount app intent link snippets for React Router tutorial - #75
Add shopify/Discount app intent link snippets for React Router tutorial#75loic-d wants to merge 3 commits into
Conversation
Generated from Shopify/discount-functions-testing#1408. Adds the coderef sources for the new 'Let Sidekick create and edit your discount' step in the build-ui-with-react-router tutorial: - docs/reference/shopify/{javascript,rust}/shopify.extension.toml: create + edit admin.app.intent.link extensions under the discount-function.app-intent-link tag - docs/reference/shopify/{javascript,rust}/create-intent-schema.json, edit-intent-schema.json, instructions.md Scoped to just these files; unrelated regen drift (formatting/deps) omitted. Assisted-By: devx/544990ff-9f89-4bd0-8c23-777a2f097188
The {id} URL segment is filled with the discount's ID at runtime; only
the Function ID stays hardcoded. Keeps the comment implementation-agnostic.
Synced from discount-functions-testing.
The functionId property only needs matchValue for intent disambiguation. Drop the JSON-Schema type and description so the snippet matches the shape we actually ship. Synced from discount-functions-testing.
| "$ref": "https://extensions.shopifycdn.com/shopifycloud/schemas/v1/shopify/discount.json", | ||
| "additionalProperties": true, | ||
| "properties": { | ||
| "functionId": { |
There was a problem hiding this comment.
should we still include mapTo: param here? like in DFT
There was a problem hiding this comment.
nvm I see this PR now: https://github.com/Shopify/discount-functions-testing/pull/1429
lauramann
left a comment
There was a problem hiding this comment.
LGTM - just a question around whether we should still include mapTo on the intent-schema
|
|
||
| [[extensions.targeting]] | ||
| target = "admin.app.intent.link" | ||
| # {id} receives the discount ID; the Function ID stays hardcoded. |
|
We can merge this now and I created prs for the follow up. |
|
Follow-up dependency: #78 adds the missing runtime lifecycle for these intent links. It returns the authoritative discount GID from create/update mutations, resolves successful saves with |
Summary
Adds the coderef source snippets for the new "Let Sidekick create and edit your discount" step in the
build-ui-with-react-routertutorial. Generated from Shopify/discount-functions-testing#1408 (dev generate-reference-app), scoped to only the app-intent-link files.Files
docs/reference/shopify/{javascript,rust}/shopify.extension.toml— create + editadmin.app.intent.linkextensions under thediscount-function.app-intent-linktag (added to the existing React Router function toml)docs/reference/shopify/{javascript,rust}/create-intent-schema.json,edit-intent-schema.json,instructions.mdDetails
YOUR_FUNCTION_ID; edit URL is/app/discount/YOUR_FUNCTION_ID/{id}(matches the app'sapp.discount.$functionId.$idroute)functionIdusesmatchValue; notools.jsonRelated
Note on scope
This is a curated diff. A full
dev generate-reference-appalso rewrites ~110 unrelated files (oxfmt reflow, dependency/lockfile churn, new.oxfmtrc.json/.oxlintrc.json) becausemainis stale vs currentdiscount-functions-testingmain. That drift is intentionally omitted here and should be handled as a separate maintenance regen.