@toreda/build-tools
Version:

127 lines (87 loc) • 3.34 kB
Markdown

[](https://github.com/toreda/build-tools/actions)
[](https://sonarcloud.io/project/activity?graph=coverage&id=toreda_build-tools)
[](https://sonarcloud.io/project/overview?id=toreda_build-tools)
[](https://github.com/toreda/build-tools/releases/latest)
[](https://github.com/toreda/build-tools/releases)
[](https://github.com/toreda/build-tools/issues)
[](https://github.com/toreda/build-tools/blob/master/LICENSE)
# `@toreda/build-tools`
Helpers for common gulp build flows. Reduce complexity and code duplication in your gulpfile. Reduce redundancy and upkeep across multiple projects.
* [**Usage**](
* [**Package**](
- [Install](
- [Run Tests](
- [Build](
- [License](
```typescript
import {dest, parallel, series, src} from 'gulp';
import {Build} from '@toreda/build-tools';
import {EventEmitter} from 'events';
import {Log} from '@toreda/log';
const log = new Log();
const events = new EventEmitter();
const build = new Build({
env: 'dev',
log: log,
events: events
});
function runLint() {
}
function createDist() {
return build.create.dir('./dist', false);
}
function cleanDist() {
return build.clean.dir('./dist');
}
function buildSrc() {
return build.run.typescript('./dist', 'tsconfig.json');
}
exports.default = series(createDist, cleanDist, runLint, buildSrc);
```
Install `@toreda/build-tools` directly from NPM.
```bash
yarn add @toreda/build-tools --dev
```
```bash
npm install @toreda/build-tools --save-dev
```
Install or clone `@toreda/build-tools` [(see above)](
Our unit tests use [Jest](https://jestjs.io/).
Installing jest is not required after project dependencies are installed ([see above](#install)).
```bash
yarn test
```
# Build from source
The next steps are the same whether you installed the package using NPM or cloned the repo from Github.
### Build with Yarn
Enter the following commands in order from the build-tools project root.
```bash
yarn build
```
### Build with NPM
Enter the following commands in order from the build-tools project root.
```bash
npm run-script build
```
[](LICENSE) © Toreda, Inc.
Copyright © 2019 - 2022 Toreda, Inc. All Rights Reserved.
https://www.toreda.com