We use npmjs.org. Make sure to set secure_rewrites to false in your CouchDB config (You can use futon for that).
- Install couchdb:
- Follow instructions in the link above for your platform.
- Start up couchdb:
Should launch on http://127.0.0.1:5984/ by default
Set up admin on couchdb: http://guide.couchdb.org/draft/security.html
Check out Futon panel for couchdb: http://127.0.0.1:5984/_utils/
- Sign in as admin:
- Click on the 'Login' link in the bottom right (kinda hard to find) and use credentials set in step 3
- Turn secure_rewrites to false:
- Go to Tools/Configuration
- Search for secure_rewrites under the section httpd
- Make sure secure_rewrites is set to false
- install couchapp
- sudo npm install couchapp -g
Clone npmjs.org: https://github.com/imhotep/npmjs.org
- Follow the "Installing" part of the readme, but don't synch from the npm registry.
- Replicate from cordova registry
- Launch the registry locally:
couchapp serve registry/app.js http://127.0.0.1:5984/registry -d www/attachments/
Use plugin-registry to interact with registry locally: https://github.com/imhotep/plugman-registry
See https://github.com/imhotep/plugman-registry/blob/master/index.js variable local_registry to make sure it's pointing in the right place
To publish a Cordova plugin. One has to specify a couple of things. As per npm, id and version <plugin> attributes are required. Everything else is optional. <name> is a human readable name and does not have to follow npm's rules (no spaces).
There are new XML tags that are pretty self explanatory: <author>, <description>, <license>, <keywords> (comma separated keywords). They help with search and discovery.
Plugman creates a package.json based on Cordova's plugin.xml which is required by npm. It stores its configuration, log file and cache in a folder named .plugman in the user's directory so that it doesn't interfere with npm's own configuration. It implements and maps the following actions:
adduser: adds a user to the registry
publish: creates a package.json based on the plugin.xml and publishes it to the registry
unpublish: unpublishes package from registry
search: searches a plugin given some keywords
fetch: fetches a plugin from cache (if present) or from registry
plugman can be pointed at any registry by running
$ plugman config set registry http://localhost:5984/registry/_design/app/_rewrite # useful for local debugging
plugman has new commands to handle adduser, publish, unpublish, search. One can install a plugin from registry by specifying the plugin_name if that plugin is not already in the Cordova project's plugins directory.
$ plugman --plugin plugin_name --project /path/to/project --platform ios
$ plugman adduser
$ plugman publish path/to/plugin
$ plugman unpublish plugin[@version]
$ plugman search keyword1[,keyword2,...,keywordn]
npm does not support download counts or popularity for packages. We might be able to add that later.