From 3e73038f3fbd82c53d53424882a11ffb53b38eae Mon Sep 17 00:00:00 2001 From: Tre' Seymour Date: Thu, 22 Aug 2019 11:51:01 -0600 Subject: [PATCH 1/2] Add ability to run $ grunt tasks # Lists available tasks :) --- Gruntfile.js | 10 ++++++++++ package.json | 1 + yarn.lock | 10 +++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index e98708b87e3a7..ccbda5c5d2857 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -25,8 +25,18 @@ module.exports = function (grunt) { // grunt.config.get() within the config files const config = { root: __dirname, + availabletasks: { + tasks: { + options: { + filter: 'exclude', + tasks: ['availabletasks', 'tasks'] + } + } + }, }; + grunt.registerTask('tasks', ['availabletasks']); + grunt.config.merge(config); // load plugins diff --git a/package.json b/package.json index ac625591be599..e4472c36b439c 100644 --- a/package.json +++ b/package.json @@ -380,6 +380,7 @@ "geckodriver": "1.16.2", "getopts": "^2.2.4", "grunt": "1.0.4", + "grunt-available-tasks": "^0.6.3", "grunt-cli": "^1.2.0", "grunt-contrib-watch": "^1.1.0", "grunt-karma": "2.0.0", diff --git a/yarn.lock b/yarn.lock index 484c855af7933..33bd1c3c33c5f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14275,6 +14275,14 @@ growly@^1.3.0: resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= +grunt-available-tasks@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/grunt-available-tasks/-/grunt-available-tasks-0.6.3.tgz#5be7f6fdda776b80a7b272a21f68bd3050f82260" + integrity sha1-W+f2/dp3a4CnsnKiH2i9MFD4ImA= + dependencies: + chalk "^1.1.1" + lodash "^4.10.0" + grunt-babel@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/grunt-babel/-/grunt-babel-8.0.0.tgz#92ef63aafadf938c488dc2f926ac9846e0c93d1b" @@ -18701,7 +18709,7 @@ lodash@^3.10.1, lodash@^3.3.1, lodash@~3.10.1: resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" integrity sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y= -lodash@^4.16.4: +lodash@^4.10.0, lodash@^4.16.4: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== From 880e5c6dd3b6326d533b90ccbeefebf48ca9ad9e Mon Sep 17 00:00:00 2001 From: Tre' Seymour Date: Tue, 27 Aug 2019 08:40:15 -0600 Subject: [PATCH 2/2] Move conf and task to config per review --- Gruntfile.js | 10 ---------- tasks/config/availabletasks.js | 35 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 tasks/config/availabletasks.js diff --git a/Gruntfile.js b/Gruntfile.js index ccbda5c5d2857..e98708b87e3a7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -25,18 +25,8 @@ module.exports = function (grunt) { // grunt.config.get() within the config files const config = { root: __dirname, - availabletasks: { - tasks: { - options: { - filter: 'exclude', - tasks: ['availabletasks', 'tasks'] - } - } - }, }; - grunt.registerTask('tasks', ['availabletasks']); - grunt.config.merge(config); // load plugins diff --git a/tasks/config/availabletasks.js b/tasks/config/availabletasks.js new file mode 100644 index 0000000000000..e9392cec19504 --- /dev/null +++ b/tasks/config/availabletasks.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +module.exports = function (grunt) { + const config = { + availabletasks: { + tasks: { + options: { + filter: 'exclude', + tasks: ['availabletasks', 'tasks'] + } + } + } + }; + grunt.registerTask('tasks', ['availabletasks']); + grunt.config.merge(config); + + return config; +};