Skip to content

Latest commit

 

History

History
148 lines (109 loc) · 4.59 KB

REPOSITORIES.md

File metadata and controls

148 lines (109 loc) · 4.59 KB

Requirements for Motorcycle.js Repositories

This document aims to normalize and maintain high quality repositories for the Motorcycle.js project.

Table of Contents

Set Up a New Repository

  1. Make a new directory with the name of your new repository and navigate to the directory:

     mkdir repo-name && cd $_
    
  2. From CLI, issue:

     git init
    
  3. Create a README.md file with a title and description of the repository.

  4. Add README.md to git:

     git add -A
    
  5. Make your first commit:

     git commit -m "docs(README): initial commit"
    
  6. Tag the commit:

     git tag -f v0.0.0
    
  7. Create a development branch:

     git checkout -b develop
    
  8. On Github, choose New repository.

  9. Enter the name of the new repository.

  10. Enter a short description.

  11. Choose Create repository.

  12. From CLI:

    git remote add origin https://github.com/user/repo.git
    git push origin --all
    git push origin --tags
    
  13. Go to Travis CI and enable the new repository.

  14. Under settings, enable Build only if .travis.yml is present.

  15. On Github, navigate to the new repository and choose Settings > Branches.

  16. Change Default branch from master to develop and choose Update.

  17. Under Protected branches, choose master branch.

  18. Check Protect this branch.

  19. Check Require status checks to pass before merging.

  20. Choose Save changes.

  21. Download gh-label.sh bash script, and run it. This will create the appropriate labels for the repository. On request, supply the script with your credentials and repository name.

  22. Your done! Now, follow the guidelines below.

Testing

All repositories included in, or to be considered for inclusion, the Motorcycle.js organization must have proper tests, which cover at least basic usage of the library in question.

Preferred Testing Tools

Although not a requirement, these tools are recommended for keeping the tooling the same across Motorcycle.js repositories.

Continuous Integration

Every repository must enable continuous integration through Travis-CI with passing builds before consideration of being included into the motorcyclejs Github organization.

Here is a sample configuration for Travis-CI.

Code Style

All repositories included in Motorcyclejs must use the following to adhere to code style standards:

Optionally:

  • babel-eslint - If your project is using ES6 or Babel for transpilation.

NPM Scripts

Required:

  • eslint - for running eslint checks
  • test - for running tests
  • start - must be npm install && npm prune && validate-commit-msg
  • release-patch - for patch releases
  • release-minor - for minor releases
  • release-major - for major releases

Optional:

  • compile - for running Babel or other compilation steps
  • prepublish - should be npm run compile if compile is needed
  • test-ci - for running tests on Travis-CI if the test script above will not work for any reason.

Refer to Motorcycle-Core package.json for reference.

Dependencies

All dependencies must be locked down to specific versions to avoid unnecessary developer inconsistencies.

Required Dev Dependencies:

  • validate-commit-message : >= 3.0.1 - for npm start script

Recommended Dev Dependencies:

  • cli-release : >= 1.0.4 - for release-* scripts

Github Usage