Skip to content

Commit 0d3e031

Browse files
Servicenow Plugin - New Frontend Support (#4826)
* Adding new fs system for Service Now Signed-off-by: Mohamed El-Malah <[email protected]> * Changeset Signed-off-by: Mohamed El-Malah <[email protected]> * dedupe Signed-off-by: Mohamed El-Malah <[email protected]> * Adding exports and api report Signed-off-by: Mohamed El-Malah <[email protected]> * yarn --fix Signed-off-by: Mohamed El-Malah <[email protected]> * add compatibility Signed-off-by: Mohamed El-Malah <[email protected]> --------- Signed-off-by: Mohamed El-Malah <[email protected]> Signed-off-by: Christoph Jerolimov <[email protected]> Co-authored-by: Christoph Jerolimov <[email protected]>
1 parent 933074c commit 0d3e031

File tree

8 files changed

+200
-7
lines changed

8 files changed

+200
-7
lines changed

docs/compatibility/new-frontend-system.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ This page provides a table listing all the frontend plugins in the Community Plu
9292
| @backstage-community/plugin-report-portal | frontend-plugin | | 1.41.1 | | [README](https://github.com/backstage/community-plugins/blob/master/workspaces/report-portal/plugins/report-portal/README.md) |
9393
| @backstage-community/plugin-rollbar | frontend-plugin | | 1.40.2 | | [README](https://github.com/backstage/community-plugins/blob/master/workspaces/rollbar/plugins/rollbar/README.md) |
9494
| @backstage-community/plugin-sentry | frontend-plugin | true | 1.42.4 | true | [README](https://github.com/backstage/community-plugins/blob/master/workspaces/sentry/plugins/sentry/README.md) |
95-
| @backstage-community/plugin-servicenow | frontend-plugin | | 1.41.1 | | [README](https://github.com/backstage/community-plugins/blob/master/workspaces/servicenow/plugins/servicenow/README.md) |
95+
| @backstage-community/plugin-servicenow | frontend-plugin | true | 1.41.1 | true | [README](https://github.com/backstage/community-plugins/blob/master/workspaces/servicenow/plugins/servicenow/README.md) |
9696
| @backstage-community/plugin-shortcuts | frontend-plugin | | 1.42.4 | | [README](https://github.com/backstage/community-plugins/blob/master/workspaces/shortcuts/plugins/shortcuts/README.md) |
9797
| @backstage-community/plugin-sonarqube | frontend-plugin | true | 1.42.3 | true | [README](https://github.com/backstage/community-plugins/blob/master/workspaces/sonarqube/plugins/sonarqube/README.md) |
9898
| @backstage-community/plugin-splunk-on-call | frontend-plugin | | 1.42.4 | | [README](https://github.com/backstage/community-plugins/blob/master/workspaces/splunk/plugins/splunk-on-call/README.md) |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@backstage-community/plugin-servicenow': minor
3+
---
4+
5+
Added support for the new frontend system

workspaces/servicenow/plugins/servicenow/package.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,28 @@
55
"main": "src/index.ts",
66
"types": "src/index.ts",
77
"publishConfig": {
8-
"access": "public",
9-
"main": "dist/index.esm.js",
10-
"types": "dist/index.d.ts"
8+
"access": "public"
119
},
1210
"repository": {
1311
"type": "git",
1412
"url": "https://github.com/backstage/community-plugins",
1513
"directory": "workspaces/servicenow/plugins/servicenow"
1614
},
15+
"exports": {
16+
".": "./src/index.ts",
17+
"./alpha": "./src/alpha.ts",
18+
"./package.json": "./package.json"
19+
},
20+
"typesVersions": {
21+
"*": {
22+
"alpha": [
23+
"src/alpha.ts"
24+
],
25+
"package.json": [
26+
"package.json"
27+
]
28+
}
29+
},
1730
"backstage": {
1831
"role": "frontend-plugin",
1932
"pluginId": "servicenow",
@@ -36,8 +49,10 @@
3649
"dependencies": {
3750
"@backstage-community/plugin-servicenow-common": "workspace:^",
3851
"@backstage/catalog-model": "^1.7.5",
52+
"@backstage/core-compat-api": "^0.4.4",
3953
"@backstage/core-components": "^0.17.4",
4054
"@backstage/core-plugin-api": "^1.10.9",
55+
"@backstage/frontend-plugin-api": "^0.10.4",
4156
"@backstage/plugin-catalog-react": "^1.19.1",
4257
"@backstage/theme": "^0.6.7",
4358
"@mui/icons-material": "^5.15.17",
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
## API Report File for "@backstage-community/plugin-servicenow"
2+
3+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4+
5+
```ts
6+
/// <reference types="react" />
7+
8+
import { AnyApiFactory } from '@backstage/core-plugin-api';
9+
import { AnyRouteRefParams } from '@backstage/frontend-plugin-api';
10+
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
11+
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
12+
import { FrontendPlugin } from '@backstage/frontend-plugin-api';
13+
import { JSX as JSX_2 } from 'react';
14+
import { RouteRef } from '@backstage/frontend-plugin-api';
15+
16+
// @alpha (undocumented)
17+
const _default: FrontendPlugin<
18+
{},
19+
{},
20+
{
21+
'api:servicenow': ExtensionDefinition<{
22+
kind: 'api';
23+
name: undefined;
24+
config: {};
25+
configInput: {};
26+
output: ConfigurableExtensionDataRef<
27+
AnyApiFactory,
28+
'core.api.factory',
29+
{}
30+
>;
31+
inputs: {};
32+
params: {
33+
factory: AnyApiFactory;
34+
};
35+
}>;
36+
'page:servicenow': ExtensionDefinition<{
37+
kind: 'page';
38+
name: undefined;
39+
config: {
40+
path: string | undefined;
41+
};
42+
configInput: {
43+
path?: string | undefined;
44+
};
45+
output:
46+
| ConfigurableExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
47+
| ConfigurableExtensionDataRef<string, 'core.routing.path', {}>
48+
| ConfigurableExtensionDataRef<
49+
RouteRef<AnyRouteRefParams>,
50+
'core.routing.ref',
51+
{
52+
optional: true;
53+
}
54+
>;
55+
inputs: {};
56+
params: {
57+
defaultPath: string;
58+
loader: () => Promise<JSX.Element>;
59+
routeRef?: RouteRef<AnyRouteRefParams> | undefined;
60+
};
61+
}>;
62+
}
63+
>;
64+
export default _default;
65+
66+
// (No @packageDocumentation comment for this package)
67+
```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright 2025 The Backstage Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
export * from './alpha/index';
18+
export { default } from './alpha/index';
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright 2025 The Backstage Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
export { default } from './plugin';
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
* Copyright 2025 The Backstage Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import {
18+
ApiBlueprint,
19+
createApiFactory,
20+
PageBlueprint,
21+
createFrontendPlugin,
22+
discoveryApiRef,
23+
fetchApiRef,
24+
identityApiRef,
25+
} from '@backstage/frontend-plugin-api';
26+
import {
27+
compatWrapper,
28+
convertLegacyRouteRef,
29+
} from '@backstage/core-compat-api';
30+
import {
31+
serviceNowApiRef,
32+
ServiceNowBackendClient,
33+
} from '../api/ServiceNowBackendClient';
34+
35+
import { rootRouteRef } from '../routes';
36+
37+
/** @alpha */
38+
export const servicenowApi = ApiBlueprint.make({
39+
params: {
40+
factory: createApiFactory({
41+
api: serviceNowApiRef,
42+
deps: {
43+
discoveryApi: discoveryApiRef,
44+
fetchApi: fetchApiRef,
45+
identityApi: identityApiRef,
46+
},
47+
factory: ({ discoveryApi, fetchApi, identityApi }) =>
48+
new ServiceNowBackendClient(discoveryApi, fetchApi, identityApi),
49+
}),
50+
},
51+
});
52+
53+
/** @alpha */
54+
export const servicenowPage = PageBlueprint.make({
55+
params: {
56+
defaultPath: '/servicenow',
57+
routeRef: convertLegacyRouteRef(rootRouteRef),
58+
loader: () =>
59+
import('../components/Servicenow').then(m =>
60+
compatWrapper(<m.ServicenowContent />),
61+
),
62+
},
63+
});
64+
65+
/** @alpha */
66+
export default createFrontendPlugin({
67+
pluginId: 'servicenow',
68+
extensions: [servicenowApi, servicenowPage],
69+
});

workspaces/servicenow/yarn.lock

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2544,9 +2544,11 @@ __metadata:
25442544
"@backstage/catalog-model": "npm:^1.7.5"
25452545
"@backstage/cli": "npm:^0.33.1"
25462546
"@backstage/core-app-api": "npm:^1.18.0"
2547+
"@backstage/core-compat-api": "npm:^0.4.4"
25472548
"@backstage/core-components": "npm:^0.17.4"
25482549
"@backstage/core-plugin-api": "npm:^1.10.9"
25492550
"@backstage/dev-utils": "npm:^1.1.12"
2551+
"@backstage/frontend-plugin-api": "npm:^0.10.4"
25502552
"@backstage/plugin-catalog-react": "npm:^1.19.1"
25512553
"@backstage/test-utils": "npm:^1.7.10"
25522554
"@backstage/theme": "npm:^0.6.7"
@@ -3970,9 +3972,9 @@ __metadata:
39703972
linkType: hard
39713973

39723974
"@electric-sql/pglite@npm:^0.3.0":
3973-
version: 0.3.5
3974-
resolution: "@electric-sql/pglite@npm:0.3.5"
3975-
checksum: 10/ac4f07ba2737768440fed8a4ac23b864a9d40115518a82b4de5cd166a5d8d18a5b010c762d8092701b0afb1da2540012498a28f17991d060ca8c55b45348e241
3975+
version: 0.3.7
3976+
resolution: "@electric-sql/pglite@npm:0.3.7"
3977+
checksum: 10/e76b99a06bdba55c3249f2e4fc17fce043460509943b73c14c2ad558854ff4cc752ccb8d438cd7340866b76b3031e3bc37085032decfbaaf871dcd9d07d732df
39763978
languageName: node
39773979
linkType: hard
39783980

0 commit comments

Comments
 (0)