From 96f44c976bfcad5651b50831821ce75b441d272b Mon Sep 17 00:00:00 2001
From: Sindre Sorhus
Date: Tue, 4 Oct 2022 21:22:40 +0700
Subject: [PATCH] Meta tweaks
---
.github/workflows/main.yml | 5 +++--
package.json | 7 +++++--
readme.md | 25 ++++++++++++++-----------
source/vendor/ansi-styles/index.js | 6 +++---
test/level.js | 2 +-
5 files changed, 26 insertions(+), 19 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index ef5d807..5cd8789 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -10,12 +10,13 @@ jobs:
fail-fast: false
matrix:
node-version:
+ - 18
- 16
- 14
- 12
steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-node@v2
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
diff --git a/package.json b/package.json
index 7daddb2..aa639ff 100644
--- a/package.json
+++ b/package.json
@@ -58,12 +58,15 @@
"log-update": "^5.0.0",
"matcha": "^0.7.0",
"tsd": "^0.19.0",
- "xo": "^0.47.0",
+ "xo": "^0.52.4",
"yoctodelay": "^2.0.0"
},
"xo": {
"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": {
diff --git a/readme.md b/readme.md
index 2f41876..cf4d414 100644
--- a/readme.md
+++ b/readme.md
@@ -13,7 +13,6 @@
[](https://www.npmjs.com/package/chalk?activeTab=dependents)
[](https://www.npmjs.com/package/chalk)
[](https://repl.it/github/chalk/chalk)
-[](https://stakes.social/0x44d871aebF0126Bf646753E2C976Aa7e68A66c15)

@@ -25,19 +24,19 @@
- Sindre Sorhus' open source work is supported by the community on GitHub Sponsors and Dev
+ Sindre Sorhus' open source work is supported by the community on GitHub Sponsors
Special thanks to:
-
+
-
+
@@ -62,6 +61,16 @@
It’s 100% JavaScript, fully customizable, and developer-first.
+
+
+
+
+

+
+ Fund your open source dependencies
+
+
+
@@ -80,7 +89,7 @@
- Doesn't extend `String.prototype`
- Clean and focused
- 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
@@ -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.
-## 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
- [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
diff --git a/source/vendor/ansi-styles/index.js b/source/vendor/ansi-styles/index.js
index 5746537..50e9dfa 100644
--- a/source/vendor/ansi-styles/index.js
+++ b/source/vendor/ansi-styles/index.js
@@ -105,7 +105,7 @@ function assembleStyles() {
// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js
Object.defineProperties(styles, {
rgbToAnsi256: {
- value: (red, green, blue) => {
+ value(red, green, blue) {
// We use the extended greyscale palette here, with the exception of
// black and white. normal palette only has 4 greyscale shades.
if (red === green && green === blue) {
@@ -128,7 +128,7 @@ function assembleStyles() {
enumerable: false,
},
hexToRgb: {
- value: hex => {
+ value(hex) {
const matches = /(?[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
if (!matches) {
return [0, 0, 0];
@@ -157,7 +157,7 @@ function assembleStyles() {
enumerable: false,
},
ansi256ToAnsi: {
- value: code => {
+ value(code) {
if (code < 8) {
return 30 + code;
}
diff --git a/test/level.js b/test/level.js
index f8efeba..367baa6 100644
--- a/test/level.js
+++ b/test/level.js
@@ -38,6 +38,6 @@ test('propagate enable/disable changes from child colors', 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');
});