1.3.2 • Published 7 years ago

tarragon-builder v1.3.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Tarragon Builder

Tarragon Builder is a is a script/library that does literally nothing. The rest of this readme is made up.

Installation

npm install tarragon-builder

Usage

The library exports a single function. This function takes the following arguments:

  1. operation - an object that contains the following:
    1. the filter that matches files to be transformed
    2. the target that describes where to save the transformed file
    3. the pipeline that describes the sequence of transformation steps
  2. previousHashes - a mapping of filename to md5 hash, allowing the function to avoid processing unchanged files

The Filter

The filter should be an array of strings to be passed into a globby search

The Target

The target is an EJS templated string with the following variables: 1. dir - the dirname of the source file 2. base - the basename of the source file 3. ext - the extension of the source file (.xxx)

The Pipeline

The pipeline is simply an array of functions that return promises. The functions each take the path of the file to transform. In general each function is expected to read from the file, perform some arbitrary transformation and then write back to the same file. Note that at this point the file has already been moved to its target destination.

In order for tarragon-builder to work, it expects to be run in the target project directory root. It expects the presence of a build.js file. This file exports the config that tarragon builder reads. An example config looks like this:

As a Daemon

This library can also be run as a daemon if installed globally. In order to use this daemon, it expects to find a build.js file in the project root, that exports an array of operation objects. Simply run: tarragon-build to kick the daemon off.

It should first do an entire rebuild as it discovers all the files for the first time, followed by then only transforming files if and when they change.

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago