Skip to content

Commit fb28c6b

Browse files
committed
fix(pos): include BackgroundShopifyGlobal in targets.json reverse mapping
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.
1 parent b06074d commit fb28c6b

4 files changed

Lines changed: 239 additions & 3485 deletions

File tree

packages/ui-extensions/docs/surfaces/point-of-sale/build-docs-targets-json.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ function getNestedApis(apiName) {
281281
CashDrawerApi: ['./api/cash-drawer-api/cash-drawer-api'],
282282
PinPadApi: ['./api/pin-pad-api'],
283283
DataTargetApi: ['./api/data-target-api/data-target-api'],
284+
BackgroundShopifyGlobal: ['./globals'],
284285
};
285286

286287
const relativePaths = apiFilePaths[apiName];
@@ -354,8 +355,9 @@ function getNestedApis(apiName) {
354355
const typeDef = content.substring(startPos, endPos);
355356

356357
// Extract all API names from the type definition
358+
// Match both *Api types (e.g. SessionApi) and *Global types (e.g. BackgroundShopifyGlobal)
357359
const nestedApis = [];
358-
const apiMatches = typeDef.matchAll(/(\w+Api)\b/g);
360+
const apiMatches = typeDef.matchAll(/(\w+Api|\w+Global)\b/g);
359361

360362
for (const apiMatch of apiMatches) {
361363
const nestedApiName = apiMatch[1];

0 commit comments

Comments
 (0)