npm package: @marcozac/node-rig
Description: The base of rig packages for Node.js projects
Author: marcozac
Latest version: 0.2.0

# @marcozac/node-rig

A [rig package](https://rushstack.io/pages/heft/rig_packages/) with a custom [Jest resolver](#jest-resolver).

```bash
npm install @marcozac/node-rig --save-dev
```

## Jest resolver

Since Jest resolver may fail to handle Node [subpath exports](https://nodejs.org/dist/latest-v16.x/docs/api/packages.html#exports), this package includes a [simple resolver](shared/jest-resolver.cjs) to handle them.

It is included in the shared [jest.config.json](base/jest.config.json) and exported under `shared/jest-resolver.cjs` path.

## Profiles

All the configuration bases are available in `base` directory and the profile ones extend them.

| Configuration base file                                 | Description                                                                                                                                                                                                                     |
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [api-extractor-task.json](base/api-extractor-task.json) | No configuration                                                                                                                                                                                                                |
| [api-extractor.json](base/api-extractor.json)           | A simple configuration targeting `<projectFolder>/lib/index.d.ts`. All settings disabled                                                                                                                                        |
| [heft.json](base/heft.json)                             | Includes the [@rushstack/heft-jest-plugin](https://github.com/microsoft/rushstack/tree/master/heft-plugins/heft-jest-plugin) and the `deleteGlobs` action to delete standard output directories: `dist`, `lib`, `lib-*`, `temp` |
| [rush-project.json](base/rush-project.json)             | Lists standard build output directories to cache: `dist`, `lib`, `lib-cjs`, `temp`                                                                                                                                              |
| [tsconfig.base.json](base/tsconfig.base.json)           | A simple `commonjs` configuration for node projects targeting `es2018`                                                                                                                                                          |
| [typescript.json](base/typescript.json)                 | No configuration                                                                                                                                                                                                                |

### Default

Ships the configurations listed in the table above enabling the `api-extractor` actions except `dtsRollup`.

```json
// <projectFolder>/config/rig.json
{
  "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
  "rigPackageName": "@marcozac/node-rig"
}
```

### Tests

The [tests](profiles/tests) profile provides a shortcut to the same configuration of the [default](#default) one omitting `api-extractor` configuration (unused in test projects).

```json
// <projectFolder>/config/rig.json
{
  "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
  "rigPackageName": "@marcozac/node-rig"
}
```