Skip to content

Conversation

@laurelthorburn
Copy link

PR summary: Admin docs build fixes and shopify-dev copy

What changed

1. Admin docs build script (docs/surfaces/admin/build-docs.sh)

  • Replaced undefined fail_and_exit with exit $build_exit so the script exits with the right status when the doc build fails.
  • Copy to shopify-dev: After a successful build, generated docs are copied into the shopify-dev repo when it exists at ../../../shopify-dev (same pattern as checkout docs).
  • Destination: shopify-dev/.../templated_apis/admin_extensions/<API_VERSION>/. Version is controlled by API_VERSION or the second script argument (default unstable).
  • Strip https://shopify.dev from generated_docs_data.json before copy so links work in Spin; for non-unstable versions, replace /unstable with the version in doc links.

2. generate-docs “Unable to find code file” fix

  • generate-docs treats every code field as a file path. The Custom Protocols section used inline snippets (e.g. '<Link to="shopify:admin/..." />'), which were interpreted as paths and failed.
  • Fix: Added five small example files under staticPages/examples/ and pointed the doc at them:
    • link-shopify-admin.tsx, fetch-shopify-admin.ts, link-app.tsx, link-extension.tsx, link-relative.tsx
  • Updated admin-extensions.doc.ts so all Custom Protocols codeblocks use these file paths instead of inline code strings.

Result

  • yarn docs:admin (and API_VERSION=2023-07 yarn docs:admin) completes successfully.
  • When shopify-dev is present as a sibling repo, admin docs are copied into it and appear on shopify.dev.

@laurelthorburn laurelthorburn changed the base branch from 2026-04-rc to 2023-07 February 7, 2026 03:04
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