Want to contribute to PouchDB Server? Great, you've come to the right place! This document contains everything you need to know to get started building, testing, and publishing the code.
PouchDB Server is a monorepo, containing the packages pouchdb-server
and express-pouchdb
. It follows the same format as the PouchDB monorepo, using the alle monorepo setup. You can read more about monorepos here and here.
Conceptually pouchdb-server
is a standalone CouchDB-esque server, whereas
express-pouchdb
is designed to be injectable into an existing Express app.
pouchdb-server
uses express-pouchdb
under the hood.
One of the primary benefits of pouchdb-server is the ability to run PouchDB's Node test suite against itself. To do that, you can simply,
$ npm run test-pouchdb
Whatever args you provide as SERVER_ARGS
will be passed to pouchdb-server
itself:
$ SERVER_ARGS='--in-memory' npm run test-pouchdb
Or to test in Firefox (IndexedDB):
$ CLIENT=selenium:firefox npm run test-pouchdb
Or to test in PhantomJS (WebSQL):
$ CLIENT=selenium:phantomjs ES5_SHIM=true npm run test-pouchdb
Additionally, we've started porting CouchDB's JavaScript test harness to a simple Node module, which can be run against PouchDB via pouchdb-server.
$ npm run test-couchdb
Want to help me make this thing awesome? Great! Here's how you should get started.
- First, check whether your bugfix must be in
express-pouchdb
orpouchdb-server
. - Make your changes on a separate branch whose name reflects your changes,
- Run all tests to make sure your changes do not break anything
- To create a PR, push your changes to your fork, and open a pull request!
- For a PR, follow the commit message style guidelines inPouchDB CONTRIBUTING.md.
pouchdb-server
is a monorepo, meaning that when you publish, you need to publish all packages simultaneously. Versions are kept in sync across packages, for simplicity's sake.
Release process:
npm version patch | minor | major
to change the version in the top-levelpackage.json
, which will apply to all packages in the release scriptgit push origin master --tags
npm run release
This will search through all the sub-packages and automatically figure out the correct dependencies
and optionalDependencies
. To add a new dependency, just add it to the top-level package.json
and it will be identified at release time.