Skip to content

Commit aa6e52c

Browse files
committed
chore: init
1 parent 08507d9 commit aa6e52c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+6554
-1129
lines changed

.editorconfig

+5-13
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,16 @@
33
# top-most EditorConfig file
44
root = true
55

6-
# Unix-style newlines with a newline ending every file
76
[*]
8-
end_of_line = lf
97
charset = utf-8
10-
insert_final_newline = true
8+
end_of_line = lf
119
trim_trailing_whitespace = true
12-
13-
# Set default charset
14-
[*.js]
15-
indent_style = space
16-
indent_size = 2
17-
18-
[Makefile]
19-
indent_style = tab
20-
21-
[package.json]
10+
insert_final_newline = true
2211
indent_style = space
2312
indent_size = 2
2413

2514
[*.md]
2615
trim_trailing_whitespace = false
16+
17+
[Makefile]
18+
indent_style = tab

.eslintrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@bubkoo/eslint-config"
3+
}

.github/workflows/lock.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: ⛔️ Lock Threads
2+
on:
3+
schedule:
4+
- cron: 0 0 * * *
5+
jobs:
6+
run:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: bubkoo/use-app-token@v1
10+
with:
11+
app_id: ${{ secrets.APP_ID }}
12+
private_key: ${{ secrets.PRIVATE_KEY }}
13+
variable_name: bot_token
14+
- uses: dessant/lock-threads@v2
15+
with:
16+
github-token: ${{ env.bot_token }}
17+
issue-lock-inactive-days: 365
18+
issue-lock-comment: >
19+
This thread has been automatically locked because it has not had recent
20+
activity. Please open a new issue for related bugs and link to relevant
21+
comments in this thread.
22+
process-only: issues
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: 🆖 Potential Duplicates
2+
on:
3+
issues:
4+
types: [opened, edited]
5+
jobs:
6+
run:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: bubkoo/use-app-token@v1
10+
with:
11+
app_id: ${{ secrets.APP_ID }}
12+
private_key: ${{ secrets.PRIVATE_KEY }}
13+
variable_name: bot_token
14+
- uses: bubkoo/potential-duplicates@v1
15+
with:
16+
GITHUB_TOKEN: ${{ env.bot_token }}

.github/workflows/release.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: 🚀 Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- next
7+
- next-major
8+
- alpha
9+
- beta
10+
jobs:
11+
run:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: ⤵️ Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: 🚧 Install
18+
run: yarn install
19+
20+
- name: 📦 Build
21+
run: yarn build
22+
23+
- name: ✅ Test
24+
run: yarn test
25+
26+
- name: 🔑 Generate Token
27+
uses: bubkoo/use-app-token@v1
28+
with:
29+
app_id: ${{ secrets.APP_ID }}
30+
private_key: ${{ secrets.PRIVATE_KEY }}
31+
env_name: bot_token
32+
33+
- name: 📦 Semantic Release
34+
uses: cycjimmy/semantic-release-action@v2
35+
id: semantic
36+
with:
37+
extends: '@bubkoo/semantic-release-config'
38+
extra_plugins: |
39+
@semantic-release/changelog
40+
@semantic-release/git
41+
env:
42+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
43+
GITHUB_TOKEN: ${{ env.bot_token }}
44+
GIT_AUTHOR_NAME: your-bot
45+
GIT_AUTHOR_EMAIL: bubkoo.wy@gmail.com
46+
GIT_COMMITTER_NAME: your-bot
47+
GIT_COMMITTER_EMAIL: bubkoo.wy@gmail.com

