Read the general Contributing Guide.
dist/
- Contains final build files for distributiondoc/
- Output folder for JSDocssrc/
- Project source codetest/
- Project tests
clone [email protected]:js-data/js-data-sql.git
cd js-data-sql
npm install
npm run build
- Lint and build distribution filesnpm run mocha
- Run tests (A compatible sql server must be running)
- Contribute to the issue/discussion that is the reason you'll be developing in the first place
- Fork js-data-sql
git clone [email protected]:<you>/js-data-sql.git
cd js-data-sql; npm install;
- Write your code, including relevant documentation and tests
- Run
npm test
(build and test)
- You need Node 4.x that includes generator support without a flag
- The tests expect a database to be running as follows, but can be overridden by passing the applicable environment variable as indicated (ex.
DB_HOST=192.168.99.100 npm test
).DB_HOST
:localhost
DB_NAME
:circle_test
DB_USER
:ubuntu
- You may use
docker
/docker-compose
to create MySql and Postgres containers to test againstdocker-compose up -d
- Start containers named
js-data-sql-mysql
andjs-data-sql-pg
- Start containers named
- MySQL
- Environment variables
DB_CLIENT
=mysql
DB_USER
=root
DB_HOST
=IP of docker-machine if not localhost
- Populate schema
DB_CLIENT=mysql DB_USER=root npm run migrate-db
- Also set
DB_HOST
if different fromlocalhost
- Run tests
npm run mocha-mysql
- Set
DB_HOST
if different fromlocalhost
- Set
- Run cli
docker exec -it js-data-sql-mysql mysql circle_test
- Environment variables
- Postgres
- Environment variables
DB_CLIENT
=pg
DB_USER
=ubuntu
DB_HOST
=IP of docker-machine if not localhost
- Populate schema
DB_CLIENT=pg npm run migrate-db
- Also set
DB_HOST
if different fromlocalhost
- Run tests
npm run mocha-pg
- Also set
DB_HOST
if different fromlocalhost
docker exec -it js-data-sql-pg psql -U ubuntu -d circle_test
- Run cli
- Environment variables
- All databases
- Run all tests against MySQL and Postgres
npm run mocha-all
- Also set
DB_HOST
if different fromlocalhost
- Run all tests against MySQL and Postgres
- Your code will be linted and checked for formatting, the tests will be run
- The
dist/
folder & files will be generated, do NOT commitdist/*
! They will be committed when a release is cut. - Submit your PR and we'll review!
- Thanks!
- Checkout master
- Bump version in
package.json
appropriately - Update
CHANGELOG.md
appropriately - Run
npm run release
- Commit and push changes
- Checkout
release
, mergemaster
intorelease
- Run
npm run release
again - Commit and push changes
- Make a GitHub release
- tag from
release
branch - set tag name to version
- set release name to version
- set release body to changelog entry for the version
npm publish .
See also Community & Support.