fix(pos): include Event Listeners API in targets.json reverse mapping#4568
Closed
henryStelle wants to merge 1 commit into
Closed
fix(pos): include Event Listeners API in targets.json reverse mapping#4568henryStelle wants to merge 1 commit into
henryStelle wants to merge 1 commit into
Conversation
…ping
BackgroundShopifyGlobal (addEventListener/removeEventListener on the shopify
global) was not being picked up by build-docs-targets-json.mjs. The script
discovers APIs by parsing type signatures and recursively resolving nested
*Api names via getNestedApis(), but BackgroundShopifyGlobal is a global
interface that doesn't match the (\w+Api) extraction pattern.
Fix: reference BackgroundShopifyGlobal from DataTargetApi's type intersection
(it is the shopify global for data targets), add it to the build script's
apiFilePaths map, and widen the getNestedApis extraction regex to also match
*Global types. Now getNestedApis('DataTargetApi') naturally discovers
BackgroundShopifyGlobal, which flows into the reverse mapping as
BackgroundShopifyGlobal -> [pos.app.ready.data].
Regenerated 2026-07-rc docs data.
9d0f224 to
fb28c6b
Compare
Contributor
Author
|
Superseded by #4569 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
BackgroundShopifyGlobal(which providesaddEventListener/removeEventListeneron theshopifyglobal) was not being picked up bybuild-docs-targets-json.mjs. The script discovers APIs by parsing type signatures and recursively resolving nested*Apinames viagetNestedApis(), butBackgroundShopifyGlobalis a global interface — not a type parameter inDataTargetApi's intersection — so it was never discovered.This caused
EventListenersApito be missing from the generatedtargets.jsonreverse mapping, which broke the<ExtensionSupports entityName="Event Listeners API" />component on the shopify-dev docs page.Fix
Following the existing
*Apipattern used bySessionApi,StorageApi, etc.:EventListenersApi+EventListenersApiContenttypes insrc/surfaces/point-of-sale/api/event-listeners-api/EventListenersApitoDataTargetApi's type intersection indata-target-api.tsEventListenersApifromapi.tsbuild-docs-targets-json.mjs'sapiFilePathsmapNow
getNestedApis('DataTargetApi')naturally discoversEventListenersApi, which flows into the reverse mapping asEventListenersApi -> [pos.app.ready.data]— no special-case hacks needed.Regenerated
2026-07-rc/generated_docs_data_v2.json2026-07-rc/targets.json