Home Reference Source Repository

Function

Static Public Summary
public

Configure CORS settings for Azure Storage.

public

Build js, css, images.

public

Build, lint and minify css.

public

Copy the images (jpg,png,gif,svg) inside imagesPath to a temp folder and compress them.

public

Upgrade version inside package.json and web.config ([OPT-IN]) according semver.

public

Delete and recreate folders This task could be called directly

public

Build, lint and minify css.

public

Upload JavaScript, Css and images to storage.

public

getNewVersion(newVersionType: String, version: String): String

Increment the string version accorging semver

public

getWebpackConfig(config: *, dev: boolean): *

public

lessTaskAsync(objectPattern: {"config": *, "minify": *}): *

public

Lint JavaScript files This task could be called directly

public

Copy JavaScript files inside tools folder after installation This task could be called directly

public

run(fn: Function, options: Object): Promise

Run a promise with some timings

public

sassTaskAsync(objectPattern: {"config": *, "minify": *})

public

up()

public

Update web.config with CSS and JS files hash.

public

upload(objectPattern: {"config": *, "env": *})

public

Watch JavaScript (via webpack), less/sass folder.

public

Lint, transpile and minify Js files via webpack.

public

wp(config: *): *

public

wp(config: *): *

Static Public

public azureStorage(): Promise source

import azureStorage from 'deployment-tools/src/azure-storage.js'

Configure CORS settings for Azure Storage. You can change the settings using azure-storage-settings.json file. We use the the azure remote service as data validator, so if there is something wrong in the settings we display the error in the response. This task could be called directly

Return:

Promise

A Promise

Example:

run this on your terminal
node src/run azureStorage

public build(): Promise source

import build from 'deployment-tools/src/build.js'

Build js, css, images. This task could be called directly

Return:

Promise

A Promise

Example:

run this on your terminal
node src/run build

public buildCss(obj: object): Promise source

import buildCss from 'deployment-tools/src/buildCss.js'

Build, lint and minify css. This task could be called directly

Params:

NameTypeAttributeDescription
obj object
  • optional

obj

obj.config object

The config Object

obj.cleaned boolean
  • optional
  • default: false

Already performed the cleaning phase

Return:

Promise

A Promise

Example:

run this on your terminal
node src/run buildCss

public buildImages(obj: object): Promise source

import buildImages from 'deployment-tools/src/buildImages.js'

Copy the images (jpg,png,gif,svg) inside imagesPath to a temp folder and compress them. This task could be called directly

Params:

NameTypeAttributeDescription
obj object
  • optional

obj

obj.config object

The config Object

obj.cleaned boolean
  • optional
  • default: false

Already performed the cleaning phase

Return:

Promise

A Promise

Example:

run this on your terminal
node src/run buildImages

public bump(): Promise source

import bump from 'deployment-tools/src/bump.js'

Upgrade version inside package.json and web.config ([OPT-IN]) according semver. This task could be called directly

Return:

Promise

A Promise

Example:

run this on your terminal
node src/run bump

public clean(obj: object): Promise source

import clean from 'deployment-tools/src/clean.js'

Delete and recreate folders This task could be called directly

Params:

NameTypeAttributeDescription
obj object
  • optional

obj

obj.config object

The config Object

Return:

Promise

A Promise

public compileStylesheetAsync(obj: object): Promise source

import compileStylesheetAsync from 'deployment-tools/src/utils/css.js'

Build, lint and minify css.

Params:

NameTypeAttributeDescription
obj object
  • optional

obj

obj.srcFolder string

The folder that contains the file

obj.filename string

The name of the file (main.less/main.sass)

obj.outputFolder string

The output folder

obj.cdnDomain string

