@cucumber/html-formatter 17.0.0 → 19.1.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 (45) 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 -15
  6. package/dist/main.js +1 -1
  7. package/dist/package.json +51 -29
  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 -1
  11. package/dist/src/CucumberHtmlStream.js.map +1 -1
  12. package/dist/src/main.d.ts +1 -0
  13. package/dist/src/main.d.ts.map +1 -1
  14. package/dist/src/main.js +9 -15
  15. package/dist/src/main.js.map +1 -1
  16. package/dist/src/styles.scss +10 -0
  17. package/dist/test/CucumberHtmlStreamTest.js +3 -3
  18. package/dist/test/CucumberHtmlStreamTest.js.map +1 -1
  19. package/dist/test/acceptance.d.ts +2 -0
  20. package/dist/test/acceptance.d.ts.map +1 -0
  21. package/dist/test/acceptance.js +63 -0
  22. package/dist/test/acceptance.js.map +1 -0
  23. package/dist/tsconfig.build.tsbuildinfo +1 -1
  24. package/package.json +51 -29
  25. package/src/CucumberHtmlStream.ts +21 -10
  26. package/src/main.tsx +12 -26
  27. package/src/styles.scss +10 -0
  28. package/test/CucumberHtmlStreamTest.ts +19 -6
  29. package/test/acceptance.ts +62 -0
  30. package/tsconfig.build.json +5 -3
  31. package/tsconfig.json +23 -1
  32. package/.github/ISSUE_TEMPLATE.md +0 -5
  33. package/.github/PULL_REQUEST_TEMPLATE.md +0 -5
  34. package/.rsync +0 -3
  35. package/.subrepo +0 -1
  36. package/Dockerfile +0 -15
  37. package/Makefile +0 -26
  38. package/bin/cucumber-html-formatter.js +0 -3
  39. package/check.js +0 -22
  40. package/default.mk +0 -87
  41. package/dist/src/cli-main.d.ts +0 -2
  42. package/dist/src/cli-main.d.ts.map +0 -1
  43. package/dist/src/cli-main.js +0 -22
  44. package/dist/src/cli-main.js.map +0 -1
  45. 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": "17.0.0",
3
+ "version": "19.1.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,38 +11,63 @@
14
11
  "author": "Aslak Hellesøy",
15
12
  "license": "MIT",
16
13
  "scripts": {
17
- "test": "mocha",
18
- "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"
19
24
  },
