backstage-plugin-techdocs-addon-mermaid 0.17.0 → 0.18.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/README.md +26 -5
- package/dist/alpha.esm.js +19 -0
- package/dist/alpha.esm.js.map +1 -0
- package/dist/index.d.ts +14 -2
- package/dist/index.esm.js +1 -0
- package/dist/index.esm.js.map +1 -1
- package/package.json +11 -17
- package/src/index.ts +2 -1
package/README.md
CHANGED
|
@@ -21,20 +21,41 @@ Backstage v1.2+
|
|
|
21
21
|
yarn --cwd packages/app add backstage-plugin-techdocs-addon-mermaid
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
4.
|
|
24
|
+
4. Enabling the Mermaid Addon:
|
|
25
|
+
|
|
26
|
+
- **Legacy Frontend System**: Enable the addon within techdocs viewer's within `App.tsx` and `EntityPage.tsx`
|
|
25
27
|
|
|
26
28
|
```typescript jsx
|
|
27
29
|
// packages/app/src/App.tsx
|
|
28
30
|
// packages/app/src/components/catalog/EntityPage.tsx
|
|
29
|
-
import { Mermaid } from
|
|
30
|
-
|
|
31
|
+
import { Mermaid } from "backstage-plugin-techdocs-addon-mermaid";
|
|
32
|
+
|
|
31
33
|
// ...
|
|
32
34
|
{techDocsPage}
|
|
33
35
|
<TechDocsAddons>
|
|
34
36
|
{/*...*/}
|
|
35
|
-
<Mermaid config={{ theme:
|
|
37
|
+
<Mermaid config={{ theme: "forest", themeVariables: { lineColor: "#000000" } }} />
|
|
36
38
|
</TechDocsAddons>
|
|
37
|
-
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
- **New Frontend System**: Enable the addon module within `App.tsx`:
|
|
42
|
+
|
|
43
|
+
```typescript jsx
|
|
44
|
+
// packages/app/src/App.tsx
|
|
45
|
+
import techDocsPlugin from '@backstage/plugin-techdocs/alpha';
|
|
46
|
+
import { techDocsMermaidAddonModule } from "backstage-plugin-techdocs-addon-mermaid";
|
|
47
|
+
|
|
48
|
+
// ...
|
|
49
|
+
|
|
50
|
+
const app = createApp({
|
|
51
|
+
features: [
|
|
52
|
+
// ...
|
|
53
|
+
techDocsPlugin,
|
|
54
|
+
techDocsMermaidAddonModule,
|
|
55
|
+
// ...other techdocs addon modules
|
|
56
|
+
],
|
|
57
|
+
});
|
|
58
|
+
```
|
|
38
59
|
|
|
39
60
|
## Use Mermaid in your TechDocs
|
|
40
61
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AddonBlueprint } from '@backstage/plugin-techdocs-react/alpha';
|
|
2
|
+
import { MermaidAddon } from './Mermaid/Mermaid.esm.js';
|
|
3
|
+
import { createFrontendModule } from '@backstage/frontend-plugin-api';
|
|
4
|
+
|
|
5
|
+
const techDocsMermaidAddon = AddonBlueprint.make({
|
|
6
|
+
name: "mermaid",
|
|
7
|
+
params: {
|
|
8
|
+
name: "Mermaid",
|
|
9
|
+
location: "Content",
|
|
10
|
+
component: MermaidAddon
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
const techDocsMermaidAddonModule = createFrontendModule({
|
|
14
|
+
pluginId: "techdocs",
|
|
15
|
+
extensions: [techDocsMermaidAddon]
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export { techDocsMermaidAddon, techDocsMermaidAddonModule };
|
|
19
|
+
//# sourceMappingURL=alpha.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.ts"],"sourcesContent":["import { AddonBlueprint } from \"@backstage/plugin-techdocs-react/alpha\";\nimport { MermaidAddon } from \"./Mermaid\";\nimport { createFrontendModule } from \"@backstage/frontend-plugin-api\";\n\nexport const techDocsMermaidAddon = AddonBlueprint.make({\n name: \"mermaid\",\n params: {\n name: \"Mermaid\",\n location: \"Content\",\n component: MermaidAddon,\n },\n});\n\nexport const techDocsMermaidAddonModule = createFrontendModule({\n pluginId: \"techdocs\",\n extensions: [techDocsMermaidAddon],\n});\n"],"names":[],"mappings":";;;;AAIa,MAAA,oBAAA,GAAuB,eAAe,IAAK,CAAA;AAAA,EACtD,IAAM,EAAA,SAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,SAAA;AAAA,IACN,QAAU,EAAA,SAAA;AAAA,IACV,SAAW,EAAA;AAAA;AAEf,CAAC;AAEM,MAAM,6BAA6B,oBAAqB,CAAA;AAAA,EAC7D,QAAU,EAAA,UAAA;AAAA,EACV,UAAA,EAAY,CAAC,oBAAoB;AACnC,CAAC;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
3
2
|
import { MermaidConfig, LayoutLoaderDefinition } from 'mermaid';
|
|
4
3
|
import { IconLoader } from 'mermaid/dist/rendering-util/icons';
|
|
4
|
+
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
5
|
+
import * as _backstage_plugin_techdocs_react_dist_types_types_d_BooYUMWM from '@backstage/plugin-techdocs-react/dist/types/types.d-BooYUMWM';
|
|
5
6
|
|
|
6
7
|
type MermaidProps = {
|
|
7
8
|
lightConfig?: MermaidConfig;
|
|
@@ -24,4 +25,15 @@ declare const techdocsAddonMermaidPlugin: _backstage_core_plugin_api.BackstagePl
|
|
|
24
25
|
*/
|
|
25
26
|
declare const Mermaid: (props: MermaidProps) => JSX.Element | null;
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
declare const techDocsMermaidAddon: _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
29
|
+
kind: "addon";
|
|
30
|
+
name: "mermaid";
|
|
31
|
+
config: {};
|
|
32
|
+
configInput: {};
|
|
33
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_plugin_techdocs_react_dist_types_types_d_BooYUMWM.T, "techdocs.addon", {}>;
|
|
34
|
+
inputs: {};
|
|
35
|
+
params: _backstage_plugin_techdocs_react_dist_types_types_d_BooYUMWM.T;
|
|
36
|
+
}>;
|
|
37
|
+
declare const techDocsMermaidAddonModule: _backstage_frontend_plugin_api.FrontendModule;
|
|
38
|
+
|
|
39
|
+
export { Mermaid, techDocsMermaidAddon, techDocsMermaidAddonModule, techdocsAddonMermaidPlugin };
|
package/dist/index.esm.js
CHANGED
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "backstage-plugin-techdocs-addon-mermaid",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"main": "dist/index.esm.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,10 +32,11 @@
|
|
|
32
32
|
"postpack": "backstage-cli package postpack"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@backstage/core-components": "^0.
|
|
36
|
-
"@backstage/core-plugin-api": "^1.10.
|
|
37
|
-
"@backstage/plugin-
|
|
38
|
-
"@backstage/
|
|
35
|
+
"@backstage/core-components": "^0.17.0",
|
|
36
|
+
"@backstage/core-plugin-api": "^1.10.5",
|
|
37
|
+
"@backstage/frontend-plugin-api": "^0.10.0",
|
|
38
|
+
"@backstage/plugin-techdocs-react": "^1.2.15",
|
|
39
|
+
"@backstage/theme": "^0.6.4",
|
|
39
40
|
"@material-ui/core": "^4.12.2",
|
|
40
41
|
"@material-ui/icons": "^4.11.3",
|
|
41
42
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
@@ -48,11 +49,11 @@
|
|
|
48
49
|
"react-router-dom": "^6.3.0"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
|
-
"@backstage/cli": "^0.
|
|
52
|
-
"@backstage/core-app-api": "^1.
|
|
53
|
-
"@backstage/dev-utils": "^1.1.
|
|
54
|
-
"@backstage/plugin-techdocs-addons-test-utils": "^1.0.
|
|
55
|
-
"@backstage/test-utils": "^1.7.
|
|
52
|
+
"@backstage/cli": "^0.31.0",
|
|
53
|
+
"@backstage/core-app-api": "^1.16.0",
|
|
54
|
+
"@backstage/dev-utils": "^1.1.8",
|
|
55
|
+
"@backstage/plugin-techdocs-addons-test-utils": "^1.0.46",
|
|
56
|
+
"@backstage/test-utils": "^1.7.6",
|
|
56
57
|
"@date-io/core": "^1.3.13",
|
|
57
58
|
"@svgr/core": "^6.0.0",
|
|
58
59
|
"@testing-library/dom": "^9.0.0",
|
|
@@ -78,12 +79,5 @@
|
|
|
78
79
|
"directory": "."
|
|
79
80
|
},
|
|
80
81
|
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
|
|
81
|
-
"typesVersions": {
|
|
82
|
-
"*": {
|
|
83
|
-
"index": [
|
|
84
|
-
"dist/index.d.ts"
|
|
85
|
-
]
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
82
|
"module": "./dist/index.esm.js"
|
|
89
83
|
}
|
package/src/index.ts
CHANGED
|
@@ -13,4 +13,5 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export { techdocsAddonMermaidPlugin, Mermaid } from
|
|
16
|
+
export { techdocsAddonMermaidPlugin, Mermaid } from "./plugin";
|
|
17
|
+
export { techDocsMermaidAddon, techDocsMermaidAddonModule } from "./alpha";
|