Is there an easier way to debug ember addons - ember.js

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

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)

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!

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.

Related

NPM repo missing file

I have a git repo for an Ember Addon:
https://github.com/lifegadget/ui-responsive-toolbelt
It passes all unit tests. It has been published to npm as ui-responsive-toolbelt. I have used npm's "link" functionality to test locally that this "addon" (in Ember parlance) works fine in consuming application when included in the package.json file as a dependency.
Surprisingly, and I'm completely flummoxed on this, when npm installs this dependency into an Ember project directory it brings across a vast majority of the files without complaining. From NPM's perspective it appears to be a clean install. Unfortunately an addon depends heavily on it's "entry point" which is the index.js in the root directory of the repo. I have very clearly included this file in the repo but for some reason it is not being brough over!
I have tried this on two computers and three Ember projects and all have the same outcome. Please help!
the error message I get from Ember-CLI when I try to start the server with ember serve is:
The package ui-responsive-toolbelt is not a properly formatted package, we have used a fallback lookup to resolve it at /path/to/project/node_modules/ui-responsive-toolbelt. This is generally caused by an addon not having a main entry point (or index.js).
This message is repeated twice and then I get:
The ui-responsive-toolbelt addon could not be found at /path/to/project/node_modules/ui-list/node_modules/ui-responsive-toolbelt.
I confirmed that your repo looks fine
npm install ui-responsive-toolbelt does not download the index file
So the problem is that npm publish is not working properly. There is a bug filled for that. https://github.com/npm/npm/issues/5082
What you can do is publish again your addon using a recent npm version (or play with older versions) until you see that the index file is added too.

Is the ember cli addon installation broken in Ember Cli 0.1.11?

I'm using ember cli for some small test projects to evaluate the concepts. Normal use of ember cli works for me. After 10 created small projects and using blueprints and the pod structure I decided to try the development and usage of addons. The creation of addons was not the real problem.
The problem is I can not successfully install a created addon. I also tried to install other addons created by other ember-cli users. The result is always the same. I got no error message and the addon could be found inside the node_modules directory of the addon consuming application but there is nothing installed in the app directory and it's sub directories !!!
What can I do to find the problem ?
Do you have a public available addon which could be installed definitely without problems ?
Are there log files which could be inspected to see more details (hidden error messages) ?
Best regads
Andreas
The current Ember CLI version is 0.0.12. I'm not aware of any issues with addon installations. If the issue persist, you should create an issue on ember-cli issue tracker.

Ember CLI ember new fails on ember-cli-qunit

I've been trying to use Ember CLI to set up a new ember install, but the process keeps dying when trying to install ember-cli-qunit. I'm relatively new to using npm, bower, and ember so maybe this could just be an issue with me being dumb. Here is the dump I get when running
ember new webapp
I've been working on this for a few hours and can't really figure out how to fix the issue.
Thanks in advance
You must have ran bower as root at some point, and that would've changed the permissions of bower's cache files in your home directory (as per the error in the EACCESS line). Simply changing the permissions back to your own user (as root of course) should fix the problem.
Because of similar sudo problems driving me crazy (and the system's nodejs package being dated) I switched my setup to nvm: node version manager which installs everything to my own home directory instead and I never need to use root again for node-related installations.

Can't "ember server" but "npm start" works

Although I successfully installed ember-cli, I cannot run ember server. It said -bash: ember: command not found. But when I ran npm start, that worked.
According to the package.json file, npm start is referring to ember server.
But why didn't ember server work?
The way I fixed this problem is by running ember init in the repo, and let it override all the testing related files and skip all the files related to the project, like routes/app.js.
Oh, Yeah~
Based on your comments, it sounds like you may have installed npm or another part of the node toolchain with sudo. Here are some common ways to install the toolchain--I can say from experience that avoiding using sudo in package managers (and everything possible) is often the way to go.
Hope this helps--let us know if it was something else.

Managing npm package installation for non-web developers

I work on a project where I am the only front-end developer amongst a team of C++ developers. When we build our release variant, I want the C++ developers to run the web build process (npm install, grunt/gulp build which does concat/minification/etc...). In order for that to happen, they have to npm install all the devDependencies.
Is there a way to allow them to quickly install the necessary npm modules without having to re-download them ever time npm install is called? Or make the npm install only go through installation once?
npm link doesn't work since that links to the web application and not the node modules that the web application depends upon.
tar.gz would be possible but that means updating the tar.gz every time a node module gets updated.
Curious what development process others suggest for tacking working in a mixed language environment.
You can checkout node_modules to your git or whatever version control you're using, so they won't be downloaded every time.
Yes, someone will have to update modules once in a while, but some people (including npm itself) do just that.
You can also put a caching proxy server (i.e. sinopia) to download packages from, so downloading would be a bit faster.