Before all, you have to create a new library.
To make this, read the instructions reported here
When your library is ready, you can use the following grunt commands:
|grunt lint||Run es-lint to check that code respects the style guide. Single run task.|
|grunt test||Run unit test. Single run task.|
|grunt coverage||Run unit test, calculate coverage, run a local server to display the coverage report and wait. When a file is changed (in "example", "src" or "test" folder), the test re-run and the server is reloaded.
P.S. to read coverage, open "lcov-report" folder in browser.
|grunt docx||Create temporary documentation, run a local server to display it and wait. When a file is changed (in "modules" folder), the documentation is re-created and the server is reloaded.|
|grunt serve||Run a local server on "example" folder. When a file is changed (in "example" or "src" folder), the server is reloaded.|
|grunt travis||Create a new build, run unit test, calculate coverage, send coverage to coveralls, run es-lint and create a temporary documentation. (This command can be executed only on Travis; it's useful to check if build is successful).|
|grunt version||Create a new build, run unit test, calculate coverage, run es-lint, create a new version (major, minor or patch), create a new official documentation.|
We use Git flow to create a new feature or make an hotfix.
git checkout developgit checkout -b feature/newfeature
git branch -d feature/newfeaturegit push origin :feature/newfeature
? Current: 1.1.0 - Choose a new version for this library: (Use arrow keys)❯ No new versionMajor Version (2.0.0)Minor Version (1.2.0)Patch (1.1.1)
? Features for version 1.1.0 (use ";" to separate features): ()
git commit -a -m "New feature"git push origin master
git tag 2.0.0git push --tags origin
git subtree push --prefix docs origin gh-pages
To read documentation of your library, open
http://d-mobilelab.github.io/(yourlibrary)/temp replacing temp with version number.
For example, for version 1.0.0, open