If you have a bugfix or new feature that you would like to contribute to elasticsearch.js please feel free to submit a pull request, or open an issue for discussion. If your change is adding new functionality, you should open an issue before writing any code.
The process for contributing to any of the Elasticsearch repositories is similar.
While developing, be sure to run eslint on the files you modify.
Please write test cases to exercise your changes.
- Install dev dependencies.
npm install
- Install Grunt.
npm install -g grunt-cli
- Run the tests. Testing the code will lint the project, run the unit tests, install local versions of elasticsearch, and run the integration tests using those installations.
grunt test
Or to skip the integration tests:
grunt unit_test
- Optionally, run the browser tests. While this step is automated and simple, it can take several minutes for the tests to complete. Unless you are making changes to browser specific portions of the code you can probably let Travis run the browser tests for you.
Quick Option: Run them locally in your browser
grunt browser_clients:build
node ./test/utils/server
# open http://127.0.0.1:8000/unit.html
# open http://127.0.0.1:8000/builds.html
Run them on Sauce Labs across several browsers, operating systems, and browser versions
grunt browser_clients:test
Push your local changes a forked copy of the repository and submit a pull request. In the pull request, describe what your changes do and be sure to link to any conversations regarding this implementation, eg "Closes #123".
Please make sure you have signed the Contributor License Agreement. We are not asking you to assign copyright to us, but to give us the right to distribute your code without restriction. We ask this of all contributors in order to assure our users of the origin and continuing existence of the code. You only need to sign the CLA once.
There will probably be discussion about the pull request and we will work with you if any changes are needed.
To automatically regenerate elasticsearch-js from elasticsearch master, run the following command:
npm run generate
Before you attempt to release a new version, make sure you have AWS credentials in the root of this project in the following format:
{
"key": "YOUR_AWS_ACCESS_KEY_ID",
"secret": "YOUR_AWS_SECRET_ACCESS_KEY"
}
Also, make sure you have been added as a contributor on npm for both elasticsearch and elasticsearch-browser.
grunt version:12.0.0-rc4
After bumping the version, commit and push the changed files.
npm publish [--tag prerelease]
grunt browser_clients:release
If this is a prerelease, you will need to modify the elasticsearch-browser
npm tags
npm dist-tag add [email protected] latest
npm dist-tag add [email protected] prerelease
Voila! You're all finished.