Skip to content

Commit

Permalink
Update paths to ui, server, deprecation, plugin_discovery in src/legacy
Browse files Browse the repository at this point in the history
This commit accompanies the four that precede it. Rather than squash
them altogether, the four previous commits all do nothing except move
files to help avoid conflicts.
  • Loading branch information
epixa committed Feb 11, 2019
1 parent 982e76d commit 146518c
Show file tree
Hide file tree
Showing 222 changed files with 350 additions and 353 deletions.
6 changes: 3 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ bower_components
/optimize
/built_assets
/src/fixtures/vislib/mock_data
/src/ui/public/angular-bootstrap
/src/ui/public/flot-charts
/src/legacy/ui/public/angular-bootstrap
/src/legacy/ui/public/flot-charts
/test/fixtures/scenarios
/src/legacy/core_plugins/console/public/webpackShims
/src/legacy/core_plugins/console/public/tests/webpackShims
/src/ui/public/utils/decode_geo_hash.js
/src/legacy/ui/public/utils/decode_geo_hash.js
/src/legacy/core_plugins/timelion/public/webpackShims/jquery.flot.*
/src/core/lib/kbn_internal_native_observable
/packages/*/target
Expand Down
8 changes: 4 additions & 4 deletions .i18nrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"paths": {
"common.ui": "src/ui",
"server": "src/server",
"common.ui": "src/legacy/ui",
"server": "src/legacy/server",
"console": "src/legacy/core_plugins/console",
"core": "src/core",
"inputControl": "src/legacy/core_plugins/input_control_vis",
Expand Down Expand Up @@ -47,8 +47,8 @@
},
"exclude": [
"src/core/public/fatal_errors/get_error_info.ts",
"src/ui/ui_render/bootstrap/app_bootstrap.js",
"src/ui/ui_render/ui_render_mixin.js",
"src/legacy/ui/ui_render/bootstrap/app_bootstrap.js",
"src/legacy/ui/ui_render/ui_render_mixin.js",
"x-pack/plugins/infra/public/graphql/types.ts",
"x-pack/plugins/infra/public/utils/loading_state/loading_result.ts",
"x-pack/plugins/infra/server/graphql/types.ts",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ out an open PR:

- [CONTRIBUTING.md](CONTRIBUTING.md) will help you get Kibana up and running.
- If you would like to contribute code, please follow our [STYLEGUIDE.md](STYLEGUIDE.md).
- Learn more about our UI code with [UI_SYSTEMS.md](src/ui/public/UI_SYSTEMS.md).
- Learn more about our UI code with [UI_SYSTEMS.md](src/legacy/ui/public/UI_SYSTEMS.md).
- For all other questions, check out the [FAQ.md](FAQ.md) and
[wiki](https://github.com/elastic/kibana/wiki).

Expand Down
8 changes: 4 additions & 4 deletions docs/development/core/development-modules.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ modules. The sole purpose of these modules is to extend the environment with
certain components. Here is a breakdown of those modules:

- *`import 'ui/autoload/styles'`*
Imports all styles at the root of `src/ui/public/styles`
Imports all styles at the root of `src/legacy/ui/public/styles`

- *`import 'ui/autoload/directives'`*
Imports all directives in `src/ui/public/directives`
Imports all directives in `src/legacy/ui/public/directives`

- *`import 'ui/autoload/filters'`*
Imports all filters in `src/ui/public/filters`
Imports all filters in `src/legacy/ui/public/filters`

- *`import 'ui/autoload/modules'`*
Imports angular and several ui services and "components" which Kibana
Expand All @@ -38,7 +38,7 @@ Kibana uses Webpack to bundle Kibana's dependencies.

Here is how import/require statements are resolved to a file:

. Check the beginning of the module path
. Check the beginning of the module path
* if the path starts with a '.'
** append it the directory of the current file
** proceed to *3*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ For a more complex use-case you usually want to use that method.
`params` is a parameter object specifying several parameters, that influence rendering.

You will find a detailed description of all the parameters in the inline docs
in the {repo}blob/{branch}/src/ui/public/visualize/loader/types.ts[loader source code].
in the {repo}blob/{branch}/src/legacy/ui/public/visualize/loader/types.ts[loader source code].

Both methods return an `EmbeddedVisualizeHandler`, that gives you some access
to the visualization. The `embedVisualizationWithSavedObject` method will return
Expand All @@ -55,4 +55,4 @@ The returned `EmbeddedVisualizeHandler` itself has the following methods and pro
- `removeRenderCompleteListener(listener)`: removes an event listener from the handler again

You can find the detailed `EmbeddedVisualizeHandler` documentation in its
{repo}blob/{branch}/src/ui/public/visualize/loader/embedded_visualize_handler.ts[source code].
{repo}blob/{branch}/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.ts[source code].
2 changes: 1 addition & 1 deletion kibana.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export * from './target/types/type_exports';
* 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 LegacyKibanaServer from './src/server/kbn_server';
import * as LegacyKibanaServer from './src/legacy/server/kbn_server';

/**
* Re-export legacy types under a namespace.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ exports.getWebpackConfig = function(kibanaPath, projectRoot, config) {
const fromKibana = (...path) => resolve(kibanaPath, ...path);

const alias = {
// Kibana defaults https://github.com/elastic/kibana/blob/6998f074542e8c7b32955db159d15661aca253d7/src/ui/ui_bundler_env.js#L30-L36
ui: fromKibana('src/ui/public'),
// Kibana defaults https://github.com/elastic/kibana/blob/6998f074542e8c7b32955db159d15661aca253d7/src/legacy/ui/ui_bundler_env.js#L30-L36
ui: fromKibana('src/legacy/ui/public'),
test_harness: fromKibana('src/test_harness/public'),
querystring: 'querystring-browser',
moment$: fromKibana('webpackShims/moment'),
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-i18n/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ For example:
src/legacy/core_plugins/kibana/translations/fr.json
```

The engine scans `x-pack/plugins/*/translations`, `src/core_plugins/*/translations`, `plugins/*/translations` and `src/ui/translations` folders on initialization, so there is no need to register translation files.
The engine scans `x-pack/plugins/*/translations`, `src/core_plugins/*/translations`, `plugins/*/translations` and `src/legacy/ui/translations` folders on initialization, so there is no need to register translation files.

The engine uses a `config/kibana.yml` file for locale resolution process. If locale is
defined via `i18n.locale` option in `config/kibana.yml` then it will be used as a base
Expand Down
2 changes: 1 addition & 1 deletion src/cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import _ from 'lodash';
import { pkg } from '../utils';
import { pkg } from '../legacy/utils';
import Command from './command';
import serveCommand from './serve/serve';

Expand Down
12 changes: 6 additions & 6 deletions src/cli/cluster/cluster_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import { first, mapTo, filter, map, take } from 'rxjs/operators';

import Log from '../log';
import Worker from './worker';
import { Config } from '../../server/config/config';
import { transformDeprecations } from '../../server/config/transform_deprecations';
import { Config } from '../../legacy/server/config/config';
import { transformDeprecations } from '../../legacy/server/config/transform_deprecations';

process.env.kbnWorkerType = 'managr';

Expand Down Expand Up @@ -160,13 +160,13 @@ export default class ClusterManager {

setupWatching(extraPaths, extraIgnores) {
const chokidar = require('chokidar');
const { fromRoot } = require('../../utils');
const { fromRoot } = require('../../legacy/utils');

const watchPaths = [
fromRoot('src/legacy/core_plugins'),
fromRoot('src/server'),
fromRoot('src/ui'),
fromRoot('src/utils'),
fromRoot('src/legacy/server'),
fromRoot('src/legacy/ui'),
fromRoot('src/legacy/utils'),
fromRoot('x-pack/common'),
fromRoot('x-pack/plugins'),
fromRoot('x-pack/server'),
Expand Down
2 changes: 1 addition & 1 deletion src/cli/cluster/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import _ from 'lodash';
import cluster from 'cluster';
import { EventEmitter } from 'events';

import { BinderFor, fromRoot } from '../../utils';
import { BinderFor, fromRoot } from '../../legacy/utils';

const cliPath = fromRoot('src/cli');
const baseArgs = _.difference(process.argv.slice(2), ['--no-watch']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import mkdirp from 'mkdirp';
import rimraf from 'rimraf';

import { safeDump } from 'js-yaml';
import { createMapStream, createSplitStream, createPromiseFromStreams } from '../../../utils/streams';
import { createMapStream, createSplitStream, createPromiseFromStreams } from '../../../legacy/utils/streams';
import { getConfigFromFiles } from '../../../core/server/config/read_config';

const testConfigFile = follow('__fixtures__/reload_logging_config/kibana.test.yml');
Expand Down
4 changes: 2 additions & 2 deletions src/cli/serve/read_keystore.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import path from 'path';
import { set } from 'lodash';

import { Keystore } from '../../server/keystore';
import { getData } from '../../server/path';
import { Keystore } from '../../legacy/server/keystore';
import { getData } from '../../legacy/server/path';

export function readKeystore(dataPath = getData()) {
const keystore = new Keystore(path.join(dataPath, 'kibana.keystore'));
Expand Down
4 changes: 2 additions & 2 deletions src/cli/serve/read_keystore.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import path from 'path';
import { readKeystore } from './read_keystore';

jest.mock('../../server/keystore');
import { Keystore } from '../../server/keystore';
jest.mock('../../legacy/server/keystore');
import { Keystore } from '../../legacy/server/keystore';

describe('cli/serve/read_keystore', () => {
beforeEach(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/cli/serve/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import _ from 'lodash';
import { statSync, lstatSync, realpathSync } from 'fs';
import { resolve } from 'path';

import { fromRoot } from '../../utils';
import { getConfig } from '../../server/path';
import { fromRoot } from '../../legacy/utils';
import { getConfig } from '../../legacy/server/path';
import { bootstrap } from '../../core/server';
import { readKeystore } from './read_keystore';

Expand Down
4 changes: 2 additions & 2 deletions src/cli_keystore/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*/

