I am trying to use rajit:bootstrap3-datepicker in my project. The project page on Atmosphere list jquery as dependency of this package.
Does meteor add jquery when I run the command
meteor add rajit:bootstrap3-datepicker
or do I have to separately add jquery
meteor add jquery
Note: .meteor/packages does not show jquery as one of the added packages.
jquery is listed as a dependency in rajit:bootstrap3-datepicker package.js, this is why it will be automatically added to your app without the need to explicitly add it yourself.
.meteor/packages is only listing your app direct dependencies, not dependencies implied by the packages you're using.
You do not have to install jQuery in addition. Usually packages have their dependencies already included, so just do meteor add [package] and you are good to go.
.meteor/packages will only list dependencies specific to your app and not a package's dependency.
Related
ASP.NET has a nuget package called ReactJS.net which is capable of running Facebook React v16+ code.
I'd like to integrate Office UI Fabric, but the react package is only available as an NPM package, where I'd run
npm install office-ui-fabric-react --save
Is it possible to take the contents of this code and integrate it into ASP.NET (MVC/Core)?
Should I "do something" with the github source and add it to my code? (e.g. rename the necessary files to jsx)
Should I create a temporary node project, install the package, and manually copy data over?
Is there another way I'm not listing (a utility, etc)
I have not used the ASP.NET ReactJS.net Plugin, but from what I can gather it requires you to generate a bundle that contains all the dependencies you want to use with it and include in your ASP.net template.
To create a bundle that excludes react from the office-ui-fabric-react module, I would use webpack to build the bundle and the exclude react as a dependency bundled in the bundle.
https://webpack.js.org/configuration/externals/
So, my problem is that I am trying to add a couple of console.log() to a js file of an already installed package that I have in my project.
The package that I am trying to add these lines to is aldeed:autoform, since I've discovered kind of a bug in a function and I want to contribute with a solution.
In order to modify a package, I have already done the following steps:
Clone the github repo for autoform inside myProject/packages/ folder.
Modified the lines that I wanted to.
Changed the name value inside Package.describe({}) (set to
aldeed-autoform-modified)
Removed aldeed:autoform from my project (meteor remove
aldeed:autoform)
Added my modified version of autoform (meteor add
aldeed:autoform-modified)
The problem is that, since I am also using antoher packages that have aldeed:autoform as a dependency, this package gets automatically installed, and then when I run my project, it trhows an error saying that a template (related to AutoForm) is defined twice, and this makes sense since autoform package and the modified one have this templated defined, and both get included in the project.
What should I do? What is the proper way to modify a package that is a dependency for others?
If you want to modify an existing package, you can use a local version of it.
There is no need to modify its name, and if another package depends on it, changing the name will cause the dependent package not to use your modified version.
Simply clone the package repository into your projects's/packages directory or to the directory denoted by the METEOR_PACKAGE_DIRS environment variable.
You can find more details on the Meteor Guide.
I'm starting new app with meteor and I'm confuse when I have to install packages.
Meteor gives the possibility to install packages just like that:
meteor add <username>:<packagename>
Ok, very easy. The problem is that I would like use bower then, How I have to install the packages? For example angular.
meteor add urigo:angular
is the same as? what is the difference*? How I have to perform?
bower install angular
The logical conclusion could be use one of them, but I have seen in examples that they can be toguether.
*the package is recorded in different places, but the operation is the same?
With
meteor add <developer>:<packagename>
you add packages from the Meteor specific package database. Meteor packages are completely integrated into the Meteor eco-system and may contain both server and client side code.
You should use "meteor add" whenever possible.
To find Meteor packages you can use Atmosphere
Bower on the other hand is a framework independent package system for client side (mostly) JavaScript packages. It's not well integrated with Meteor - Although community packages exists to simplify usage of Bower packages with Meteor.
To answer you specific example:
meteor add urigo:angular
This command adds the Angular package of the Angular-Meteor project to your Meteor application. It's not only Angular but does also include some Angular services ($meteor) to provide integration of Meteor with Angular.
It even adds Angular support to the server side to some degree.
bower install angular
only downloads the official minified and non-minified javascript file of the latest Angular version for client side use.
You could use the Bower version with Angular but you wouldn't get the benefits of the integration.
While I don't use Bower myself, check out this package: https://atmospherejs.com/mquandalle/bower. I think it may help answer your question.
I want to build a meteor package to wrap an existing javascript library. I would like to include the library as a git submodule. I only need 2 files from the submodule. If I only include these two in package.js will the rest of the files be ignored by meteor and not built into the package?
The only files that will end up in your package are those that will be explicitly added with api.addFiles routine (look here).
BTW, If you're planning to wrap an existing JavaScript library then you should probably start by getting familiar with autopublish project. For more details watch this video.
I can add a package to a custom checkout of meteor as outlined in How to build a Meteor smart package
But this doesn't really work when developing with others.
I'm wondering if there's a way to do it within a project? A-la the old Rails vendor/plugins? If not, perhaps it could be something the devs might want to implement..
If you need others to use your package but you don't want your package in Meteor, then you could just fork the Meteor repo and work on your fork instead of Meteor itself. That way, the others can clone your repo instead of Meteor...