* chore: merge canavs into x-pack squashed, since 6.x history isn't important and i want to be able to rebase... * chore: eslint fixes in canvas adds license headers and includes project linting overrides * Chore: Reorg the x-pack gulp tasks (#22785) - Removes deprecated, non-functional lint scripts - Removes some unused (and barely used) dependencies - Replaces deprecated `gulp-util` dependency - Adds eslint rule to prevent future use of deprecated `gulp-util` dependency - Moves all gulp tasks into `tasks` path - Moves `gulp_helpers` into `tasks/helpers` - All tasks in `gulpfile.js` were moved into `tasks` and broken up by domain This is basically a no-op moving files around PR. All the existing tasks appear to work the same with these changes. <img width="334" alt="screenshot 2018-09-06 15 42 45" src="https://user-images.githubusercontent.com/404731/45188971-8618c000-b1eb-11e8-9b26-b072ccc7ddb7.png"> * chore: rename files to match rules * chore: copy canvas dependencies * chore: reduce package.json to essentials * chore: make canvas work in xpack * chore: make browser tests work * chore: fix include paths node_modules is in a different relative path * chore: fix ml tests with canvas code in x-pack explicitely enable state management so the mlStateFactory tests pass * chore: fix RBAC tests with canvas * chore: split up the xpack prepare scripts * chore: canvas tasks - dev, peg, and plugins get dev, peg, and plugin building tasks working * chore: canvas tasks - local tests * chore: additional file cleanup * chore: yarn lockfiles and eslint fixes license headers and some small formatting stuff
46 lines
1.5 KiB
JavaScript
46 lines
1.5 KiB
JavaScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License;
|
|
* you may not use this file except in compliance with the Elastic License.
|
|
*/
|
|
|
|
import { getPlugins } from './get_plugins';
|
|
|
|
/*
|
|
* Note: The path `plugins / pluginName / ** / __tests__ / ** / *.js` will match
|
|
* all public and server tests, so a special var must be used for "index" tests
|
|
* paths: `plugins / pluginName / __tests__ / ** / *.js`
|
|
*/
|
|
function getPluginPaths(plugins, opts = {}) {
|
|
const testPath = opts.tests ? '__tests__/**' : '';
|
|
|
|
return plugins.reduce((paths, pluginName) => {
|
|
const plugin = pluginName.trim();
|
|
const commonPath = `${plugin}/common`;
|
|
const serverPath = `${plugin}/**/server`;
|
|
const publicPath = `${plugin}/**/public`;
|
|
|
|
const indexPaths = `plugins/${plugin}/${testPath}/*.js`; // index and helpers
|
|
const commonPaths = `plugins/${commonPath}/**/${testPath}/*.js`;
|
|
const serverPaths = `plugins/${serverPath}/**/${testPath}/*.js`;
|
|
const publicPaths = `plugins/${publicPath}/**/${testPath}/*.js`;
|
|
|
|
paths = paths.concat([indexPaths, commonPaths, serverPaths]);
|
|
|
|
if (opts.browser) {
|
|
paths = paths.concat(publicPaths);
|
|
}
|
|
|
|
return paths;
|
|
}, []);
|
|
}
|
|
|
|
export function forPlugins() {
|
|
const plugins = getPlugins();
|
|
return getPluginPaths(plugins, { browser: true });
|
|
}
|
|
|
|
export function forPluginServerTests() {
|
|
const plugins = getPlugins();
|
|
return getPluginPaths(plugins, { tests: true });
|
|
}
|