@ac-bench/reporter-markdown 0.2.1 → 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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @ac-bench/reporter-markdown
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5c203e7: The reporter factory is a named export only, `markdownReporter`; the package
8
+ no longer has a default export. `zod` is now a required peer dependency
9
+ (`^4.5.4`), passed on from `@ac-kit/app-report`.
10
+
11
+ Migration: replace `import markdownReporter from "@ac-bench/reporter-markdown"`
12
+ with `import { markdownReporter } from "@ac-bench/reporter-markdown"`, and add
13
+ `zod` to your dependencies if it is not there already.
14
+ - 5c203e7: The gate verdicts in every report. The table ends with a gates table — rows
15
+ coloured by verdict on a colour terminal, a count line, and the message of
16
+ every verdict that is not a plain pass — interactive or not, and shows the
17
+ run's progress ("fork unit 3/12") under the live region; `renderGateTable`
18
+ renders the gates table alone. Markdown gains a `## Gates` section. CSV writes
19
+ the verdicts to `<output>.gates.csv` (`gatesOutput`), only when there are any.
20
+
21
+ ### Patch Changes
22
+
23
+ - 5c203e7: The `homepage` points at the @ac-bench documentation site: `measure(1)` for the CLI, the API reference for `core`, `lib` and `gate`, the site's home for the others.
24
+ - Updated dependencies [5c203e7]
25
+ - Updated dependencies [5c203e7]
26
+ - Updated dependencies [5c203e7]
27
+ - Updated dependencies [5c203e7]
28
+ - Updated dependencies [5c203e7]
29
+ - Updated dependencies [5c203e7]
30
+ - Updated dependencies [5c203e7]
31
+ - Updated dependencies [5c203e7]
32
+ - Updated dependencies [5c203e7]
33
+ - Updated dependencies [5c203e7]
34
+ - Updated dependencies [5c203e7]
35
+ - Updated dependencies [5c203e7]
36
+ - Updated dependencies [5c203e7]
37
+ - @ac-kit/app-report@0.4.0
38
+ - @ac-bench/core@0.5.0
39
+ - @ac-kit/format-markdown@0.2.4
40
+
3
41
  ## 0.2.1
4
42
 
5
43
  ### Patch Changes
package/README.md CHANGED
@@ -1,13 +1,14 @@
1
1
  # @ac-bench/reporter-markdown
2
2
 
3
3
  Writes a benchmark run as a GitHub-flavoured Markdown document when the run
4
- ends: an environment header (run, tool, machine, runtimes), then one table per
5
- condition, titled by the condition's titles and its file. Suited to pasting into
6
- a pull request or committing next to the code the numbers describe.
4
+ ends: an environment header (run, tool, machine, runtimes), a `## Gates`
5
+ section with every verdict and their counts, then one table per condition,
6
+ titled by the condition's titles and its file. Suited to pasting into a pull
7
+ request or committing next to the code the numbers describe.
7
8
 
8
9
  ```ts
9
10
  import { defineConfig } from "@ac-bench/cli";
10
- import markdownReporter from "@ac-bench/reporter-markdown";
11
+ import { markdownReporter } from "@ac-bench/reporter-markdown";
11
12
 
12
13
  export default defineConfig({
13
14
  plugins: [markdownReporter({ output: "docs/benchmarks.md" })],
@@ -15,9 +16,12 @@ export default defineConfig({
15
16
  });
16
17
  ```
17
18
 
18
- `output` defaults to the run's output base name plus `.md`. The default export
19
+ `output` defaults to the run's output base name plus `.md`. `markdownReporter`
19
20
  is a factory because there is something to configure; call it with no arguments
20
21
  for the defaults.
21
22
 
22
23
  `@ac-bench/cli` already depends on this package and selects it by id, so listing
23
24
  it in `plugins` is only necessary to pass options.
25
+
26
+ `zod` is a peer dependency (`^4.5.4`), passed on from `@ac-kit/app-report`:
27
+ install it beside this package.
package/dist/index.d.ts CHANGED
@@ -4,5 +4,5 @@ export type MarkdownReporterOptions = {
4
4
  readonly output?: string;
5
5
  };
6
6
  /** The whole run as one GitHub-flavoured Markdown document. */
7
- export default function markdownReporter(options?: MarkdownReporterOptions): ReporterPlugin;
7
+ export declare function markdownReporter(options?: MarkdownReporterOptions): ReporterPlugin;
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGX,cAAc,EACd,MAAM,uBAAuB,CAAC;AAU/B,MAAM,MAAM,uBAAuB,GAAG;IACrC,sEAAsE;IACtE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,+DAA+D;AAE/D,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACvC,OAAO,GAAE,uBAA4B,GACnC,cAAc,CAShB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGX,cAAc,EACd,MAAM,uBAAuB,CAAC;AAY/B,MAAM,MAAM,uBAAuB,GAAG;IACrC,sEAAsE;IACtE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,+DAA+D;AAC/D,wBAAgB,gBAAgB,CAC/B,OAAO,GAAE,uBAA4B,GACnC,cAAc,CAShB"}
package/dist/index.js CHANGED
@@ -1,9 +1,8 @@
1
- import { collectConditions, collectedConditionFrame, defineReporterPlugin, } from "@ac-bench/core/plugin";
1
+ import { collectConditions, collectedConditionFrame, countVerdicts, defineReporterPlugin, gateVerdictFrame, } from "@ac-bench/core/plugin";
2
2
  import { AggregateSink } from "@ac-kit/app-report";
3
3
  import { renderFrameAsMarkdown } from "@ac-kit/format-markdown";
4
4
  /** The whole run as one GitHub-flavoured Markdown document. */
5
- // oxlint-disable-next-line ac-kit/no-default-export-with-named -- public API; rename pending owner decision
6
- export default function markdownReporter(options = {}) {
5
+ export function markdownReporter(options = {}) {
7
6
  return defineReporterPlugin({
8
7
  id: "markdown",
9
8
  createSink: (context) => new AggregateSink(context.openOutput(options.output ?? `${context.defaultOutput}.md`), formatMarkdown_(context)),
@@ -17,6 +16,16 @@ function formatMarkdown_(context) {
17
16
  if (header !== null) {
18
17
  sections.push(header);
19
18
  }
19
+ const verdicts = run.data.flatMap((item) => item.kind === "gate-verdict" ? [item.verdict] : []);
20
+ if (verdicts.length > 0) {
21
+ sections.push([
22
+ "## Gates",
23
+ "",
24
+ renderFrameAsMarkdown(gateVerdictFrame(verdicts, { title: null })),
25
+ "",
26
+ countVerdicts(verdicts),
27
+ ].join("\n"));
28
+ }
20
29
  for (const condition of collectConditions(run)) {
21
30
  const frame = collectedConditionFrame(context.registry.resolve(condition.measure), condition);
22
31
  sections.push(renderFrameAsMarkdown(frame));
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACN,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,GACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAOhE,+DAA+D;AAC/D,4GAA4G;AAC5G,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACvC,OAAO,GAA4B,EAAE;IAErC,OAAO,oBAAoB,CAAC;QAC3B,EAAE,EAAE,UAAU;QACd,UAAU,EAAE,CAAC,OAAO,EAAE,EAAE,CACvB,IAAI,aAAa,CAChB,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,KAAK,CAAC,EACnE,eAAe,CAAC,OAAO,CAAC,CACxB;KACF,CAAC,CAAC;AACJ,CAAC;AAED,mEAAmE;AACnE,SAAS,eAAe,CACvB,OAAwB;IAExB,OAAO,CAAC,GAAG,EAAE,EAAE;QACd,MAAM,QAAQ,GAAa,EAAE,CAAC;QAE9B,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YACrB,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC;QAED,KAAK,MAAM,SAAS,IAAI,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;YAChD,MAAM,KAAK,GAAG,uBAAuB,CACpC,OAAO,CA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ac-bench/reporter-markdown",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Markdown reporter for @ac-bench: writes a run as a GitHub-flavoured document, an environment header then one table per condition.",
5
5
  "keywords": [
6
6
  "benchmark",
@@ -8,7 +8,7 @@
8
8
  "markdown",
9
9
  "reporter"
10
10
  ],
11
- "homepage": "https://git.grenadine.io/anthochamp/node-essentials/src/branch/main/bench/reporter-markdown#readme",
11
+ "homepage": "https://anthochamp.pages.grenadine.io/node-essentials/bench/",
12
12
  "bugs": {
13
13
  "url": "https://git.grenadine.io/anthochamp/node-essentials/issues"
14
14
  },
@@ -44,22 +44,26 @@
44
44
  "prepack": "yarn build"
45
45
  },
46
46
  "dependencies": {
47
- "@ac-bench/core": "^0.4.0",
48
- "@ac-kit/app-report": "^0.3.1",
49
- "@ac-kit/format-markdown": "^0.2.3",
47
+ "@ac-bench/core": "^0.5.0",
48
+ "@ac-kit/app-report": "^0.4.0",
49
+ "@ac-kit/format-markdown": "^0.2.4",
50
50
  "@types/web": "^0.0.367"
51
51
  },
52
52
  "devDependencies": {
53
- "@ac-kit/model-dataset": "^0.3.0",
53
+ "@ac-kit/model-dataset": "^0.3.1",
54
54
  "@ac-kit/tsconfig": "0.1.0",
55
55
  "@ac-kit/typedoc-config": "0.1.0",
56
- "@ac-kit/vitest-config": "0.2.0",
56
+ "@ac-kit/vitest-config": "0.3.0",
57
57
  "@typescript/native": "typescript@7.0.2",
58
58
  "rimraf": "6.1.4",
59
59
  "typedoc": "0.28.20",
60
60
  "typescript": "@typescript/typescript6@6.0.2",
61
61
  "vite": "8.4.0",
62
- "vitest": "5.1.2"
62
+ "vitest": "5.1.2",
63
+ "zod": "^4.5.4"
64
+ },
65
+ "peerDependencies": {
66
+ "zod": "^4.5.4"
63
67
  },
64
68
  "engines": {
65
69
  "node": ">=24"