20
- "dependencies": {
21
- "@cucumber/messages": "^17.1.0",
22
- "commander": "8.1.0",
23
- "source-map-support": "0.5.19"
25
+ "peerDependencies": {
26
+ "@cucumber/messages": ">=18"
24
27
  },
25
28
  "devDependencies": {
26
- "@babel/core": "7.15.0",
27
- "@cucumber/gherkin-streams": "^4.0.0",
29
+ "@babel/core": "7.17.9",
30
+ "@cucumber/compatibility-kit": "^9.2.0",
31
+ "@cucumber/gherkin": "23.0.1",
32
+ "@cucumber/gherkin-streams": "^5.0.1",
28
33
  "@cucumber/gherkin-utils": "^7.0.0",
29
- "@cucumber/message-streams": "^3.0.0",
34
+ "@cucumber/message-streams": "^4.0.1",
35
+ "@cucumber/messages": "^18.0.0",
30
36
  "@cucumber/query": "^11.0.0",
31
- "@cucumber/react": "^18.0.0",
32
- "@types/mocha": "9.0.0",
33
- "@types/node": "14.17.14",
34
- "@types/react": "17.0.19",
35
- "@types/react-dom": "17.0.9",
36
- "babel-loader": "8.2.2",
37
- "css-loader": "6.2.0",
38
- "mini-css-extract-plugin": "2.2.2",
39
- "mocha": "9.1.1",
40
- "puppeteer": "10.2.0",
37
+ "@cucumber/react-components": "^20.0.2",
38
+ "@types/glob": "^7.2.0",
39
+ "@types/mocha": "9.1.0",
40
+ "@types/node": "17.0.23",
41
+ "@types/react": "17.0.44",
42
+ "@types/react-dom": "17.0.15",
43
+ "@typescript-eslint/eslint-plugin": "^5.18.0",
44
+ "@typescript-eslint/parser": "^5.18.0",
45
+ "babel-loader": "8.2.4",
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": "9.2.2",
58
+ "prettier": "^2.6.2",
59
+ "puppeteer": "^13.5.2",
41
60
  "react": "17.0.2",
42
61
  "react-dom": "17.0.2",
43
- "sass-loader": "12.1.0",
44
- "ts-loader": "9.2.5",
45
- "ts-node": "10.2.1",
46
- "typescript": "4.4.2",
47
- "webpack": "5.51.1",
48
- "webpack-cli": "4.8.0"
62
+ "sass": "1.50.0",
63
+ "sass-loader": "12.6.0",
64
+ "shx": "^0.3.4",
65
+ "source-map-support": "0.5.21",
66
+ "ts-loader": "9.2.8",
67
+ "ts-node": "10.7.0",
68
+ "typescript": "4.6.3",
69
+ "webpack": "5.72.0",
70
+ "webpack-cli": "4.9.2"
49
71
  },
50
72
  "bugs": {
51
73
  "url": "https://github.com/cucumber/cucumber/issues"
@@ -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
 
@@ -46,7 +49,6 @@ export default class CucumberHtmlStream extends Transform {
46
49
  if (err) return callback(err)
47
50
  this.writeTemplateBetween('{{css}}', '{{messages}}', (err) => {
48
51
  if (err) return callback(err)
49
- // this.writeResource("cucumber-react.css", callback);
50
52
  callback()
51
53
  })
52
54
  })
@@ -80,22 +82,31 @@ export default class CucumberHtmlStream extends Transform {
80
82
  ) {
81
83
  this.readTemplate((err, template) => {
82
84
  if (err) return callback(err)
83
- 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
84
89
  const endIndex = end == null ? template.length : template.indexOf(end)
85
90
  this.push(template.substring(beginIndex, endIndex))
86
91
  callback()
87
92
  })
88
93
  }
89
94
 
90
- private readTemplate(callback: (error?: Error | null, data?: string) => void) {
95
+ private readTemplate(
96
+ callback: (error?: Error | null, data?: string) => void
97
+ ) {
91
98
  if (this.template !== null) {
92
99
  return callback(null, this.template)
93
100
  }
94
- fs.readFile(__dirname + '/index.mustache.html', { encoding: 'utf-8' }, (err, template) => {
95
- if (err) return callback(err)
96
- this.template = template
97
- return callback(null, template)
98
- })
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
+ )
99
110
  }
100
111
 
101
112
  private writeMessage(envelope: messages.Envelope) {
package/src/main.tsx CHANGED
@@ -1,15 +1,12 @@
1
+ import './styles.scss'
2
+
1
3
  import * as messages from '@cucumber/messages'
2
- import {
3
- components,
4
- EnvelopesQuery,
5
- searchFromURLParams,
6
- } from '@cucumber/react'
7
- import { Query as GherkinQuery } from '@cucumber/gherkin-utils'
8
- import { Query as CucumberQuery } from '@cucumber/query'
4
+ import { components, searchFromURLParams } from '@cucumber/react-components'
9
5
  import React from 'react'
10
6
  import ReactDOM from 'react-dom'
11
7
 
12
- const { FilteredResults, QueriesWrapper } = components.app
8
+ const { CucumberReact } = components
9
+ const { FilteredResults, EnvelopesWrapper, SearchWrapper } = components.app
13
10
 
14
11
  declare global {
15
12
  interface Window {
@@ -17,25 +14,14 @@ declare global {
17
14
  }
18
15
  }
19
16
 
20
- const gherkinQuery = new GherkinQuery()
21
- const cucumberQuery = new CucumberQuery()
22
- const envelopesQuery = new EnvelopesQuery()
23
-
24
- for (const envelope of window.CUCUMBER_MESSAGES as messages.Envelope[]) {
25
- gherkinQuery.update(envelope)
26
- cucumberQuery.update(envelope)
27
- envelopesQuery.update(envelope)
28
- }
29
-
30
17
  const app = (
31
- <QueriesWrapper
32
- gherkinQuery={gherkinQuery}
33
- cucumberQuery={cucumberQuery}
34
- envelopesQuery={envelopesQuery}
35
- {...searchFromURLParams()}
36
- >
37
- <FilteredResults />
38
- </QueriesWrapper>
18
+ <CucumberReact theme="auto">
19
+ <EnvelopesWrapper envelopes={window.CUCUMBER_MESSAGES}>
20
+ <SearchWrapper {...searchFromURLParams()}>
21
+ <FilteredResults className="html-formatter" />
22
+ </SearchWrapper>
23
+ </EnvelopesWrapper>
24
+ </CucumberReact>
39
25
  )
40
26
 
41
27
  ReactDOM.render(app, document.getElementById('content'))
@@ -0,0 +1,10 @@
1
+ body {
2
+ padding: 0;
3
+ margin: 0;
4
+ }
5
+
6
+ .html-formatter {
7
+ max-width: 1600px;
8
+ min-height: 100vh;
9
+ margin: 0 auto;
10
+ }
@@ -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,26 +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 run prepublishOnly
14
-
15
- dist/src/index.mustache.html: src/index.mustache.html
16
- cp $< $@
17
-
18
- .tested: $(HTML_REPORT_CHECKS)
19
-
20
- .PRECIOUS: acceptance/%.html
21
- acceptance/%.html: ../../compatibility-kit/javascript/features/%.ndjson .built
22
- mkdir -p $(@D)
23
- cat $< | ./bin/cucumber-html-formatter.js > $@
24
-
25
- acceptance/%.html.checked: acceptance/%.html
26
- 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,22 +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('.cucumber-react')
12
- return content && content.innerHTML
13
- })
14
- await browser.close()
15
-
16
- if(!dynamicHTML) throw new Error(`The file ${path} did not render a .cucumber-react element. Inspect manually.`)
17
- }
18
-
19
- check().then(() => console.log(`${path} rendered OK!`)).catch((err) => {
20
- console.error(err.stack)
21
- process.exit(1)
22
- })
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:
34
- ../../node_modules/.bin/npm-check-updates --upgrade --reject hast-util-sanitize,@types/node
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
- )