harnosoft-build
Module that help to build you node.js apps
Last updated a year ago by cypper .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install harnosoft-build 
SYNC missed versions from official npm registry.

Harnosoft-build

Npm module that helps you build your project

Install

npm install harnosoft-build

Usage

Create gulpfile.js in your project

// you should have gulp@4.0.0 in devDependencies
const gulp = require('gulp')
const Build = require('harnosoft-build').default
// here you can overwrite default config values
const config = {
  unitTestsCoverage: {
    thresholds: {
      lines: 90,
      functions: 90,
      branches: 90,
      statements: 90
    }
  }
}
const build = new Build(config)
build.initGulpTasks(gulp)

API

new Build(config)

  • config - object with user config values Create new build instance with its own configuration

build.initGulpTasks(gulp)

  • gulp - instance of gulp@4.0.0 Inits all available gulp tasks

Default config values

app:
  src: 'app/'
codeStyle:
  files: 'app/**/*.js'
  watchFiles: 'app/**/*.js'
unitTests:
  files: 'app/**/*.test.js'
  watchFiles: 'app/**/*.js'
unitTestsCoverage:
  jsFiles: 'app/**/*.js'
  testFiles: 'app/**/*.test.js'
  watchFiles: 'app/**/*.js'
  dest: 'coverage/'
  thresholds:
    statements: 80
    branches: 80
    functions: 80
    lines: 80
swagger:
  startFile: 'app/start.js'
  watchFiles: 'app/**/*.js'
compile:
  files:
    withBabel: 'app/**/*.js'
    noBabel: 'app/**/!(*.js)'
  dest: 'compiled/'
jsdoc:
  src: 'app/'
  watchFiles: 'app/**/*.js'
  dest: 'jsdocs/'
  threshold: 90
filesGlobs:
  js: '*.js'
  test: '*.test.js'
  nonJs: '!(*.js)'
  nonTestJs: '!(*.test).js'

Gulp tasks available

  • ['all'] - task runs code-style and unit-tests tasks.
  • ['compile', 'c'] - task compiles an app using babel.
  • ['code-style', 'cs'] - task checks JavaScript code with the standard syntax on files with .js extension.
  • ['code-style-fail-safe', 'cs-fail-safe'] - task the same as code-style, but it doesn't exit with an error code, in case of any code style errors
  • ['code-style-watch', 'csw'] - task watches on files (default with .js extension) and executes code-style-fail-safe task.
  • ['unit-tests', 'ut'] - task runs tests on files with .test.js endings using mocha.
  • ['unit-tests-fail-safe', 'ut-fail-safe'] - task the same as unit-tests, but it doesn't exit with an error code, in case of any task fail.
  • ['unit-tests-watch', 'utw'] - task watches on files (default with .js extension) and executes unit-tests-fail-safe task.
  • ['unit-tests-coverage', 'utc'] - task validates tests coverage on files with .test.js endings using nyc.
  • ['unit-tests-coverage-fail-safe', 'utc-fail-safe'] - task the same as unit-tests-coverage, but it doesn't exit with an error code, in case of coverage fail.
  • ['unit-tests-coverage-watch', 'utcw'] - task watches on files (default with .js extension) and executes unit-tests-coverage-fail-safe task.
  • ['swagger', 'sg'] - task validates swagger documentation.
  • ['swagger-fail-safe', 'sg-fail-safe'] - task the same as swagger, but it doesn't exit with an error code, in case of any error in docs.
  • ['swagger-watch', 'sgw'] - task watches on files (default with .js extension) and executes swagger-fail-safe task.
  • ['jsdoc', 'j'] - task generates and tests js docs with esdoc npm module.
  • ['jsdoc-fail-safe', 'j-fail-safe'] - task the same as jsdoc, but it doesn't exit with an error code, in case of any esdoc errors.
  • ['jsdoc-watch', 'jw'] - task watches on files (default with .js extension) and executes jsdoc-fail-safe task.

Current Tags

  • 0.0.6                                ...           latest (a year ago)

5 Versions

  • 0.0.6                                ...           a year ago
  • 0.0.5                                ...           a year ago
  • 0.0.4                                ...           a year ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 7
Dependencies (16)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |