@backstage/plugin-home 0.8.14-next.1 → 0.8.15-next.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 CHANGED
@@ -1,5 +1,39 @@
1
1
  # @backstage/plugin-home
2
2
 
3
+ ## 0.8.15-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - d02db50: Remove unnecessary use of `compatWrapper` and `convertLegacyRouteRef`(s) for the new frontend system.
8
+ - Updated dependencies
9
+ - @backstage/frontend-plugin-api@0.13.2-next.0
10
+ - @backstage/core-app-api@1.19.3-next.0
11
+ - @backstage/core-plugin-api@1.12.1-next.0
12
+ - @backstage/plugin-catalog-react@1.21.4-next.0
13
+ - @backstage/theme@0.7.1-next.0
14
+ - @backstage/plugin-home-react@0.1.33-next.0
15
+ - @backstage/core-components@0.18.4-next.0
16
+ - @backstage/config@1.3.6
17
+ - @backstage/catalog-client@1.12.1
18
+ - @backstage/catalog-model@1.7.6
19
+
20
+ ## 0.8.14
21
+
22
+ ### Patch Changes
23
+
24
+ - 2ac5d29: Allow customization of `VisitList` by adding optional `enrichVisit`, `transformPathname`, `canSave` functions to `VisitsStorageApi`, along with `VisitDisplayProvider` for colors, labels
25
+ - Updated dependencies
26
+ - @backstage/frontend-plugin-api@0.13.0
27
+ - @backstage/core-compat-api@0.5.4
28
+ - @backstage/plugin-catalog-react@1.21.3
29
+ - @backstage/core-components@0.18.3
30
+ - @backstage/core-plugin-api@1.12.0
31
+ - @backstage/core-app-api@1.19.2
32
+ - @backstage/config@1.3.6
33
+ - @backstage/catalog-model@1.7.6
34
+ - @backstage/plugin-home-react@0.1.32
35
+ - @backstage/catalog-client@1.12.1
36
+
3
37
  ## 0.8.14-next.1
4
38
 
5
39
  ### Patch Changes
package/README.md CHANGED
@@ -358,7 +358,7 @@ In order to validate the config you can use `backstage/cli config:check`
358
358
 
359
359
  ### Customizing the VisitList
360
360
 
361
- If you want more control over the recent and top visited lists, you can write your own functions to transform the pathnames and determine which visits to save. You can also enrich each visit with other fields and customize the chip colors/labels in the visit lists.
361
+ If you want more control over the recent and top visited lists, you can write your own functions to transform the path names and determine which visits to save. You can also enrich each visit with other fields and customize the chip colors/labels in the visit lists.
362
362
 
363
363
  #### Transform Pathname Function
364
364
 
