Skip to content

Commit 4b32b1d

Browse files
chore: update repository (#146)
1 parent eeb3d39 commit 4b32b1d

File tree

10 files changed

+58
-50
lines changed

10 files changed

+58
-50
lines changed

.eslintrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@
33
"parserOptions": {
44
"sourceType": "module",
55
"requireConfigFile": false
6-
}
6+
},
7+
"ignorePatterns": [
8+
"node_modules/",
9+
"dist/"
10+
]
711
}

.github/workflows/codeql.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [master]
16+
branches: [main]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [master]
19+
branches: [main]
2020
schedule:
2121
- cron: '20 18 * * 6'
2222

@@ -43,15 +43,15 @@ jobs:
4343

4444
steps:
4545
- name: Harden Runner
46-
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
46+
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
4747
with:
4848
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
4949
- name: Checkout repository
50-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
50+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
5151

5252
# Initializes the CodeQL tools for scanning.
5353
- name: Initialize CodeQL
54-
uses: github/codeql-action/init@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
54+
uses: github/codeql-action/init@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3.25.12
5555
with:
5656
languages: ${{ matrix.language }}
5757
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -65,7 +65,7 @@ jobs:
6565
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
6666
# If this step fails, then you should remove it and run the build manually (see below)
6767
- name: Autobuild
68-
uses: github/codeql-action/autobuild@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
68+
uses: github/codeql-action/autobuild@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3.25.12
6969

7070
# ℹ️ Command-line programs to run using the OS shell.
7171
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -78,6 +78,6 @@ jobs:
7878
# ./location_of_script_within_repo/buildscript.sh
7979

8080
- name: Perform CodeQL Analysis
81-
uses: github/codeql-action/analyze@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
81+
uses: github/codeql-action/analyze@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3.25.12
8282
with:
8383
category: "/language:${{matrix.language}}"

.github/workflows/node.js.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Node.js CI
22

33
on:
44
push:
5-
branches: [master]
5+
branches: [main]
66
pull_request:
77

88
permissions:
@@ -13,19 +13,23 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
node-version: [18.x]
16+
node-version: [20.x]
1717
fail-fast: false
1818
steps:
1919
- name: Harden Runner
20-
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
20+
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
2121
with:
2222
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
23-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
23+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2424
- name: Use Node.js ${{ matrix.node-version }}
25-
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
25+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
2626
with:
2727
node-version: ${{ matrix.node-version }}
2828
- name: Install dependencies
2929
run: npm i
30+
- name: Lint
31+
run: npm run lint
32+
- name: Build
33+
run: npm run build
3034
- name: Run tests
3135
run: npm run test

.github/workflows/scorecard.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
schedule:
1313
- cron: '21 19 * * 2'
1414
push:
15-
branches: [ "master" ]
15+
branches: [ "main" ]
1616

1717
# Declare default permissions as read only.
1818
permissions: read-all
@@ -32,12 +32,12 @@ jobs:
3232

3333
steps:
3434
- name: "Checkout code"
35-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
35+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3636
with:
3737
persist-credentials: false
3838

3939
- name: "Run analysis"
40-
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
40+
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
4141
with:
4242
results_file: results.sarif
4343
results_format: sarif
@@ -59,14 +59,14 @@ jobs:
5959
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6060
# format to the repository Actions tab.
6161
- name: "Upload artifact"
62-
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
62+
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
6363
with:
6464
name: SARIF file
6565
path: results.sarif
6666
retention-days: 5
6767

6868
# Upload the results to GitHub's code scanning dashboard.
6969
- name: "Upload to code-scanning"
70-
uses: github/codeql-action/upload-sarif@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
70+
uses: github/codeql-action/upload-sarif@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3.25.12
7171
with:
7272
sarif_file: results.sarif

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ small and all contributions are valued.
1010

1111
This guide explains the process for contributing to the TopCli project's.
1212

13-
## [Code of Conduct](https://github.com/TopCli/Governance/blob/master/CODE_OF_CONDUCT.md)
13+
## [Code of Conduct](https://github.com/TopCli/Governance/blob/main/CODE_OF_CONDUCT.md)
1414

1515
The TopCli project has a
16-
[Code of Conduct](https://github.com/TopCli/Governance/blob/master/CODE_OF_CONDUCT.md)
16+
[Code of Conduct](https://github.com/TopCli/Governance/blob/main/CODE_OF_CONDUCT.md)
1717
that *all* contributors are expected to follow. This code describes the
1818
*minimum* behavior expectations for all contributors.
1919

20-
See [details on our policy on Code of Conduct](https://github.com/TopCli/Governance/blob/master/COC_POLICY.md).
20+
See [details on our policy on Code of Conduct](https://github.com/TopCli/Governance/blob/main/COC_POLICY.md).
2121

2222
<a id="developers-certificate-of-origin"></a>
2323
## Developer's Certificate of Origin 1.1

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 TopCli
3+
Copyright (c) 2021-2024 TopCli
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Spinner
2-
![version](https://img.shields.io/badge/dynamic/json.svg?style=for-the-badge&url=https://raw.githubusercontent.com/TopCli/Spinner/master/package.json&query=$.version&label=Version)
2+
3+
![version](https://img.shields.io/badge/dynamic/json.svg?style=for-the-badge&url=https://raw.githubusercontent.com/TopCli/Spinner/main/package.json&query=$.version&label=Version)
34
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg?style=for-the-badge)](https://github.com/TopCli/Spinner/commit-activity)
4-
[![mit](https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge)](https://github.com/TopCli/Spinner/blob/master/LICENSE)
5+
[![mit](https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge)](https://github.com/TopCli/Spinner/blob/main/LICENSE)
6+
[![scorecard](https://api.securityscorecards.dev/projects/github.com/TopCli/Spinner/badge?style=for-the-badge)](https://ossf.github.io/scorecard-visualizer/#/projects/github.com/TopCli/Spinner)
57
![build](https://img.shields.io/github/actions/workflow/status/TopCli/Spinner/node.js.yml?style=for-the-badge)
68

7-
Asynchronous CLI Spinner. This package has been created to handle simultaneous/multiple spinner at a time. The package has been inspired by [Ora](https://github.com/sindresorhus/ora) but in Asynchronous.
9+
Asynchronous CLI Spinner. This package has been created to handle simultaneous/multiple spinner at a time. The package has been inspired by [Ora](https://github.com/sindresorhus/ora) but asynchronous.
810

911
All available spinners are part of [cli-spinners](https://github.com/sindresorhus/cli-spinners#readme) package.
1012

@@ -13,7 +15,8 @@ All available spinners are part of [cli-spinners](https://github.com/sindresorhu
1315
</p>
1416

1517
## Requirements
16-
- [Node.js](https://nodejs.org/en/) v18 or higher
18+
19+
- [Node.js](https://nodejs.org/en/) v20 or higher
1720

1821
## Getting Started
1922

@@ -26,6 +29,7 @@ $ yarn add @topcli/spinner
2629
```
2730

2831
## Usage example
32+
2933
Create and wait multiple spinner at a time.
3034

3135
```js
@@ -68,7 +72,8 @@ await timers.setTimeout(1_000);
6872
spinner.succeed("All done !");
6973
```
7074

71-
> 👀 When you are working on a CLI that can be used as an API too, the **verbose** option allow you to disable the Spinner.
75+
> [!TIP]
76+
> When you are working on a CLI that can be used as an API too, the **verbose** option allow you to disable the Spinner.
7277
7378
## API
7479

@@ -100,7 +105,8 @@ export interface ISpinnerOptions {
100105
}
101106
```
102107

103-
> 👀 Check [cli-spinners](https://github.com/sindresorhus/cli-spinners#readme) for all the spinner name.
108+
> [!TIP]
109+
> Check [cli-spinners](https://github.com/sindresorhus/cli-spinners#readme) for all the spinner name.
104110
105111
```js
106112
new Spinner({ name: "dots2" });

package.json

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"scripts": {
1616
"build": "tsup src/index.ts --format cjs,esm --dts --clean",
1717
"prepublishOnly": "npm run build",
18-
"test-only": "node --no-warnings --loader tsx --test test/Spinner.spec.ts",
18+
"test-only": "npx tsx --test test/Spinner.spec.ts",
1919
"test": "npm run lint && npm run coverage",
2020
"coverage": "c8 -r html npm run test-only",
2121
"lint": "eslint ."
@@ -26,17 +26,12 @@
2626
},
2727
"keywords": [
2828
"CLI",
29-
"SlimIO",
29+
"TopCLI",
3030
"multiple",
3131
"simultaneous",
3232
"async",
33-
"asynchronous",
3433
"spinner",
35-
"spinners",
36-
"ora",
37-
"listr",
3834
"terminal",
39-
"term",
4035
"console",
4136
"progress"
4237
],
@@ -53,22 +48,21 @@
5348
"@topcli/wcwidth": "^1.0.1",
5449
"ansi-regex": "^6.0.1",
5550
"cli-cursor": "^4.0.0",
56-
"cli-spinners": "^2.9.0",
51+
"cli-spinners": "^3.1.0",
5752
"kleur": "^4.1.5",
5853
"strip-ansi": "^7.1.0"
5954
},
6055
"devDependencies": {
61-
"@nodesecure/eslint-config": "^1.7.0",
56+
"@nodesecure/eslint-config": "^1.9.0",
6257
"@slimio/is": "^2.0.0",
63-
"@types/node": "^20.3.3",
64-
"c8": "^8.0.0",
65-
"eslint": "^8.44.0",
66-
"tsup": "^7.1.0",
67-
"tsx": "^3.12.7",
68-
"typescript": "^5.1.6"
58+
"@types/node": "^20.14.11",
59+
"c8": "^10.1.2",
60+
"tsup": "^8.1.0",
61+
"tsx": "^4.16.2",
62+
"typescript": "^5.5.3"
6963
},
7064
"engines": {
71-
"node": ">=16"
65+
"node": ">=20"
7266
},
7367
"type": "module"
7468
}

src/Spinner.class.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import readline from "node:readline";
55
import * as TTY from "node:tty";
66

77
// Import Third-party Dependencies
8-
import cliSpinners from "cli-spinners";
8+
import cliSpinners, { type SpinnerName, type Spinner as CliSpinner } from "cli-spinners";
99
import stripAnsi from "strip-ansi";
1010
import ansiRegex from "ansi-regex";
1111
import wcwidth from "@topcli/wcwidth";
@@ -15,7 +15,7 @@ import kleur from "kleur";
1515
let internalSpinnerCount = 0;
1616

1717
// CONSTANTS
18-
const kDefaultSpinnerName = "dots" satisfies cliSpinners.SpinnerName;
18+
const kDefaultSpinnerName = "dots" satisfies SpinnerName;
1919
const kLogSymbols = process.platform !== "win32" || process.env.CI || process.env.TERM === "xterm-256color" ?
2020
{ success: kleur.bold().green("✔"), error: kleur.bold().red("✖") } :
2121
{ success: kleur.bold().green("√"), error: kleur.bold().red("×") };
@@ -26,7 +26,7 @@ export interface ISpinnerOptions {
2626
*
2727
* @default "dots"
2828
*/
29-
name?: cliSpinners.SpinnerName;
29+
name?: SpinnerName;
3030
/**
3131
* Spinner frame color
3232
*
@@ -54,12 +54,12 @@ export class Spinner extends EventEmitter {
5454

5555
#verbose = true;
5656
#started = false;
57-
#spinner: cliSpinners.Spinner;
57+
#spinner: CliSpinner;
5858
#text = "";
5959
#prefix = "";
6060
#color: (stdout: string) => string;
6161

62-
#interval: NodeJS.Timer | null = null;
62+
#interval: NodeJS.Timeout | null = null;
6363
#frameIndex = 0;
6464
#spinnerPos = 0;
6565
#startTime: number;

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"target": "ES2021",
66
"outDir": "dist",
77
"module": "NodeNext",
8-
"moduleResolution": "node",
8+
"moduleResolution": "NodeNext",
99
"esModuleInterop": true,
1010
"resolveJsonModule": true,
1111
"skipDefaultLibCheck": true,

0 commit comments

Comments
 (0)