Recommended way to include javascript and css in a nupkg - npm

I have a nuget package that provides frontend as well as backend code.
Usually I'd use the content folder in my nuget structure to distribute javascript and css files to the clients.
Now, with aspnet5, the recommended way to install frontend dependencies is to use bower or npm.
My nuget package makes no sense as a standalone .net package nor as a js+css package. It'd be great if I could just add a dependency to my package and have it working.
What's the recommended way to achieve this?
Edit:
As #VictorHurdugaci said, Nuget is not a great delivery mechanism for frontend dependencies. But I need a way to build a cohesive package that my clients install it and "just works (tm)".
I could use bower, but then I'd have to remember to add the dependency to my bower.json and keep them in sync with my nupkg.
Using bower, or npm, is there a way to pack it all in a single "artifact" for clients to use?

Nuget is not a great delivery mechanism for client side assets. Use Bower or something similar instead.

Related

Is it possible to have npm get a dependency from local files but fallback to a published package?

I'm developing both an application and a package which it will depend on. I'd like to use git submodules to include the package in my dev environment and build using a published package from npm when I compile for production. What is the easiest way to achieve something like this?

Apache Ivy custom resolver

One of the projects which I work with uses Apache ivy to resolve dependencies. So far all 3rd components were deployed as Maven packages, however, now I have to get a NuGet package instead. As ivy does not support NuGet I'd like to write my own resolver. Is this possible? I've looked over the net but did not find any documentation on this.

How to ivy:install multiple modules and their sources and javadocs (i.e. everything that is ivy cache)?

So I'm creating my own ivy repository. I have went through the tutorial for building the repository and the basic task of installing one module works flawlessly. Of course, there we have examples of installing one module. Actually the ant task install can do only one module at the time. Since I'd like to store everything that's in the cache in the repository, it would be quite tedious to do that by running one module at the time...
Other then writing some kind of a build.xml generator that would have install task for each of the module I need/have, is there an easier way to do this? If there is some trick to use some kind of meta ivy.xml that has all the dependencies I need installed, that would also be ok.
In addition if I run install on one module with transitive=true, for example module M, in my repo I have M's jar,sources,javadoc and everything, but for M's dependencies - only the jars. How would I install sources,javadocs,etc of transitively dependent modules?

Packaging Php Composer inside of Nuget

Does the following make sense: sticking a Composer package (post composer install) inside of a Nuget package for deployment purposes. Or an NPM install result inside of a Nuget package?
In the context of deployment, would it not be best to deploy both types of packages?
The answer is... No, the scenarios do not make sense.
If you want to wrap up different package managers into a single whole item, use containers. Nuget is not a container system.
If you don't want to wrap them up, figure out how to deploy for each package manager and build out an appropriate deployment script.

Using gulp and bower together

I feel comfortable using Gulp for compiling scss, minifying it, minifying and concatenating scripts etc. For installing vendor libraries bower seems really nice to me due to its flat dependency tree. But when I install Gulp locally with
npm install gulp
it creates a node_modules folder with lots of different libs except Gulp itself. So I it comes to that I don't actually need bower and I may use these libs. But I really don't like npm's complicated dependency tree. Perhaps, I could somehow install only Gulp itself and use just bower for dependencies?
And what about package.json and bower.json? Do I really need both of them in the project or maybe they duplicate one another's functions? In general, I'm feeling a bit of confused with how to use bower and gulp together. Maybe someone could clarify those moments to me?
Gulp is an automated build tool you get with nodejs's package manager npm, it's used to run tasks such as concatenating, compiling sass, etc.
Bower is a dependency management tool whereby it fetches libraries, and their dependencies for your project. It does nothing but dependency management.
An example of how the two are used together would be fetching bootstrap and jquery with bower, then using gulp to copy the relevant scripts (jquery.js &bootstrap.js) to your websites assets folder.
Basically you'd use bower to fetch a library, such as jquery, then you'd use gulp to minify your jquery code.
A final example would, you use bower to fetch jquery, bootstrap, and say angularjs, you then use gulp to concatenate them into one file 'vendor.js', to save http requests in your app.
Hope those examples shine some light on how the two are used together.