The domain (with http://) of the CDN

obj.minify boolean
  • default: false

Compile a minified version of the file

obj.engine string

Which engine to use less/sass

obj.projectName string

The name of the project

obj.stylelintrc string
  • optional

Relative path of the configuration file for stylelint

obj.styledocPath string

Relative path for the documentation output

obj.doiuseRules string
  • default: ''

Browser to check with doiuse

obj.autoprefixerRules string
  • default: ''

Browser to autoprefix

Return:

Promise

A Promise

public deploy(): Promise source

import deploy from 'deployment-tools/src/deploy.js'

Upload JavaScript, Css and images to storage. This task could be called directly

Return:

Promise

A Promise

Example:

run this on your terminal
node src/run deploy

public getNewVersion(newVersionType: String, version: String): String source

import getNewVersion from 'deployment-tools/src/libs/version.js'

Increment the string version accorging semver

Params:

NameTypeAttributeDescription
newVersionType String

A string that contains the new version type

version String

The actual version

Return:

String

The new version accorging to newVersionType

public getWebpackConfig(config: *, dev: boolean): * source

import getWebpackConfig from 'deployment-tools/src/utils/webpack-helper.js'

Params:

NameTypeAttributeDescription
config *
dev boolean
  • optional
  • default: false

Return:

*

public lessTaskAsync(objectPattern: {"config": *, "minify": *}): * source

import lessTaskAsync from 'deployment-tools/src/utils/less.js'

Params:

NameTypeAttributeDescription
objectPattern {"config": *, "minify": *}
  • optional
  • default: {}

Return:

*

public lint(obj: object): Promise source

import lint from 'deployment-tools/src/lint.js'

Lint JavaScript files This task could be called directly

Params:

NameTypeAttributeDescription
obj object
  • optional

obj

obj.config object

The config Object

Return:

Promise

A Promise

Example:

run this on your terminal
node src/run lint

public postinstall(): Promise source

import postinstall from 'deployment-tools/src/postinstall.js'

Copy JavaScript files inside tools folder after installation This task could be called directly

Return:

Promise

A Promise

public run(fn: Function, options: Object): Promise source

import run from 'deployment-tools/src/run.js'

Run a promise with some timings

Params:

NameTypeAttributeDescription
fn Function

A function async to generator

options Object
  • optional

The option to pass to promise

Return:

Promise

A Promise

public sassTaskAsync(objectPattern: {"config": *, "minify": *}) source

import sassTaskAsync from 'deployment-tools/src/utils/sass.js'

Params:

NameTypeAttributeDescription
objectPattern {"config": *, "minify": *}
  • default: {"config":null,"minify":null}

public up() source

public updateWebconfigChunk(obj: object): Promise source

import updateWebconfigChunk from 'deployment-tools/src/utils/webconfig-chunk.js'

Update web.config with CSS and JS files hash.

Params:

NameTypeAttributeDescription
obj object
  • optional

obj

obj.longTermHash object
  • optional

Return if long term hash is false

obj.webConfig string

Relative path of webconfig

obj.outputPath string

Relative path of build js folder. In this folder there's webpack-manifest.json file

Return:

Promise

A Promise

public upload(objectPattern: {"config": *, "env": *}) source

import upload from 'deployment-tools/src/upload.js'

Params:

NameTypeAttributeDescription
objectPattern {"config": *, "env": *}
  • optional
  • default: {}

public watch(obj: object): Promise source

import watch from 'deployment-tools/src/watch.js'

Watch JavaScript (via webpack), less/sass folder. This task could be called directly

Params:

NameTypeAttributeDescription
obj object
  • optional

obj

obj.config object

The config Object

Return:

Promise

A Promise

public webpack(obj: object): Promise source

import webpack from 'deployment-tools/src/buildJs.js'

Lint, transpile and minify Js files via webpack. This task could be called directly

Params:

NameTypeAttributeDescription
obj object
  • optional

obj

obj.config object

The config Object

obj.cleaned boolean
  • optional
  • default: false

Already performed the cleaning phase

Return:

Promise

A Promise

Example:

run this on your terminal
node src/run buildImages

public wp(config: *): * source

Params:

NameTypeAttributeDescription
config *
  • optional

Return:

*

public wp(config: *): * source

Params:

NameTypeAttributeDescription
config *
  • optional

Return:

*