import Logger from '../cli_plugin/lib/logger';
import { confirm, question } from '../server/utils';
import { createPromiseFromStreams, createConcatStream } from '../utils';
import { confirm, question } from '../legacy/server/utils';
import { createPromiseFromStreams, createConcatStream } from '../legacy/utils';

/**
* @param {Keystore} keystore
Expand Down
4 changes: 2 additions & 2 deletions src/cli_keystore/add.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ jest.mock('fs', () => ({
import sinon from 'sinon';
import { PassThrough } from 'stream';

import { Keystore } from '../server/keystore';
import { Keystore } from '../legacy/server/keystore';
import { add } from './add';
import Logger from '../cli_plugin/lib/logger';
import * as prompt from '../server/utils/prompt';
import * as prompt from '../legacy/server/utils/prompt';

describe('Kibana keystore', () => {
describe('add', () => {
Expand Down
6 changes: 3 additions & 3 deletions src/cli_keystore/cli_keystore.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

import { join } from 'path';

import { pkg } from '../utils';
import { pkg } from '../legacy/utils';
import Command from '../cli/command';
import { getData } from '../server/path';
import { Keystore } from '../server/keystore';
import { getData } from '../legacy/server/path';
import { Keystore } from '../legacy/server/keystore';

const path = join(getData(), 'kibana.keystore');
const keystore = new Keystore(path);
Expand Down
2 changes: 1 addition & 1 deletion src/cli_keystore/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import Logger from '../cli_plugin/lib/logger';
import { confirm } from '../server/utils';
import { confirm } from '../legacy/server/utils';

export async function create(keystore, command, options) {
const logger = new Logger(options);
Expand Down
4 changes: 2 additions & 2 deletions src/cli_keystore/create.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jest.mock('fs', () => ({

import sinon from 'sinon';

import { Keystore } from '../server/keystore';
import { Keystore } from '../legacy/server/keystore';
import { create } from './create';
import Logger from '../cli_plugin/lib/logger';
import * as prompt from '../server/utils/prompt';
import * as prompt from '../legacy/server/utils/prompt';

describe('Kibana keystore', () => {
describe('create', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/cli_keystore/list.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jest.mock('fs', () => ({
}));

import sinon from 'sinon';
import { Keystore } from '../server/keystore';
import { Keystore } from '../legacy/server/keystore';
import { list } from './list';
import Logger from '../cli_plugin/lib/logger';

Expand Down
2 changes: 1 addition & 1 deletion src/cli_keystore/remove.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jest.mock('fs', () => ({

import sinon from 'sinon';

import { Keystore } from '../server/keystore';
import { Keystore } from '../legacy/server/keystore';
import { remove } from './remove';

describe('Kibana keystore', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/cli_plugin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import _ from 'lodash';
import { pkg } from '../utils';
import { pkg } from '../legacy/utils';
import Command from '../cli/command';
import listCommand from './list';
import installCommand from './install';
Expand Down
4 changes: 2 additions & 2 deletions src/cli_plugin/install/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
* under the License.
*/

