Skip to content

Commit

Permalink
[server] work out plugin organization, and app declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer Alger committed Jun 25, 2015
1 parent f47d3ca commit 8d2e881
Show file tree
Hide file tree
Showing 800 changed files with 1,405 additions and 1,254 deletions.
3 changes: 0 additions & 3 deletions .bowerrc

This file was deleted.

2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.x
iojs-2
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ cache:
directories:
- esvm
- node_modules
- src/kibana/bower_components
before_cache:
- rm -rf esvm/*/logs esvm/data_dir
notifications:
Expand Down
7 changes: 0 additions & 7 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@
],
"license": "Apache 2.0",
"homepage": "http://www.elastic.co/products/kibana",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"angular": "1.2.28",
"angular-bindonce": "0.3.3",
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"ansicolors": "^0.3.2",
"bluebird": "^2.9.27",
"body-parser": "^1.10.1",
"boom": "^2.8.0",
"bunyan": "^1.2.3",
"commander": "^2.6.0",
"compression": "^1.3.0",
Expand All @@ -60,6 +61,7 @@
"js-yaml": "^3.2.5",
"lodash": "^3.9.3",
"json-stringify-safe": "^5.0.1",
"minimatch": "^2.0.8",
"moment": "^2.10.3",
"numeral": "^1.5.3",
"request": "^2.40.0",
Expand Down
3 changes: 3 additions & 0 deletions src/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../.jshintrc.node"
}
2 changes: 1 addition & 1 deletion src/server/bin/kibana.bat → src/bin/kibana.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set SCRIPT_DIR=%~dp0
for %%I in ("%SCRIPT_DIR%..") do set DIR=%%~dpfI

set NODE=%DIR%\node\node.exe
set SERVER=%DIR%\src\bin\kibana.js
set SERVER=%DIR%\src\server\cli
set NODE_ENV="production"
set CONFIG_PATH=%DIR%\config\kibana.yml

Expand Down
2 changes: 1 addition & 1 deletion src/server/bin/kibana.sh → src/bin/kibana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ done

DIR=$(dirname "${SCRIPT}")/..
NODE=${DIR}/node/bin/node
SERVER=${DIR}/src/bin/kibana.js
SERVER=${DIR}/src/server/cli

CONFIG_PATH="${DIR}/config/kibana.yml" NODE_ENV="production" exec "${NODE}" ${SERVER} ${@}

File renamed without changes.
79 changes: 79 additions & 0 deletions src/dev_server/dev_statics_plugin/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
module.exports = function (kibana) {
var path = require('path');
var glob = require('glob');
var join = path.join;
var rel = join.bind(null, __dirname);

var ROOT = rel('../../../');
var SRC = join(ROOT, 'src');
var NODE_MODULES = join(ROOT, 'node_modules');
var APP = join(SRC, 'kibana');
var TEST = join(ROOT, 'test');
var istanbul = require('./lib/istanbul');
var amdWrapper = require('./lib/amd_wrapper');
var kibanaSrcFilter = require('./lib/kibana_src_filter');

return new kibana.Plugin({
require: ['marvel'],
init: function (server, options) {
server.ext('onPreHandler', istanbul({ root: SRC, displayRoot: SRC, filter: kibanaSrcFilter }));
server.ext('onPreHandler', istanbul({ root: APP, displayRoot: SRC, filter: kibanaSrcFilter }));

server.route({
path: '/test/{paths*}',
method: 'GET',
handler: {
directory: {
path: TEST
}
}
});

server.route({
path: '/amd-wrap/{paths*}',
method: 'GET',
handler: amdWrapper({ root: ROOT })
});

server.route({
path: '/src/{paths*}',
method: 'GET',
handler: {
directory: {
path: SRC
}
}
});

server.route({
path: '/node_modules/{paths*}',
method: 'GET',
handler: {
directory: {
path: NODE_MODULES
}
}
});

server.route({
path: '/specs',
method: 'GET',
handler: function (request, reply) {
var unit = join(ROOT, '/test/unit/');
glob(join(unit, 'specs/**/*.js'), function (er, files) {
var moduleIds = files
.filter(function (filename) {
return path.basename(filename).charAt(0) !== '_';
})
.map(function (filename) {
return path.relative(unit, filename).replace(/\\/g, '/').replace(/\.js$/, '');
});

return reply(moduleIds);
});
}
});
}
});

};
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions src/dev_server/dev_statics_plugin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "dev_statics",
"version": "1.0.0"
}
26 changes: 26 additions & 0 deletions src/dev_server/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
var _ = require('lodash');
var join = require('path').join;

var KbnServer = require('../server');

function run(grunt) {
var opt = grunt ? _.bindKey(grunt, 'option') : _.noop;

return (new KbnServer({
'logging.quiet': opt('debug') && opt('verbose'),
'kibana.server.port': opt('port') || 5601,
'kibana.pluginPaths': [
join(__dirname, 'dev_statics_plugin')
],
'kibana.pluginScanDirs': [
join(__dirname, '..', 'plugins')
]
}))
.listen();
}

if (require.main === module) {
run().done();
} else {
module.exports = run;
}
18 changes: 0 additions & 18 deletions src/kibana/components/setup/_setup_error.js

This file was deleted.

29 changes: 0 additions & 29 deletions src/kibana/components/setup/setup.js

This file was deleted.

43 changes: 0 additions & 43 deletions src/kibana/components/setup/steps/check_es_version.js

This file was deleted.

21 changes: 0 additions & 21 deletions src/kibana/components/setup/steps/check_for_es.js

This file was deleted.

17 changes: 0 additions & 17 deletions src/kibana/components/setup/steps/check_for_kibana_index.js

This file was deleted.

31 changes: 0 additions & 31 deletions src/kibana/components/setup/steps/create_kibana_index.js

This file was deleted.

46 changes: 0 additions & 46 deletions src/kibana/index.html

This file was deleted.

Loading

0 comments on commit 8d2e881

Please sign in to comment.