From 2d33d2f0fd5fc5b2c757007335150a6a421c7243 Mon Sep 17 00:00:00 2001 From: jasper Date: Tue, 20 Dec 2016 18:49:17 -0500 Subject: [PATCH] build: remove deepModules hackery (#9579) Backports PR #9327 **Commit 1:** build: remove deepModules hackery The deepModules hacks in the build system were added to support the long paths that resulted from npm2, but npm3 fundamentally addresses that problem, so deepModules is no longer necessary. In practical terms, npm3 shouldn't ever cause path lengths to become so long that they trigger path length problems on certain operating systems. * Original sha: 19fcc93ad3a6b97fea30a8f837d5256675aaf3b8 * Authored by Court Ewing on 2016-12-02T00:13:13Z --- Gruntfile.js | 17 +---------------- tasks/build/index.js | 2 -- tasks/build/packageJson.js | 5 +---- tasks/config/clean.js | 3 --- 4 files changed, 2 insertions(+), 25 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index d04aded254600..071fcb4b78217 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -45,22 +45,7 @@ module.exports = function (grunt) { '<%= src %>/**/*.js', '!<%= src %>/fixtures/**/*.js', '!<%= root %>/test/fixtures/scenarios/**/*.js' - ], - deepModules: { - 'caniuse-db': '1.0.30000265', - 'chalk': '1.1.0', - 'glob': '4.5.3', - 'har-validator': '1.8.0', - 'json5': '0.4.0', - 'loader-utils': '0.2.11', - 'micromatch': '2.2.0', - 'postcss-normalize-url': '2.1.1', - 'postcss-reduce-idents': '1.0.2', - 'postcss-unique-selectors': '1.0.0', - 'postcss-minify-selectors': '1.4.6', - 'postcss-single-charset': '0.3.0', - 'regenerator': '0.8.36' - } + ] }; grunt.config.merge(config); diff --git a/tasks/build/index.js b/tasks/build/index.js index 60b11508fac48..1688a4a95f791 100644 --- a/tasks/build/index.js +++ b/tasks/build/index.js @@ -17,8 +17,6 @@ module.exports = function (grunt) { '_build:installNpmDeps', '_build:removePkgJsonDeps', 'clean:testsFromModules', - 'clean:deepModuleBins', - 'clean:deepModules', 'run:optimizeBuild', 'stop:optimizeBuild', '_build:downloadNodeBuilds:finish', diff --git a/tasks/build/packageJson.js b/tasks/build/packageJson.js index a9038a2dd6d5b..2b58a4353f942 100644 --- a/tasks/build/packageJson.js +++ b/tasks/build/packageJson.js @@ -1,8 +1,5 @@ module.exports = function (grunt) { - let { defaults } = require('lodash'); - let pkg = grunt.config.get('pkg'); - let deepModules = grunt.config.get('deepModules'); grunt.registerTask('_build:packageJson', function () { const { sha, number, version } = grunt.config.get('build'); @@ -22,7 +19,7 @@ module.exports = function (grunt) { engines: { node: pkg.engines.node }, - dependencies: defaults({}, pkg.dependencies, deepModules) + dependencies: pkg.dependencies }, null, ' ') ); }); diff --git a/tasks/config/clean.js b/tasks/config/clean.js index f83a816085567..fdb0e856856e3 100644 --- a/tasks/config/clean.js +++ b/tasks/config/clean.js @@ -1,10 +1,7 @@ module.exports = function (grunt) { - let modules = Object.keys(grunt.config.get('deepModules')); return { build: 'build', target: 'target', testsFromModules: 'build/kibana/node_modules/**/{test,tests}/**', - deepModuleBins: 'build/kibana/node_modules/*/node_modules/**/.bin/{' + modules.join(',') + '}', - deepModules: 'build/kibana/node_modules/*/node_modules/**/{' + modules.join(',') + '}/', }; };