Replies: 2 comments 2 replies
-
I've done something similar to this in AuditBoard's own app. It's not super polished, but I'll see if I can clean it up or at least share the basic approach I took. |
Beta Was this translation helpful? Give feedback.
2 replies
-
@bertdeblock released https://github.com/bertdeblock/generate-template-registry which does the trick so I think i'll close this discussion :) Thanks again @bertdeblock! 💯 🥳 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In Glint's "Authoring addons" guide, it is said that when using classic
.hbs
files, we should expose aaddon/template-registry.d.ts
file that exports the addon's registry so apps can extend it. That file is supposed to list all components/helpers/modifiers that the addon exposes to its parents.However, when dealing with addons with a lot of those, things can easily get out of sync and you can end up forgetting to expose a component's Glint types.
That's why i suggest to have an additional script (
sync-template-registry
?) that goes through a project and automatically generates thetemplate-registry
file for us. It would:template-registry.ts
filetemplate-registry.ts
Note that the default value for the
registry-file
option is based on a v1 addon as for v2 addons we can't really know how their author will decide to structure them.The
--check
option can come in handy on a CI to prevent from publishing an addon w/ an out-of-sync template-registry.Beta Was this translation helpful? Give feedback.
All reactions