[build] Remove gulp (#138179)

* [build] Remove gulp

* remove more helpers
This commit is contained in:
Jonathan Budzenski 2022-08-09 00:35:09 -04:00 committed by GitHub
parent aa1ce834a6
commit f967dcf62a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 21 additions and 691 deletions

View file

@ -1174,7 +1174,6 @@
"file-loader": "^4.2.0",
"form-data": "^4.0.0",
"geckodriver": "^3.0.2",
"gulp": "4.0.2",
"gulp-babel": "^8.0.0",
"gulp-brotli": "^3.0.0",
"gulp-gzip": "^1.4.2",

View file

@ -1,15 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
require('../src/setup_node_env');
const { downloadChromium } = require('./tasks/download_chromium');
// export the tasks that are runnable from the CLI
module.exports = {
downloadChromium,
};

View file

@ -1,26 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
const { resolve } = require('path');
exports.runGulpTask = function (name) {
process.chdir(resolve(__dirname, '../../..'));
process.argv.splice(1, 1, require.resolve('gulp/bin/gulp'), name);
require('gulp/bin/gulp');
};
exports.runKibanaScript = function (name, args = []) {
process.chdir(resolve(__dirname, '../../../..'));
process.argv.splice(2, 0, ...args);
require('../../../../scripts/' + name); // eslint-disable-line import/no-dynamic-require
};
exports.runXPackScript = function (name, args = []) {
process.chdir(resolve(__dirname, '../../..'));
process.argv.splice(2, 0, ...args);
require('../../../scripts/' + name); // eslint-disable-line import/no-dynamic-require
};

View file

@ -1,8 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
require('./_helpers').runKibanaScript('kbn');

View file

@ -1,8 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
require('./_helpers').runKibanaScript('eslint', ['x-pack/plugins/canvas/**/*.{js,jsx,ts,tsx}']);

View file

@ -1,8 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
require('./_helpers').runGulpTask('canvas:test');

View file

@ -1,8 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
require('./_helpers').runGulpTask('canvas:test:common');

View file

@ -1,8 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
require('./_helpers').runGulpTask('canvas:test:plugins');

View file

@ -1,8 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
require('./_helpers').runGulpTask('canvas:test:mocha');

View file

@ -1,26 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { download, paths } from '@kbn/screenshotting-plugin/server/utils';
export const downloadChromium = async () => {
// eslint-disable-next-line no-console
const consoleLogger = (tag: string) => (message: unknown) => console.log(tag, message);
const logger = {
get: () => logger,
debug: consoleLogger('debug'),
info: consoleLogger('info'),
warn: consoleLogger('warn'),
trace: consoleLogger('trace'),
error: consoleLogger('error'),
fatal: consoleLogger('fatal'),
log: consoleLogger('log'),
};
// Download Chromium for all platforms
await Promise.all(paths.packages.map((pkg) => download(pkg, logger)));
};

596
yarn.lock

File diff suppressed because it is too large Load diff