backstage-plugin-techdocs-addon-mermaid 0.6.2 → 0.7.1

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/README.md CHANGED
@@ -9,13 +9,19 @@ Backstage v1.2+
9
9
  ## Getting started
10
10
 
11
11
  1. Follow [the official documentation for TechDocs Addons](https://backstage.io/docs/features/techdocs/addons#installing-and-using-addons) to enable addons for techdocs.
12
- 2. Install this plugin in your backstage app. Run the following command from the root of your backstage installation:
12
+ 2. For your backstage instance, make sure you have installed `mkdocs-techdocs-core` >= 1.0.2. Older versions will not render mermaid correctly!
13
+ ```sh
14
+ pip3 install mkdocs-techdocs-core==1.0.2
15
+ ```
16
+
17
+ 3. Install this plugin in your backstage app. Run the following command from the root of your backstage installation:
13
18
  ```
14
19
  yarn add --cwd packages/app backstage-plugin-techdocs-addon-mermaid
15
20
  ```
16
- 3. Enable the addon in your application
21
+ 4. Enable the addon within techdocs viewer's within `App.tsx` and `EntityPage.tsx`
17
22
  ```typescript jsx
18
23
  // packages/app/src/App.tsx
24
+ // packages/app/src/components/catalog/EntityPage.tsx
19
25
  import { Mermaid } from 'backstage-plugin-techdocs-addon-mermaid';
20
26
 
21
27
  // ...
package/dist/index.esm.js CHANGED
@@ -4,7 +4,7 @@ import { useEffect } from 'react';
4
4
  import { useTheme } from '@material-ui/core';
5
5
  import mermaid from 'mermaid';
6
6
 
7
- const mermaidStart = /^(\s*)(graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|journey|gantt|pie|requirementDiagram|gitGraph|C4Context)/;
7
+ const mermaidStart = /^(\s*)(graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|journey|gantt|pie|requirementDiagram|gitGraph|C4Contex|timeline)/;
8
8
  const isMermaidCode = (code) => {
9
9
  if (code.startsWith("%%{init")) {
10
10
  const codeSplitByDirectiveStart = code.split("%%");
@@ -41,6 +41,7 @@ const makeDiagram = (el, diagramText, backstagePalette, properties) => {
41
41
  };
42
42
  const MermaidAddon = (properties) => {
43
43
  const highlightTables = useShadowRootElements([".highlighttable"]);
44
+ const highlightDivs = useShadowRootElements([".highlight"]);
44
45
  const mermaidPreBlocks = useShadowRootElements([".mermaid"]);
45
46
  const theme = useTheme();
46
47
  useEffect(() => {
@@ -62,6 +63,29 @@ const MermaidAddon = (properties) => {
62
63
  makeDiagram(highlightTable, diagramText, theme.palette.type, properties);
63
64
  });
64
65
  }, [highlightTables, properties, theme.palette.type]);
66
+ useEffect(() => {
67
+ highlightDivs.forEach((highlightDiv) => {
68
+ if (!highlightDiv.classList.contains("language-text")) {
69
+ return;
70
+ }
71
+ if (highlightDiv.style.display === "none") {
72
+ return;
73
+ }
74
+ const table = highlightDiv.querySelector("table");
75
+ if (!table) {
76
+ return;
77
+ }
78
+ const codeBlock = highlightDiv.querySelector("code");
79
+ if (!codeBlock) {
80
+ return;
81
+ }
82
+ const diagramText = codeBlock.innerText;
83
+ if (!isMermaidCode(diagramText)) {
84
+ return;
85
+ }
86
+ makeDiagram(highlightDiv, diagramText, theme.palette.type, properties);
87
+ });
88
+ }, [highlightDivs, properties, theme.palette.type]);
65
89
  useEffect(() => {
66
90
  mermaidPreBlocks.forEach((mermaidPreBlock) => {
67
91
  if (mermaidPreBlock.style.display === "none") {
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/Mermaid/hooks.ts","../src/Mermaid/Mermaid.tsx","../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst mermaidStart =\n /^(\\s*)(graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|journey|gantt|pie|requirementDiagram|gitGraph|C4Context)/;\n\nexport const isMermaidCode = (code: string): boolean => {\n if (code.startsWith('%%{init')) {\n const codeSplitByDirectiveStart = code.split('%%');\n\n if (codeSplitByDirectiveStart.length > 2)\n return code.split('%%')[2].match(mermaidStart) !== null;\n }\n\n return code.match(mermaidStart) !== null;\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEffect } from 'react';\nimport { PaletteType, useTheme } from '@material-ui/core';\n\nimport { useShadowRootElements } from '@backstage/plugin-techdocs-react';\nimport mermaid from 'mermaid'\nimport { isMermaidCode } from './hooks';\nimport { MermaidProps } from './props';\nimport { BackstageTheme } from '@backstage/theme';\nimport { MermaidConfig } from 'mermaid';\n\nexport function selectConfig(backstagePalette: PaletteType, properties: MermaidProps): MermaidConfig {\n // Theme set directly in the Mermaid configuration takes\n // precedence for backwards-compatibility\n if(properties.config) {\n return properties.config;\n }\n\n if(backstagePalette === 'light') {\n return properties.lightConfig || {};\n }\n\n return properties.darkConfig || {};\n}\n\n/**\n * Show report issue button when text is highlighted\n */\n\nlet diagramId = 0\n\nconst makeDiagram = (el: HTMLDivElement | HTMLPreElement, diagramText: string, backstagePalette: PaletteType, properties: MermaidProps) => {\n el.style.display = 'none'\n\n const diagramElement = document.createElement('div')\n diagramElement.className = \"mermaid\"\n\n el.parentNode?.insertBefore(diagramElement, el.nextSibling);\n\n const id = `mermaid-${diagramId++}`\n\n const config = selectConfig(backstagePalette, properties);\n if(config) {\n mermaid.initialize(config);\n }\n\n mermaid.render(id, diagramText, (svgGraph: string) => {\n diagramElement.innerHTML = svgGraph\n });\n}\n\nexport const MermaidAddon = (properties: MermaidProps) => {\n const highlightTables = useShadowRootElements<HTMLDivElement>(['.highlighttable']);\n const mermaidPreBlocks = useShadowRootElements<HTMLPreElement>(['.mermaid']);\n const theme = useTheme<BackstageTheme>();\n\n useEffect(() => {\n highlightTables.forEach(highlightTable => {\n if (!highlightTable.classList.contains('language-text')) {\n return;\n }\n\n // Skip already processed\n if (highlightTable.style.display === 'none') {\n return\n }\n\n const codeBlock = highlightTable.querySelector('code')\n if (!codeBlock) {\n return\n }\n\n const diagramText = codeBlock.innerText\n\n // Ideally we could detect mermaid based on some annotation, but use a regex for now\n if (!isMermaidCode(diagramText)) {\n return\n }\n\n makeDiagram(highlightTable, diagramText, theme.palette.type, properties)\n });\n }, [highlightTables, properties, theme.palette.type]);\n\n useEffect(() => {\n mermaidPreBlocks.forEach(mermaidPreBlock => {\n // Skip already processed\n if (mermaidPreBlock.style.display === 'none') {\n return\n }\n\n const codeBlock = mermaidPreBlock.querySelector('code')\n if (!codeBlock) {\n return\n }\n\n const diagramText = codeBlock.innerText\n\n makeDiagram(mermaidPreBlock, diagramText, theme.palette.type, properties)\n });\n }, [mermaidPreBlocks, properties, theme.palette.type]);\n\n return null;\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createPlugin } from '@backstage/core-plugin-api';\nimport {\n createTechDocsAddonExtension,\n TechDocsAddonLocations,\n} from '@backstage/plugin-techdocs-react';\n\nimport { MermaidAddon } from './Mermaid';\nimport type { MermaidProps } from './Mermaid';\n\n/**\n * The TechDocs addons mermaid plugin\n *\n * @public\n */\n\n\nexport const techdocsAddonMermaidPlugin = createPlugin({\n id: 'techdocs-addon-mermaid',\n});\n\n/**\n * TechDocs addon that lets you render Mermaid diagrams\n *\n * @public\n */\n\n export const Mermaid = techdocsAddonMermaidPlugin.provide(\n createTechDocsAddonExtension<MermaidProps>({\n name: 'MermaidDiagram',\n location: TechDocsAddonLocations.Content,\n component: MermaidAddon,\n }),\n);\n"],"names":[],"mappings":";;;;;;AAAA,MAAM,YAAY,GAAG,qIAAqI,CAAC;AACpJ,MAAM,aAAa,GAAG,CAAC,IAAI,KAAK;AACvC,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;AAClC,IAAI,MAAM,yBAAyB,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACvD,IAAI,IAAI,yBAAyB,CAAC,MAAM,GAAG,CAAC;AAC5C,MAAM,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;AAC9D,GAAG;AACH,EAAE,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;AAC3C,CAAC;;ACHM,SAAS,YAAY,CAAC,gBAAgB,EAAE,UAAU,EAAE;AAC3D,EAAE,IAAI,UAAU,CAAC,MAAM,EAAE;AACzB,IAAI,OAAO,UAAU,CAAC,MAAM,CAAC;AAC7B,GAAG;AACH,EAAE,IAAI,gBAAgB,KAAK,OAAO,EAAE;AACpC,IAAI,OAAO,UAAU,CAAC,WAAW,IAAI,EAAE,CAAC;AACxC,GAAG;AACH,EAAE,OAAO,UAAU,CAAC,UAAU,IAAI,EAAE,CAAC;AACrC,CAAC;AACD,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,MAAM,WAAW,GAAG,CAAC,EAAE,EAAE,WAAW,EAAE,gBAAgB,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C;AACd,CAAC;;AC7DW,MAAC,0BAA0B,GAAG,YAAY,CAAC;AACvD,EAAE,EAAE,EAAE,wBAAwB;AAC9B,CAAC,EAAE;AACS,MAAC,OAAO,GAAG,0BAA0B,CAAC,OAAO;AACzD,EAAE,4BAA4B,CAAC;AAC/B,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,QAAQ,EAAE,sBAAsB,CAAC,OAAO;AAC5C,IAAI,SAAS,EAAE,YAAY;AAC3B,GAAG,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/Mermaid/hooks.ts","../src/Mermaid/Mermaid.tsx","../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst mermaidStart =\n /^(\\s*)(graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|journey|gantt|pie|requirementDiagram|gitGraph|C4Contex|timeline)/;\n\nexport const isMermaidCode = (code: string): boolean => {\n if (code.startsWith('%%{init')) {\n const codeSplitByDirectiveStart = code.split('%%');\n\n if (codeSplitByDirectiveStart.length > 2)\n return code.split('%%')[2].match(mermaidStart) !== null;\n }\n\n return code.match(mermaidStart) !== null;\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEffect } from 'react';\nimport { PaletteType, useTheme } from '@material-ui/core';\n\nimport { useShadowRootElements } from '@backstage/plugin-techdocs-react';\nimport mermaid from 'mermaid'\nimport { isMermaidCode } from './hooks';\nimport { MermaidProps } from './props';\nimport { BackstageTheme } from '@backstage/theme';\nimport { MermaidConfig } from 'mermaid';\n\nexport function selectConfig(backstagePalette: PaletteType, properties: MermaidProps): MermaidConfig {\n // Theme set directly in the Mermaid configuration takes\n // precedence for backwards-compatibility\n if(properties.config) {\n return properties.config;\n }\n\n if(backstagePalette === 'light') {\n return properties.lightConfig || {};\n }\n\n return properties.darkConfig || {};\n}\n\n/**\n * Show report issue button when text is highlighted\n */\n\nlet diagramId = 0\n\nconst makeDiagram = (el: HTMLDivElement | HTMLPreElement, diagramText: string, backstagePalette: PaletteType, properties: MermaidProps) => {\n el.style.display = 'none'\n\n const diagramElement = document.createElement('div')\n diagramElement.className = \"mermaid\"\n\n el.parentNode?.insertBefore(diagramElement, el.nextSibling);\n\n const id = `mermaid-${diagramId++}`\n\n const config = selectConfig(backstagePalette, properties);\n if(config) {\n mermaid.initialize(config);\n }\n\n mermaid.render(id, diagramText, (svgGraph: string) => {\n diagramElement.innerHTML = svgGraph\n });\n}\n\nexport const MermaidAddon = (properties: MermaidProps) => {\n const highlightTables = useShadowRootElements<HTMLDivElement>(['.highlighttable']);\n const highlightDivs = useShadowRootElements<HTMLDivElement>(['.highlight']);\n const mermaidPreBlocks = useShadowRootElements<HTMLPreElement>(['.mermaid']);\n const theme = useTheme<BackstageTheme>();\n\n useEffect(() => {\n highlightTables.forEach(highlightTable => {\n if (!highlightTable.classList.contains('language-text')) {\n return;\n }\n\n // Skip already processed\n if (highlightTable.style.display === 'none') {\n return\n }\n\n const codeBlock = highlightTable.querySelector('code')\n if (!codeBlock) {\n return\n }\n\n const diagramText = codeBlock.innerText\n\n // Ideally we could detect mermaid based on some annotation, but use a regex for now\n if (!isMermaidCode(diagramText)) {\n return\n }\n\n makeDiagram(highlightTable, diagramText, theme.palette.type, properties)\n });\n }, [highlightTables, properties, theme.palette.type]);\n\n useEffect(() => {\n highlightDivs.forEach(highlightDiv => {\n if (!highlightDiv.classList.contains('language-text')) {\n return;\n }\n\n // Skip already processed\n if (highlightDiv.style.display === 'none') {\n return\n }\n\n // skip mkdocs-material < 9 code blocks (handled above)\n const table = highlightDiv.querySelector('table')\n if (!table) {\n return\n }\n\n const codeBlock = highlightDiv.querySelector('code')\n if (!codeBlock) {\n return\n }\n\n const diagramText = codeBlock.innerText\n\n // Ideally we could detect mermaid based on some annotation, but use a regex for now\n if (!isMermaidCode(diagramText)) {\n return\n }\n\n makeDiagram(highlightDiv, diagramText, theme.palette.type, properties)\n });\n }, [highlightDivs, properties, theme.palette.type]);\n\n useEffect(() => {\n mermaidPreBlocks.forEach(mermaidPreBlock => {\n // Skip already processed\n if (mermaidPreBlock.style.display === 'none') {\n return\n }\n\n const codeBlock = mermaidPreBlock.querySelector('code')\n if (!codeBlock) {\n return\n }\n\n const diagramText = codeBlock.innerText\n\n makeDiagram(mermaidPreBlock, diagramText, theme.palette.type, properties)\n });\n }, [mermaidPreBlocks, properties, theme.palette.type]);\n\n return null;\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createPlugin } from '@backstage/core-plugin-api';\nimport {\n createTechDocsAddonExtension,\n TechDocsAddonLocations,\n} from '@backstage/plugin-techdocs-react';\n\nimport { MermaidAddon } from './Mermaid';\nimport type { MermaidProps } from './Mermaid';\n\n/**\n * The TechDocs addons mermaid plugin\n *\n * @public\n */\n\n\nexport const techdocsAddonMermaidPlugin = createPlugin({\n id: 'techdocs-addon-mermaid',\n});\n\n/**\n * TechDocs addon that lets you render Mermaid diagrams\n *\n * @public\n */\n\n export const Mermaid = techdocsAddonMermaidPlugin.provide(\n createTechDocsAddonExtension<MermaidProps>({\n name: 'MermaidDiagram',\n location: TechDocsAddonLocations.Content,\n component: MermaidAddon,\n }),\n);\n"],"names":[],"mappings":";;;;;;AAAA,MAAM,YAAY,GAAG,6IAA6I,CAAC;AAC5J,MAAM,aAAa,GAAG,CAAC,IAAI,KAAK;AACvC,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;AAClC,IAAI,MAAM,yBAAyB,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACvD,IAAI,IAAI,yBAAyB,CAAC,MAAM,GAAG,CAAC;AAC5C,MAAM,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;AAC9D,GAAG;AACH,EAAE,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;AAC3C,CAAC;;ACHM,SAAS,YAAY,CAAC,gBAAgB,EAAE,UAAU,EAAE;AAC3D,EAAE,IAAI,UAAU,CAAC,MAAM,EAAE;AACzB,IAAI,OAAO,UAAU,CAAC,MAAM,CAAC;AAC7B,GAAG;AACH,EAAE,IAAI,gBAAgB,KAAK,OAAO,EAAE;AACpC,IAAI,OAAO,UAAU,CAAC,WAAW,IAAI,EAAE,CAAC;AACxC,GAAG;AACH,EAAE,OAAO,UAAU,CAAC,UAAU,IAAI,EAAE,CAAC;AACrC,CAAC;AACD,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,MAAM,WAAW,GAAG,CAAC,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,KAAK;AACvE,EAAE,IAAI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AAI,SAAS,EAAE,YAAY;AAC3B,GAAG,CAAC;AACJ;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backstage-plugin-techdocs-addon-mermaid",
3
- "version": "0.6.2",
3
+ "version": "0.7.1",
4
4
  "main": "dist/index.esm.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "MIT",
@@ -27,25 +27,25 @@
27
27
  "postpack": "backstage-cli package postpack"
28
28
  },
29
29
  "dependencies": {
30
- "@backstage/core-components": "^0.12.3",
31
- "@backstage/core-plugin-api": "^1.3.0",
32
- "@backstage/plugin-techdocs-react": "^1.1.2",
33
- "@backstage/theme": "^0.2.16",
30
+ "@backstage/core-components": "^0.13.1",
31
+ "@backstage/core-plugin-api": "^1.5.1",
32
+ "@backstage/plugin-techdocs-react": "^1.1.6",
33
+ "@backstage/theme": "^0.3.0",
34
34
  "@material-ui/core": "^4.12.2",
35
35
  "@material-ui/icons": "^4.11.3",
36
36
  "@material-ui/lab": "4.0.0-alpha.57",
37
- "mermaid": "^9.3.0",
37
+ "mermaid": "^9.4.0",
38
38
  "react-use": "^17.2.4"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "react": "^16.13.1 || ^17.0.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@backstage/cli": "^0.22.1",
45
- "@backstage/core-app-api": "^1.4.0",
46
- "@backstage/dev-utils": "^1.0.11",
47
- "@backstage/plugin-techdocs-addons-test-utils": "^1.0.9",
48
- "@backstage/test-utils": "^1.2.4",
44
+ "@backstage/cli": "^0.22.7",
45
+ "@backstage/core-app-api": "^1.8.0",
46
+ "@backstage/dev-utils": "^1.0.15",
47
+ "@backstage/plugin-techdocs-addons-test-utils": "^1.0.14",
48
+ "@backstage/test-utils": "^1.3.1",
49
49
  "@date-io/core": "^1.3.13",
50
50
  "@svgr/core": "^6.0.0",
51
51
  "@testing-library/dom": ">=7.21.4",
@@ -64,5 +64,10 @@
64
64
  },
65
65
  "files": [
66
66
  "dist"
67
- ]
67
+ ],
68
+ "repository": {
69
+ "type": "git",
70
+ "url": "https://github.com/johanneswuerbach/backstage-plugin-techdocs-addon-mermaid"
71
+ },
72
+ "module": "./dist/index.esm.js"
68
73
  }