Yeoman generator
Yeoman generator for creating ES6 javascript libraries with JSPM. Generated directory is configured to work with testing stack: karma-jspm, Mocha, Chai, Sinon, Travis, Sauce Labs
##Instalation
###Installing generator
npm install -g yo npm install -g generator-jspm-lib###Scaffolding library
mkdir mylib &cd mylib yo jspm-libGenerator will ask you for your GitHub username which will be used for jspm configuration.
###Set GitHub authentification to avoid GitHub rate limit:
jspm registry config github###Setup Travis with Github and Sauce Labs
We assume you have registered GitHub, NPM, Travis and Sauce Labs accounts
Install travis cli by:
gem install travis- Enable you new lib repo for travis build by running comman:
travis enable- Add travis environment variables by command line:
travis env set SAUCE_USERNAME my_sauce_user travis env set SAUCE_ACCESS_KEY my_sauce_key- Set GitHub authentification env variable to avoid GitHub rate limit in travis build:
travis env set JSPM_AUTH "$(node -pe 'JSON.parse(process.argv[1]).registries.github.auth'"$(cat ~/.jspm/config)")"- Enable NPM deployment from travis build
travis setup npmIt is recommended by jspm to release your libraries to npm endpoint. For more details see travis documentation.
##Development workflow
###JSPM linking (with watching)
gulp link###Depoly new release to NPM
gulp deploy-master###Testing
karma start##Using your library In any jspm project you can install your library with this command:
jspm install npm:REPOor make a pull request to JSPM Reigistry