Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gulp related packages (major) #46665

Merged
merged 29 commits into from
Oct 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6ccbe7e
Update gulp related packages
renovate-bot Sep 26, 2019
70d99a7
Merge branch 'master' of github.com:elastic/kibana into renovate/majo…
Sep 26, 2019
0e07b05
ts-ify and gulp4-ify x-pack tasks, remove unused canvas tasks
Sep 26, 2019
477618a
remove unnecessary gulp.TaskFunction usage
Sep 26, 2019
fcaa3bd
fix old references
Sep 26, 2019
89a0876
update renovate config
Sep 26, 2019
7ba65d9
Merge branch 'master' of github.com:elastic/kibana into renovate/majo…
Sep 26, 2019
76a92c3
Merge branch 'master' of github.com:elastic/kibana into renovate/majo…
Sep 26, 2019
c5820ab
move constants into helpers directory
Sep 26, 2019
b26755e
typo
Sep 26, 2019
f5a8884
Merge branch 'master' of github.com:elastic/kibana into renovate/majo…
Sep 27, 2019
058bf3c
compact tasks a bit, remove unnecessary paths
Sep 27, 2019
7d6b7b7
fix build directories
Sep 30, 2019
a3a8eab
Merge branch 'master' of github.com:elastic/kibana into renovate/majo…
Sep 30, 2019
8b4f3ca
Merge branch 'master' into renovate/major-gulp
elasticmachine Oct 1, 2019
5aa2473
Merge branch 'master' of github.com:elastic/kibana into renovate/majo…
Oct 1, 2019
fdf5548
Merge branch 'master' into renovate/major-gulp
elasticmachine Oct 3, 2019
e16eea9
Merge branch 'master' of github.com:elastic/kibana into renovate/majo…
Oct 3, 2019
15591cc
deprecate testonly task
Oct 3, 2019
31cfda4
rather than justifying an unjustifiable ts-ignore, ts-ify the importe…
Oct 3, 2019
c54b03e
Merge branch 'master' of github.com:elastic/kibana into renovate/majo…
Oct 4, 2019
14af392
update renovate config
Oct 4, 2019
5ddc5b7
Merge branch 'master' of github.com:elastic/kibana into renovate/majo…
Oct 4, 2019
5173591
update browser download tests to mock axios
Oct 4, 2019
ef4c268
add root index.d.ts to tsconfig
Oct 4, 2019
ae13958
Merge branch 'master' of github.com:elastic/kibana into renovate/majo…
Oct 5, 2019
3eb03da
export BrowserType
Oct 5, 2019
3ec4220
remove unnecessary `@ts-ignore`
Oct 5, 2019
3b41afb
use consistent casing
Oct 5, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@
"@types/supertest": "^2.0.5",
"@types/type-detect": "^4.0.1",
"@types/uuid": "^3.4.4",
"@types/vinyl-fs": "^2.4.11",
"@types/zen-observable": "^0.8.0",
"@typescript-eslint/eslint-plugin": "1.13.0",
"@typescript-eslint/parser": "1.13.0",
Expand Down
26 changes: 26 additions & 0 deletions packages/kbn-plugin-helpers/lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export function babelRegister(): void;
export function resolveKibanaPath(path: string): string;
export function readFtrConfigFile(path: string): any;
export function run(
task: 'build' | 'start' | 'testAll' | 'testBrowser' | 'testServer' | 'postinstall',
options: any
): Promise<void>;
2 changes: 1 addition & 1 deletion packages/kbn-plugin-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"globby": "^8.0.1",
"gulp-babel": "^8.0.0",
"gulp-rename": "1.4.0",
"gulp-zip": "4.2.0",
"gulp-zip": "5.0.0",
"inquirer": "^1.2.2",
"minimatch": "^3.0.4",
"node-sass": "^4.9.4",
Expand Down
4 changes: 4 additions & 0 deletions packages/kbn-plugin-helpers/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["lib/index.d.ts"]
}
20 changes: 20 additions & 0 deletions packages/kbn-test/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export * from './src/index';
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,28 @@
* under the License.
*/

// @ts-ignore not typed yet
export { runTestsCli, startServersCli } from './functional_tests/cli';

// @ts-ignore not typed yet
export { runTests, startServers } from './functional_tests/tasks';

// @ts-ignore not typed yet
export { OPTIMIZE_BUNDLE_DIR, KIBANA_ROOT } from './functional_tests/lib/paths';

// @ts-ignore not typed yet
export { esTestConfig, createEsTestCluster } from './es';

// @ts-ignore not typed yet
export { kbnTestConfig, kibanaServerTestUser, kibanaTestUser, adminTestUser } from './kbn';

// @ts-ignore not typed yet
export { setupUsers, DEFAULT_SUPERUSER_PASS } from './functional_tests/lib/auth';

// @ts-ignore not typed yet
export { readConfigFile } from './functional_test_runner/lib/config/read_config_file';

// @ts-ignore not typed yet
export { runFtrCli } from './functional_test_runner/cli';

export {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@
* under the License.
*/

// @ts-ignore not typed yet
export { createAutoJUnitReporter } from './auto_junit_reporter';
// @ts-ignore not typed yet
export { setupJUnitReportGeneration } from './junit_report_generation';
// @ts-ignore not typed yet
export { runMochaCli } from './run_mocha_cli';
// @ts-ignore not typed yet
export { recordLog, snapshotLogsForRunnable } from './log_cache';
// @ts-ignore not typed yet
export { escapeCdata } from './xml';
4 changes: 2 additions & 2 deletions packages/kbn-test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"include": [
"types/**/*",
"src/functional_test_runner/**/*",
"src/mocha/xml.ts"
"src/**/*",
"index.d.ts"
]
}
24 changes: 24 additions & 0 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,14 @@
'@types/uuid',
],
},
{
groupSlug: 'vinyl-fs',
groupName: 'vinyl-fs related packages',
packageNames: [
'vinyl-fs',
'@types/vinyl-fs',
],
},
{
groupSlug: 'zen-observable',
groupName: 'zen-observable related packages',
Expand Down Expand Up @@ -639,6 +647,14 @@
'@types/color',
],
},
{
groupSlug: 'fancy-log',
groupName: 'fancy-log related packages',
packageNames: [
'fancy-log',
'@types/fancy-log',
],
},
{
groupSlug: 'file-saver',
groupName: 'file-saver related packages',
Expand All @@ -647,6 +663,14 @@
'@types/file-saver',
],
},
{
groupSlug: 'getos',
groupName: 'getos related packages',
packageNames: [
'getos',
'@types/getos',
],
},
{
groupSlug: 'git-url-parse',
groupName: 'git-url-parse related packages',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,30 @@
*/

import vfs from 'vinyl-fs';
import { ToolingLog } from '@kbn/dev-utils';

const NOTICE_COMMENT_RE = /\/\*[\s\n\*]*@notice([\w\W]+?)\*\//g;
const NEWLINE_RE = /\r?\n/g;

interface Options {
/**
* Name to print at the top of the notice
*/
productName: string;
/**
* absolute path to the repo to search for @notice comments
*/
directory: string;
log: ToolingLog;
}

/**
* Generates the text for the NOTICE.txt file at the root of the
* repo which details the licenses for code that is copied/vendored
* into the repository.
*
* @param {Object} options
* @property {string} options.productName Name to print at the top of the notice
* @property {ToolingLog} options.log
* @property {string} options.directory absolute path to the repo to search for @notice comments
* @return {string}
*/
export async function generateNoticeFromSource({ productName, directory, log }) {
const globs = [
'**/*.{js,less,css,ts}',
];
export async function generateNoticeFromSource({ productName, directory, log }: Options) {
const globs = ['**/*.{js,less,css,ts}'];

const options = {
cwd: directory,
Expand All @@ -46,18 +51,18 @@ export async function generateNoticeFromSource({ productName, directory, log })
'packages/*/{node_modules,build,target,dist}/**',
'x-pack/{node_modules,build,target,dist,data}/**',
'x-pack/packages/*/{node_modules,build,target,dist}/**',
]
],
};

log.debug('vfs.src globs', globs);
log.debug('vfs.src options', options);
log.info(`Searching ${directory} for multi-line comments starting with @notice`);

const files = vfs.src(globs, options);
const noticeComments = [];
const noticeComments: string[] = [];
await new Promise((resolve, reject) => {
files
.on('data', (file) => {
.on('data', file => {
log.verbose(`Checking for @notice comments in ${file.relative}`);

const source = file.contents.toString('utf8');
Expand All @@ -75,19 +80,19 @@ export async function generateNoticeFromSource({ productName, directory, log })

let noticeText = '';
noticeText += `${productName}\n`;
noticeText += `Copyright 2012-${(new Date()).getUTCFullYear()} Elasticsearch B.V.\n`;
noticeText += `Copyright 2012-${new Date().getUTCFullYear()} Elasticsearch B.V.\n`;

for (const comment of noticeComments.sort()) {
noticeText += '\n---\n';
noticeText += comment
.split(NEWLINE_RE)
.map(line => (
.map(line =>
line
// trim whitespace
.trim()
// trim leading * and a single space
.replace(/(^\* ?)/, '')
))
)
.join('\n')
.trim();
noticeText += '\n';
Expand Down
1 change: 1 addition & 0 deletions src/dev/notice/index.js → src/dev/notice/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
*/

export { generateNoticeFromSource } from './generate_notice_from_source';
// @ts-ignore not typed yet
export { generateBuildNoticeText } from './generate_build_notice_text';
44 changes: 14 additions & 30 deletions x-pack/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,20 @@
* you may not use this file except in compliance with the Elastic License.
*/

require('@kbn/plugin-helpers').babelRegister();
require('dotenv').config({ silent: true });
require('../src/setup_node_env');

const path = require('path');
const gulp = require('gulp');
const mocha = require('gulp-mocha');
const multiProcess = require('gulp-multi-process');
const fancyLog = require('fancy-log');
const pkg = require('./package.json');
const { buildTask } = require('./tasks/build');
const { devTask } = require('./tasks/dev');
const { testTask, testBrowserTask, testBrowserDevTask, testServerTask } = require('./tasks/test');
const { prepareTask } = require('./tasks/prepare');

const buildDir = path.resolve(__dirname, 'build');
const buildTarget = path.resolve(buildDir, 'plugin');
const packageDir = path.resolve(buildDir, 'distributions');
const coverageDir = path.resolve(__dirname, 'coverage');

const gulpHelpers = {
buildDir,
buildTarget,
coverageDir,
log: fancyLog,
mocha,
multiProcess,
packageDir,
pkg,
// export the tasks that are runnable from the CLI
module.exports = {
build: buildTask,
dev: devTask,
prepare: prepareTask,
test: testTask,
testserver: testServerTask,
testbrowser: testBrowserTask,
'testbrowser-dev': testBrowserDevTask,
};

require('./tasks/build')(gulp, gulpHelpers);
require('./tasks/clean')(gulp, gulpHelpers);
require('./tasks/dev')(gulp, gulpHelpers);
require('./tasks/prepare')(gulp, gulpHelpers);
require('./tasks/report')(gulp, gulpHelpers);
require('./tasks/test')(gulp, gulpHelpers);
require('./legacy/plugins/canvas/tasks')(gulp, gulpHelpers);
51 changes: 0 additions & 51 deletions x-pack/legacy/plugins/canvas/tasks/helpers/babelhook.js

This file was deleted.

23 changes: 0 additions & 23 deletions x-pack/legacy/plugins/canvas/tasks/helpers/dom_setup.js

This file was deleted.

10 changes: 0 additions & 10 deletions x-pack/legacy/plugins/canvas/tasks/helpers/enzyme_setup.js

This file was deleted.

Loading