@backstage/plugin-api-docs 0.0.0-nightly-20240815021638 → 0.0.0-nightly-20240816021916

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,22 +1,23 @@
1
1
  # @backstage/plugin-api-docs
2
2
 
3
- ## 0.0.0-nightly-20240815021638
3
+ ## 0.0.0-nightly-20240816021916
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - 770ba02: `ConsumingComponentsCard` and `ProvidingComponentsCard` will now optionally accept `columns` to override which table columns are displayed
8
+ - fe1fbb2: Migrating usages of the deprecated `createExtension` `v1` format to the newer `v2` format, and old `create*Extension` extension creators to blueprints.
8
9
  - 4b6d2cb: Updated dependency `@graphiql/react` to `^0.23.0`.
9
10
  - 6582799: Add `tableOptions` to all tables and additionally `title` to API tables.
10
11
  - Updated dependencies
11
- - @backstage/plugin-catalog@0.0.0-nightly-20240815021638
12
- - @backstage/frontend-plugin-api@0.0.0-nightly-20240815021638
13
- - @backstage/plugin-catalog-react@0.0.0-nightly-20240815021638
14
- - @backstage/core-components@0.0.0-nightly-20240815021638
15
- - @backstage/core-compat-api@0.0.0-nightly-20240815021638
16
- - @backstage/catalog-model@0.0.0-nightly-20240815021638
12
+ - @backstage/plugin-catalog@0.0.0-nightly-20240816021916
13
+ - @backstage/frontend-plugin-api@0.0.0-nightly-20240816021916
14
+ - @backstage/plugin-catalog-react@0.0.0-nightly-20240816021916
15
+ - @backstage/core-components@0.0.0-nightly-20240816021916
16
+ - @backstage/core-compat-api@0.0.0-nightly-20240816021916
17
+ - @backstage/catalog-model@0.0.0-nightly-20240816021916
17
18
  - @backstage/core-plugin-api@1.9.3
18
- - @backstage/plugin-catalog-common@0.0.0-nightly-20240815021638
19
- - @backstage/plugin-permission-react@0.0.0-nightly-20240815021638
19
+ - @backstage/plugin-catalog-common@0.0.0-nightly-20240816021916
20
+ - @backstage/plugin-permission-react@0.0.0-nightly-20240816021916
20
21
 
21
22
  ## 0.11.8-next.3
22
23
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-api-docs__alpha",
3
- "version": "0.0.0-nightly-20240815021638",
3
+ "version": "0.0.0-nightly-20240816021916",
4
4
  "main": "../dist/alpha.esm.js",
5
5
  "module": "../dist/alpha.esm.js",
6
6
  "types": "../dist/alpha.d.ts"
package/dist/alpha.d.ts CHANGED
@@ -1,9 +1,119 @@
1
+ import * as _backstage_catalog_model from '@backstage/catalog-model';
2
+ import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
1
3
  import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
4
+ import React__default from 'react';
2
5
 
