@cucumber/html-formatter 12.0.0 → 13.0.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.
package/.mocharc.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "require": ["ts-node/register", "source-map-support/register"],
2
+ "require": ["tsconfig-paths/register", "ts-node/register", "source-map-support/register"],
3
3
  "extension": ["ts", "tsx"],
4
4
  "recursive": true,
5
- "timeout": 10000
5
+ "timeout": 10000
6
6
  }
package/Makefile CHANGED
@@ -4,19 +4,18 @@ CCK_NDJSONS = $(shell find ../../compatibility-kit/javascript/features -name "*.
4
4
  HTML_REPORTS = $(patsubst ../../compatibility-kit/javascript/features/%.ndjson,acceptance/%.html,$(CCK_NDJSONS))
5
5
  HTML_REPORT_CHECKS = $(patsubst acceptance/%.html,acceptance/%.html.checked,$(HTML_REPORTS))
6
6
 
7
- .built: webpack.config.js
8
-
9
- ifdef CHECK_INTEGRITY
10
- # We only check integrity of generated HTML reports when we're making a release.
11
- # The integrity check only passes when package.json *doesn't* refer to modules
12
- # using file:..
13
- #
14
- # When https://github.com/cucumber/cucumber/issues/1259 is fixed we might
15
- # be able to check this all the time (including CI)
7
+ .built: webpack.config.js dist/main.js dist/src/index.mustache.html dist/cucumber-react.css
8
+
9
+ dist/main.js: dist/src/main.js
10
+ ../../node_modules/.bin/webpack-cli
11
+
12
+ dist/src/index.mustache.html: src/index.mustache.html
13
+ cp $< $@
14
+
15
+ dist/cucumber-react.css: ../../node_modules/@cucumber/react/dist/src/styles/cucumber-react.css
16
+ cp $< $@
17
+
16
18
  .tested: $(HTML_REPORT_CHECKS)
17
- else
18
- .tested: $(HTML_REPORTS)
19
- endif
20
19
 
21
20
  .PRECIOUS: acceptance/%.html
22
21
  acceptance/%.html: ../../compatibility-kit/javascript/features/%.ndjson .built
package/check.js CHANGED
@@ -1,17 +1,17 @@
1
1
  const fs = require('fs')
2
2
  const path = process.argv[2]
3
3
  const html = fs.readFileSync(path, 'utf-8')
4
- const puppeteer = require('puppeteer');
4
+ const puppeteer = require('puppeteer')
5
5
 
6
6
  async function check() {
7
- const browser = await puppeteer.launch();
8
- const page = await browser.newPage();
7
+ const browser = await puppeteer.launch({ headless: true, args: ['--no-sandbox'] })
8
+ const page = await browser.newPage()
9
9
  await page.setContent(html)
10
10
  const dynamicHTML = await page.evaluate(() => {
11
11
  const content = document.querySelector('.cucumber-react')
12
12
  return content && content.innerHTML
13
- });
14
- await browser.close();
13
+ })
14
+ await browser.close()
15
15
 
16
16
  if(!dynamicHTML) throw new Error(`The file ${path} did not render a .cucumber-react element. Inspect manually.`)
17
17
  }
package/default.mk CHANGED
@@ -3,64 +3,42 @@ SHELL := /usr/bin/env bash
3
3
  rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
4
4
  TYPESCRIPT_SOURCE_FILES = $(sort $(call rwildcard,src test,*.ts *.tsx))
5
5
  PRIVATE = $(shell node -e "console.log(require('./package.json').private)")
6
- NPM ?= npm
7
6
  IS_TESTDATA = $(findstring -testdata,${CURDIR})
7
+ NPM_MODULE = $(shell cat package.json | jq .name --raw-output)
8
8
 
9
- ifeq (yarn,$(NPM))
10
- LOCKFILE = yarn.lock
11
- else
12
- LOCKFILE = package-lock.json
13
- endif
14
-
15
- default: .tested .built .linted
9
+ default: .tested
16
10
  .PHONY: default
17
11
 
18
- .deps: $(LOCKFILE)
19
- touch $@
20
-
21
- .codegen: .deps
22
- touch $@
23
-
24
- .built: .codegen $(TYPESCRIPT_SOURCE_FILES)
25
- $(NPM) run build
12
+ .codegen:
26
13
  touch $@
27
14
 
28
15
  .tested: .tested-npm
29
16
 
30
- .tested-npm: .built $(TYPESCRIPT_SOURCE_FILES)
31
- TS_NODE_TRANSPILE_ONLY=1 $(NPM) run test
32
- touch $@
33
-
34
- .linted: $(TYPESCRIPT_SOURCE_FILES) .built
35
- $(NPM) run lint-fix
17
+ .tested-npm: $(TYPESCRIPT_SOURCE_FILES) .codegen
18
+ npm run test
36
19
  touch $@
37
20
 
38
- $(LOCKFILE): package.json
39
- $(NPM) install
40
- touch $@
21
+ pre-release: clean update-version update-dependencies default
22
+ .PHONY: pre-release
41
23
 
42
24
  update-dependencies:
43
- npx npm-check-updates --upgrade
25
+ ../../node_modules/.bin/npm-check-updates --upgrade && \
26
+ pushd ../.. && \
27
+ npm install && \
28
+ npm run build && \
29
+ popd
44
30
  .PHONY: update-dependencies
45
31
 
46
- remove-local-dependencies:
47
- ifeq ($(IS_TESTDATA),-testdata)
48
- # no-op
49
- else
50
- cat package.json | sed 's/"@cucumber\/\(.*\)": "file:..\/..\/.*"/"@cucumber\/\1": "^0.0.0"/' > package.json.tmp
51
- mv package.json.tmp package.json
52
- endif
53
- .PHONY: remove-local-dependencies
54
-
55
- pre-release: remove-local-dependencies update-version update-dependencies clean default
56
- .PHONY: pre-release
57
-
58
32
  update-version:
59
33
  ifeq ($(IS_TESTDATA),-testdata)
60
34
  # no-op
61
35
  else
62
36
  ifdef NEW_VERSION
63
- $(NPM) --no-git-tag-version --allow-same-version version "$(NEW_VERSION)"
37
+ npm --no-git-tag-version --allow-same-version version "$(NEW_VERSION)"
38
+ # Update all npm packages that depend on us
39
+ pushd ../.. && \
40
+ ./scripts/npm-each update_npm_dependency_if_exists package.json "$(NPM_MODULE)" "^$(NEW_VERSION)"
41
+ # npm install
64
42
  else
65
43
  @echo -e "\033[0;31mNEW_VERSION is not defined. Can't update version :-(\033[0m"
66
44
  exit 1
@@ -73,7 +51,7 @@ ifeq ($(IS_TESTDATA),-testdata)
73
51
  # no-op
74
52
  else
75
53
  ifneq (true,$(PRIVATE))
76
- $(NPM) publish --access public
54
+ npm publish --access public
77
55
  else
78
56
  @echo "Not publishing private npm module"
79
57
  endif
@@ -81,17 +59,11 @@ endif
81
59
  .PHONY: publish
82
60
 
83
61
  post-release:
84
- ifeq ($(IS_TESTDATA),-testdata)
85
- # no-op
86
- else
87
- cat package.json | sed 's/"@cucumber\/\(.*\)": .*"/"@cucumber\/\1": "file:..\/..\/\1\/javascript"/' > package.json.tmp
88
- mv package.json.tmp package.json
89
- endif
90
62
  .PHONY: post-release
91
63
 
92
64
  clean: clean-javascript
93
65
  .PHONY: clean
94
66
 
95
67
  clean-javascript:
96
- rm -rf .deps .codegen .built* .tested* .linted package-lock.json yarn.lock node_modules coverage dist acceptance
68
+ rm -rf .deps .codegen .tested* node_modules coverage dist acceptance
97
69
  .PHONY: clean-javascript