@backstage/plugin-home 0.8.10 → 0.8.11-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @backstage/plugin-home
2
2
 
3
+ ## 0.8.11-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - f16d380: Add the missing Visits API to the alpha plugin, fixing a crash due to the API not being installed.
8
+ - f2f133c: Internal update to use the new variant of `ApiBlueprint`.
9
+ - Updated dependencies
10
+ - @backstage/core-compat-api@0.4.5-next.1
11
+ - @backstage/plugin-catalog-react@1.20.0-next.1
12
+ - @backstage/frontend-plugin-api@0.11.0-next.0
13
+ - @backstage/theme@0.6.8-next.0
14
+ - @backstage/catalog-client@1.11.0-next.0
15
+ - @backstage/plugin-home-react@0.1.29-next.0
16
+ - @backstage/core-components@0.17.5-next.0
17
+ - @backstage/catalog-model@1.7.5
18
+ - @backstage/config@1.3.3
19
+ - @backstage/core-app-api@1.18.0
20
+ - @backstage/core-plugin-api@1.10.9
21
+
22
+ ## 0.8.11-next.0
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies
27
+ - @backstage/plugin-catalog-react@1.19.2-next.0
28
+ - @backstage/core-compat-api@0.4.5-next.0
29
+ - @backstage/frontend-plugin-api@0.10.4
30
+
3
31
  ## 0.8.10
4
32
 
5
33
  ### Patch Changes
package/dist/alpha.d.ts CHANGED
@@ -42,6 +42,15 @@ declare const titleExtensionDataRef: _backstage_frontend_plugin_api.Configurable
42
42
  declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
43
43
  root: _backstage_frontend_plugin_api.RouteRef<undefined>;