.github/workflows/update-authors.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: 🎗 Update Authors
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- alpha
7+
- beta
8+
jobs:
9+
authors:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
- uses: bubkoo/use-app-token@v1
16+
with:
17+
app_id: ${{ secrets.APP_ID }}
18+
private_key: ${{ secrets.PRIVATE_KEY }}
19+
env_name: bot_token
20+
- uses: bubkoo/update-authors@v1
21+
with:
22+
GITHUB_TOKEN: ${{ env.bot_token }}
23+
bots: false
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: 🤝 Update Contributors
2+
on:
3+
schedule:
4+
- cron: '0 1 * * *'
5+
push:
6+
branches:
7+
- master
8+
- alpha
9+
- beta
10+
jobs:
11+
contributors:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: bubkoo/use-app-token@v1
15+
with:
16+
app_id: ${{ secrets.APP_ID }}
17+
private_key: ${{ secrets.PRIVATE_KEY }}
18+
env_name: bot_token
19+
- uses: bubkoo/contributors-list@v1
20+
with:
21+
GITHUB_TOKEN: ${{ env.bot_token }}
22+
excludeUsers: semantic-release-bot ImgBotApp

.github/workflows/update-license.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 🔑 Update License
2+
on:
3+
schedule:
4+
- cron: '0 3 1 1 *' # At 03:00 on day-of-month 1 in January.
5+
jobs:
6+
update:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
with:
11+
fetch-depth: 0
12+
- uses: bubkoo/use-app-token@v1
13+
with:
14+
app_id: ${{ secrets.APP_ID }}
15+
private_key: ${{ secrets.PRIVATE_KEY }}
16+
env_name: bot_token
17+
- uses: FantasticFiasco/action-update-license-year@v2
18+
with:
19+
token: ${{ env.bot_token }}

.gitignore

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
.DS_Store
22
.idea
3+
.vscode
4+
.nyc_output
5+
.DS_Store
6+
.vscode
37
npm-debug.log
4-
5-
/node_modules
8+
yarn-error.log
9+
node_modules
10+
dist
11+
es
12+
lib
13+
test/coverage

.husky/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx @commitlint/cli --extends @bubkoo/commitlint-config --edit "$1"

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

.npmignore

-10
This file was deleted.

.prettierignore

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
*.md
2+
*.sh
3+
*.yml
4+
*.svg
5+
*.gif
6+
.DS_Store
7+
.gitignore
8+
.npmignore
9+
.prettierignore
10+
.babelrc
11+
.editorconfig
12+
.eslintrc
13+
.eslintignore
14+
.stylelintrc.json
15+
package.json
16+
tsconfig.json
17+
tslint.json
18+
CNAME
19+
LICENSE
20+
lib/
21+
es/
22+
dist/
23+
coverage/
24+
yarn.lock
25+
yarn-error.log
26+
npm-debug.log
27+
lerna-debug.log

.prettierrc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true,
4+
"printWidth": 80,
5+
"trailingComma": "all",
6+
"proseWrap": "never",
7+
"overrides": [
8+
{ "files": ".eslintrc", "options": { "parser": "json" } },
9+
{ "files": ".prettierrc", "options": { "parser": "json" } }
10+
]
11+
}

README.md

+31-33
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
# ascii-progress
1+
<h1 align="center">ascii-progress</h1>
22

3-
> Ascii progress-bar(s) in the terminal.
3+
<p align="center"><strong>Ascii progress-bar(s) in the terminal.</strong></p>
44

