Ember package.json: dependencies vs devDependencies - ember.js

What is the difference of having the packages under the dependencies or devDependencies in the package.json?
How does that impact in the final build?
Sounds quite simple, but I don't have it clear to which packages to put in each section. Even similar addon's documentations vary as well, some say to use --save and others --save-dev, which confuses me.

In an ember app all your dependencies will go under devDependencies since you build the app via the ember cli and you do not include the app in another project.
For addons the story is a bit different, if your addon exposes any functionality from a package then that package has to be under dependencies.

Take a look in your package.json file and you will see two types of dependencies. One is called devDependencies(usually modules needed for local development) and one is called dependencies (dependencies used in production or that are integral to the given project). The --save flag adds your dependencies to the dependencies object of your package.json file and --save-dev adds your dependencies to the devDependencies. They're separated for convenience.
Edit:
This question has been answered before, but the tldr; is, it doesn't affect your production build. Hope that this helps.

Related

How to avoid listing dependencies twice when packaging with Conan?

I'm currently trying to package a project as a Conan package. This project manages its dependencies with Conan itself already and as such has a conanfile.txt which lists its dependencies. I'm doing it in-repo following how the documentation suggests doing it.
Now I would like to package this project but I can't figure out what the proper way to simply let that conanfile.txt be the reference for the project's dependencies, and if it's possible to leverage the fact that it's already there instead of re-listing all the dependencies in the conanfile.py. I could skip it by just removing the conanfile.txt and using the conanfile.py as a consumer, but that forces a more complex handling of the actual build() step in the recipe which I would like to avoid. I would also like to let the people that develop the library be able to build it the way they would prefer, not necessarily through Conan except for the dependency management.
Is there a way to fetch a project dependencies from within the Conan recipe instead of listing twice the dependencies, both in the conanfile.txt and in the requires variable of the Conan recipe? If possible I would like to avoid reading the conanfile.txt and manually feeding line by line the dependencies into the requires variable.
I'm aware that I might be looking for a way that doesn't fit Conan's design and/or how packaging should work in general.
You can use conanfile.txt, but I strongly recommend using conanfile.py instead.
You can run conan install . as well, and install all dependencies listed in the conanfile.py. As the command install will not run your build() section, I can't see the problem.
Anyway, you can create a base class in conanfile.py which loads the conanfile.txt content and filter the requirements. Oblivious, it sounds be more complex than using only conanfile.py.
In terms of feature, there is no way, Conan doesn't load both files. By default it will conanfile.py and ignores conanfile.txt. You can't force both by argument or variables.

Can Leiningen recursively download the dependencies of its checkout dependencies?

Checkout dependencies can be used to add another work-in-progress project to your Leiningen project during development (for example: you're developing an app and underlying library in parallel).
However, when a checkout dependency itself has a "traditional" dependency (from Clojars), running lein run in the parent project will throw a java.io.FileNotFoundException since it apparently does not retrieve the "traditional" dependencies of its checkout dependencies.
Is there a way to let a Leiningen project recursively download the dependencies of its checkout dependencies?
My opinion of the "proper" way to do this is to have your project depend on the library in your checkouts directory as a traditional dependency in addition to having it in your checkouts directory.
Then every time you change dependencies, run lein install in your library project. This will cause lein to generate the appropriate jar file and install it into your local maven repo. It does not matter if this library project is finished, because you are not actually running it in this state, just using it to fetch dependencies.
Then when it does work you don't have to do anything to "switch to production" other than remove your checkouts directory. The dependency is already in place in the dependent project.
There is a side effect of using checkouts to work on libraries in that the code is loaded twice. Once from the "depended on" version, and then again from the "checkouts version". This is very occationally a problem for me when I'm using protocols and have to remember to re-load the protocol definition.

how to install highcharts with bower

I am starting a new Ember-CLI project. And I want to install HighCharts with bower.
How do I do this?
I have read two posts about this.
The first one tells me to:bower install highcharts.com
Unfortunately the install hangs and eventually crashes
The second post tells me to: bower install https://github.com/highslide-software/highcharts-release
But this only seems to install a bower.json and an index file... but no js files?
In this specific case, can I just manually place the highcharts.js into my own vendor folder... update brocfile and just forget bower for now? Is there any downside to this?
I have found that the unzipping of highcharts.com does take way longer than any other repo, but it should succeed eventually. There is also highcharts-release, which you mentioned. You should be able to just enter the following,
bower install highcharts-release
Once that installs you should have the files highcharts.js and highcharts.src.js at your disposal.
Try using the keyword -- highcharts-release instead of the full path.
highcharts-release contains way fewer files, which should resolve your issue.
If you use your own vendor folder, it will be harder to update to newer releases in the future, I would not recommend it unless using bower is really impossible, which is somewhat doubtful.
Another way to update the bower.json and install it via CLI from the project directory.
bower install

RequireJS and Bower dependencies

I'm Using Bower to install dependencies and using RequireJS's r.js.
But when using r.js to build, all of the bower-components are also included (tests, docs, non-minized js etc). As it's nice to have tests included with each components in my dev directory, I find it a hassle to deal with when using r.js.
How would I setup a app.build.js file for r.js, that only includes the needed dependencies?
There is an option skipDirOptimize which should do what you want.

Using Maven 1.x without extra plugins, how does someone build an executable jar?

Using Maven 1.x with just the bundled/standard plugins, what configuration is necessary to build an executable Jar?
Answers should cover:
including dependencies in target Jar
proper classpath configuration to make dependency Jars accessible
Well the easiest way is to simply set the maven.jar.mainclass property to the main class you'd like to use.
As far as setting up the manifest classpath you can use maven.jar.manifest.classpath.add=true to have maven automatically update the classpath based on the dependencies described in the project.xml.
Disclaimer: It's been a long time since I've used Maven 1 and I did not test any of this out, but I'm pretty sure this will get you started in the right direction. For more information check out the jar plugin docs.