Skip to content

DVS-devtools/js-utils

Repository files navigation

js-utils

Greenkeeper badge Build Status Coverage Status

Docomodigital Monorepo with all common Vanilla Js libraries.

Packages on this repo are not dependent to each other, this monorepo exists only to simplify the development process, sharing all the development tools (webpack, babel, jest, eslint...) to all the packages

Usage

This repo uses Lerna, so every lerna commands are available.

Common cli command flags

Add --stream flag to show a better formatted console output for every package process

Add a --scope [package.json name][] flag to run the command only on the specified packages

Start the Dev server for one or more packages

$ lerna run start [--stream] [--scope name]

Or:

$ cd packages/PACKAGENAME
$ npm [yarn] run start

Run the tests for one or more packages

$ npm [yarn] run test:all

Or:

$ lerna run test [--stream] [--scope name]

Or:

$ cd packages/PACKAGENAME
$ npm [yarn] run test

Other test scripts:

  • lerna [npm - yarn] run test:watch (watch files and rerun tests on file change)
  • lerna [npm - yarn] run test:open (run the tests and open the html coverage results)
  • lerna [npm - yarn] run test:coveralls (run the tests and send the coverage results to Coveralls)

Run the linter (eslint)

$ npm [yarn] run lint:all

Or:

$ lerna run lint [--stream] [--scope name]

Or:

$ cd packages/PACKAGENAME
$ npm [yarn] run lint

Build the package for release

$ npm [yarn] run build:all

Or:

$ lerna run build [--stream] [--scope name]

Or:

$ cd packages/PACKAGENAME
$ npm [yarn] run build

Generate the package docs with the current package version

$ npm [yarn] run doc:all

Or:

$ lerna run doc [--stream] [--scope name]

Or:

$ cd packages/PACKAGENAME
$ npm [yarn] run doc

Generate the package docs with the current package version in a "latest" folder

$ npm [yarn] run doc:latest:all

Or:

$ lerna run doc:latest [--stream] [--scope name]

Or:

$ cd packages/PACKAGENAME
$ npm [yarn] run doc:latest

Bump package version and publish

$ lerna publish

This will check all packages finding the ones with unpublished changes, asks for the new version and publish it (triggers the npm pre hooks)