@@ -490,7 +490,7 @@ export const apis: AnyApiFactory[] = [
490
490
 
491
491
  #### Custom Chip Colors and Labels
492
492
 
493
- To provide your own chip colors and/or labels for the recent and top visited lists, wrap the components in `VisitDisplayProvider` with `getChipColor` and `getChipLabel` functions. The colors provided will be used instead of the hard coded [colorVariants](https://github.com/backstage/backstage/blob/2da352043425bcab4c4422e4d2820c26c0a83382/packages/theme/src/base/pageTheme.ts#L46) provided via `@backstage/theme`.
493
+ To provide your own chip colors and/or labels for the recent and top visited lists, wrap the components in `VisitDisplayProvider` with `getChipColor` and `getChipLabel` functions. The colors provided will be used instead of the hard coded [`colorVariants`](https://github.com/backstage/backstage/blob/2da352043425bcab4c4422e4d2820c26c0a83382/packages/theme/src/base/pageTheme.ts#L46) provided via `@backstage/theme`.
494
494
 
495
495
  ```tsx
496
496
  import {
package/dist/alpha.d.ts CHANGED
@@ -42,7 +42,7 @@ declare const titleExtensionDataRef: _backstage_frontend_plugin_api.Configurable
42
42
  declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin<{
43
43
  root: _backstage_frontend_plugin_api.RouteRef<undefined>;
44
44
  }, {}, {
45
- "api:home/visits": _backstage_frontend_plugin_api.ExtensionDefinition<{
45
+ "api:home/visits": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
46
46
  kind: "api";
47
47
  name: "visits";
48
48
  config: {};
@@ -51,7 +51,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
51
51
  inputs: {};
52
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
53
  }>;
54
- "app-root-element:home/visit-listener": _backstage_frontend_plugin_api.ExtensionDefinition<{
54
+ "app-root-element:home/visit-listener": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
55
55
  kind: "app-root-element";
56
56
  name: "visit-listener";
57
57
  config: {};
@@ -62,7 +62,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
62
62
  element: JSX.Element;
63
63
  };
64
64
  }>;
65
- "page:home": _backstage_frontend_plugin_api.ExtensionDefinition<{
65
+ "page:home": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
66
66
  config: {
67
67
  path: string | undefined;
68
68
  };
package/dist/alpha.esm.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { createRouteRef, createExtensionDataRef, PageBlueprint, createExtensionInput, coreExtensionData, AppRootElementBlueprint, ApiBlueprint, identityApiRef, storageApiRef, createFrontendPlugin } from '@backstage/frontend-plugin-api';
3
- import { compatWrapper } from '@backstage/core-compat-api';
4
3
  import 'react-router-dom';
5
4
  import './components/CustomHomepage/CustomHomepageGrid.esm.js';
6
5
  import { VisitListener } from './components/VisitListener.esm.js';
@@ -31,17 +30,13 @@ const homePage = PageBlueprint.makeWithOverrides({
31
30
  return originalFactory({
32
31
  path: "/home",
33
32
  routeRef: rootRouteRef,
34
- loader: () => import('./components/index.esm.js').then(
35
- (m) => compatWrapper(
36
- /* @__PURE__ */ jsx(
37
- m.HomepageCompositionRoot,
38
- {
39
- children: inputs.props?.get(coreExtensionData.reactElement),
40
- title: inputs.props?.get(titleExtensionDataRef)
41
- }
42
- )
43
- )
44
- )
33
+ loader: () => import('./components/index.esm.js').then((m) => /* @__PURE__ */ jsx(
34
+ m.HomepageCompositionRoot,
35
+ {
36
+ children: inputs.props?.get(coreExtensionData.reactElement),
37
+ title: inputs.props?.get(titleExtensionDataRef)
38
+ }
39
+ ))
45
40
  });
46
41
  }
47
42
  });
@@ -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 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 path: '/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: defineParams =>\n defineParams({\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,cAAA,EAAe;AAK7B,MAAM,qBAAA,GAAwB,sBAAA,EAA+B,CAAE,IAAA,CAAK;AAAA,EACzE,EAAA,EAAI;AACN,CAAC;AAED,MAAM,QAAA,GAAW,cAAc,iBAAA,CAAkB;AAAA,EAC/C,MAAA,EAAQ;AAAA,IACN,KAAA,EAAO,oBAAA;AAAA,MACL;AAAA,QACE,iBAAA,CAAkB,aAAa,QAAA,EAAS;AAAA,QACxC,sBAAsB,QAAA;AAAS,OACjC;AAAA,MACA;AAAA,QACE,SAAA,EAAW,IAAA;AAAA,QACX,QAAA,EAAU;AAAA;AACZ;AACF,GACF;AAAA,EACA,OAAA,EAAS,CAAC,eAAA,EAAiB,EAAE,QAAO,KAAM;AACxC,IAAA,OAAO,eAAA,CAAgB;AAAA,MACrB,IAAA,EAAM,OAAA;AAAA,MACN,QAAA,EAAU,YAAA;AAAA,MACV,MAAA,EAAQ,MACN,OAAO,2BAAe,CAAA,CAAE,IAAA;AAAA,QAAK,CAAA,CAAA,KAC3B,aAAA;AAAA,0BACE,GAAA;AAAA,YAAC,CAAA,CAAE,uBAAA;AAAA,YAAF;AAAA,cACC,QAAA,EAAU,MAAA,CAAO,KAAA,EAAO,GAAA,CAAI,kBAAkB,YAAY,CAAA;AAAA,cAC1D,KAAA,EAAO,MAAA,CAAO,KAAA,EAAO,GAAA,CAAI,qBAAqB;AAAA;AAAA;AAChD;AACF;AACF,KACH,CAAA;AAAA,EACH;AACF,CAAC,CAAA;AAED,MAAM,2BAAA,GAA8B,wBAAwB,IAAA,CAAK;AAAA,EAC/D,IAAA,EAAM,gBAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,OAAA,sBAAU,aAAA,EAAA,EAAc;AAAA;AAE5B,CAAC,CAAA;AAED,MAAM,SAAA,GAAY,aAAa,IAAA,CAAK;AAAA,EAClC,IAAA,EAAM,QAAA;AAAA,EACN,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,GAAA,EAAK,YAAA;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,UAAA,EAAY,aAAA;AAAA,MACZ,WAAA,EAAa;AAAA,KACf;AAAA,IACA,OAAA,EAAS,CAAC,EAAE,UAAA,EAAY,WAAA,EAAY,KAClC,gBAAA,CAAiB,MAAA,CAAO,EAAE,UAAA,EAAY,WAAA,EAAa;AAAA,GACtD;AACL,CAAC,CAAA;AAKD,YAAe,oBAAA,CAAqB;AAAA,EAClC,QAAA,EAAU,MAAA;AAAA,EACV,MAAM,EAAE,WAAA,EAAa,MAAM,OAAO,uBAAiB,CAAA,EAAE;AAAA,EACrD,UAAA,EAAY,CAAC,QAAA,EAAU,SAAA,EAAW,2BAA2B,CAAA;AAAA,EAC7D,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM;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 { 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 path: '/home',\n routeRef: rootRouteRef,\n loader: () =>\n import('./components/').then(m => (\n <m.HomepageCompositionRoot\n children={inputs.props?.get(coreExtensionData.reactElement)}\n title={inputs.props?.get(titleExtensionDataRef)}\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: defineParams =>\n defineParams({\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":";;;;;;;;;;;AA+BA,MAAM,eAAe,cAAA,EAAe;AAK7B,MAAM,qBAAA,GAAwB,sBAAA,EAA+B,CAAE,IAAA,CAAK;AAAA,EACzE,EAAA,EAAI;AACN,CAAC;AAED,MAAM,QAAA,GAAW,cAAc,iBAAA,CAAkB;AAAA,EAC/C,MAAA,EAAQ;AAAA,IACN,KAAA,EAAO,oBAAA;AAAA,MACL;AAA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,EAClC,QAAA,EAAU,MAAA;AAAA,EACV,MAAM,EAAE,WAAA,EAAa,MAAM,OAAO,uBAAiB,CAAA,EAAE;AAAA,EACrD,UAAA,EAAY,CAAC,QAAA,EAAU,SAAA,EAAW,2BAA2B,CAAA;AAAA,EAC7D,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM;AAAA;AAEV,CAAC,CAAA;;;;"}
@@ -1,5 +1,5 @@
1
1
  var name = "@backstage/plugin-home";
2
- var version = "0.8.14-next.1";
2
+ var version = "0.8.15-next.0";
3
3
  var description = "A Backstage plugin that helps you build a home page";
4
4
  var backstage = {
5
5
  role: "frontend-plugin",
@@ -59,7 +59,6 @@ var dependencies = {
59
59
  "@backstage/catalog-model": "workspace:^",
60
60
  "@backstage/config": "workspace:^",
61
61
  "@backstage/core-app-api": "workspace:^",
62
- "@backstage/core-compat-api": "workspace:^",
63
62
  "@backstage/core-components": "workspace:^",
64
63
  "@backstage/core-plugin-api": "workspace:^",
65
64
  "@backstage/frontend-plugin-api": "workspace:^",
@@ -1 +1 @@
1
- {"version":3,"file":"package.json.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"package.json.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-home",
3
- "version": "0.8.14-next.1",
3
+ "version": "0.8.15-next.0",
4
4
  "description": "A Backstage plugin that helps you build a home page",
5
5
  "backstage": {
6
6
  "role": "frontend-plugin",
@@ -68,17 +68,16 @@
68
68
  "test": "backstage-cli package test"
69
69
  },
70
70
  "dependencies": {
71
- "@backstage/catalog-client": "1.12.1-next.0",
72
- "@backstage/catalog-model": "1.7.6-next.0",
73
- "@backstage/config": "1.3.6-next.0",
74
- "@backstage/core-app-api": "1.19.2-next.1",
75
- "@backstage/core-compat-api": "0.5.4-next.0",
76
- "@backstage/core-components": "0.18.3-next.2",
77
- "@backstage/core-plugin-api": "1.11.2-next.1",
78
- "@backstage/frontend-plugin-api": "0.12.2-next.2",
79
- "@backstage/plugin-catalog-react": "1.21.3-next.2",
80
- "@backstage/plugin-home-react": "0.1.32-next.0",
81
- "@backstage/theme": "0.7.0",
71
+ "@backstage/catalog-client": "1.12.1",
72
+ "@backstage/catalog-model": "1.7.6",
73
+ "@backstage/config": "1.3.6",
74
+ "@backstage/core-app-api": "1.19.3-next.0",
75
+ "@backstage/core-components": "0.18.4-next.0",
76
+ "@backstage/core-plugin-api": "1.12.1-next.0",
77
+ "@backstage/frontend-plugin-api": "0.13.2-next.0",
78
+ "@backstage/plugin-catalog-react": "1.21.4-next.0",
79
+ "@backstage/plugin-home-react": "0.1.33-next.0",
80
+ "@backstage/theme": "0.7.1-next.0",
82
81
  "@material-ui/core": "^4.12.2",
83
82
  "@material-ui/icons": "^4.9.1",
84
83
  "@material-ui/lab": "4.0.0-alpha.61",
@@ -94,9 +93,9 @@
94
93
  "zod": "^3.22.4"
95
94
  },
96
95
  "devDependencies": {
97
- "@backstage/cli": "0.34.5-next.1",
98
- "@backstage/dev-utils": "1.1.17-next.1",
99
- "@backstage/test-utils": "1.7.13-next.0",
96
+ "@backstage/cli": "0.34.6-next.0",
97
+ "@backstage/dev-utils": "1.1.18-next.0",
98
+ "@backstage/test-utils": "1.7.14-next.0",
100
99
  "@testing-library/dom": "^10.0.0",
101
100
  "@testing-library/jest-dom": "^6.0.0",
102
101
  "@testing-library/react": "^16.0.0",