How to clone Ionic project to production - plugins

I have an Ionic Project, with all plugins, and libs and I am a little lost on how to manage so many plugins and libs.
Sometimes I install a plugin, test and after that install a couple of other plugins, and so on. After some time, I have so many plugins and I donĀ“t remember what are useful and what are not useful.
So, I would like to create another folder with a fresh version of my project, with only the necessary plugins and libs.
I am now using gulp to minify and uglyfy my code, and I will put all my minified files in this new folder.
So, my questions are:
Is there a simple way to verify what are the plugins and libs really necessary, without need to see it one by one ?
Is there a way to clone all my original project to another one, after I have already cleaned up the original folder ?
Thanks.

when you adding a plugin, you should call
ionic plugin "plugin-name" --save
it will save plugin information to your config.xml and package.json
next time, when your run ionic build, if plugins not install, it will auto install necessary plugins.
about npm module, you should call npm install "package-name" --save-dev to save your develop module, like gulp
in new project, you just copy the package.json and change project name and information, then call npm install, it will install the saved module.

Related

Install a github repository as a library through a script file

I am trying to remove the libraries folder in an Arduino project I am working on and install them through a script file. The issue with some of the libraries is that they seem to not be officially registered, so you can't use the arduino-cli lib install for them. Most of them are on github, so I am looking for a way to install them in a similar fashion as arduino-cli lib install, so they can all be neatly in one script file. I am slightly new to github and I am not sure if there is a way through which this is achievable.

Bower package not found - necessary to use npm as well?

I'm new to Bower, and I'm setting up a dummy project. I have initialised my project and installed jQuery and gulp just to get things started. This is fine, they have been added to my dependencies list in bower.json and are now present in my bower_modules folder. Great so far.
However, I want to install two plugins: main-bower-files and gulp-filter, but bower doesn't seem to have these libs.
When I run bower install --save main-bower-files, I get:
bower ENOTFOUND Package main-bower-files not found
So, it seems my only solution is use npm instead. But surely bower is supposed to be an alternative to npm, right?
Or is the only solution just to npm init as well as bower init at the start of the project, and then run two lists of separate dependencies?
Any help appreciated.
Actually, Bower and NPM have slightly different aims.
In my experience, Bower focuses mainly on frontend packages (jQuery, CreateJS, ...). See it as an alternative of using an external CDN for certain resources. NPM, however, has most of those packages on Bower, and then a large selection of packages for the backend, as well.
You would indeed need to keep two separate dependency lists, if you need packages from both repositories. Using those two managers in tandem is actually not that uncommon.
Be sure to install gulp and its modules through NPM, since they are definitely not frontend resources.
TLDR: Bower = frontend resources that you could have also hosted on a CDN, NPM = everything from frontend to backend and more.

How to include leaflet-pip in ionic. Manually, bower or with browserify?

Right now in my ionic project I added manually the leaflet-pip.min.js file in www/lib/leaflet-pip/
I would like to do it with bower or with browserify. Documentation says:
npm install leaflet-pip
It is installed in node_modules/leaflet-pip directory but what else do I have to do, shouldn't those files be copied (automatically) to www/lib/leaflet-pip so thus I can add to my index.html the path to leaflet-pip.min.js

Manage dependencies of ionic project - Github

I am working on an ionic project which needs to be shared with multiple developers using Github. We are not syncing the following folders to github, so they are part of the .gitignore file
plugins/
www/lib/
How would a new developer (who gets the app from github) would manage the dependencies that are part of these folders.
If I do 'ionic state restore' from the terminal then it fetches all the cordova plugins that are part of package.json. So, this takes care of the 'plugins/' folder.
However, www/lib folder is still empty. What do I need to do to get all the ionic/angular related javascript files that reside in the www/lib folder.
(Assuming the you have both bower and npm installed, if not follow these links to get your setup done: npm, bower)
Ionic uses bower as its library package manager. Run these commands after you clone the project from github:
npm install (refers package.json to install plugins)
bower install (referes bower.json to install libs)
Hope it was helpful, Happy coding. :)

How to put Nuget libraries on a folder

i generally add any library from Nuget to my project like issuing this command
Install-Package Mvc3Futures
then i have seen everything related to that library just added in my project. some one told me that library can be added to folder and later we can add that folder to my project like this way tools > options > package manager - add your folder .
really i have no idea how we can add library to any folder from Nuget. if it is possible then please show me the way in step-by-steps. thanks
I cannot give you a step-by-step, but you can relocate/specify the place of the packages folder: Is it possible to change the location of packages for NuGet?. But this way all of your packages location will change, I don't think you can do that per package. During installation you can specify where you install the package from (but not to): http://docs.nuget.org/docs/reference/command-line-reference, see Install Command.