docs/solutions/developer-experience/2026-04-06-registry-helper-refactors-must-update-template-registry-dependencies.md
Template CI started failing after a batch of registry refactors in apps/www.
The application source was fine, but generated template code was not. templates/plate-template and templates/plate-playground-template were missing helper modules such as block-discussion-index, get-annotation-click-target, and trailing-block-kit. That made the break look like a template-only issue even though the real bug lived in registry wiring.
The local source files already existed, so it was easy to assume the refactor was complete.
That missed the real contract: registry items must explicitly carry every helper file and registry dependency that generated consumers need.
The failures were deterministic Module not found errors in generated template source, not random package resolution noise.
Reinstalling dependencies would not fix a file that was never copied into the generated template in the first place.
Two new files, ui/suggestion-line-break-anchor.tsx and ui/suggestion-styles.ts, were only supporting ui/suggestion-node.tsx.
Keeping them separate would have meant teaching the registry about two more files for no lasting design benefit.
When a registry item starts importing a new local helper, update the registry definition at the same time.
For this fix, the important additions were:
ui/block-discussion-index.ts under the block-discussion registry itemlib/get-annotation-click-target.ts as its own registry lib itemtrailing-block-kit.ts as its own registry kit itemregistryDependencies from comment-kit, suggestion-kit, editor-kit, and editor-aiThat makes generated consumers install the same dependency graph that apps/www uses.
If a helper only exists for one registry component, prefer folding it back into that file instead of growing the registry surface.
In this case, SuggestionLineBreakAnchor, suggestionVariants, and getBlockSuggestionWrapperClassName moved into:
That let the extra helper files disappear entirely instead of teaching templates about more moving parts.
After registry wiring changes, regenerate the local registry payload:
pnpm --filter www rd
This is the fastest way to confirm the generated JSON no longer points at deleted or missing helpers.
Template generation is driven by registry metadata, not by whatever happens to exist in apps/www/src.
That means every local helper used by a registry item must be represented in one of two ways:
Once that rule is followed, the generated templates stop drifting behind the app source and CI stops reporting missing modules that only exist outside the template install graph.
rg on app source is not enoughA clean local import tree in apps/www does not prove the templates have the same files.
The real source of truth for generated consumers is the registry definition plus the rebuilt registry JSON.
If a helper is only used once, keeping it separate increases registry bookkeeping and CI blast radius.
Inline it unless the helper is genuinely shared.
pnpm turbo build --filter=./apps/www can fail for unrelated reasonsFor this change, registry rebuild, typecheck, and lint passed, but full apps/www build still hit an existing Turbopack/RSC boundary issue in packages/core.
That failure should not be mistaken for evidence that the registry helper fix is wrong.
These commands were used while fixing the issue:
pnpm install
pnpm --filter www rd
pnpm turbo typecheck --filter=./apps/www
pnpm lint:fix
pnpm turbo build --filter=./apps/www still failed, but on unrelated packages/core React Server Component errors rather than registry helper resolution.