Skip to content

Create a new Repository on GitHub

Kitson Kelly edited this page Dec 15, 2017 · 8 revisions

NOTE This is an internal document for setting up a new repository as part of the Dojo organisation.

Creating the initial repository

In most cases you should be copying the HEAD of master of dojo/dojo2-package-template. This contains the scaffold of what should go in the repo. Be kind, and if you find an issue with the template, raise an issue or a PR so others can learn from your sage wisdom.

Once you have it cloned, it is best to reset the repo so none of the commit history of the template comes over to the new repo:

$ cp -r dojo2-package-template my-awesome-package
$ cd my-awesome-package
$ rm -rf .git
$ git init .
$ git add .

You should ensure that the new package name is reflected in the following files:

  • /package.json
  • /README.md
  • /tests/intern.ts

Add the appropriate Breowserstack or Saucelabs credentials to /.travis.yml.

Once you have edited the package.json you should be able to do an npm install which should add the appropriate package tooling. Then grunt, grunt test and grunt dist should work.

Adding on GitHub

You need dojo organisational admin rights to setup a new repo.

Go to the organisational page, and click the New repository button. Enter the name on the next page. Add a description that matches the description used in the package.json and README.md. Do not choose to initialise the repository.

You can now push the repository that your created:

$ git remote add origin [email protected]:dojo/my-awesome-package.git
$ git push -u origin master

Refreshing the GitHub page for the repo should provide you with the repo.

Go into the settings tab and adjust the following settings:

  • Options -> Features -> Wikis - disable this
  • Options -> Features -> Merge Button - disable this
  • Collaborators & Teams - add the Dojo 2 Committers team with Admin access
  • Webhooks
    • Add https://webhooks.gitter.im/e/f117a5b2933baacadb84 as application/json with Issues, Pull Requests, Push ticked
    • Add https://hooks.slack.com/services/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 as application/json with an appropriate amount of information being sent.

Setting up CI

Travis settings are determined by your repo rights and you need admin rights on the repo in question.

  • Go to the Travis Dojo Profile page (if you can't access this, you don't have the proper rights).
  • You will likely have to Sync account to have Travis pick up the newly created repo.
  • Should then be able to toggle the build on for the repo.
  • Select the settings icon to the right of the toggle.
    • Enable Build only if .travis.yml is present
    • Enable Limit concurrent jobs and set to 1
    • Enable Auto cancel branch builds
    • Enable Auto cancel pull request builds

On the next push to the repo, Travis CI could complete

TODO Add information about Appveyor for NodeJS packages.

Setting up on CodeCoverage

This should generally be an automatic process.

Integration with ZenHub

Ensure that you have the ZenHub plugin added to your browser and that you are logged into ZenHub. Then navigate to the main meta boards.

Click on the Repos dropdown:

Repos Button

Scroll to the end and find the Add a Repo + link. Choose the repository to merge.

Adding to dojo/meta

You should update the dojo/meta/README.md with appropriate information about the package. Also, you should add the package to dojo/meta/data/packages.json, which will ensure that applications that depend on this information are updated correctly.

Also, update the markdown in GitHub Helpers wiki page with the repo.

Publishing to NPM

For publishing to NPM the first time, you should use the following command:

$ grunt release --pre-release-tag=<<APPROPRIATE TAG>> --initial --push-back