Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ The Flakiness SDK provides a comprehensive set of tools for creating and managin
npm i @flakiness/sdk @flakiness/flakiness-report
```

Requires Node.js 22+.

## Quick Start

Here's a minimal example of creating a Flakiness JSON Report:
Expand Down Expand Up @@ -125,4 +127,3 @@ Use this entry point when you need to process or manipulate reports in browser-b
```

If neither method is available, the upload is skipped with a `'skipped'` status.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"keywords": [],
"author": "Degu Labs, Inc",
"license": "MIT",
"engines": {
"node": ">=22"
},
Comment on lines +33 to +35

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the Node 22 floor off the browser-only entrypoint

This makes the entire package un-installable on older build runtimes via engines, even though package.json still exposes ./browser and that path (src/browser.ts/src/reportUtilsBrowser.ts) never touches styleText. In projects that only consume @flakiness/sdk/browser from Node 18/20-based toolchains, package managers with engine enforcement will now reject the install for a change that only affected showReport().

Useful? React with 👍 / 👎.

"devDependencies": {
"@flakiness/flakiness-report": "^0.27.0",
"@flakiness/playwright": "^1.3.2",
Expand All @@ -45,7 +48,6 @@
"@flakiness/flakiness-report": ">=0.26.0 <1.0.0"
},
"dependencies": {
"chalk": "^5.6.2",
"debug": "^4.4.3",
"open": "^10.2.0",
"stable-hash": "^0.0.6",
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/showReport.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import chalk from 'chalk';
import { styleText } from 'node:util';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid making the top-level SDK import require util.styleText

Because src/index.ts:11 re-exports showReport, this named import is evaluated whenever consumers import @flakiness/sdk, even if they never call showReport(). util.styleText is only available on newer Node releases (v20.12+), so Node 18 / early Node 20 users can still install this package version and then hit an immediate module-load failure after this patch. If the runtime floor is intentionally changing, it needs to be enforced in package metadata or guarded with a fallback instead of silently breaking the main entrypoint.

Useful? React with 👍 / 👎.

import open from "open";
import { randomUUIDBase62 } from './_internalUtils.js';
import { StaticServer } from './staticServer.js';
Expand Down Expand Up @@ -38,7 +38,7 @@ export async function showReport(reportFolder: string, options?: {
url.searchParams.set('port', String(server.port()));
url.searchParams.set('token', token);

console.log(chalk.cyan(`
console.log(styleText('cyan', `
Serving Flakiness report at ${(url.toString())}
Press Ctrl+C to quit.`))
await open(url.toString());
Expand Down
4 changes: 3 additions & 1 deletion src/stripAnsi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ const ansiRegex = new RegExp('[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(
*
* @example
* ```typescript
* const clean = stripAnsi(chalk.red('Error: test failed'));
* import { styleText } from 'node:util';
*
* const clean = stripAnsi(styleText('red', 'Error: test failed'));
* // Returns: 'Error: test failed' (without color codes)
* ```
*/
Expand Down
Loading