Skip to content

Fix customer-account targets.json output path #4293

Merged
midhatdlg merged 2 commits into2026-04-rcfrom
fix/customer-account-targets-json-path
Apr 15, 2026
Merged

Fix customer-account targets.json output path #4293
midhatdlg merged 2 commits into2026-04-rcfrom
fix/customer-account-targets-json-path

Conversation

@midhatdlg
Copy link
Copy Markdown

@midhatdlg midhatdlg commented Apr 13, 2026

Problem

Closes Part 1 of : https://github.com/shop/issues-learn/issues/1521

When customer-account docs are generated, targets.json is written to
db/data/docs/templated_apis/targets.json (root level) instead of
db/data/docs/templated_apis/customer_account_ui_extensions/{version}/targets.json. This is
because build-docs.mjs calls build-docs-targets-json.mjs without passing the API version
argument. The script falls back to searching for generated_docs_data.json (v1), which
customer-account doesn't generate, so it defaults to the generated/ root.

Solution

  • packages/ui-extensions/docs/surfaces/customer-account/build-docs.mjs — Pass
    EXTENSIONS_API_VERSION to build-docs-targets-json.mjs, matching the pattern checkout already
    uses in build-docs.sh.
  • packages/ui-extensions/docs/surfaces/customer-account/build-docs-targets-json.mjs
    Harden findGeneratedDocsPath() to also search for generated_docs_data_v2.json, preventing
    the fallback from ever triggering.

Risk

  1. Visibility: Not user-facing — affects generated data files only.
  2. Impact: Scoped to customer-account surface docs generation.
  3. Type: Bug fix.
  4. Unknowns: None — checkout already uses this exact pattern and works correctly.

Top-hatting

  1. Run yarn docs:customer-account 2026-04-rc
  2. Confirm targets.json appears at docs/surfaces/customer-account/generated/customer_account_ ui_extensions/2026-04-rc/targets.json
  3. Confirm there is NO targets.json at docs/surfaces/customer-account/generated/targets.json

Note

Generated files are included in this PR so reviewers can see the output of the changes. They
will be removed after review:

  • packages/ui-extensions/docs/surfaces/customer-account/generated/customer_account_ui_extension s/2026-04-rc/generated_docs_data_v2.json
  • packages/ui-extensions/docs/surfaces/customer-account/generated/targets.json

@github-actions
Copy link
Copy Markdown
Contributor

🚨🚨🚨 Docs migration in progress 🚨🚨🚨

We are actively migrating UI extension reference docs to MDX in the areas/platforms/shopify-dev zone of the monorepo. This impacts docs for the following surfaces:

During this migration, please be aware of the following:

.doc.ts files are being deprecated. Changes to .doc.ts files in this repo will not be reflected in the new MDX-based docs. If you need to update docs for a reference that has already been migrated, make your changes directly in the areas/platforms/shopify-dev zone of the monorepo instead.

Doc comments in .ts source files (the comment blocks above types and functions) are also affected. Generating docs from these comments currently requires a newer version of the @shopify/generate-docs library that isn't yet available. Updates to doc comments may not produce the expected output until the migration is complete.

Examples that previously lived in this repo are being moved to the areas/platforms/shopify-dev zone of the monorepo and should be authored there going forward.

What should I do?

  • If your PR includes changes to .doc.ts files, doc comments, or examples, please reach out to us in #devtools-proj-templated-refs so we can help ensure your updates are captured correctly.
  • If your PR is limited to source code changes (non-docs), you can ignore this notice.

Thanks for your patience while we complete the migration! 🙏

@midhatdlg midhatdlg changed the title ⏺ Fix customer-account targets.json writing to wrong path by passing … Fix customer-account targets.json output path Apr 13, 2026
Copy link
Copy Markdown

@johndcollett johndcollett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems good.

@midhatdlg midhatdlg added the #gsd:47443 Templated References https://vault.shopify.io/gsd/projects/47443 label Apr 15, 2026
@midhatdlg midhatdlg self-assigned this Apr 15, 2026
@midhatdlg
Copy link
Copy Markdown
Author

/shipit

@midhatdlg midhatdlg merged commit 9b5e41f into 2026-04-rc Apr 15, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:47443 Templated References https://vault.shopify.io/gsd/projects/47443

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants