Skip to content

Comments

2024-10 target docs#3775

Merged
laurelthorburn merged 2 commits into2024-10from
2024-10-target-docs
Feb 6, 2026
Merged

2024-10 target docs#3775
laurelthorburn merged 2 commits into2024-10from
2024-10-target-docs

Conversation

@johndcollett
Copy link

@johndcollett johndcollett commented Jan 30, 2026

Background

Part of: https://github.com/Shopify/shopify-dev/issues/66648

We want to parse target information for the dev docs for each surface.

Solution

Added scripts for each surface to pull target information from extension-targets.ts or targets.ts into a format that shopify-dev needs to display that information.

The scripts handle:

  • @private JSDoc tags: Targets marked with @private are excluded from the generated output
  • RunnableExtension targets: Included with components: [] since they don't render UI
  • Pick<> and Omit<> types: Correctly resolved to their component lists
  • Union types: Component types like AllComponents | OrderRoutingComponents are correctly merged

Also updated the build-docs.sh script to run the above script to create the targets output in the same place as other docs information for the reference.

🎩

Run the docs generation script for the different surfaces and verify that targets.json gets created correctly:

# 1. Admin surface
yarn docs:admin 2024-10

# 2. Checkout surface
yarn docs:checkout 2024-10

# 3. Point-of-Sale surface
yarn docs:point-of-sale 2024-10

# 4. Customer account surface
yarn docs:customer-account 2024-10

Verify that:

  • Targets with @private JSDoc tags are NOT included in the output (e.g., Playground in admin, purchase.checkout.gift-card.render in checkout)
  • RunnableExtension targets (e.g., purchase.address-autocomplete.suggest) have components: []
  • Component types using Pick<> resolve to only the picked components (e.g., pos.home.tile.render should have only ['Tile'])
  • Component types using Omit<> resolve to all components except the omitted ones

Checklist

  • I have 🎩'd these changes

@laurelthorburn laurelthorburn self-assigned this Jan 30, 2026
@johndcollett johndcollett changed the title target docs 2024-10 target docs Jan 30, 2026
@laurelthorburn laurelthorburn marked this pull request as ready for review February 3, 2026 18:17
johndcollett and others added 2 commits February 6, 2026 15:03
… handling to targets.json scripts

- Customer-account: Add generic recursive component parsing for AllComponents
  - Correctly resolves to 63 customer-account components (not checkout's 60)
  - Excludes Chat (not in shared-checkout-components.ts)
  - Includes local components (Card, Avatar, etc.)
  - Excludes @internal components (PolicyModal)
- Admin: Add RunnableExtension support for should-render targets (27 new targets)
- Admin: Add parseInlineComponentTypes for Pick/Omit handling
  - CustomerSegmentTemplateComponent correctly has 2 components
  - AllComponents correctly excludes 3 omitted components
- Checkout: Add RunnableExtension support for address-autocomplete targets
- Checkout: Add @Private target exclusion
- POS: Add parseInlineComponentTypes for Pick handling
  - ActionComponents correctly has 1 component (Button)
  - SmartGridComponents correctly has 1 component (Tile)
- All scripts: Add @Private JSDoc exclusion for targets
@laurelthorburn laurelthorburn merged commit 545ab4a into 2024-10 Feb 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants