Skip to content

2024-01 target docs#3817

Open
laurelthorburn wants to merge 1 commit into2024-01from
2024-01-target-docs
Open

2024-01 target docs#3817
laurelthorburn wants to merge 1 commit into2024-01from
2024-01-target-docs

Conversation

@laurelthorburn
Copy link

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 admin and checkout surfaces to pull target information into a format that shopify-dev needs to display that information.

Note: This is the 2024-01 API version branch. All four surfaces exist (admin, checkout, point-of-sale, customer-account).

The scripts handle:

  • @private JSDoc tags: Targets marked with @private are excluded from the generated output
  • Pick<> / Omit<> types: Correctly resolved to their component lists
  • API parsing: Extracts API types from RenderExtension<Api, Components> definitions
  • Reverse mappings: Generates API → targets and Component → targets mappings

Key differences for 2024-01:

  • Admin uses extension-targets.ts with ExtensionTargets interface
  • Checkout uses targets.ts with ExtensionTargets interface
  • Checkout has both new . naming (e.g., purchase.checkout.block.render) and deprecated :: naming (e.g., Checkout::Dynamic::Render)
  • Admin has 39 components including new ones like Badge, Card, ColorPicker, MoneyField
  • Order routing targets added (admin.settings.order-routing-rule.render)

🎩

Run the docs generation scripts (which now include targets.json generation):

# 1. Admin surface (18 targets, 39 components)
yarn docs:admin 2024-01

# 2. Checkout surface (56 targets, 52 components)
yarn docs:checkout 2024-01

Verify that:

  • Admin: 18 targets generated (1 @private excluded: Playground)
  • Checkout: 56 targets generated (multiple @private excluded including gift card and payment method targets)
  • Admin targets have 39 admin-specific components (AdminAction, AdminBlock, Badge, Card, etc.)
  • Checkout targets have 52 checkout components (Banner, BlockLayout, Map, MapMarker, etc.)
  • Each target has components and apis arrays
  • Reverse mappings exist for APIs and Components

Checklist

  • I have 🎩'd these changes

- Add build-docs-targets-json.mjs for admin and checkout surfaces
- Update build-docs.sh scripts to include targets.json generation
- Admin: 18 targets, 39 components
- Checkout: 56 targets, 52 components
@laurelthorburn laurelthorburn marked this pull request as ready for review February 3, 2026 21:21
@laurelthorburn laurelthorburn self-assigned this Feb 3, 2026
@laurelthorburn laurelthorburn changed the title Add targets.json generation scripts for 2024-01 2024-01 target docs Feb 3, 2026
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.

1 participant