You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
4.9 KiB

  1. ## Contributing to Mongoose
  2. ### STOP!
  3. If you have a question about Mongoose (not a bug report) please post it to either [StackOverflow](http://stackoverflow.com/questions/tagged/mongoose), our [Google Group](http://groups.google.com/group/mongoose-orm), or on the #mongoosejs irc channel on freenode.
  4. ### Reporting bugs
  5. - Before opening a new issue, look for existing [issues](https://github.com/learnboost/mongoose/issues) to avoid duplication. If the issue does not yet exist, [create one](https://github.com/learnboost/mongoose/issues/new).
  6. - Please describe the issue you are experiencing, along with any associated stack trace.
  7. - Please post code that reproduces the issue, the version of mongoose, node version, and mongodb version.
  8. - _The source of this project is written in javascript, not coffeescript, therefore your bug reports should be written in javascript_.
  9. - In general, adding a "+1" comment to an existing issue does little to help get it resolved. A better way is to submit a well documented pull request with clean code and passing tests.
  10. ### Requesting new features
  11. - Before opening a new issue, look for existing [issues](https://github.com/learnboost/mongoose/issues) to avoid duplication. If the issue does not yet exist, [create one](https://github.com/learnboost/mongoose/issues/new).
  12. - Please describe a use case for it
  13. - it would be ideal to include test cases as well
  14. - In general, adding a "+1" comment to an existing issue does little to help get it resolved. A better way is to submit a well documented pull request with clean code and passing tests.
  15. ### Fixing bugs / Adding features
  16. - Before starting to write code, look for existing [issues](https://github.com/learnboost/mongoose/issues). That way you avoid working on something that might not be of interest or that has been addressed already in a different branch. You can create a new issue [here](https://github.com/learnboost/mongoose/issues/new).
  17. - _The source of this project is written in javascript, not coffeescript, therefore your bug reports should be written in javascript_.
  18. - Fork the [repo](https://github.com/learnboost/mongoose) _or_ for small documentation changes, navigate to the source on github and click the [Edit](https://github.com/blog/844-forking-with-the-edit-button) button.
  19. - Follow the general coding style of the rest of the project:
  20. - 2 space tabs
  21. - no trailing whitespace
  22. - comma first
  23. - inline documentation for new methods, class members, etc
  24. - 1 space between conditionals/functions, and their parenthesis and curly braces
  25. - `if (..) {`
  26. - `for (..) {`
  27. - `while (..) {`
  28. - `function (err) {`
  29. - Write tests and make sure they pass (tests are in the [test](https://github.com/LearnBoost/mongoose/tree/master/test) directory).
  30. ### Running the tests
  31. - Open a terminal and navigate to the root of the project
  32. - execute `npm install` to install the necessary dependencies
  33. - execute `make test` to run the tests (we're using [mocha](http://visionmedia.github.com/mocha/))
  34. - or to execute a single test `T="-g 'some regexp that matches the test description'" make test`
  35. - any mocha flags can be specified with T="..."
  36. ### Documentation
  37. To contribute to the [API documentation](http://mongoosejs.com/docs/api.html) just make your changes to the inline documentation of the appropriate [source code](https://github.com/LearnBoost/mongoose/tree/master/lib) in the master branch and submit a [pull request](https://help.github.com/articles/using-pull-requests/). You might also use the github [Edit](https://github.com/blog/844-forking-with-the-edit-button) button.
  38. To contribute to the [guide](http://mongoosejs.com/docs/guide.html) or [quick start](http://mongoosejs.com/docs/index.html) docs, make your changes to the appropriate `.jade` files in the [docs](https://github.com/LearnBoost/mongoose/tree/master/docs) directory of the master branch and submit a pull request. Again, the [Edit](https://github.com/blog/844-forking-with-the-edit-button) button might work for you here.
  39. If you'd like to preview your documentation changes, first commit your changes to your local master branch, then execute `make docs` from the project root, which switches to the gh-pages branch, merges from master, and builds all the static pages for you. Now execute `node server.js` from the project root which will launch a local webserver where you can browse the documentation site locally. If all looks good, submit a [pull request](https://help.github.com/articles/using-pull-requests/) to the master branch with your changes.
  40. ### Plugins website
  41. The [plugins](http://plugins.mongoosejs.com/) site is also an [open source project](https://github.com/aheckmann/mongooseplugins) that you can get involved with. Feel free to fork and improve it as well!
  42. ### Sharing your projects
  43. All are welcome to share their creations which use mongoose on our [tumbler](http://mongoosejs.tumblr.com/). Just fill out the [simple submission form](http://mongoosejs.tumblr.com/submit).