5-
[![MIT License](https://img.shields.io/badge/license-MIT_License-green.svg?style=flat-square)](https://github.com/bubkoo/ascii-progress/blob/master/LICENSE)
6-
[![Package Quality](http://npm.packagequality.com/shield/ascii-progress.svg)](http://packagequality.com/#?package=ascii-progress)
5+
<p align="center">Fork from <a href="https://github.com/tsayen/dom-to-image" rel="nofollow">dom-to-image</a> with more maintainable code and some new features.</p>
76

7+
<p align="center">
8+
<a href="/LICENSE"><img src="https://img.shields.io/github/license/bubkoo/ascii-progress?style=flat-square" alt="MIT License"></a>
9+
<a href="https://www.typescriptlang.org"><img alt="Language" src="https://img.shields.io/badge/language-TypeScript-blue.svg?style=flat-square"></a>
10+
<a href="https://github.com/bubkoo/ascii-progress/pulls"><img alt="PRs Welcome" src="https://img.shields.io/badge/PRs-Welcome-brightgreen.svg?style=flat-square"></a>
11+
12+
</p>
813

914
**Feature**:
1015

@@ -28,14 +33,14 @@ $ npm install ascii-progress
2833
> For more usage see the [examples](https://github.com/bubkoo/ascii-progress/blob/master/examples)
2934
3035
```javascript
31-
var ProgressBar = require('ascii-progress');
36+
const { ProgressBar } = require('ascii-progress');
3237

33-
var bar = new ProgressBar({
38+
const bar = new ProgressBar({
3439
schema: ':bar',
35-
total : 10
40+
total : 10,
3641
});
3742

38-
var iv = setInterval(function () {
43+
const iv = setInterval(function () {
3944
bar.tick();
4045
if (bar.completed) {
4146
clearInterval(iv);
@@ -46,9 +51,7 @@ var iv = setInterval(function () {
4651

4752
### Options
4853

49-
These are keys in the options object you can pass to the progress bar along with
50-
`total` as seen in the example above.
51-
54+
These are keys in the options object you can pass to the progress bar along with `total` as seen in the example above.
5255

5356
- `schema` - template string of the progress bar. Default `" [:bar] :current/:total :percent :elapseds :etas'"`.
5457
- `total` - total number of ticks to complete. Default `100`.
@@ -62,35 +65,22 @@ These are keys in the options object you can pass to the progress bar along with
6265

6366

6467
### Properties
65-
6668
- `schema`
6769
- `total`
6870
- `current`
6971
- `completed`
7072

7173
### Methods
7274

73-
#### `setSchema(schema, refresh/tokens)`
74-
75-
Update the schema of the progress bar. If `refresh` or `tokens` is truely the progress bar will be refreshed.
76-
77-
#### `tick(delta, tokens)`
78-
79-
Update ticks of the progress bar by `delta`, then render the progress bar with optional `tokens`.
80-
81-
#### `update(ratio, tokens)`
82-
83-
Update the progress bar to `ratio` by percentage, then render the progress bar with optional `tokens`.
84-
85-
#### `clear()`
86-
87-
Clean the progress bar in the terminal.
75+
- `setSchema(schema, refresh/tokens)` - Update the schema of the progress bar. If `refresh` or `tokens` is truely the progress bar will be refreshed.
76+
- `tick(delta, tokens)` - Update ticks of the progress bar by `delta`, then render the progress bar with optional `tokens`.
77+
- `update(ratio, tokens)` - Update the progress bar to `ratio` by percentage, then render the progress bar with optional `tokens`.
8878

79+
- `clear()` - Clean the progress bar in the terminal.
8980

9081
## Schema
9182

92-
The schema defines appearance the progress bar. Few inner tokens and many
93-
formatting methods can be used to customer you progress bar.
83+
The schema defines appearance the progress bar. Few inner tokens and many formatting methods can be used to customer you progress bar.
9484

9585
### Tokens
9686

@@ -110,9 +100,9 @@ These are tokens you can use in the format of your progress bar.
110100
You can define custom tokens by adding a `{name: value}` object parameter to your method (`tick()`, `update()`, etc.) calls.
111101

112102
```javascript
113-
var bar = new ProgressBar({
103+
const bar = new ProgressBar({
114104
schema: ':current: :token1 :token2',
115-
total : 3
105+
total : 3,
116106
});
117107
bar.tick({
118108
'token1': "Hello",
@@ -207,7 +197,15 @@ The percentage is green and bold.
207197

208198
## Contributing
209199

210-
Pull requests and stars are highly welcome.
200+
Please let us know how can we help. Do check out [issues](https://github.com/bubkoo/ascii-progress/issues) for bug reports or suggestions first.
201+
202+
To become a contributor, please follow our [contributing guide](/CONTRIBUTING.md).
203+
204+
<a href="https://github.com/bubkoo/ascii-progress/graphs/contributors">
205+
<img src="/CONTRIBUTORS.svg" alt="Contributors" width="740" />
206+
</a>
207+
211208

212-
For bugs and feature requests, please [create an issue](https://github.com/bubkoo/ascii-progress/issues/new).
209+
## License
213210

211+
The scripts and documentation in this project are released under the [MIT License](LICENSE)

0 commit comments

Comments
 (0)