Skip to content

2023-04 target docs#3815

Open
laurelthorburn wants to merge 5 commits into2023-04from
2023-04-target-docs
Open

2023-04 target docs#3815
laurelthorburn wants to merge 5 commits into2023-04from
2023-04-target-docs

Conversation

@laurelthorburn
Copy link

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

Note: This is the 2023-04 API version branch. Only admin and checkout surfaces exist on this branch (no point-of-sale or customer-account).

The scripts handle:

  • @private JSDoc tags: Targets marked with @private are excluded from the generated output
  • Pick<> 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 2023-04:

  • Admin uses extension-targets.ts with ExtensionTargets interface
  • Checkout uses extension-points.ts with ExtensionPoints interface (older naming)
  • Checkout target names use :: separator (e.g., Checkout::Actions::RenderBefore)
  • Admin has its own 24 components (not shared with checkout)

🎩

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

# 1. Admin surface (12 targets, 24 components)
yarn docs:admin 2023-04

# 2. Checkout surface (25 targets, 42 components)
yarn docs:checkout 2023-04

Verify that:

  • Admin: 12 targets generated (2 @private excluded: Playground, admin.customers.segmentation-templates.render)
  • Checkout: 25 targets generated (3 @private excluded: Checkout::GiftCard::Render, Checkout::PaymentMethod::Render, Checkout::PaymentMethod::RenderRequiredAction)
  • Admin targets have 24 admin-specific components (AdminAction, AdminBlock, etc.)
  • Checkout targets have 42 checkout components (Banner, BlockLayout, etc.)
  • Each target has components and apis arrays
  • Reverse mappings exist for APIs and Components

Checklist

  • I have 🎩'd these changes

Github CLI failure

  • .github/workflows/ci.yml --> to resolve the error/failures below

Error: This request has been automatically failed because it uses a deprecated version of actions/cache: v1. Please update your workflow to use v3/v4 of actions/cache to avoid interruptions. Learn more: https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down

Create scripts to generate targets.json for 2023-04 API version:
- Admin: 12 targets (excludes @Private), 24 components
- Checkout: 25 targets (excludes @Private), 42 components

Handles @Private JSDoc tag exclusion and Pick<> type parsing.
Exclude docs generated folders from Prettier checks to prevent
CI failures from auto-generated JSON files.
Fix CI failures caused by deprecated actions/cache@v1.
GitHub has deprecated v1/v2 versions.
@laurelthorburn laurelthorburn marked this pull request as ready for review February 3, 2026 18:10
@laurelthorburn laurelthorburn self-assigned this 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