Skip to content

Commit

Permalink
docs: remove typedoc
Browse files Browse the repository at this point in the history
  • Loading branch information
keindev committed Nov 25, 2021
1 parent 3a39dec commit 2ed0d90
Show file tree
Hide file tree
Showing 21 changed files with 164 additions and 1,499 deletions.
46 changes: 33 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,53 @@
<details>
<summary>Dependencies</summary>

- Bumped **[stdout-update](https://www.npmjs.com/package/stdout-update/v/2.0.1)** from `2.0.0` to `2.0.1`
- Bumped **[chalk](https://www.npmjs.com/package/chalk/v/4.1.2)** from `4.1.1` to `4.1.2`
- Bumped **[elegant-spinner](https://www.npmjs.com/package/elegant-spinner/v/3.0.0)** from `2.0.0` to `3.0.0`
- Bumped **[figures](https://www.npmjs.com/package/figures/v/4.0.0)** from `3.2.0` to `4.0.0`
- Bumped **[stdout-update](https://www.npmjs.com/package/stdout-update/v/2.0.4)** from `2.0.1` to `2.0.4`

</details>

<details>
<summary>Dev Dependencies</summary>

- Bumped **[@babel/preset-env](https://www.npmjs.com/package/@babel/preset-env/v/7.14.1)** from `7.14.0` to `7.14.1`
- Bumped **[@tagproject/ts-package-shared-config](https://www.npmjs.com/package/@tagproject/ts-package-shared-config/v/3.0.0)** from `2.0.3` to `3.0.0`
- Bumped **[@types/node](https://www.npmjs.com/package/@types/node/v/15.0.2)** from `15.0.1` to `15.0.2`
- Bumped **[@typescript-eslint/eslint-plugin](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin/v/4.22.1)** from `4.22.0` to `4.22.1`
- Bumped **[@typescript-eslint/parser](https://www.npmjs.com/package/@typescript-eslint/parser/v/4.22.1)** from `4.22.0` to `4.22.1`
- Bumped **[changelog-guru](https://www.npmjs.com/package/changelog-guru/v/3.0.1)** from `2.3.1` to `3.0.1`
- Bumped **[cspell](https://www.npmjs.com/package/cspell/v/5.4.0)** from `5.3.12` to `5.4.0`
- Bumped **[ghinfo](https://www.npmjs.com/package/ghinfo/v/2.0.3)** from `2.0.2` to `2.0.3`
- Bumped **[ts-jest](https://www.npmjs.com/package/ts-jest/v/26.5.6)** from `26.5.5` to `26.5.6`
- Bumped **[typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown/v/3.8.0)** from `3.7.2` to `3.8.0`
- Bumped **[@babel/plugin-transform-runtime](https://www.npmjs.com/package/@babel/plugin-transform-runtime/v/7.16.4)** from `7.13.15` to `7.16.4`
- Bumped **[@babel/preset-env](https://www.npmjs.com/package/@babel/preset-env/v/7.16.4)** from `7.14.1` to `7.16.4`
- Bumped **[@tagproject/ts-package-shared-config](https://www.npmjs.com/package/@tagproject/ts-package-shared-config/v/5.0.0)** from `3.0.0` to `5.0.0`
- Bumped **[@types/jest](https://www.npmjs.com/package/@types/jest/v/27.0.3)** from `26.0.23` to `27.0.3`
- Bumped **[@types/node](https://www.npmjs.com/package/@types/node/v/16.11.10)** from `15.0.2` to `16.11.10`
- Bumped **[@typescript-eslint/eslint-plugin](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin/v/5.4.0)** from `4.22.1` to `5.4.0`
- Bumped **[@typescript-eslint/parser](https://www.npmjs.com/package/@typescript-eslint/parser/v/5.4.0)** from `4.22.1` to `5.4.0`
- Bumped **[babel-jest](https://www.npmjs.com/package/babel-jest/v/27.3.1)** from `26.6.3` to `27.3.1`
- Bumped **[changelog-guru](https://www.npmjs.com/package/changelog-guru/v/3.0.2)** from `3.0.1` to `3.0.2`
- Bumped **[cspell](https://www.npmjs.com/package/cspell/v/5.13.1)** from `5.4.0` to `5.13.1`
- Bumped **[eslint](https://www.npmjs.com/package/eslint/v/8.3.0)** from `7.25.0` to `8.3.0`
- Bumped **[eslint-plugin-import](https://www.npmjs.com/package/eslint-plugin-import/v/2.25.3)** from `2.22.1` to `2.25.3`
- Bumped **[eslint-plugin-jest](https://www.npmjs.com/package/eslint-plugin-jest/v/25.3.0)** from `24.3.6` to `25.3.0`
- Bumped **[eslint-plugin-optimize-regex](https://www.npmjs.com/package/eslint-plugin-optimize-regex/v/1.2.1)** from `1.2.0` to `1.2.1`
- Bumped **[eslint-plugin-promise](https://www.npmjs.com/package/eslint-plugin-promise/v/5.1.1)** from `5.1.0` to `5.1.1`
- Bumped **[husky](https://www.npmjs.com/package/husky/v/7.0.4)** from `6.0.0` to `7.0.4`
- Bumped **[jest](https://www.npmjs.com/package/jest/v/27.3.1)** from `26.6.3` to `27.3.1`
- Bumped **[prettier](https://www.npmjs.com/package/prettier/v/2.5.0)** from `2.2.1` to `2.5.0`
- Bumped **[strip-ansi](https://www.npmjs.com/package/strip-ansi/v/7.0.1)** from `7.0.0` to `7.0.1`
- Bumped **[ts-jest](https://www.npmjs.com/package/ts-jest/v/27.0.7)** from `26.5.6` to `27.0.7`
- Bumped **[typedoc](https://www.npmjs.com/package/typedoc/v/0.22.10)** from `0.20.36` to `0.22.10`
- Bumped **[typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown/v/3.11.7)** from `3.8.0` to `3.11.7`
- Bumped **[typescript](https://www.npmjs.com/package/typescript/v/4.5.2)** from `4.2.4` to `4.5.2`

</details>

# :bug: Bug Fixes

- Fix string escaping error [`328b80b`](https://github.com/keindev/tasktree/commit/328b80b8c178574cd3e573d21b71e9d2a4b3f237)
- Fix display of styled strings [`6339919`](https://github.com/keindev/tasktree/commit/6339919576564185515af421f9f047521875d150)

# :memo: Internal changes

- **[Ci]** Rename default branch to main [`3a39dec`](https://github.com/keindev/tasktree/commit/3a39dec16a020f79ee0c8c2d2faac427c0a9c91f)

# :wrench: Code Refactoring

- Add Task, Theme & `ProgressBar` to index exports [`41dc87a`](https://github.com/keindev/tasktree/commit/41dc87a02c59a5447db56a2d716136ee08566611)
- Fix eslint errors [`164f375`](https://github.com/keindev/tasktree/commit/164f3757ec883819aaa4912253bd9ae9d4c0a9e0)

---

Expand Down
77 changes: 77 additions & 0 deletions docs/api/ProgressBar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# ProgressBar

To add a Progress Bar to your task, use [Task.bar](Task.md#bar) method accepting the string pattern and progress bar parameters.

```javascript
const progress = new task.bar([template, options]);
```

## Constructor

```typescript
new ProgressBar(template?: string, options?: IProgressBarOptions)
```

### IProgressBarOptions:

| Name | Type | Description |
| :---------------- | :-------- | :---------------------------------------------------------- |
| `badges?` | _boolean_ | Option to add badge |
| `clear?` | _boolean_ | Option to clear the bar on completion |
| `completeChar?` | _string_ | Completion character |
| `current?` | _number_ | Current completed index |
| `gradient?` | _boolean_ | Option to add gradient to pending bar |
| `incompleteChar?` | _string_ | Incomplete character |
| `total?` | _number_ | Total number of ticks to complete |
| `width?` | _number_ | The displayed width of the progress bar defaulting to total |

### Template (ProgressBar output template)

| Name | Description |
| :--------- | :----------------------------------- |
| `:bar` | The progress bar itself |
| `:current` | Current tick number |
| `:total` | Total ticks |
| `:elapsed` | Time elapsed in seconds |
| `:percent` | Completion percentage |
| `:eta` | Estimated completion time in seconds |
| `:rate` | Rate of ticks per second |

> default template: `:bar :rate/bps :percent :eta/s`
## Methods

### complete

Completes progress and marks it as successful

### fail

Stops the progress and marks it as failed

### render

Render output string with [Theme](Theme.md)

### skip

Stops the progress and marks it as skipped

### tick

Increases current progress on step value

#### Parameters

| Name | Type | Description |
| :-------- | :-------------------------------------------------------------------- | :------------------------------------------------------------------------------ |
| `step?` | _number_ | Value by which the current progress will increase |
| `tokens?` | [_IProgressBarToken_](../interfaces/progressbar.iprogressbartoken.md) | Add custom tokens by adding a `{'name': value}` object parameter to your method |

#### Example

```javascript
const bar = new Progress(':bar template with custom :token');

bar.tick(10, { token: 100 });
```
46 changes: 46 additions & 0 deletions docs/api/Theme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Theme

Allows you to set a custom theme options for the tree display.

## Options

All theme options is object with several fields:

```typescript
{
// status text badge to the task, will be added after the task is completed
badge?: string;
// indication color
color?: string;
// indication symbol
symbol?: string
}
```

### Indication types

| Type | `badge` | `color` | `symbol` | Description |
| :------ | :------: | :---------------------------- | :---------: | :------------------------------------------- |
| default || `[default]` - text | `-` | default color |
| active || `#4285f4` - symbol | `frame (⠧)` | spinner, progress bar color |
| success || `#00c851` - symbol, text, bar || task symbol, progress bar color |
| skip | `[skip]` | `#ff8800` - symbol, text, bar || task symbol, progress bar color |
| error | `[fail]` | `#ff4444` - symbol, text, bar || task symbol, error title, progress bar color |
| message || `#2e2e2e` - symbol || dim pointer to task information |
| info || `#33b5e5` - symbol || information message symbol |
| warning || `#ffbb33` - symbol || warning message symbol |
| subtask || `#2e2e2e` - symbol, text || dim pointer to subtask |
| list || `#4285f4` - symbol || list symbol |
| dim || `#838584` - symbol, bar | `-` | dim color |

```javascript
const theme = {
default: '#ffffff',
success: ['#008000', ''],
skip: {
symbol: '',
},
error: ['#ff0000', '', '[error]'],
...
};
```
Loading

0 comments on commit 2ed0d90

Please sign in to comment.