mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Merge branch 'chore/removeRequireFrom' into renameAllFiles
This commit is contained in:
commit
07b32d715f
25 changed files with 29 additions and 59 deletions
|
@ -127,7 +127,6 @@
|
|||
"moment-timezone": "0.4.1",
|
||||
"raw-loader": "0.5.1",
|
||||
"request": "2.61.0",
|
||||
"requirefrom": "0.2.0",
|
||||
"rimraf": "2.4.3",
|
||||
"rjs-repack-loader": "1.0.6",
|
||||
"script-loader": "0.6.1",
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import _ from 'lodash';
|
||||
|
||||
let utils = require('requirefrom')('src/utils');
|
||||
let pkg = utils('packageJson');
|
||||
import pkg from '../utils/packageJson';
|
||||
import Command from './command';
|
||||
|
||||
let argv = process.env.kbnWorkerArgv ? JSON.parse(process.env.kbnWorkerArgv) : process.argv.slice();
|
||||
|
|
|
@ -83,8 +83,7 @@ module.exports = class ClusterManager {
|
|||
|
||||
setupWatching(extraPaths) {
|
||||
const chokidar = require('chokidar');
|
||||
const utils = require('requirefrom')('src/utils');
|
||||
const fromRoot = utils('fromRoot');
|
||||
const fromRoot = require('../../utils/fromRoot');
|
||||
|
||||
this.watcher = chokidar.watch([
|
||||
'src/plugins',
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import path from 'path';
|
||||
import expect from 'expect.js';
|
||||
|
||||
var utils = require('requirefrom')('src/utils');
|
||||
var fromRoot = utils('fromRoot');
|
||||
import fromRoot from '../../../utils/fromRoot';
|
||||
import settingParser from '../setting_parser';
|
||||
|
||||
describe('kibana cli', function () {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const utils = require('requirefrom')('src/utils');
|
||||
const fromRoot = utils('fromRoot');
|
||||
import fromRoot from '../../utils/fromRoot';
|
||||
import settingParser from './setting_parser';
|
||||
import installer from './plugin_installer';
|
||||
import remover from './plugin_remover';
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import _ from 'lodash';
|
||||
const utils = require('requirefrom')('src/utils');
|
||||
const fromRoot = utils('fromRoot');
|
||||
import fromRoot from '../../utils/fromRoot';
|
||||
import pluginDownloader from './plugin_downloader';
|
||||
import pluginCleaner from './plugin_cleaner';
|
||||
import pluginExtractor from './plugin_extractor';
|
||||
|
|
|
@ -2,8 +2,7 @@ import _ from 'lodash';
|
|||
import fs from 'fs';
|
||||
import yaml from 'js-yaml';
|
||||
|
||||
let utils = require('requirefrom')('src/utils');
|
||||
let fromRoot = utils('fromRoot');
|
||||
import fromRoot from '../../utils/fromRoot';
|
||||
|
||||
let legacySettingMap = {
|
||||
// server
|
||||
|
@ -67,4 +66,3 @@ module.exports = function (path) {
|
|||
apply(config, val, key);
|
||||
}, {});
|
||||
};
|
||||
|
||||
|
|
|
@ -3,8 +3,7 @@ const { isWorker } = require('cluster');
|
|||
const { resolve } = require('path');
|
||||
|
||||
const cwd = process.cwd();
|
||||
const src = require('requirefrom')('src');
|
||||
const fromRoot = src('utils/fromRoot');
|
||||
import fromRoot from '../../utils/fromRoot';
|
||||
|
||||
let canCluster;
|
||||
try {
|
||||
|
@ -127,7 +126,7 @@ module.exports = function (program) {
|
|||
}
|
||||
|
||||
let kbnServer = {};
|
||||
const KbnServer = src('server/KbnServer');
|
||||
const KbnServer = require('../../server/KbnServer');
|
||||
try {
|
||||
kbnServer = new KbnServer(settings);
|
||||
await kbnServer.ready();
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import LazyServer from './lazy_server';
|
||||
import LazyOptimizer from './lazy_optimizer';
|
||||
module.exports = async (kbnServer, kibanaHapiServer, config) => {
|
||||
|
||||
let src = require('requirefrom')('src');
|
||||
let fromRoot = src('utils/fromRoot');
|
||||
import fromRoot from '../../utils/fromRoot';
|
||||
|
||||
export default async (kbnServer, kibanaHapiServer, config) => {
|
||||
let server = new LazyServer(
|
||||
config.get('optimize.lazyHost'),
|
||||
config.get('optimize.lazyPort'),
|
||||
|
@ -20,7 +18,6 @@ module.exports = async (kbnServer, kibanaHapiServer, config) => {
|
|||
})
|
||||
);
|
||||
|
||||
|
||||
let ready = false;
|
||||
|
||||
let sendReady = () => {
|
||||
|
|
|
@ -3,8 +3,7 @@ import expect from 'expect.js';
|
|||
import sinon from 'sinon';
|
||||
|
||||
import isUpgradeable from '../is_upgradeable';
|
||||
let utils = require('requirefrom')('src/utils');
|
||||
let pkg = utils('packageJson');
|
||||
import pkg from '../../../../utils/packageJson';
|
||||
let version = pkg.version;
|
||||
|
||||
describe('plugins/elasticsearch', function () {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import expect from 'expect.js';
|
||||
import util from 'util';
|
||||
const requireFromTest = require('requirefrom')('test');
|
||||
const kbnTestServer = requireFromTest('utils/kbn_server');
|
||||
import kbnTestServer from '../../../../../test/utils/kbn_server';
|
||||
|
||||
const format = util.format;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import semver from 'semver';
|
||||
const utils = require('requirefrom')('src/utils');
|
||||
const rcVersionRegex = /(\d+\.\d+\.\d+)\-rc(\d+)/i;
|
||||
|
||||
module.exports = function (server, doc) {
|
||||
|
|
|
@ -3,8 +3,6 @@ import isUpgradeable from './is_upgradeable';
|
|||
import _ from 'lodash';
|
||||
import { format } from 'util';
|
||||
|
||||
const utils = require('requirefrom')('src/utils');
|
||||
|
||||
module.exports = function (server) {
|
||||
const MAX_INTEGER = Math.pow(2, 53) - 1;
|
||||
|
||||
|
@ -54,4 +52,3 @@ module.exports = function (server) {
|
|||
});
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
import { union } from 'lodash';
|
||||
|
||||
import findSourceFiles from './find_source_files';
|
||||
module.exports = (kibana) => {
|
||||
|
||||
let utils = require('requirefrom')('src/utils');
|
||||
let fromRoot = utils('fromRoot');
|
||||
import fromRoot from '../../utils/fromRoot';
|
||||
|
||||
export default (kibana) => {
|
||||
return new kibana.Plugin({
|
||||
config: (Joi) => {
|
||||
return Joi.object({
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import { resolve } from 'path';
|
||||
import { fromNode as fn } from 'bluebird';
|
||||
import expect from 'expect.js';
|
||||
import requirefrom from 'requirefrom';
|
||||
|
||||
const requireFromTest = requirefrom('test');
|
||||
const kbnTestServer = requireFromTest('utils/kbn_server');
|
||||
import kbnTestServer from '../../../test/utils/kbn_server';
|
||||
const basePath = '/kibana';
|
||||
|
||||
describe('Server basePath config', function () {
|
||||
|
|
|
@ -3,7 +3,7 @@ import Joi from 'joi';
|
|||
import _ from 'lodash';
|
||||
import override from './override';
|
||||
import createDefaultSchema from './schema';
|
||||
let pkg = require('requirefrom')('src/utils')('packageJson');
|
||||
import pkg from '../../utils/packageJson';
|
||||
import clone from './deep_clone_with_buffers';
|
||||
import { zipObject } from 'lodash';
|
||||
|
||||
|
|
|
@ -4,8 +4,7 @@ import path from 'path';
|
|||
import { get } from 'lodash';
|
||||
import { randomBytes } from 'crypto';
|
||||
|
||||
let utils = require('requirefrom')('src/utils');
|
||||
let fromRoot = utils('fromRoot');
|
||||
import fromRoot from '../../utils/fromRoot';
|
||||
|
||||
module.exports = () => Joi.object({
|
||||
pkg: Joi.object({
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
import expect from 'expect.js';
|
||||
import requirefrom from 'requirefrom';
|
||||
|
||||
const requireFromTest = requirefrom('test');
|
||||
const kbnTestServer = requireFromTest('utils/kbn_server');
|
||||
import kbnTestServer from '../../../../test/utils/kbn_server';
|
||||
|
||||
describe('cookie validation', function () {
|
||||
let kbnServer;
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
import expect from 'expect.js';
|
||||
import { fromNode as fn } from 'bluebird';
|
||||
import { resolve } from 'path';
|
||||
|
||||
const requireFromTest = require('requirefrom')('test');
|
||||
const kbnTestServer = requireFromTest('utils/kbn_server');
|
||||
import kbnTestServer from '../../../../test/utils/kbn_server';
|
||||
|
||||
const nonDestructiveMethods = ['GET'];
|
||||
const destructiveMethods = ['POST', 'PUT', 'DELETE'];
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import Hapi from 'hapi';
|
||||
import { constant, once, compact, flatten } from 'lodash';
|
||||
import { promisify, resolve, fromNode } from 'bluebird';
|
||||
import fromRoot from '../utils/fromRoot';
|
||||
import pkg from '../utils/packageJson';
|
||||
|
||||
let utils = require('requirefrom')('src/utils');
|
||||
let rootDir = utils('fromRoot')('.');
|
||||
let pkg = utils('packageJson');
|
||||
let rootDir = fromRoot('.');
|
||||
|
||||
module.exports = class KbnServer {
|
||||
constructor(settings) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import PluginApi from './plugin_api';
|
||||
import { inspect } from 'util';
|
||||
import { get, indexBy } from 'lodash';
|
||||
let Collection = require('requirefrom')('src')('utils/Collection');
|
||||
import Collection from '../../utils/Collection';
|
||||
|
||||
let byIdCache = Symbol('byIdCache');
|
||||
let pluginApis = Symbol('pluginApis');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import _ from 'lodash';
|
||||
import UiApp from './ui_app';
|
||||
let Collection = require('requirefrom')('src')('utils/Collection');
|
||||
import Collection from '../utils/Collection';
|
||||
|
||||
let byIdCache = Symbol('byId');
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
let { defaults } = require('lodash');
|
||||
let babelOptions = require('requirefrom')('src')('optimize/babelOptions');
|
||||
let babelOptions = require('../../src/optimize/babelOptions');
|
||||
|
||||
module.exports = {
|
||||
build: {
|
||||
|
|
|
@ -2,7 +2,7 @@ module.exports = function (grunt) {
|
|||
var resolve = require('path').resolve;
|
||||
var directory = resolve(__dirname, '../../esvm');
|
||||
var dataDir = resolve(directory, 'data_dir');
|
||||
var uiConfig = require('requirefrom')('test')('serverConfig');
|
||||
var uiConfig = require('../../test/serverConfig');
|
||||
|
||||
return {
|
||||
options: {
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
import { defaultsDeep, set } from 'lodash';
|
||||
import requirefrom from 'requirefrom';
|
||||
import { header as basicAuthHeader } from './base_auth';
|
||||
import { kibanaUser, kibanaServer } from '../shield';
|
||||
|
||||
const src = requirefrom('src');
|
||||
const KbnServer = src('server/KbnServer');
|
||||
const fromRoot = src('utils/fromRoot');
|
||||
import KbnServer from '../../src/server/KbnServer';
|
||||
import fromRoot from '../../src/utils/fromRoot';
|
||||
|
||||
const SERVER_DEFAULTS = {
|
||||
server: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue