Skip to content

Commit

Permalink
Merge pull request elastic#22695 from w33ble/chore/canvas-in-xpack
Browse files Browse the repository at this point in the history
Chore: Canvas in X-pack
  • Loading branch information
w33ble authored Sep 14, 2018
2 parents f1eb1f2 + 90d2c1a commit 801d7c3
Show file tree
Hide file tree
Showing 848 changed files with 59,014 additions and 37 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ bower_components
/x-pack/coverage
/x-pack/build
/x-pack/plugins/**/__tests__/fixtures/**
/x-pack/plugins/canvas/common/lib/grammar.js
/x-pack/plugins/canvas/canvas_plugin
/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/*
**/*.js.snap
!/.eslintrc.js
110 changes: 110 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,5 +330,115 @@ module.exports = {
files: ['x-pack/plugins/monitoring/public/**/*'],
env: { browser: true },
},

/**
* Canvas overrides
*/
{
files: ['x-pack/plugins/canvas/**/*'],
plugins: ['prettier'],
rules: {
// preferences
'comma-dangle': [2, 'always-multiline'],
'no-multiple-empty-lines': [2, { max: 1, maxEOF: 1 }],
'no-multi-spaces': 2,
radix: 2,
curly: [2, 'multi-or-nest', 'consistent'],

// annoying rules that conflict with prettier
'space-before-function-paren': 0,
indent: 0,
'wrap-iife': 0,
'max-len': 0,

// module importing
'import/order': [
2,
{ groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'] },
],
'import/extensions': [2, 'never', { json: 'always', less: 'always', svg: 'always' }],

// prettier
'prettier/prettier': 2,

// react
'jsx-quotes': 2,
'react/no-did-mount-set-state': 2,
'react/no-did-update-set-state': 2,
'react/no-multi-comp': [2, { ignoreStateless: true }],
'react/self-closing-comp': 2,
'react/sort-comp': 2,
'react/jsx-boolean-value': 2,
'react/jsx-wrap-multilines': 2,
'react/no-unescaped-entities': [2, { forbid: ['>', '}'] }],
'react/forbid-elements': [
2,
{
forbid: [
{
element: 'EuiConfirmModal',
message: 'Use <ConfirmModal> instead',
},
{
element: 'EuiPopover',
message: 'Use <Popover> instead',
},
{
element: 'EuiIconTip',
message: 'Use <TooltipIcon> instead',
},
],
},
],
},
},
{
files: ['x-pack/plugins/canvas/*', 'x-pack/plugins/canvas/**/*'],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
packageDir: resolve(__dirname, 'x-pack/package.json'),
},
],
},
},
{
files: [
'x-pack/plugins/canvas/gulpfile.js',
'x-pack/plugins/canvas/tasks/*.js',
'x-pack/plugins/canvas/tasks/**/*.js',
'x-pack/plugins/canvas/__tests__/**/*',
'x-pack/plugins/canvas/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*',
],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
peerDependencies: true,
packageDir: resolve(__dirname, 'x-pack/package.json'),
},
],
},
},
{
files: ['x-pack/plugins/canvas/canvas_plugin_src/**/*'],
globals: { canvas: true, $: true },
rules: {
'import/no-extraneous-dependencies': [
'error',
{
packageDir: resolve(__dirname, 'x-pack/package.json'),
},
],
'import/no-unresolved': [
'error',
{
ignore: ['!!raw-loader.+.svg$'],
},
],
},
},
],
};
3 changes: 3 additions & 0 deletions src/dev/license_checker/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ export const LICENSE_WHITELIST = [
];

export const LICENSE_OVERRIDES = {
'[email protected]': ['MIT'], // license header appended in the dist
'[email protected]': ['BSD'], // adler32 extracted from react source

// TODO can be removed once we upgrade past [email protected]
'[email protected]': ['Apache-2.0'],

Expand Down
2 changes: 2 additions & 0 deletions src/dev/precommit_hook/casing_check_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export const IGNORE_FILE_GLOBS = [
'tasks/config/**/*',
'**/{Dockerfile,docker-compose.yml}',
'x-pack/plugins/apm/**/*',
'x-pack/plugins/canvas/tasks/**/*',
'x-pack/plugins/canvas/canvas_plugin_src/**/*',
'**/.*',
'**/{webpackShims,__mocks__}/**/*',
'x-pack/docs/**/*',
Expand Down
15 changes: 10 additions & 5 deletions x-pack/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ require('dotenv').config({ silent: true });
const path = require('path');
const gulp = require('gulp');
const mocha = require('gulp-mocha');
const pegjs = require('gulp-pegjs');
const multiProcess = require('gulp-multi-process');
const fancyLog = require('fancy-log');
const ansiColors = require('ansi-colors');
const pkg = require('./package.json');
Expand All @@ -20,14 +22,16 @@ const packageDir = path.resolve(buildDir, 'distributions');
const coverageDir = path.resolve(__dirname, 'coverage');

const gulpHelpers = {
log: fancyLog,
colors: ansiColors,
mocha,
pkg,
buildDir,
buildTarget,
packageDir,
colors: ansiColors,
coverageDir,
log: fancyLog,
mocha,
multiProcess,
packageDir,
pegjs,
pkg,
};

require('./tasks/build')(gulp, gulpHelpers);
Expand All @@ -36,3 +40,4 @@ require('./tasks/dev')(gulp, gulpHelpers);
require('./tasks/prepare')(gulp, gulpHelpers);
require('./tasks/report')(gulp, gulpHelpers);
require('./tasks/test')(gulp, gulpHelpers);
require('./plugins/canvas/tasks')(gulp, gulpHelpers);
2 changes: 2 additions & 0 deletions x-pack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { indexManagement } from './plugins/index_management';
import { consoleExtensions } from './plugins/console_extensions';
import { notifications } from './plugins/notifications';
import { kueryAutocomplete } from './plugins/kuery_autocomplete';
import { canvas } from './plugins/canvas';

module.exports = function (kibana) {
return [
Expand All @@ -39,6 +40,7 @@ module.exports = function (kibana) {
dashboardMode(kibana),
logstash(kibana),
apm(kibana),
canvas(kibana),
licenseManagement(kibana),
cloud(kibana),
indexManagement(kibana),
Expand Down
45 changes: 45 additions & 0 deletions x-pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
"aws-sdk": "2.2.33",
"axios": "^0.18.0",
"babel-jest": "^23.4.2",
"babel-plugin-inline-react-svg": "^0.5.4",
"babel-plugin-mock-imports": "^0.0.5",
"babel-plugin-pegjs-inline-precompile": "^0.1.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.14",
"babel-register": "^6.26.0",
"chalk": "^2.4.1",
"chance": "1.0.10",
"checksum": "0.1.1",
Expand All @@ -47,10 +52,13 @@
"fetch-mock": "^5.13.1",
"gulp": "3.9.1",
"gulp-mocha": "2.2.0",
"gulp-pegjs": "^0.1.0",
"gulp-multi-process": "^1.3.1",
"hapi": "14.2.0",
"jest": "^23.5.0",
"jest-cli": "^23.5.0",
"jest-styled-components": "^6.1.1",
"jsdom": "9.9.1",
"mocha": "3.3.0",
"mustache": "^2.3.0",
"mutation-observer": "^1.0.3",
Expand All @@ -63,8 +71,10 @@
"redux-test-utils": "0.2.2",
"rsync": "0.4.0",
"run-sequence": "^2.2.1",
"sass-loader": "^7.1.0",
"simple-git": "1.37.0",
"sinon": "^5.0.7",
"squel": "^5.12.2",
"supertest": "^3.1.0",
"supertest-as-promised": "^4.0.2",
"tmp": "0.0.31",
Expand All @@ -76,6 +86,7 @@
"yargs": "4.7.1"
},
"dependencies": {
"@elastic/datemath": "^4.0.2",
"@elastic/eui": "4.0.1",
"@elastic/node-crypto": "0.1.2",
"@elastic/node-phantom-simple": "2.2.4",
Expand All @@ -84,47 +95,67 @@
"@kbn/i18n": "link:../packages/kbn-i18n",
"@kbn/ui-framework": "link:../packages/kbn-ui-framework",
"@samverschueren/stream-to-observable": "^0.3.0",
"@scant/router": "^0.1.0",
"@slack/client": "^4.2.2",
"@types/moment-timezone": "^0.5.8",
"angular-paging": "2.2.1",
"angular-resource": "1.4.9",
"angular-sanitize": "1.4.9",
"angular-ui-ace": "0.2.3",
"axios": "^0.18.0",
"babel-core": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-runtime": "^6.26.0",
"base64-js": "^1.2.1",
"bluebird": "3.1.1",
"boom": "3.1.1",
"brace": "0.11.1",
"chroma-js": "^1.3.6",
"classnames": "2.2.5",
"concat-stream": "1.5.1",
"copy-to-clipboard": "^3.0.8",
"d3": "3.5.6",
"d3-scale": "1.0.6",
"dedent": "^0.7.0",
"dragselect": "1.7.17",
"elasticsearch": "^14.1.0",
"extract-zip": "1.5.0",
"file-saver": "^1.3.8",
"font-awesome": "4.4.0",
"get-port": "2.1.0",
"getos": "^3.1.0",
"glob": "6.0.4",
"handlebars": "^4.0.10",
"hapi-auth-cookie": "6.1.1",
"history": "4.7.2",
"humps": "2.0.1",
"icalendar": "0.7.1",
"inline-style": "^2.0.0",
"isomorphic-fetch": "2.2.1",
"joi": "6.10.1",
"jquery": "^3.3.1",
"jstimezonedetect": "1.0.5",
"lodash": "3.10.1",
"lodash.clone": "^4.5.0",
"lodash.keyby": "^4.6.0",
"lodash.lowercase": "^4.3.0",
"lodash.mean": "^4.1.0",
"lodash.omitby": "^4.6.0",
"lodash.orderby": "4.6.0",
"lodash.pickby": "^4.6.0",
"lodash.topath": "^4.5.2",
"lodash.uniqby": "^4.7.0",
"lz-string": "^1.4.4",
"markdown-it": "^8.4.1",
"mime": "^2.2.2",
"mkdirp": "0.5.1",
"moment": "^2.20.1",
"moment-duration-format": "^1.3.0",
"moment-timezone": "^0.5.14",
"ngreact": "^0.5.1",
"nodemailer": "^4.6.4",
"object-path-immutable": "^0.5.3",
"papaparse": "^4.6.0",
"pdfmake": "0.1.33",
"pivotal-ui": "13.0.1",
"pluralize": "3.1.0",
Expand All @@ -133,31 +164,45 @@
"prop-types": "^15.6.0",
"puid": "1.0.5",
"puppeteer-core": "^1.7.0",
"raw-loader": "0.5.1",
"react": "^16.3.0",
"react-beautiful-dnd": "^8.0.7",
"react-clipboard.js": "^1.1.2",
"react-datetime": "^2.14.0",
"react-dom": "^16.3.0",
"react-dropzone": "^4.2.9",
"react-markdown-renderer": "^1.4.0",
"react-portal": "^3.2.0",
"react-redux": "^5.0.7",
"react-redux-request": "^1.5.6",
"react-router-breadcrumbs-hoc": "1.1.2",
"react-router-dom": "^4.2.2",
"react-select": "^1.2.1",
"react-shortcuts": "^2.0.0",
"react-sticky": "^6.0.1",
"react-syntax-highlighter": "^5.7.0",
"react-vis": "^1.8.1",
"recompose": "^0.26.0",
"reduce-reducers": "^0.1.2",
"redux": "4.0.0",
"redux-actions": "2.2.1",
"redux-thunk": "2.3.0",
"redux-thunks": "^1.0.0",
"request": "^2.85.0",
"reselect": "3.0.1",
"rimraf": "^2.6.2",
"rison-node": "0.3.1",
"rxjs": "^6.2.1",
"scriptjs": "^2.5.8",
"semver": "5.1.0",
"socket.io": "^1.7.3",
"socket.io-client": "^1.7.3",
"stream-stream": "^1.2.6",
"style-it": "^1.6.12",
"styled-components": "3.3.3",
"tar-fs": "1.13.0",
"tinycolor2": "1.3.0",
"tinymath": "^0.5.0",
"tslib": "^1.9.3",
"ui-select": "0.19.4",
"unbzip2-stream": "1.0.9",
Expand Down
Loading

0 comments on commit 801d7c3

Please sign in to comment.