44
44
  }, {}, {
45
+ "api:home/visits": _backstage_frontend_plugin_api.ExtensionDefinition<{
46
+ kind: "api";
47
+ name: "visits";
48
+ config: {};
49
+ configInput: {};
50
+ output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
51
+ inputs: {};
52
+ params: <TApi, TImpl extends TApi, TDeps extends { [name in string]: unknown; }>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
53
+ }>;
45
54
  "app-root-element:home/visit-listener": _backstage_frontend_plugin_api.ExtensionDefinition<{
46
55
  kind: "app-root-element";
47
56
  name: "visit-listener";
package/dist/alpha.esm.js CHANGED
@@ -1,9 +1,12 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { createRouteRef, createExtensionDataRef, PageBlueprint, createExtensionInput, coreExtensionData, AppRootElementBlueprint, createFrontendPlugin } from '@backstage/frontend-plugin-api';
2
+ import { createRouteRef, createExtensionDataRef, PageBlueprint, createExtensionInput, coreExtensionData, AppRootElementBlueprint, ApiBlueprint, storageApiRef, identityApiRef, createFrontendPlugin } from '@backstage/frontend-plugin-api';
3
3
  import { compatWrapper } from '@backstage/core-compat-api';
4
4
  import 'react-router-dom';
5
5
  import './components/CustomHomepage/CustomHomepageGrid.esm.js';
6
6
  import { VisitListener } from './components/VisitListener.esm.js';
7
+ import { VisitsStorageApi } from './api/VisitsStorageApi.esm.js';
8
+ import '@backstage/core-app-api';
9
+ import { visitsApiRef } from './api/VisitsApi.esm.js';
7
10
  export { homeTranslationRef } from './translation.esm.js';
8
11
 
9
12
  const rootRouteRef = createRouteRef();
@@ -47,10 +50,21 @@ const visitListenerAppRootElement = AppRootElementBlueprint.make({
47
50
  element: /* @__PURE__ */ jsx(VisitListener, {})
48
51
  }
49
52
  });
53
+ const visitsApi = ApiBlueprint.make({
54
+ name: "visits",
55
+ params: (define) => define({
56
+ api: visitsApiRef,
57
+ deps: {
58
+ storageApi: storageApiRef,
59
+ identityApi: identityApiRef
60
+ },
61
+ factory: ({ storageApi, identityApi }) => VisitsStorageApi.create({ storageApi, identityApi })
62
+ })
63
+ });
50
64
  var alpha = createFrontendPlugin({
51
65
  pluginId: "home",
52
66
  info: { packageJson: () => import('./package.json.esm.js') },
53
- extensions: [homePage, visitListenerAppRootElement],
67
+ extensions: [homePage, visitsApi, visitListenerAppRootElement],
54
68
  routes: {
55
69
  root: rootRouteRef
56
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 coreExtensionData,\n createExtensionDataRef,\n createExtensionInput,\n PageBlueprint,\n createFrontendPlugin,\n createRouteRef,\n AppRootElementBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport { compatWrapper } from '@backstage/core-compat-api';\nimport { VisitListener } from './components/';\n\nconst rootRouteRef = createRouteRef();\n\n/**\n * @alpha\n */\nexport const titleExtensionDataRef = createExtensionDataRef<string>().with({\n id: 'title',\n});\n\nconst homePage = PageBlueprint.makeWithOverrides({\n inputs: {\n props: createExtensionInput(\n [\n coreExtensionData.reactElement.optional(),\n titleExtensionDataRef.optional(),\n ],\n {\n singleton: true,\n optional: true,\n },\n ),\n },\n factory: (originalFactory, { inputs }) => {\n return originalFactory({\n defaultPath: '/home',\n routeRef: rootRouteRef,\n loader: () =>\n import('./components/').then(m =>\n compatWrapper(\n <m.HomepageCompositionRoot\n children={inputs.props?.get(coreExtensionData.reactElement)}\n title={inputs.props?.get(titleExtensionDataRef)}\n />,\n ),\n ),\n });\n },\n});\n\nconst visitListenerAppRootElement = AppRootElementBlueprint.make({\n name: 'visit-listener',\n params: {\n element: <VisitListener />,\n },\n});\n\n/**\n * @alpha\n */\nexport default createFrontendPlugin({\n pluginId: 'home',\n info: { packageJson: () => import('../package.json') },\n extensions: [homePage, visitListenerAppRootElement],\n routes: {\n root: rootRouteRef,\n },\n});\n\nexport { homeTranslationRef } from './translation';\n"],"names":[],"mappings":";;;;;;;;AA4BA,MAAM,eAAe,cAAe,EAAA;AAKvB,MAAA,qBAAA,GAAwB,sBAA+B,EAAA,CAAE,IAAK,CAAA;AAAA,EACzE,EAAI,EAAA;AACN,CAAC;AAED,MAAM,QAAA,GAAW,cAAc,iBAAkB,CAAA;AAAA,EAC/C,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,oBAAA;AAAA,MACL;AAAA,QACE,iBAAA,CAAkB,aAAa,QAAS,EAAA;AAAA,QACxC,sBAAsB,QAAS;AAAA,OACjC;AAAA,MACA;AAAA,QACE,SAAW,EAAA,IAAA;AAAA,QACX,QAAU,EAAA;AAAA;AACZ;AACF,GACF;AAAA,EACA,OAAS,EAAA,CAAC,eAAiB,EAAA,EAAE,QAAa,KAAA;AACxC,IAAA,OAAO,eAAgB,CAAA;AAAA,MACrB,WAAa,EAAA,OAAA;AAAA,MACb,QAAU,EAAA,YAAA;AAAA,MACV,MAAQ,EAAA,MACN,OAAO,2BAAe,CAAE,CAAA,IAAA;AAAA,QAAK,CAC3B,CAAA,KAAA,aAAA;AAAA,0BACE,GAAA;AAAA,YAAC,CAAE,CAAA,uBAAA;AAAA,YAAF;AAAA,cACC,QAAU,EAAA,MAAA,CAAO,KAAO,EAAA,GAAA,CAAI,kBAAkB,YAAY,CAAA;AAAA,cAC1D,KAAO,EAAA,MAAA,CAAO,KAAO,EAAA,GAAA,CAAI,qBAAqB;AAAA;AAAA;AAChD;AACF;AACF,KACH,CAAA;AAAA;AAEL,CAAC,CAAA;AAED,MAAM,2BAAA,GAA8B,wBAAwB,IAAK,CAAA;AAAA,EAC/D,IAAM,EAAA,gBAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,OAAA,sBAAU,aAAc,EAAA,EAAA;AAAA;AAE5B,CAAC,CAAA;AAKD,YAAe,oBAAqB,CAAA;AAAA,EAClC,QAAU,EAAA,MAAA;AAAA,EACV,MAAM,EAAE,WAAA,EAAa,MAAM,OAAO,uBAAiB,CAAE,EAAA;AAAA,EACrD,UAAA,EAAY,CAAC,QAAA,EAAU,2BAA2B,CAAA;AAAA,EAClD,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA;AAAA;AAEV,CAAC,CAAA;;;;"}
1
+ {"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 coreExtensionData,\n createExtensionDataRef,\n createExtensionInput,\n PageBlueprint,\n createFrontendPlugin,\n createRouteRef,\n AppRootElementBlueprint,\n identityApiRef,\n storageApiRef,\n ApiBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport { compatWrapper } from '@backstage/core-compat-api';\nimport { VisitListener } from './components/';\nimport { visitsApiRef, VisitsStorageApi } from './api';\n\nconst rootRouteRef = createRouteRef();\n\n/**\n * @alpha\n */\nexport const titleExtensionDataRef = createExtensionDataRef<string>().with({\n id: 'title',\n});\n\nconst homePage = PageBlueprint.makeWithOverrides({\n inputs: {\n props: createExtensionInput(\n [\n coreExtensionData.reactElement.optional(),\n titleExtensionDataRef.optional(),\n ],\n {\n singleton: true,\n optional: true,\n },\n ),\n },\n factory: (originalFactory, { inputs }) => {\n return originalFactory({\n defaultPath: '/home',\n routeRef: rootRouteRef,\n loader: () =>\n import('./components/').then(m =>\n compatWrapper(\n <m.HomepageCompositionRoot\n children={inputs.props?.get(coreExtensionData.reactElement)}\n title={inputs.props?.get(titleExtensionDataRef)}\n />,\n ),\n ),\n });\n },\n});\n\nconst visitListenerAppRootElement = AppRootElementBlueprint.make({\n name: 'visit-listener',\n params: {\n element: <VisitListener />,\n },\n});\n\nconst visitsApi = ApiBlueprint.make({\n name: 'visits',\n params: define =>\n define({\n api: visitsApiRef,\n deps: {\n storageApi: storageApiRef,\n identityApi: identityApiRef,\n },\n factory: ({ storageApi, identityApi }) =>\n VisitsStorageApi.create({ storageApi, identityApi }),\n }),\n});\n\n/**\n * @alpha\n */\nexport default createFrontendPlugin({\n pluginId: 'home',\n info: { packageJson: () => import('../package.json') },\n extensions: [homePage, visitsApi, visitListenerAppRootElement],\n routes: {\n root: rootRouteRef,\n },\n});\n\nexport { homeTranslationRef } from './translation';\n"],"names":[],"mappings":";;;;;;;;;;;AAgCA,MAAM,eAAe,cAAe,EAAA;AAKvB,MAAA,qBAAA,GAAwB,sBAA+B,EAAA,CAAE,IAAK,CAAA;AAAA,EACzE,EAAI,EAAA;AACN,CAAC;AAED,MAAM,QAAA,GAAW,cAAc,iBAAkB,CAAA;AAAA,EAC/C,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,oBAAA;AAAA,MACL;AAAA,QACE,iBAAA,CAAkB,aAAa,QAAS,EAAA;AAAA,QACxC,sBAAsB,QAAS;AAAA,OACjC;AAAA,MACA;AAAA,QACE,SAAW,EAAA,IAAA;AAAA,QACX,QAAU,EAAA;AAAA;AACZ;AACF,GACF;AAAA,EACA,OAAS,EAAA,CAAC,eAAiB,EAAA,EAAE,QAAa,KAAA;AACxC,IAAA,OAAO,eAAgB,CAAA;AAAA,MACrB,WAAa,EAAA,OAAA;AAAA,MACb,QAAU,EAAA,YAAA;AAAA,MACV,MAAQ,EAAA,MACN,OAAO,2BAAe,CAAE,CAAA,IAAA;AAAA,QAAK,CAC3B,CAAA,KAAA,aAAA;AAAA,0BACE,GAAA;AAAA,YAAC,CAAE,CAAA,uBAAA;AAAA,YAAF;AAAA,cACC,QAAU,EAAA,MAAA,CAAO,KAAO,EAAA,GAAA,CAAI,kBAAkB,YAAY,CAAA;AAAA,cAC1D,KAAO,EAAA,MAAA,CAAO,KAAO,EAAA,GAAA,CAAI,qBAAqB;AAAA;AAAA;AAChD;AACF;AACF,KACH,CAAA;AAAA;AAEL,CAAC,CAAA;AAED,MAAM,2BAAA,GAA8B,wBAAwB,IAAK,CAAA;AAAA,EAC/D,IAAM,EAAA,gBAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,OAAA,sBAAU,aAAc,EAAA,EAAA;AAAA;AAE5B,CAAC,CAAA;AAED,MAAM,SAAA,GAAY,aAAa,IAAK,CAAA;AAAA,EAClC,IAAM,EAAA,QAAA;AAAA,EACN,MAAA,EAAQ,YACN,MAAO,CAAA;AAAA,IACL,GAAK,EAAA,YAAA;AAAA,IACL,IAAM,EAAA;AAAA,MACJ,UAAY,EAAA,aAAA;AAAA,MACZ,WAAa,EAAA;AAAA,KACf;AAAA,IACA,OAAA,EAAS,CAAC,EAAE,UAAY,EAAA,WAAA,EACtB,KAAA,gBAAA,CAAiB,MAAO,CAAA,EAAE,UAAY,EAAA,WAAA,EAAa;AAAA,GACtD;AACL,CAAC,CAAA;AAKD,YAAe,oBAAqB,CAAA;AAAA,EAClC,QAAU,EAAA,MAAA;AAAA,EACV,MAAM,EAAE,WAAA,EAAa,MAAM,OAAO,uBAAiB,CAAE,EAAA;AAAA,EACrD,UAAY,EAAA,CAAC,QAAU,EAAA,SAAA,EAAW,2BAA2B,CAAA;AAAA,EAC7D,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA;AAAA;AAEV,CAAC,CAAA;;;;"}
@@ -1,5 +1,5 @@
1
1
  var name = "@backstage/plugin-home";
2
- var version = "0.8.10";
2
+ var version = "0.8.11-next.1";
3
3
  var description = "A Backstage plugin that helps you build a home page";
4
4
  var backstage = {
5
5
  role: "frontend-plugin",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-home",
3
- "version": "0.8.10",
3
+ "version": "0.8.11-next.1",
4
4
  "description": "A Backstage plugin that helps you build a home page",
5
5
  "backstage": {
6
6
  "role": "frontend-plugin",
@@ -68,17 +68,17 @@
68
68
  "test": "backstage-cli package test"
69
69
  },
70
70
  "dependencies": {
71
- "@backstage/catalog-client": "^1.10.2",
72
- "@backstage/catalog-model": "^1.7.5",
73
- "@backstage/config": "^1.3.3",
74
- "@backstage/core-app-api": "^1.18.0",
75
- "@backstage/core-compat-api": "^0.4.4",
76
- "@backstage/core-components": "^0.17.4",
77
- "@backstage/core-plugin-api": "^1.10.9",
78
- "@backstage/frontend-plugin-api": "^0.10.4",
79
- "@backstage/plugin-catalog-react": "^1.19.1",
80
- "@backstage/plugin-home-react": "^0.1.28",
81
- "@backstage/theme": "^0.6.7",
71
+ "@backstage/catalog-client": "1.11.0-next.0",
72
+ "@backstage/catalog-model": "1.7.5",
73
+ "@backstage/config": "1.3.3",
74
+ "@backstage/core-app-api": "1.18.0",
75
+ "@backstage/core-compat-api": "0.4.5-next.1",
76
+ "@backstage/core-components": "0.17.5-next.0",
77
+ "@backstage/core-plugin-api": "1.10.9",
78
+ "@backstage/frontend-plugin-api": "0.11.0-next.0",
79
+ "@backstage/plugin-catalog-react": "1.20.0-next.1",
80
+ "@backstage/plugin-home-react": "0.1.29-next.0",
81
+ "@backstage/theme": "0.6.8-next.0",
82
82
  "@material-ui/core": "^4.12.2",
83
83
  "@material-ui/icons": "^4.9.1",
84
84
  "@material-ui/lab": "4.0.0-alpha.61",
@@ -94,9 +94,9 @@
94
94
  "zod": "^3.22.4"
95
95
  },
96
96
  "devDependencies": {
97
- "@backstage/cli": "^0.33.1",
98
- "@backstage/dev-utils": "^1.1.12",
99
- "@backstage/test-utils": "^1.7.10",
97
+ "@backstage/cli": "0.33.2-next.0",
98
+ "@backstage/dev-utils": "1.1.13-next.1",
99
+ "@backstage/test-utils": "1.7.11-next.0",
100
100
  "@testing-library/dom": "^10.0.0",
101
101
  "@testing-library/jest-dom": "^6.0.0",
102
102
  "@testing-library/react": "^16.0.0",