1.0.15 • Published 4 years ago

that-build-library v1.0.15

Weekly downloads
97
License
MIT
Repository
github
Last release
4 years ago

That Build Library

CircleCI

Overview

At That Dev Company we create and manage a whole bunch of projects which are generally built, packaged and deployed using the same set of techniques.

This library contains a collection of common scripts that help with those build and deploy processes

Installation

To install:-

yarn add that-build-library

Quick Example

An example use:-

import { BuildUtils } from 'that-build-library'

Promise.resolve()
    .then(() => BuildUtils.echo('Cleaning'))
    .then(() => BuildUtils.clean('dist'))
    
    .then(() => BuildUtils.echo('Compiling'))
    .then(() => BuildUtils.tsc())
    
    .catch(console.error)

Utilities

The following utility functions are available:-

clean (folder, leaveRoot)

Removes the contents of a folder

  • folder the folder to be cleaned
  • leaveRoot (optional) should the folder be left untouched (just the contents removed)

copy (source, destination, filename)

Copies a file or a folder

  • source the folder or file to be copied
  • destination the folder to be created/copied into
  • filename (optional) the filename of the new file (defaults to the name of the source file)

echo (message)

Logs a message to screen

  • message the message to be logged

exec (cmd, parameters)

Executes a command line program

  • cmd the command to be run
  • parameters a list of parameters to be passed

npmPublish (folder, packageProcessor)

Updates the version and publishes the project to NPM

  • folder the folder containing the distributable build
  • packageProcessor a function that will tidy up the package.json

prettierJS (include, excludes)

Automatically tidies the code (for JAVASCRIPT code)

  • include the root folder prettify
  • excludes an array of folders to exclude

prettierTS (include, excludes)

Automatically tidies the code (for TYPESCRIPT code)

  • include the root folder prettify
  • excludes an array of folders to exclude

processPackage (callback, autoUpdate)

Load the package.json file

  • callback a function which will receive the package.json file's contents
  • autoUpdate should the version of the package.json be automatically updated and saved

removeModuleAlias (moduleName, folder)

Automatically flattens typescript module paths

  • moduleName the name of the path module to remove
  • folder the actual path of the module

test (minimum_coverage, include, excludes)

Compile the codebase (in accordance to the typescript config)

  • minimum_coverage the minimum coverage threshold for each file (0 to 100)
  • include the path to the root directory (default "src")
  • excludes an array of paths to be excluded (default [])

tsc (config)

Compile the codebase (in accordance to the typescript config)

  • config the path to the tsconfig file

zip (from, to)

Create a zip of the build

  • from the build path
  • to the path to the zip file being produced
1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

0.2.1

6 years ago

0.1.36

6 years ago

0.1.35

6 years ago

0.1.34

6 years ago

0.1.33

6 years ago

0.1.32

6 years ago

0.1.31

6 years ago

0.1.30

6 years ago

0.1.28

6 years ago

0.1.27

6 years ago

0.1.26

6 years ago

0.1.25

6 years ago

0.1.24

6 years ago

0.1.23

6 years ago

0.1.22

6 years ago

0.1.21

6 years ago

0.1.20

6 years ago

0.1.19

6 years ago

0.1.18

6 years ago

0.1.17

6 years ago

0.1.14

6 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.4

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago