Read the general Contributing Guide.
dist/- Contains final build files for distributiondoc/- Output folder for JSDocssrc/- Project source codetest/- Project tests
clone git@github.com:js-data/js-data-sql.gitcd js-data-sqlnpm installnpm 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 git@github.com:<you>/js-data-sql.gitcd 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:localhostDB_NAME:circle_testDB_USER:ubuntu
- You may use
docker/docker-composeto create MySql and Postgres containers to test againstdocker-compose up -d- Start containers named
js-data-sql-mysqlandjs-data-sql-pg
- Start containers named
- MySQL
- Environment variables
DB_CLIENT=mysqlDB_USER=rootDB_HOST=IP of docker-machine if not localhost
- Populate schema
DB_CLIENT=mysql DB_USER=root npm run migrate-db- Also set
DB_HOSTif different fromlocalhost
- Run tests
npm run mocha-mysql- Set
DB_HOSTif different fromlocalhost
- Set
- Run cli
docker exec -it js-data-sql-mysql mysql circle_test
- Environment variables
- Postgres
- Environment variables
DB_CLIENT=pgDB_USER=ubuntuDB_HOST=IP of docker-machine if not localhost
- Populate schema
DB_CLIENT=pg npm run migrate-db- Also set
DB_HOSTif different fromlocalhost
- Run tests
npm run mocha-pg- Also set
DB_HOSTif 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_HOSTif 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.jsonappropriately - Update
CHANGELOG.mdappropriately - Run
npm run release - Commit and push changes
- Checkout
release, mergemasterintorelease - Run
npm run releaseagain - Commit and push changes
- Make a GitHub release
- tag from
releasebranch - 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.