@allurereport/plugin-dashboard 3.20.0 → 3.21.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.
@@ -11,4 +11,5 @@ export declare const generateStaticFiles: (payload: DashboardOptions & {
11
11
  reportDataFiles: ReportFile[];
12
12
  reportUuid: string;
13
13
  reportName: string;
14
+ overviewHref?: string;
14
15
  }) => Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import { randomUUID } from "node:crypto";
2
2
  import { defaultChartsConfig } from "@allurereport/charts-api";
3
- import { createBaseUrlScript, createFontLinkTag, createReportDataScript, stringifyForInlineScript, createScriptTag, createStylesLinkTag, } from "@allurereport/core-api";
3
+ import { createBaseUrlScript, createFontLinkTag, injectReportDataScript, reportDataScriptPlaceholder, stringifyForInlineScript, createScriptTag, createStylesLinkTag, } from "@allurereport/core-api";
4
4
  import { copyReportStaticAssets, getReportStaticAsset, readReportStaticAssets, } from "@allurereport/plugin-api/static-assets";
5
5
  import { generateCharts } from "@allurereport/web-commons";
6
6
  import Handlebars from "handlebars";
@@ -57,7 +57,7 @@ export const generateEnvirontmentsList = async (writer, store) => {
57
57
  await writer.writeWidget("environments.json", environments);
58
58
  };
59
59
  export const generateStaticFiles = async (payload) => {
60
- const { reportName = "Allure Report", reportLanguage = "en", logo = "", theme = "light", reportFiles, reportDataFiles, reportUuid, allureVersion, } = payload;
60
+ const { reportName = "Allure Report", reportLanguage = "en", logo = "", theme = "light", reportFiles, reportDataFiles, reportUuid, allureVersion, overviewHref, } = payload;
61
61
  const compile = Handlebars.compile(template);
62
62
  const staticAssets = await readReportStaticAssets(reportStaticArchive);
63
63
  const { manifest } = staticAssets;
@@ -96,12 +96,13 @@ export const generateStaticFiles = async (payload) => {
96
96
  createdAt: Date.now(),
97
97
  reportUuid,
98
98
  allureVersion,
99
+ overviewHref,
99
100
  };
100
101
  try {
101
102
  const html = compile({
102
103
  headTags: headTags.join("\n"),
103
104
  bodyTags: bodyTags.join("\n"),
104
- reportFilesScript: createReportDataScript(reportDataFiles),
105
+ reportFilesScript: reportDataScriptPlaceholder,
105
106
  reportOptions: stringifyForInlineScript(reportOptions),
106
107
  analyticsEnable: true,
107
108
  allureVersion,
@@ -109,7 +110,7 @@ export const generateStaticFiles = async (payload) => {
109
110
  reportName,
110
111
  singleFile: payload.singleFile,
111
112
  });
112
- await reportFiles.addFile("index.html", Buffer.from(html, "utf8"));
113
+ await reportFiles.addFile("index.html", injectReportDataScript(html, reportDataFiles));
113
114
  }
114
115
  catch (err) {
115
116
  if (err instanceof RangeError) {
package/dist/plugin.js CHANGED
@@ -34,6 +34,7 @@ export class DashboardPlugin {
34
34
  reportDataFiles,
35
35
  reportUuid: context.reportUuid,
36
36
  reportName: context.reportName,
37
+ overviewHref: context.overviewHref,
37
38
  });
38
39
  });
39
40
  this.start = async (context) => {
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/plugin-dashboard",
3
- "version": "3.20.0",
3
+ "version": "3.21.0",
4
4
  "description": "Allure Dashboard Plugin – plugin for generating dashboard with a mix of charts",
5
5
  "keywords": [
6
6
  "allure",
@@ -28,21 +28,24 @@
28
28
  "build": "run clean && tsc --project ./tsconfig.json && node ../../scripts/pack-report-static.mjs ../web-dashboard/dist/multi ./dist/static/report.tar",
29
29
  "clean": "rimraf ./dist",
30
30
  "test": "rimraf ./out && vitest run",
31
+ "test:unit": "yarn test",
31
32
  "lint": "oxlint --import-plugin src test features stories",
32
33
  "lint:fix": "oxlint --import-plugin --fix src test features stories"
33
34
  },
34
35
  "dependencies": {
35
- "@allurereport/charts-api": "3.20.0",
36
- "@allurereport/core-api": "3.20.0",
37
- "@allurereport/plugin-api": "3.20.0",
38
- "@allurereport/web-commons": "3.20.0",
36
+ "@allurereport/charts-api": "3.21.0",
37
+ "@allurereport/core-api": "3.21.0",
38
+ "@allurereport/plugin-api": "3.21.0",
39
+ "@allurereport/web-commons": "3.21.0",
39
40
  "d3-shape": "^3.2.0",
40
- "handlebars": "^4.7.9"
41
+ "handlebars": "4.7.10"
41
42
  },
42
43
  "devDependencies": {
43
- "@allurereport/web-dashboard": "3.20.0",
44
+ "@allurereport/test-config": "3.21.0",
45
+ "@allurereport/web-dashboard": "3.21.0",
44
46
  "@types/d3-shape": "^3.1.8",
45
47
  "@types/node": "^20",
48
+ "@vitest/coverage-istanbul": "^4.1.0",
46
49
  "@vitest/runner": "^2",
47
50
  "allure-js-commons": "^3",
48
51
  "allure-vitest": "^3",