import { fromRoot, pkg } from '../../utils';
import { fromRoot, pkg } from '../../legacy/utils';
import install from './install';
import Logger from '../lib/logger';
import { getConfig } from '../../server/path';
import { getConfig } from '../../legacy/server/path';
import { parse, parseMilliseconds } from './settings';
import logWarnings from '../lib/log_warnings';
import { warnIfUsingPluginDirOption } from '../lib/warn_if_plugin_dir_option';
Expand Down
2 changes: 1 addition & 1 deletion src/cli_plugin/install/kibana.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import path from 'path';
import { versionSatisfies, cleanVersion } from '../../utils/version';
import { versionSatisfies, cleanVersion } from '../../legacy/utils/version';
import { statSync } from 'fs';

export function existingInstall(settings, logger) {
Expand Down
2 changes: 1 addition & 1 deletion src/cli_plugin/install/settings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { fromRoot } from '../../utils';
import { fromRoot } from '../../legacy/utils';
import { resolve } from 'path';
import { parseMilliseconds, parse } from './settings';

Expand Down
2 changes: 1 addition & 1 deletion src/cli_plugin/list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { fromRoot } from '../../utils';
import { fromRoot } from '../../legacy/utils';
import list from './list';
import Logger from '../lib/logger';
import { parse } from './settings';
Expand Down
2 changes: 1 addition & 1 deletion src/cli_plugin/list/settings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { fromRoot } from '../../utils';
import { fromRoot } from '../../legacy/utils';
import { parse } from './settings';

describe('kibana cli', function () {
Expand Down
4 changes: 2 additions & 2 deletions src/cli_plugin/remove/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
* under the License.
*/

import { fromRoot } from '../../utils';
import { fromRoot } from '../../legacy/utils';
import remove from './remove';
import Logger from '../lib/logger';
import { parse } from './settings';
import { getConfig } from '../../server/path';
import { getConfig } from '../../legacy/server/path';
import logWarnings from '../lib/log_warnings';
import { warnIfUsingPluginDirOption } from '../lib/warn_if_plugin_dir_option';

Expand Down
2 changes: 1 addition & 1 deletion src/cli_plugin/remove/settings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { fromRoot } from '../../utils';
import { fromRoot } from '../../legacy/utils';
import { parse } from './settings';

describe('kibana cli', function () {
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/config/config_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { BehaviorSubject } from 'rxjs';
import { first } from 'rxjs/operators';

const mockPackage = new Proxy({ raw: {} as any }, { get: (obj, prop) => obj.raw[prop] });
jest.mock('../../../utils/package_json', () => ({ pkg: mockPackage }));
jest.mock('../../../legacy/utils/package_json', () => ({ pkg: mockPackage }));

import { schema, Type, TypeOf } from '@kbn/config-schema';

Expand Down
2 changes: 1 addition & 1 deletion src/core/server/config/env.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jest.mock('path', () => ({
}));

const mockPackage = new Proxy({ raw: {} as any }, { get: (obj, prop) => obj.raw[prop] });
jest.mock('../../../utils/package_json', () => ({ pkg: mockPackage }));
jest.mock('../../../legacy/utils/package_json', () => ({ pkg: mockPackage }));

import { Env } from '.';
import { getEnvOptions } from './__mocks__/env';
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { resolve } from 'path';
import process from 'process';

import { pkg } from '../../../utils/package_json';
import { pkg } from '../../../legacy/utils/package_json';

export interface PackageInfo {
version: string;
Expand Down
Loading

0 comments on commit 146518c

Please sign in to comment.