Skip to content

Commit

Permalink
Merge pull request #192 from K-Phoen/dependencies-bump/2023-12-27
Browse files Browse the repository at this point in the history
Bump dependencies to match Backstage 1.21.1
  • Loading branch information
K-Phoen committed Dec 27, 2023
2 parents 0c9d794 + 54d27f2 commit 26b0816
Show file tree
Hide file tree
Showing 10 changed files with 1,547 additions and 1,010 deletions.
7 changes: 7 additions & 0 deletions .changeset/wicked-steaks-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@k-phoen/backstage-plugin-announcements-backend': patch
'@k-phoen/backstage-plugin-announcements-common': patch
'@k-phoen/backstage-plugin-announcements': patch
---

Bump dependencies to match Backstage 1.21.1
2 changes: 0 additions & 2 deletions app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ backend:
database:
client: better-sqlite3
connection: ':memory:'
cache:
store: memory
cors:
origin: http://localhost:3000
methods: [GET, HEAD, PATCH, POST, PUT, DELETE]
Expand Down
2 changes: 1 addition & 1 deletion backstage.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.15.0"
"version": "1.21.1"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
]
},
"devDependencies": {
"@backstage/cli": "^0.22.8",
"@backstage/cli": "^0.25.0",
"@changesets/cli": "^2.18.0",
"@spotify/prettier-config": "^12.0.0",
"@types/webpack": "^5.28.0",
Expand Down
17 changes: 17 additions & 0 deletions plugins/announcements-backend/dev/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import yn from 'yn';
import { getRootLogger } from '@backstage/backend-common';
import { startStandaloneServer } from '../src/service/standaloneServer';

const port = process.env.PLUGIN_PORT ? Number(process.env.PLUGIN_PORT) : 7007;
const enableCors = yn(process.env.PLUGIN_CORS, { default: false });
const logger = getRootLogger();

startStandaloneServer({ port, enableCors, logger }).catch(err => {
logger.error(err);
process.exit(1);
});

process.on('SIGINT', () => {
logger.info('CTRL+C pressed; exiting.');
process.exit(0);
});
20 changes: 10 additions & 10 deletions plugins/announcements-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@
"postpack": "backstage-cli package postpack"
},
"dependencies": {
"@backstage/backend-common": "^0.19.0",
"@backstage/config": "^1.0.8",
"@backstage/core-plugin-api": "^1.5.2",
"@backstage/errors": "^1.2.0",
"@backstage/plugin-auth-node": "^0.2.15",
"@backstage/plugin-permission-common": "^0.7.6",
"@backstage/plugin-permission-node": "^0.7.9",
"@backstage/plugin-search-common": "^1.2.4",
"@backstage/backend-common": "^0.20.0",
"@backstage/config": "^1.1.1",
"@backstage/core-plugin-api": "^1.8.1",
"@backstage/errors": "^1.2.3",
"@backstage/plugin-auth-node": "^0.4.2",
"@backstage/plugin-permission-common": "^0.7.11",
"@backstage/plugin-permission-node": "^0.7.19",
"@backstage/plugin-search-common": "^1.2.9",
"@k-phoen/backstage-plugin-announcements-common": "^0.0.7",
"@types/express": "^4.17.6",
"cross-fetch": "^3.1.5",
"express": "^4.17.1",
"express-promise-router": "^4.1.0",
"knex": "^2.0.0",
"knex": "^3.0.0",
"luxon": "^3.2.0",
"node-fetch": "^2.6.7",
"slugify": "^1.6.6",
Expand All @@ -52,7 +52,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.22.8",
"@backstage/cli": "^0.25.0",
"@types/supertest": "^2.0.8",
"@types/uuid": "^8.3.4",
"better-sqlite3": "^8.0.0",
Expand Down
25 changes: 13 additions & 12 deletions plugins/announcements-backend/src/service/standaloneServer.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Server } from 'http';
import Knex from 'knex';
import { Logger } from 'winston';
import {
createServiceBuilder,
useHotMemoize,
ServerTokenManager,
loadBackendConfig,
SingleHostDiscovery,
HostDiscovery,
DatabaseManager,
} from '@backstage/backend-common';
import { buildAnnouncementsContext } from './announcementsContextBuilder';
import { createRouter } from './router';
import { ServerPermissionClient } from '@backstage/plugin-permission-node';
import { ConfigReader } from '@backstage/config';

export interface ServerOptions {
port: number;
Expand All @@ -25,7 +25,7 @@ export async function startStandaloneServer(
service: 'announcements-backend-backend',
});
const config = await loadBackendConfig({ logger, argv: process.argv });
const discovery = SingleHostDiscovery.fromConfig(config);
const discovery = HostDiscovery.fromConfig(config);
const tokenManager = ServerTokenManager.fromConfig(config, { logger });
const permissions = ServerPermissionClient.fromConfig(config, {
discovery,
Expand All @@ -34,17 +34,18 @@ export async function startStandaloneServer(

logger.debug('Starting application server...');

const database = useHotMemoize(module, () => {
return Knex({
client: 'better-sqlite3',
connection: ':memory:',
useNullAsDefault: true,
});
});
const manager = DatabaseManager.fromConfig(
new ConfigReader({
backend: {
database: { client: 'better-sqlite3', connection: ':memory:' },
},
}),
);
const database = manager.forPlugin('announcements');

const announcementsContext = await buildAnnouncementsContext({
logger: logger,
database: { getClient: async () => database },
database: database,
permissions,
});

Expand Down
4 changes: 2 additions & 2 deletions plugins/announcements-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
"postpack": "backstage-cli package postpack"
},
"devDependencies": {
"@backstage/cli": "^0.22.8"
"@backstage/cli": "^0.25.0"
},
"dependencies": {
"@backstage/plugin-permission-common": "^0.7.6"
"@backstage/plugin-permission-common": "^0.7.11"
},
"files": [
"dist"
Expand Down
26 changes: 13 additions & 13 deletions plugins/announcements/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@
"postpack": "backstage-cli package postpack"
},
"dependencies": {
"@backstage/catalog-model": "^1.4.0",
"@backstage/core-app-api": "^1.8.1",
"@backstage/core-components": "^0.13.2",
"@backstage/core-plugin-api": "^1.5.2",
"@backstage/errors": "^1.2.0",
"@backstage/plugin-catalog-react": "^1.7.0",
"@backstage/plugin-permission-react": "^0.4.13",
"@backstage/plugin-search-common": "^1.2.4",
"@backstage/plugin-search-react": "^1.6.2",
"@backstage/theme": "^0.4.0",
"@backstage/catalog-model": "^1.4.3",
"@backstage/core-app-api": "^1.11.2",
"@backstage/core-components": "^0.13.9",
"@backstage/core-plugin-api": "^1.8.1",
"@backstage/errors": "^1.2.3",
"@backstage/plugin-catalog-react": "^1.9.2",
"@backstage/plugin-permission-react": "^0.4.18",
"@backstage/plugin-search-common": "^1.2.9",
"@backstage/plugin-search-react": "^1.7.4",
"@backstage/theme": "^0.5.0",
"@k-phoen/backstage-plugin-announcements-common": "^0.0.7",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
Expand All @@ -53,9 +53,9 @@
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
},
"devDependencies": {
"@backstage/cli": "^0.22.8",
"@backstage/dev-utils": "^1.0.16",
"@backstage/test-utils": "^1.4.0",
"@backstage/cli": "^0.25.0",
"@backstage/dev-utils": "^1.0.25",
"@backstage/test-utils": "^1.4.6",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
Expand Down
Loading

0 comments on commit 26b0816

Please sign in to comment.