### Kickstart your open-source library!
The yeoman generator itself is very easy to use (like most yeoman generators):
However, to completely set-up everything, we advise you to follow these steps:
Javasript libraries often have their names in lower case with words separated with dashes (e.g.: symmetrical-happiness). This will also be the name of your library on npm. Don't put anything in your repo, the generator will do it for you.
go somewhere convenient and set-up your workspace.
After answering a few questions, the generator will do all the dirty work for you.
While the dependencies are being installed, go to travis-ci.org, sign up for an account and add your repository to their system (More CI services will be supported in the future).
You can also register an account to codecov.io and add the repository to their service if you want to publish your code coverage and add a sweet badge to your readme.
Prepare your releasing process :
semantic-release-cli setup # in the repo folder
Important: This will release a 1.0.0 version on NPM. See below if you're not ready.
git add .git cz # commit using commitizen. Choose the 'feat' commit type for the creation of your library!git push origin master
If everything was setup correctly, many magical things will happen:
npm installand dowload the browser build on npmcdn.com.
This will release a 1.0.0 version on NPM. If your library is not yet ready, it may be better to start with a 0.1.0 version. semantic-release does not support this, so you'll have to publish this version yourself. After commiting, before pushing, change the "version" field in package.json to 0.0.0 and run this:
npm version minornpm publish
and then push including tags:
git push origin master --tags
Don't worry, this is only for the first version. You can now forget about releases, semantic-release will do it for you.
npm run testor
npm run test:with-coverage. Html coverage reports will be in the "coverage/lcov-report/" folder.
npm run test:check-coverage
npm run build:lib
npm run build:umdor minified with
npm run build:umd.min
npm run build
npm run buildwhich does the same as
npm run build:lib.
npm run clean:coverage
npm run clean:build
npm run clean
You can commit like you normally would, but you'll have to follow the angular conventional commit format. To help you do this you can use commitizen (see usage section).
Before each commit is taken into account, the tests wil be run and the coverage will be checked. If this fails, you can commit with the same message by running
git cz --retry.
The commit message is also validated to ensure you respect the format. This is important so that the semantic-release module works properly.
This generator was built with a lot of inspiration from Kent C. Dodds video series about open source libraries. You can watch it on egghead.io to better understand everything that's used with this generator.
Here is a list of options and features that are planned for the future (in approximate order of priority)