-
Notifications
You must be signed in to change notification settings - Fork 58
Description
Background
To move @embroider/addon-blueprint away from rollup-plugin-ts, we changed how declaration files are created (it is assumed that the v2 addon runs on glint).
/* package.json for projects with Glint */
"scripts": {
"build:types": "glint --declaration",
"lint:types": "glint",
"start:types": "glint --declaration --watch"
}When I tried the new approach on ember-container-query, I noticed that,
build:typesdoesn't create thedeclarationsfolderstart:typesdoes create thedeclarationsfolder
I filed a bug report in embroider-build/addon-blueprint#139.
@NullVoxPopuli and @dfreeman, who further investigated the problem, found the cause to be a @glint-ignore comment that I had added some time ago.
https://discord.com/channels/480462759797063690/1126182801876713532/1126191306109091840
Dan on Discord
it looks like a bug
specifically, if I set
noEmitOnError: false, declarations are emittedI'm guessing it happens to work with
--buildbecause that will always emit declarations, regardless of errors (because--buildprioritizes having declarations available for your other project references)ah
it's because of the
@glint-ignorehere
https://github.com/ijlee2/ember-container-query/blob/4.0.4/ember-container-query/src/components/container-query.hbs#L1the bug appears to be that TS internally is counting that as an error that triggers
noEmitOnErrorbehaviorif I add an entry for
elementin the registry inunpublished-development-types, everything works
Additional notes
By adding console.log()'s, I checked that glint --declaration results in determineOptionsToExtend() correctly setting options.{noEmit,declaration,emitDeclarationOnly} (to false, true, and true, respectively).
I'm guessing that something different happens,
- When we run
glint --buildas opposed toglint --declaration - When we run
glint --declaration --watchas opposed to justglint --declaration