Skip to content

Commit

Permalink
update package json
Browse files Browse the repository at this point in the history
  • Loading branch information
sammbetts committed Nov 8, 2023
1 parent 9da6ac4 commit b6d6d45
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 13,161 deletions.
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

58 changes: 15 additions & 43 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,26 @@
{
"name": "@sammbetts/backstage-plugin-service-health-dashboard",
"description": "A backstage plugin for showing third party services health and incidents",
"version": "0.2.0",
"repository": "https://github.com/sammbetts/backstage-plugin-service-health.git",
"name": "root",
"version": "0.1.0",
"engines": {
"node": "16 || 18"
},
"main": "/src/index.ts",
"types": "/src/index.ts",
"license": "Apache-2.0",
"private": false,
"publishConfig": {
"access": "public",
"registry": "https://npm.pkg.github.com",
"main": "dist/index.esm.js",
"types": "dist/index.d.ts"
},
"backstage": {
"role": "frontend-plugin"
},
"scripts": {
"start": "backstage-cli package start",
"dev": "concurrently \"yarn start\" \"yarn start-backend\"",
"start": "yarn workspace backstage-plugin-service-health-dashboard start",
"start-backend": "yarn workspace backstage-plugin-service-health-backend start",
"build": "backstage-cli package build",
"build:all": "backstage-cli repo build --all",
"tsc": "tsc",
"lint": "backstage-cli package lint",
"test": "backstage-cli package test",
"clean": "backstage-cli package clean",
"prepack": "backstage-cli package prepack",
"postpack": "backstage-cli package postpack"
},
"dependencies": {
"@backstage/core-components": "^0.13.3",
"@backstage/core-plugin-api": "^1.5.3",
"@material-ui/core": "^4.9.13",
"@material-ui/icons": "^4.9.1",
"@spotify/prettier-config": "^15.0.0",
"axios": "^1.4.0",
"luxon": "^3.4.0",
"react-use": "^18",
"typescript": "^5.0.0"
},
"peerDependencies": {
"react": "^16.13.1 || ^18.0.0",
"react-dom": "^16.13.1 || ^18.0.0",
"react-router": "^6.3.0",
"react-router-dom": "^6.3.0"
},
"devDependencies": {
"@backstage/cli": "^0.22.9",
"@backstage/core-app-api": "^1.9.0",
Expand All @@ -53,25 +29,21 @@
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
"@types/luxon": "^3.3.1",
"@spotify/prettier-config": "^15.0.0",
"concurrently": "^6.0.0",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"react": "^18",
"react-dom": "17",
"react": "^16.13.1 || ^18.0.0",
"react-use": "^17.4.0",
"react-dom": "^16.13.1 || ^18.0.0",
"react-router": "^6.3.0",
"react-router-dom": "^6.3.0"
"react-router-dom": "^6.3.0",
"typescript": "^5.0.0"
},
"resolutions": {
"@types/react": "^18",
"@types/react-dom": "^18",
"react": "^18",
"react-dom": "^18",
"react-router": "^6.3.0",
"react-router-dom": "^6.3.0"
"@types/react-dom": "^18"
},
"files": [
"dist"
],
"packageManager": "yarn@3.2.4",
"prettier": "@spotify/prettier-config",
"lint-staged": {
Expand Down
4 changes: 4 additions & 0 deletions service-health-backend/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module "*.png" {
const value: any;
export = value;
}
2 changes: 2 additions & 0 deletions service-health-backend/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"name": "@sammbetts/backstage-plugin-service-health-backend",
"version": "0.1.0",
"repository": "https://github.com/sammbetts/backstage-plugin-service-health.git",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
"private": false,
"publishConfig": {
"access": "public",
"registry": "https://npm.pkg.github.com",
"main": "dist/index.cjs.js",
"types": "dist/index.d.ts"
},
Expand Down
10 changes: 5 additions & 5 deletions service-health-backend/src/service/IncidentNotifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ export class IncidentNotifier {

constructor(logger: Logger, config: Config) {
this.logger = logger;
this.slackWebhookUrl = config.getString(
'serviceHealth.slackWebhookUrl',
);
this.slackWebhookUrl = config.getString('serviceHealth.slackWebhookUrl');
}

async connect(database: PluginDatabaseManager) {
Expand All @@ -36,7 +34,7 @@ export class IncidentNotifier {
for (const incident of service.incidents) {
if (await this.isIncidentNew(incident.id)) {
incident.serviceName = service.serviceName;
incident.componentName = service.incidentComponents;
incident.componentName = service.incidentComponents.join(', ');
incident.updated = convertToUKDateTimeFormat(
incident.modified || incident.updated_at || incident.date_updated,
);
Expand All @@ -51,7 +49,9 @@ export class IncidentNotifier {
services: newIncidents,
};
} catch (error) {
this.logger.error(`Error while fetching health data: ${(error as Error).message}`);
this.logger.error(
`Error while fetching health data: ${(error as Error).message}`,
);
return { services: [] };
}
}
Expand Down
4 changes: 0 additions & 4 deletions service-health-backend/src/service/serviceHealthLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,6 @@ export async function refreshAllServices(_: DatabaseHandler): Promise<any> {
const opsGenieIncidents = fetchDataFromAPI(
'https://opsgenie.status.atlassian.com/api/v2/summary.json',
);
const robinIncidents = fetchDataFromAPI(
'https://status.robinpowered.com/api/v2/summary.json',
);
const slackIncidents = fetchDataFromSlackAPI(
'https://status.slack.com/api/v2.0.0/current',
);
Expand All @@ -152,7 +149,6 @@ export async function refreshAllServices(_: DatabaseHandler): Promise<any> {
hashiCorpIncidents,
jiraIncidents,
opsGenieIncidents,
robinIncidents,
slackIncidents,
statusPageIncidents,
vercelPageIncidents,
Expand Down
6 changes: 4 additions & 2 deletions service-health-dashboard/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"name": "@sammbetts/backstage-plugin-service-health-dashboard",
"version": "0.2.0",
"version": "0.1.0",
"repository": "https://github.com/sammbetts/backstage-plugin-service-health.git",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
"private": false,
"publishConfig": {
"access": "public",
"registry": "https://npm.pkg.github.com",
"main": "dist/index.esm.js",
"types": "dist/index.d.ts"
},
Expand Down Expand Up @@ -34,7 +36,7 @@
"@types/react-dom": "18",
"axios": "^1.4.0",
"luxon": "^3.4.0",
"react": "18",
"react": "^16.13.1 || ^18.0.0",
"react-dom": "18",
"react-use": "^17.4.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import GCP from '../assets/gcp.png';
import GoogleWorkspace from '../assets/googleworkspace.png';
import HashiCorp from '../assets/hashicorp.png';
import Jira from '../assets/jira.png';
import Robin from '../assets/robin.png';
import Slack from '../assets/slack.png';
import StatusPage from '../assets/statuspage.png';
import OpsGenie from '../assets/opsgenie.png';
Expand Down Expand Up @@ -68,7 +67,6 @@ const icons = {
'Google Cloud Platform': GCP,
'Google Workspace': GoogleWorkspace,
'HashiCorp Services': HashiCorp,
Robin: Robin,
'Jira Software': Jira,
Opsgenie: OpsGenie,
Slack: Slack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const ServiceHealth = (props: TableProps) => {
incidentServiceName={
incident.service_name || // google
incident.services || // slack
incident.components[0].name // all others
incident.components[0].name.join(', ') // all others
}
incidentStatus={
<>
Expand Down
2 changes: 1 addition & 1 deletion service-health-dashboard/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11013,7 +11013,7 @@ react-universal-interface@^0.6.2:
resolved "https://registry.yarnpkg.com/react-universal-interface/-/react-universal-interface-0.6.2.tgz#5e8d438a01729a4dbbcbeeceb0b86be146fe2b3b"
integrity sha512-dg8yXdcQmvgR13RIlZbTRQOoUrDciFVoSBZILwjE2LFISxZZ8loVJKAkuzswl5js8BHda79bIb2b84ehU8IjXw==

react-use@^17.2.4, react-use@^17.3.2:
react-use@^17.2.4, react-use@^17.3.2, react-use@^17.4.0:
version "17.4.0"
resolved "https://registry.yarnpkg.com/react-use/-/react-use-17.4.0.tgz#cefef258b0a6c534a5c8021c2528ac6e1a4cdc6d"
integrity sha512-TgbNTCA33Wl7xzIJegn1HndB4qTS9u03QUwyNycUnXaweZkE4Kq2SB+Yoxx8qbshkZGYBDvUXbXWRUmQDcZZ/Q==
Expand Down
8 changes: 7 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"extends": "@backstage/cli/config/tsconfig.json",
"include": ["service-health-backend/src", "service-health-dashboard/src", "service-health-dashboard/dev", "global.d.ts"],
"include": [
"service-health-backend/src",
"service-health-dashboard/src",
"service-health-dashboard/dev",
"service-health-dashboard-backend/dev",
"global.d.ts"
],
"exclude": ["node_modules"],
"compilerOptions": {
"outDir": "dist-types",
Expand Down
Loading

0 comments on commit b6d6d45

Please sign in to comment.