Where does meteor stores its packages? - meteor

I have a meteor 1.0 app. I've added a bunch of packages, for example: meteor add kevohagan:ramda. But I cannot find it anywhere. I can't even find it on my system.
In my project:
$> meteor list
kevohagan:ramda 0.1.2 A practical functional library for Javascript programmers.
meteor-platform 1.2.0 Include a standard set of Meteor packages in your app
...
$> ls packages
ls: packages: No such file or directory
$> mdfind ramda.js # file added by the package
# no results
Where are they ?

If you add a package via meteor add author:pkg it will be added to the meteor installation (e.g. ~/.meteor/packages); here you can find different versions of the package. In your project home, the package name will be added to the .meteor/packages file.
Later, if run your project, the package will be added to the build directory (and of course only one version can be found here).

I think that they all are in
.meteor/local/build/programs/server/packages
but they are ninified, and the file names are changed, like "kevohagan_ramda.js" or "meteor-platform.js"

If you check out your project folder then you'll find two 'packages' folders. One at the root of your project and the other deep down inside .meteor. Below I've listed both of them.
.meteor/packages //this consist of the packages that you built yourself or other top-level packages like spinner & iron:router
.meteor/local/build/programs/server/packages //other packages

Related

How to completely remove renv from an R statistics program

I have been using renv on a R project, but now want to remove it from renv versioning, i.e. delete all renv associated files, but still have access to the libraries that I used installed under renv. How do I do this? Alternatively, how do I migrate from renv to packrat?
From RStudio's documentation, link provided by Kevin:
To deactivate renv in a project, use renv::deactivate(). This removes the renv auto-loader from the project .Rprofile, but doesn’t touch any other renv files used in the project. If you’d like to later re-activate renv, you can do so with renv::activate().
To remove renv from a project, use renv::deactivate() to first remove the renv auto-loader from the project .Rprofile, then delete the project’s renv folder and renv.lock lockfile as desired.
If you want to completely remove any installed renv infrastructure components from your entire system, you can do so with the following R code:
root <- renv::paths$root()
unlink(root, recursive = TRUE)
The renv package can then also be uninstalled via:
utils::remove.packages("renv")
Note that if you’ve customized any of renv’s infrastructure paths as described in ?renv::paths, then you’ll need to find and remove those customized folders as well.
Have you tried renv::isolate? That should bring over all the libraries from the renv shared cache into the local project directory? But perhaps that's not what you want to do?

How to Disable download missing package each time in meteor?

I tried to create meteor web application, but meteor download missing package each time when I change my code, and it was unnecessary.
So, can I config it only runs at the first time?
Thanks!
Could you add the actual message on the package it tries to download? Anyway, there are two potential locations where meteor looks for packages that need to be installed.
This is which each Meteor application and it's using Meteor Atmosphere packages. You can find these at .meteor folder in your project root file called packages path ./meteor/packages
Other potential place is packages.json in project root. It exists if you have used npm install or meteor npm install within the project.
Deleting unnecessary packages from these files should do the trick.

Checking constraints for a Meteor package

In order to customize a third-party Meteor package, I copied the package folder from /Users/<name>/.meteor/packages/accounts-ui-unstyled/.1.1.8.cfkrwq++os+web.browser+web.cordova/ and pasted it into the packages folder at the root of my app as accounts-ui-unstyled/.
Now when the app compiles, I get this error:
Errors prevented startup:
While selecting package versions:
error: No version of accounts-ui-unstyled satisfies all constraints: #=0.0.0, #=1.1.8
Constraints on package "accounts-ui-unstyled":
* accounts-ui-unstyled#=0.0.0 <- top level
* accounts-ui-unstyled#=1.1.8 <- top level
* accounts-ui-unstyled#1.1.8 <- accounts-ui 1.1.6
Your application has errors. Waiting for file change.
Where are these constraints being declared, and what do I need to change to get the accounts-ui-unstyled/ folder in the packages folder to be correctly identified?
Normally you would like to create a local copy of a package by cloning its repository from GitHub (provided the source is available), and not from your local file system (which holds pre-built versions of the packages).
Sometimes (as it is the case with the core Meteor packages), they are "hidden" in sub-directories of the repository.
A neat trick is to use SVN in order to quickly get a snapshot of that sub-directory:
$ mkdir packages && cd packages
$ svn export https://github.com/meteor/meteor/trunk/packages/accounts-ui-unstyled
If you want to pull from a specific branch, use
$ svn export https://github.com/meteor/meteor/branches/<branch_name>/packages/<package-name>
The constraints will be specified in the package.js file, as expected.
Note: MDG are planning to move the core packages into their own repository/repositories, so those instructions may not be valid for the core packages in the future.

Meteor packages -- how does it work?

I downloaded a Meteor Starter project called MeteorAdmin.
In the root of its directory tree, you find a packages directory that contains few packages (boostrap, comments, few others) and also, in the .meteor directory there's a file called packages that defines the dependencies of this project.
What is the difference between them? What I found interesting is that .meteor/packages contains bootstrap as well. In theory shouldn't that be enough so that bootstrap would get downloaded to the project?
The meteor packages file simply lists all of the apps dependencies as well as the load order of each (top to bottom). You can edit this file if you know what you are doing, but it's probably better to leave it alone until you are more familiar with Meteor.
The way you add packages is by typing meteor add <package-name> in your terminal and then it will be added to your project. Additionally, the name of the package will be added to the bottom of your packages file.
A meteor app can have local packages that are defined in the packages folder of the root directory. This project likely is implementing it's own bootstrap package and then added it with the meteor command I listed above. Once a local package is added to your project with the meteor add command it's package name will appear in the packages file just like packages from Atmosphere. I hope that answers your question... Let me know if you were looking for something more specific.

How to re-use an already installed package in Meteor?

I installed couple of packages for 'Project A' (e.g bootstrap) assuming that it will be available for all subsequent projects. But when a new meteor project 'Project B' was created, meteor list showed only default packages. So my assumption that meteor packages are like ruby gems available globally is incorrect. As I work offline every now and then, Is there a way I can manually copy/re-use installed packages?
Yes they are similar to gems. Packages are installed in ~/.meteor/packages, in precompiled form. They can be installed globally this way.
When you add a package to your project it will essentially copy the package from there into your build-cache directory hidden in the .meteor directory of your project.
To install a package locally where you can easily re-use it you would have to clone the github repository of the package and place the output in the /packages directory of your Meteor app.
For example for bootstrap, twbs:bootstrap you would clone this reposistory: https://github.com/twbs/bootstrap, into a directory like /packages/twbs:bootstrap (name doesn't matter if its defined in the package.js file on the repository.
In general you can easily re-use a package without the hassle of adding it in manually like so. It's better to use the global packages which are kept up to date.
The trouble comes with being offline. If you use a local package its nearly guaranteed to always work. Whereas the global ones can give a bit of trouble once in a while when you try to add a package in as meteor tries to check the package is up to date, especially where npm packages are involved with the package.
To keep it short if you added a package in using meteor add twbs:bootstrap you should most likely be able to add it to another project using the same command. Only if you keep your packages & meteor up to date.

Resources