springbokjs-library v17.0.0
springbokjs-library 
:warning: After 9.0.0, springbokjs-library doesn't supports node < 3.1.0
Recommended version: node > 4.1.0 with --es_staging
How to install
With yo
npm install -g yo generator-springbokjs-library
yo springbokjs-libraryWithout
Install dependencies
npm install --save-dev springbokjs-library && npm install --save babel-runtimeEdit Makefile:
Browser lib
include node_modules/springbokjs-library/lib-browser.mkNode 5 lib
include node_modules/springbokjs-library/lib-node5.mkNode 5 And Browser lib
include node_modules/springbokjs-library/lib-node5-browser.mkInit your package
make init
# is equals to: make install-config-files install-scripts install-githooksPerfect !
You can now use make watch !
How this works
Babel and es6
Write code in es6 in the src directory, it's then transpiled with babel to lib.
Use the task make build or make watch to transpile the code.
Coding Rules
Eslint and jscs are used to ensure a common coding style. I mostly follow the Airbnb coding style except for this points:
- 4 spaces indentation (instead of 2)
- Maximum line length is 120
- Always use
{ }to delimit blocks - Don't use
void - You can declare multiple var one the same line if there are all undefined (
let i, j;) "is allowed to escape':"'hi'"is more readable than'\'hi\''
You can check the code by running the task make lint. With an editor, install the plugins to validate the code as you type !
Documentation
jsdoc allows to document the code and generate the api.
istanbul is used to generate the coverage.
You can generate the documentation with make docs, a shortcut for make api tests-coverage
Tests
Tests are in the directory tests/src, transpiled with babel to tests/lib. Use the task make tests to run the tests.
Compilation to tests/lib is done by make build or make watch.
Prefer to follow the structure in tests/src like src and tests each file.
Available tasks with make
To package manager
install-config-files: install symbolic links to.jscsrc,.jshintrc,.eslintrc,.babelrcand.npmignoreinstall-scripts: modify package.json to install npm scripts and hooksupdate: runnpm pruneandnpm install
To code
clean: removelib,tests/libanddistdirectories.build:cleanthe directory, buildsrctolib,tests/srctotests/liband thenlintthe codewatch:cleanthen build and watchsrcandtests/srcdirectorieslint: executejshint(if .jshintrc exists),jscsandeslint(if .eslintrc exists)lint-fix: executejscs -xtests: run tests with mocha (execute build/watch before if needed)docs: runapiandtests-coverageapi: generate api with jsdoctests-coverage: generate coverage documentation
Publish a new version
- npm version patch|minor|major
- npm publish
In the process, this will pre-generate a changelog based on the commits, then open nano so you can adapt it if you want.
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago