forked from orbit-oss/chalk
Meta tweaks
This commit is contained in:
parent
c2311622c3
commit
96f44c976b
5 changed files with 26 additions and 19 deletions
5
.github/workflows/main.yml
vendored
5
.github/workflows/main.yml
vendored
|
|
@ -10,12 +10,13 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
node-version:
|
node-version:
|
||||||
|
- 18
|
||||||
- 16
|
- 16
|
||||||
- 14
|
- 14
|
||||||
- 12
|
- 12
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
- run: npm install
|
- run: npm install
|
||||||
|
|
|
||||||
|
|
@ -58,12 +58,15 @@
|
||||||
"log-update": "^5.0.0",
|
"log-update": "^5.0.0",
|
||||||
"matcha": "^0.7.0",
|
"matcha": "^0.7.0",
|
||||||
"tsd": "^0.19.0",
|
"tsd": "^0.19.0",
|
||||||
"xo": "^0.47.0",
|
"xo": "^0.52.4",
|
||||||
"yoctodelay": "^2.0.0"
|
"yoctodelay": "^2.0.0"
|
||||||
},
|
},
|
||||||
"xo": {
|
"xo": {
|
||||||
"rules": {
|
"rules": {
|
||||||
"unicorn/prefer-string-slice": "off"
|
"unicorn/prefer-string-slice": "off",
|
||||||
|
"@typescript-eslint/consistent-type-imports": "off",
|
||||||
|
"@typescript-eslint/consistent-type-exports": "off",
|
||||||
|
"@typescript-eslint/consistent-type-definitions": "off"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"c8": {
|
"c8": {
|
||||||
|
|
|
||||||
25
readme.md
25
readme.md
|
|
@ -13,7 +13,6 @@
|
||||||
[](https://www.npmjs.com/package/chalk?activeTab=dependents)
|
[](https://www.npmjs.com/package/chalk?activeTab=dependents)
|
||||||
[](https://www.npmjs.com/package/chalk)
|
[](https://www.npmjs.com/package/chalk)
|
||||||
[](https://repl.it/github/chalk/chalk)
|
[](https://repl.it/github/chalk/chalk)
|
||||||
[](https://stakes.social/0x44d871aebF0126Bf646753E2C976Aa7e68A66c15)
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
@ -25,19 +24,19 @@
|
||||||
<p>
|
<p>
|
||||||
<p>
|
<p>
|
||||||
<sup>
|
<sup>
|
||||||
Sindre Sorhus' open source work is supported by the community on <a href="https://github.com/sponsors/sindresorhus">GitHub Sponsors</a> and <a href="https://stakes.social/0x44d871aebF0126Bf646753E2C976Aa7e68A66c15">Dev</a>
|
Sindre Sorhus' open source work is supported by the community on <a href="https://github.com/sponsors/sindresorhus">GitHub Sponsors</a>
|
||||||
</sup>
|
</sup>
|
||||||
</p>
|
</p>
|
||||||
<sup>Special thanks to:</sup>
|
<sup>Special thanks to:</sup>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<a href="https://standardresume.co/tech">
|
<a href="https://standardresume.co/tech">
|
||||||
<img src="https://sindresorhus.com/assets/thanks/standard-resume-logo.svg" width="160"/>
|
<img src="https://sindresorhus.com/assets/thanks/standard-resume-logo.svg" width="160">
|
||||||
</a>
|
</a>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<a href="https://retool.com/?utm_campaign=sindresorhus">
|
<a href="https://retool.com/?utm_campaign=sindresorhus">
|
||||||
<img src="https://sindresorhus.com/assets/thanks/retool-logo.svg" width="230"/>
|
<img src="https://sindresorhus.com/assets/thanks/retool-logo.svg" width="230">
|
||||||
</a>
|
</a>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
@ -62,6 +61,16 @@
|
||||||
<sup>It’s 100% JavaScript, fully customizable, and developer-first.</sup>
|
<sup>It’s 100% JavaScript, fully customizable, and developer-first.</sup>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<a href="https://www.stackaid.us/?utm_campaign=sindre">
|
||||||
|
<div>
|
||||||
|
<img src="https://sindresorhus.com/assets/thanks/stackaid-logo.png" width="230" alt="StackAid">
|
||||||
|
</div>
|
||||||
|
<b>Fund your open source dependencies</b>
|
||||||
|
</a>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -80,7 +89,7 @@
|
||||||
- Doesn't extend `String.prototype`
|
- Doesn't extend `String.prototype`
|
||||||
- Clean and focused
|
- Clean and focused
|
||||||
- Actively maintained
|
- Actively maintained
|
||||||
- [Used by ~76,000 packages](https://www.npmjs.com/browse/depended/chalk) as of October 26, 2021
|
- [Used by ~86,000 packages](https://www.npmjs.com/browse/depended/chalk) as of October 4, 2022
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
|
|
@ -288,12 +297,6 @@ If you're on Windows, do yourself a favor and use [Windows Terminal](https://git
|
||||||
|
|
||||||
[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68) and the package is unmaintained. Although there are other packages, they either do too much or not enough. Chalk is a clean and focused alternative.
|
[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68) and the package is unmaintained. Although there are other packages, they either do too much or not enough. Chalk is a clean and focused alternative.
|
||||||
|
|
||||||
## chalk for enterprise
|
|
||||||
|
|
||||||
Available as part of the Tidelift Subscription.
|
|
||||||
|
|
||||||
The maintainers of chalk and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-chalk?utm_source=npm-chalk&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
|
||||||
|
|
||||||
## Related
|
## Related
|
||||||
|
|
||||||
- [chalk-template](https://github.com/chalk/chalk-template) - [Tagged template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates) support for this module
|
- [chalk-template](https://github.com/chalk/chalk-template) - [Tagged template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates) support for this module
|
||||||
|
|
|
||||||
6
source/vendor/ansi-styles/index.js
vendored
6
source/vendor/ansi-styles/index.js
vendored
|
|
@ -105,7 +105,7 @@ function assembleStyles() {
|
||||||
// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js
|
// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js
|
||||||
Object.defineProperties(styles, {
|
Object.defineProperties(styles, {
|
||||||
rgbToAnsi256: {
|
rgbToAnsi256: {
|
||||||
value: (red, green, blue) => {
|
value(red, green, blue) {
|
||||||
// We use the extended greyscale palette here, with the exception of
|
// We use the extended greyscale palette here, with the exception of
|
||||||
// black and white. normal palette only has 4 greyscale shades.
|
// black and white. normal palette only has 4 greyscale shades.
|
||||||
if (red === green && green === blue) {
|
if (red === green && green === blue) {
|
||||||
|
|
@ -128,7 +128,7 @@ function assembleStyles() {
|
||||||
enumerable: false,
|
enumerable: false,
|
||||||
},
|
},
|
||||||
hexToRgb: {
|
hexToRgb: {
|
||||||
value: hex => {
|
value(hex) {
|
||||||
const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
|
const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
|
||||||
if (!matches) {
|
if (!matches) {
|
||||||
return [0, 0, 0];
|
return [0, 0, 0];
|
||||||
|
|
@ -157,7 +157,7 @@ function assembleStyles() {
|
||||||
enumerable: false,
|
enumerable: false,
|
||||||
},
|
},
|
||||||
ansi256ToAnsi: {
|
ansi256ToAnsi: {
|
||||||
value: code => {
|
value(code) {
|
||||||
if (code < 8) {
|
if (code < 8) {
|
||||||
return 30 + code;
|
return 30 + code;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,6 @@ test('propagate enable/disable changes from child colors', t => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('disable colors if they are not supported', async t => {
|
test('disable colors if they are not supported', async t => {
|
||||||
const {stdout} = await execaNode(fileURLToPath(new URL('./_fixture.js', import.meta.url)));
|
const {stdout} = await execaNode(fileURLToPath(new URL('_fixture.js', import.meta.url)));
|
||||||
t.is(stdout, 'testout testerr');
|
t.is(stdout, 'testout testerr');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue