Skip to content

Commit

Permalink
removed the dev server and cleaned up package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer Alger committed Jan 20, 2015
1 parent 89e082b commit 94ff1e9
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 219 deletions.
18 changes: 3 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
"Lukas Olson <lukas.olson@elasticsearch.com>"
],
"scripts": {
"test": "grunt test",
"start": "node ./src/server/bin/kibana.js",
"test": "grunt test --use-jruby",
"server": "grunt server",
"precommit": "grunt hintStagedFiles",
"prepush": "echo"
"server": "node ./src/server/bin/kibana.js",
"precommit": "grunt hintStagedFiles"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -93,17 +92,6 @@
"simple-git": "^0.11.0",
"tar": "^1.0.1"
},
"scripts": {
"test": "grunt test --use-jruby",
"server": "grunt server",
"precommit": "grunt hintStagedFiles",
"prepush": "echo"
},
"repository": {
"type": "git",
"url": "git@github.com:elasticsearch/kibana.git"
},
"author": "",
"license": "Apache 2.0",
"bugs": {
"url": "https://github.com/elasticsearch/kibana/issues"
Expand Down
4 changes: 4 additions & 0 deletions src/server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ app.set('view engine', 'jade');
app.use(favicon(path.join(config.public_folder, 'styles', 'theme', 'elk.ico')));
app.use(requestLogger());

if (app.get('env') === 'development') {
require('./dev')(app);
}

// The proxy must be set up before all the other middleware.
// TODO: WE might want to move the middleware to each of the individual routes
// so we don't have weird conflicts in the future.
Expand Down
File renamed without changes.
File renamed without changes.
56 changes: 56 additions & 0 deletions src/server/dev/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/* jshint node:true */

var express = require('express');
var instrumentationMiddleware = require('./_instrumentation');
var amdRapperMiddleware = require('./_amd_rapper');

var glob = require('glob');
var path = require('path');
var join = path.join;
var rel = join.bind(null, __dirname);
var ROOT = rel('../../../');
var SRC = join(ROOT, 'src');
var APP = join(SRC, 'kibana');
var TEST = join(ROOT, 'test');

module.exports = function (app) {
app.use(instrumentationMiddleware({
root: SRC,
displayRoot: SRC,
filter: function (filename) {
return filename.match(/.*\/src\/.*\.js$/)
&& !filename.match(/.*\/src\/kibana\/bower_components\/.*\.js$/)
&& !filename.match(/.*\/src\/kibana\/utils\/(event_emitter|next_tick|rison)\.js$/);
}
}));

app.use(instrumentationMiddleware({
root: APP,
displayRoot: SRC,
filter: function (filename) {
return filename.match(/.*\/src\/.*\.js$/)
&& !filename.match(/.*\/src\/kibana\/bower_components\/.*\.js$/)
&& !filename.match(/.*\/src\/kibana\/utils\/(event_emitter|next_tick|rison)\.js$/);
}
}));

app.use(amdRapperMiddleware({
root: ROOT
}));

app.use('/test', express.static(TEST));
app.use('/specs', function (req, res) {
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(/\.js$/, '');
});

res.end(JSON.stringify(moduleIds));
});
});
};
1 change: 0 additions & 1 deletion tasks/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module.exports = function (grunt) {
'jade',
'esvm:dev',
'maybe_start_kibana',
'maybe_start_server',
'watch'
];

Expand Down
5 changes: 0 additions & 5 deletions tasks/maybe_connect_dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ module.exports = function (grunt) {
req.end();
};
};
grunt.registerTask('maybe_start_server', maybeStartServer({
name: 'connect-server',
port: 8000,
tasks: ['server']
}));
grunt.registerTask('maybe_start_kibana', maybeStartServer({
name: 'kibana-server',
port: 5601,
Expand Down
34 changes: 0 additions & 34 deletions tasks/ruby_server.js

This file was deleted.

15 changes: 0 additions & 15 deletions tasks/server.js

This file was deleted.

4 changes: 0 additions & 4 deletions tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ module.exports = function (grunt) {
var tasks = [
'jshint',
'maybe_start_kibana',
'maybe_start_server',
'jade',
'less',
getTestTask()
Expand All @@ -36,7 +35,6 @@ module.exports = function (grunt) {
grunt.registerTask('quick-test', function () {
var tasks = [
'maybe_start_kibana',
'maybe_start_server',
getTestTask()
];
grunt.task.run(tasks);
Expand All @@ -45,13 +43,11 @@ module.exports = function (grunt) {
grunt.registerTask('coverage', [
'blanket',
'maybe_start_kibana',
'maybe_start_server',
'mocha:coverage'
]);

grunt.registerTask('test:watch', [
'maybe_start_kibana',
'maybe_start_server',
'watch:test'
]);
};
145 changes: 0 additions & 145 deletions test/utils/dev_server/index.js

This file was deleted.

0 comments on commit 94ff1e9

Please sign in to comment.