1

I have been just starting out with ember addon and one of the difficulty I am facing is to debug it. I have a separate repo for my addon(lets name it my-addon for now), and everytime I make any change, I have to

1) commit it

2) push the changes

3) go to consuming app and then re install the app from git(atleast re-run npm install git:address so I get the latest changes)

4) run ember g my-addon (because I am in older cli)

5) do build

6) and check if things are working

This process is kinda tedious, I was wondering if I can place the addon(all of it) within the consuming app itself, atleast in the dev phase so I can just build my ember app and test the addon in the consuming app itself, and once I feel good about, push it to my local git repo.

Any thoughts or approach on how you folks do it - or may be I am just missing out something and doing it wrong!

Thanks, Dee

Deewendra Shrestha
  • 2,313
  • 1
  • 23
  • 53

3 Answers3

3

If you use ember-cli you can link your local addon in the consuming app. You can find all details in the user guide

Note that watchman doesn't observe local addon symlinked (there are couple of issues opened both on ember-cli and watchman). I've resolved removing watchman falling back to NodeWatcher (I'm on mac)

GUL
  • 1,175
  • 1
  • 13
  • 22
  • Now that I am trying your approach, and following the documentation and I am getting "'Unknown blueprint: chart-reuse" error. I did generate the blue print using "ember g blueprint chart-reuse". I do get "Could not find watchman, falling back to NodeWatcher for file system events." message too. Any suggestion? – Deewendra Shrestha Sep 21 '15 at 19:13
  • "Could not find watchman, falling back to NodeWatcher for file system events." is just a warning, you can safely ignore that. I'm sorry but I can't help you on the blueprint, I haven't used it yet – GUL Sep 21 '15 at 19:34
0

I am pretty sure the solution provided by @GUL must work too, but what worked for me was:

1) in the consuming dev app, I created a folder called addons and placed all my addon code there 2) in consuming dev app, in package.json I added :

"ember-addon": { "paths": [ "addons/ember-chart" ] }

and that worked for me!

Deewendra Shrestha
  • 2,313
  • 1
  • 23
  • 53
0

The top answer is best here. I just wanted to offer an alternative that is useful in certain situations. npm pack at root of in development addon. Then cd back to parent project. npm install ../ember-composable-helpers-2.2.0.tgz. And then check if things are working.

npm pack will create a tarball as if published on npm.

snewcomer
  • 2,020
  • 1
  • 19
  • 22