0.0.6 • Published 5 years ago

harnosoft-build v0.0.6

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
5 years ago

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