From d4cf84c37acfe6a2308d85db854b55b88a3aea5b Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Sun, 12 Jun 2022 21:13:16 -0400 Subject: [PATCH] Fixes --- packages/redux-devtools-cli/src/db/connector.ts | 4 ++-- packages/redux-devtools-cli/src/routes.ts | 11 ++++++----- packages/redux-devtools-cli/src/store.ts | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/redux-devtools-cli/src/db/connector.ts b/packages/redux-devtools-cli/src/db/connector.ts index 64d78cbb..c07a4d92 100644 --- a/packages/redux-devtools-cli/src/db/connector.ts +++ b/packages/redux-devtools-cli/src/db/connector.ts @@ -1,8 +1,8 @@ import path from 'path'; import knexModule, { Knex } from 'knex'; -import { SCServer } from 'socketcluster-server'; +import { AGServer } from 'socketcluster-server'; -export default function connector(options: SCServer.SCServerOptions) { +export default function connector(options: AGServer.AGServerOptions) { const dbOptions = options.dbOptions as Knex.Config; dbOptions.useNullAsDefault = true; if (!(dbOptions as any).migrate) { diff --git a/packages/redux-devtools-cli/src/routes.ts b/packages/redux-devtools-cli/src/routes.ts index e0b7b0a6..b9e46376 100644 --- a/packages/redux-devtools-cli/src/routes.ts +++ b/packages/redux-devtools-cli/src/routes.ts @@ -5,7 +5,7 @@ import morgan from 'morgan'; import * as http from 'http'; import bodyParser from 'body-parser'; import cors from 'cors'; -import { SCServer } from 'socketcluster-server'; +import { AGServer } from 'socketcluster-server'; import { ApolloServer } from 'apollo-server-express'; import { AddData, ReportBaseFields, Store } from './store'; import { resolvers, schema } from './api/schema'; @@ -21,9 +21,9 @@ function serveUmdModule(name: string) { } function routes( - options: SCServer.SCServerOptions, + options: AGServer.AGServerOptions, store: Store, - scServer: SCServer + scServer: AGServer ): Router { const limit = options.maxRequestBody; const logHTTPRequests = options.logHTTPRequests; @@ -65,7 +65,8 @@ function routes( serveUmdModule('@redux-devtools/app'); app.get('/port.js', function (req, res) { - res.send(`reduxDevToolsPort = ${options.port!}`); + // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + res.send(`reduxDevToolsPort = ${options.port}`); }); app.get('*', function (req, res) { res.sendFile(path.join(__dirname, '../app/index.html')); @@ -108,7 +109,7 @@ function routes( id: (r as ReportBaseFields).id, error: (r as { error: string }).error, }); - scServer.exchange.publish('report', { + scServer.exchange.transmitPublish('report', { type: 'add', data: r, }); diff --git a/packages/redux-devtools-cli/src/store.ts b/packages/redux-devtools-cli/src/store.ts index 08da6b76..0d6edd99 100644 --- a/packages/redux-devtools-cli/src/store.ts +++ b/packages/redux-devtools-cli/src/store.ts @@ -1,6 +1,6 @@ import { v4 as uuidV4 } from 'uuid'; import pick from 'lodash/pick'; -import { SCServer } from 'socketcluster-server'; +import { AGServer } from 'socketcluster-server'; import { Knex } from 'knex'; import connector from './db/connector'; @@ -139,7 +139,7 @@ export interface Store { add: (data: AddData) => Promise; } -function createStore(options: SCServer.SCServerOptions): Store { +function createStore(options: AGServer.AGServerOptions): Store { knex = connector(options); return {