Permalink
Switch branches/tags
2.8.x add-restQuery-each arbitrary-update better-dockerfile built-push-scaling cli-dotenv dependabot/npm_and_yarn/husky-1.3.0 dependabot/npm_and_yarn/winston-and-winston-daily-rotate-file fix/release-token fix/3711 gh-pages graphql greenkeeper/eslint-plugin-flowtype-3.1.0 greenkeeper/eslint-plugin-flowtype-3.1.1 greenkeeper/eslint-plugin-flowtype-3.1.2 greenkeeper/eslint-plugin-flowtype-3.1.3 greenkeeper/eslint-plugin-flowtype-3.1.4 greenkeeper/eslint-plugin-flowtype-3.2.0 greenkeeper/eslint-plugin-flowtype-pin-3.0.0 greenkeeper/flow-bin-0.84.0 greenkeeper/flow-bin-0.85.0 greenkeeper/flow-bin-0.86.0 greenkeeper/flow-bin-0.87.0 greenkeeper/flow-bin-0.88.0 greenkeeper/flow-bin-0.89.0 greenkeeper/husky-1.3.0 greenkeeper/jasmine-3.3.0 greenkeeper/jasmine-3.3.1 greenkeeper/mongodb-runner-4.4.0 greenkeeper/mongodb-runner-4.5.0 greenkeeper/mongodb-runner-4.6.0 greenkeeper/mongodb-runner-4.7.0 greenkeeper/mongodb-runner-4.7.1 greenkeeper/winston-3.0.0-rc2 greenkeeper/winston-daily-rotate-file-3.0.0 greenkeeper/winston-daily-rotate-file-3.0.1 greenkeeper/winston-daily-rotate-file-3.3.3 greenkeeper/winston-daily-rotate-file-3.3.4 greenkeeper/winston-daily-rotate-file-3.3.5 greenkeeper/winston-daily-rotate-file-3.4.0 greenkeeper/winston-daily-rotate-file-3.4.1 greenkeeper/winston-daily-rotate-file-3.5.0 greenkeeper/winston-daily-rotate-file-3.5.1 issue/5167 lighter-pointer-perms master parse-init push-overhaul-again readme-logging refactor-auth-adapters revert-4240-schema-index revert-4412-fix-4411-failing-localtime-tests role-basedACLs windows-scripts
Nothing to show
Find file Copy path
74 lines (49 sloc) 4.18 KB

Contributing to Parse Server

We really want Parse to be yours, to see it grow and thrive in the open source community.

If you are not familiar with Pull Requests and want to know more about them, you can visit the Creating a pull request article. It contains detailed informations about the process.

Setting up the project for debugging and contributing:

Recommended setup:

  • vscode, the popular IDE.
  • Jasmine Test Explorer, a very practical test exploration plugin which let you run, debug and see the test results inline.

Setting up you local machine:

  • Fork this project and clone the fork on your local machine:
$ git clone https://github.com/parse-community/parse-server
$ cd parse-server # go into the clone directory
$ npm install # install all the node dependencies
$ code . # launch vscode
$ npm run watch # run babel watching for local file changes

Once you have babel running in watch mode, you can start making changes to parse-server.

Good to know:

  • The lib/ folder is not commited, so never make changes in there.
  • Always make changes to files in the src/ folder.
  • All the tests should point to sources in the lib/ folder.

Troubleshooting:

Question: I modify the code in the src folder but it doesn't seem to have any effect.
Answer: Check that npm run watch is running

Question: How do I use breakpoints and debug step by step?
Answer: The easiest way is to install Jasmine Test Explorer, it will let you run selectively tests and debug them.

Question: How do I deploy my forked version on my servers?
Answer: In your package.json, update the parse-server dependency to https://github.com/MY_USERNAME/parse-server#MY_FEATURE. Run npm install, commit the changes and deploy to your servers.

Please Do's

  • Begin by reading the Development Guide to learn how to get started running the parse-server.
  • Take testing seriously! Aim to increase the test coverage with every pull request. To obtain the test coverage of the project, run:
    • Windows: npm run coverage:win
    • Unix: npm run coverage
  • Run the tests for the file you are working on with the following command:
    • Windows: npm run test:win spec/MyFile.spec.js
    • Unix: npm test spec/MyFile.spec.js
  • Run the tests for the whole project to make sure the code passes all tests. This can be done by running the test command for a single file but removing the test file argument. The results can be seen at <PROJECT_ROOT>/coverage/lcov-report/index.html.
  • Lint your code by running npm run lint to make sure the code is not going to be rejected by the CI.
  • Do not publish the lib folder.

Run your tests against Postgres (optional)

If your pull request introduces a change that may affect the storage or retrieval of objects, you may want to make sure it plays nice with Postgres.

  • Run the tests against the postgres database with PARSE_SERVER_TEST_DB=postgres npm test. You'll need to have postgres running on your machine and setup appropriately

  • The Postgres adapter has a special debugger that traces all the sql commands. You can enable it with setting the environment variable PARSE_SERVER_LOG_LEVEL=debug

  • If your feature is intended to only work with MongoDB, you should disable PostgreSQL-specific tests with:

    • describe_only_db('mongo') // will create a describe that runs only on mongoDB
    • it_only_db('mongo') // will make a test that only runs on mongo
    • it_exclude_dbs(['postgres']) // will make a test that runs against all DB's but postgres

Code of Conduct

This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to honor this code.