@backstage/plugin-techdocs 1.7.1-next.2 → 1.8.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 +30 -0
- package/alpha/package.json +1 -1
- package/dist/alpha.d.ts +2 -1
- package/dist/alpha.esm.js +70 -2
- package/dist/alpha.esm.js.map +1 -1
- package/dist/esm/{TechDocsCustomHome-453580db.esm.js → TechDocsCustomHome-63a41580.esm.js} +15 -12
- package/dist/esm/{TechDocsCustomHome-453580db.esm.js.map → TechDocsCustomHome-63a41580.esm.js.map} +1 -1
- package/dist/esm/TechDocsIndexPage-f0a2b203.esm.js +257 -0
- package/dist/esm/TechDocsIndexPage-f0a2b203.esm.js.map +1 -0
- package/dist/esm/{index-683d6465.esm.js → TechDocsReaderPage-ac1d5884.esm.js} +36 -689
- package/dist/esm/TechDocsReaderPage-ac1d5884.esm.js.map +1 -0
- package/dist/esm/client-3113b6a6.esm.js +166 -0
- package/dist/esm/client-3113b6a6.esm.js.map +1 -0
- package/dist/esm/{index-715820dc.esm.js → index-a1239e83.esm.js} +7 -13
- package/dist/esm/index-a1239e83.esm.js.map +1 -0
- package/dist/esm/routes-f8adf6c9.esm.js +15 -0
- package/dist/esm/routes-f8adf6c9.esm.js.map +1 -0
- package/dist/index.esm.js +268 -13
- package/dist/index.esm.js.map +1 -1
- package/package.json +23 -23
- package/dist/esm/index-683d6465.esm.js.map +0 -1
- package/dist/esm/index-715820dc.esm.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-3113b6a6.esm.js","sources":["../../src/client.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { CompoundEntityRef } from '@backstage/catalog-model';\nimport { Config } from '@backstage/config';\nimport {\n DiscoveryApi,\n FetchApi,\n IdentityApi,\n} from '@backstage/core-plugin-api';\nimport { NotFoundError, ResponseError } from '@backstage/errors';\nimport {\n SyncResult,\n TechDocsApi,\n TechDocsEntityMetadata,\n TechDocsMetadata,\n TechDocsStorageApi,\n} from '@backstage/plugin-techdocs-react';\nimport { EventSourcePolyfill } from 'event-source-polyfill';\n\n/**\n * API to talk to `techdocs-backend`.\n *\n * @public\n */\nexport class TechDocsClient implements TechDocsApi {\n public configApi: Config;\n public discoveryApi: DiscoveryApi;\n private fetchApi: FetchApi;\n\n constructor(options: {\n configApi: Config;\n discoveryApi: DiscoveryApi;\n fetchApi: FetchApi;\n }) {\n this.configApi = options.configApi;\n this.discoveryApi = options.discoveryApi;\n this.fetchApi = options.fetchApi;\n }\n\n async getApiOrigin(): Promise<string> {\n return await this.discoveryApi.getBaseUrl('techdocs');\n }\n\n /**\n * Retrieve TechDocs metadata.\n *\n * When docs are built, we generate a techdocs_metadata.json and store it along with the generated\n * static files. It includes necessary data about the docs site. This method requests techdocs-backend\n * which retrieves the TechDocs metadata.\n *\n * @param entityId - Object containing entity data like name, namespace, etc.\n */\n async getTechDocsMetadata(\n entityId: CompoundEntityRef,\n ): Promise<TechDocsMetadata> {\n const { kind, namespace, name } = entityId;\n\n const apiOrigin = await this.getApiOrigin();\n const requestUrl = `${apiOrigin}/metadata/techdocs/${namespace}/${kind}/${name}`;\n const request = await this.fetchApi.fetch(`${requestUrl}`);\n if (!request.ok) {\n throw await ResponseError.fromResponse(request);\n }\n\n return await request.json();\n }\n\n /**\n * Retrieve metadata about an entity.\n *\n * This method requests techdocs-backend which uses the catalog APIs to respond with filtered\n * information required here.\n *\n * @param entityId - Object containing entity data like name, namespace, etc.\n */\n async getEntityMetadata(\n entityId: CompoundEntityRef,\n ): Promise<TechDocsEntityMetadata> {\n const { kind, namespace, name } = entityId;\n\n const apiOrigin = await this.getApiOrigin();\n const requestUrl = `${apiOrigin}/metadata/entity/${namespace}/${kind}/${name}`;\n\n const request = await this.fetchApi.fetch(`${requestUrl}`);\n if (!request.ok) {\n throw await ResponseError.fromResponse(request);\n }\n\n return await request.json();\n }\n}\n\n/**\n * API which talks to TechDocs storage to fetch files to render.\n *\n * @public\n */\nexport class TechDocsStorageClient implements TechDocsStorageApi {\n public configApi: Config;\n public discoveryApi: DiscoveryApi;\n public identityApi: IdentityApi;\n private fetchApi: FetchApi;\n\n constructor(options: {\n configApi: Config;\n discoveryApi: DiscoveryApi;\n identityApi: IdentityApi;\n fetchApi: FetchApi;\n }) {\n this.configApi = options.configApi;\n this.discoveryApi = options.discoveryApi;\n this.identityApi = options.identityApi;\n this.fetchApi = options.fetchApi;\n }\n\n async getApiOrigin(): Promise<string> {\n return await this.discoveryApi.getBaseUrl('techdocs');\n }\n\n async getStorageUrl(): Promise<string> {\n return (\n this.configApi.getOptionalString('techdocs.storageUrl') ??\n `${await this.discoveryApi.getBaseUrl('techdocs')}/static/docs`\n );\n }\n\n async getBuilder(): Promise<string> {\n return this.configApi.getString('techdocs.builder');\n }\n\n /**\n * Fetch HTML content as text for an individual docs page in an entity's docs site.\n *\n * @param entityId - Object containing entity data like name, namespace, etc.\n * @param path - The unique path to an individual docs page e.g. overview/what-is-new\n * @returns HTML content of the docs page as string\n * @throws Throws error when the page is not found.\n */\n async getEntityDocs(\n entityId: CompoundEntityRef,\n path: string,\n ): Promise<string> {\n const { kind, namespace, name } = entityId;\n\n const storageUrl = await this.getStorageUrl();\n const url = `${storageUrl}/${namespace}/${kind}/${name}/${path}`;\n\n const request = await this.fetchApi.fetch(\n `${url.endsWith('/') ? url : `${url}/`}index.html`,\n );\n\n let errorMessage = '';\n switch (request.status) {\n case 404:\n errorMessage = 'Page not found. ';\n // path is empty for the home page of an entity's docs site\n if (!path) {\n errorMessage +=\n 'This could be because there is no index.md file in the root of the docs directory of this repository.';\n }\n throw new NotFoundError(errorMessage);\n case 500:\n errorMessage =\n 'Could not generate documentation or an error in the TechDocs backend. ';\n throw new Error(errorMessage);\n default:\n // Do nothing\n break;\n }\n\n return request.text();\n }\n\n /**\n * Check if docs are on the latest version and trigger rebuild if not\n *\n * @param entityId - Object containing entity data like name, namespace, etc.\n * @param logHandler - Callback to receive log messages from the build process\n * @returns Whether documents are currently synchronized to newest version\n * @throws Throws error on error from sync endpoint in TechDocs Backend\n */\n async syncEntityDocs(\n entityId: CompoundEntityRef,\n logHandler: (line: string) => void = () => {},\n ): Promise<SyncResult> {\n const { kind, namespace, name } = entityId;\n\n const apiOrigin = await this.getApiOrigin();\n const url = `${apiOrigin}/sync/${namespace}/${kind}/${name}`;\n const { token } = await this.identityApi.getCredentials();\n\n return new Promise((resolve, reject) => {\n // Polyfill is used to add support for custom headers and auth\n const source = new EventSourcePolyfill(url, {\n withCredentials: true,\n headers: token ? { Authorization: `Bearer ${token}` } : {},\n });\n\n source.addEventListener('log', (e: any) => {\n if (e.data) {\n logHandler(JSON.parse(e.data));\n }\n });\n\n source.addEventListener('finish', (e: any) => {\n let updated: boolean = false;\n\n if (e.data) {\n ({ updated } = JSON.parse(e.data));\n }\n\n resolve(updated ? 'updated' : 'cached');\n });\n\n source.onerror = (e: any) => {\n source.close();\n\n switch (e.status) {\n // the endpoint returned a 404 status\n case 404:\n reject(new NotFoundError(e.message));\n return;\n\n // also handles the event-stream close. the reject is ignored if the Promise was already\n // resolved by a finish event.\n default:\n reject(new Error(e.data));\n return;\n }\n };\n });\n }\n\n async getBaseUrl(\n oldBaseUrl: string,\n entityId: CompoundEntityRef,\n path: string,\n ): Promise<string> {\n const { kind, namespace, name } = entityId;\n\n const apiOrigin = await this.getApiOrigin();\n const newBaseUrl = `${apiOrigin}/static/docs/${namespace}/${kind}/${name}/${path}`;\n\n return new URL(\n oldBaseUrl,\n newBaseUrl.endsWith('/') ? newBa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G,UAAU,CAAA,CAAA,CAAA;AAAA,MACrD,QAAS,EAAA,CAAA;AAAA,GACb;AACF;;;;"}
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import '@backstage/core-plugin-api';
|
|
3
|
-
import '@backstage/errors';
|
|
4
|
-
import 'event-source-polyfill';
|
|
1
|
+
export { d as TechDocsReaderLayout, b as TechDocsReaderPage } from './TechDocsReaderPage-ac1d5884.esm.js';
|
|
5
2
|
import 'react';
|
|
6
3
|
import 'react-router-dom';
|
|
7
|
-
import '@backstage/plugin-techdocs-react';
|
|
8
|
-
import 'react-use/lib/useAsync';
|
|
9
|
-
import 'react-use/lib/useAsyncRetry';
|
|
10
4
|
import '@backstage/core-components';
|
|
5
|
+
import '@backstage/plugin-techdocs-react';
|
|
11
6
|
import '@material-ui/core';
|
|
12
7
|
import '@backstage/plugin-search-react';
|
|
13
8
|
import './TechDocsSearchResultListItem-4736f829.esm.js';
|
|
14
9
|
import '@material-ui/core/Typography';
|
|
15
10
|
import '@material-ui/lab';
|
|
16
11
|
import '@material-ui/icons/Close';
|
|
12
|
+
import '@backstage/core-plugin-api';
|
|
13
|
+
import 'react-use/lib/useAsync';
|
|
14
|
+
import 'react-use/lib/useAsyncRetry';
|
|
17
15
|
import '@backstage/integration-react';
|
|
18
16
|
import 'dompurify';
|
|
19
17
|
import '@backstage/integration';
|
|
20
18
|
import '@material-ui/icons/FeedbackOutlined';
|
|
21
|
-
import 'react-dom';
|
|
22
19
|
import 'git-url-parse';
|
|
23
20
|
import '@material-ui/icons/Menu';
|
|
24
21
|
import '@material-ui/core/IconButton';
|
|
@@ -29,9 +26,6 @@ import '@material-ui/icons/Code';
|
|
|
29
26
|
import '@backstage/plugin-catalog-react';
|
|
30
27
|
import '@backstage/catalog-model';
|
|
31
28
|
import 'lodash';
|
|
29
|
+
import './routes-f8adf6c9.esm.js';
|
|
32
30
|
import '@material-ui/icons/Settings';
|
|
33
|
-
|
|
34
|
-
import '@material-ui/styles';
|
|
35
|
-
import '@material-ui/icons/Star';
|
|
36
|
-
import '@material-ui/icons/StarBorder';
|
|
37
|
-
//# sourceMappingURL=index-715820dc.esm.js.map
|
|
31
|
+
//# sourceMappingURL=index-a1239e83.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-a1239e83.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createRouteRef } from '@backstage/core-plugin-api';
|
|
2
|
+
|
|
3
|
+
const rootRouteRef = createRouteRef({
|
|
4
|
+
id: "techdocs:index-page"
|
|
5
|
+
});
|
|
6
|
+
const rootDocsRouteRef = createRouteRef({
|
|
7
|
+
id: "techdocs:reader-page",
|
|
8
|
+
params: ["namespace", "kind", "name"]
|
|
9
|
+
});
|
|
10
|
+
const rootCatalogDocsRouteRef = createRouteRef({
|
|
11
|
+
id: "techdocs:catalog-reader-view"
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { rootRouteRef as a, rootCatalogDocsRouteRef as b, rootDocsRouteRef as r };
|
|
15
|
+
//# sourceMappingURL=routes-f8adf6c9.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes-f8adf6c9.esm.js","sources":["../../src/routes.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'techdocs:index-page',\n});\n\nexport const rootDocsRouteRef = createRouteRef({\n id: 'techdocs:reader-page',\n params: ['namespace', 'kind', 'name'],\n});\n\nexport const rootCatalogDocsRouteRef = createRouteRef({\n id: 'techdocs:catalog-reader-view',\n});\n"],"names":[],"mappings":";;AAkBO,MAAM,eAAe,cAAe,CAAA;AAAA,EACzC,EAAI,EAAA,qBAAA;AACN,CAAC,EAAA;AAEM,MAAM,mBAAmB,cAAe,CAAA;AAAA,EAC7C,EAAI,EAAA,sBAAA;AAAA,EACJ,MAAQ,EAAA,CAAC,WAAa,EAAA,MAAA,EAAQ,MAAM,CAAA;AACtC,CAAC,EAAA;AAEM,MAAM,0BAA0B,cAAe,CAAA;AAAA,EACpD,EAAI,EAAA,8BAAA;AACN,CAAC;;;;"}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
import '
|
|
1
|
+
import { createApiRef, useRouteRef, useApi, configApiRef, createPlugin, createApiFactory, discoveryApiRef, identityApiRef, fetchApiRef, createRoutableExtension } from '@backstage/core-plugin-api';
|
|
2
|
+
import { T as TechDocsStorageClient, a as TechDocsClient } from './esm/client-3113b6a6.esm.js';
|
|
3
|
+
export { a as TechDocsClient, T as TechDocsStorageClient } from './esm/client-3113b6a6.esm.js';
|
|
4
|
+
import { T as TechDocsReaderPageSubheader, a as TechDocsReaderPageContent, b as TechDocsReaderPage$1 } from './esm/TechDocsReaderPage-ac1d5884.esm.js';
|
|
5
|
+
export { R as Reader, d as TechDocsReaderLayout, a as TechDocsReaderPageContent, e as TechDocsReaderPageHeader, T as TechDocsReaderPageSubheader, c as TechDocsReaderProvider, f as TechDocsSearch } from './esm/TechDocsReaderPage-ac1d5884.esm.js';
|
|
6
|
+
import { r as rootDocsRouteRef, a as rootRouteRef, b as rootCatalogDocsRouteRef } from './esm/routes-f8adf6c9.esm.js';
|
|
7
|
+
import { t as toLowerMaybe, T as TechDocsIndexPage$1 } from './esm/TechDocsIndexPage-f0a2b203.esm.js';
|
|
8
|
+
export { a as DefaultTechDocsHome, D as DocsTable, E as EntityListDocsTable, b as TechDocsPageWrapper, c as TechDocsPicker } from './esm/TechDocsIndexPage-f0a2b203.esm.js';
|
|
9
|
+
import { ItemCardGrid, ItemCardHeader, LinkButton, WarningPanel, CodeSnippet, Progress, Link, Content, ContentHeader, MissingAnnotationEmptyState } from '@backstage/core-components';
|
|
10
|
+
import { Card, CardMedia, CardContent, CardActions, Typography } from '@material-ui/core';
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import { useEntityList, useEntityOwnership, useEntity } from '@backstage/plugin-catalog-react';
|
|
13
|
+
import { techdocsStorageApiRef as techdocsStorageApiRef$1, techdocsApiRef as techdocsApiRef$1 } from '@backstage/plugin-techdocs-react';
|
|
14
|
+
import { createSearchResultListItemExtension } from '@backstage/plugin-search-react';
|
|
15
|
+
import { Routes, Route, useRoutes } from 'react-router-dom';
|
|
16
|
+
import { getCompoundEntityRef, parseEntityRef } from '@backstage/catalog-model';
|
|
3
17
|
import '@backstage/errors';
|
|
4
18
|
import 'event-source-polyfill';
|
|
5
|
-
import 'react';
|
|
6
|
-
import 'react-router-dom';
|
|
7
|
-
import '@backstage/plugin-techdocs-react';
|
|
8
|
-
import 'react-use/lib/useAsync';
|
|
9
|
-
import 'react-use/lib/useAsyncRetry';
|
|
10
|
-
import '@backstage/core-components';
|
|
11
|
-
import '@material-ui/core';
|
|
12
|
-
import '@backstage/plugin-search-react';
|
|
13
19
|
import './esm/TechDocsSearchResultListItem-4736f829.esm.js';
|
|
14
20
|
import '@material-ui/core/Typography';
|
|
15
21
|
import '@material-ui/lab';
|
|
16
22
|
import '@material-ui/icons/Close';
|
|
23
|
+
import 'react-use/lib/useAsync';
|
|
24
|
+
import 'react-use/lib/useAsyncRetry';
|
|
17
25
|
import '@backstage/integration-react';
|
|
18
26
|
import 'dompurify';
|
|
19
27
|
import '@backstage/integration';
|
|
20
28
|
import '@material-ui/icons/FeedbackOutlined';
|
|
21
|
-
import 'react-dom';
|
|
22
29
|
import 'git-url-parse';
|
|
23
30
|
import '@material-ui/icons/Menu';
|
|
24
31
|
import '@material-ui/core/IconButton';
|
|
@@ -26,12 +33,260 @@ import 'react-use/lib/useCopyToClipboard';
|
|
|
26
33
|
import 'react-helmet';
|
|
27
34
|
import '@material-ui/core/styles';
|
|
28
35
|
import '@material-ui/icons/Code';
|
|
29
|
-
import '@backstage/plugin-catalog-react';
|
|
30
|
-
import '@backstage/catalog-model';
|
|
31
36
|
import 'lodash';
|
|
32
37
|
import '@material-ui/icons/Settings';
|
|
33
38
|
import '@material-ui/icons/Share';
|
|
34
39
|
import '@material-ui/styles';
|
|
35
40
|
import '@material-ui/icons/Star';
|
|
36
41
|
import '@material-ui/icons/StarBorder';
|
|
42
|
+
|
|
43
|
+
const techdocsStorageApiRef = createApiRef({
|
|
44
|
+
id: "plugin.techdocs.storageservice"
|
|
45
|
+
});
|
|
46
|
+
const techdocsApiRef = createApiRef({
|
|
47
|
+
id: "plugin.techdocs.service"
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const DocsCardGrid = (props) => {
|
|
51
|
+
const { entities } = props;
|
|
52
|
+
const getRouteToReaderPageFor = useRouteRef(rootDocsRouteRef);
|
|
53
|
+
const config = useApi(configApiRef);
|
|
54
|
+
if (!entities)
|
|
55
|
+
return null;
|
|
56
|
+
return /* @__PURE__ */ React.createElement(ItemCardGrid, { "data-testid": "docs-explore" }, !(entities == null ? void 0 : entities.length) ? null : entities.map((entity, index) => {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
return /* @__PURE__ */ React.createElement(Card, { key: index }, /* @__PURE__ */ React.createElement(CardMedia, null, /* @__PURE__ */ React.createElement(
|
|
59
|
+
ItemCardHeader,
|
|
60
|
+
{
|
|
61
|
+
title: (_a = entity.metadata.title) != null ? _a : entity.metadata.name
|
|
62
|
+
}
|
|
63
|
+
)), /* @__PURE__ */ React.createElement(CardContent, null, entity.metadata.description), /* @__PURE__ */ React.createElement(CardActions, null, /* @__PURE__ */ React.createElement(
|
|
64
|
+
LinkButton,
|
|
65
|
+
{
|
|
66
|
+
to: getRouteToReaderPageFor({
|
|
67
|
+
namespace: toLowerMaybe(
|
|
68
|
+
(_b = entity.metadata.namespace) != null ? _b : "default",
|
|
69
|
+
config
|
|
70
|
+
),
|
|
71
|
+
kind: toLowerMaybe(entity.kind, config),
|
|
72
|
+
name: toLowerMaybe(entity.metadata.name, config)
|
|
73
|
+
}),
|
|
74
|
+
color: "primary",
|
|
75
|
+
"data-testid": "read_docs"
|
|
76
|
+
},
|
|
77
|
+
"Read Docs"
|
|
78
|
+
)));
|
|
79
|
+
}));
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const allEntitiesGroup = {
|
|
83
|
+
title: "All Documentation",
|
|
84
|
+
filterPredicate: () => true
|
|
85
|
+
};
|
|
86
|
+
const EntityListDocsGridGroup = (props) => {
|
|
87
|
+
const { entities, group } = props;
|
|
88
|
+
const { loading: loadingOwnership, isOwnedEntity } = useEntityOwnership();
|
|
89
|
+
const shownEntities = entities.filter((entity) => {
|
|
90
|
+
if (group.filterPredicate === "ownedByUser") {
|
|
91
|
+
if (loadingOwnership) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
return isOwnedEntity(entity);
|
|
95
|
+
}
|
|
96
|
+
return typeof group.filterPredicate === "function" && group.filterPredicate(entity);
|
|
97
|
+
});
|
|
98
|
+
const titleComponent = (() => {
|
|
99
|
+
return typeof group.title === "string" ? /* @__PURE__ */ React.createElement(ContentHeader, { title: group.title }) : group.title;
|
|
100
|
+
})();
|
|
101
|
+
if (shownEntities.length === 0) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
return /* @__PURE__ */ React.createElement(Content, null, titleComponent, /* @__PURE__ */ React.createElement(DocsCardGrid, { entities: shownEntities }));
|
|
105
|
+
};
|
|
106
|
+
const EntityListDocsGrid = (props) => {
|
|
107
|
+
const { loading, error, entities } = useEntityList();
|
|
108
|
+
if (error) {
|
|
109
|
+
return /* @__PURE__ */ React.createElement(
|
|
110
|
+
WarningPanel,
|
|
111
|
+
{
|
|
112
|
+
severity: "error",
|
|
113
|
+
title: "Could not load available documentation."
|
|
114
|
+
},
|
|
115
|
+
/* @__PURE__ */ React.createElement(CodeSnippet, { language: "text", text: error.toString() })
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
if (loading) {
|
|
119
|
+
return /* @__PURE__ */ React.createElement(Progress, null);
|
|
120
|
+
}
|
|
121
|
+
if (entities.length === 0) {
|
|
122
|
+
return /* @__PURE__ */ React.createElement("div", { "data-testid": "doc-not-found" }, /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, "No documentation found that match your filter. Learn more about", " ", /* @__PURE__ */ React.createElement(Link, { to: "https://backstage.io/docs/features/techdocs/creating-and-publishing" }, "publishing documentation"), "."));
|
|
123
|
+
}
|
|
124
|
+
entities.sort(
|
|
125
|
+
(a, b) => {
|
|
126
|
+
var _a, _b;
|
|
127
|
+
return ((_a = a.metadata.title) != null ? _a : a.metadata.name).localeCompare(
|
|
128
|
+
(_b = b.metadata.title) != null ? _b : b.metadata.name
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
return /* @__PURE__ */ React.createElement(Content, null, (props.groups || [allEntitiesGroup]).map((group, index) => /* @__PURE__ */ React.createElement(
|
|
133
|
+
EntityListDocsGridGroup,
|
|
134
|
+
{
|
|
135
|
+
entities,
|
|
136
|
+
group,
|
|
137
|
+
key: `${group.title}-${index}`
|
|
138
|
+
}
|
|
139
|
+
)));
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const techdocsPlugin = createPlugin({
|
|
143
|
+
id: "techdocs",
|
|
144
|
+
apis: [
|
|
145
|
+
createApiFactory({
|
|
146
|
+
api: techdocsStorageApiRef$1,
|
|
147
|
+
deps: {
|
|
148
|
+
configApi: configApiRef,
|
|
149
|
+
discoveryApi: discoveryApiRef,
|
|
150
|
+
identityApi: identityApiRef,
|
|
151
|
+
fetchApi: fetchApiRef
|
|
152
|
+
},
|
|
153
|
+
factory: ({ configApi, discoveryApi, identityApi, fetchApi }) => new TechDocsStorageClient({
|
|
154
|
+
configApi,
|
|
155
|
+
discoveryApi,
|
|
156
|
+
identityApi,
|
|
157
|
+
fetchApi
|
|
158
|
+
})
|
|
159
|
+
}),
|
|
160
|
+
createApiFactory({
|
|
161
|
+
api: techdocsApiRef$1,
|
|
162
|
+
deps: {
|
|
163
|
+
configApi: configApiRef,
|
|
164
|
+
discoveryApi: discoveryApiRef,
|
|
165
|
+
fetchApi: fetchApiRef
|
|
166
|
+
},
|
|
167
|
+
factory: ({ configApi, discoveryApi, fetchApi }) => new TechDocsClient({
|
|
168
|
+
configApi,
|
|
169
|
+
discoveryApi,
|
|
170
|
+
fetchApi
|
|
171
|
+
})
|
|
172
|
+
})
|
|
173
|
+
],
|
|
174
|
+
routes: {
|
|
175
|
+
root: rootRouteRef,
|
|
176
|
+
docRoot: rootDocsRouteRef,
|
|
177
|
+
entityContent: rootCatalogDocsRouteRef
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
const TechdocsPage = techdocsPlugin.provide(
|
|
181
|
+
createRoutableExtension({
|
|
182
|
+
name: "TechdocsPage",
|
|
183
|
+
component: () => Promise.resolve().then(function () { return Router$1; }).then((m) => m.Router),
|
|
184
|
+
mountPoint: rootRouteRef
|
|
185
|
+
})
|
|
186
|
+
);
|
|
187
|
+
const EntityTechdocsContent = techdocsPlugin.provide(
|
|
188
|
+
createRoutableExtension({
|
|
189
|
+
name: "EntityTechdocsContent",
|
|
190
|
+
component: () => Promise.resolve().then(function () { return Router$1; }).then((m) => m.EmbeddedDocsRouter),
|
|
191
|
+
mountPoint: rootCatalogDocsRouteRef
|
|
192
|
+
})
|
|
193
|
+
);
|
|
194
|
+
const TechDocsCustomHome = techdocsPlugin.provide(
|
|
195
|
+
createRoutableExtension({
|
|
196
|
+
name: "TechDocsCustomHome",
|
|
197
|
+
component: () => import('./esm/TechDocsCustomHome-63a41580.esm.js').then(
|
|
198
|
+
(m) => m.TechDocsCustomHome
|
|
199
|
+
),
|
|
200
|
+
mountPoint: rootRouteRef
|
|
201
|
+
})
|
|
202
|
+
);
|
|
203
|
+
const TechDocsIndexPage = techdocsPlugin.provide(
|
|
204
|
+
createRoutableExtension({
|
|
205
|
+
name: "TechDocsIndexPage",
|
|
206
|
+
component: () => import('./esm/TechDocsIndexPage-f0a2b203.esm.js').then(function (n) { return n.d; }).then(
|
|
207
|
+
(m) => m.TechDocsIndexPage
|
|
208
|
+
),
|
|
209
|
+
mountPoint: rootRouteRef
|
|
210
|
+
})
|
|
211
|
+
);
|
|
212
|
+
const TechDocsReaderPage = techdocsPlugin.provide(
|
|
213
|
+
createRoutableExtension({
|
|
214
|
+
name: "TechDocsReaderPage",
|
|
215
|
+
component: () => import('./esm/index-a1239e83.esm.js').then(
|
|
216
|
+
(m) => m.TechDocsReaderPage
|
|
217
|
+
),
|
|
218
|
+
mountPoint: rootDocsRouteRef
|
|
219
|
+
})
|
|
220
|
+
);
|
|
221
|
+
const TechDocsSearchResultListItem = techdocsPlugin.provide(
|
|
222
|
+
createSearchResultListItemExtension({
|
|
223
|
+
name: "TechDocsSearchResultListItem",
|
|
224
|
+
component: () => import('./esm/TechDocsSearchResultListItem-4736f829.esm.js').then(
|
|
225
|
+
(m) => m.TechDocsSearchResultListItem
|
|
226
|
+
),
|
|
227
|
+
predicate: (result) => result.type === "techdocs"
|
|
228
|
+
})
|
|
229
|
+
);
|
|
230
|
+
|
|
231
|
+
const TECHDOCS_EXTERNAL_ANNOTATION$1 = "backstage.io/techdocs-entity";
|
|
232
|
+
const EntityPageDocs = ({ entity }) => {
|
|
233
|
+
var _a, _b;
|
|
234
|
+
let entityRef = getCompoundEntityRef(entity);
|
|
235
|
+
if ((_a = entity.metadata.annotations) == null ? void 0 : _a[TECHDOCS_EXTERNAL_ANNOTATION$1]) {
|
|
236
|
+
try {
|
|
237
|
+
entityRef = parseEntityRef(
|
|
238
|
+
(_b = entity.metadata.annotations) == null ? void 0 : _b[TECHDOCS_EXTERNAL_ANNOTATION$1]
|
|
239
|
+
);
|
|
240
|
+
} catch {
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return /* @__PURE__ */ React.createElement(TechDocsReaderPage, { entityRef }, /* @__PURE__ */ React.createElement(TechDocsReaderPageSubheader, null), /* @__PURE__ */ React.createElement(TechDocsReaderPageContent, { withSearch: false }));
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
const TECHDOCS_ANNOTATION = "backstage.io/techdocs-ref";
|
|
247
|
+
const TECHDOCS_EXTERNAL_ANNOTATION = "backstage.io/techdocs-entity";
|
|
248
|
+
const isTechDocsAvailable = (entity) => {
|
|
249
|
+
var _a, _b, _c, _d;
|
|
250
|
+
return Boolean((_b = (_a = entity == null ? void 0 : entity.metadata) == null ? void 0 : _a.annotations) == null ? void 0 : _b[TECHDOCS_ANNOTATION]) || Boolean((_d = (_c = entity == null ? void 0 : entity.metadata) == null ? void 0 : _c.annotations) == null ? void 0 : _d[TECHDOCS_EXTERNAL_ANNOTATION]);
|
|
251
|
+
};
|
|
252
|
+
const Router = () => {
|
|
253
|
+
return /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(Route, { path: "/", element: /* @__PURE__ */ React.createElement(TechDocsIndexPage$1, null) }), /* @__PURE__ */ React.createElement(
|
|
254
|
+
Route,
|
|
255
|
+
{
|
|
256
|
+
path: "/:namespace/:kind/:name/*",
|
|
257
|
+
element: /* @__PURE__ */ React.createElement(TechDocsReaderPage$1, null)
|
|
258
|
+
}
|
|
259
|
+
));
|
|
260
|
+
};
|
|
261
|
+
const EmbeddedDocsRouter = (props) => {
|
|
262
|
+
var _a, _b;
|
|
263
|
+
const { children } = props;
|
|
264
|
+
const { entity } = useEntity();
|
|
265
|
+
const element = useRoutes([
|
|
266
|
+
{
|
|
267
|
+
path: "/*",
|
|
268
|
+
element: /* @__PURE__ */ React.createElement(EntityPageDocs, { entity }),
|
|
269
|
+
children: [
|
|
270
|
+
{
|
|
271
|
+
path: "*",
|
|
272
|
+
element: children
|
|
273
|
+
}
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
]);
|
|
277
|
+
const projectId = ((_a = entity.metadata.annotations) == null ? void 0 : _a[TECHDOCS_ANNOTATION]) || ((_b = entity.metadata.annotations) == null ? void 0 : _b[TECHDOCS_EXTERNAL_ANNOTATION]);
|
|
278
|
+
if (!projectId) {
|
|
279
|
+
return /* @__PURE__ */ React.createElement(MissingAnnotationEmptyState, { annotation: [TECHDOCS_ANNOTATION] });
|
|
280
|
+
}
|
|
281
|
+
return element;
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
var Router$1 = /*#__PURE__*/Object.freeze({
|
|
285
|
+
__proto__: null,
|
|
286
|
+
isTechDocsAvailable: isTechDocsAvailable,
|
|
287
|
+
Router: Router,
|
|
288
|
+
EmbeddedDocsRouter: EmbeddedDocsRouter
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
export { DocsCardGrid, EmbeddedDocsRouter, EntityListDocsGrid, EntityTechdocsContent, Router, TechDocsCustomHome, TechDocsIndexPage, TechDocsReaderPage, TechDocsSearchResultListItem, TechdocsPage, isTechDocsAvailable, techdocsPlugin as plugin, techdocsApiRef, techdocsPlugin, techdocsStorageApiRef };
|
|
37
292
|
//# sourceMappingURL=index.esm.js.map
|
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":["../src/api.ts","../src/home/components/Grids/DocsCardGrid.tsx","../src/home/components/Grids/EntityListDocsGrid.tsx","../src/plugin.ts","../src/EntityPageDocs.tsx","../src/Router.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 { CompoundEntityRef } from '@backstage/catalog-model';\nimport {\n TechDocsEntityMetadata,\n TechDocsMetadata,\n} from '@backstage/plugin-techdocs-react';\nimport { createApiRef } from '@backstage/core-plugin-api';\n\n/**\n * Utility API reference for the {@link TechDocsStorageApi}.\n *\n * @public\n * @deprecated Import from `@backstage/plugin-techdocs-react` instead\n */\nexport const techdocsStorageApiRef = createApiRef<TechDocsStorageApi>({\n id: 'plugin.techdocs.storageservice',\n});\n\n/**\n * Utility API reference for the {@link TechDocsApi}.\n *\n * @public\n * @deprecated Import from `@backstage/plugin-techdocs-react` instead\n */\nexport const techdocsApiRef = createApiRef<TechDocsApi>({\n id: 'plugin.techdocs.service',\n});\n\n/**\n * The outcome of a docs sync operation.\n *\n * @public\n * @deprecated Import from `@backstage/plugin-techdocs-react` instead\n */\nexport type SyncResult = 'cached' | 'updated';\n\n/**\n * API which talks to TechDocs storage to fetch files to render.\n *\n * @public\n * @deprecated Import from `@backstage/plugin-techdocs-react` instead\n */\nexport interface TechDocsStorageApi {\n getApiOrigin(): Promise<string>;\n getStorageUrl(): Promise<string>;\n getBuilder(): Promise<string>;\n getEntityDocs(entityId: CompoundEntityRef, path: string): Promise<string>;\n syncEntityDocs(\n entityId: CompoundEntityRef,\n logHandler?: (line: string) => void,\n ): Promise<SyncResult>;\n getBaseUrl(\n oldBaseUrl: string,\n entityId: CompoundEntityRef,\n path: string,\n ): Promise<string>;\n}\n\n/**\n * API to talk to techdocs-backend.\n *\n * @public\n * @deprecated Import from `@backstage/plugin-techdocs-react` instead\n */\nexport interface TechDocsApi {\n getApiOrigin(): Promise<string>;\n getTechDocsMetadata(entityId: CompoundEntityRef): Promise<TechDocsMetadata>;\n getEntityMetadata(\n entityId: CompoundEntityRef,\n ): Promise<TechDocsEntityMetadata>;\n}\n","/*\n * Copyright 2021 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 { rootDocsRouteRef } from '../../../routes';\nimport { toLowerMaybe } from '../../../helpers';\nimport { Entity } from '@backstage/catalog-model';\nimport { useApi, useRouteRef, configApiRef } from '@backstage/core-plugin-api';\nimport {\n LinkButton,\n ItemCardGrid,\n ItemCardHeader,\n} from '@backstage/core-components';\nimport { Card, CardActions, CardContent, CardMedia } from '@material-ui/core';\nimport React from 'react';\n\n/**\n * Props for {@link DocsCardGrid}\n *\n * @public\n */\nexport type DocsCardGridProps = {\n entities: Entity[] | undefined;\n};\n\n/**\n * Component which accepts a list of entities and renders a item card for each entity\n *\n * @public\n */\nexport const DocsCardGrid = (props: DocsCardGridProps) => {\n const { entities } = props;\n const getRouteToReaderPageFor = useRouteRef(rootDocsRouteRef);\n const config = useApi(configApiRef);\n if (!entities) return null;\n return (\n <ItemCardGrid data-testid=\"docs-explore\">\n {!entities?.length\n ? null\n : entities.map((entity, index: number) => (\n <Card key={index}>\n <CardMedia>\n <ItemCardHeader\n title={entity.metadata.title ?? entity.metadata.name}\n />\n </CardMedia>\n <CardContent>{entity.metadata.description}</CardContent>\n <CardActions>\n <LinkButton\n to={getRouteToReaderPageFor({\n namespace: toLowerMaybe(\n entity.metadata.namespace ?? 'default',\n config,\n ),\n kind: toLowerMaybe(entity.kind, config),\n name: toLowerMaybe(entity.metadata.name, config),\n })}\n color=\"primary\"\n data-testid=\"read_docs\"\n >\n Read Docs\n </LinkButton>\n </CardActions>\n </Card>\n ))}\n </ItemCardGrid>\n );\n};\n","/*\n * Copyright 2021 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 { DocsCardGrid } from './DocsCardGrid';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n CodeSnippet,\n Content,\n ContentHeader,\n Link,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\nimport {\n useEntityList,\n useEntityOwnership,\n} from '@backstage/plugin-catalog-react';\nimport { Typography } from '@material-ui/core';\nimport React from 'react';\n\n/**\n * Props for {@link EntityListDocsGrid}\n *\n * @public\n */\nexport type DocsGroupConfig = {\n title: React.ReactNode;\n filterPredicate: ((entity: Entity) => boolean) | string;\n};\n\n/**\n * Props for {@link EntityListDocsGrid}\n *\n * @public\n */\nexport type EntityListDocsGridPageProps = {\n groups?: DocsGroupConfig[];\n};\n\nconst allEntitiesGroup: DocsGroupConfig = {\n title: 'All Documentation',\n filterPredicate: () => true,\n};\n\nconst EntityListDocsGridGroup = (props: {\n group: DocsGroupConfig;\n entities: Entity[];\n}) => {\n const { entities, group } = props;\n const { loading: loadingOwnership, isOwnedEntity } = useEntityOwnership();\n\n const shownEntities = entities.filter(entity => {\n if (group.filterPredicate === 'ownedByUser') {\n if (loadingOwnership) {\n return false;\n }\n return isOwnedEntity(entity);\n }\n\n return (\n typeof group.filterPredicate === 'function' &&\n group.filterPredicate(entity)\n );\n });\n\n const titleComponent: React.ReactNode = (() => {\n return typeof group.title === 'string' ? (\n <ContentHeader title={group.title} />\n ) : (\n group.title\n );\n })();\n\n if (shownEntities.length === 0) {\n return null;\n }\n\n return (\n <Content>\n {titleComponent}\n <DocsCardGrid entities={shownEntities} />\n </Content>\n );\n};\n\n/**\n * Component responsible to get entities from entity list context and pass down to DocsCardGrid\n *\n * @public\n */\nexport const EntityListDocsGrid = (props: EntityListDocsGridPageProps) => {\n const { loading, error, entities } = useEntityList();\n\n if (error) {\n return (\n <WarningPanel\n severity=\"error\"\n title=\"Could not load available documentation.\"\n >\n <CodeSnippet language=\"text\" text={error.toString()} />\n </WarningPanel>\n );\n }\n\n if (loading) {\n return <Progress />;\n }\n\n if (entities.length === 0) {\n return (\n <div data-testid=\"doc-not-found\">\n <Typography variant=\"body2\">\n No documentation found that match your filter. Learn more about{' '}\n <Link to=\"https://backstage.io/docs/features/techdocs/creating-and-publishing\">\n publishing documentation\n </Link>\n .\n </Typography>\n </div>\n );\n }\n\n entities.sort((a, b) =>\n (a.metadata.title ?? a.metadata.name).localeCompare(\n b.metadata.title ?? b.metadata.name,\n ),\n );\n\n return (\n <Content>\n {(props.groups || [allEntitiesGroup]).map((group, index: number) => (\n <EntityListDocsGridGroup\n entities={entities}\n group={group}\n key={`${group.title}-${index}`}\n />\n ))}\n </Content>\n );\n};\n","/*\n * Copyright 2020 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 {\n techdocsApiRef,\n techdocsStorageApiRef,\n} from '@backstage/plugin-techdocs-react';\nimport { TechDocsClient, TechDocsStorageClient } from './client';\nimport {\n rootDocsRouteRef,\n rootRouteRef,\n rootCatalogDocsRouteRef,\n} from './routes';\nimport {\n configApiRef,\n createApiFactory,\n createPlugin,\n createRoutableExtension,\n discoveryApiRef,\n fetchApiRef,\n identityApiRef,\n} from '@backstage/core-plugin-api';\nimport {\n createSearchResultListItemExtension,\n SearchResultListItemExtensionProps,\n} from '@backstage/plugin-search-react';\nimport { TechDocsSearchResultListItemProps } from './search/components/TechDocsSearchResultListItem';\n\n/**\n * The Backstage plugin that renders technical documentation for your components\n *\n * @public\n */\nexport const techdocsPlugin = createPlugin({\n id: 'techdocs',\n apis: [\n createApiFactory({\n api: techdocsStorageApiRef,\n deps: {\n configApi: configApiRef,\n discoveryApi: discoveryApiRef,\n identityApi: identityApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ configApi, discoveryApi, identityApi, fetchApi }) =>\n new TechDocsStorageClient({\n configApi,\n discoveryApi,\n identityApi,\n fetchApi,\n }),\n }),\n createApiFactory({\n api: techdocsApiRef,\n deps: {\n configApi: configApiRef,\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ configApi, discoveryApi, fetchApi }) =>\n new TechDocsClient({\n configApi,\n discoveryApi,\n fetchApi,\n }),\n }),\n ],\n routes: {\n root: rootRouteRef,\n docRoot: rootDocsRouteRef,\n entityContent: rootCatalogDocsRouteRef,\n },\n});\n\n/**\n * Routable extension used to render docs\n *\n * @public\n */\nexport const TechdocsPage = techdocsPlugin.provide(\n createRoutableExtension({\n name: 'TechdocsPage',\n component: () => import('./Router').then(m => m.Router),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * Routable extension used to render docs on Entity page\n *\n * @public\n */\nexport const EntityTechdocsContent = techdocsPlugin.provide(\n createRoutableExtension({\n name: 'EntityTechdocsContent',\n component: () => import('./Router').then(m => m.EmbeddedDocsRouter),\n mountPoint: rootCatalogDocsRouteRef,\n }),\n);\n\n/**\n * Component which takes a custom tabs config object and renders a documentation landing page.\n *\n * @public\n */\nexport const TechDocsCustomHome = techdocsPlugin.provide(\n createRoutableExtension({\n name: 'TechDocsCustomHome',\n component: () =>\n import('./home/components/TechDocsCustomHome').then(\n m => m.TechDocsCustomHome,\n ),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * Responsible for rendering the provided router element\n *\n * @public\n */\nexport const TechDocsIndexPage = techdocsPlugin.provide(\n createRoutableExtension({\n name: 'TechDocsIndexPage',\n component: () =>\n import('./home/components/TechDocsIndexPage').then(\n m => m.TechDocsIndexPage,\n ),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * Component responsible for composing a TechDocs reader page experience\n *\n * @public\n */\nexport const TechDocsReaderPage = techdocsPlugin.provide(\n createRoutableExtension({\n name: 'TechDocsReaderPage',\n component: () =>\n import('./reader/components/TechDocsReaderPage').then(\n m => m.TechDocsReaderPage,\n ),\n mountPoint: rootDocsRouteRef,\n }),\n);\n\n/**\n * React extension used to render results on Search page or modal\n *\n * @public\n */\nexport const TechDocsSearchResultListItem: (\n props: SearchResultListItemExtensionProps<TechDocsSearchResultListItemProps>,\n) => JSX.Element | null = techdocsPlugin.provide(\n createSearchResultListItemExtension({\n name: 'TechDocsSearchResultListItem',\n component: () =>\n import('./search/components/TechDocsSearchResultListItem').then(\n m => m.TechDocsSearchResultListItem,\n ),\n predicate: result => result.type === 'techdocs',\n }),\n);\n","/*\n * Copyright 2020 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 {\n Entity,\n getCompoundEntityRef,\n parseEntityRef,\n} from '@backstage/catalog-model';\n\nimport React from 'react';\nimport { TechDocsReaderPage } from './plugin';\nimport { TechDocsReaderPageContent } from './reader/components/TechDocsReaderPageContent';\nimport { TechDocsReaderPageSubheader } from './reader/components/TechDocsReaderPageSubheader';\n\nconst TECHDOCS_EXTERNAL_ANNOTATION = 'backstage.io/techdocs-entity';\n\ntype EntityPageDocsProps = { entity: Entity };\n\nexport const EntityPageDocs = ({ entity }: EntityPageDocsProps) => {\n let entityRef = getCompoundEntityRef(entity);\n\n if (entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION]) {\n try {\n entityRef = parseEntityRef(\n entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION],\n );\n } catch {\n // not a fan of this but we don't care if the parseEntityRef fails\n }\n }\n\n return (\n <TechDocsReaderPage entityRef={entityRef}>\n <TechDocsReaderPageSubheader />\n <TechDocsReaderPageContent withSearch={false} />\n </TechDocsReaderPage>\n );\n};\n","/*\n * Copyright 2020 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 React, { PropsWithChildren } from 'react';\nimport { Route, Routes, useRoutes } from 'react-router-dom';\n\nimport { Entity } from '@backstage/catalog-model';\nimport { EntityPageDocs } from './EntityPageDocs';\nimport { MissingAnnotationEmptyState } from '@backstage/core-components';\nimport { TechDocsIndexPage } from './home/components/TechDocsIndexPage';\nimport { TechDocsReaderPage } from './reader/components/TechDocsReaderPage';\nimport { useEntity } from '@backstage/plugin-catalog-react';\n\nconst TECHDOCS_ANNOTATION = 'backstage.io/techdocs-ref';\n\nconst TECHDOCS_EXTERNAL_ANNOTATION = 'backstage.io/techdocs-entity';\n\n/**\n * Helper that takes in entity and returns true/false if TechDocs is available for the entity\n *\n * @public\n */\nexport const isTechDocsAvailable = (entity: Entity) =>\n Boolean(entity?.metadata?.annotations?.[TECHDOCS_ANNOTATION]) ||\n Boolean(entity?.metadata?.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION]);\n\n/**\n * Responsible for registering routes for TechDocs, TechDocs Homepage and separate TechDocs page\n *\n * @public\n */\nexport const Router = () => {\n return (\n <Routes>\n <Route path=\"/\" element={<TechDocsIndexPage />} />\n <Route\n path=\"/:namespace/:kind/:name/*\"\n element={<TechDocsReaderPage />}\n />\n </Routes>\n );\n};\n\n/**\n * Responsible for registering route to view docs on Entity page\n *\n * @public\n */\nexport const EmbeddedDocsRouter = (props: PropsWithChildren<{}>) => {\n const { children } = props;\n const { entity } = useEntity();\n\n // Using objects instead of <Route> elements, otherwise \"outlet\" will be null on sub-pages and add-ons won't render\n const element = useRoutes([\n {\n path: '/*',\n element: <EntityPageDocs entity={entity} />,\n children: [\n {\n path: '*',\n element: children,\n },\n ],\n },\n ]);\n\n const projectId =\n entity.metadata.annotations?.[TECHDOCS_ANNOTATION] ||\n entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION];\n\n if (!projectId) {\n return <MissingAnnotationEmptyState annotation={[TECHDOCS_ANNOTATION]} />;\n }\n\n return element;\n};\n"],"names":["techdocsStorageApiRef","techdocsApiRef","TECHDOCS_EXTERNAL_ANNOTATION","TechDocsIndexPage","TechDocsReaderPage"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BO,MAAM,wBAAwB,YAAiC,CAAA;AAAA,EACpE,EAAI,EAAA,gCAAA;AACN,CAAC,EAAA;AAQM,MAAM,iBAAiB,YAA0B,CAAA;AAAA,EACtD,EAAI,EAAA,yBAAA;AACN,CAAC;;ACCY,MAAA,YAAA,GAAe,CAAC,KAA6B,KAAA;AACxD,EAAM,MAAA,EAAE,UAAa,GAAA,KAAA,CAAA;AACrB,EAAM,MAAA,uBAAA,GAA0B,YAAY,gBAAgB,CAAA,CAAA;AAC5D,EAAM,MAAA,MAAA,GAAS,OAAO,YAAY,CAAA,CAAA;AAClC,EAAA,IAAI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EAAA,EAAA,EAAA,CAAA;AA8DE,EAAM,MAAA,EAAE,UAAa,GAAA,KAAA,CAAA;AACrB,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAG7B,EAAA,MAAM,UAAU,SAAU,CAAA;AAAA,IACxB;AAAA,MACE,IAAM,EAAA,IAAA;AAAA,MACN,OAAA,kBAAU,KAAA,CAAA,aAAA,CAAA,cAAA,EAAA,EAAe,MAAgB,EAAA,CAAA;AAAA,MACzC,QAAU,EAAA;AAAA,QACR;AAAA,UACE,IAAM,EAAA,GAAA;AAAA,UACN,OAAS,EAAA,QAAA;AAAA,SACX;AAAA,OACF;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AAED,EAAM,MAAA,SAAA,GAAA,CAAA,CACJ,YAAO,QAAS,CAAA,WAAA,KAAhB,mBAA8B,mBAC9B,CAAA,MAAA,CAAA,EAAA,GAAA,MAAA,CAAO,QAAS,CAAA,WAAA,KAAhB,IAA8B,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,4BAAA,CAAA,CAAA,CAAA;AAEhC,EAAA,IAAI,CAAC,SAAW,EAAA;AACd,IAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,2BAAA,EAAA,EAA4B,UAAY,EAAA,CAAC,mBAAmB,CAAG,EAAA,CAAA,CAAA;AAAA,GACzE;AAEA,EAAO,OAAA,OAAA,CAAA;AACT;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-techdocs",
|
|
3
3
|
"description": "The Backstage plugin that renders technical documentation for your components",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.8.0",
|
|
5
5
|
"main": "./dist/index.esm.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -45,19 +45,19 @@
|
|
|
45
45
|
"clean": "backstage-cli package clean"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@backstage/catalog-model": "^1.4.3
|
|
49
|
-
"@backstage/config": "^1.1.1
|
|
50
|
-
"@backstage/core-components": "^0.13.6
|
|
51
|
-
"@backstage/core-plugin-api": "^1.7.0
|
|
52
|
-
"@backstage/errors": "^1.2.3
|
|
53
|
-
"@backstage/frontend-plugin-api": "^0.2.0
|
|
54
|
-
"@backstage/integration": "^1.7.1
|
|
55
|
-
"@backstage/integration-react": "^1.1.20
|
|
56
|
-
"@backstage/plugin-catalog-react": "^1.8.5
|
|
57
|
-
"@backstage/plugin-search-common": "^1.2.7
|
|
58
|
-
"@backstage/plugin-search-react": "^1.7.1
|
|
59
|
-
"@backstage/plugin-techdocs-react": "^1.1.12
|
|
60
|
-
"@backstage/theme": "^0.4.3
|
|
48
|
+
"@backstage/catalog-model": "^1.4.3",
|
|
49
|
+
"@backstage/config": "^1.1.1",
|
|
50
|
+
"@backstage/core-components": "^0.13.6",
|
|
51
|
+
"@backstage/core-plugin-api": "^1.7.0",
|
|
52
|
+
"@backstage/errors": "^1.2.3",
|
|
53
|
+
"@backstage/frontend-plugin-api": "^0.2.0",
|
|
54
|
+
"@backstage/integration": "^1.7.1",
|
|
55
|
+
"@backstage/integration-react": "^1.1.20",
|
|
56
|
+
"@backstage/plugin-catalog-react": "^1.8.5",
|
|
57
|
+
"@backstage/plugin-search-common": "^1.2.7",
|
|
58
|
+
"@backstage/plugin-search-react": "^1.7.1",
|
|
59
|
+
"@backstage/plugin-techdocs-react": "^1.1.12",
|
|
60
|
+
"@backstage/theme": "^0.4.3",
|
|
61
61
|
"@material-ui/core": "^4.12.2",
|
|
62
62
|
"@material-ui/icons": "^4.9.1",
|
|
63
63
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
@@ -72,18 +72,18 @@
|
|
|
72
72
|
"react-use": "^17.2.4"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"react": "^16.13.1 || ^17.0.0",
|
|
76
|
-
"react-dom": "^16.13.1 || ^17.0.0",
|
|
75
|
+
"react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
76
|
+
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
77
77
|
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@backstage/cli": "^0.23.0
|
|
81
|
-
"@backstage/core-app-api": "^1.11.0
|
|
82
|
-
"@backstage/dev-utils": "^1.0.22
|
|
83
|
-
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.1
|
|
84
|
-
"@backstage/test-utils": "^1.4.4
|
|
85
|
-
"@testing-library/dom": "^
|
|
86
|
-
"@testing-library/jest-dom": "^
|
|
80
|
+
"@backstage/cli": "^0.23.0",
|
|
81
|
+
"@backstage/core-app-api": "^1.11.0",
|
|
82
|
+
"@backstage/dev-utils": "^1.0.22",
|
|
83
|
+
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.1",
|
|
84
|
+
"@backstage/test-utils": "^1.4.4",
|
|
85
|
+
"@testing-library/dom": "^9.0.0",
|
|
86
|
+
"@testing-library/jest-dom": "^6.0.0",
|
|
87
87
|
"@testing-library/react": "^12.1.3",
|
|
88
88
|
"@testing-library/react-hooks": "^8.0.0",
|
|
89
89
|
"@testing-library/user-event": "^14.0.0",
|