2026 04 v1 cleanup#4478
Conversation
🚨🚨🚨 Docs migration in progress 🚨🚨🚨We are actively migrating UI extension reference docs to MDX in the
During this migration, please be aware of the following:
Doc comments in Examples that previously lived in this repo are being moved to the What should I do?
Thanks for your patience while we complete the migration! 🙏 |
bc84f3d to
220e3d0
Compare
jgray7019
left a comment
There was a problem hiding this comment.
Should these changes be going into 2026-04 branch instead of 2026-04-rc?
- src/docs/ (entire tree — component-definitions.ts, docs-type.ts, components/*.ts) — v1 shared component schemas, all consumers were the .doc.ts files I deleted earlier - src/surfaces/admin/docs-types.ts — same - src/surfaces/checkout/helper.docs.ts — same - docs/surfaces/checkout/reference/helper.docs.ts — same
src/surfaces/checkout/components/Abbreviation/Abbreviation.doc.ts), which incidentally created build/ts/surfaces/checkout/components/ as a side effect. copyComponentDefinitions in buildTargetDts.ts assumed that directory existed. With the .doc.ts files gone, tsc no longer creates the parent dir, so copyFileSync fails with ENOENT on the destination.
220e3d0 to
879c3a5
Compare
|
We detected some changes in |
Tsconfigs targeting .doc.ts globs, the scaffolder + its ReadMe, the JSX live-preview templates, and Icon's preview config — all unreachable now that the v1 docs and jsxWrapper are gone.
Part of https://github.com/shop/issues-learn/issues/1601
Background
Same v1 cleanup as #4470, but targeting
2026-04-rcso the older active release branch stops dragging the v1 artifacts.The v1 generator consumes hand-authored
.doc.tsfiles and emitsgenerated_docs_data.json,generated_static_pages.json, andgenerated_category_pages.json. We've fully moved to v2, which reads@publicDocsJSDoc tags off the source.tsfiles and emitsgenerated_docs_data_v2.json. Keeping the v1 files around invites accidental regressions and confuses contributors.Solution
Scoped to
2026-04-rc(mirror of the cleanup landed on2026-07-rcin #4470):Bump
@shopify/generate-docsto1.2.2— the latest stable release; v2-only CLI surface.Delete all
.doc.tsfiles (~410 files across admin, checkout, customer-account, point-of-sale).Delete v1 generated JSONs for
2026-04-rcand surface-level paths:generated_docs_data.json,generated_static_pages.json,generated_category_pages.json.Delete v1 type-helper sidecars in
src/that consumed removed exports from generate-docs (ReferenceEntityTemplateSchema,CodeTabType,ExampleType, etc.):src/docs/(whole tree —component-definitions.ts,docs-type.ts,components/*.tsmetadata sidecars)src/surfaces/admin/docs-types.tssrc/surfaces/checkout/helper.docs.tsdocs/surfaces/checkout/reference/helper.docs.tsThese were metadata-only files (name/description/category records) consumed exclusively by the deleted
.doc.tsfiles. None of the real component source was touched.Slim the four build scripts (
admin,checkout,customer-account,point-of-sale) to v2-only:--isLandingPage,--isCategoryPage,--typesInput), thetransformJsonstep,.doc.ts→.doc.jstsc compile, and dead template helpers (htmlWrapper, jsxWrapper, etc.).build-docs-fast.sh/build-docs-watch.shcheckout scripts (v1-only).Stop copying screenshots to shopify-dev in every surface's build script.
Fix
build-docs-targets-json.mjs(admin + POS) to locate output dirs viagenerated_docs_data_v2.jsonnow thatgenerated_docs_data.jsonis gone.Fix
buildTargetDts.ts—copyComponentDefinitionsnowmkdirSync's the components build destination. Previously the dir existed only as a side effect of tsc emitting the now-deleted.doc.tsfiles; on a clean CI build with no.doc.tsfiles compiled,copyFileSyncfailed with ENOENT.Fix
yarn.lock— the@shopify/generate-docs@1.2.2resolvedURL had been pinned tonpm.shopify.io(Shopify's internal registry) because of local.npmrcscope routing. Rewrote it toregistry.npmjs.orgso CI (which can't auth to the internal mirror) can install. Integrity sha512 is identical between registries.Leave scaffolding alone —
create-doc-files.js, thegen-docs:adminworkspace script, andtsconfig.docs.jsonare kept since they're authoring tools, not v1 build artifacts.🎩
Each should produce only `generated_docs_data_v2.json` + `targets.json` under the surface's versioned output dir, with no v1 files anywhere.
CI parity locally (clean `build/` removed first): `yarn lint`, `yarn type-check`, `yarn build`, `yarn test --no-watch` all pass.
Checklist