diff --git a/packages/kbn-config/src/__mocks__/env.ts b/packages/kbn-config/src/__mocks__/env.ts index f37ac14e60235..e0f6f6add1686 100644 --- a/packages/kbn-config/src/__mocks__/env.ts +++ b/packages/kbn-config/src/__mocks__/env.ts @@ -30,7 +30,6 @@ export function getEnvOptions(options: DeepPartial = {}): EnvOptions configs: options.configs || [], cliArgs: { dev: true, - open: false, quiet: false, silent: false, watch: false, diff --git a/packages/kbn-config/src/__snapshots__/env.test.ts.snap b/packages/kbn-config/src/__snapshots__/env.test.ts.snap index 005fa6e680f8b..884896266344c 100644 --- a/packages/kbn-config/src/__snapshots__/env.test.ts.snap +++ b/packages/kbn-config/src/__snapshots__/env.test.ts.snap @@ -10,7 +10,6 @@ Env { "disableOptimizer": true, "dist": false, "envName": "development", - "open": false, "oss": false, "quiet": false, "repl": false, @@ -56,7 +55,6 @@ Env { "disableOptimizer": true, "dist": false, "envName": "production", - "open": false, "oss": false, "quiet": false, "repl": false, @@ -101,7 +99,6 @@ Env { "dev": true, "disableOptimizer": true, "dist": false, - "open": false, "oss": false, "quiet": false, "repl": false, @@ -146,7 +143,6 @@ Env { "dev": false, "disableOptimizer": true, "dist": false, - "open": false, "oss": false, "quiet": false, "repl": false, @@ -191,7 +187,6 @@ Env { "dev": false, "disableOptimizer": true, "dist": false, - "open": false, "oss": false, "quiet": false, "repl": false, @@ -236,7 +231,6 @@ Env { "dev": false, "disableOptimizer": true, "dist": false, - "open": false, "oss": false, "quiet": false, "repl": false, diff --git a/packages/kbn-config/src/env.ts b/packages/kbn-config/src/env.ts index e7b4658262235..7edb4b1c8dad9 100644 --- a/packages/kbn-config/src/env.ts +++ b/packages/kbn-config/src/env.ts @@ -38,7 +38,6 @@ export interface CliArgs { watch: boolean; repl: boolean; basePath: boolean; - open: boolean; oss: boolean; /** @deprecated use disableOptimizer to know if the @kbn/optimizer is disabled in development */ optimize?: boolean; diff --git a/src/cli/cluster/cluster_manager.test.ts b/src/cli/cluster/cluster_manager.test.ts index a8e139533d397..1d2986e742527 100644 --- a/src/cli/cluster/cluster_manager.test.ts +++ b/src/cli/cluster/cluster_manager.test.ts @@ -38,7 +38,6 @@ import { Worker } from './worker'; const CLI_ARGS: SomeCliArgs = { disableOptimizer: true, - open: false, oss: false, quiet: false, repl: false, diff --git a/src/cli/cluster/cluster_manager.ts b/src/cli/cluster/cluster_manager.ts index 931650a67687c..f427c8750912b 100644 --- a/src/cli/cluster/cluster_manager.ts +++ b/src/cli/cluster/cluster_manager.ts @@ -18,10 +18,8 @@ */ import { resolve } from 'path'; -import { format as formatUrl } from 'url'; import Fs from 'fs'; -import opn from 'opn'; import { REPO_ROOT } from '@kbn/utils'; import { FSWatcher } from 'chokidar'; import * as Rx from 'rxjs'; @@ -43,7 +41,6 @@ export type SomeCliArgs = Pick< | 'silent' | 'repl' | 'disableOptimizer' - | 'open' | 'watch' | 'oss' | 'runExamples' @@ -52,7 +49,7 @@ export type SomeCliArgs = Pick< >; const firstAllTrue = (...sources: Array>) => - Rx.combineLatest(...sources).pipe( + Rx.combineLatest(sources).pipe( filter((values) => values.every((v) => v === true)), take(1), mapTo(undefined) @@ -146,17 +143,6 @@ export class ClusterManager { }); }); - if (opts.open) { - this.setupOpen( - formatUrl({ - protocol: config.get('server.ssl.enabled') ? 'https' : 'http', - hostname: config.get('server.host'), - port: config.get('server.port'), - pathname: this.basePathProxy ? this.basePathProxy.basePath : '', - }) - ); - } - if (opts.watch) { const pluginPaths = config.get('plugins.paths'); const scanDirs = [ @@ -208,14 +194,6 @@ export class ClusterManager { } } - setupOpen(openUrl: string) { - firstAllTrue(this.serverReady$, this.kbnOptimizerReady$) - .toPromise() - .then(() => { - opn(openUrl); - }); - } - setupWatching(extraPaths: string[], pluginInternalDirsIgnore: string[]) { // eslint-disable-next-line @typescript-eslint/no-var-requires const chokidar = require('chokidar'); diff --git a/src/cli/serve/serve.js b/src/cli/serve/serve.js index f344d3b70ed9d..2fa24cc7f3791 100644 --- a/src/cli/serve/serve.js +++ b/src/cli/serve/serve.js @@ -192,7 +192,6 @@ export default function (program) { if (CAN_CLUSTER) { command .option('--dev', 'Run the server with development mode defaults') - .option('--open', 'Open a browser window to the base url after the server is started') .option('--ssl', 'Run the dev server using HTTPS') .option('--dist', 'Use production assets from kbn/optimizer') .option( @@ -222,7 +221,6 @@ export default function (program) { configs: [].concat(opts.config || []), cliArgs: { dev: !!opts.dev, - open: !!opts.open, envName: unknownOptions.env ? unknownOptions.env.name : undefined, quiet: !!opts.quiet, silent: !!opts.silent, diff --git a/src/core/test_helpers/kbn_server.ts b/src/core/test_helpers/kbn_server.ts index 3bb1b202f811c..ab89d58681dcd 100644 --- a/src/core/test_helpers/kbn_server.ts +++ b/src/core/test_helpers/kbn_server.ts @@ -70,7 +70,6 @@ export function createRootWithSettings( configs: [], cliArgs: { dev: false, - open: false, quiet: false, silent: false, watch: false,