Skip to content

Commit aa8f522

Browse files
authored
chore: drop chalk from dependencies (#12)
There's a nice native replacement now. Since node 20 will end-of-life in April, 2026, we will also enforce engine as 22+.
1 parent 55cb485 commit aa8f522

5 files changed

Lines changed: 10 additions & 7 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ The Flakiness SDK provides a comprehensive set of tools for creating and managin
1010
npm i @flakiness/sdk @flakiness/flakiness-report
1111
```
1212

13+
Requires Node.js 22+.
14+
1315
## Quick Start
1416

1517
Here's a minimal example of creating a Flakiness JSON Report:

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
"keywords": [],
3131
"author": "Degu Labs, Inc",
3232
"license": "MIT",
33+
"engines": {
34+
"node": ">=22"
35+
},
3336
"devDependencies": {
3437
"@flakiness/flakiness-report": "^0.28.0",
3538
"@flakiness/playwright": "^1.3.3",
@@ -45,7 +48,6 @@
4548
"@flakiness/flakiness-report": ">=0.26.0 <1.0.0"
4649
},
4750
"dependencies": {
48-
"chalk": "^5.6.2",
4951
"debug": "^4.4.3",
5052
"open": "^10.2.0",
5153
"stable-hash": "^0.0.6",

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/showReport.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import chalk from 'chalk';
1+
import { styleText } from 'node:util';
22
import open from "open";
33
import { randomUUIDBase62 } from './_internalUtils.js';
44
import { StaticServer } from './staticServer.js';
@@ -38,7 +38,7 @@ export async function showReport(reportFolder: string, options?: {
3838
url.searchParams.set('port', String(server.port()));
3939
url.searchParams.set('token', token);
4040

41-
console.log(chalk.cyan(`
41+
console.log(styleText('cyan', `
4242
Serving Flakiness report at ${(url.toString())}
4343
Press Ctrl+C to quit.`))
4444
await open(url.toString());

src/stripAnsi.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ const ansiRegex = new RegExp('[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(
1313
*
1414
* @example
1515
* ```typescript
16-
* const clean = stripAnsi(chalk.red('Error: test failed'));
16+
* import { styleText } from 'node:util';
17+
*
18+
* const clean = stripAnsi(styleText('red', 'Error: test failed'));
1719
* // Returns: 'Error: test failed' (without color codes)
1820
* ```
1921
*/

0 commit comments

Comments
 (0)