3
6
  declare const _default: _backstage_frontend_plugin_api.BackstagePlugin<{
4
7
  root: _backstage_frontend_plugin_api.RouteRef<undefined>;
5
8
  }, {
6
9
  registerApi: _backstage_frontend_plugin_api.ExternalRouteRef<undefined>;
7
- }, {}>;
10
+ }, {
11
+ "nav-item:api-docs": _backstage_frontend_plugin_api.ExtensionDefinition<{}, {}, _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<{
12
+ title: string;
13
+ icon: _backstage_core_plugin_api.IconComponent;
14
+ routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
15
+ }, "core.nav-item.target", {}>, {}, "nav-item", undefined, undefined>;
16
+ "api:api-docs/config": _backstage_frontend_plugin_api.ExtensionDefinition<{}, {}, _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>, {}, "api", undefined, "config">;
17
+ "page:api-docs": _backstage_frontend_plugin_api.ExtensionDefinition<{
18
+ initiallySelectedFilter: "all" | "owned" | "starred" | undefined;
19
+ } & {
20
+ path: string | undefined;
21
+ }, {
22
+ initiallySelectedFilter?: "all" | "owned" | "starred" | undefined;
23
+ } & {
24
+ path?: string | undefined;
25
+ }, _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
26
+ optional: true;
27
+ }>, {
28
+ [x: string]: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.AnyExtensionDataRef, {
29
+ optional: boolean;
30
+ singleton: boolean;
31
+ }>;
32
+ }, "page", undefined, undefined>;
33
+ "entity-card:api-docs/has-apis": _backstage_frontend_plugin_api.ExtensionDefinition<{
34
+ filter: string | undefined;
35
+ }, {
36
+ filter?: string | undefined;
37
+ }, _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
38
+ optional: true;
39
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
40
+ optional: true;
41
+ }>, {}, "entity-card", undefined, "has-apis">;
42
+ "entity-card:api-docs/definition": _backstage_frontend_plugin_api.ExtensionDefinition<{
43
+ filter: string | undefined;
44
+ }, {
45
+ filter?: string | undefined;
46
+ }, _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
47
+ optional: true;
48
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
49
+ optional: true;
50
+ }>, {}, "entity-card", undefined, "definition">;
51
+ "entity-card:api-docs/consumed-apis": _backstage_frontend_plugin_api.ExtensionDefinition<{
52
+ filter: string | undefined;
53
+ }, {
54
+ filter?: string | undefined;
55
+ }, _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
56
+ optional: true;
57
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
58
+ optional: true;
59
+ }>, {}, "entity-card", undefined, "consumed-apis">;
60
+ "entity-card:api-docs/provided-apis": _backstage_frontend_plugin_api.ExtensionDefinition<{
61
+ filter: string | undefined;
62
+ }, {
63
+ filter?: string | undefined;
64
+ }, _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
65
+ optional: true;
66
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
67
+ optional: true;
68
+ }>, {}, "entity-card", undefined, "provided-apis">;
69
+ "entity-card:api-docs/consuming-components": _backstage_frontend_plugin_api.ExtensionDefinition<{
70
+ filter: string | undefined;
71
+ }, {
72
+ filter?: string | undefined;
73
+ }, _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
74
+ optional: true;
75
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
76
+ optional: true;
77
+ }>, {}, "entity-card", undefined, "consuming-components">;
78
+ "entity-card:api-docs/providing-components": _backstage_frontend_plugin_api.ExtensionDefinition<{
79
+ filter: string | undefined;
80
+ }, {
81
+ filter?: string | undefined;
82
+ }, _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
83
+ optional: true;
84
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
85
+ optional: true;
86
+ }>, {}, "entity-card", undefined, "providing-components">;
87
+ "entity-content:api-docs/definition": _backstage_frontend_plugin_api.ExtensionDefinition<{
88
+ path: string | undefined;
89
+ title: string | undefined;
90
+ filter: string | undefined;
91
+ }, {
92
+ filter?: string | undefined;
93
+ title?: string | undefined;
94
+ path?: string | undefined;
95
+ }, _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
96
+ optional: true;
97
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-content-title", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
98
+ optional: true;
99
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
100
+ optional: true;
101
+ }>, {}, "entity-content", undefined, "definition">;
102
+ "entity-content:api-docs/apis": _backstage_frontend_plugin_api.ExtensionDefinition<{
103
+ path: string | undefined;
104
+ title: string | undefined;
105
+ filter: string | undefined;
106
+ }, {
107
+ filter?: string | undefined;
108
+ title?: string | undefined;
109
+ path?: string | undefined;
110
+ }, _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
111
+ optional: true;
112
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-content-title", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
113
+ optional: true;
114
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
115
+ optional: true;
116
+ }>, {}, "entity-content", undefined, "apis">;
117
+ }>;
8
118
 
9
119
  export { _default as default };
package/dist/alpha.esm.js CHANGED
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import Grid from '@material-ui/core/Grid';
3
- import { createNavItemExtension, createApiExtension, createApiFactory, createPageExtension, createSchemaFromZod, createFrontendPlugin } from '@backstage/frontend-plugin-api';
3
+ import { NavItemBlueprint, ApiBlueprint, createApiFactory, PageBlueprint, createFrontendPlugin } from '@backstage/frontend-plugin-api';
4
4
  import { convertLegacyRouteRef, compatWrapper } from '@backstage/core-compat-api';
5
- import { createEntityCardExtension, createEntityContentExtension } from '@backstage/plugin-catalog-react/alpha';
6
5
  import { RELATION_HAS_PART, parseEntityRef } from '@backstage/catalog-model';
7
6
  import '@backstage/plugin-catalog-react';
8
7
  import '@material-ui/lab/Alert';
@@ -12,130 +11,154 @@ import '@backstage/core-plugin-api';
12
11
  import { defaultDefinitionWidgets } from './components/ApiDefinitionCard/ApiDefinitionWidget.esm.js';
13
12
  import '@material-ui/core/Typography';
14
13
  import { rootRoute, registerComponentRouteRef } from './routes.esm.js';
