Skip to content

Commit 5ea8e16

Browse files
authored
Add named export for CucumberHtmlStream (#320)
1 parent d2842a9 commit 5ea8e16

File tree

6 files changed

+15
-5
lines changed

6 files changed

+15
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
9+
### Added
10+
- Add named export for `CucumberHtmlStream` ([#320](https://github.com/cucumber/html-formatter/pull/320))
911

1012
## [21.5.0] - 2024-08-02
1113
### Changed

javascript/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "@cucumber/html-formatter",
33
"version": "21.5.0",
44
"description": "HTML formatter for Cucumber",
5-
"main": "dist/src/CucumberHtmlStream.js",
6-
"types": "dist/src/CucumberHtmlStream.d.ts",
5+
"main": "dist/src/index.js",
6+
"types": "dist/src/index.d.ts",
77
"repository": {
88
"type": "git",
99
"url": "git+https://github.com/cucumber/html-formatter.git"

javascript/src/CucumberHtmlStream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as messages from '@cucumber/messages'
22
import fs from 'fs'
33
import { Readable, Transform, TransformCallback } from 'stream'
44

5-
export default class CucumberHtmlStream extends Transform {
5+
export class CucumberHtmlStream extends Transform {
66
private template: string | null = null
77
private preMessageWritten = false
88
private postMessageWritten = false

javascript/src/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { CucumberHtmlStream } from './CucumberHtmlStream'
2+
3+
export * from './CucumberHtmlStream'
4+
5+
/**
6+
* @deprecated use the named export `CucumberHtmlStream` instead
7+
*/
8+
export default CucumberHtmlStream

javascript/test/CucumberHtmlStreamTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as messages from '@cucumber/messages'
22
import assert from 'assert'
33
import { Writable } from 'stream'
44

5-
import CucumberHtmlStream from '../src/CucumberHtmlStream'
5+
import { CucumberHtmlStream } from '../src'
66

77
async function renderAsHtml(
88
...envelopes: messages.Envelope[]

javascript/test/acceptance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import path from 'path'
66
import puppeteer from 'puppeteer'
77
import { PassThrough, pipeline } from 'stream'
88

9-
import CucumberHtmlStream from '../src/CucumberHtmlStream'
9+
import { CucumberHtmlStream } from '../src'
1010

1111
async function canRenderHtml(html: string): Promise<boolean> {
1212
const browser = await puppeteer.launch({

0 commit comments

Comments
 (0)