I often do this, addons are eslinted when imported · Issue #14 · ember-cli/ember-cli-eslint · GitHub. Forgot to set isDevelopingAddon
to false
before publishing. Is there any easy way to make isDevelopingAddon
to true
only when I do npm link
to test it in the host app and false
in all other situation (CI, publish etc.,)
No, not that I know of, though we could probably make that a really nice experience out of the box. Either by detecting that the addon is linked or via a specific environment variable. Seems like a fun project to hack on if someone wants to pick it up …
Yeah, this API is on my hitlist.
It doesn’t really make sense to ask every addon “do you want to be in development mode?”. That’s not really up to each addon, it’s up to the person setting up the application.
it’s up to the person setting up the application
if we want to live-reload addon changes, then we have to make it as developing
in host app?
or is it fine if we just make this property true internally when npm linked?
I think both are acceptable designs for a new API.
I like using npm link
best because the intent expressed by doing that is almost exactly the right intent anyway. I can’t think of a common use case where someone would either NPM-link without wanting dev or want dev without NPM linking (monorepos tend to use links internally, so they would be covered).
Are you talking about in-repo addons? Is ember-cli really using npm link
to integrate them internally? Otherwise that might be an use case where you don’t use npm link
but need to toggle isDevelopingAddon
sometimes.
In-repo-addons definitely should always be in development mode regardless.
But I was talking about projects that use something like https://lernajs.io/ to have one (or many) apps and also a collection of addons all in one repo.
oh my g.o.s.h. that would be amazing. +100 to this idea.
Or add an .isDevelopingAddon
file in the project we can gitignore.