diff --git a/packages/redux-devtools-cli/package.json b/packages/redux-devtools-cli/package.json index b2159169..aa0c0c2b 100644 --- a/packages/redux-devtools-cli/package.json +++ b/packages/redux-devtools-cli/package.json @@ -58,7 +58,7 @@ "lodash": "^4.17.21", "minimist": "^1.2.5", "morgan": "^1.10.0", - "open": "^7.4.2", + "open": "^8.2.1", "react": "^16.14.0", "react-dom": "^16.14.0", "semver": "^7.3.5", diff --git a/packages/redux-devtools-cli/src/bin/openApp.ts b/packages/redux-devtools-cli/src/bin/openApp.ts index 5be253f9..f0b31f51 100644 --- a/packages/redux-devtools-cli/src/bin/openApp.ts +++ b/packages/redux-devtools-cli/src/bin/openApp.ts @@ -3,7 +3,7 @@ import path from 'path'; import spawn from 'cross-spawn'; import { Options } from '../options'; -export default function openApp(app: boolean | string, options: Options) { +export default async function openApp(app: true | string, options: Options) { if (app === true || app === 'electron') { try { const port = options.port ? `--port=${options.port}` : ''; @@ -31,9 +31,9 @@ export default function openApp(app: boolean | string, options: Options) { } return; } - // eslint-disable-next-line @typescript-eslint/no-floating-promises - open( + + await open( `http://localhost:${options.port}/`, - app !== 'browser' ? { app: app as string } : undefined + app !== 'browser' ? { app: { name: app } } : undefined ); } diff --git a/packages/redux-devtools-cli/src/bin/redux-devtools.ts b/packages/redux-devtools-cli/src/bin/redux-devtools.ts index dd8570eb..d63802e9 100644 --- a/packages/redux-devtools-cli/src/bin/redux-devtools.ts +++ b/packages/redux-devtools-cli/src/bin/redux-devtools.ts @@ -90,8 +90,8 @@ if (argv.injectserver) { // eslint-disable-next-line @typescript-eslint/no-floating-promises server(argv).then(function (r) { if (argv.open && argv.open !== 'false') { - r.on('ready', function () { - openApp(argv.open, options); + r.on('ready', async function () { + await openApp(argv.open, options); }); } }); diff --git a/packages/redux-devtools-cli/src/index.ts b/packages/redux-devtools-cli/src/index.ts index 2421ec6e..0ec675ce 100644 --- a/packages/redux-devtools-cli/src/index.ts +++ b/packages/redux-devtools-cli/src/index.ts @@ -14,7 +14,7 @@ export interface ExtendedOptions extends Options { export default function (argv: { [arg: string]: any }): Promise<{ portAlreadyUsed?: boolean; - on: (status: 'ready', cb: () => void) => void; + on: (status: 'ready', cb: (() => void) | (() => Promise)) => void; }> { const options = Object.assign(getOptions(argv), { workerController: __dirname + '/worker.js', diff --git a/yarn.lock b/yarn.lock index c418012a..42f445ca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4954,7 +4954,7 @@ __metadata: minimist: ^1.2.5 morgan: ^1.10.0 ncp: ^2.0.0 - open: ^7.4.2 + open: ^8.2.1 react: ^16.14.0 react-dom: ^16.14.0 semver: ^7.3.5 @@ -22783,7 +22783,7 @@ fsevents@^1.2.7: languageName: node linkType: hard -"open@npm:^7.0.2, open@npm:^7.0.3, open@npm:^7.4.2": +"open@npm:^7.0.2, open@npm:^7.0.3": version: 7.4.2 resolution: "open@npm:7.4.2" dependencies: @@ -22793,7 +22793,7 @@ fsevents@^1.2.7: languageName: node linkType: hard -"open@npm:^8.0.9": +"open@npm:^8.0.9, open@npm:^8.2.1": version: 8.2.1 resolution: "open@npm:8.2.1" dependencies: