forked from orbit-oss/chalk
Fix code coverage
This commit is contained in:
parent
04fdbd6d8d
commit
7a6893551d
4 changed files with 24 additions and 8 deletions
5
.github/workflows/main.yml
vendored
5
.github/workflows/main.yml
vendored
|
|
@ -10,6 +10,7 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
node-version:
|
node-version:
|
||||||
|
- 16
|
||||||
- 14
|
- 14
|
||||||
- 12
|
- 12
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -19,3 +20,7 @@ jobs:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- run: npm test
|
- run: npm test
|
||||||
|
- uses: codecov/codecov-action@v2
|
||||||
|
if: matrix.node-version == 16
|
||||||
|
with:
|
||||||
|
fail_ci_if_error: true
|
||||||
|
|
|
||||||
21
package.json
21
package.json
|
|
@ -14,11 +14,12 @@
|
||||||
"default": "./source/vendor/supports-color/browser.js"
|
"default": "./source/vendor/supports-color/browser.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"types": "./source/index.d.ts",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^12.17.0 || ^14.13 || >=16.0.0"
|
"node": "^12.17.0 || ^14.13 || >=16.0.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "xo && nyc ava && tsd",
|
"test": "xo && c8 ava && tsd",
|
||||||
"bench": "matcha benchmark.js"
|
"bench": "matcha benchmark.js"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
|
@ -48,23 +49,29 @@
|
||||||
"text"
|
"text"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/node": "^16.11.10",
|
||||||
"ava": "^3.15.0",
|
"ava": "^3.15.0",
|
||||||
|
"c8": "^7.10.0",
|
||||||
"color-convert": "^2.0.1",
|
"color-convert": "^2.0.1",
|
||||||
"coveralls": "^3.1.1",
|
|
||||||
"execa": "^6.0.0",
|
"execa": "^6.0.0",
|
||||||
"log-update": "^5.0.0",
|
"log-update": "^5.0.0",
|
||||||
"matcha": "^0.7.0",
|
"matcha": "^0.7.0",
|
||||||
"nyc": "^15.1.0",
|
|
||||||
"tsd": "^0.19.0",
|
"tsd": "^0.19.0",
|
||||||
"typescript": "^4.5.2",
|
|
||||||
"xo": "^0.47.0",
|
"xo": "^0.47.0",
|
||||||
"yoctodelay": "^2.0.0"
|
"yoctodelay": "^2.0.0"
|
||||||
},
|
},
|
||||||
"types": "./source/index.d.ts",
|
|
||||||
"xo": {
|
"xo": {
|
||||||
"rules": {
|
"rules": {
|
||||||
"unicorn/prefer-string-slice": "off",
|
"unicorn/prefer-string-slice": "off"
|
||||||
"unicorn/better-regex": "off"
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"c8": {
|
||||||
|
"reporter": [
|
||||||
|
"text",
|
||||||
|
"lcov"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"source/vendor"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
> Terminal string styling done right
|
> Terminal string styling done right
|
||||||
|
|
||||||
[](https://coveralls.io/github/chalk/chalk?branch=main)
|
[](https://codecov.io/gh/chalk/chalk)
|
||||||
[](https://www.npmjs.com/package/chalk?activeTab=dependents) [](https://www.npmjs.com/package/chalk)
|
[](https://www.npmjs.com/package/chalk?activeTab=dependents) [](https://www.npmjs.com/package/chalk)
|
||||||
[](https://repl.it/github/chalk/chalk)
|
[](https://repl.it/github/chalk/chalk)
|
||||||
[](https://stakes.social/0x44d871aebF0126Bf646753E2C976Aa7e68A66c15)
|
[](https://stakes.social/0x44d871aebF0126Bf646753E2C976Aa7e68A66c15)
|
||||||
|
|
@ -72,6 +72,7 @@
|
||||||
|
|
||||||
- Expressive API
|
- Expressive API
|
||||||
- Highly performant
|
- Highly performant
|
||||||
|
- No dependencies
|
||||||
- Ability to nest styles
|
- Ability to nest styles
|
||||||
- [256/Truecolor color support](#256-and-truecolor-color-support)
|
- [256/Truecolor color support](#256-and-truecolor-color-support)
|
||||||
- Auto-detects color support
|
- Auto-detects color support
|
||||||
|
|
@ -86,6 +87,8 @@
|
||||||
npm install chalk
|
npm install chalk
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**IMPORTANT:** Chalk 5 is ESM. If you want to use Chalk with TypeScript or a build tool, you will probably want to use Chalk 4 for now. [Read more.](https://github.com/chalk/chalk/releases/tag/v5.0.0)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
// TODO: When targeting Node.js 16, use `String.prototype.replaceAll`.
|
||||||
export function stringReplaceAll(string, substring, replacer) {
|
export function stringReplaceAll(string, substring, replacer) {
|
||||||
let index = string.indexOf(substring);
|
let index = string.indexOf(substring);
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue