Skip to content

Commit

Permalink
remove legacy ES plugin (elastic#77703)
Browse files Browse the repository at this point in the history
* remove legacy ES plug

* fix types

* delete some `legacy/core_plugins` references

* fix type
# Conflicts:
#	.github/CODEOWNERS
#	src/legacy/core_plugins/elasticsearch/index.js
#	src/legacy/core_plugins/elasticsearch/lib/abortable_request_handler.js
#	src/legacy/core_plugins/elasticsearch/lib/abortable_request_handler.test.js
#	src/legacy/core_plugins/elasticsearch/lib/cluster.ts
#	src/legacy/core_plugins/elasticsearch/lib/create_proxy.js
#	x-pack/dev-tools/jest/create_jest_config.js
  • Loading branch information
pgayvallet committed Sep 18, 2020
1 parent 5242103 commit d0006f7
Show file tree
Hide file tree
Showing 41 changed files with 53 additions and 939 deletions.
10 changes: 0 additions & 10 deletions kibana.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export { Public, Server };
/**
* All exports from TS ambient definitions (where types are added for JS source in a .d.ts file).
*/
import * as LegacyElasticsearch from './src/legacy/core_plugins/elasticsearch';
import * as LegacyKibanaPluginSpec from './src/legacy/plugin_discovery/plugin_spec/plugin_spec_options';
import * as LegacyKibanaServer from './src/legacy/server/kbn_server';

Expand All @@ -44,13 +43,4 @@ export namespace Legacy {
export type InitPluginFunction = LegacyKibanaPluginSpec.InitPluginFunction;
export type UiExports = LegacyKibanaPluginSpec.UiExports;
export type PluginSpecOptions = LegacyKibanaPluginSpec.PluginSpecOptions;

export namespace Plugins {
export namespace elasticsearch {
export type Plugin = LegacyElasticsearch.ElasticsearchPlugin;
export type Cluster = LegacyElasticsearch.Cluster;
export type ClusterConfig = LegacyElasticsearch.ClusterConfig;
export type CallClusterOptions = LegacyElasticsearch.CallClusterOptions;
}
}
}
1 change: 0 additions & 1 deletion src/cli/cluster/cluster_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ export class ClusterManager {
new Set(
[
fromRoot('src/core'),
fromRoot('src/legacy/core_plugins'),
fromRoot('src/legacy/server'),
fromRoot('src/legacy/ui'),
fromRoot('src/legacy/utils'),
Expand Down
2 changes: 1 addition & 1 deletion src/cli/serve/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export default function (program) {
'A path to scan for plugins, this can be specified multiple ' +
'times to specify multiple directories',
pluginDirCollector,
[fromRoot('plugins'), fromRoot('src/legacy/core_plugins')]
[fromRoot('plugins')]
)
.option(
'--plugin-path <path>',
Expand Down
4 changes: 0 additions & 4 deletions src/dev/jest/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export default {
'<rootDir>/src/plugins',
'<rootDir>/src/legacy/ui',
'<rootDir>/src/core',
'<rootDir>/src/legacy/core_plugins',
'<rootDir>/src/legacy/server',
'<rootDir>/src/cli',
'<rootDir>/src/cli_keystore',
Expand All @@ -48,14 +47,11 @@ export default {
'packages/kbn-ui-framework/src/services/**/*.js',
'!packages/kbn-ui-framework/src/services/index.js',
'!packages/kbn-ui-framework/src/services/**/*/index.js',
'src/legacy/core_plugins/**/*.{js,mjs,jsx,ts,tsx}',
'!src/legacy/core_plugins/**/{__test__,__snapshots__}/**/*',
],
moduleNameMapper: {
'@elastic/eui$': '<rootDir>/node_modules/@elastic/eui/test-env',
'@elastic/eui/lib/(.*)?': '<rootDir>/node_modules/@elastic/eui/test-env/$1',
'^src/plugins/(.*)': '<rootDir>/src/plugins/$1',
'^plugins/([^/.]*)(.*)': '<rootDir>/src/legacy/core_plugins/$1/public$2',
'^uiExports/(.*)': '<rootDir>/src/dev/jest/mocks/file_mock.js',
'^test_utils/(.*)': '<rootDir>/src/test_utils/public/$1',
'^fixtures/(.*)': '<rootDir>/src/fixtures/$1',
Expand Down
5 changes: 0 additions & 5 deletions src/dev/precommit_hook/casing_check_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ export const REMOVE_EXTENSION = ['packages/kbn-plugin-generator/template/**/*.ej
* @type {Array}
*/
export const TEMPORARILY_IGNORED_PATHS = [
'src/legacy/core_plugins/console/public/src/directives/helpExample.txt',
'src/legacy/core_plugins/console/public/src/sense_editor/theme-sense-dark.js',
'src/legacy/core_plugins/tile_map/public/__tests__/scaledCircleMarkers.png',
'src/legacy/core_plugins/tile_map/public/__tests__/shadedCircleMarkers.png',
'src/legacy/core_plugins/tile_map/public/__tests__/shadedGeohashGrid.png',
'src/fixtures/config_upgrade_from_4.0.0_to_4.0.1-snapshot.json',
'src/core/server/core_app/assets/favicons/android-chrome-192x192.png',
'src/core/server/core_app/assets/favicons/android-chrome-256x256.png',
Expand Down
526 changes: 0 additions & 526 deletions src/legacy/core_plugins/elasticsearch/index.d.ts

This file was deleted.

58 changes: 0 additions & 58 deletions src/legacy/core_plugins/elasticsearch/index.js

This file was deleted.

This file was deleted.

This file was deleted.

51 changes: 0 additions & 51 deletions src/legacy/core_plugins/elasticsearch/lib/cluster.ts

This file was deleted.

79 changes: 0 additions & 79 deletions src/legacy/core_plugins/elasticsearch/lib/create_proxy.js

This file was deleted.

5 changes: 0 additions & 5 deletions src/legacy/core_plugins/elasticsearch/package.json

This file was deleted.

4 changes: 0 additions & 4 deletions src/legacy/server/kbn_server.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,14 @@ import {
import { LegacyConfig, ILegacyInternals } from '../../core/server/legacy';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { UiPlugins } from '../../core/server/plugins';
import { ElasticsearchPlugin } from '../core_plugins/elasticsearch';

// lot of legacy code was assuming this type only had these two methods
export type KibanaConfig = Pick<LegacyConfig, 'get' | 'has'>;

// Extend the defaults with the plugins and server methods we need.
declare module 'hapi' {
interface PluginProperties {
elasticsearch: ElasticsearchPlugin;
kibana: any;
spaces: any;
// add new plugin types here
}

interface Server {
Expand Down
Loading

0 comments on commit d0006f7

Please sign in to comment.