tolkira 0.1.2 → 0.3.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.
@@ -2,10 +2,16 @@
2
2
 
3
3
  **Status: experimental.** The compatibility subpath accepts the legacy options
4
4
  object and renders with Tolkira. It is a migration aid, not a promise of visual
5
- parity.
5
+ parity. The shim is asynchronous: use Node 22 or later, then either
6
+ `import { generate }` or `require(...)`, and await `generate(...)` before
7
+ reading the report.
6
8
 
7
9
  ## Before and after
8
10
 
11
+ ```shell
12
+ npm i -D tolkira
13
+ ```
14
+
9
15
  ```js
10
16
  // before
11
17
  const reporter = require('cucumber-html-reporter');
@@ -32,8 +38,32 @@ await generate({
32
38
  });
33
39
  ```
34
40
 
35
- Only the import changes. `theme` is ignored with a warning; everything else
36
- maps to Tolkira. The callback form still works:
41
+ The option names are unchanged. ESM projects import the shim; CommonJS
42
+ projects require it. The wrapper is async, so await the promise (or use the
43
+ callback) before reading the report. The core package and CLI remain ESM-only.
44
+
45
+ A CommonJS project can require the shim directly:
46
+
47
+ ```js
48
+ // report.cjs
49
+ const { generate } = require('tolkira/compat/cucumber-html-reporter');
50
+
51
+ async function main() {
52
+ await generate({
53
+ jsonFile: 'reports/cucumber.json',
54
+ output: 'reports/report.html',
55
+ });
56
+ }
57
+
58
+ main().catch((error) => {
59
+ console.error(error);
60
+ process.exitCode = 1;
61
+ });
62
+ ```
63
+
64
+ The wrapper exposes only the named `generate` function; there is no default
65
+ export. `theme` is ignored with a warning; everything else maps to Tolkira. The
66
+ callback form still works:
37
67
 
38
68
  ```js
39
69
  generate(options, (error) => {
@@ -41,6 +71,11 @@ generate(options, (error) => {
41
71
  });
42
72
  ```
43
73
 
74
+ Callback caveat: callback-only code can ignore the returned promise. Tolkira
75
+ marks that ignored promise handled so it does not crash the process; awaiting
76
+ the same call still throws. The callback receives an `Error` object, not the
77
+ legacy string. If the callback itself throws, handle that error yourself.
78
+
44
79
  ## Mapping
45
80
 
46
81
  | Old option | Tolkira behaviour |
@@ -60,13 +95,18 @@ generate(options, (error) => {
60
95
  `jsonFile` wins when both `jsonFile` and `jsonDir` are set. If both are missing,
61
96
  generation fails with a usage error.
62
97
 
98
+ The shim consumes legacy Cucumber JSON, which has no Messages `meta.ci`
99
+ envelope. CI job and git details therefore do not appear automatically; pass
100
+ them as `metadata` entries (for example `CI`, `Build`, `Commit` and `Branch`).
101
+ The core Messages path reads `meta.ci` and renders it in HTML only.
102
+
63
103
  ## What is not reproduced
64
104
 
65
105
  - **Themes and charts.** The old Bootstrap, hierarchy and Foundation themes are
66
106
  not cloned. The report keeps Tolkira's simple shell and Details view.
67
107
  - **External screenshots.** `storeScreenshots`, `screenshotsDirectory` and
68
108
  `noInlineScreenshots` are ignored because Tolkira always inlines attachments.
69
- Very large runs can hit the 10 MB size warning; split assets are a v0.2 item.
109
+ Very large runs can hit the 10 MB size warning; split assets are a later item.
70
110
  - **The old rendered HTML.** The shim consumes the input JSON and options, not
71
111
  the generated HTML. If you only have the old HTML, export the JSON again.
72
112
  - **The `output + '.json'` side effect.** Tolkira does not write a merged JSON
@@ -74,10 +114,24 @@ generation fails with a usage error.
74
114
  - **Custom CSS/JS, i18n, email reports, CDN mode and browser launch.** These
75
115
  conflict with the single-file, no-network baseline or are out of scope.
76
116
 
117
+ ## Seed-Test
118
+
119
+ Seed-Test 2.0's dev/AI integration branch is ESM. Use
120
+ `import { generate } from 'tolkira/compat/cucumber-html-reporter'` and await
121
+ the call before reading the HTML. The old default import becomes the named
122
+ `generate`, and the `reporter.Options` type becomes
123
+ `CucumberHtmlReporterOptions`. Seed-Test 1.x is CommonJS and can require the
124
+ same subpath, then await `generate` or use its callback; its current
125
+ `reporter.generate(options)` call without `await` must change too. The core
126
+ package stays ESM-only.
127
+ Seed-Test's group mode also expects a sidecar at `output + '.json'`; Tolkira
128
+ does not write that file.
129
+
77
130
  ## Limits
78
131
 
79
132
  - The shim accepts legacy Cucumber JSON. It does not turn Messages into legacy
80
- JSON or vice versa.
133
+ JSON or vice versa. Legacy JSON arrives with expanded outline examples, so the
134
+ shim renders them as flat scenarios.
81
135
  - The usual Tolkira limits apply: 100 MB total input, 50 MB per attachment,
82
136
  100 MB total attachments.
83
137
  - The shim is experimental. The option set is frozen; new features are added to
@@ -6,6 +6,9 @@
6
6
  `test/messages-producers.test.ts`). Each fixture is a two-scenario feature: one
7
7
  passes, one fails with `Error: boom`.
8
8
 
9
+ The dated cross-format limitations table is
10
+ [`docs/LIMITATIONS.md`](LIMITATIONS.md) (last verified 2026-11-11).
11
+
9
12
  ## Legacy JSON
10
13
 
11
14
  | Producer | Tested | Notes |
@@ -24,6 +27,196 @@ passes, one fails with `Error: boom`.
24
27
  | cucumber-ruby | 12.0.1 real run | `message` formatter; `exception.message` carries the readable error while `message` is the stack, so the report merges them. |
25
28
  | Behave | not applicable | No Messages formatter. |
26
29
 
30
+ ## JUnit XML
31
+
32
+ JUnit is basic mode: suites, test cases, statuses, durations, failures, errors,
33
+ skipped cases and testcase-level `system-out`/`system-err`. Fixtures modelled
34
+ on real output shapes, with provenance in `test/fixtures/junit/`, cover:
35
+
36
+ | Producer | Tested shape | Notes |
37
+ | --- | --- | --- |
38
+ | jest-junit | 16.x | Synthetic but real-shaped; `<testsuites>` root; suite-level `<system-out>` is tolerated, not mapped. |
39
+ | pytest | 8.x `--junitxml` | Synthetic but real-shaped; `<properties>` plus testcase-level `system-out`/`system-err` are mapped. |
40
+ | Gradle | 8.x test task | Synthetic but real-shaped; root `<testsuite>`, `<properties>`, `<failure>`/`<error>`/`<skipped>`; suite-level output is tolerated, not mapped. |
41
+
42
+ See [`JUNIT-XML.md`](JUNIT-XML.md) for the mapping and limits.
43
+
44
+ ## Scenario outlines
45
+
46
+ Messages input carries the Gherkin document, so Tolkira groups executed
47
+ examples under one outline section and numbers them `#1.1`, `#1.2`, `#2.1`.
48
+ Examples blocks and rows whose test case never started are omitted, matching the
49
+ official formatter. A row whose selected test case started with zero raw
50
+ results stays visible as an unexecuted row with its original numbering and no
51
+ outcome. Outline and examples tags, descriptions and keywords come from the
52
+ AST; the substituted values remain visible in the steps. Outlines are ordered
53
+ failed-first like the rest of the report; examples inside an outline keep their
54
+ Gherkin order and numbering.
55
+
56
+ Legacy JSON has no Gherkin document and arrives with examples already expanded.
57
+ Tolkira keeps those rows flat and does not invent an outline. A Messages
58
+ outline without examples also falls back to a flat row; this is a deliberate
59
+ difference from the official formatter, which renders the outline with no
60
+ examples.
61
+
62
+ ## Rules, backgrounds and tags
63
+
64
+ Messages input carries rules and backgrounds in the Gherkin document. Tolkira
65
+ renders a rule as a section with its keyword, name, description and tags.
66
+ Scenarios and outlines stay inside their rule. Feature-level items and rule
67
+ sections are ordered by severity and then by first input position; scenarios do
68
+ not move across rule boundaries. Features without rules keep their previous
69
+ layout.
70
+
71
+ Feature tags render once in the feature header. Rule tags render once on the
72
+ rule section. Scenario tags render on their scenario row or, for an outline, on
73
+ the outline heading; examples tags render once on the examples heading. Example
74
+ rows show no tags. Feature, rule, scenario and examples tags remain in the
75
+ pickle tag set for the tag filter, search and the JSON summary, but they are
76
+ not repeated on every row. A rule section is hidden when a search, status
77
+ or tag filter leaves no visible scenario below it.
78
+
79
+ Feature and rule backgrounds render their keyword, name and description once
80
+ when the name or description is non-empty. Their steps stay in the scenario
81
+ step lists, as Cucumber compiles them into each pickle; Tolkira does not render
82
+ a second background step list. The `backgrounds` Compatibility Kit sample has an
83
+ anonymous background and therefore shows no background heading.
84
+
85
+ Legacy JSON has no reliable rule or background structure. Its normalisation
86
+ synthesizes a Background node for step resolution, marks it synthetic and the
87
+ report model skips it. Legacy feature and scenario tags remain best effort.
88
+ JUnit has neither rules nor backgrounds. The JSON summary stays version 2 and
89
+ continues to expose only the flat scenario list and inherited `scenarios[].tags`;
90
+ rule and background structure is HTML-only.
91
+
92
+ ## Hooks
93
+
94
+ Messages per-scenario hooks render separately from steps. The subtitle counts
95
+ both; named hooks show `Before: name`; passed hooks collapse behind one
96
+ `N hooks` disclosure, while failed and skipped hooks stay inline with their
97
+ error and attachments. Skipped hooks are kept because they explain the skip;
98
+ the official formatter filters some of them. BeforeAll/AfterAll render in a
99
+ Hooks section below the feature list; a named run hook shows its bare name.
100
+ The section is omitted when empty, while the official formatter shows an empty
101
+ section.
102
+
103
+ Legacy JSON has per-scenario before/after hooks but no test-run hooks. JUnit has
104
+ no hooks. The JSON summary stays version 2: hooks stay in
105
+ `scenarios[].steps` with `keyword: "Hook"`, plus an optional `name`. Summary
106
+ step counts include hooks; the HTML counts steps and hooks separately.
107
+
108
+ ## CI metadata and attachments
109
+
110
+ Messages input can carry `meta.ci`. Tolkira reads the CI name and URL, the git
111
+ remote, revision, branch and tag, and shows them in the report header and
112
+ Details. Missing fields are omitted; only http(s) values become links, and a
113
+ missing name falls back to the URL as link text. A safe http(s), scp-like or
114
+ `ssh://` GitHub remote plus a revision links the 7-character commit to the full
115
+ https revision and keeps the full value in the link title; other remotes and
116
+ schemes show the revision as plain text. In a mixed run the first non-empty CI block
117
+ wins, and meta synthesized by the legacy adapter cannot erase it. CI metadata is
118
+ Messages-only; legacy Cucumber JSON has no CI envelope, so pass CI values
119
+ through the `metadata` option instead. The JSON summary never includes CI
120
+ fields and stays schema version 2.
121
+
122
+ Attachment names use the Cucumber `fileName` when present. Unnamed attachments
123
+ fall back to a deterministic `attachment.<ext>` name in Messages and legacy
124
+ JSON; known parameterised media types strip parameters and keep their
125
+ extension (`text/uri-list` becomes `.txt` and `text/x.cucumber.log+plain`
126
+ becomes `.log`), while unknown or forged types normalise to
127
+ `application/octet-stream` and `attachment.bin`. Names are text, never
128
+ filesystem paths. `application/json` attachments are pretty-printed without
129
+ re-serialising values, so big numbers and duplicate keys survive; malformed
130
+ JSON and bodies above 262,144 UTF-8 bytes render as escaped raw text.
131
+ `text/uri-list` entries become links only for http(s); other schemes and
132
+ protocol-relative values stay escaped text. `text/x.cucumber.log+plain` logs
133
+ render safe theme-aware SGR, 256-colour and truecolour spans plus a copy
134
+ action; non-SGR control sequences are stripped, and logs above 262,144 UTF-8
135
+ bytes render as escaped text without colour parsing. `text/html` attachments
136
+ are escaped text, and SVG attachments are only used as an `<img>` data URI;
137
+ neither is injected as markup. Attachment counts and the offline single-file
138
+ contract are unchanged.
139
+
140
+ ## Step diagnostics
141
+
142
+ Messages input carries `suggestion` and `stepDefinition` envelopes. For an
143
+ undefined step Tolkira shows "No step definition found." and renders every
144
+ suggestion snippet as escaped code with its language label. For an ambiguous
145
+ step it shows "Multiple matching step definitions found:" and each matching
146
+ pattern with its source reference in the relative `uri:line` form.
147
+ Multiple snippets and multiple definitions are supported. A passed step can
148
+ carry definition ids but never shows a diagnostic.
149
+
150
+ The lead is status-based: it appears even when the producer sent no suggestion
151
+ or definition envelope. Snippets and patterns are Messages-only. Legacy JSON has
152
+ no such envelopes, so an undefined or ambiguous legacy step shows the lead and
153
+ nothing else; Tolkira never invents a definition. JUnit has no Gherkin step
154
+ statuses and renders no diagnostics.
155
+
156
+ The `undefined`, `undefined-multiple`, `ambiguous`, `all-statuses` and `empty`
157
+ Compatibility Kit samples are checked in as fixtures. `ambiguous` already has
158
+ two matching definitions; there is no separate `ambiguous-multiple` sample.
159
+
160
+ ## Markdown descriptions
161
+
162
+ Feature, rule, background, scenario, outline and examples descriptions render a
163
+ safe GFM subset: headings, emphasis, inline and fenced code, http(s)/mailto
164
+ links, ordered and unordered lists, tables and blockquotes. Raw HTML is escaped
165
+ and never executed. Links carry `rel="noopener noreferrer nofollow"`; relative,
166
+ `javascript:`, `data:` and `file:` targets stay plain text. Images, including
167
+ reference-style and linked images, render as alt text only, so the report makes
168
+ no network request and no image becomes an anchor. Description headings never
169
+ emit `h1`, `h2`, `h5` or `h6`; tables sit in the focusable scroll region.
170
+
171
+ The same renderer covers Messages, legacy JSON and JUnit. JUnit has no standard
172
+ description field; Tolkira reads the non-standard `description` attributes on
173
+ `<testsuite>` and `<testcase>` when present and otherwise keeps plain names.
174
+ Descriptions render only in the HTML report and do not change the JSON summary.
175
+ The Markdown fixtures are local hand-written inputs, not producer captures:
176
+ `markdown-descriptions.ndjson` is authoritative, `markdown-descriptions.feature`
177
+ is an abridged illustration of the Gherkin source,
178
+ `legacy/markdown-description.json` covers the legacy adapter and
179
+ `junit/markdown-description.xml` covers the JUnit description attributes.
180
+
181
+ ## Search and URL state
182
+
183
+ The search box accepts the official Cucumber tag-expression grammar when the
184
+ whole query is tag-shaped: `@a and not @b`, `not @a`, parentheses and escaped
185
+ tag characters. Text mixed with tags and invalid expressions fall back to the
186
+ existing substring search, with no error. Status filters and the tag dropdown
187
+ combine with a valid expression using AND, and the final visible set still opens
188
+ at most 20 newly expanded rows. Clearing the tag dropdown always applies
189
+ immediately, even while a tag expression is active.
190
+
191
+ The report stores `query`, every repeated lowercase `hide` value and `tag` in
192
+ the URL, restores them on load and synchronises the search input, status
193
+ buttons and tag select. Updates use `replaceState` and preserve the hash and
194
+ unrelated parameters. Empty, unknown and uppercase parameters are ignored.
195
+ When `replaceState` is unavailable or throws (for example on `file://`),
196
+ filtering keeps working. URL state and tag expressions are progressive
197
+ enhancements; the static report stays readable without JavaScript.
198
+
199
+ ## Auto-expansion
200
+
201
+ The report opens every feature with an executed scenario whose status is not
202
+ `passed`, including undefined, ambiguous, pending, skipped and unknown. Passed
203
+ scenarios stay collapsed unless they carry an image. A feature whose scenarios
204
+ are all unexecuted opens; a mixed feature opens only for an executed non-passed
205
+ or image scenario, not merely because it contains an unexecuted row. The
206
+ unexecuted rows themselves stay collapsed and show no outcome. This applies to
207
+ Messages, legacy JSON and JUnit input because it is a status rule, not an
208
+ input-format rule. Text search and a valid tag expression still open at most 20
209
+ rows, counting only rows they newly open.
210
+
211
+ The JSON summary stays version 2. Undefined summary steps may carry
212
+ `suggestions`; ambiguous summary steps may carry `definitions`. The fields are
213
+ optional and additive, so `schemaVersion` does not change. Scenario counts
214
+ cover executed scenarios only; an unexecuted scenario keeps `status:
215
+ "unknown"` with `executed: false` and `counts.scenarios.total` can be smaller
216
+ than `scenarios.length`. A legacy scenario with no steps and no hooks is
217
+ unexecuted, so its scenario total drops by one compared with version 1 while
218
+ legacy steps without a result remain executed.
219
+
27
220
  ## Breaking changes that matter
28
221
 
29
222
  - **3.2.1 (2017):** JSON mime-type revert; duration handling was still in flux.
package/docs/JUNIT-XML.md CHANGED
@@ -23,17 +23,34 @@ tolkira reports/junit.xml reports/cucumber.json --out report.html
23
23
  | JUnit XML | Report |
24
24
  | --- | --- |
25
25
  | `<testsuite name="...">` | feature; `name` falls back to `classname` or `JUnit suite N` |
26
+ | `<testsuite description="...">` | feature description, rendered as safe Markdown |
26
27
  | `<testcase name="...">` | scenario with one synthetic step |
28
+ | `<testcase description="...">` | scenario description, rendered as safe Markdown |
27
29
  | `<failure>` / `<error>` | failed; `message` and text become the step error |
28
30
  | `<skipped>` | skipped |
29
31
  | no status child | passed |
30
32
  | `time="1.234"` | 1234 ms |
31
- | `system-out` / `system-err` | `text/plain` attachments |
33
+ | `system-out` / `system-err` | `text/plain` attachments (testcase level only) |
32
34
  | `file` attribute | not used yet; the input file is the URI |
33
35
 
34
36
  Suites and test cases are recomputed; `<testsuite tests="...">` totals are not
35
37
  trusted.
36
38
 
39
+ ## Verified producer shapes
40
+
41
+ `test/junit-producers.test.ts` covers fixtures modelled on common producers.
42
+ They are synthetic but real-shaped, and each records its provenance in a
43
+ comment plus `test/fixtures/junit/PROVENANCE.md`:
44
+
45
+ | Fixture | Producer shape | Covered behaviour |
46
+ | --- | --- | --- |
47
+ | `jest-junit.xml` | jest-junit 16.x | `<testsuites>`, `<testsuite>`, passed/failed/skipped, `<failure>`, suite-level output tolerated and ignored |
48
+ | `pytest.xml` | pytest 8.x `--junitxml` | `<properties>`, passed/failed/skipped, `<failure>`, testcase-level output attached |
49
+ | `gradle.xml` | Gradle 8.x test task | root `<testsuite>`, `<properties>`, passed/failed/error/skipped, `<failure>`, `<error>`, suite-level output tolerated and ignored |
50
+
51
+ These are regression fixtures, not a claim that every dialect is supported.
52
+ Suite-level `system-out`/`system-err` is intentionally not attached.
53
+
37
54
  ## Example
38
55
 
39
56
  ```xml
@@ -56,11 +73,19 @@ one.
56
73
 
57
74
  - No screenshots, videos, traces or arbitrary attachments.
58
75
  - No Gherkin steps, doc strings or data tables.
76
+ - `description` is not a standard JUnit XML attribute. Tolkira reads it on
77
+ `<testsuite>` and `<testcase>` as a best-effort feature/scenario description
78
+ when a producer writes it; dialects without it keep plain names. The text is
79
+ rendered as the same safe Markdown as Cucumber descriptions and never enters
80
+ the JSON summary.
59
81
  - `system-out`/`system-err` are text only; HTML is escaped and never executed.
60
82
  Only testcase-level output is mapped; suite-level output is ignored.
83
+ - `<!DOCTYPE>` and `<!ENTITY>` declarations are rejected as a parser-safety
84
+ measure. The same text inside comments, CDATA sections or processing
85
+ instructions is data and is accepted.
61
86
  - A document with no test cases is rejected with a clear error instead of
62
87
  rendered as an empty run.
63
- - JUnit XML dialects differ; v0.1 handles the common Jenkins/Gradle/Maven/
88
+ - JUnit XML dialects differ; Tolkira handles the common Jenkins/Gradle/Maven/
64
89
  pytest/Playwright shape and fails clearly otherwise.
65
90
  - The existing 100 MB total input limit applies.
66
91
 
@@ -0,0 +1,17 @@
1
+ # Limitations
2
+
3
+ Last verified: **2026-11-13**. "Verified" means the repository state on that
4
+ date: the cited fixture or test exists and passes. It does not mean every
5
+ producer was re-run on that date.
6
+
7
+ | Area | Status | Last verified | What it means |
8
+ | --- | --- | --- | --- |
9
+ | Behave 1.3.3 | Partial | 2026-11-13 | The real JSON run (`behave-real.json`) covers pass/fail statuses, errors and seconds-based durations. A real Behave run with attachments and doc strings is still outstanding; the synthetic `behave.json` covers those shapes. |
10
+ | JUnit XML | Basic | 2026-11-13 | Suites, test cases, statuses, durations, failures, skipped cases and `system-out`/`system-err`. No Gherkin steps, screenshots, traces or arbitrary attachments. Not a replacement for a native Playwright, Jest or Allure report. |
11
+ | Legacy JSON outlines | Flat | 2026-11-13 | Examples arrive expanded. Tolkira keeps those rows flat and does not reconstruct the original outline table. Messages outlines are grouped. |
12
+ | Rules and backgrounds in the summary | HTML only | 2026-11-13 | The version-2 JSON summary exposes a flat scenario list and inherited tags. Rules and backgrounds are an HTML presentation feature. |
13
+ | Themes and charts | Not supported | 2026-11-13 | Branding is title, metadata, logo, accent colour and dark mode. The old cucumber-html-reporter themes and charts are not reproduced. |
14
+ | External attachments | Not supported | 2026-11-13 | Output stays one file. Current limits: 100 MB total input, 50 MB per attachment, 100 MB total attachments, with a warning above 10 MB. |
15
+ | History, trends and multi-run dashboards | Not supported | 2026-11-13 | One run per report. Use multiple-cucumber-html-reporter if you need its dashboard and multi-run grouping. |
16
+ | Native Playwright adapter | Not supported | 2026-11-13 | JUnit XML is the breadth path; Playwright's JUnit output renders in basic mode. |
17
+ | Browser and accessibility coverage | Ongoing | 2026-11-13 | Chromium, Firefox and WebKit at 320, 390, 768, 1024 and 1440 px, plus 320 px at 200 % text zoom. This is not a formal WCAG audit. |
package/llms.txt ADDED
@@ -0,0 +1,31 @@
1
+ # Tolkira
2
+
3
+ > Tolkira converts Cucumber legacy JSON, Cucumber Messages (NDJSON) and JUnit
4
+ > XML into one self-contained HTML report and prints a stable JSON summary for
5
+ > CI and AI agents. It requires Node.js 22 or newer and runs offline with no
6
+ > server, CDN or telemetry.
7
+
8
+ Package: https://www.npmjs.com/package/tolkira
9
+
10
+ ## Start here
11
+
12
+ - [README](https://github.com/Silasoa/tolkira/blob/main/README.md): install,
13
+ quick start, migration from cucumber-html-reporter and MCHR, decision matrix.
14
+ - [Agent interface](https://github.com/Silasoa/tolkira/blob/main/docs/AGENT-INTERFACE.md):
15
+ CLI, API, JSON summary schema 2 and exit codes.
16
+ - [Limitations](https://github.com/Silasoa/tolkira/blob/main/docs/LIMITATIONS.md):
17
+ dated status of Behave coverage, JUnit, themes and attachments.
18
+ - [Compatibility](https://github.com/Silasoa/tolkira/blob/main/docs/COMPATIBILITY.md):
19
+ cucumber-html-reporter shim mapping and caveats.
20
+ - [Cucumber compatibility](https://github.com/Silasoa/tolkira/blob/main/docs/CUCUMBER-COMPATIBILITY.md):
21
+ tested producers and versions.
22
+
23
+ ## Rules for agents
24
+
25
+ - Generate the summary with `tolkira <inputs> --json` and parse stdout; do not
26
+ scrape the HTML for pass/fail data.
27
+ - Exit code 0 means the report was generated, not that the tests passed. Read
28
+ `status` and `counts` from the summary.
29
+ - Check `scenarios[].executed` before treating a scenario status as an outcome.
30
+ - Attach `report.html` as the human-facing artifact; keep the JSON summary for
31
+ automation.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tolkira",
3
- "version": "0.1.2",
4
- "description": "The interpreter for your test results. Self-contained HTML reports for Cucumber JSON, Messages, and beyond.",
3
+ "version": "0.3.0",
4
+ "description": "Self-contained offline HTML reports for Cucumber legacy JSON, Messages and JUnit XML, with a stable JSON summary for CI and AI agents.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "Tolkira contributors",
@@ -17,11 +17,20 @@
17
17
  "cucumber",
18
18
  "cucumber-json",
19
19
  "cucumber-messages",
20
+ "cucumber-html-reporter",
21
+ "multiple-cucumber-html-reporter",
22
+ "html-formatter",
23
+ "junit",
24
+ "junit-xml",
20
25
  "gherkin",
21
26
  "bdd",
22
27
  "html-report",
23
28
  "test-report",
24
29
  "report-generator",
30
+ "offline",
31
+ "ci",
32
+ "agent",
33
+ "llm",
25
34
  "testing"
26
35
  ],
27
36
  "engines": {
@@ -36,8 +45,14 @@
36
45
  "import": "./dist/index.js"
37
46
  },
38
47
  "./compat/cucumber-html-reporter": {
39
- "types": "./dist/compat/cucumber-html-reporter.d.ts",
40
- "import": "./dist/compat/cucumber-html-reporter.js"
48
+ "import": {
49
+ "types": "./dist/compat/cucumber-html-reporter.d.ts",
50
+ "default": "./dist/compat/cucumber-html-reporter.js"
51
+ },
52
+ "require": {
53
+ "types": "./dist/compat/cucumber-html-reporter.d.cts",
54
+ "default": "./dist/compat/cucumber-html-reporter.cjs"
55
+ }
41
56
  },
42
57
  "./package.json": "./package.json"
43
58
  },
@@ -45,6 +60,7 @@
45
60
  "files": [
46
61
  "dist",
47
62
  "README.md",
63
+ "llms.txt",
48
64
  "DESIGN.md",
49
65
  "LICENSE",
50
66
  "SECURITY.md",
@@ -52,18 +68,23 @@
52
68
  "docs/COMPATIBILITY.md",
53
69
  "docs/CUCUMBER-COMPATIBILITY.md",
54
70
  "docs/JUNIT-XML.md",
71
+ "docs/LIMITATIONS.md",
55
72
  "GLOSSARY.md"
56
73
  ],
57
74
  "scripts": {
58
75
  "clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
59
- "build": "npm run clean && npm run styles && node esbuild.mjs && tsc -p tsconfig.build.json",
76
+ "build": "npm run clean && npm run assets && node esbuild.mjs && tsc -p tsconfig.build.json && tsc -p tsconfig.compat-cjs.json",
77
+ "postbuild": "node scripts/copy-compat-cjs.mjs",
60
78
  "typecheck": "tsc --noEmit",
61
79
  "lint": "oxlint .",
62
- "test": "npm run styles && vitest run",
80
+ "test": "npm run assets && vitest run",
63
81
  "test:e2e": "playwright test",
82
+ "pretest:e2e": "npm run assets",
83
+ "assets": "node scripts/build-styles.mjs && node scripts/build-search.mjs",
64
84
  "styles": "node scripts/build-styles.mjs",
85
+ "prestress": "npm run build",
65
86
  "stress": "node scripts/stress.mjs",
66
- "check": "npm run styles && npm run typecheck && npm run lint && npm run test && npm run build",
87
+ "check": "npm run assets && npm run typecheck && npm run lint && npm run build && npm run test",
67
88
  "prepublishOnly": "npm run check"
68
89
  },
69
90
  "publishConfig": {
@@ -72,9 +93,11 @@
72
93
  },
73
94
  "dependencies": {
74
95
  "@cucumber/messages": "^34.2.1",
75
- "fast-xml-parser": "^5.12.0"
96
+ "fast-xml-parser": "^5.12.0",
97
+ "markdown-it": "^15.0.3"
76
98
  },
77
99
  "devDependencies": {
100
+ "@cucumber/tag-expressions": "^11.0.1",
78
101
  "@playwright/test": "^1.64.1",
79
102
  "@types/node": "^26.6.6",
80
103
  "esbuild": "^0.28.2",