Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor - Test application using local package over the published one

I'm using Meteor 0.9.3, and I want to try to make some changes to a Meteor smart package. I'm using the package in my app already, let's call it: author:smartpackage.

First, I removed my reference to the published package:

meteor remove author:smartpackage

I've forked the repository on GitHub, and made a local clone in:

/somedir/meteor-smartpackage/

I've created a directory in my meteor app:

/meteor/myApp/packages

and created a symlink:

ln -s /somedir/meteor-smartpackage /meteor/myApp/packages/meteor-smartpackage

How do I now add this local package into my app? I've tried a variety of

meteor add xxxx

options, but I can't find the right command. Am I even close?

like image 521
Paul Ellery Avatar asked Sep 30 '14 21:09

Paul Ellery


2 Answers

The steps you described look good to me, so maybe this is the symlink stuff which is messing around.

The proper way of maintaining private packages is to have a packages/ directory somewhere in your filesystem, let's say in ~/meteor/packages, then you have to set a special environment variable that is called PACKAGE_DIRS, which is looked up by the meteor command line tool to find local packages that reside out of official package repositories.

So let's set this environment variable in your .bashrc and resource it :

echo "export PACKAGE_DIRS=$HOME/meteor/packages" >> ~/.bashrc;
. ~/.bashrc

Then assuming your forked package resides in ~/meteor/packages, meteor add author:package should work normally.

like image 109
saimeunt Avatar answered Sep 20 '22 15:09

saimeunt


Update to saimeunt's answer, for Meteor 1.2+ I found that loading the local package requires leaving out the author when running meteor add.

Loads Local Package meteor add cocos2d-meteor

Loads Remote Package meteor add jakelin:cocos2d-meteor

like image 23
Andrew Ash Avatar answered Sep 18 '22 15:09

Andrew Ash