-
-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify how to set enableTypeScriptTransform
in Ember apps, addons and engines
#467
Clarify how to set enableTypeScriptTransform
in Ember apps, addons and engines
#467
Conversation
@chriskrycho When {
"scripts": {
"prepack": "ember ts:precompile",
"postpack": "ember ts:clean"
}
} When we use If so, I wonder if this is worth mentioning in |
Nope, nothing will generate types out of the box for you in that mode. For that reason, addons which want to publish types should generally do one of two things:
Probably worth documenting that explicitly here (feel free to steal that prose and tweak/improve it!). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT, this looks good @ijlee2.
One thing I'm wondering though, I'm not sure if the ember-cli-build.js
file for addons and engines should be modified as well. I think that enabling the transform from within the index.js
file should be sufficient.
README.md
Outdated
|
||
const EngineAddon = require('ember-engines/lib/engine-addon'); | ||
|
||
module.exports = EngineAddon.extend({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bertdeblock Thanks for the suggestion. I wasn't familiar with the new syntax and hope I updated the file correctly.
enableTypeScriptTransform
in Ember apps, addons and engines
Co-authored-by: Chris Krycho <[email protected]>
Thanks for writing this up, it helped me when I was having build problems with an addon. I think it would be great to have merged so it’s easier to find 😀 |
@bertdeblock Could we merge this pull request some time soon? (I forget where we had left off, if there had been additional feedback that I needed to address.) |
Description
Currently, the
README
explains how to setenableTypeScriptTransform
for Ember apps only.It wasn't clear to me what to do for Ember addons and engines (to be precise, engines created as an addon). The setup for engines turned out to be tricky, because I wasn't supposed to embed the
'ember-cli-babel'
key inside of anoptions
hash (the pattern suggested by apps and addons).I'd like to update the section
Enabling TypeScript Transpilation
so that:v4.9.0-beta.0
at the time of writing). (Note, I continued to writereturn app.toTree();
. That is, to limit the scope of this pull request, I didn't assume that the developer uses, or will use, Embroider.)