@cucumber/html-formatter 18.0.0 → 19.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/.eslintrc.json +51 -0
  2. package/.mocharc.json +9 -3
  3. package/.prettierrc.json +5 -0
  4. package/README.md +3 -29
  5. package/dist/main.css +25 -23
  6. package/dist/main.js +1 -1
  7. package/dist/package.json +50 -31
  8. package/dist/src/CucumberHtmlStream.d.ts +1 -1
  9. package/dist/src/CucumberHtmlStream.d.ts.map +1 -1
  10. package/dist/src/CucumberHtmlStream.js +2 -0
  11. package/dist/src/CucumberHtmlStream.js.map +1 -1
  12. package/dist/src/main.d.ts +1 -1
  13. package/dist/src/main.d.ts.map +1 -1
  14. package/dist/src/main.js +9 -9
  15. package/dist/src/main.js.map +1 -1
  16. package/dist/test/CucumberHtmlStreamTest.js +3 -3
  17. package/dist/test/CucumberHtmlStreamTest.js.map +1 -1
  18. package/dist/test/acceptance.d.ts +2 -0
  19. package/dist/test/acceptance.d.ts.map +1 -0
  20. package/dist/test/acceptance.js +63 -0
  21. package/dist/test/acceptance.js.map +1 -0
  22. package/dist/tsconfig.build.tsbuildinfo +1 -1
  23. package/package.json +50 -31
  24. package/src/CucumberHtmlStream.ts +21 -9
  25. package/src/main.tsx +3 -2
  26. package/test/CucumberHtmlStreamTest.ts +19 -6
  27. package/test/acceptance.ts +62 -0
  28. package/tsconfig.build.json +5 -3
  29. package/tsconfig.json +23 -1
  30. package/.github/ISSUE_TEMPLATE.md +0 -5
  31. package/.github/PULL_REQUEST_TEMPLATE.md +0 -5
  32. package/.rsync +0 -3
  33. package/.subrepo +0 -1
  34. package/Dockerfile +0 -15
  35. package/Makefile +0 -27
  36. package/bin/cucumber-html-formatter.js +0 -3
  37. package/check.js +0 -27
  38. package/default.mk +0 -87
  39. package/dist/src/cli-main.d.ts +0 -2
  40. package/dist/src/cli-main.d.ts.map +0 -1
  41. package/dist/src/cli-main.js +0 -22
  42. package/dist/src/cli-main.js.map +0 -1
  43. package/src/cli-main.ts +0 -25
