17.0.0 • Published 9 years ago

springbokjs-library v17.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
9 years ago

springbokjs-library NPM version

: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-library

Without

Install dependencies

npm install --save-dev springbokjs-library && npm install --save babel-runtime

Edit Makefile:

Browser lib
include node_modules/springbokjs-library/lib-browser.mk
Node 5 lib
include node_modules/springbokjs-library/lib-node5.mk
Node 5 And Browser lib
include node_modules/springbokjs-library/lib-node5-browser.mk

Init your package

make init
# is equals to: make install-config-files install-scripts install-githooks

Perfect !

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, .babelrc and .npmignore
  • install-scripts: modify package.json to install npm scripts and hooks
  • update: run npm prune and npm install

To code

  • clean: remove lib, tests/lib and dist directories.
  • build: clean the directory, build src to lib, tests/src to tests/lib and then lint the code
  • watch: clean then build and watch src and tests/src directories
  • lint: execute jshint (if .jshintrc exists), jscs and eslint (if .eslintrc exists)
  • lint-fix: execute jscs -x
  • tests: run tests with mocha (execute build/watch before if needed)
  • docs: run api and tests-coverage
  • api: generate api with jsdoc
  • tests-coverage: generate coverage documentation

Publish a new version

In the process, this will pre-generate a changelog based on the commits, then open nano so you can adapt it if you want.

17.0.0

9 years ago

16.1.1

9 years ago

16.1.0

9 years ago

16.0.0

9 years ago

15.0.0

9 years ago

14.0.1

9 years ago

14.0.0

9 years ago

13.5.0

9 years ago

13.4.2

9 years ago

13.4.1

9 years ago

13.4.0

9 years ago

13.3.0

9 years ago

13.2.1

9 years ago

13.2.0

9 years ago

13.1.1

9 years ago

13.1.0

9 years ago

13.0.0

9 years ago

12.3.0

9 years ago

12.2.1

9 years ago

12.2.0

9 years ago

12.1.0

9 years ago

12.0.0

9 years ago

11.5.0

9 years ago

11.4.0

9 years ago

11.3.1

9 years ago

11.3.0

9 years ago

11.2.0

9 years ago

11.1.1

9 years ago

11.1.0

9 years ago

11.0.0

9 years ago

10.2.4

9 years ago

10.2.3

9 years ago

10.2.2

9 years ago

10.2.0

9 years ago

10.1.0

9 years ago

10.0.2

9 years ago

10.0.1

9 years ago

10.0.0

9 years ago

9.0.3

9 years ago

9.0.2

9 years ago

9.0.1

9 years ago

9.0.0

9 years ago

8.0.4

9 years ago

8.0.3

9 years ago

8.0.2

9 years ago

8.0.1

9 years ago

8.0.0

9 years ago

7.0.6

9 years ago

7.0.5

9 years ago

7.0.4

9 years ago

7.0.3

9 years ago

7.0.2

9 years ago

7.0.0

9 years ago

6.1.0

9 years ago

6.0.3

9 years ago

6.0.2

9 years ago

6.0.1

9 years ago

6.0.0

9 years ago

5.0.2

9 years ago

5.0.1

9 years ago

5.0.0

9 years ago

4.1.1

10 years ago

4.1.0

10 years ago

4.0.1

10 years ago

4.0.0

10 years ago

3.5.2

10 years ago

3.5.1

10 years ago

3.5.0

10 years ago

3.4.1

10 years ago

3.4.0

10 years ago

3.3.3

10 years ago

3.3.2

10 years ago

3.3.1

10 years ago

3.3.0

10 years ago

3.2.1

10 years ago

3.2.0

10 years ago

3.1.0

10 years ago

3.0.3

10 years ago

3.0.1

10 years ago

3.0.0

10 years ago

2.7.1

10 years ago

2.7.0

10 years ago

2.6.1

10 years ago

2.6.0

10 years ago

2.5.3

10 years ago

2.5.2

10 years ago

2.5.1

10 years ago

2.4.7

10 years ago

2.4.6

10 years ago

2.4.5

10 years ago

2.4.4

10 years ago

2.4.3

10 years ago

2.4.2

10 years ago

2.4.1

10 years ago

2.4.0

10 years ago

2.3.0

10 years ago

2.2.3

11 years ago

2.2.2

11 years ago

2.2.1

11 years ago

2.2.0

11 years ago

2.1.0

11 years ago

2.0.0

11 years ago

1.0.4

11 years ago

1.0.3

11 years ago

1.0.2

11 years ago

1.0.1

11 years ago