14
+ import { EntityCardBlueprint, EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';
15
15
 
16
- const apiDocsNavItem = createNavItemExtension({
17
- title: "APIs",
18
- routeRef: convertLegacyRouteRef(rootRoute),
19
- icon: () => compatWrapper(/* @__PURE__ */ React.createElement(AppIcon, { id: "kind:api" }))
16
+ const apiDocsNavItem = NavItemBlueprint.make({
17
+ params: {
18
+ title: "APIs",
19
+ routeRef: convertLegacyRouteRef(rootRoute),
20
+ icon: () => compatWrapper(/* @__PURE__ */ React.createElement(AppIcon, { id: "kind:api" }))
21
+ }
20
22
  });
21
- const apiDocsConfigApi = createApiExtension({
22
- factory: createApiFactory({
23
- api: apiDocsConfigRef,
24
- deps: {},
25
- factory: () => {
26
- const definitionWidgets = defaultDefinitionWidgets();
27
- return {
28
- getApiDefinitionWidget: (apiEntity) => {
29
- return definitionWidgets.find((d) => d.type === apiEntity.spec.type);
30
- }
31
- };
32
- }
33
- })
23
+ const apiDocsConfigApi = ApiBlueprint.make({
24
+ name: "config",
25
+ params: {
26
+ factory: createApiFactory({
27
+ api: apiDocsConfigRef,
28
+ deps: {},
29
+ factory: () => {
30
+ const definitionWidgets = defaultDefinitionWidgets();
31
+ return {
32
+ getApiDefinitionWidget: (apiEntity) => {
33
+ return definitionWidgets.find((d) => d.type === apiEntity.spec.type);
34
+ }
35
+ };
36
+ }
37
+ })
38
+ }
34
39
  });
35
- const apiDocsExplorerPage = createPageExtension({
36
- defaultPath: "/api-docs",
37
- routeRef: convertLegacyRouteRef(rootRoute),
38
- // Mapping DefaultApiExplorerPageProps to config
39
- configSchema: createSchemaFromZod(
40
- (z) => z.object({
41
- path: z.string().default("/api-docs"),
42
- initiallySelectedFilter: z.enum(["owned", "starred", "all"]).optional()
40
+ const apiDocsExplorerPage = PageBlueprint.makeWithOverrides({
41
+ config: {
42
+ schema: {
43
43
  // Ommiting columns and actions for now as their types are too complex to map to zod
44
- })
45
- ),
46
- loader: ({ config }) => import('./components/ApiExplorerPage/index.esm.js').then(
47
- (m) => compatWrapper(
48
- /* @__PURE__ */ React.createElement(
49
- m.ApiExplorerIndexPage,
50
- {
51
- initiallySelectedFilter: config.initiallySelectedFilter
52
- }
44
+ initiallySelectedFilter: (z) => z.enum(["owned", "starred", "all"]).optional()
45
+ }
46
+ },
47
+ factory(originalFactory, { config }) {
48
+ return originalFactory({
49
+ defaultPath: "/api-docs",
50
+ routeRef: convertLegacyRouteRef(rootRoute),
51
+ loader: () => import('./components/ApiExplorerPage/index.esm.js').then(
52
+ (m) => compatWrapper(
53
+ /* @__PURE__ */ React.createElement(
54
+ m.ApiExplorerIndexPage,
55
+ {
56
+ initiallySelectedFilter: config.initiallySelectedFilter
57
+ }
58
+ )
59
+ )
53
60
  )
54
- )
55
- )
61
+ });
62
+ }
56
63
  });
57
- const apiDocsHasApisEntityCard = createEntityCardExtension({
64
+ const apiDocsHasApisEntityCard = EntityCardBlueprint.make({
58
65
  name: "has-apis",
59
- // Ommiting configSchema for now
60
- // We are skipping variants and columns are too complex to map to zod
61
- // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
62
- filter: (entity) => {
63
- return entity.kind === "Component" && entity.relations?.some(
64
- ({ type, targetRef }) => type.toLocaleLowerCase("en-US") === RELATION_HAS_PART && parseEntityRef(targetRef).kind === "API"
65
- );
66
- },
67
- loader: () => import('./components/ApisCards/index.esm.js').then(
68
- (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.HasApisCard, null))
69
- )
66
+ params: {
67
+ // Ommiting configSchema for now
68
+ // We are skipping variants and columns are too complex to map to zod
69
+ // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
70
+ filter: (entity) => {
71
+ return entity.kind === "Component" && entity.relations?.some(
72
+ ({ type, targetRef }) => type.toLocaleLowerCase("en-US") === RELATION_HAS_PART && parseEntityRef(targetRef).kind === "API"
73
+ );
74
+ },
75
+ loader: () => import('./components/ApisCards/index.esm.js').then(
76
+ (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.HasApisCard, null))
77
+ )
78
+ }
70
79
  });
71
- const apiDocsDefinitionEntityCard = createEntityCardExtension({
80
+ const apiDocsDefinitionEntityCard = EntityCardBlueprint.make({
72
81
  name: "definition",
73
- filter: "kind:api",
74
- loader: () => import('./components/ApiDefinitionCard/index.esm.js').then(
75
- (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.ApiDefinitionCard, null))
76
- )
82
+ params: {
83
+ filter: "kind:api",
84
+ loader: () => import('./components/ApiDefinitionCard/index.esm.js').then(
85
+ (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.ApiDefinitionCard, null))
86
+ )
87
+ }
77
88
  });
78
- const apiDocsConsumedApisEntityCard = createEntityCardExtension({
89
+ const apiDocsConsumedApisEntityCard = EntityCardBlueprint.make({
79
90
  name: "consumed-apis",
80
- // Ommiting configSchema for now
81
- // We are skipping variants and columns are too complex to map to zod
82
- // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
83
- filter: "kind:component",
84
- loader: () => import('./components/ApisCards/index.esm.js').then(
85
- (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.ConsumedApisCard, null))
86
- )
91
+ params: {
92
+ // Ommiting configSchema for now
93
+ // We are skipping variants and columns are too complex to map to zod
94
+ // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
95
+ filter: "kind:component",
96
+ loader: () => import('./components/ApisCards/index.esm.js').then(
97
+ (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.ConsumedApisCard, null))
98
+ )
99
+ }
87
100
  });
88
- const apiDocsProvidedApisEntityCard = createEntityCardExtension({
101
+ const apiDocsProvidedApisEntityCard = EntityCardBlueprint.make({
89
102
  name: "provided-apis",
90
- // Ommiting configSchema for now
91
- // We are skipping variants and columns are too complex to map to zod
92
- // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
93
- filter: "kind:component",
94
- loader: () => import('./components/ApisCards/index.esm.js').then(
95
- (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.ProvidedApisCard, null))
96
- )
103
+ params: {
104
+ // Ommiting configSchema for now
105
+ // We are skipping variants and columns are too complex to map to zod
106
+ // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
107
+ filter: "kind:component",
108
+ loader: () => import('./components/ApisCards/index.esm.js').then(
109
+ (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.ProvidedApisCard, null))
110
+ )
111
+ }
97
112
  });
98
- const apiDocsConsumingComponentsEntityCard = createEntityCardExtension({
113
+ const apiDocsConsumingComponentsEntityCard = EntityCardBlueprint.make({
99
114
  name: "consuming-components",
100
- // Ommiting configSchema for now
101
- // We are skipping variants
102
- // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
103
- filter: "kind:api",
104
- loader: () => import('./components/ComponentsCards/index.esm.js').then(
105
- (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.ConsumingComponentsCard, null))
106
- )
115
+ params: {
116
+ // Ommiting configSchema for now
117
+ // We are skipping variants
118
+ // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
119
+ filter: "kind:api",
120
+ loader: () => import('./components/ComponentsCards/index.esm.js').then(
121
+ (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.ConsumingComponentsCard, null))
122
+ )
123
+ }
107
124
  });
108
- const apiDocsProvidingComponentsEntityCard = createEntityCardExtension({
125
+ const apiDocsProvidingComponentsEntityCard = EntityCardBlueprint.make({
109
126
  name: "providing-components",
110
- // Ommiting configSchema for now
111
- // We are skipping variants
112
- // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
113
- filter: "kind:api",
114
- loader: () => import('./components/ComponentsCards/index.esm.js').then(
115
- (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.ProvidingComponentsCard, null))
116
- )
127
+ params: {
128
+ // Ommiting configSchema for now
129
+ // We are skipping variants
130
+ // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
131
+ filter: "kind:api",
132
+ loader: () => import('./components/ComponentsCards/index.esm.js').then(
133
+ (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.ProvidingComponentsCard, null))
134
+ )
135
+ }
117
136
  });
118
- const apiDocsDefinitionEntityContent = createEntityContentExtension({
137
+ const apiDocsDefinitionEntityContent = EntityContentBlueprint.make({
119
138
  name: "definition",
120
- defaultPath: "/defintion",
121
- defaultTitle: "Definition",
122
- filter: "kind:api",
123
- loader: async () => import('./components/ApiDefinitionCard/index.esm.js').then(
124
- (m) => compatWrapper(
125
- /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3 }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(m.ApiDefinitionCard, null)))
139
+ params: {
140
+ defaultPath: "/defintion",
141
+ defaultTitle: "Definition",
142
+ filter: "kind:api",
143
+ loader: async () => import('./components/ApiDefinitionCard/index.esm.js').then(
144
+ (m) => compatWrapper(
145
+ /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3 }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(m.ApiDefinitionCard, null)))
146
+ )
126
147
  )
127
- )
148
+ }
128
149
  });
129
- const apiDocsApisEntityContent = createEntityContentExtension({
150
+ const apiDocsApisEntityContent = EntityContentBlueprint.make({
130
151
  name: "apis",
131
- defaultPath: "/apis",
132
- defaultTitle: "APIs",
133
- filter: "kind:component",
134
- loader: async () => import('./components/ApisCards/index.esm.js').then(
135
- (m) => compatWrapper(
136
- /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3, alignItems: "stretch" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(m.ProvidedApisCard, null)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(m.ConsumedApisCard, null)))
152
+ params: {
153
+ defaultPath: "/apis",
154
+ defaultTitle: "APIs",
155
+ filter: "kind:component",
156
+ loader: async () => import('./components/ApisCards/index.esm.js').then(
157
+ (m) => compatWrapper(
158
+ /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3, alignItems: "stretch" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(m.ProvidedApisCard, null)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(m.ConsumedApisCard, null)))
159
+ )
137
160
  )
138
- )
161
+ }
139
162
  });
140
163
  var alpha = createFrontendPlugin({
141
164
  id: "api-docs",
@@ -1 +1 @@
1
- {"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 from 'react';\nimport Grid from '@material-ui/core/Grid';\n\nimport {\n createApiExtension,\n createApiFactory,\n createNavItemExtension,\n createPageExtension,\n createFrontendPlugin,\n createSchemaFromZod,\n} from '@backstage/frontend-plugin-api';\n\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\n\nimport {\n createEntityCardExtension,\n createEntityContentExtension,\n} from '@backstage/plugin-catalog-react/alpha';\nimport {\n ApiEntity,\n parseEntityRef,\n RELATION_HAS_PART,\n} from '@backstage/catalog-model';\n\nimport { defaultDefinitionWidgets } from './components/ApiDefinitionCard';\nimport { rootRoute, registerComponentRouteRef } from './routes';\nimport { apiDocsConfigRef } from './config';\nimport { AppIcon } from '@backstage/core-components';\n\nconst apiDocsNavItem = createNavItemExtension({\n title: 'APIs',\n routeRef: convertLegacyRouteRef(rootRoute),\n icon: () => compatWrapper(<AppIcon id=\"kind:api\" />),\n});\n\nconst apiDocsConfigApi = createApiExtension({\n factory: createApiFactory({\n api: apiDocsConfigRef,\n deps: {},\n factory: () => {\n const definitionWidgets = defaultDefinitionWidgets();\n return {\n getApiDefinitionWidget: (apiEntity: ApiEntity) => {\n return definitionWidgets.find(d => d.type === apiEntity.spec.type);\n },\n };\n },\n }),\n});\n\nconst apiDocsExplorerPage = createPageExtension({\n defaultPath: '/api-docs',\n routeRef: convertLegacyRouteRef(rootRoute),\n // Mapping DefaultApiExplorerPageProps to config\n configSchema: createSchemaFromZod(z =>\n z.object({\n path: z.string().default('/api-docs'),\n initiallySelectedFilter: z.enum(['owned', 'starred', 'all']).optional(),\n // Ommiting columns and actions for now as their types are too complex to map to zod\n }),\n ),\n loader: ({ config }) =>\n import('./components/ApiExplorerPage').then(m =>\n compatWrapper(\n <m.ApiExplorerIndexPage\n initiallySelectedFilter={config.initiallySelectedFilter}\n />,\n ),\n ),\n});\n\nconst apiDocsHasApisEntityCard = createEntityCardExtension({\n name: 'has-apis',\n // Ommiting configSchema for now\n // We are skipping variants and columns are too complex to map to zod\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: entity => {\n return (\n entity.kind === 'Component' &&\n entity.relations?.some(\n ({ type, targetRef }) =>\n type.toLocaleLowerCase('en-US') === RELATION_HAS_PART &&\n parseEntityRef(targetRef).kind === 'API',\n )!!\n );\n },\n loader: () =>\n import('./components/ApisCards').then(m =>\n compatWrapper(<m.HasApisCard />),\n ),\n});\n\nconst apiDocsDefinitionEntityCard = createEntityCardExtension({\n name: 'definition',\n filter: 'kind:api',\n loader: () =>\n import('./components/ApiDefinitionCard').then(m =>\n compatWrapper(<m.ApiDefinitionCard />),\n ),\n});\n\nconst apiDocsConsumedApisEntityCard = createEntityCardExtension({\n name: 'consumed-apis',\n // Ommiting configSchema for now\n // We are skipping variants and columns are too complex to map to zod\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: 'kind:component',\n loader: () =>\n import('./components/ApisCards').then(m =>\n compatWrapper(<m.ConsumedApisCard />),\n ),\n});\n\nconst apiDocsProvidedApisEntityCard = createEntityCardExtension({\n name: 'provided-apis',\n // Ommiting configSchema for now\n // We are skipping variants and columns are too complex to map to zod\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: 'kind:component',\n loader: () =>\n import('./components/ApisCards').then(m =>\n compatWrapper(<m.ProvidedApisCard />),\n ),\n});\n\nconst apiDocsConsumingComponentsEntityCard = createEntityCardExtension({\n name: 'consuming-components',\n // Ommiting configSchema for now\n // We are skipping variants\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: 'kind:api',\n loader: () =>\n import('./components/ComponentsCards').then(m =>\n compatWrapper(<m.ConsumingComponentsCard />),\n ),\n});\n\nconst apiDocsProvidingComponentsEntityCard = createEntityCardExtension({\n name: 'providing-components',\n // Ommiting configSchema for now\n // We are skipping variants\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: 'kind:api',\n loader: () =>\n import('./components/ComponentsCards').then(m =>\n compatWrapper(<m.ProvidingComponentsCard />),\n ),\n});\n\nconst apiDocsDefinitionEntityContent = createEntityContentExtension({\n name: 'definition',\n defaultPath: '/defintion',\n defaultTitle: 'Definition',\n filter: 'kind:api',\n loader: async () =>\n import('./components/ApiDefinitionCard').then(m =>\n compatWrapper(\n <Grid container spacing={3}>\n <Grid item xs={12}>\n <m.ApiDefinitionCard />\n </Grid>\n </Grid>,\n ),\n ),\n});\n\nconst apiDocsApisEntityContent = createEntityContentExtension({\n name: 'apis',\n defaultPath: '/apis',\n defaultTitle: 'APIs',\n filter: 'kind:component',\n loader: async () =>\n import('./components/ApisCards').then(m =>\n compatWrapper(\n <Grid container spacing={3} alignItems=\"stretch\">\n <Grid item xs={12}>\n <m.ProvidedApisCard />\n </Grid>\n <Grid item xs={12}>\n <m.ConsumedApisCard />\n </Grid>\n </Grid>,\n ),\n ),\n});\n\nexport default createFrontendPlugin({\n id: 'api-docs',\n routes: {\n root: convertLegacyRouteRef(rootRoute),\n },\n externalRoutes: {\n registerApi: convertLegacyRouteRef(registerComponentRouteRef),\n },\n extensions: [\n apiDocsNavItem,\n apiDocsConfigApi,\n apiDocsExplorerPage,\n apiDocsHasApisEntityCard,\n apiDocsDefinitionEntityCard,\n apiDocsProvidedApisEntityCard,\n apiDocsConsumedApisEntityCard,\n apiDocsConsumingComponentsEntityCard,\n apiDocsProvidingComponentsEntityCard,\n apiDocsDefinitionEntityContent,\n api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,EAAM,sBAAsB,SAAS,CAAA;AAAA,GACvC;AAAA,EACA,cAAgB,EAAA;AAAA,IACd,WAAA,EAAa,sBAAsB,yBAAyB,CAAA;AAAA,GAC9D;AAAA,EACA,UAAY,EAAA;AAAA,IACV,cAAA;AAAA,IACA,gBAAA;AAAA,IACA,mBAAA;AAAA,IACA,wBAAA;AAAA,IACA,2BAAA;AAAA,IACA,6BAAA;AAAA,IACA,6BAAA;AAAA,IACA,oCAAA;AAAA,IACA,oCAAA;AAAA,IACA,8BAAA;AAAA,IACA,wBAAA;AAAA,GACF;AACF,CAAC,CAAA;;;;"}
1
+ {"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 from 'react';\nimport Grid from '@material-ui/core/Grid';\n\nimport {\n ApiBlueprint,\n NavItemBlueprint,\n PageBlueprint,\n createApiFactory,\n createFrontendPlugin,\n} from '@backstage/frontend-plugin-api';\n\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\n\nimport {\n ApiEntity,\n parseEntityRef,\n RELATION_HAS_PART,\n} from '@backstage/catalog-model';\n\nimport { defaultDefinitionWidgets } from './components/ApiDefinitionCard';\nimport { rootRoute, registerComponentRouteRef } from './routes';\nimport { apiDocsConfigRef } from './config';\nimport { AppIcon } from '@backstage/core-components';\n\nimport {\n EntityCardBlueprint,\n EntityContentBlueprint,\n} from '@backstage/plugin-catalog-react/alpha';\n\nconst apiDocsNavItem = NavItemBlueprint.make({\n params: {\n title: 'APIs',\n routeRef: convertLegacyRouteRef(rootRoute),\n icon: () => compatWrapper(<AppIcon id=\"kind:api\" />),\n },\n});\n\nconst apiDocsConfigApi = ApiBlueprint.make({\n name: 'config',\n params: {\n factory: createApiFactory({\n api: apiDocsConfigRef,\n deps: {},\n factory: () => {\n const definitionWidgets = defaultDefinitionWidgets();\n return {\n getApiDefinitionWidget: (apiEntity: ApiEntity) => {\n return definitionWidgets.find(d => d.type === apiEntity.spec.type);\n },\n };\n },\n }),\n },\n});\n\nconst apiDocsExplorerPage = PageBlueprint.makeWithOverrides({\n config: {\n schema: {\n // Ommiting columns and actions for now as their types are too complex to map to zod\n initiallySelectedFilter: z =>\n z.enum(['owned', 'starred', 'all']).optional(),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n defaultPath: '/api-docs',\n routeRef: convertLegacyRouteRef(rootRoute),\n loader: () =>\n import('./components/ApiExplorerPage').then(m =>\n compatWrapper(\n <m.ApiExplorerIndexPage\n initiallySelectedFilter={config.initiallySelectedFilter}\n />,\n ),\n ),\n });\n },\n});\n\nconst apiDocsHasApisEntityCard = EntityCardBlueprint.make({\n name: 'has-apis',\n params: {\n // Ommiting configSchema for now\n // We are skipping variants and columns are too complex to map to zod\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: entity => {\n return (\n entity.kind === 'Component' &&\n entity.relations?.some(\n ({ type, targetRef }) =>\n type.toLocaleLowerCase('en-US') === RELATION_HAS_PART &&\n parseEntityRef(targetRef).kind === 'API',\n )!!\n );\n },\n loader: () =>\n import('./components/ApisCards').then(m =>\n compatWrapper(<m.HasApisCard />),\n ),\n },\n});\n\nconst apiDocsDefinitionEntityCard = EntityCardBlueprint.make({\n name: 'definition',\n params: {\n filter: 'kind:api',\n loader: () =>\n import('./components/ApiDefinitionCard').then(m =>\n compatWrapper(<m.ApiDefinitionCard />),\n ),\n },\n});\n\nconst apiDocsConsumedApisEntityCard = EntityCardBlueprint.make({\n name: 'consumed-apis',\n params: {\n // Ommiting configSchema for now\n // We are skipping variants and columns are too complex to map to zod\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: 'kind:component',\n loader: () =>\n import('./components/ApisCards').then(m =>\n compatWrapper(<m.ConsumedApisCard />),\n ),\n },\n});\n\nconst apiDocsProvidedApisEntityCard = EntityCardBlueprint.make({\n name: 'provided-apis',\n params: {\n // Ommiting configSchema for now\n // We are skipping variants and columns are too complex to map to zod\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: 'kind:component',\n loader: () =>\n import('./components/ApisCards').then(m =>\n compatWrapper(<m.ProvidedApisCard />),\n ),\n },\n});\n\nconst apiDocsConsumingComponentsEntityCard = EntityCardBlueprint.make({\n name: 'consuming-components',\n params: {\n // Ommiting configSchema for now\n // We are skipping variants\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: 'kind:api',\n loader: () =>\n import('./components/ComponentsCards').then(m =>\n compatWrapper(<m.ConsumingComponentsCard />),\n ),\n },\n});\n\nconst apiDocsProvidingComponentsEntityCard = EntityCardBlueprint.make({\n name: 'providing-components',\n params: {\n // Ommiting configSchema for now\n // We are skipping variants\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: 'kind:api',\n loader: () =>\n import('./components/ComponentsCards').then(m =>\n compatWrapper(<m.ProvidingComponentsCard />),\n ),\n },\n});\n\nconst apiDocsDefinitionEntityContent = EntityContentBlueprint.make({\n name: 'definition',\n params: {\n defaultPath: '/defintion',\n defaultTitle: 'Definition',\n filter: 'kind:api',\n loader: async () =>\n import('./components/ApiDefinitionCard').then(m =>\n compatWrapper(\n <Grid container spacing={3}>\n <Grid item xs={12}>\n <m.ApiDefinitionCard />\n </Grid>\n </Grid>,\n ),\n ),\n },\n});\n\nconst apiDocsApisEntityContent = EntityContentBlueprint.make({\n name: 'apis',\n params: {\n defaultPath: '/apis',\n defaultTitle: 'APIs',\n filter: 'kind:component',\n loader: async () =>\n import('./components/ApisCards').then(m =>\n compatWrapper(\n <Grid container spacing={3} alignItems=\"stretch\">\n <Grid item xs={12}>\n <m.ProvidedApisCard />\n </Grid>\n <Grid item xs={12}>\n <m.ConsumedApisCard />\n </Grid>\n </Grid>,\n ),\n ),\n },\n});\n\nexport default createFrontendPlugin({\n id: 'api-docs',\n routes: {\n root: convertLegacyRouteRef(rootRoute),\n },\n externalRoutes: {\n registerApi: convertLegacyRouteRef(registerComponentRouteRef),\n },\n extensions: [\n apiDocsNavItem,\n apiDocsConfigApi,\n apiDocsExplorerPage,\n apiDocsHasApisEntityCard,\n apiDocsDefinitionEntityCard,\n apiDocsProvidedApisEntityCard,\n apiDocsConsumedApisEntityCard,\n apiDocsConsumingComponentsEntityCard,\n apiDocsProvidingComponentsEntityCard,\n apiDocsDefinitionEntityContent,\n apiDocsApisEntityContent,\n ],\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAgDA,MAAM,cAAA,GAAiB,iBAAiB,IAAK,CAAA;AAAA,EAC3C,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,MAAA;AAAA,IACP,QAAA,EAAU,sBAAsB,SAAS,CAAA;AAAA,IACzC,MAAM,MAAM,aAAA,qCAAe,OAAQ,EAAA,EAAA,EAAA,EAAG,YAAW,CAAE,CAAA;AAAA,GACrD;AACF,CAAC,CAAA,CAAA;AAED,MAAM,gBAAA,GAAmB,aAAa,IAAK,CAAA;AAAA,EACzC,IAAM,EAAA,QAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,SAAS,gBAAiB,CAAA;AAAA,MACxB,GAAK,EAAA,gBAAA;AAAA,MACL,MAAM,EAAC;AAAA,MACP,SAAS,MAAM;AACb,QAAA,MAAM,oBAAoB,wBAAyB,EAAA,CAAA;AACnD,QAAO,OAAA;AAAA,UACL,sBAAA,EAAwB,CAAC,SAAyB,KAAA;AAChD,YAAA,OAAO,kBAAkB,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,IAAS,KAAA,SAAA,CAAU,KAAK,IAAI,CAAA,CAAA;A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ACA,2BAAA;AAAA,IACA,6BAAA;AAAA,IACA,6BAAA;AAAA,IACA,oCAAA;AAAA,IACA,oCAAA;AAAA,IACA,8BAAA;AAAA,IACA,wBAAA;AAAA,GACF;AACF,CAAC,CAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-api-docs",
3
- "version": "0.0.0-nightly-20240815021638",
3
+ "version": "0.0.0-nightly-20240816021916",
4
4
  "description": "A Backstage plugin that helps represent API entities in the frontend",
5
5
  "backstage": {
6
6
  "role": "frontend-plugin",
@@ -53,15 +53,15 @@
53
53
  },
54
54
  "dependencies": {
55
55
  "@asyncapi/react-component": "1.3.1",
56
- "@backstage/catalog-model": "^0.0.0-nightly-20240815021638",
57
- "@backstage/core-compat-api": "^0.0.0-nightly-20240815021638",
58
- "@backstage/core-components": "^0.0.0-nightly-20240815021638",
56
+ "@backstage/catalog-model": "^0.0.0-nightly-20240816021916",
57
+ "@backstage/core-compat-api": "^0.0.0-nightly-20240816021916",
58
+ "@backstage/core-components": "^0.0.0-nightly-20240816021916",
59
59
  "@backstage/core-plugin-api": "^1.9.3",
60
- "@backstage/frontend-plugin-api": "^0.0.0-nightly-20240815021638",
61
- "@backstage/plugin-catalog": "^0.0.0-nightly-20240815021638",
62
- "@backstage/plugin-catalog-common": "^0.0.0-nightly-20240815021638",
63
- "@backstage/plugin-catalog-react": "^0.0.0-nightly-20240815021638",
64
- "@backstage/plugin-permission-react": "^0.0.0-nightly-20240815021638",
60
+ "@backstage/frontend-plugin-api": "^0.0.0-nightly-20240816021916",
61
+ "@backstage/plugin-catalog": "^0.0.0-nightly-20240816021916",
62
+ "@backstage/plugin-catalog-common": "^0.0.0-nightly-20240816021916",
63
+ "@backstage/plugin-catalog-react": "^0.0.0-nightly-20240816021916",
64
+ "@backstage/plugin-permission-react": "^0.0.0-nightly-20240816021916",
65
65
  "@graphiql/react": "^0.23.0",
66
66
  "@material-ui/core": "^4.12.2",
67
67
  "@material-ui/icons": "^4.9.1",
@@ -75,10 +75,10 @@
75
75
  "swagger-ui-react": "^5.0.0"
76
76
  },
77
77
  "devDependencies": {
78
- "@backstage/cli": "^0.0.0-nightly-20240815021638",
79
- "@backstage/core-app-api": "^0.0.0-nightly-20240815021638",
80
- "@backstage/dev-utils": "^0.0.0-nightly-20240815021638",
81
- "@backstage/test-utils": "^0.0.0-nightly-20240815021638",
78
+ "@backstage/cli": "^0.0.0-nightly-20240816021916",
79
+ "@backstage/core-app-api": "^0.0.0-nightly-20240816021916",
80
+ "@backstage/dev-utils": "^0.0.0-nightly-20240816021916",
81
+ "@backstage/test-utils": "^0.0.0-nightly-20240816021916",
82
82
  "@testing-library/dom": "^10.0.0",
83
83
  "@testing-library/jest-dom": "^6.0.0",
84
84
  "@testing-library/react": "^15.0.0",