# @component-controls/config

> Component controls configuration reading utilities

Latest version **4.0.3** (published 2022-01-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @component-controls/config
pnpm add @component-controls/config
yarn add @component-controls/config
bun add @component-controls/config
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.3 |
| Published | 2022-01-14 |
| First published | 2020-05-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 8 |
| Unpacked size | 74 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 82 |
| Maintainers | atanasster |

## Links

- npm: https://www.npmjs.com/package/@component-controls/config
- Repository: https://github.com/ccontrols/component-controls
- Issues: https://github.com/ccontrols/component-controls/issues
- npm.io page: https://npm.io/package/@component-controls/config

## Dependencies (8)

- [glob](https://npm.io/package/glob.md) ^7.1.6
- [yargs](https://npm.io/package/yargs.md) ^15.3.1
- [glob-base](https://npm.io/package/glob-base.md) ^0.3.0
- [micromatch](https://npm.io/package/micromatch.md) ^4.0.2
- [typescript](https://npm.io/package/typescript.md) ^4.2.4
- [@component-controls/core](https://npm.io/package/@component-controls/core.md) ^4.0.3
- [@component-controls/render](https://npm.io/package/@component-controls/render.md) ^4.0.3
- [@component-controls/instrument](https://npm.io/package/@component-controls/instrument.md) ^4.0.3

## Recent versions

- 4.0.3 (latest) — 2022-01-14
- 3.15.0 — 2021-07-21
- 3.14.6 — 2021-05-20
- 3.14.5 — 2021-05-19
- 3.14.3 — 2021-05-18
- 3.14.2 — 2021-05-18
- 3.14.0 — 2021-05-17
- 3.13.0 — 2021-05-17
- 3.12.0 — 2021-05-13
- 3.11.4 — 2021-05-11
- 3.11.3 — 2021-05-10
- 3.11.1 — 2021-05-10
- 3.11.0 — 2021-05-10
- 3.10.4 — 2021-05-09
- 3.10.3 — 2021-05-09
- … 107 more at https://npm.io/package/@component-controls/config/versions

## README

# Table of contents

-   [Overview](#overview)
-   [Installation](#installation)
-   [API](#api)
    -   [loadConfigurations](#loadconfigurations)
    -   [extractDocuments](#extractdocuments)
    -   [ConfigurationResult](#configurationresult)

# Overview

Configuration file utilities. Uses the [glob](https://www.npmjs.com/package/glob) package to locate story files from the configuration

# Installation

This package is usually installed as part of the @component-controls package, but you can also install it standalone:

```bash
$ npm install @component-controls/config --save-dev
```

# API

<api-readme extract="loadConfigurations, extractDocuments, BuildConfiguration, ConfigurationResult" />

<!-- START-API-README -->

## loadConfigurations

**`function`**

loads bot the build time and run time configurations

_defined in [@component-controls/config/core/config/src/index.ts](https://github.com/ccontrols/component-controls/tree/master/core/config/src/index.ts#L205)_

**parameters**

| Name        | Type             | Description                 |
| ----------- | ---------------- | --------------------------- |
| `rootPath*` | `string`         | the roo path of the project |
| `returns`   | RunConfiguration | merged configuration        |

## extractDocuments

**`react component`**

Find the story files out of a configuration file using glob for the regex file search

_defined in [@component-controls/config/core/config/src/index.ts](https://github.com/ccontrols/component-controls/tree/master/core/config/src/index.ts#L127)_

**properties**

| Name              | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Parent                                        |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------- |
| `config*`         | <details><summary>`BuildConfiguration`</summary><blockquote>`webpack`: `Configuration` \| `WebpackConfigFn`<br />`finalWebpack`: `Configuration` \| `WebpackConfigFn`<br />`presets`: `RuleType`\[]<br />`configPath`: `string`<br />`distFolder`: `string`<br />`bundleName`: `string`<br />`staticFolder`: `string`<br />`cssFileName`: `string`<br />`logOptions`: `Partial`&lt;`LogOptions`><br />`mode`: `"none"` \| `"development"` \| `"production"`<br /><details><summary>`loaders`</summary><blockquote>`at`\*: **function** (<br />`index`\*: `number`<br />) => `T` \| `undefined`<br />`module`: `string`<br />`ident`: `string`<br />`loader`: `string`<br />`options`: `string` \| `type`</blockquote></details>`stories`: `string` \| `string`\[]<br />`files`: `string` \| `string`\[]<br />`siteRoot`: `string`<br />`ignore`: `string`\[]<br /><details><summary>`pages`</summary><blockquote>\[`string`]: </blockquote></details>`categories`: `DocType`\[]<br />`siteMap`: `type` \| `boolean`<br />`siteUrl`: `string`<br />`instrument`: `any`<br /><details><summary>`search`</summary><blockquote>`indexingModule`: `string`<br />`searchingModule`\*: `string`<br />`fields`: `SearchFields`\[]<br />`emptySearchDocuments`: `string`\[]<br />`hitsPerPage`: `number`<br />`options`: `any`</blockquote></details><details><summary>`tokens`</summary><blockquote>`figmaAccessToken`: `string`<br />`githubAccessToken`: `string`</blockquote></details>`component`: `string` \| `Record`&lt;`string`, `unknown`> \| `ElementType`&lt;`Props`><br />`subcomponents`: `Record`&lt;`string`, (`string`, `Record`&lt;`string`, `unknown`>, `ElementType`&lt;`Props`>)><br /><details><summary>`controls`</summary><blockquote>\[`string`]: `ComponentControlText` \| `ComponentControlBoolean` \| `ComponentControlColor` \| `ComponentControlDate` \| `ComponentControlObject`&lt;> \| `ComponentControlButton`&lt;> \| `ComponentControlOptions`&lt;> \| `ComponentControlNumber` \| `ComponentControlArray` \| `ComponentControlFiles`</blockquote></details><details><summary>`smartControls`</summary><blockquote>`smart`: `boolean`<br />`include`: `string`\[] \| `IncludeFn`<br />`exclude`: `string`\[] \| `IncludeFn`</blockquote></details>`decorators`: `StoryRenderFn`\[]<br />`plugins`: `any`<br />`category`: `string`</blockquote></details> | [`ConfigurationResult`](#configurationresult) |
| `configPath*`     | `string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | [`ConfigurationResult`](#configurationresult) |
| `optionsFilePath` | `string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | [`ConfigurationResult`](#configurationresult) |

## ConfigurationResult

**`interface`**

_defined in [@component-controls/config/core/config/src/index.ts](https://github.com/ccontrols/component-controls/tree/master/core/config/src/index.ts#L41)_

**properties**

| Name              | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `config*`         | <details><summary>`BuildConfiguration`</summary><blockquote>`webpack`: `Configuration` \| `WebpackConfigFn`<br />`finalWebpack`: `Configuration` \| `WebpackConfigFn`<br />`presets`: `RuleType`\[]<br />`configPath`: `string`<br />`distFolder`: `string`<br />`bundleName`: `string`<br />`staticFolder`: `string`<br />`cssFileName`: `string`<br />`logOptions`: `Partial`&lt;`LogOptions`><br />`mode`: `"none"` \| `"development"` \| `"production"`<br /><details><summary>`loaders`</summary><blockquote>`at`\*: **function** (<br />`index`\*: `number`<br />) => `T` \| `undefined`<br />`module`: `string`<br />`ident`: `string`<br />`loader`: `string`<br />`options`: `string` \| `type`</blockquote></details>`stories`: `string` \| `string`\[]<br />`files`: `string` \| `string`\[]<br />`siteRoot`: `string`<br />`ignore`: `string`\[]<br /><details><summary>`pages`</summary><blockquote>\[`string`]: </blockquote></details>`categories`: `DocType`\[]<br />`siteMap`: `type` \| `boolean`<br />`siteUrl`: `string`<br />`instrument`: `any`<br /><details><summary>`search`</summary><blockquote>`indexingModule`: `string`<br />`searchingModule`\*: `string`<br />`fields`: `SearchFields`\[]<br />`emptySearchDocuments`: `string`\[]<br />`hitsPerPage`: `number`<br />`options`: `any`</blockquote></details><details><summary>`tokens`</summary><blockquote>`figmaAccessToken`: `string`<br />`githubAccessToken`: `string`</blockquote></details>`component`: `string` \| `Record`&lt;`string`, `unknown`> \| `ElementType`&lt;`Props`><br />`subcomponents`: `Record`&lt;`string`, (`string`, `Record`&lt;`string`, `unknown`>, `ElementType`&lt;`Props`>)><br /><details><summary>`controls`</summary><blockquote>\[`string`]: `ComponentControlText` \| `ComponentControlBoolean` \| `ComponentControlColor` \| `ComponentControlDate` \| `ComponentControlObject`&lt;> \| `ComponentControlButton`&lt;> \| `ComponentControlOptions`&lt;> \| `ComponentControlNumber` \| `ComponentControlArray` \| `ComponentControlFiles`</blockquote></details><details><summary>`smartControls`</summary><blockquote>`smart`: `boolean`<br />`include`: `string`\[] \| `IncludeFn`<br />`exclude`: `string`\[] \| `IncludeFn`</blockquote></details>`decorators`: `StoryRenderFn`\[]<br />`plugins`: `any`<br />`category`: `string`</blockquote></details> |
| `configPath*`     | `string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `optionsFilePath` | `string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

<!-- END-API-README -->

---
_Source: https://npm.io/package/@component-controls/config · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