package/package.json CHANGED
@@ -1,10 +1,7 @@
1
1
  {
2
2
  "name": "@cucumber/html-formatter",
3
- "version": "18.0.0",
3
+ "version": "19.2.0",
4
4
  "description": "HTML formatter for Cucumber",
5
- "bin": {
6
- "cucumber-html-formatter": "bin/cucumber-html-formatter.js"
7
- },
8
5
  "main": "dist/src/CucumberHtmlStream.js",
9
6
  "types": "dist/src/CucumberHtmlStream.d.ts",
10
7
  "repository": {
@@ -14,40 +11,62 @@
14
11
  "author": "Aslak Hellesøy",
15
12
  "license": "MIT",
16
13
  "scripts": {
17
- "prepare": "cpy '**/*.scss' '../dist/src' --cwd='src' --parents",
18
- "test": "mocha",
19
- "prepublishOnly": "tsc --build tsconfig.build.json"
14
+ "clean": "shx rm -rf dist",
15
+ "build:tsc": "tsc --build tsconfig.build.json",
16
+ "build:webpack": "webpack",
17
+ "build": "npm run clean && npm run build:tsc && npm run prepare && npm run build:webpack",
18
+ "prepare": "shx mkdir -p dist/src && shx cp src/*.scss dist/src && shx cp src/index.mustache.html dist/src",
19
+ "test": "mocha --exclude test/acceptance.ts",
20
+ "prepublishOnly": "npm run build",
21
+ "eslint:fix": "eslint --ext ts,tsx --max-warnings 0 --fix src test",
22
+ "eslint": "eslint --ext ts,tsx --max-warnings 0 src test",
23
+ "validate": "mocha test/acceptance.ts"
20
24
  },
21
- "dependencies": {
22
- "@cucumber/messages": "^17.1.1",
23
- "commander": "8.3.0",
24
- "source-map-support": "0.5.21"
25
+ "peerDependencies": {
26
+ "@cucumber/messages": ">=18"
25
27
  },
26
28
  "devDependencies": {
27
- "@babel/core": "7.16.12",
28
- "@cucumber/gherkin-streams": "^4.0.0",
29
+ "@babel/core": "7.18.0",
30
+ "@cucumber/compatibility-kit": "^9.2.0",
31
+ "@cucumber/gherkin": "23.0.1",
32
+ "@cucumber/gherkin-streams": "^5.0.1",
29
33
  "@cucumber/gherkin-utils": "^7.0.0",
30
- "@cucumber/message-streams": "^3.0.0",
34
+ "@cucumber/message-streams": "^4.0.1",
35
+ "@cucumber/messages": "^18.0.0",
31
36
  "@cucumber/query": "^11.0.0",
32
- "@cucumber/react": "^19.0.0",
33
- "@types/mocha": "9.1.0",
34
- "@types/node": "16.11.21",
35
- "@types/react": "17.0.38",
36
- "@types/react-dom": "17.0.11",
37
- "babel-loader": "8.2.3",
38
- "cpy-cli": "3.1.1",
39
- "css-loader": "6.5.1",
40
- "mini-css-extract-plugin": "2.5.3",
41
- "mocha": "9.2.0",
42
- "puppeteer": "^13.1.2",
37
+ "@cucumber/react-components": "^20.1.0",
38
+ "@types/glob": "^7.2.0",
39
+ "@types/mocha": "9.1.1",
40
+ "@types/node": "17.0.23",
41
+ "@types/react": "17.0.45",
42
+ "@types/react-dom": "18.0.5",
43
+ "@typescript-eslint/eslint-plugin": "^5.18.0",
44
+ "@typescript-eslint/parser": "^5.18.0",
45
+ "babel-loader": "8.2.5",
46
+ "css-loader": "6.7.1",
47
+ "eslint": "^8.13.0",
48
+ "eslint-config-prettier": "^8.5.0",
49
+ "eslint-plugin-import": "^2.26.0",
50
+ "eslint-plugin-node": "^11.1.0",
51
+ "eslint-plugin-prettier": "^4.0.0",
52
+ "eslint-plugin-react": "^7.29.4",
53
+ "eslint-plugin-react-hooks": "^4.4.0",
54
+ "eslint-plugin-simple-import-sort": "^7.0.0",
55
+ "glob": "^8.0.0",
56
+ "mini-css-extract-plugin": "2.6.0",
57
+ "mocha": "10.0.0",
58
+ "prettier": "^2.6.2",
59
+ "puppeteer": "^14.0.0",
43
60
  "react": "17.0.2",
44
61
  "react-dom": "17.0.2",
45
- "sass": "1.49.0",
46
- "sass-loader": "12.4.0",
47
- "ts-loader": "9.2.6",
48
- "ts-node": "10.4.0",
49
- "typescript": "4.5.5",
50
- "webpack": "5.67.0",
62
+ "sass": "1.52.1",
63
+ "sass-loader": "13.0.0",
64
+ "shx": "^0.3.4",
65
+ "source-map-support": "0.5.21",
66
+ "ts-loader": "9.3.0",
67
+ "ts-node": "10.8.0",
68
+ "typescript": "4.7.2",
69
+ "webpack": "5.72.1",
51
70
  "webpack-cli": "4.9.2"
52
71
  },
53
72
  "bugs": {
@@ -1,6 +1,6 @@
1
+ import * as messages from '@cucumber/messages'
1
2
  import fs from 'fs'
2
3
  import { Readable, Transform, TransformCallback } from 'stream'
3
- import * as messages from '@cucumber/messages'
4
4
 
5
5
  export default class CucumberHtmlStream extends Transform {
6
6
  private template: string | null = null
@@ -11,7 +11,10 @@ export default class CucumberHtmlStream extends Transform {
11
11
  * @param cssPath
12
12
  * @param jsPath
13
13
  */
14
- constructor(private readonly cssPath: string, private readonly jsPath: string) {
14
+ constructor(
15
+ private readonly cssPath: string,
16
+ private readonly jsPath: string
17
+ ) {
15
18
  super({ objectMode: true })
16
19
  }
17
20
 
@@ -79,22 +82,31 @@ export default class CucumberHtmlStream extends Transform {
79
82
  ) {
80
83
  this.readTemplate((err, template) => {
81
84
  if (err) return callback(err)
82
- const beginIndex = begin == null ? 0 : template.indexOf(begin) + begin.length
85
+ if (!template)
86
+ return callback(new Error('template is required if error is missing'))
87
+ const beginIndex =
88
+ begin == null ? 0 : template.indexOf(begin) + begin.length
83
89
  const endIndex = end == null ? template.length : template.indexOf(end)
84
90
  this.push(template.substring(beginIndex, endIndex))
85
91
  callback()
86
92
  })
87
93
  }
88
94
 
89
- private readTemplate(callback: (error?: Error | null, data?: string) => void) {
95
+ private readTemplate(
96
+ callback: (error?: Error | null, data?: string) => void
97
+ ) {
90
98
  if (this.template !== null) {
91
99
  return callback(null, this.template)
92
100
  }
93
- fs.readFile(__dirname + '/index.mustache.html', { encoding: 'utf-8' }, (err, template) => {
94
- if (err) return callback(err)
95
- this.template = template
96
- return callback(null, template)
97
- })
101
+ fs.readFile(
102
+ __dirname + '/index.mustache.html',
103
+ { encoding: 'utf-8' },
104
+ (err, template) => {
105
+ if (err) return callback(err)
106
+ this.template = template
107
+ return callback(null, template)
108
+ }
109
+ )
98
110
  }
99
111
 
100
112
  private writeMessage(envelope: messages.Envelope) {
package/src/main.tsx CHANGED
@@ -1,8 +1,9 @@
1
+ import './styles.scss'
2
+
1
3
  import * as messages from '@cucumber/messages'
2
- import { components, searchFromURLParams } from '@cucumber/react'
4
+ import { components, searchFromURLParams } from '@cucumber/react-components'
3
5
  import React from 'react'
4
6
  import ReactDOM from 'react-dom'
5
- import './styles.scss'
6
7
 
7
8
  const { CucumberReact } = components
8
9
  const { FilteredResults, EnvelopesWrapper, SearchWrapper } = components.app
@@ -1,13 +1,20 @@
1
1
  import * as messages from '@cucumber/messages'
2
- import CucumberHtmlStream from '../src/CucumberHtmlStream'
3
- import { Writable } from 'stream'
4
2
  import assert from 'assert'
3
+ import { Writable } from 'stream'
5
4
 
6
- async function renderAsHtml(...envelopes: messages.Envelope[]): Promise<string> {
5
+ import CucumberHtmlStream from '../src/CucumberHtmlStream'
6
+
7
+ async function renderAsHtml(
8
+ ...envelopes: messages.Envelope[]
9
+ ): Promise<string> {
7
10
  return new Promise((resolve, reject) => {
8
11
  let html = ''
9
12
  const sink: Writable = new Writable({
10
- write(chunk: any, encoding: string, callback: (error?: Error | null) => void): void {
13
+ write(
14
+ chunk: string,
15
+ _: string,
16
+ callback: (error?: Error | null) => void
17
+ ): void {
11
18
  html += chunk
12
19
  callback()
13
20
  },
@@ -40,7 +47,9 @@ describe('CucumberHtmlStream', () => {
40
47
  },
41
48
  }
42
49
  const html = await renderAsHtml(e1)
43
- assert(html.indexOf(`window.CUCUMBER_MESSAGES = [${JSON.stringify(e1)}]`) >= 0)
50
+ assert(
51
+ html.indexOf(`window.CUCUMBER_MESSAGES = [${JSON.stringify(e1)}]`) >= 0
52
+ )
44
53
  })
45
54
 
46
55
  it('writes two messages to html', async () => {
@@ -57,7 +66,11 @@ describe('CucumberHtmlStream', () => {
57
66
  }
58
67
  const html = await renderAsHtml(e1, e2)
59
68
  assert(
60
- html.indexOf(`window.CUCUMBER_MESSAGES = [${JSON.stringify(e1)},${JSON.stringify(e2)}]`) >= 0
69
+ html.indexOf(
70
+ `window.CUCUMBER_MESSAGES = [${JSON.stringify(e1)},${JSON.stringify(
71
+ e2
72
+ )}]`
73
+ ) >= 0
61
74
  )
62
75
  })
63
76
  })
@@ -0,0 +1,62 @@
1
+ import { NdjsonToMessageStream } from '@cucumber/message-streams'
2
+ import assert from 'assert'
3
+ import fs from 'fs'
4
+ import glob from 'glob'
5
+ import path from 'path'
6
+ import puppeteer from 'puppeteer'
7
+ import { PassThrough, pipeline } from 'stream'
8
+
9
+ import CucumberHtmlStream from '../src/CucumberHtmlStream'
10
+
11
+ async function canRenderHtml(html: string): Promise<boolean> {
12
+ const browser = await puppeteer.launch({
13
+ headless: true,
14
+ args: ['--no-sandbox'],
15
+ })
16
+ const page = await browser.newPage()
17
+ await page.setContent(html)
18
+ const dynamicHTML = await page.evaluate(() => {
19
+ const content = document.querySelector('[data-testid="cucumber-react"]')
20
+ return content && content.innerHTML
21
+ })
22
+ await browser.close()
23
+
24
+ if (!dynamicHTML) {
25
+ return false
26
+ }
27
+
28
+ return true
29
+ }
30
+
31
+ describe('html-formatter', () => {
32
+ const files = glob.sync(
33
+ `./node_modules/@cucumber/compatibility-kit/features/**/*.ndjson`
34
+ )
35
+ for (const ndjson of files) {
36
+ it(`can render ${path.basename(ndjson, '.ndjson')}`, async () => {
37
+ const ndjsonData = fs.createReadStream(ndjson, { encoding: 'utf-8' })
38
+ const toMessageStream = new NdjsonToMessageStream()
39
+ const htmlData = await new Promise<string>((resolve, reject) => {
40
+ const chunks: Buffer[] = []
41
+ const out = new PassThrough()
42
+ .on('data', (chunk) => chunks.push(Buffer.from(chunk)))
43
+ .on('end', () => resolve(Buffer.concat(chunks).toString()))
44
+ pipeline(
45
+ ndjsonData,
46
+ toMessageStream,
47
+ new CucumberHtmlStream(
48
+ __dirname + '/../dist/main.css',
49
+ __dirname + '/../dist/main.js'
50
+ ),
51
+ out,
52
+ (err: Error) => {
53
+ if (err) {
54
+ reject(err)
55
+ }
56
+ }
57
+ )
58
+ })
59
+ assert.ok(await canRenderHtml(htmlData.toString()))
60
+ })
61
+ }
62
+ })
@@ -1,13 +1,15 @@
1
1
  {
2
- "extends": "../../tsconfig.build.json",
2
+ "extends": "./tsconfig.json",
3
3
  "compilerOptions": {
4
4
  "rootDir": ".",
5
- "outDir": "dist"
5
+ "outDir": "dist",
6
+ "composite": true,
7
+ "declarationMap": true,
8
+ "noEmit": false
6
9
  },
7
10
  "include": [
8
11
  "src",
9
12
  "test",
10
- "features",
11
13
  "package.json"
12
14
  ]
13
15
  }
package/tsconfig.json CHANGED
@@ -1,3 +1,25 @@
1
1
  {
2
- "extends": "../../tsconfig.json"
2
+ "compilerOptions": {
3
+ "baseUrl": ".",
4
+ "declaration": true,
5
+ "sourceMap": true,
6
+ "allowJs": false,
7
+ "resolveJsonModule": true,
8
+ "esModuleInterop": true,
9
+ "noImplicitAny": true,
10
+ "downlevelIteration": true,
11
+ "skipLibCheck": true,
12
+ "strictNullChecks": true,
13
+ "experimentalDecorators": true,
14
+ "module": "CommonJS",
15
+ "lib": [
16
+ "ES6",
17
+ "dom"
18
+ ],
19
+ "target": "ES6",
20
+ "moduleResolution": "node",
21
+ "allowSyntheticDefaultImports": true,
22
+ "noEmit": true,
23
+ "jsx": "react"
24
+ }
3
25
  }
@@ -1,5 +0,0 @@
1
- PLEASE DO NOT CREATE ISSUES IN THIS REPO.
2
- THIS REPO IS A READ-ONLY MIRROR.
3
-
4
- Create your issue in the Cucumber monorepo instead:
5
- https://github.com/cucumber/cucumber/issues
@@ -1,5 +0,0 @@
1
- PLEASE DO NOT CREATE PULL REAUESTS IN THIS REPO.
2
- THIS REPO IS A READ-ONLY MIRROR.
3
-
4
- Create your pull request in the Cucumber monorepo instead:
5
- https://github.com/cucumber/cucumber/pulls
package/.rsync DELETED
@@ -1,3 +0,0 @@
1
- ../../LICENSE LICENSE
2
- ../../.templates/github/ .github/
3
- ../../.templates/javascript/ .
package/.subrepo DELETED
@@ -1 +0,0 @@
1
- cucumber/html-formatter
package/Dockerfile DELETED
@@ -1,15 +0,0 @@
1
- # cucumber/html-formatter
2
- FROM node:16-alpine
3
-
4
- RUN mkdir -p /home/node/app
5
- ADD src /home/node/app/src
6
- ADD test /home/node/app/test
7
- ADD bin /home/node/app/bin
8
- ADD package.json /home/node/app/package.json
9
- ADD tsconfig.json /home/node/app/tsconfig.json
10
- ADD webpack.config.js /home/node/app/webpack.config.js
11
- RUN cd /home/node/app && npm install
12
- RUN cd /home/node/app && npm run build
13
-
14
- USER node
15
- ENTRYPOINT [ "/home/node/app/bin/cucumber-html-formatter.js" ]
package/Makefile DELETED
@@ -1,27 +0,0 @@
1
- include default.mk
2
-
3
- CCK_NDJSONS = $(shell find ../../compatibility-kit/javascript/features -name "*.ndjson")
4
- HTML_REPORTS = $(patsubst ../../compatibility-kit/javascript/features/%.ndjson,acceptance/%.html,$(CCK_NDJSONS))
5
- HTML_REPORT_CHECKS = $(patsubst acceptance/%.html,acceptance/%.html.checked,$(HTML_REPORTS))
6
-
7
- .built: webpack.config.js dist/main.js dist/src/index.mustache.html
8
-
9
- dist/main.js: dist/src/main.js
10
- ../../node_modules/.bin/webpack-cli
11
-
12
- dist/src/main.js:
13
- npm i -D puppeteer
14
- npm run prepublishOnly
15
-
16
- dist/src/index.mustache.html: src/index.mustache.html
17
- cp $< $@
18
-
19
- .tested: $(HTML_REPORT_CHECKS)
20
-
21
- .PRECIOUS: acceptance/%.html
22
- acceptance/%.html: ../../compatibility-kit/javascript/features/%.ndjson .built
23
- mkdir -p $(@D)
24
- cat $< | ./bin/cucumber-html-formatter.js > $@
25
-
26
- acceptance/%.html.checked: acceptance/%.html
27
- node check.js $< > $@
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- require('source-map-support').install()
3
- require('../dist/src/cli-main')
package/check.js DELETED
@@ -1,27 +0,0 @@
1
- const fs = require('fs')
2
- const path = process.argv[2]
3
- const html = fs.readFileSync(path, 'utf-8')
4
- const puppeteer = require('puppeteer')
5
-
6
- async function check() {
7
- const browser = await puppeteer.launch({ headless: true, args: ['--no-sandbox'] })
8
- const page = await browser.newPage()
9
- await page.setContent(html)
10
- const dynamicHTML = await page.evaluate(() => {
11
- const content = document.querySelector('[data-testid="cucumber-react"]')
12
- return content && content.innerHTML
13
- })
14
- await browser.close()
15
-
16
- if (!dynamicHTML)
17
- throw new Error(
18
- `The file ${path} did not render a [data-testid="cucumber-react"] element. Inspect manually.`
19
- )
20
- }
21
-
22
- check()
23
- .then(() => console.log(`${path} rendered OK!`))
24
- .catch((err) => {
25
- console.error(err.stack)
26
- process.exit(1)
27
- })
package/default.mk DELETED
@@ -1,87 +0,0 @@
1
- SHELL := /usr/bin/env bash
2
- # https://stackoverflow.com/questions/2483182/recursive-wildcards-in-gnu-make
3
- rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
4
- TYPESCRIPT_SOURCE_FILES = $(sort $(call rwildcard,src test,*.ts *.tsx))
5
- PRIVATE = $(shell node -e "console.log(require('./package.json').private)")
6
- IS_TESTDATA = $(findstring -testdata,${CURDIR})
7
- NPM_MODULE = $(shell cat package.json | jq .name --raw-output)
8
-
9
- default: .tested
10
- .PHONY: default
11
-
12
- ../../node_modules ../../package-lock.json: package.json
13
- cd ../.. && npm install
14
-
15
- .codegen:
16
- touch $@
17
-
18
- .tested: .tested-npm .built
19
-
20
- .built: $(TYPESCRIPT_SOURCE_FILES) ../../node_modules ../../package-lock.json .codegen
21
- pushd ../.. && \
22
- npm run build && \
23
- popd && \
24
- touch $@
25
-
26
- .tested-npm: $(TYPESCRIPT_SOURCE_FILES) ../../node_modules ../../package-lock.json .codegen
27
- npm run test
28
- touch $@
29
-
30
- pre-release: clean update-version update-dependencies default
31
- .PHONY: pre-release
32
-
33
- update-dependencies: ../../node_modules ../../package-lock.json
34
- ../../node_modules/.bin/npm-check-updates --upgrade --reject hast-util-sanitize,@types/node,react-markdown,rehype-raw,rehype-sanitize,remark-gfm
35
- .PHONY: update-dependencies
36
-
37
- update-version:
38
- ifeq ($(IS_TESTDATA),-testdata)
39
- # no-op
40
- else
41
- ifdef NEW_VERSION
42
- npm --no-git-tag-version --allow-same-version version "$(NEW_VERSION)"
43
- # Update all npm packages that depend on us
44
- pushd ../.. && \
45
- ./scripts/npm-each update_npm_dependency_if_exists package.json "$(NPM_MODULE)" "$(NEW_VERSION)"
46
- else
47
- @echo -e "\033[0;31mNEW_VERSION is not defined. Can't update version :-(\033[0m"
48
- exit 1
49
- endif
50
- endif
51
- .PHONY: update-version
52
-
53
- publish: .codegen
54
- ifeq ($(IS_TESTDATA),-testdata)
55
- # no-op
56
- else
57
- ifneq (true,$(PRIVATE))
58
- npm publish --access public
59
- else
60
- @echo "Not publishing private npm module"
61
- endif
62
- endif
63
- .PHONY: publish
64
-
65
- post-release:
66
- .PHONY: post-release
67
-
68
- clean: clean-javascript
69
- .PHONY: clean
70
-
71
- clean-javascript:
72
- rm -rf .deps .codegen .tested* coverage dist acceptance
73
- .PHONY: clean-javascript
74
-
75
- clobber: clean
76
- rm -rf node_modules ../../node_modules
77
- .PHONY: clobber
78
-
79
- ### COMMON stuff for all platforms
80
-
81
- BERP_VERSION = 1.3.0
82
- BERP_GRAMMAR = gherkin.berp
83
-
84
- define berp-generate-parser =
85
- -! dotnet tool list --tool-path /usr/bin | grep "berp\s*$(BERP_VERSION)" && dotnet tool update Berp --version $(BERP_VERSION) --tool-path /usr/bin
86
- berp -g $(BERP_GRAMMAR) -t $< -o $@ --noBOM
87
- endef
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=cli-main.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli-main.d.ts","sourceRoot":"","sources":["../../src/cli-main.ts"],"names":[],"mappings":""}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const message_streams_1 = require("@cucumber/message-streams");
7
- const commander_1 = __importDefault(require("commander"));
8
- const package_json_1 = __importDefault(require("../package.json"));
9
- const stream_1 = require("stream");
10
- const CucumberHtmlStream_1 = __importDefault(require("./CucumberHtmlStream"));
11
- const program = new commander_1.default.Command();
12
- program.version(package_json_1.default.version);
13
- program.parse(process.argv);
14
- const toMessageStream = new message_streams_1.NdjsonToMessageStream();
15
- (0, stream_1.pipeline)(process.stdin, toMessageStream, new CucumberHtmlStream_1.default(__dirname + '/../../dist/main.css', __dirname + '/../../dist/main.js'), process.stdout, (err) => {
16
- if (err) {
17
- // tslint:disable-next-line:no-console
18
- console.error(err);
19
- process.exit(1);
20
- }
21
- });
22
- //# sourceMappingURL=cli-main.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli-main.js","sourceRoot":"","sources":["../../src/cli-main.ts"],"names":[],"mappings":";;;;;AAAA,+DAAiE;AACjE,0DAAiC;AACjC,mEAA+B;AAC/B,mCAAiC;AACjC,8EAAqD;AAErD,MAAM,OAAO,GAAG,IAAI,mBAAS,CAAC,OAAO,EAAE,CAAA;AAEvC,OAAO,CAAC,OAAO,CAAC,sBAAC,CAAC,OAAO,CAAC,CAAA;AAC1B,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AAE3B,MAAM,eAAe,GAAG,IAAI,uCAAqB,EAAE,CAAA;AACnD,IAAA,iBAAQ,EACN,OAAO,CAAC,KAAK,EACb,eAAe,EACf,IAAI,4BAAkB,CAAC,SAAS,GAAG,sBAAsB,EAAE,SAAS,GAAG,qBAAqB,CAAC,EAC7F,OAAO,CAAC,MAAM,EACd,CAAC,GAAQ,EAAE,EAAE;IACX,IAAI,GAAG,EAAE;QACP,sCAAsC;QACtC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KAChB;AACH,CAAC,CACF,CAAA"}
package/src/cli-main.ts DELETED
@@ -1,25 +0,0 @@
1
- import { NdjsonToMessageStream } from '@cucumber/message-streams'
2
- import commander from 'commander'
3
- import p from '../package.json'
4
- import { pipeline } from 'stream'
5
- import CucumberHtmlStream from './CucumberHtmlStream'
6
-
7
- const program = new commander.Command()
8
-
9
- program.version(p.version)
10
- program.parse(process.argv)
11
-
12
- const toMessageStream = new NdjsonToMessageStream()
13
- pipeline(
14
- process.stdin,
15
- toMessageStream,
16
- new CucumberHtmlStream(__dirname + '/../../dist/main.css', __dirname + '/../../dist/main.js'),
17
- process.stdout,
18
- (err: any) => {
19
- if (err) {
20
- // tslint:disable-next-line:no-console
21
- console.error(err)
22
- process.exit(1)
23
- }
24
- }
25
- )