@backstage-community/plugin-opencost 0.25.0 → 0.25.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 +6 -0
- package/README.md +15 -0
- package/dist/alpha.d.ts +50 -0
- package/dist/alpha.esm.js +26 -0
- package/dist/alpha.esm.js.map +1 -0
- package/package.json +37 -15
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -48,6 +48,21 @@ and
|
|
|
48
48
|
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
## New Frontend System
|
|
52
|
+
|
|
53
|
+
Install the package as described above. With [feature discovery](https://backstage.io/docs/frontend-system/architecture/app/#feature-discovery), the plugin is automatically discovered. Otherwise, add it to your app:
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
import { createApp } from '@backstage/frontend-defaults';
|
|
57
|
+
import openCostPlugin from '@backstage-community/plugin-opencost/alpha';
|
|
58
|
+
|
|
59
|
+
const app = createApp({
|
|
60
|
+
features: [openCostPlugin],
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The plugin provides `page:opencost` at `/opencost`. Its page title and icon are used for sidebar navigation.
|
|
65
|
+
|
|
51
66
|
## Plugin Configuration
|
|
52
67
|
|
|
53
68
|
Since OpenCost doesn't have any authentication at this point, you just need to give API access to the plugin to access your data.
|
package/dist/alpha.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
3
|
+
|
|
4
|
+
/** @alpha */
|
|
5
|
+
declare const openCostFrontendPlugin: _backstage_frontend_plugin_api.OverridableFrontendPlugin<{
|
|
6
|
+
root: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
7
|
+
}, {}, {
|
|
8
|
+
"page:opencost": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
9
|
+
kind: "page";
|
|
10
|
+
name: undefined;
|
|
11
|
+
config: {
|
|
12
|
+
path: string | undefined;
|
|
13
|
+
title: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
configInput: {
|
|
16
|
+
path?: string | undefined;
|
|
17
|
+
title?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
20
|
+
optional: true;
|
|
21
|
+
}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.title", {
|
|
22
|
+
optional: true;
|
|
23
|
+
}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.IconElement, "core.icon", {
|
|
24
|
+
optional: true;
|
|
25
|
+
}>;
|
|
26
|
+
inputs: {
|
|
27
|
+
pages: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.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", {
|
|
28
|
+
optional: true;
|
|
29
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.title", {
|
|
30
|
+
optional: true;
|
|
31
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.IconElement, "core.icon", {
|
|
32
|
+
optional: true;
|
|
33
|
+
}>, {
|
|
34
|
+
singleton: false;
|
|
35
|
+
optional: false;
|
|
36
|
+
internal: false;
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
params: {
|
|
40
|
+
path: string;
|
|
41
|
+
title?: string;
|
|
42
|
+
icon?: _backstage_frontend_plugin_api.IconElement;
|
|
43
|
+
loader?: () => Promise<react.JSX.Element>;
|
|
44
|
+
routeRef?: _backstage_frontend_plugin_api.RouteRef;
|
|
45
|
+
noHeader?: boolean;
|
|
46
|
+
};
|
|
47
|
+
}>;
|
|
48
|
+
}>;
|
|
49
|
+
|
|
50
|
+
export { openCostFrontendPlugin as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { compatWrapper, convertLegacyRouteRef, convertLegacyRouteRefs } from '@backstage/core-compat-api';
|
|
3
|
+
import { PageBlueprint, createFrontendPlugin } from '@backstage/frontend-plugin-api';
|
|
4
|
+
import MoneyIcon from '@material-ui/icons/MonetizationOn';
|
|
5
|
+
import { rootRouteRef } from './routes.esm.js';
|
|
6
|
+
|
|
7
|
+
const openCostPage = PageBlueprint.make({
|
|
8
|
+
params: {
|
|
9
|
+
path: "/opencost",
|
|
10
|
+
title: "OpenCost",
|
|
11
|
+
icon: /* @__PURE__ */ jsx(MoneyIcon, {}),
|
|
12
|
+
noHeader: true,
|
|
13
|
+
routeRef: convertLegacyRouteRef(rootRouteRef),
|
|
14
|
+
loader: () => import('./components/OpenCostPage/index.esm.js').then(
|
|
15
|
+
(m) => compatWrapper(/* @__PURE__ */ jsx(m.OpenCostPage, {}))
|
|
16
|
+
)
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const openCostFrontendPlugin = createFrontendPlugin({
|
|
20
|
+
pluginId: "opencost",
|
|
21
|
+
extensions: [openCostPage],
|
|
22
|
+
routes: convertLegacyRouteRefs({ root: rootRouteRef })
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export { openCostFrontendPlugin as default };
|
|
26
|
+
//# sourceMappingURL=alpha.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 */\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n convertLegacyRouteRefs,\n} from '@backstage/core-compat-api';\nimport {\n createFrontendPlugin,\n PageBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport MoneyIcon from '@material-ui/icons/MonetizationOn';\nimport { rootRouteRef } from './routes';\n\nconst openCostPage = PageBlueprint.make({\n params: {\n path: '/opencost',\n title: 'OpenCost',\n icon: <MoneyIcon />,\n noHeader: true,\n routeRef: convertLegacyRouteRef(rootRouteRef),\n loader: () =>\n import('./components/OpenCostPage').then(m =>\n compatWrapper(<m.OpenCostPage />),\n ),\n },\n});\n\n/** @alpha */\nconst openCostFrontendPlugin = createFrontendPlugin({\n pluginId: 'opencost',\n extensions: [openCostPage],\n routes: convertLegacyRouteRefs({ root: rootRouteRef }),\n});\n\nexport default openCostFrontendPlugin;\n"],"names":[],"mappings":";;;;;;AA2BA,MAAM,YAAA,GAAe,cAAc,IAAA,CAAK;AAAA,EACtC,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,WAAA;AAAA,IACN,KAAA,EAAO,UAAA;AAAA,IACP,IAAA,sBAAO,SAAA,EAAA,EAAU,CAAA;AAAA,IACjB,QAAA,EAAU,IAAA;AAAA,IACV,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,MAAA,EAAQ,MACN,OAAO,wCAA2B,CAAA,CAAE,IAAA;AAAA,MAAK,OACvC,aAAA,iBAAc,GAAA,CAAC,CAAA,CAAE,YAAA,EAAF,EAAe,CAAE;AAAA;AAClC;AAEN,CAAC,CAAA;AAGD,MAAM,yBAAyB,oBAAA,CAAqB;AAAA,EAClD,QAAA,EAAU,UAAA;AAAA,EACV,UAAA,EAAY,CAAC,YAAY,CAAA;AAAA,EACzB,MAAA,EAAQ,sBAAA,CAAuB,EAAE,IAAA,EAAM,cAAc;AACvD,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage-community/plugin-opencost",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.1",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "frontend-plugin",
|
|
6
6
|
"pluginId": "opencost",
|
|
7
7
|
"pluginPackages": [
|
|
8
8
|
"@backstage-community/plugin-opencost"
|
|
9
|
-
]
|
|
9
|
+
],
|
|
10
|
+
"features": {
|
|
11
|
+
"./alpha": "@backstage/FrontendPlugin"
|
|
12
|
+
}
|
|
10
13
|
},
|
|
11
14
|
"publishConfig": {
|
|
12
|
-
"access": "public"
|
|
13
|
-
"main": "dist/index.esm.js",
|
|
14
|
-
"types": "dist/index.d.ts"
|
|
15
|
+
"access": "public"
|
|
15
16
|
},
|
|
16
17
|
"repository": {
|
|
17
18
|
"type": "git",
|
|
@@ -20,8 +21,32 @@
|
|
|
20
21
|
},
|
|
21
22
|
"license": "Apache-2.0",
|
|
22
23
|
"sideEffects": false,
|
|
23
|
-
"main": "dist/index.esm.js",
|
|
24
|
-
"types": "dist/index.d.ts",
|
|
24
|
+
"main": "./dist/index.esm.js",
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"import": "./dist/index.esm.js",
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"default": "./dist/index.esm.js"
|
|
31
|
+
},
|
|
32
|
+
"./alpha": {
|
|
33
|
+
"backstage": "@backstage/FrontendPlugin",
|
|
34
|
+
"import": "./dist/alpha.esm.js",
|
|
35
|
+
"types": "./dist/alpha.d.ts",
|
|
36
|
+
"default": "./dist/alpha.esm.js"
|
|
37
|
+
},
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
"typesVersions": {
|
|
41
|
+
"*": {
|
|
42
|
+
"alpha": [
|
|
43
|
+
"dist/alpha.d.ts"
|
|
44
|
+
],
|
|
45
|
+
"package.json": [
|
|
46
|
+
"package.json"
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
},
|
|
25
50
|
"files": [
|
|
26
51
|
"dist",
|
|
27
52
|
"config.schema.json"
|
|
@@ -36,8 +61,10 @@
|
|
|
36
61
|
"test": "backstage-cli package test"
|
|
37
62
|
},
|
|
38
63
|
"dependencies": {
|
|
64
|
+
"@backstage/core-compat-api": "^0.5.16",
|
|
39
65
|
"@backstage/core-components": "^0.18.15",
|
|
40
66
|
"@backstage/core-plugin-api": "^1.12.11",
|
|
67
|
+
"@backstage/frontend-plugin-api": "^0.18.2",
|
|
41
68
|
"@date-io/luxon": "1.x",
|
|
42
69
|
"@material-ui/core": "^4.9.13",
|
|
43
70
|
"@material-ui/icons": "^4.9.1",
|
|
@@ -51,10 +78,12 @@
|
|
|
51
78
|
"devDependencies": {
|
|
52
79
|
"@backstage/cli": "^0.36.7",
|
|
53
80
|
"@backstage/dev-utils": "^1.1.28",
|
|
81
|
+
"@backstage/frontend-test-utils": "^0.6.5",
|
|
54
82
|
"@testing-library/dom": "^10.0.0",
|
|
55
83
|
"@testing-library/jest-dom": "^6.0.0",
|
|
56
|
-
"@testing-library/react": "^
|
|
84
|
+
"@testing-library/react": "^16.0.0",
|
|
57
85
|
"@types/lodash": "^4.14.151",
|
|
86
|
+
"@types/react-dom": "^18.3.0",
|
|
58
87
|
"react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
59
88
|
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
60
89
|
"react-router-dom": "*"
|
|
@@ -64,12 +93,5 @@
|
|
|
64
93
|
"react-router-dom": "*"
|
|
65
94
|
},
|
|
66
95
|
"configSchema": "config.schema.json",
|
|
67
|
-
"typesVersions": {
|
|
68
|
-
"*": {
|
|
69
|
-
"package.json": [
|
|
70
|
-
"package.json"
|
|
71
|
-
]
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
96
|
"module": "./dist/index.esm.js"
|
|
75
97
|
}
|