Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion src/cli/plugin/__tests__/plugin_downloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import sinon from 'sinon';
import nock from 'nock';
import glob from 'glob';
import rimraf from 'rimraf';
const { join } = require('path');
import mkdirp from 'mkdirp';
import pluginLogger from '../plugin_logger';
import pluginDownloader from '../plugin_downloader';
import { join } from 'path';

describe('kibana cli', function () {

Expand Down
2 changes: 1 addition & 1 deletion src/cli/plugin/__tests__/plugin_extractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import expect from 'expect.js';
import sinon from 'sinon';
import glob from 'glob';
import rimraf from 'rimraf';
const { join } = require('path');
import mkdirp from 'mkdirp';

import pluginLogger from '../plugin_logger';
import extract from '../plugin_extractor';
import pluginDownloader from '../plugin_downloader';
import { join } from 'path';

describe('kibana cli', function () {

Expand Down
4 changes: 2 additions & 2 deletions src/cli/plugin/__tests__/plugin_installer.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import expect from 'expect.js';
import sinon from 'sinon';
import rimraf from 'rimraf';
const { mkdirSync } = require('fs');
const { join } = require('path');
import pluginLogger from '../plugin_logger';
import pluginInstaller from '../plugin_installer';
import { mkdirSync } from 'fs';
import { join } from 'path';

describe('kibana cli', function () {

Expand Down
2 changes: 1 addition & 1 deletion src/cli/plugin/downloaders/file.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { createWriteStream, createReadStream, unlinkSync, statSync } = require('fs');
import getProgressReporter from '../progress_reporter';
import { createWriteStream, createReadStream, unlinkSync, statSync } from 'fs';

function openSourceFile({ sourcePath }) {
try {
Expand Down
4 changes: 2 additions & 2 deletions src/cli/plugin/downloaders/http.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { fromNode: fn } = require('bluebird');
const { createWriteStream, unlinkSync } = require('fs');
import Wreck from 'wreck';
import getProgressReporter from '../progress_reporter';
import { fromNode as fn } from 'bluebird';
import { createWriteStream, unlinkSync } from 'fs';

function sendRequest({ sourceUrl, timeout }) {
const maxRedirects = 11; //Because this one goes to 11.
Expand Down
2 changes: 1 addition & 1 deletion src/cli/plugin/plugin_installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import pluginCleaner from './plugin_cleaner';
import pluginExtractor from './plugin_extractor';
import KbnServer from '../../server/KbnServer';
import readYamlConfig from '../serve/read_yaml_config';
const { statSync, renameSync } = require('fs');
import Promise from 'bluebird';
import { sync as rimrafSync } from 'rimraf';
import { statSync, renameSync } from 'fs';
const mkdirp = Promise.promisify(require('mkdirp'));

export default {
Expand Down
2 changes: 1 addition & 1 deletion src/cli/plugin/setting_parser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { resolve } = require('path');
import expiry from 'expiry-js';
import { intersection } from 'lodash';
import { resolve } from 'path';

export default function createSettingParser(options) {
function parseMilliseconds(val) {
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/agg_resp/geohash_grid.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash';
define(function (require) {
return function GeoHashGridAggResponseFixture() {

var _ = require('lodash');

// for vis:
//
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/fake_row.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash';
define(function (require) {
var _ = require('lodash');
var longString = Array(200).join('_');

return function (id, mapping) {
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/hits.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash';
define(function (require) {
var _ = require('lodash');
return function fitsFixture() {
return _.map([
{_source: {'@timestamp': 0, ssl: true, ip: '192.168.0.1', extension: 'php', 'machine.os': 'Linux', bytes: 10, request: 'foo'}},
Expand Down
4 changes: 2 additions & 2 deletions src/fixtures/mock_courier.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _ from 'lodash';
import sinon from 'auto-release-sinon';
define(function (require) {
var _ = require('lodash');
var sinon = require('auto-release-sinon');

return function (Private, Promise) {
var indexPatterns = Private(require('fixtures/stubbed_logstash_index_pattern'));
Expand Down
4 changes: 2 additions & 2 deletions src/fixtures/mock_state.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _ from 'lodash';
import sinon from 'auto-release-sinon';
define(function (require) {
var _ = require('lodash');
var sinon = require('auto-release-sinon');

function MockState(defaults) {
this.on = _.noop;
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/mock_ui_state.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash';
define(function (require) {
var _ = require('lodash');
var keys = {};
return {
get: function (path, def) {
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/search_response.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import hits from 'fixtures/real_hits';
define(function (require) {
var hits = require('fixtures/real_hits');

return {
took: 73,
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/stubbed_logstash_index_pattern.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import _ from 'lodash';
define(function (require) {
return function stubbedLogstashIndexPatternService(Private) {
var StubIndexPattern = Private(require('testUtils/stub_index_pattern'));
var fieldTypes = Private(require('ui/index_patterns/_field_types'));
var mockLogstashFields = Private(require('fixtures/logstash_fields'));

var _ = require('lodash');

var fields = mockLogstashFields.map(function (field) {
field.displayName = field.name;
Expand Down
4 changes: 2 additions & 2 deletions src/fixtures/stubbed_search_source.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sinon from 'auto-release-sinon';
import searchResponse from 'fixtures/search_response';
define(function (require) {
var sinon = require('auto-release-sinon');
var searchResponse = require('fixtures/search_response');

return function stubSearchSource(Private, $q, Promise) {
var deferedResult = $q.defer();
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/tilemap_map.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sinon from 'auto-release-sinon';
define(function (require) {
var sinon = require('auto-release-sinon');

function MockMap(container, chartData, params) {
this.container = container;
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/vislib/_vis_fixture.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var $ = require('jquery');
import _ from 'lodash';
import $ from 'jquery';

var $visCanvas = $('<div>').attr('id', 'vislib-vis-fixtures').appendTo('body');
var count = 0;
Expand Down
8 changes: 4 additions & 4 deletions src/optimize/BaseOptimizer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
let { inherits } = require('util');
let { defaults } = require('lodash');
let { resolve } = require('path');
let { writeFile } = require('fs');
import webpack from 'webpack';
import Boom from 'boom';
import DirectoryNameAsMain from 'webpack-directory-name-as-main';
Expand All @@ -11,6 +7,10 @@ import CommonsChunkPlugin from 'webpack/lib/optimize/CommonsChunkPlugin';
let utils = require('requirefrom')('src/utils');
let fromRoot = utils('fromRoot');
import babelOptions from './babelOptions';
import { inherits } from 'util';
import { defaults } from 'lodash';
import { resolve } from 'path';
import { writeFile } from 'fs';
let babelExclude = [/[\/\\](webpackShims|node_modules|bower_components)[\/\\]/];

class BaseOptimizer {
Expand Down
4 changes: 2 additions & 2 deletions src/optimize/FsOptimizer.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
let { fromNode } = require('bluebird');
let { writeFile } = require('fs');

import BaseOptimizer from './BaseOptimizer';
import fromRoot from '../utils/fromRoot';
import { fromNode } from 'bluebird';
import { writeFile } from 'fs';

module.exports = class FsOptimizer extends BaseOptimizer {
async init() {
Expand Down
2 changes: 1 addition & 1 deletion src/optimize/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import FsOptimizer from './FsOptimizer';
module.exports = async (kbnServer, server, config) => {
if (!config.get('optimize.enabled')) return;

Expand Down Expand Up @@ -33,7 +34,6 @@ module.exports = async (kbnServer, server, config) => {
}

// only require the FsOptimizer when we need to
let FsOptimizer = require('./FsOptimizer');
let optimizer = new FsOptimizer({
env: bundles.env,
bundles: bundles,
Expand Down
4 changes: 2 additions & 2 deletions src/optimize/lazy/LazyOptimizer.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
let { once, pick, size } = require('lodash');
let { join } = require('path');
import Boom from 'boom';

import BaseOptimizer from '../BaseOptimizer';
import WeirdControlFlow from './WeirdControlFlow';
import { once, pick, size } from 'lodash';
import { join } from 'path';

module.exports = class LazyOptimizer extends BaseOptimizer {
constructor(opts) {
Expand Down
4 changes: 2 additions & 2 deletions src/optimize/lazy/LazyServer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

let { Server } = require('hapi');
let { fromNode } = require('bluebird');
import Boom from 'boom';
import { Server } from 'hapi';
import { fromNode } from 'bluebird';


module.exports = class LazyServer {
Expand Down
2 changes: 1 addition & 1 deletion src/optimize/lazy/WeirdControlFlow.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fromNode } from 'bluebird';

let { fromNode } = require('bluebird');

module.exports = class WeirdControlFlow {
constructor(work) {
Expand Down
2 changes: 1 addition & 1 deletion src/optimize/lazy/lazy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isWorker } from 'cluster';
module.exports = async (kbnServer, server, config) => {

let { isWorker } = require('cluster');

if (!isWorker) {
throw new Error(`lazy optimization is only available in "watch" mode`);
Expand Down
4 changes: 2 additions & 2 deletions src/optimize/lazy/optmzrRole.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import LazyServer from './LazyServer';
import LazyOptimizer from './LazyOptimizer';
module.exports = async (kbnServer, kibanaHapiServer, config) => {

let src = require('requirefrom')('src');
let fromRoot = src('utils/fromRoot');
let LazyServer = require('./LazyServer');
let LazyOptimizer = require('./LazyOptimizer');

let server = new LazyServer(
config.get('optimize.lazyHost'),
Expand Down
4 changes: 2 additions & 2 deletions src/optimize/lazy/proxyRole.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let { fromNode } = require('bluebird');
let { get, once } = require('lodash');
import { fromNode } from 'bluebird';
import { get, once } from 'lodash';

module.exports = (kbnServer, server, config) => {

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/devMode/public/ngMock.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import angular from 'angular';
import 'angular-mocks';
if (angular.mocks) {
throw new Error(
'Don\'t require angular-mocks directly or the tests ' +
'can\'t setup correctly, use the ngMock module instead.'
);
}

require('angular-mocks');
module.exports = angular.mock;
2 changes: 1 addition & 1 deletion src/plugins/elasticsearch/lib/create_proxy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import createAgent from './create_agent';
import mapUri from './map_uri';
const { resolve } = require('url');
import { resolve } from 'url';

function createProxy(server, method, route, config) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _ from 'lodash';
import $ from 'jquery';
define(function (require) {
const _ = require('lodash');
const $ = require('jquery');
const module = require('ui/modules').get('kibana');

module.directive('lineInterpolationOption', function ($parse, $compile) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import _ from 'lodash';
import $ from 'jquery';
import 'ui/directives/inequality';
define(function (require) {
const _ = require('lodash');
const $ = require('jquery');
const module = require('ui/modules').get('kibana');
require('ui/directives/inequality');

module.directive('pointSeriesOptions', function ($parse, $compile) {
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _ from 'lodash';
import $ from 'jquery';
define(function (require) {
const _ = require('lodash');
const $ = require('jquery');
const module = require('ui/modules').get('kibana');

module.directive('vislibBasicOptions', function ($parse, $compile) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import visTypes from 'ui/registry/vis_types';
define(function (require) {
const visTypes = require('ui/registry/vis_types');
visTypes.register(require('plugins/kbn_vislib_vis_types/histogram'));
visTypes.register(require('plugins/kbn_vislib_vis_types/line'));
visTypes.register(require('plugins/kbn_vislib_vis_types/pie'));
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/kbn_vislib_vis_types/public/tileMap.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import _ from 'lodash';
import supports from 'ui/utils/supports';
define(function (require) {
return function TileMapVisType(Private, getAppState, courier, config) {
const VislibVisType = Private(require('ui/vislib_vis_type/VislibVisType'));
const Schemas = Private(require('ui/Vis/Schemas'));
const geoJsonConverter = Private(require('ui/agg_response/geo_json/geo_json'));
const _ = require('lodash');
const supports = require('ui/utils/supports');

return new VislibVisType({
name: 'tile_map',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash';
define(function (require) {
const _ = require('lodash');
return function loadPanelFunction(Private) { // Inject services here
return function (panel, $scope) { // Function parameters here
const panelTypes = {
Expand Down
10 changes: 5 additions & 5 deletions src/plugins/kibana/public/dashboard/components/panel/panel.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import moment from 'moment';
import $ from 'jquery';
import _ from 'lodash';
import 'ui/visualize';
import 'ui/doc_table';
define(function (require) {
const moment = require('moment');
const $ = require('jquery');
require('ui/modules')
.get('app/dashboard')
.directive('dashboardPanel', function (savedVisualizations, savedSearches, Notifier, Private, $injector) {
const _ = require('lodash');
const loadPanel = Private(require('plugins/kibana/dashboard/components/panel/lib/load_panel'));
const filterManager = Private(require('ui/filter_manager'));
const notify = new Notifier();
Expand All @@ -17,8 +19,6 @@ define(function (require) {
};
});

require('ui/visualize');
require('ui/doc_table');

const brushEvent = Private(require('ui/utils/brush_event'));

Expand Down
8 changes: 4 additions & 4 deletions src/plugins/kibana/public/dashboard/directives/grid.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import _ from 'lodash';
import $ from 'jquery';
import Binder from 'ui/Binder';
import 'gridster';
define(function (require) {
const _ = require('lodash');
const $ = require('jquery');
const Binder = require('ui/Binder');
require('gridster');

const app = require('ui/modules').get('app/dashboard');

Expand Down
Loading