Skip to content

Commit

Permalink
Merge pull request #7 from spalger/pr/4523
Browse files Browse the repository at this point in the history
Pr/4523
  • Loading branch information
lukasolson committed Jul 30, 2015
2 parents 6741ac7 + 5eee21f commit df480f2
Show file tree
Hide file tree
Showing 1,785 changed files with 70,634 additions and 83,011 deletions.
3 changes: 0 additions & 3 deletions .bowerrc

This file was deleted.

6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
.DS_Store
.node_binaries
node_modules
bower_components
**/*.css
trash
build
bundles
target
.jruby
.idea
*.iml
*.log
esvm
.htpasswd
src/server/bin/plugins
installed_plugins
4 changes: 3 additions & 1 deletion .jscsrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"esnext": true,
"maximumLineLength": {
"value": 140,
"allowComments": true
},
"requireCurlyBraces": [
"requireSemicolons": true,
"requireCurlyBraces": [
"for",
"do",
"try",
Expand Down
18 changes: 17 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
{
// for files at project root
"node": true,
"browser": true,
"mocha": true,

"predef": {
"inject": true,
"module": true,
"define": true,
"console": false,
"-event": true,
"-name": true,
"-Promise": true,
"-Worker": true,
"-status": true,
"-fetch": true
},

// shared with .jshintrc files for browser and node
"unused": false,
Expand All @@ -23,5 +38,6 @@
"sub": true,
"-W084": true,
"scripturl": true,
"evil": true
"evil": true,
"esnext": true
}
14 changes: 0 additions & 14 deletions .jshintrc.browser

This file was deleted.

9 changes: 0 additions & 9 deletions .jshintrc.node

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-v2.4
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
language: node_js
node_js: '0.12'
node_js: 'iojs-v2.4'
install: npm install
script: npm test
script: ./node_modules/.bin/grunt travis
sudo: false
cache:
directories:
- esvm
- node_modules
- src/kibana/bower_components
before_cache:
- rm -rf esvm/*/logs esvm/data_dir
- rm -rf esvm/*/logs esvm/data_dir
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
notifications:
email:
- rashid.khan@elastic.co
Expand Down
23 changes: 11 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,35 @@ Please make sure you have signed the [Contributor License Agreement](http://www.

### Development Environment Setup

- Install node.js (we recommend using [nvm](https://github.com/creationix/nvm))
- Clone the kibana repo and move into it

```sh
## follow directions at https://github.com/creationix/nvm, then
nvm install 0.10
git clone https://github.com/elastic/kibana.git kibana
cd kibana
```

- Install grunt and bower globally (as root if not using nvm)
- Install the version of node.js listed in the `.node-version` file (this is made easy with tools like [nvm](https://github.com/creationix/nvm) and [avn](https://github.com/wbyoung/avn))

```sh
npm install -g grunt-cli bower
nvm install "$(cat .node-version)"
```

- Clone the kibana repo and move into it
- Install dependencies

```sh
git clone https://github.com/elastic/kibana.git kibana
cd kibana
npm install
```

- Install node and bower dependencies
- Start elasticsearch, you can use [esvm](https://github.com/simianhacker/esvm) to make that easier.

```sh
npm install && bower install
grunt esvm:dev:keepalive
```

- Start the development server.

```sh
grunt dev # use the "--with-es" flag to install & start elasticsearch too
./bin/kibana --dev
```

#### Linting
Expand All @@ -65,7 +64,7 @@ Before running the tests you will need to install the projects dependencies as d
Once that is complete just run:

```sh
grunt test build
./node_modules/.bin/grunt test build
```

Distributable, built packages can be found in `target/` after the build completes.
Expand Down
69 changes: 22 additions & 47 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
module.exports = function (grunt) {
// set the config once before calling load-grunt-config
// and once durring so that we have access to it via
// and once during so that we have access to it via
// grunt.config.get() within the config files
var config = {
pkg: grunt.file.readJSON('package.json'),
root: __dirname,
src: __dirname + '/src', // unbuild version of build
build: __dirname + '/build', // copy of source, but optimized
app: __dirname + '/src/kibana', // source directory for the app
plugins: __dirname + '/src/kibana/plugins', // source directory for the app
server: __dirname + '/src/server', // source directory for the server
target: __dirname + '/target', // location of the compressed build targets
buildApp: __dirname + '/build/kibana', // build directory for the app
configFile: __dirname + '/src/server/config/kibana.yml',
src: __dirname + '/src',
build: __dirname + '/build', // temporary build directory
plugins: __dirname + '/src/plugins',
server: __dirname + '/src/server',
target: __dirname + '/target', // location of the compressed build targets
testUtilsDir: __dirname + '/src/testUtils',
configFile: __dirname + '/src/config/kibana.yml',

karmaBrowser: (function () {
switch (require('os').platform()) {
case 'win32':
return 'IE';
case 'darwin':
return 'Chrome';
default:
return 'Firefox';
}
}()),

nodeVersion: '0.10.35',
platforms: ['darwin-x64', 'linux-x64', 'linux-x86', 'windows'],
services: [ [ 'launchd', '10.9'], [ 'upstart', '1.5'], [ 'systemd', 'default'], [ 'sysv', 'lsb-3.1' ] ],

unitTestDir: __dirname + '/test/unit',
testUtilsDir: __dirname + '/test/utils',
bowerComponentsDir: __dirname + '/src/kibana/bower_components',

devPlugins: 'vis_debug_spy',
devPlugins: 'devMode',

meta: {
banner: '/*! <%= package.name %> - v<%= package.version %> - ' +
Expand All @@ -34,44 +40,13 @@ module.exports = function (grunt) {
lintThese: [
'Gruntfile.js',
'<%= root %>/tasks/**/*.js',
'<%= src %>/kibana/*.js',
'<%= src %>/server/bin/*.js',
'<%= src %>/server/{config,lib,plugins}/**/*.js',
'<%= src %>/server/bin/{plugin,startup}/**/*.js',
'<%= src %>/kibana/{components,directives,factories,filters,plugins,registry,services,utils}/**/*.js',
'<%= unitTestDir %>/**/*.js',
'!<%= unitTestDir %>/specs/vislib/fixture/**/*'
],
lessFiles: [
'<%= src %>/kibana/components/*/*.less',
'<%= src %>/kibana/styles/main.less',
'<%= src %>/kibana/components/vislib/styles/main.less',
'<%= src %>/server/plugins/status/public/styles/main.less',
'<%= plugins %>/dashboard/styles/main.less',
'<%= plugins %>/discover/styles/main.less',
'<%= plugins %>/settings/styles/main.less',
'<%= plugins %>/visualize/styles/main.less',
'<%= plugins %>/visualize/styles/visualization.less',
'<%= plugins %>/visualize/styles/main.less',
'<%= plugins %>/table_vis/table_vis.less',
'<%= plugins %>/metric_vis/metric_vis.less',
'<%= plugins %>/markdown_vis/markdown_vis.less'
'<%= src %>/**/*.js',
'!<%= src %>/fixtures/**/*.js'
]
};

grunt.config.merge(config);

var dirname = require('path').dirname;
var indexFiles = grunt.file.expand({ cwd: 'src/kibana/plugins' }, [
'*/index.js',
'!' + config.devPlugins + '/index.js'
]);
var moduleIds = indexFiles.map(function (fileName) {
return 'plugins/' + dirname(fileName) + '/index';
});

config.bundled_plugin_module_ids = grunt.bundled_plugin_module_ids = moduleIds;

// load plugins
require('load-grunt-config')(grunt, {
configPath: __dirname + '/tasks/config',
Expand Down
4 changes: 2 additions & 2 deletions STYLEGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ Kibana is written in Angular, and uses several utility methods to make using Ang
Angular modules are defined using a custom require module named `module`. It is used as follows:

```js
var app = require('modules').get('app/namespace');
var app = require('ui/modules').get('app/namespace');
```

`app` above is a reference to an Angular module, and can be used to define controllers, providers and anything else used in Angular.
Expand Down Expand Up @@ -849,7 +849,7 @@ app.service('CustomService', function(Promise, otherDeps) {
Angular routes are defined using a custom require modules named `routes` that remove much of the required boilerplate.

```js
require('routes')
require('ui/routes')
.when('/my/object/route/:id?', {
// angular route code goes here
});
Expand Down
25 changes: 25 additions & 0 deletions bin/kibana
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh
SCRIPT=$0

# SCRIPT may be an arbitrarily deep series of symlinks. Loop until we have the concrete path.
while [ -h "$SCRIPT" ] ; do
ls=$(ls -ld "$SCRIPT")
# Drop everything prior to ->
link=$(expr "$ls" : '.*-> \(.*\)$')
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=$(dirname "$SCRIPT")/"$link"
fi
done

DIR="$(dirname "${SCRIPT}")/.."
NODE="${DIR}/node/bin/node"
test -x "$NODE" || NODE=$(which node)
if [ ! -x "$NODE" ]; then
echo "unable to find usable node.js executable."
exit 1
fi

exec "${NODE}" "${DIR}/src/cli/cli" ${@}

25 changes: 25 additions & 0 deletions bin/kibana.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@echo off

SETLOCAL

set SCRIPT_DIR=%~dp0
for %%I in ("%SCRIPT_DIR%..") do set DIR=%%~dpfI

set NODE=%DIR%\node\node.exe
for /f "delims=" %%i in ('WHERE node') do set SYS_NODE=%%i

If Not Exist "%NODE%" (
IF Exist "%SYS_NODE%" (
set NODE=%SYS_NODE%
) else (
Echo unable to find usable node.js executable.
Exit /B 1
)
)

TITLE Kibana Server
"%NODE%" "%DIR%\src\cli\cli" %*

:finally

ENDLOCAL
59 changes: 0 additions & 59 deletions bower.json

This file was deleted.

Loading

0 comments on commit df480f2

Please sign in to comment.