From e0b1cdc6ee83c4ca10f5f425337105b2c94ade79 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 13 Aug 2018 17:48:52 +0100 Subject: [PATCH 01/60] feat(NA): added new build step to generate a static file system for node_modules and monkey patch the bin start files to include the static file system loader on begining. --- package.json | 1 + src/dev/build/build_distributables.js | 2 + src/dev/build/tasks/create_static_fs_task.js | 109 +++++++++++++++++++ src/dev/build/tasks/index.js | 1 + 4 files changed, 113 insertions(+) create mode 100644 src/dev/build/tasks/create_static_fs_task.js diff --git a/package.json b/package.json index 61d689be30f59..75bd2667ac685 100644 --- a/package.json +++ b/package.json @@ -325,6 +325,7 @@ "sinon": "^5.0.7", "source-map": "0.5.6", "source-map-support": "0.2.10", + "static-fs": "git+https://git@github.com/mistic/static-fs.git", "strip-ansi": "^3.0.1", "supertest": "3.0.0", "supertest-as-promised": "4.0.2", diff --git a/src/dev/build/build_distributables.js b/src/dev/build/build_distributables.js index 14a94eb55052f..6e81df61b91c9 100644 --- a/src/dev/build/build_distributables.js +++ b/src/dev/build/build_distributables.js @@ -37,6 +37,7 @@ import { CreatePackageJsonTask, CreateReadmeTask, CreateRpmPackageTask, + CreateStaticFilesystem, DownloadNodeBuildsTask, ExtractNodeBuildsTask, InstallDependenciesTask, @@ -112,6 +113,7 @@ export async function buildDistributables(options) { await run(TranspileScssTask); await run(CleanExtraFilesFromModulesTask); await run(OptimizeBuildTask); + await run(CreateStaticFilesystem); /** * copy generic build outputs into platform-specific build diff --git a/src/dev/build/tasks/create_static_fs_task.js b/src/dev/build/tasks/create_static_fs_task.js new file mode 100644 index 0000000000000..f3167c1e19014 --- /dev/null +++ b/src/dev/build/tasks/create_static_fs_task.js @@ -0,0 +1,109 @@ +/* + * 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. + */ + +import { deleteAll } from '../lib'; +import { dirname, relative } from 'path'; +import { StaticFilesystemCreator } from 'static-link/dist/main'; +import { calculateHash, isFile, mkdir, writeFile, copyFile, readFile } from 'static-link/dist/lib/common'; + +export const CreateStaticFilesystem = { + description: + 'Creating StaticModulesFs and patching entryPoints', + + async run(config, log, build) { + const createLoaderFile = async (filePath) => { + const sourceFile = require.resolve(`static-link/dist/lib/static-loader`); + await copyFile(sourceFile, filePath); + }; + + const patchEntryPoints = async (entryPoints, staticModulesLoader, staticModulesFs) => { + for (const each of entryPoints) { + const entrypoint = require.resolve(build.resolvePath(each)); + + if (await isFile(entrypoint)) { + let loaderPath = relative(dirname(entrypoint), staticModulesLoader).replace(/\\/g, '/'); + if (loaderPath.charAt(0) !== '.') { + loaderPath = `./${loaderPath}`; + } + let fsPath = relative(dirname(entrypoint), staticModulesFs).replace(/\\/g, '/'); + fsPath = `\${__dirname }/${fsPath}`; + let content = await readFile(entrypoint, { encoding: 'utf8' }); + const patchLine = `require('${loaderPath}').load(require.resolve(\`${fsPath}\`));\n`; + let prefix = ''; + if (content.indexOf(patchLine) === -1) { + const rx = /^#!.*$/gm.exec(content.toString()); + if (rx && rx.index === 0) { + prefix = `${rx[0]}\n`; + // remove prefix + content = content.replace(prefix, ''); + } + // strip existing loader + content = content.replace(/^require.*static-loader.js.*$/gm, ''); + content = content.replace(/\/\/ load static module: .*$/gm, ''); + content = content.trim(); + content = `${prefix}// load static module: ${fsPath}\n${patchLine}\n${content}`; + + await writeFile(entrypoint, content); + } + } + } + }; + + const addModulesToStaticModulesFs = async (nodeModulesDir, staticModulesFs, hash) => { + const sf = new StaticFilesystemCreator(); + + await sf.addFolder(nodeModulesDir, '/node_modules'); + await mkdir(dirname(staticModulesFs)); + await sf.write(staticModulesFs, hash); + }; + + const generateServerBundle = async () => { + const nodeModulesDir = build.resolvePath('node_modules'); + const staticModulesDir = build.resolvePath('static_modules'); + const staticModulesFs = build.resolvePath(staticModulesDir, 'static_modules.fs'); + const staticModulesLoader = build.resolvePath(staticModulesDir, 'static_loader.js'); + const entryPointsToPatch = [ + 'src/cli' + ]; + + const hash = calculateHash({ + staticModulesDir, + staticModulesFs, + staticModulesLoader, + entryPointsToPatch + }); + + await createLoaderFile(staticModulesLoader); + await patchEntryPoints(entryPointsToPatch, staticModulesLoader, staticModulesFs); + await addModulesToStaticModulesFs(nodeModulesDir, staticModulesFs, hash); + }; + + await generateServerBundle(); + + // Delete node_modules folder + const nodeModulesDir = build.resolvePath('node_modules'); + + await deleteAll( + log, + [ + `${nodeModulesDir}/**` + ] + ); + } +}; diff --git a/src/dev/build/tasks/index.js b/src/dev/build/tasks/index.js index 156754e031fee..e4bb062b4ee35 100644 --- a/src/dev/build/tasks/index.js +++ b/src/dev/build/tasks/index.js @@ -26,6 +26,7 @@ export * from './create_archives_task'; export * from './create_empty_dirs_and_files_task'; export * from './create_package_json_task'; export * from './create_readme_task'; +export * from './create_static_fs_task'; export * from './install_dependencies_task'; export * from './license_file_task'; export * from './nodejs'; From 41b785d23ee0f83cc9b2568d0450fc594a8014ae Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 13 Aug 2018 19:36:12 +0100 Subject: [PATCH 02/60] chore(NA): updated lockfile. --- yarn.lock | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/yarn.lock b/yarn.lock index 82a35b0464b00..5c3a07227d617 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12647,6 +12647,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" +"static-fs@git+https://git@github.com/mistic/static-fs.git": + version "0.1.0" + resolved "git+https://git@github.com/mistic/static-fs.git#95ad39770bdad43e23d6eea43a6d7dd90d0f28bf" + static-module@^2.2.0: version "2.2.2" resolved "https://registry.yarnpkg.com/static-module/-/static-module-2.2.2.tgz#496e9bf1d29cb5177a30fae224511953d7dd291b" From 8b104e11d2526432a04d124cba052b3f807f25f7 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 13 Aug 2018 20:27:00 +0100 Subject: [PATCH 03/60] chore(NA): replace import to the correct static-fs files. --- package.json | 2 +- src/dev/build/tasks/create_static_fs_task.js | 4 ++-- yarn.lock | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 75bd2667ac685..f3b8ef0efa4ff 100644 --- a/package.json +++ b/package.json @@ -325,7 +325,7 @@ "sinon": "^5.0.7", "source-map": "0.5.6", "source-map-support": "0.2.10", - "static-fs": "git+https://git@github.com/mistic/static-fs.git", + "static-fs": "git+https://git@github.com/mistic/static-fs.git#e034fc0", "strip-ansi": "^3.0.1", "supertest": "3.0.0", "supertest-as-promised": "4.0.2", diff --git a/src/dev/build/tasks/create_static_fs_task.js b/src/dev/build/tasks/create_static_fs_task.js index f3167c1e19014..164191184516b 100644 --- a/src/dev/build/tasks/create_static_fs_task.js +++ b/src/dev/build/tasks/create_static_fs_task.js @@ -19,8 +19,8 @@ import { deleteAll } from '../lib'; import { dirname, relative } from 'path'; -import { StaticFilesystemCreator } from 'static-link/dist/main'; -import { calculateHash, isFile, mkdir, writeFile, copyFile, readFile } from 'static-link/dist/lib/common'; +import { StaticFilesystemCreator } from 'static-fs/dist/main'; +import { calculateHash, isFile, mkdir, writeFile, copyFile, readFile } from 'static-fs/dist/lib/common'; export const CreateStaticFilesystem = { description: diff --git a/yarn.lock b/yarn.lock index 5c3a07227d617..ac0e598b63481 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12647,9 +12647,9 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -"static-fs@git+https://git@github.com/mistic/static-fs.git": +"static-fs@git+https://git@github.com/mistic/static-fs.git#e034fc0": version "0.1.0" - resolved "git+https://git@github.com/mistic/static-fs.git#95ad39770bdad43e23d6eea43a6d7dd90d0f28bf" + resolved "git+https://git@github.com/mistic/static-fs.git#e034fc051d25491d1f627d890976f4f47fbd3fd6" static-module@^2.2.0: version "2.2.2" From 34106f714304865c8762ffda453f8b5fc03d73ef Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 13 Aug 2018 21:03:24 +0100 Subject: [PATCH 04/60] fix(NA): resolve for a correct static fs loader. --- src/dev/build/tasks/create_static_fs_task.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dev/build/tasks/create_static_fs_task.js b/src/dev/build/tasks/create_static_fs_task.js index 164191184516b..bfa6cbd801617 100644 --- a/src/dev/build/tasks/create_static_fs_task.js +++ b/src/dev/build/tasks/create_static_fs_task.js @@ -28,7 +28,7 @@ export const CreateStaticFilesystem = { async run(config, log, build) { const createLoaderFile = async (filePath) => { - const sourceFile = require.resolve(`static-link/dist/lib/static-loader`); + const sourceFile = require.resolve(`static-fs/dist/lib/static-loader`); await copyFile(sourceFile, filePath); }; From b60c33d6df42eadfa743d3d3cb85f530c3fc1ec9 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 14 Aug 2018 02:57:08 +0100 Subject: [PATCH 05/60] chore(NA): last static-fs working version. --- package.json | 2 +- yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 5acc4fc10c192..a49fac466210d 100644 --- a/package.json +++ b/package.json @@ -316,7 +316,7 @@ "proxyquire": "1.7.11", "simple-git": "1.37.0", "sinon": "^5.0.7", - "static-fs": "git+https://git@github.com/mistic/static-fs.git#e034fc0", + "static-fs": "git+https://git@github.com/mistic/static-fs.git#ddd8d4e", "strip-ansi": "^3.0.1", "supertest": "3.0.0", "supertest-as-promised": "4.0.2", diff --git a/yarn.lock b/yarn.lock index 96755f8d006d0..3ce6e7dc2ddd6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12441,9 +12441,9 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -"static-fs@git+https://git@github.com/mistic/static-fs.git#e034fc0": +"static-fs@git+https://git@github.com/mistic/static-fs.git#ddd8d4e": version "0.1.0" - resolved "git+https://git@github.com/mistic/static-fs.git#e034fc051d25491d1f627d890976f4f47fbd3fd6" + resolved "git+https://git@github.com/mistic/static-fs.git#ddd8d4e598c170abbb044092100621878d722ebb" static-module@^2.2.0: version "2.2.2" From 956e5386c0f1dff99745838a32f4462c8d4c7190 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 15 Aug 2018 03:01:17 +0100 Subject: [PATCH 06/60] feat(NA): changed patched entryPoints. --- package.json | 2 +- src/dev/build/tasks/create_static_fs_task.js | 2 +- yarn.lock | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a49fac466210d..15ecc114944a3 100644 --- a/package.json +++ b/package.json @@ -316,7 +316,7 @@ "proxyquire": "1.7.11", "simple-git": "1.37.0", "sinon": "^5.0.7", - "static-fs": "git+https://git@github.com/mistic/static-fs.git#ddd8d4e", + "static-fs": "git+https://git@github.com/mistic/static-fs.git#5ef29e9", "strip-ansi": "^3.0.1", "supertest": "3.0.0", "supertest-as-promised": "4.0.2", diff --git a/src/dev/build/tasks/create_static_fs_task.js b/src/dev/build/tasks/create_static_fs_task.js index bfa6cbd801617..3af90a6b44845 100644 --- a/src/dev/build/tasks/create_static_fs_task.js +++ b/src/dev/build/tasks/create_static_fs_task.js @@ -79,7 +79,7 @@ export const CreateStaticFilesystem = { const staticModulesFs = build.resolvePath(staticModulesDir, 'static_modules.fs'); const staticModulesLoader = build.resolvePath(staticModulesDir, 'static_loader.js'); const entryPointsToPatch = [ - 'src/cli' + 'src/setup_node_env/babel_register' ]; const hash = calculateHash({ diff --git a/yarn.lock b/yarn.lock index 3ce6e7dc2ddd6..ce972f42c969a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12441,9 +12441,9 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -"static-fs@git+https://git@github.com/mistic/static-fs.git#ddd8d4e": +"static-fs@git+https://git@github.com/mistic/static-fs.git#00ea434": version "0.1.0" - resolved "git+https://git@github.com/mistic/static-fs.git#ddd8d4e598c170abbb044092100621878d722ebb" + resolved "git+https://git@github.com/mistic/static-fs.git#00ea434cdc25d1d3b0b4bcde7e76733f12b98ca7" static-module@^2.2.0: version "2.2.2" From 470e1252e724898e197480f0612fe2d13f8f7e26 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 15 Aug 2018 22:18:50 +0100 Subject: [PATCH 07/60] chore(NA): update to last static fs. --- package.json | 2 +- yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 15ecc114944a3..a4b8601de7410 100644 --- a/package.json +++ b/package.json @@ -316,7 +316,7 @@ "proxyquire": "1.7.11", "simple-git": "1.37.0", "sinon": "^5.0.7", - "static-fs": "git+https://git@github.com/mistic/static-fs.git#5ef29e9", + "static-fs": "git+https://git@github.com/mistic/static-fs.git#efbde0a", "strip-ansi": "^3.0.1", "supertest": "3.0.0", "supertest-as-promised": "4.0.2", diff --git a/yarn.lock b/yarn.lock index ce972f42c969a..f7390fff8c1a8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12441,9 +12441,9 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -"static-fs@git+https://git@github.com/mistic/static-fs.git#00ea434": +"static-fs@git+https://git@github.com/mistic/static-fs.git#efbde0a": version "0.1.0" - resolved "git+https://git@github.com/mistic/static-fs.git#00ea434cdc25d1d3b0b4bcde7e76733f12b98ca7" + resolved "git+https://git@github.com/mistic/static-fs.git#efbde0aa9f5aa29dbc7125dee850338f0613d2ff" static-module@^2.2.0: version "2.2.2" From bc6db674380f5271f24340af47424ba569e01ea4 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 22 Aug 2018 18:43:25 +0100 Subject: [PATCH 08/60] fix(NA): fix imports on webpack shims. chore(NA): added new static-fs version. --- package.json | 2 +- webpackShims/ace.js | 2 +- webpackShims/angular.js | 4 ++-- webpackShims/jquery.js | 2 +- webpackShims/leaflet.js | 14 +++++++------- webpackShims/mocha.js | 2 +- webpackShims/moment-timezone.js | 4 ++-- webpackShims/moment.js | 2 +- webpackShims/sinon.js | 2 +- yarn.lock | 6 +++--- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index 57aaf3a65b8ae..cac21b48779f1 100644 --- a/package.json +++ b/package.json @@ -317,7 +317,7 @@ "proxyquire": "1.7.11", "simple-git": "1.37.0", "sinon": "^5.0.7", - "static-fs": "git+https://git@github.com/mistic/static-fs.git#efbde0a", + "static-fs": "git+https://git@github.com/mistic/static-fs.git#6098a7c", "strip-ansi": "^3.0.1", "supertest": "3.0.0", "supertest-as-promised": "4.0.2", diff --git a/webpackShims/ace.js b/webpackShims/ace.js index e411b46a7a405..08814809711cf 100644 --- a/webpackShims/ace.js +++ b/webpackShims/ace.js @@ -19,7 +19,7 @@ require('brace'); require('brace/mode/json'); -require('../node_modules/@elastic/ui-ace/ui-ace'); +require('@elastic/ui-ace/ui-ace'); require('ui/modules').get('kibana', ['ui.ace']); diff --git a/webpackShims/angular.js b/webpackShims/angular.js index ab7fc06bf3c28..a133750c87eb4 100644 --- a/webpackShims/angular.js +++ b/webpackShims/angular.js @@ -18,9 +18,9 @@ */ require('jquery'); -require('../node_modules/angular/angular'); +require('angular/angular'); module.exports = window.angular; -require('../node_modules/angular-elastic/elastic'); +require('angular-elastic/elastic'); require('ui/modules').get('kibana', ['monospaced.elastic']); diff --git a/webpackShims/jquery.js b/webpackShims/jquery.js index 3fd7af45f12de..c1298aaceb69a 100644 --- a/webpackShims/jquery.js +++ b/webpackShims/jquery.js @@ -17,5 +17,5 @@ * under the License. */ -var $ = window.jQuery = window.$ = module.exports = require('../node_modules/jquery/dist/jquery'); +var $ = window.jQuery = window.$ = module.exports = require('jquery/dist/jquery'); require('ui/jquery/find_test_subject')($); diff --git a/webpackShims/leaflet.js b/webpackShims/leaflet.js index c35076e129533..aa1a1e0537b5e 100644 --- a/webpackShims/leaflet.js +++ b/webpackShims/leaflet.js @@ -17,15 +17,15 @@ * under the License. */ -require('../node_modules/leaflet/dist/leaflet.css'); -window.L = module.exports = require('../node_modules/leaflet/dist/leaflet'); +require('leaflet/dist/leaflet.css'); +window.L = module.exports = require('leaflet/dist/leaflet'); window.L.Browser.touch = false; window.L.Browser.pointer = false; -require('../node_modules/leaflet.heat/dist/leaflet-heat.js'); +require('leaflet.heat/dist/leaflet-heat.js'); -require('../node_modules/leaflet-draw/dist/leaflet.draw.css'); -require('../node_modules/leaflet-draw/dist/leaflet.draw.js'); +require('leaflet-draw/dist/leaflet.draw.css'); +require('leaflet-draw/dist/leaflet.draw.js'); -require('../node_modules/leaflet-responsive-popup/leaflet.responsive.popup.css'); -require('../node_modules/leaflet-responsive-popup/leaflet.responsive.popup.js'); +require('leaflet-responsive-popup/leaflet.responsive.popup.css'); +require('leaflet-responsive-popup/leaflet.responsive.popup.js'); diff --git a/webpackShims/mocha.js b/webpackShims/mocha.js index 9ab12381b643c..0ef77e906ec39 100644 --- a/webpackShims/mocha.js +++ b/webpackShims/mocha.js @@ -17,4 +17,4 @@ * under the License. */ -module.exports = require('../node_modules/mocha/mocha.js'); +module.exports = require('mocha/mocha.js'); diff --git a/webpackShims/moment-timezone.js b/webpackShims/moment-timezone.js index 91bcc0cd1391c..5933bffde6b19 100644 --- a/webpackShims/moment-timezone.js +++ b/webpackShims/moment-timezone.js @@ -17,5 +17,5 @@ * under the License. */ -var moment = module.exports = require('../node_modules/moment-timezone/moment-timezone'); -moment.tz.load(require('../node_modules/moment-timezone/data/packed/latest.json')); +var moment = module.exports = require('moment-timezone/moment-timezone'); +moment.tz.load(require('moment-timezone/data/packed/latest.json')); diff --git a/webpackShims/moment.js b/webpackShims/moment.js index c6aca40432a85..556a40c4789cb 100644 --- a/webpackShims/moment.js +++ b/webpackShims/moment.js @@ -17,4 +17,4 @@ * under the License. */ -module.exports = require('../node_modules/moment/min/moment.min.js'); +module.exports = require('moment/min/moment.min.js'); diff --git a/webpackShims/sinon.js b/webpackShims/sinon.js index e201f405fb127..72a0d998333d4 100644 --- a/webpackShims/sinon.js +++ b/webpackShims/sinon.js @@ -17,5 +17,5 @@ * under the License. */ -require('script-loader!../node_modules/sinon/pkg/sinon.js'); +require('script-loader!sinon/pkg/sinon.js'); module.exports = window.sinon; diff --git a/yarn.lock b/yarn.lock index f282da63ced56..7778d908ee04a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12442,9 +12442,9 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -"static-fs@git+https://git@github.com/mistic/static-fs.git#efbde0a": - version "0.1.0" - resolved "git+https://git@github.com/mistic/static-fs.git#efbde0aa9f5aa29dbc7125dee850338f0613d2ff" +"static-fs@git+https://git@github.com/mistic/static-fs.git#6098a7c": + version "0.0.1" + resolved "git+https://git@github.com/mistic/static-fs.git#6098a7c14ff5b1bf0b27ccfe6df3536118906ab5" static-module@^2.2.0: version "2.2.2" From 64f40b5ab965d8ca745220a0624805f93f0c2426 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 22 Aug 2018 18:50:55 +0100 Subject: [PATCH 09/60] chore(NA): update to static-fs with stat and statSync. --- package.json | 2 +- yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index cac21b48779f1..a8ae633659fba 100644 --- a/package.json +++ b/package.json @@ -317,7 +317,7 @@ "proxyquire": "1.7.11", "simple-git": "1.37.0", "sinon": "^5.0.7", - "static-fs": "git+https://git@github.com/mistic/static-fs.git#6098a7c", + "static-fs": "git+https://git@github.com/mistic/static-fs.git#a6b132d", "strip-ansi": "^3.0.1", "supertest": "3.0.0", "supertest-as-promised": "4.0.2", diff --git a/yarn.lock b/yarn.lock index 7778d908ee04a..4549f54e550ec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12442,9 +12442,9 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -"static-fs@git+https://git@github.com/mistic/static-fs.git#6098a7c": +"static-fs@git+https://git@github.com/mistic/static-fs.git#a6b132d": version "0.0.1" - resolved "git+https://git@github.com/mistic/static-fs.git#6098a7c14ff5b1bf0b27ccfe6df3536118906ab5" + resolved "git+https://git@github.com/mistic/static-fs.git#a6b132d3b6224811de4bdb77611d4fec7e114f11" static-module@^2.2.0: version "2.2.2" From 319011ba13064113475974cb4e6dcada948e673e Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 22 Aug 2018 20:30:28 +0100 Subject: [PATCH 10/60] fix(NA): vendor chunk filtering in order to include default node modules and static node modules. --- src/optimize/base_optimizer.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/optimize/base_optimizer.js b/src/optimize/base_optimizer.js index ff8cae3fd2bc1..e3daffff092b7 100644 --- a/src/optimize/base_optimizer.js +++ b/src/optimize/base_optimizer.js @@ -18,6 +18,7 @@ */ import { writeFile } from 'fs'; +import { sep } from 'path'; import Boom from 'boom'; import ExtractTextPlugin from 'extract-text-webpack-plugin'; @@ -186,8 +187,21 @@ export default class BaseOptimizer { new webpack.optimize.CommonsChunkPlugin({ name: 'vendors', filename: 'vendors.bundle.js', - // only combine node_modules from Kibana - minChunks: module => module.context && module.context.indexOf(nodeModulesPath) !== -1 + // only combine node_modules from Kibana whether they are + // default node_modules during development + // or static node_modules during prod/distributable + minChunks: (module) => { + if (!module || !module.context) { + return false; + } + + const moduleDirs = module.context.split(sep); + const firstDirIdx = moduleDirs.findIndex(e => e === 'node_modules'); + const isKibanaStaticNodeModule = (firstDirIdx === 0) || (firstDirIdx === 1 && !moduleDirs[0]); + const isKibanaDefaultNodeModule = module.context.indexOf(nodeModulesPath) !== -1; + + return isKibanaDefaultNodeModule || isKibanaStaticNodeModule; + } }), new webpack.NoEmitOnErrorsPlugin(), From 00cb5281e8a87cb2bca9a3fd7dcb770ece0818ea Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 22 Aug 2018 21:39:33 +0100 Subject: [PATCH 11/60] refact(NA): major refact on create static modules fs task. --- package.json | 1 + src/dev/build/build_distributables.js | 6 +- src/dev/build/lib/fs.js | 15 +++ src/dev/build/lib/index.js | 1 + src/dev/build/tasks/clean_tasks.js | 11 +- src/dev/build/tasks/create_static_fs_task.js | 109 ---------------- .../tasks/create_static_modules_fs_task.js | 116 ++++++++++++++++++ src/dev/build/tasks/index.js | 2 +- yarn.lock | 33 ++++- 9 files changed, 180 insertions(+), 114 deletions(-) delete mode 100644 src/dev/build/tasks/create_static_fs_task.js create mode 100644 src/dev/build/tasks/create_static_modules_fs_task.js diff --git a/package.json b/package.json index a8ae633659fba..a2b71e5794ef8 100644 --- a/package.json +++ b/package.json @@ -253,6 +253,7 @@ "chromedriver": "2.41.0", "classnames": "2.2.5", "dedent": "^0.7.0", + "delete-empty": "^2.0.0", "enzyme": "3.2.0", "enzyme-adapter-react-16": "^1.1.1", "enzyme-to-json": "3.3.1", diff --git a/src/dev/build/build_distributables.js b/src/dev/build/build_distributables.js index 2a121429fd2d1..74ab840b2b523 100644 --- a/src/dev/build/build_distributables.js +++ b/src/dev/build/build_distributables.js @@ -22,6 +22,7 @@ import { getConfig, createRunner } from './lib'; import { BootstrapTask, BuildPackagesTask, + CleanEmptyFoldersTask, CleanExtraBinScriptsTask, CleanExtraBrowsersTask, CleanExtraFilesFromModulesTask, @@ -38,7 +39,7 @@ import { CreatePackageJsonTask, CreateReadmeTask, CreateRpmPackageTask, - CreateStaticFilesystem, + CreateStaticModulesFsTask, DownloadNodeBuildsTask, ExtractNodeBuildsTask, InstallDependenciesTask, @@ -114,7 +115,8 @@ export async function buildDistributables(options) { await run(TranspileScssTask); await run(CleanExtraFilesFromModulesTask); await run(OptimizeBuildTask); - await run(CreateStaticFilesystem); + await run(CleanEmptyFoldersTask); + await run(CreateStaticModulesFsTask); /** * copy generic build outputs into platform-specific build diff --git a/src/dev/build/lib/fs.js b/src/dev/build/lib/fs.js index 1c19a68d7136a..609c7cb45bb78 100644 --- a/src/dev/build/lib/fs.js +++ b/src/dev/build/lib/fs.js @@ -27,6 +27,7 @@ import vfs from 'vinyl-fs'; import { promisify } from 'bluebird'; import mkdirpCb from 'mkdirp'; import del from 'del'; +import deleteEmpty from 'delete-empty'; import { createPromiseFromStreams, createMapStream } from '../../../utils'; import { Extract } from 'tar'; @@ -112,6 +113,20 @@ export async function deleteAll(log, patterns) { log.verbose('Deleted:', longInspect(files)); } +export async function deleteEmptyFolders(log, rootFolderPath) { + if (typeof rootFolderPath !== 'string') { + throw new TypeError('Expected root folder to be a string path'); + } + + log.debug('Deleting all empty folders and their children recursively starting on ', rootFolderPath); + + assertAbsolute(rootFolderPath.startsWith('!') ? rootFolderPath.slice(1) : rootFolderPath); + const deletedEmptyFolders = await deleteEmpty(rootFolderPath); + + log.debug('Deleted %d empty folders', deletedEmptyFolders.length); + log.verbose('Deleted:', longInspect(deletedEmptyFolders)); +} + export async function copyAll(sourceDir, destination, options = {}) { const { select = ['**/*'], diff --git a/src/dev/build/lib/index.js b/src/dev/build/lib/index.js index bf7388417ecf8..b2e0f6c453e41 100644 --- a/src/dev/build/lib/index.js +++ b/src/dev/build/lib/index.js @@ -30,4 +30,5 @@ export { getFileHash, untar, deleteAll, + deleteEmptyFolders } from './fs'; diff --git a/src/dev/build/tasks/clean_tasks.js b/src/dev/build/tasks/clean_tasks.js index a2f2cb07d4af7..83f6287ba9fc5 100644 --- a/src/dev/build/tasks/clean_tasks.js +++ b/src/dev/build/tasks/clean_tasks.js @@ -17,7 +17,7 @@ * under the License. */ -import { deleteAll } from '../lib'; +import { deleteAll, deleteEmptyFolders } from '../lib'; export const CleanTask = { global: true, @@ -213,3 +213,12 @@ export const CleanExtraBrowsersTask = { } }, }; + +export const CleanEmptyFoldersTask = { + global: true, + description: 'Cleaning all empty folders recursively', + + async run(config, log, build) { + await deleteEmptyFolders(log, build.resolvePath('.')); + }, +}; diff --git a/src/dev/build/tasks/create_static_fs_task.js b/src/dev/build/tasks/create_static_fs_task.js deleted file mode 100644 index 3af90a6b44845..0000000000000 --- a/src/dev/build/tasks/create_static_fs_task.js +++ /dev/null @@ -1,109 +0,0 @@ -/* - * 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. - */ - -import { deleteAll } from '../lib'; -import { dirname, relative } from 'path'; -import { StaticFilesystemCreator } from 'static-fs/dist/main'; -import { calculateHash, isFile, mkdir, writeFile, copyFile, readFile } from 'static-fs/dist/lib/common'; - -export const CreateStaticFilesystem = { - description: - 'Creating StaticModulesFs and patching entryPoints', - - async run(config, log, build) { - const createLoaderFile = async (filePath) => { - const sourceFile = require.resolve(`static-fs/dist/lib/static-loader`); - await copyFile(sourceFile, filePath); - }; - - const patchEntryPoints = async (entryPoints, staticModulesLoader, staticModulesFs) => { - for (const each of entryPoints) { - const entrypoint = require.resolve(build.resolvePath(each)); - - if (await isFile(entrypoint)) { - let loaderPath = relative(dirname(entrypoint), staticModulesLoader).replace(/\\/g, '/'); - if (loaderPath.charAt(0) !== '.') { - loaderPath = `./${loaderPath}`; - } - let fsPath = relative(dirname(entrypoint), staticModulesFs).replace(/\\/g, '/'); - fsPath = `\${__dirname }/${fsPath}`; - let content = await readFile(entrypoint, { encoding: 'utf8' }); - const patchLine = `require('${loaderPath}').load(require.resolve(\`${fsPath}\`));\n`; - let prefix = ''; - if (content.indexOf(patchLine) === -1) { - const rx = /^#!.*$/gm.exec(content.toString()); - if (rx && rx.index === 0) { - prefix = `${rx[0]}\n`; - // remove prefix - content = content.replace(prefix, ''); - } - // strip existing loader - content = content.replace(/^require.*static-loader.js.*$/gm, ''); - content = content.replace(/\/\/ load static module: .*$/gm, ''); - content = content.trim(); - content = `${prefix}// load static module: ${fsPath}\n${patchLine}\n${content}`; - - await writeFile(entrypoint, content); - } - } - } - }; - - const addModulesToStaticModulesFs = async (nodeModulesDir, staticModulesFs, hash) => { - const sf = new StaticFilesystemCreator(); - - await sf.addFolder(nodeModulesDir, '/node_modules'); - await mkdir(dirname(staticModulesFs)); - await sf.write(staticModulesFs, hash); - }; - - const generateServerBundle = async () => { - const nodeModulesDir = build.resolvePath('node_modules'); - const staticModulesDir = build.resolvePath('static_modules'); - const staticModulesFs = build.resolvePath(staticModulesDir, 'static_modules.fs'); - const staticModulesLoader = build.resolvePath(staticModulesDir, 'static_loader.js'); - const entryPointsToPatch = [ - 'src/setup_node_env/babel_register' - ]; - - const hash = calculateHash({ - staticModulesDir, - staticModulesFs, - staticModulesLoader, - entryPointsToPatch - }); - - await createLoaderFile(staticModulesLoader); - await patchEntryPoints(entryPointsToPatch, staticModulesLoader, staticModulesFs); - await addModulesToStaticModulesFs(nodeModulesDir, staticModulesFs, hash); - }; - - await generateServerBundle(); - - // Delete node_modules folder - const nodeModulesDir = build.resolvePath('node_modules'); - - await deleteAll( - log, - [ - `${nodeModulesDir}/**` - ] - ); - } -}; diff --git a/src/dev/build/tasks/create_static_modules_fs_task.js b/src/dev/build/tasks/create_static_modules_fs_task.js new file mode 100644 index 0000000000000..c32e268c2f0b1 --- /dev/null +++ b/src/dev/build/tasks/create_static_modules_fs_task.js @@ -0,0 +1,116 @@ +/* + * 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. + */ + +import { deleteAll } from '../lib'; +import { dirname, relative } from 'path'; +import { StaticFilesystemCreator } from 'static-fs/dist/main'; +import { calculateHash, isFile, mkdir, writeFile, copyFile, readFile } from 'static-fs/dist/lib/common'; + +// Creates a static-fs loader in our final build +const createLoaderFile = async (filePath) => { + const sourceFile = require.resolve(`static-fs/dist/lib/static-loader`); + await copyFile(sourceFile, filePath); +}; + +// Patches our final build node entry points in order +// to make the server code able to read the node_modules +// from ours static modules fs +const patchEntryPoints = async (build, entryPoints, staticModulesLoader, staticModulesFs) => { + for (const each of entryPoints) { + const entryPoint = require.resolve(build.resolvePath(each)); + const isEntryPointAFile = await isFile(entryPoint); + + if (isEntryPointAFile) { + let loaderPath = relative(dirname(entryPoint), staticModulesLoader).replace(/\\/g, '/'); + if (loaderPath.charAt(0) !== '.') { + loaderPath = `./${loaderPath}`; + } + let fsPath = relative(dirname(entryPoint), staticModulesFs).replace(/\\/g, '/'); + fsPath = `\${__dirname }/${fsPath}`; + let content = await readFile(entryPoint, { encoding: 'utf8' }); + const patchLine = `require('${loaderPath}').load(require.resolve(\`${fsPath}\`));\n`; + let prefix = ''; + if (content.indexOf(patchLine) === -1) { + const rx = /^#!.*$/gm.exec(content.toString()); + if (rx && rx.index === 0) { + prefix = `${rx[0]}\n`; + // remove prefix + content = content.replace(prefix, ''); + } + // strip existing loader + content = content.replace(/^require.*static-loader.js.*$/gm, ''); + content = content.replace(/\/\/ load static module: .*$/gm, ''); + content = content.trim(); + content = `${prefix}// load static module: ${fsPath}\n${patchLine}\n${content}`; + + await writeFile(entryPoint, content); + } + } + } +}; + +// Moves our node_modules to inside our static filesystem +const addModulesToStaticModulesFs = async (nodeModulesDir, staticModulesFs, hash) => { + const sf = new StaticFilesystemCreator(); + + await sf.addFolder(nodeModulesDir, '/node_modules'); + await mkdir(dirname(staticModulesFs)); + await sf.write(staticModulesFs, hash); +}; + +// Generates the entire static modules file system +const generateStaticModulesFs = async (build) => { + const nodeModulesDir = build.resolvePath('node_modules'); + const staticModulesDir = build.resolvePath('static_modules'); + const staticModulesFs = build.resolvePath(staticModulesDir, 'static_modules.fs'); + const staticModulesLoader = build.resolvePath(staticModulesDir, 'static_loader.js'); + const entryPointsToPatch = [ + 'src/setup_node_env/babel_register' + ]; + + const hash = calculateHash({ + staticModulesDir, + staticModulesFs, + staticModulesLoader, + entryPointsToPatch + }); + + await createLoaderFile(staticModulesLoader); + await patchEntryPoints(build, entryPointsToPatch, staticModulesLoader, staticModulesFs); + await addModulesToStaticModulesFs(nodeModulesDir, staticModulesFs, hash); +}; + +export const CreateStaticModulesFsTask = { + description: + 'Creating static filesystem with node_modules, patching entryPoints and deleting node_modules folder', + + async run(config, log, build) { + // Creates the static filesystem with + // every node_module we have + await generateStaticModulesFs(build); + + // Delete node_modules folder + await deleteAll( + log, + [ + `${build.resolvePath('node_modules')}/**` + ] + ); + } +}; diff --git a/src/dev/build/tasks/index.js b/src/dev/build/tasks/index.js index e4bb062b4ee35..4a1f36fde0287 100644 --- a/src/dev/build/tasks/index.js +++ b/src/dev/build/tasks/index.js @@ -26,7 +26,7 @@ export * from './create_archives_task'; export * from './create_empty_dirs_and_files_task'; export * from './create_package_json_task'; export * from './create_readme_task'; -export * from './create_static_fs_task'; +export * from './create_static_modules_fs_task'; export * from './install_dependencies_task'; export * from './license_file_task'; export * from './nodejs'; diff --git a/yarn.lock b/yarn.lock index 4549f54e550ec..4b313b4ff0fe9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -809,6 +809,12 @@ ansi-escapes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92" +ansi-green@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ansi-green/-/ansi-green-0.1.1.tgz#8a5d9a979e458d57c40e33580b37390b8e10d0f7" + dependencies: + ansi-wrap "0.1.0" + ansi-regex@^0.2.0, ansi-regex@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-0.2.1.tgz#0d8e946967a3d8143f93e24e298525fc1b2235f9" @@ -835,7 +841,7 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -ansi-wrap@^0.1.0: +ansi-wrap@0.1.0, ansi-wrap@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" @@ -3942,6 +3948,14 @@ delegates@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" +delete-empty@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/delete-empty/-/delete-empty-2.0.0.tgz#dcf7c4f93a98445119acd57b137d13e7af78fa39" + dependencies: + log-ok "^0.1.1" + relative "^3.0.2" + rimraf "^2.6.2" + depd@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359" @@ -8535,6 +8549,13 @@ lodash@~4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.3.0.tgz#efd9c4a6ec53f3b05412429915c3e4824e4d25a4" +log-ok@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/log-ok/-/log-ok-0.1.1.tgz#bea3dd36acd0b8a7240d78736b5b97c65444a334" + dependencies: + ansi-green "^0.1.1" + success-symbol "^0.1.0" + log-symbols@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" @@ -11418,6 +11439,12 @@ regression@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/regression/-/regression-2.0.0.tgz#0f23e4012f0a4c2b5ef828b4f4b4e39f72dfb96a" +relative@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/relative/-/relative-3.0.2.tgz#0dcd8ec54a5d35a3c15e104503d65375b5a5367f" + dependencies: + isobject "^2.0.0" + remark-parse@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-5.0.0.tgz#4c077f9e499044d1d5c13f80d7a98cf7b9285d95" @@ -12699,6 +12726,10 @@ subtext@6.x.x: pez "4.x.x" wreck "14.x.x" +success-symbol@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/success-symbol/-/success-symbol-0.1.0.tgz#24022e486f3bf1cdca094283b769c472d3b72897" + suffix@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/suffix/-/suffix-0.1.1.tgz#cc58231646a0ef1102f79478ef3a9248fd9c842f" From 635d82fa063e4045c8c4c920c4ef132d0b9af30c Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 22 Aug 2018 21:58:59 +0100 Subject: [PATCH 12/60] fix(NA): remove global from clean empty folders task. --- src/dev/build/tasks/clean_tasks.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/dev/build/tasks/clean_tasks.js b/src/dev/build/tasks/clean_tasks.js index 83f6287ba9fc5..a69bdfe041e65 100644 --- a/src/dev/build/tasks/clean_tasks.js +++ b/src/dev/build/tasks/clean_tasks.js @@ -215,7 +215,6 @@ export const CleanExtraBrowsersTask = { }; export const CleanEmptyFoldersTask = { - global: true, description: 'Cleaning all empty folders recursively', async run(config, log, build) { From 112f3ec66498edad78034e22a494a85ad3f6deac Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 15 May 2019 14:57:37 -0400 Subject: [PATCH 13/60] chore(NA): change args order for deleteAll. --- src/dev/build/tasks/create_static_modules_fs_task.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dev/build/tasks/create_static_modules_fs_task.js b/src/dev/build/tasks/create_static_modules_fs_task.js index c32e268c2f0b1..91366a6e52707 100644 --- a/src/dev/build/tasks/create_static_modules_fs_task.js +++ b/src/dev/build/tasks/create_static_modules_fs_task.js @@ -107,10 +107,10 @@ export const CreateStaticModulesFsTask = { // Delete node_modules folder await deleteAll( - log, [ `${build.resolvePath('node_modules')}/**` - ] + ], + log ); } }; From ce1ba90466fce51557c6d45ad24742f9dc391132 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 19 Jun 2019 15:32:40 +0100 Subject: [PATCH 14/60] chore(NA): move to the new static fs --- package.json | 2 +- .../tasks/create_static_modules_fs_task.js | 92 +++---------------- yarn.lock | 6 +- 3 files changed, 18 insertions(+), 82 deletions(-) diff --git a/package.json b/package.json index fad0aa1a7180f..acbd5b252aa8e 100644 --- a/package.json +++ b/package.json @@ -421,7 +421,7 @@ "selenium-webdriver": "^4.0.0-alpha.1", "simple-git": "1.37.0", "sinon": "^7.2.2", - "static-fs": "git+https://git@github.com/mistic/static-fs.git#a6b132d", + "static-fs": "link:./../../projects/static-fs", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/src/dev/build/tasks/create_static_modules_fs_task.js b/src/dev/build/tasks/create_static_modules_fs_task.js index 91366a6e52707..41d180e1b72b8 100644 --- a/src/dev/build/tasks/create_static_modules_fs_task.js +++ b/src/dev/build/tasks/create_static_modules_fs_task.js @@ -18,83 +18,7 @@ */ import { deleteAll } from '../lib'; -import { dirname, relative } from 'path'; -import { StaticFilesystemCreator } from 'static-fs/dist/main'; -import { calculateHash, isFile, mkdir, writeFile, copyFile, readFile } from 'static-fs/dist/lib/common'; - -// Creates a static-fs loader in our final build -const createLoaderFile = async (filePath) => { - const sourceFile = require.resolve(`static-fs/dist/lib/static-loader`); - await copyFile(sourceFile, filePath); -}; - -// Patches our final build node entry points in order -// to make the server code able to read the node_modules -// from ours static modules fs -const patchEntryPoints = async (build, entryPoints, staticModulesLoader, staticModulesFs) => { - for (const each of entryPoints) { - const entryPoint = require.resolve(build.resolvePath(each)); - const isEntryPointAFile = await isFile(entryPoint); - - if (isEntryPointAFile) { - let loaderPath = relative(dirname(entryPoint), staticModulesLoader).replace(/\\/g, '/'); - if (loaderPath.charAt(0) !== '.') { - loaderPath = `./${loaderPath}`; - } - let fsPath = relative(dirname(entryPoint), staticModulesFs).replace(/\\/g, '/'); - fsPath = `\${__dirname }/${fsPath}`; - let content = await readFile(entryPoint, { encoding: 'utf8' }); - const patchLine = `require('${loaderPath}').load(require.resolve(\`${fsPath}\`));\n`; - let prefix = ''; - if (content.indexOf(patchLine) === -1) { - const rx = /^#!.*$/gm.exec(content.toString()); - if (rx && rx.index === 0) { - prefix = `${rx[0]}\n`; - // remove prefix - content = content.replace(prefix, ''); - } - // strip existing loader - content = content.replace(/^require.*static-loader.js.*$/gm, ''); - content = content.replace(/\/\/ load static module: .*$/gm, ''); - content = content.trim(); - content = `${prefix}// load static module: ${fsPath}\n${patchLine}\n${content}`; - - await writeFile(entryPoint, content); - } - } - } -}; - -// Moves our node_modules to inside our static filesystem -const addModulesToStaticModulesFs = async (nodeModulesDir, staticModulesFs, hash) => { - const sf = new StaticFilesystemCreator(); - - await sf.addFolder(nodeModulesDir, '/node_modules'); - await mkdir(dirname(staticModulesFs)); - await sf.write(staticModulesFs, hash); -}; - -// Generates the entire static modules file system -const generateStaticModulesFs = async (build) => { - const nodeModulesDir = build.resolvePath('node_modules'); - const staticModulesDir = build.resolvePath('static_modules'); - const staticModulesFs = build.resolvePath(staticModulesDir, 'static_modules.fs'); - const staticModulesLoader = build.resolvePath(staticModulesDir, 'static_loader.js'); - const entryPointsToPatch = [ - 'src/setup_node_env/babel_register' - ]; - - const hash = calculateHash({ - staticModulesDir, - staticModulesFs, - staticModulesLoader, - entryPointsToPatch - }); - - await createLoaderFile(staticModulesLoader); - await patchEntryPoints(build, entryPointsToPatch, staticModulesLoader, staticModulesFs); - await addModulesToStaticModulesFs(nodeModulesDir, staticModulesFs, hash); -}; +import { generateStaticFsVolume } from 'static-fs'; export const CreateStaticModulesFsTask = { description: @@ -103,7 +27,19 @@ export const CreateStaticModulesFsTask = { async run(config, log, build) { // Creates the static filesystem with // every node_module we have - await generateStaticModulesFs(build); + await generateStaticFsVolume( + build.resolvePath('.'), + build.resolvePath('static_modules'), + 'static_modules.sfs', + [ + build.resolvePath('node_modules') + ], + [ + require.resolve( + build.resolvePath('src/setup_node_env/babel_register') + ) + ] + ); // Delete node_modules folder await deleteAll( diff --git a/yarn.lock b/yarn.lock index 206194c25224e..df0936532276d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -24684,9 +24684,9 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -"static-fs@git+https://git@github.com/mistic/static-fs.git#a6b132d": - version "0.0.1" - resolved "git+https://git@github.com/mistic/static-fs.git#a6b132d3b6224811de4bdb77611d4fec7e114f11" +"static-fs@link:../../projects/static-fs": + version "0.0.0" + uid "" static-module@^1.1.0: version "1.5.0" From c87057db070416488aaf3cd2fac5c0e8c777ff7f Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 1 Jul 2019 14:59:23 +0100 Subject: [PATCH 15/60] feat(NA): migrate to last apis of static fs --- src/dev/build/build_distributables.js | 4 ++-- ..._fs_task.js => create_static_fs_with_node_modules_task.js} | 4 +--- src/dev/build/tasks/index.js | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) rename src/dev/build/tasks/{create_static_modules_fs_task.js => create_static_fs_with_node_modules_task.js} (92%) diff --git a/src/dev/build/build_distributables.js b/src/dev/build/build_distributables.js index 2db45c82773d5..bfb36223b45cb 100644 --- a/src/dev/build/build_distributables.js +++ b/src/dev/build/build_distributables.js @@ -40,7 +40,7 @@ import { CreatePackageJsonTask, CreateReadmeTask, CreateRpmPackageTask, - CreateStaticModulesFsTask, + CreateStaticFsWithNodeModulesTask, DownloadNodeBuildsTask, ExtractNodeBuildsTask, InstallDependenciesTask, @@ -125,7 +125,7 @@ export async function buildDistributables(options) { await run(CleanTypescriptTask); await run(CleanExtraFilesFromModulesTask); await run(CleanEmptyFoldersTask); - await run(CreateStaticModulesFsTask); + await run(CreateStaticFsWithNodeModulesTask); /** * copy generic build outputs into platform-specific build diff --git a/src/dev/build/tasks/create_static_modules_fs_task.js b/src/dev/build/tasks/create_static_fs_with_node_modules_task.js similarity index 92% rename from src/dev/build/tasks/create_static_modules_fs_task.js rename to src/dev/build/tasks/create_static_fs_with_node_modules_task.js index 41d180e1b72b8..833136587af46 100644 --- a/src/dev/build/tasks/create_static_modules_fs_task.js +++ b/src/dev/build/tasks/create_static_fs_with_node_modules_task.js @@ -20,7 +20,7 @@ import { deleteAll } from '../lib'; import { generateStaticFsVolume } from 'static-fs'; -export const CreateStaticModulesFsTask = { +export const CreateStaticFsWithNodeModulesTask = { description: 'Creating static filesystem with node_modules, patching entryPoints and deleting node_modules folder', @@ -29,8 +29,6 @@ export const CreateStaticModulesFsTask = { // every node_module we have await generateStaticFsVolume( build.resolvePath('.'), - build.resolvePath('static_modules'), - 'static_modules.sfs', [ build.resolvePath('node_modules') ], diff --git a/src/dev/build/tasks/index.js b/src/dev/build/tasks/index.js index 9de21fd896d11..a7a79f758f71d 100644 --- a/src/dev/build/tasks/index.js +++ b/src/dev/build/tasks/index.js @@ -25,7 +25,7 @@ export * from './create_archives_task'; export * from './create_empty_dirs_and_files_task'; export * from './create_package_json_task'; export * from './create_readme_task'; -export * from './create_static_modules_fs_task'; +export * from './create_static_fs_with_node_modules_task'; export * from './install_dependencies_task'; export * from './license_file_task'; export * from './nodejs'; From 5d769c30744af9b45eba18420c6d570ff982f2fe Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 1 Jul 2019 21:25:34 +0100 Subject: [PATCH 16/60] fix(NA): patch correct entry file. --- src/dev/build/tasks/create_static_fs_with_node_modules_task.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dev/build/tasks/create_static_fs_with_node_modules_task.js b/src/dev/build/tasks/create_static_fs_with_node_modules_task.js index 833136587af46..628632a7ccaa4 100644 --- a/src/dev/build/tasks/create_static_fs_with_node_modules_task.js +++ b/src/dev/build/tasks/create_static_fs_with_node_modules_task.js @@ -34,7 +34,7 @@ export const CreateStaticFsWithNodeModulesTask = { ], [ require.resolve( - build.resolvePath('src/setup_node_env/babel_register') + build.resolvePath('src/setup_node_env') ) ] ); From b8e5cfdcb98a27c708ea58be2223c4b5b5b53a35 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 7 Aug 2019 04:52:37 +0100 Subject: [PATCH 17/60] chore(NA): last stable integration with static-fs task --- ...create_static_fs_with_node_modules_task.js | 61 +++++++++++++------ 1 file changed, 44 insertions(+), 17 deletions(-) diff --git a/src/dev/build/tasks/create_static_fs_with_node_modules_task.js b/src/dev/build/tasks/create_static_fs_with_node_modules_task.js index 628632a7ccaa4..f8c80f2ab5f5a 100644 --- a/src/dev/build/tasks/create_static_fs_with_node_modules_task.js +++ b/src/dev/build/tasks/create_static_fs_with_node_modules_task.js @@ -17,34 +17,61 @@ * under the License. */ -import { deleteAll } from '../lib'; +import globby from 'globby'; +import normalizePath from 'normalize-path'; +import rimraf from 'rimraf'; +import { resolve } from 'path'; import { generateStaticFsVolume } from 'static-fs'; +import { promisify } from 'util'; + +const asyncRimRaf = promisify(rimraf); + +async function deletePathsList(list) { + // return Promise.all(list.map(async path => await asyncRimRaf(path, { glob: false }))); + + for (const path of list) { + await asyncRimRaf(path, { glob: false }); + } +} + +async function getTopLevelNodeModulesFolders(rootDir) { + const nodeModulesFoldersForCwd = await globby([ + '**/node_modules', + '!**/node_modules/**/node_modules' + ], { + cwd: rootDir, + onlyDirectories: true + }); + + return nodeModulesFoldersForCwd.map(folder => normalizePath(resolve(rootDir, folder))); +} export const CreateStaticFsWithNodeModulesTask = { description: 'Creating static filesystem with node_modules, patching entryPoints and deleting node_modules folder', async run(config, log, build) { + const rootDir = build.resolvePath('.'); + + // Get all the top node_modules folders + const nodeModulesFolders = await getTopLevelNodeModulesFolders(rootDir); + + // Define root entry points + const rootEntryPoints = [ + require.resolve( + build.resolvePath('src/setup_node_env') + ) + ]; + // Creates the static filesystem with // every node_module we have - await generateStaticFsVolume( - build.resolvePath('.'), - [ - build.resolvePath('node_modules') - ], - [ - require.resolve( - build.resolvePath('src/setup_node_env') - ) - ] + const staticFsAddedPaths = await generateStaticFsVolume( + rootDir, + nodeModulesFolders, + rootEntryPoints ); // Delete node_modules folder - await deleteAll( - [ - `${build.resolvePath('node_modules')}/**` - ], - log - ); + await deletePathsList(staticFsAddedPaths); } }; From b0bf35e60a3ce946074ab3fb2de7a28b2741b377 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 7 Aug 2019 05:17:29 +0100 Subject: [PATCH 18/60] chore(NA): rollback some unecessary changes --- src/dev/build/tasks/clean_tasks.js | 2 ++ .../create_static_fs_with_node_modules_task.js | 2 -- webpackShims/ace.js | 2 +- webpackShims/angular.js | 2 +- webpackShims/jquery.js | 2 +- webpackShims/leaflet.js | 14 +++++++------- webpackShims/mocha.js | 2 +- webpackShims/moment-timezone.js | 4 ++-- webpackShims/moment.js | 2 +- webpackShims/sinon.js | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/dev/build/tasks/clean_tasks.js b/src/dev/build/tasks/clean_tasks.js index 5d56f70505f1a..e5c52f663d056 100644 --- a/src/dev/build/tasks/clean_tasks.js +++ b/src/dev/build/tasks/clean_tasks.js @@ -16,7 +16,9 @@ * specific language governing permissions and limitations * under the License. */ + import minimatch from 'minimatch'; + import { deleteAll, deleteEmptyFolders, scanDelete } from '../lib'; import { resolve } from 'path'; diff --git a/src/dev/build/tasks/create_static_fs_with_node_modules_task.js b/src/dev/build/tasks/create_static_fs_with_node_modules_task.js index f8c80f2ab5f5a..0e0396f989d8b 100644 --- a/src/dev/build/tasks/create_static_fs_with_node_modules_task.js +++ b/src/dev/build/tasks/create_static_fs_with_node_modules_task.js @@ -27,8 +27,6 @@ import { promisify } from 'util'; const asyncRimRaf = promisify(rimraf); async function deletePathsList(list) { - // return Promise.all(list.map(async path => await asyncRimRaf(path, { glob: false }))); - for (const path of list) { await asyncRimRaf(path, { glob: false }); } diff --git a/webpackShims/ace.js b/webpackShims/ace.js index 0cd8f45ecb104..61f319be574dd 100644 --- a/webpackShims/ace.js +++ b/webpackShims/ace.js @@ -19,6 +19,6 @@ require('brace'); require('brace/mode/json'); -require('@elastic/ui-ace/ui-ace'); +require('../node_modules/@elastic/ui-ace/ui-ace'); module.exports = window.ace; diff --git a/webpackShims/angular.js b/webpackShims/angular.js index 08ac8440f82af..4857f0f8975bc 100644 --- a/webpackShims/angular.js +++ b/webpackShims/angular.js @@ -18,5 +18,5 @@ */ require('jquery'); -require('angular/angular'); +require('../node_modules/angular/angular'); module.exports = window.angular; diff --git a/webpackShims/jquery.js b/webpackShims/jquery.js index 5ad47839d70b2..da81dd18cf71e 100644 --- a/webpackShims/jquery.js +++ b/webpackShims/jquery.js @@ -17,4 +17,4 @@ * under the License. */ -window.jQuery = window.$ = module.exports = require('jquery/dist/jquery'); +window.jQuery = window.$ = module.exports = require('../node_modules/jquery/dist/jquery'); diff --git a/webpackShims/leaflet.js b/webpackShims/leaflet.js index aa1a1e0537b5e..c35076e129533 100644 --- a/webpackShims/leaflet.js +++ b/webpackShims/leaflet.js @@ -17,15 +17,15 @@ * under the License. */ -require('leaflet/dist/leaflet.css'); -window.L = module.exports = require('leaflet/dist/leaflet'); +require('../node_modules/leaflet/dist/leaflet.css'); +window.L = module.exports = require('../node_modules/leaflet/dist/leaflet'); window.L.Browser.touch = false; window.L.Browser.pointer = false; -require('leaflet.heat/dist/leaflet-heat.js'); +require('../node_modules/leaflet.heat/dist/leaflet-heat.js'); -require('leaflet-draw/dist/leaflet.draw.css'); -require('leaflet-draw/dist/leaflet.draw.js'); +require('../node_modules/leaflet-draw/dist/leaflet.draw.css'); +require('../node_modules/leaflet-draw/dist/leaflet.draw.js'); -require('leaflet-responsive-popup/leaflet.responsive.popup.css'); -require('leaflet-responsive-popup/leaflet.responsive.popup.js'); +require('../node_modules/leaflet-responsive-popup/leaflet.responsive.popup.css'); +require('../node_modules/leaflet-responsive-popup/leaflet.responsive.popup.js'); diff --git a/webpackShims/mocha.js b/webpackShims/mocha.js index 0ef77e906ec39..9ab12381b643c 100644 --- a/webpackShims/mocha.js +++ b/webpackShims/mocha.js @@ -17,4 +17,4 @@ * under the License. */ -module.exports = require('mocha/mocha.js'); +module.exports = require('../node_modules/mocha/mocha.js'); diff --git a/webpackShims/moment-timezone.js b/webpackShims/moment-timezone.js index 5933bffde6b19..91bcc0cd1391c 100644 --- a/webpackShims/moment-timezone.js +++ b/webpackShims/moment-timezone.js @@ -17,5 +17,5 @@ * under the License. */ -var moment = module.exports = require('moment-timezone/moment-timezone'); -moment.tz.load(require('moment-timezone/data/packed/latest.json')); +var moment = module.exports = require('../node_modules/moment-timezone/moment-timezone'); +moment.tz.load(require('../node_modules/moment-timezone/data/packed/latest.json')); diff --git a/webpackShims/moment.js b/webpackShims/moment.js index dc75bb55faab8..31476d18c9562 100644 --- a/webpackShims/moment.js +++ b/webpackShims/moment.js @@ -17,4 +17,4 @@ * under the License. */ -module.exports = require('moment/min/moment-with-locales.min.js'); +module.exports = require('../node_modules/moment/min/moment-with-locales.min.js'); diff --git a/webpackShims/sinon.js b/webpackShims/sinon.js index 72a0d998333d4..cb7737d5a9aab 100644 --- a/webpackShims/sinon.js +++ b/webpackShims/sinon.js @@ -17,5 +17,5 @@ * under the License. */ -require('script-loader!sinon/pkg/sinon.js'); +require('../node_modules/script-loader!sinon/pkg/sinon.js'); module.exports = window.sinon; From b81b1cc5b3c95db874faffcdb52bced8410ca82d Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 14 Aug 2019 01:12:53 +0100 Subject: [PATCH 19/60] chore(NA): remove changes on sinon webpackshim --- webpackShims/sinon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpackShims/sinon.js b/webpackShims/sinon.js index cb7737d5a9aab..e201f405fb127 100644 --- a/webpackShims/sinon.js +++ b/webpackShims/sinon.js @@ -17,5 +17,5 @@ * under the License. */ -require('../node_modules/script-loader!sinon/pkg/sinon.js'); +require('script-loader!../node_modules/sinon/pkg/sinon.js'); module.exports = window.sinon; From ef30bd9ba5b70af964d7df40a2f4217ee8cdab2b Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Fri, 23 Aug 2019 18:13:57 +0100 Subject: [PATCH 20/60] chore(NA): integrate with official static-fs version --- package.json | 2 +- yarn.lock | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b36c4e7e30b52..7d5f52bfa4a32 100644 --- a/package.json +++ b/package.json @@ -428,7 +428,7 @@ "selenium-webdriver": "^4.0.0-alpha.4", "simple-git": "1.116.0", "sinon": "^7.2.2", - "static-fs": "link:./../../projects/static-fs", + "static-fs": "1.0.0", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 50fcbd37d5620..f4cf693e36f17 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25721,9 +25721,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -"static-fs@link:../../projects/static-fs": - version "0.0.0" - uid "" +static-fs@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.0.0.tgz#331ad0fe902fb8e4d16187254b460b53ba739bd5" + integrity sha512-YR0BZQ46QDapA3s89QpJqz4O16Ip7KQ5+0MlzSD0j6XMfOO45/qsUdkxR9brsuFJZ40BGgG3zIn+fGP7n9KvRQ== static-module@^1.1.0: version "1.5.0" From 05a5e8e5bffb231a51c99ecab1d8b830a55cc7e3 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sat, 24 Aug 2019 04:25:17 +0100 Subject: [PATCH 21/60] chore(NA): integrate last thread-loader version --- package.json | 2 +- src/optimize/base_optimizer.js | 4 +--- yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 7d5f52bfa4a32..98eca57f82b6f 100644 --- a/package.json +++ b/package.json @@ -235,7 +235,7 @@ "symbol-observable": "^1.2.0", "tar": "4.4.10", "terser-webpack-plugin": "^1.1.0", - "thread-loader": "^2.1.2", + "thread-loader": "^2.1.3", "tinygradient": "0.4.3", "tinymath": "1.2.1", "topojson-client": "3.0.0", diff --git a/src/optimize/base_optimizer.js b/src/optimize/base_optimizer.js index 99e57f007efff..a9e36ba067c04 100644 --- a/src/optimize/base_optimizer.js +++ b/src/optimize/base_optimizer.js @@ -158,9 +158,7 @@ export default class BaseOptimizer { getThreadLoaderPoolConfig() { // Calculate the node options from the NODE_OPTIONS env var const parsedNodeOptions = process.env.NODE_OPTIONS - // thread-loader could not receive empty string as options - // or it would break that's why we need to filter here - ? process.env.NODE_OPTIONS.split(/\s/).filter(opt => !!opt) + ? process.env.NODE_OPTIONS.split(/\s/) : []; return { diff --git a/yarn.lock b/yarn.lock index f4cf693e36f17..2c305e56f8123 100644 --- a/yarn.lock +++ b/yarn.lock @@ -26693,10 +26693,10 @@ thenify-all@^1.0.0: dependencies: any-promise "^1.0.0" -thread-loader@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/thread-loader/-/thread-loader-2.1.2.tgz#f585dd38e852c7f9cded5d092992108148f5eb30" - integrity sha512-7xpuc9Ifg6WU+QYw/8uUqNdRwMD+N5gjwHKMqETrs96Qn+7BHwECpt2Brzr4HFlf4IAkZsayNhmGdbkBsTJ//w== +thread-loader@^2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/thread-loader/-/thread-loader-2.1.3.tgz#cbd2c139fc2b2de6e9d28f62286ab770c1acbdda" + integrity sha512-wNrVKH2Lcf8ZrWxDF/khdlLlsTMczdcwPA9VEK4c2exlEPynYWxi9op3nPTo5lAnDIkE0rQEB3VBP+4Zncc9Hg== dependencies: loader-runner "^2.3.1" loader-utils "^1.1.0" From c508c246b598114d1b497d4939a3c519da795acc Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sat, 24 Aug 2019 04:44:18 +0100 Subject: [PATCH 22/60] chore(NA): added last static-fs version --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 54c5be7422bb8..ae02852af16f2 100644 --- a/package.json +++ b/package.json @@ -428,7 +428,7 @@ "selenium-webdriver": "^4.0.0-alpha.4", "simple-git": "1.116.0", "sinon": "^7.2.2", - "static-fs": "1.0.0", + "static-fs": "1.0.1", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 58ac418b2c7f7..02f75d48e7230 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25732,10 +25732,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.0.0.tgz#331ad0fe902fb8e4d16187254b460b53ba739bd5" - integrity sha512-YR0BZQ46QDapA3s89QpJqz4O16Ip7KQ5+0MlzSD0j6XMfOO45/qsUdkxR9brsuFJZ40BGgG3zIn+fGP7n9KvRQ== +static-fs@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.0.1.tgz#f48b142d8b5517d77e13258e85c25348b519d78f" + integrity sha512-Um5VBxe9U1F8depTWLvr7O0b6mn+YorVrSvC+m1e9XNTQOa1qyAnXZQpcilMw0U7TknCN2Zw6EJqGzRsX960RQ== static-module@^1.1.0: version "1.5.0" From 71b1d3f9e548190e249029f927a0eaf5bc96329b Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 27 Aug 2019 04:28:55 +0100 Subject: [PATCH 23/60] chore(NA): upgrade to last static-fs version --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f9427e9350f0b..eb07ea3176bf5 100644 --- a/package.json +++ b/package.json @@ -430,7 +430,7 @@ "selenium-webdriver": "^4.0.0-alpha.4", "simple-git": "1.116.0", "sinon": "^7.2.2", - "static-fs": "1.0.1", + "static-fs": "1.0.2", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 521c8489762f9..7996ddaa9b116 100644 --- a/yarn.lock +++ b/yarn.lock @@ -26110,10 +26110,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.0.1.tgz#f48b142d8b5517d77e13258e85c25348b519d78f" - integrity sha512-Um5VBxe9U1F8depTWLvr7O0b6mn+YorVrSvC+m1e9XNTQOa1qyAnXZQpcilMw0U7TknCN2Zw6EJqGzRsX960RQ== +static-fs@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.0.2.tgz#2158aa0432da52fc59825fd457f9971439b8e642" + integrity sha512-0nPVR61JxdSvVW5JYQpQP6sq0eKSNKVDw0Opz+jASkjpO3TMCpp58Y0l0QKou0NCS9qe94zzGNY+iZzkf0YbPQ== static-module@^1.1.0: version "1.5.0" From 72faf6d054e0f2614ac1f772ca227f2652ba7e9e Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Thu, 29 Aug 2019 08:11:48 +0100 Subject: [PATCH 24/60] chore(NA): upgrade to last static-fs version 1.1.1 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 3db459a86e292..9aa49c4d57a7e 100644 --- a/package.json +++ b/package.json @@ -431,7 +431,7 @@ "selenium-webdriver": "^4.0.0-alpha.4", "simple-git": "1.116.0", "sinon": "^7.2.2", - "static-fs": "1.0.2", + "static-fs": "1.1.1", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index b3802f94c9e23..d7367279f2910 100644 --- a/yarn.lock +++ b/yarn.lock @@ -26238,10 +26238,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.0.2.tgz#2158aa0432da52fc59825fd457f9971439b8e642" - integrity sha512-0nPVR61JxdSvVW5JYQpQP6sq0eKSNKVDw0Opz+jASkjpO3TMCpp58Y0l0QKou0NCS9qe94zzGNY+iZzkf0YbPQ== +static-fs@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.1.1.tgz#a08b11db1ccf768a06ad47fa41614f6e21d8008a" + integrity sha512-FSJibkwV9L44dt+2EpnSo/5fM2nECjgoWuC2dCR1x6dI4XGCfX0YsuZGf2nyfw3qY6npFaeb7B6nLEwPn7MSsA== static-module@^1.1.0: version "1.5.0" From f7fa66ac176ed80f22cba68ded806eec1a744444 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Thu, 29 Aug 2019 14:03:38 +0100 Subject: [PATCH 25/60] chore(NA): rever static-fs version to 1.1.0 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9aa49c4d57a7e..49fa3f0410db4 100644 --- a/package.json +++ b/package.json @@ -431,7 +431,7 @@ "selenium-webdriver": "^4.0.0-alpha.4", "simple-git": "1.116.0", "sinon": "^7.2.2", - "static-fs": "1.1.1", + "static-fs": "1.1.0", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index d7367279f2910..2ed64c09b90e4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -26238,10 +26238,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.1.1.tgz#a08b11db1ccf768a06ad47fa41614f6e21d8008a" - integrity sha512-FSJibkwV9L44dt+2EpnSo/5fM2nECjgoWuC2dCR1x6dI4XGCfX0YsuZGf2nyfw3qY6npFaeb7B6nLEwPn7MSsA== +static-fs@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.1.0.tgz#564361b4637df968b6e43196db557d88f34471e5" + integrity sha512-K8caNLBSgjBSrkEKg1ICKDKgMngXmRA8CxAzFMagqKA1wyrEOaQ+uoHDcoROZAcsD78SdYtwsPvMrQwGCnLwJA== static-module@^1.1.0: version "1.5.0" From 4bc209066ddfe8b4b39516b1d358980eff945f7e Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Thu, 29 Aug 2019 15:13:35 +0100 Subject: [PATCH 26/60] chore(NA): upgrade static-fs to 1.1.1 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 49fa3f0410db4..9aa49c4d57a7e 100644 --- a/package.json +++ b/package.json @@ -431,7 +431,7 @@ "selenium-webdriver": "^4.0.0-alpha.4", "simple-git": "1.116.0", "sinon": "^7.2.2", - "static-fs": "1.1.0", + "static-fs": "1.1.1", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 2ed64c09b90e4..d7367279f2910 100644 --- a/yarn.lock +++ b/yarn.lock @@ -26238,10 +26238,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.1.0.tgz#564361b4637df968b6e43196db557d88f34471e5" - integrity sha512-K8caNLBSgjBSrkEKg1ICKDKgMngXmRA8CxAzFMagqKA1wyrEOaQ+uoHDcoROZAcsD78SdYtwsPvMrQwGCnLwJA== +static-fs@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.1.1.tgz#a08b11db1ccf768a06ad47fa41614f6e21d8008a" + integrity sha512-FSJibkwV9L44dt+2EpnSo/5fM2nECjgoWuC2dCR1x6dI4XGCfX0YsuZGf2nyfw3qY6npFaeb7B6nLEwPn7MSsA== static-module@^1.1.0: version "1.5.0" From 35ba2e48020ccb517df73c1d03743365b567e359 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Thu, 29 Aug 2019 17:48:53 +0100 Subject: [PATCH 27/60] chore(NA): upgrade static-fs for last 1.2.0 version --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9aa49c4d57a7e..cde29a073af65 100644 --- a/package.json +++ b/package.json @@ -431,7 +431,7 @@ "selenium-webdriver": "^4.0.0-alpha.4", "simple-git": "1.116.0", "sinon": "^7.2.2", - "static-fs": "1.1.1", + "static-fs": "1.2.0", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 0fb050f7a540a..5d3d48190a543 100644 --- a/yarn.lock +++ b/yarn.lock @@ -26250,10 +26250,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.1.1.tgz#a08b11db1ccf768a06ad47fa41614f6e21d8008a" - integrity sha512-FSJibkwV9L44dt+2EpnSo/5fM2nECjgoWuC2dCR1x6dI4XGCfX0YsuZGf2nyfw3qY6npFaeb7B6nLEwPn7MSsA== +static-fs@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.2.0.tgz#0cb787b3da7aff646899526d04690acb65d1be43" + integrity sha512-uQMe+dBqIrcmI8isDA4DetNZFOcWoxdQqqIGOihX8zgPsXcP15f4v8/EZjHN6vWRTVlP+MwPTCtxryOPA1JHWA== static-module@^1.1.0: version "1.5.0" From ebb14b63d585be9a36e6be2047a429ed877f1b08 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 30 Oct 2019 17:12:35 +0000 Subject: [PATCH 28/60] chore(NA): update package.json --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index b93c9b230a5c8..cd94d1f81284a 100644 --- a/package.json +++ b/package.json @@ -435,6 +435,7 @@ "prettier": "^1.18.2", "proxyquire": "1.8.0", "regenerate": "^1.4.0", + "rimraf": "^3.0.0", "sass-lint": "^1.12.1", "selenium-webdriver": "^4.0.0-alpha.5", "simple-git": "1.116.0", From d0fe18619c932403674884fab2185b3e4e10ff70 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Thu, 23 Jan 2020 14:32:01 +0000 Subject: [PATCH 29/60] chore(NA): run apm after patched environment --- src/apm.js | 4 ++-- src/cli/index.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/apm.js b/src/apm.js index e3f4d84d9b523..dd75607a9fb49 100644 --- a/src/apm.js +++ b/src/apm.js @@ -20,7 +20,6 @@ const { join } = require('path'); const { readFileSync } = require('fs'); const { execSync } = require('child_process'); -const merge = require('lodash.merge'); const { name, version, build } = require('../package.json'); const ROOT_DIR = join(__dirname, '..'); @@ -45,7 +44,8 @@ function devConfig() { } } -const apmConfig = merge( +// eslint-disable-next-line +const apmConfig = Object.assign( { active: false, serverUrl: 'https://f1542b814f674090afd914960583265f.apm.us-central1.gcp.cloud.es.io:443', diff --git a/src/cli/index.js b/src/cli/index.js index 45f88eaf82a5b..6dbdd800268a9 100644 --- a/src/cli/index.js +++ b/src/cli/index.js @@ -17,6 +17,6 @@ * under the License. */ -require('../apm')(); require('../setup_node_env'); +require('../apm')(); require('./cli'); From a704e9f1d983b3dddba6443b4c3c79f4420c54d6 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Thu, 23 Jan 2020 17:11:35 +0000 Subject: [PATCH 30/60] chore(NA): specify rule to disable eslint for --- src/apm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apm.js b/src/apm.js index dd75607a9fb49..cfcd2d87a8fae 100644 --- a/src/apm.js +++ b/src/apm.js @@ -44,7 +44,7 @@ function devConfig() { } } -// eslint-disable-next-line +// eslint-disable-next-line prefer-object-spread/prefer-object-spread const apmConfig = Object.assign( { active: false, From 4a098c688d3ef0c192f05305abac3408bc430f0e Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Thu, 23 Jan 2020 17:34:11 +0000 Subject: [PATCH 31/60] chore(NA): remove changes in the src/apm file --- src/apm.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apm.js b/src/apm.js index cfcd2d87a8fae..e3f4d84d9b523 100644 --- a/src/apm.js +++ b/src/apm.js @@ -20,6 +20,7 @@ const { join } = require('path'); const { readFileSync } = require('fs'); const { execSync } = require('child_process'); +const merge = require('lodash.merge'); const { name, version, build } = require('../package.json'); const ROOT_DIR = join(__dirname, '..'); @@ -44,8 +45,7 @@ function devConfig() { } } -// eslint-disable-next-line prefer-object-spread/prefer-object-spread -const apmConfig = Object.assign( +const apmConfig = merge( { active: false, serverUrl: 'https://f1542b814f674090afd914960583265f.apm.us-central1.gcp.cloud.es.io:443', From a8edaada3cb59606e99871338d67fba922af536d Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 27 Jan 2020 14:52:41 +0000 Subject: [PATCH 32/60] chore(NA): change apm order in the dev scripts --- scripts/kibana.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kibana.js b/scripts/kibana.js index f5a63e6c07dd6..4da739469ffb1 100644 --- a/scripts/kibana.js +++ b/scripts/kibana.js @@ -17,6 +17,6 @@ * under the License. */ -require('../src/apm')(process.env.ELASTIC_APM_PROXY_SERVICE_NAME || 'kibana-proxy'); require('../src/setup_node_env'); +require('../src/apm')(process.env.ELASTIC_APM_PROXY_SERVICE_NAME || 'kibana-proxy'); require('../src/cli/cli'); From 4c2db20369819fe4a710b2522c05da8907824cd4 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 27 Jan 2020 16:40:26 +0000 Subject: [PATCH 33/60] chore(na): update static-fs versin --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6283db5f18214..13011be54bbd1 100644 --- a/package.json +++ b/package.json @@ -473,7 +473,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.2.0", + "static-fs": "1.2.1", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 06fb22f59d992..b5c921d982eb3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27498,10 +27498,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.2.0.tgz#0cb787b3da7aff646899526d04690acb65d1be43" - integrity sha512-uQMe+dBqIrcmI8isDA4DetNZFOcWoxdQqqIGOihX8zgPsXcP15f4v8/EZjHN6vWRTVlP+MwPTCtxryOPA1JHWA== +static-fs@1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.2.1.tgz#93395715eb29cc35eeb61acbd312279ff37314e5" + integrity sha512-wccaqmstvBHy+wewTiYvFMJT73Y2rhVMHqkT/GmhmyKy6EUiamY9xQ/gWdJ3L1ycqsK656q4J6blnv69N9wZ2Q== static-module@^2.2.0: version "2.2.5" From 060c6aed6b04e1f19ba27ef41a0077e4a2ac7c01 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 27 Jan 2020 19:42:07 +0000 Subject: [PATCH 34/60] chore(NA): bump static fs version --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 13011be54bbd1..6ff3591cda0e4 100644 --- a/package.json +++ b/package.json @@ -473,7 +473,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.2.1", + "static-fs": "1.2.2", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index b5c921d982eb3..69b9aa9024c49 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27498,10 +27498,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.2.1.tgz#93395715eb29cc35eeb61acbd312279ff37314e5" - integrity sha512-wccaqmstvBHy+wewTiYvFMJT73Y2rhVMHqkT/GmhmyKy6EUiamY9xQ/gWdJ3L1ycqsK656q4J6blnv69N9wZ2Q== +static-fs@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.2.2.tgz#9b1ae2f3dca932834b6e3ff0f980e73de34e87b7" + integrity sha512-LN6bkiTC8MqsWFfzOa3O44V3bFKunLTIlNWmJu8ZrujOC3CWB7eXKHCy/MOqDy4w5vL5Z6MqPudbfiNqPVTJjQ== static-module@^2.2.0: version "2.2.5" From f35f79e9f2fb6daed0d6b74975d82cbd9f36c3d2 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 27 Jan 2020 21:23:53 +0000 Subject: [PATCH 35/60] chore(NA): correctly lint task file --- ...create_static_fs_with_node_modules_task.js | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/dev/build/tasks/create_static_fs_with_node_modules_task.js b/src/dev/build/tasks/create_static_fs_with_node_modules_task.js index 0e0396f989d8b..35644e8681475 100644 --- a/src/dev/build/tasks/create_static_fs_with_node_modules_task.js +++ b/src/dev/build/tasks/create_static_fs_with_node_modules_task.js @@ -33,13 +33,13 @@ async function deletePathsList(list) { } async function getTopLevelNodeModulesFolders(rootDir) { - const nodeModulesFoldersForCwd = await globby([ - '**/node_modules', - '!**/node_modules/**/node_modules' - ], { - cwd: rootDir, - onlyDirectories: true - }); + const nodeModulesFoldersForCwd = await globby( + ['**/node_modules', '!**/node_modules/**/node_modules'], + { + cwd: rootDir, + onlyDirectories: true, + } + ); return nodeModulesFoldersForCwd.map(folder => normalizePath(resolve(rootDir, folder))); } @@ -55,11 +55,7 @@ export const CreateStaticFsWithNodeModulesTask = { const nodeModulesFolders = await getTopLevelNodeModulesFolders(rootDir); // Define root entry points - const rootEntryPoints = [ - require.resolve( - build.resolvePath('src/setup_node_env') - ) - ]; + const rootEntryPoints = [require.resolve(build.resolvePath('src/setup_node_env'))]; // Creates the static filesystem with // every node_module we have @@ -71,5 +67,5 @@ export const CreateStaticFsWithNodeModulesTask = { // Delete node_modules folder await deletePathsList(staticFsAddedPaths); - } + }, }; From 898164dc842b95ecd5243ad0ea3c306112415154 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 27 Jan 2020 22:40:08 +0000 Subject: [PATCH 36/60] chore(NA): move away from rimraf to del --- package.json | 1 - .../build/tasks/create_static_fs_with_node_modules_task.js | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 6ff3591cda0e4..093ed2a32e3c5 100644 --- a/package.json +++ b/package.json @@ -467,7 +467,6 @@ "react-popper-tooltip": "^2.10.1", "react-textarea-autosize": "^7.1.2", "regenerate": "^1.4.0", - "rimraf": "^3.0.0", "sass-lint": "^1.12.1", "selenium-webdriver": "^4.0.0-alpha.5", "simple-git": "1.116.0", diff --git a/src/dev/build/tasks/create_static_fs_with_node_modules_task.js b/src/dev/build/tasks/create_static_fs_with_node_modules_task.js index 35644e8681475..8938735984a2d 100644 --- a/src/dev/build/tasks/create_static_fs_with_node_modules_task.js +++ b/src/dev/build/tasks/create_static_fs_with_node_modules_task.js @@ -17,18 +17,15 @@ * under the License. */ +import del from 'del'; import globby from 'globby'; import normalizePath from 'normalize-path'; -import rimraf from 'rimraf'; import { resolve } from 'path'; import { generateStaticFsVolume } from 'static-fs'; -import { promisify } from 'util'; - -const asyncRimRaf = promisify(rimraf); async function deletePathsList(list) { for (const path of list) { - await asyncRimRaf(path, { glob: false }); + await del(path); } } From 8f3a2d8d83012d92464fdbebd69923c218f55b4f Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 28 Jan 2020 04:43:12 +0000 Subject: [PATCH 37/60] chore(NA): bump static-fs version --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 093ed2a32e3c5..1d016bc487749 100644 --- a/package.json +++ b/package.json @@ -472,7 +472,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.2.2", + "static-fs": "1.3.0", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 69b9aa9024c49..9e8612c59498a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27498,10 +27498,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.2.2.tgz#9b1ae2f3dca932834b6e3ff0f980e73de34e87b7" - integrity sha512-LN6bkiTC8MqsWFfzOa3O44V3bFKunLTIlNWmJu8ZrujOC3CWB7eXKHCy/MOqDy4w5vL5Z6MqPudbfiNqPVTJjQ== +static-fs@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.3.0.tgz#434fa057e5573bef479fc203478697af569c7600" + integrity sha512-86Gc/czo6iFL6BkGW7WYKKtRhmbuGgaEzMoR92pkdTwmIerSZ6lUja/IgM5sG4Ik5QB7ofTZXty2eZGPwXrC2g== static-module@^2.2.0: version "2.2.5" From 2ef72afd7f9ad0dcc3eae5b7093c28edc0c9db3e Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 29 Jan 2020 20:16:52 +0000 Subject: [PATCH 38/60] chore(NA): bump static-fs version --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 1d016bc487749..0a28380ea8dc5 100644 --- a/package.json +++ b/package.json @@ -472,7 +472,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.3.0", + "static-fs": "1.4.0", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 9e8612c59498a..da6225f656ec3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27498,10 +27498,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.3.0.tgz#434fa057e5573bef479fc203478697af569c7600" - integrity sha512-86Gc/czo6iFL6BkGW7WYKKtRhmbuGgaEzMoR92pkdTwmIerSZ6lUja/IgM5sG4Ik5QB7ofTZXty2eZGPwXrC2g== +static-fs@1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.4.0.tgz#ad7d7ca67eace03bc072af31a467830ea20dddca" + integrity sha512-CNnEoervwLRETOCQI0gFxv9J4vlhN0iANhLqDe3V0MVf3WOZaCBNqvPzKeYteSrnX/H/avy13Uf6qLeTJlWItw== static-module@^2.2.0: version "2.2.5" From 6de6906dcdbfd5cd5972dc1412501457f459ee32 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Fri, 14 Feb 2020 05:29:59 +0000 Subject: [PATCH 39/60] chore(NA): bump static-fs version --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 7071559767035..35f5d2e9363d1 100644 --- a/package.json +++ b/package.json @@ -476,7 +476,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.4.0", + "static-fs": "1.5.0", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index d82ee3990d03c..5596ac51101ec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27635,10 +27635,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.4.0.tgz#ad7d7ca67eace03bc072af31a467830ea20dddca" - integrity sha512-CNnEoervwLRETOCQI0gFxv9J4vlhN0iANhLqDe3V0MVf3WOZaCBNqvPzKeYteSrnX/H/avy13Uf6qLeTJlWItw== +static-fs@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.5.0.tgz#de3d5f9f41b7e890ded9bc3502426b704d2daf75" + integrity sha512-g1I9wMGifUg86hiRdGBKN7PmWQuS9gzWsXJnXtcUthzk9Dc8gPOhKuhnZmlREdO+P6PyTfhTx//nGBHZ/mwX+A== static-module@^2.2.0: version "2.2.5" From f0b0abd5411a8fde1ca095780432d424f7be1275 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Fri, 21 Feb 2020 05:05:04 +0000 Subject: [PATCH 40/60] chore(NA): bump static-fs version --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9b41e68cd7e74..29379fd5ff8e7 100644 --- a/package.json +++ b/package.json @@ -475,7 +475,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.5.0", + "static-fs": "1.6.0", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index fccc318190f26..6246e9758c0ee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27722,10 +27722,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.5.0.tgz#de3d5f9f41b7e890ded9bc3502426b704d2daf75" - integrity sha512-g1I9wMGifUg86hiRdGBKN7PmWQuS9gzWsXJnXtcUthzk9Dc8gPOhKuhnZmlREdO+P6PyTfhTx//nGBHZ/mwX+A== +static-fs@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.6.0.tgz#7ccee59fb74e393412bfb51f7552441f6ccd5660" + integrity sha512-KEFpj9BmJCLxE31r4RA9TeHmJKkU2h+7XWf/Qk93VYPW8+QswIaAC+GmeH/l6XZUkpvxD+QaeuVqMUtGXxjBZA== static-module@^2.2.0: version "2.2.5" From c8c8ea76663b155112ddc7b4c6a5c0f92ab4f3a6 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sat, 22 Feb 2020 00:05:24 +0000 Subject: [PATCH 41/60] chore(NA): bump to last static-fs version --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f275265546155..ccac0ab541e68 100644 --- a/package.json +++ b/package.json @@ -475,7 +475,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.6.0", + "static-fs": "1.6.1", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 035ad497494ec..8b30867b75477 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27685,10 +27685,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.6.0.tgz#7ccee59fb74e393412bfb51f7552441f6ccd5660" - integrity sha512-KEFpj9BmJCLxE31r4RA9TeHmJKkU2h+7XWf/Qk93VYPW8+QswIaAC+GmeH/l6XZUkpvxD+QaeuVqMUtGXxjBZA== +static-fs@1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.6.1.tgz#ace39a67f051236bdcd5049696f6e7f1adef6dc5" + integrity sha512-apqLROlmU5m8ymZG2dlhYM78Y/q4+jXN1gUN3kZfzBPXTNVqGuXAeFeRtHje/li106dH66tnLNb+GvIUlRxITA== static-module@^2.2.0: version "2.2.5" From 510a530e6de527bdfed38d7f5175cbb6e46b6d4e Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 24 Feb 2020 18:02:53 +0000 Subject: [PATCH 42/60] chore(NA): apply changed according PR review feedback --- .../create_static_fs_with_node_modules_task.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/dev/build/tasks/create_static_fs_with_node_modules_task.js b/src/dev/build/tasks/create_static_fs_with_node_modules_task.js index 8938735984a2d..b3116836a82e0 100644 --- a/src/dev/build/tasks/create_static_fs_with_node_modules_task.js +++ b/src/dev/build/tasks/create_static_fs_with_node_modules_task.js @@ -30,13 +30,10 @@ async function deletePathsList(list) { } async function getTopLevelNodeModulesFolders(rootDir) { - const nodeModulesFoldersForCwd = await globby( - ['**/node_modules', '!**/node_modules/**/node_modules'], - { - cwd: rootDir, - onlyDirectories: true, - } - ); + const nodeModulesFoldersForCwd = await globby(['**/node_modules', '!**/node_modules/**'], { + cwd: rootDir, + onlyDirectories: true, + }); return nodeModulesFoldersForCwd.map(folder => normalizePath(resolve(rootDir, folder))); } @@ -52,7 +49,7 @@ export const CreateStaticFsWithNodeModulesTask = { const nodeModulesFolders = await getTopLevelNodeModulesFolders(rootDir); // Define root entry points - const rootEntryPoints = [require.resolve(build.resolvePath('src/setup_node_env'))]; + const rootEntryPoints = [build.resolvePath('src/setup_node_env/index.js')]; // Creates the static filesystem with // every node_module we have From 85833d8a51ae022be5dbb645fdf4e1c7496b908e Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 24 Feb 2020 18:13:24 +0000 Subject: [PATCH 43/60] chore(NA): remove changes to base optimizer --- src/optimize/base_optimizer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/optimize/base_optimizer.js b/src/optimize/base_optimizer.js index a94f251c292f9..a833204eaa0e2 100644 --- a/src/optimize/base_optimizer.js +++ b/src/optimize/base_optimizer.js @@ -152,7 +152,11 @@ export default class BaseOptimizer { getThreadLoaderPoolConfig() { // Calculate the node options from the NODE_OPTIONS env var - const parsedNodeOptions = process.env.NODE_OPTIONS ? process.env.NODE_OPTIONS.split(/\s/) : []; + const parsedNodeOptions = process.env.NODE_OPTIONS + ? // thread-loader could not receive empty string as options + // or it would break that's why we need to filter here + process.env.NODE_OPTIONS.split(/\s/).filter(opt => !!opt) + : []; return { name: 'optimizer-thread-loader-main-pool', From f51cf967557caaebf5154c427d49008060b5b5fd Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 24 Feb 2020 21:52:13 +0000 Subject: [PATCH 44/60] chore(NA): fix discover pattern --- .../build/tasks/create_static_fs_with_node_modules_task.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/dev/build/tasks/create_static_fs_with_node_modules_task.js b/src/dev/build/tasks/create_static_fs_with_node_modules_task.js index b3116836a82e0..5427a11aa1253 100644 --- a/src/dev/build/tasks/create_static_fs_with_node_modules_task.js +++ b/src/dev/build/tasks/create_static_fs_with_node_modules_task.js @@ -19,7 +19,6 @@ import del from 'del'; import globby from 'globby'; -import normalizePath from 'normalize-path'; import { resolve } from 'path'; import { generateStaticFsVolume } from 'static-fs'; @@ -30,12 +29,12 @@ async function deletePathsList(list) { } async function getTopLevelNodeModulesFolders(rootDir) { - const nodeModulesFoldersForCwd = await globby(['**/node_modules', '!**/node_modules/**'], { + const nodeModulesFoldersForCwd = await globby(['**/node_modules', '!**/node_modules/**/*'], { cwd: rootDir, onlyDirectories: true, }); - return nodeModulesFoldersForCwd.map(folder => normalizePath(resolve(rootDir, folder))); + return nodeModulesFoldersForCwd.map(folder => resolve(rootDir, folder)); } export const CreateStaticFsWithNodeModulesTask = { From 2531e28cbce6d3f87cd912766b52b7d0793278fa Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 2 Mar 2020 11:23:10 +0000 Subject: [PATCH 45/60] chore(NA): bump static-fs version --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d87378e561377..0aef2264978bd 100644 --- a/package.json +++ b/package.json @@ -475,7 +475,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.6.1", + "static-fs": "1.6.2", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 8b7c85621cc8e..4365d206de415 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27662,10 +27662,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.6.1.tgz#ace39a67f051236bdcd5049696f6e7f1adef6dc5" - integrity sha512-apqLROlmU5m8ymZG2dlhYM78Y/q4+jXN1gUN3kZfzBPXTNVqGuXAeFeRtHje/li106dH66tnLNb+GvIUlRxITA== +static-fs@1.6.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.6.2.tgz#8e2a12cc6ef5a67d1b482e434a196e5e9ca8660e" + integrity sha512-5vjcyT7b/+6maq5CGBc9NEo9Et6KHr99jLzCYIj6pI6UzVJWvD+ErXKduzXGTntBUpRP6wqfHryy/4D9UfULtQ== static-module@^2.2.0: version "2.2.5" From 5e6fd14b7f3ec52ab0cb90dff6bd5efb6774663b Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 11 Mar 2020 18:55:28 +0000 Subject: [PATCH 46/60] chore(NA): bump static fs to 1.6.3 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 288990d08e199..ba5594c21ee28 100644 --- a/package.json +++ b/package.json @@ -476,7 +476,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.6.2", + "static-fs": "1.6.3", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 9f28639d07a17..eeb30ecca3f59 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27533,10 +27533,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.6.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.6.2.tgz#8e2a12cc6ef5a67d1b482e434a196e5e9ca8660e" - integrity sha512-5vjcyT7b/+6maq5CGBc9NEo9Et6KHr99jLzCYIj6pI6UzVJWvD+ErXKduzXGTntBUpRP6wqfHryy/4D9UfULtQ== +static-fs@1.6.3: + version "1.6.3" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.6.3.tgz#8d8e73ede424266ed0f538332a5174d28c47b101" + integrity sha512-TRyisp3MpttGc2YW67xPVcrfhYlXAyKP6p17qWo2o+N4mGcRbr7LWiJQWd8RO1j95s7oliObHq6a4EcRzNBvHQ== static-module@^2.2.0: version "2.2.5" From 4cbf000d3ba1b2c340a2363637c07ea57a83ba2d Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Thu, 12 Mar 2020 19:38:58 +0000 Subject: [PATCH 47/60] chore(NA): bump static-fs to 1.6.4 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9ce8f4d29b49e..4c0fa111d9421 100644 --- a/package.json +++ b/package.json @@ -477,7 +477,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.6.3", + "static-fs": "1.6.4", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 360a456348d3b..1ee7028bd70c2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27671,10 +27671,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.6.3: - version "1.6.3" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.6.3.tgz#8d8e73ede424266ed0f538332a5174d28c47b101" - integrity sha512-TRyisp3MpttGc2YW67xPVcrfhYlXAyKP6p17qWo2o+N4mGcRbr7LWiJQWd8RO1j95s7oliObHq6a4EcRzNBvHQ== +static-fs@1.6.4: + version "1.6.4" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.6.4.tgz#17dfa84bb7d8dccced724d8d6f10c2e7c25cd8e3" + integrity sha512-MSA2at5bc9bGJ8c0TRvfLlJYWwAv8+0lxS5mrPqmFr0goDs0LEYQtms9p8kSLyWL+QqAMc487JzDggprUwBQQg== static-module@^2.2.0: version "2.2.5" From 26c5a2eb8154505fea8252c500731ad269af51c5 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Fri, 20 Mar 2020 18:51:13 +0000 Subject: [PATCH 48/60] chore(NA): bump static-fs to last version --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 5f79c29e69aa5..2f587d816a3e2 100644 --- a/package.json +++ b/package.json @@ -480,7 +480,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.6.4", + "static-fs": "1.6.6", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 0fbeab9b61771..5295b68589678 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27722,10 +27722,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.6.4: - version "1.6.4" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.6.4.tgz#17dfa84bb7d8dccced724d8d6f10c2e7c25cd8e3" - integrity sha512-MSA2at5bc9bGJ8c0TRvfLlJYWwAv8+0lxS5mrPqmFr0goDs0LEYQtms9p8kSLyWL+QqAMc487JzDggprUwBQQg== +static-fs@1.6.6: + version "1.6.6" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.6.6.tgz#f899cc3c99257628810bc1da228842e821171701" + integrity sha512-Wr8Xn2Uvqb8XEOyg6NO/FLhAOd6oy4PIY9kNuvdX1Yf+YF6dBjsily4VdcgK7DLtijRkka9QhkGBQu8mLUvACw== static-module@^2.2.0: version "2.2.5" From 8ab60b1074386a24c27c85c3232f314606bea4ac Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sat, 21 Mar 2020 00:23:22 +0000 Subject: [PATCH 49/60] chore(NA): bump static-fs to last version --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2f587d816a3e2..814ca0fbb528e 100644 --- a/package.json +++ b/package.json @@ -480,7 +480,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.6.6", + "static-fs": "1.6.7", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 5295b68589678..4b612d6bf38b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27722,10 +27722,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.6.6: - version "1.6.6" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.6.6.tgz#f899cc3c99257628810bc1da228842e821171701" - integrity sha512-Wr8Xn2Uvqb8XEOyg6NO/FLhAOd6oy4PIY9kNuvdX1Yf+YF6dBjsily4VdcgK7DLtijRkka9QhkGBQu8mLUvACw== +static-fs@1.6.7: + version "1.6.7" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.6.7.tgz#cc646981053f7e9edad6ebf127ccf73bd9489ed0" + integrity sha512-2mFMi5MLA/A+4VBN5Ga6ISs44KE4bQvthwRMZdmcOc3zxgH/jNcrhIcuYGSqtoJXQeTQfAqwPm/LRfJlvYe73g== static-module@^2.2.0: version "2.2.5" From 8faa3df68ca0d929ef199fa4f973bf46de9b60ab Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sat, 21 Mar 2020 04:32:14 +0000 Subject: [PATCH 50/60] chore(NA): bump static-fs to last version --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 814ca0fbb528e..80b28baf75998 100644 --- a/package.json +++ b/package.json @@ -480,7 +480,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.6.7", + "static-fs": "1.7.0", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 4b612d6bf38b7..a694453edd6a8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27722,10 +27722,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.6.7: - version "1.6.7" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.6.7.tgz#cc646981053f7e9edad6ebf127ccf73bd9489ed0" - integrity sha512-2mFMi5MLA/A+4VBN5Ga6ISs44KE4bQvthwRMZdmcOc3zxgH/jNcrhIcuYGSqtoJXQeTQfAqwPm/LRfJlvYe73g== +static-fs@1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.7.0.tgz#934836735bbef49cef1bc81e8a8a35dde83c0659" + integrity sha512-R4BH+mHwz0bQtg7Gzf/6+7opLNterjGu+i6IelsMFG81RHyL64GCZd0jn+HU4Oawf1TGAHaTa4eRaq/+eosP+w== static-module@^2.2.0: version "2.2.5" From 502ecb9929657a9deef045ed90e2a70abd172e32 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sat, 21 Mar 2020 17:11:56 +0000 Subject: [PATCH 51/60] chore(NA): bump static-fs to last version --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 80b28baf75998..42d9f518074ce 100644 --- a/package.json +++ b/package.json @@ -480,7 +480,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.7.0", + "static-fs": "1.8.0", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index a694453edd6a8..71bb355cf3fe6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27722,10 +27722,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.7.0.tgz#934836735bbef49cef1bc81e8a8a35dde83c0659" - integrity sha512-R4BH+mHwz0bQtg7Gzf/6+7opLNterjGu+i6IelsMFG81RHyL64GCZd0jn+HU4Oawf1TGAHaTa4eRaq/+eosP+w== +static-fs@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.8.0.tgz#aa35692e0a1acb8bcf8a4e6df5eb63c8be7ba6d2" + integrity sha512-c1K8LqmOZudzPa3I4VSIkof/pChxoyx6aflsVktCUxrpZgsxXYmD3rNrWSkzpCneh9doKUM5QoDGGmhUVdiD0Q== static-module@^2.2.0: version "2.2.5" From 3c0fbaf8a330e70366963616bd355e6988f8f1fb Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sat, 21 Mar 2020 18:04:09 +0000 Subject: [PATCH 52/60] chore(NA): bump static-fs to last version --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 42d9f518074ce..0d38d9308d769 100644 --- a/package.json +++ b/package.json @@ -480,7 +480,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.8.0", + "static-fs": "1.8.1", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 71bb355cf3fe6..ddb39ad4719d0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27722,10 +27722,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.8.0.tgz#aa35692e0a1acb8bcf8a4e6df5eb63c8be7ba6d2" - integrity sha512-c1K8LqmOZudzPa3I4VSIkof/pChxoyx6aflsVktCUxrpZgsxXYmD3rNrWSkzpCneh9doKUM5QoDGGmhUVdiD0Q== +static-fs@1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.8.1.tgz#93dd497b3c300db1889a7ce8011bea4f2ed503d7" + integrity sha512-9nXxOZPGToVZnatuJOoU6kumHEvov7zEOnTmTUw81ezYVv9QaHQTEQy0tWb5Q6ht+52JaNRh6NjvvH7UdTs8SA== static-module@^2.2.0: version "2.2.5" From 2def2f7ee64d3d006f1ea6e4add286146c5a86eb Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sat, 21 Mar 2020 18:40:00 +0000 Subject: [PATCH 53/60] chore(NA): bump static-fs to last version --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 0d38d9308d769..456b732fe331d 100644 --- a/package.json +++ b/package.json @@ -480,7 +480,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.8.1", + "static-fs": "1.8.2", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index ddb39ad4719d0..66f762e94d3f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27722,10 +27722,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.8.1.tgz#93dd497b3c300db1889a7ce8011bea4f2ed503d7" - integrity sha512-9nXxOZPGToVZnatuJOoU6kumHEvov7zEOnTmTUw81ezYVv9QaHQTEQy0tWb5Q6ht+52JaNRh6NjvvH7UdTs8SA== +static-fs@1.8.2: + version "1.8.2" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.8.2.tgz#d00d491894273c0ee345abd77ff8c70b3e0ed499" + integrity sha512-iLEWM9f2eDNunCZ4UJaWaRrVhB4eGxV6d72zU+9JCAsTS/hCf7SnWNT6Bnfc7ltRIHyVALNOaZcUXVZtAT3eAw== static-module@^2.2.0: version "2.2.5" From ff8e63e83732f32f9d40ca0f4079a08552c01ffa Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 1 Apr 2020 04:43:31 +0100 Subject: [PATCH 54/60] chore(NA): bump static-fs for 1.8.3 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 8c3c3412123d2..fd549aa1754c3 100644 --- a/package.json +++ b/package.json @@ -482,7 +482,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.8.2", + "static-fs": "1.8.3", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 5a1f606220a3e..146a9091bf414 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27165,10 +27165,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.8.2: - version "1.8.2" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.8.2.tgz#d00d491894273c0ee345abd77ff8c70b3e0ed499" - integrity sha512-iLEWM9f2eDNunCZ4UJaWaRrVhB4eGxV6d72zU+9JCAsTS/hCf7SnWNT6Bnfc7ltRIHyVALNOaZcUXVZtAT3eAw== +static-fs@1.8.3: + version "1.8.3" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.8.3.tgz#aa4aaf30898a5afca226f9f4e8e18f974ab52275" + integrity sha512-d/ojIqP9ujIyuLtr+ohNyLhB08TOjuIPPBz7tTB/LEA1srtPwSHxWFyTncG349TRkrjcoP+ayNI+jDrlKVBt9Q== static-module@^2.2.0: version "2.2.5" From 6afa7d1f73a926390f0ac11137b487c3fb16cd0f Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Fri, 17 Apr 2020 04:19:38 +0100 Subject: [PATCH 55/60] chore(NA): bump static-fs to 1.9.0 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 8b97774dd62d0..24bd45c180dcb 100644 --- a/package.json +++ b/package.json @@ -486,7 +486,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.8.3", + "static-fs": "1.9.0", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 9587a464283ef..cbd3f6f45cb69 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27857,10 +27857,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.8.3: - version "1.8.3" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.8.3.tgz#aa4aaf30898a5afca226f9f4e8e18f974ab52275" - integrity sha512-d/ojIqP9ujIyuLtr+ohNyLhB08TOjuIPPBz7tTB/LEA1srtPwSHxWFyTncG349TRkrjcoP+ayNI+jDrlKVBt9Q== +static-fs@1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.9.0.tgz#f36a247e54609b9ff43f09a0f1c38e748f4668ce" + integrity sha512-I/opxk2hU8Z3ec3WiKVtCLGlCeMUJlPBIo4r5CSYXDsqQdz6UgZUsHMDZFaV8MPuXkQ/85DXkrBsxWCF0FKfmg== static-module@^2.2.0: version "2.2.5" From 1dfa0c0505c59bd0ca109761c8fe132693bd249b Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Fri, 24 Apr 2020 20:56:06 +0100 Subject: [PATCH 56/60] chore(NA): bump static-fs to 1.9.1 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c358774f3bb67..daa7f546f6c78 100644 --- a/package.json +++ b/package.json @@ -486,7 +486,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.9.0", + "static-fs": "1.9.1", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 6cdb1fac63f59..82c7fb33a07f5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27792,10 +27792,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.9.0.tgz#f36a247e54609b9ff43f09a0f1c38e748f4668ce" - integrity sha512-I/opxk2hU8Z3ec3WiKVtCLGlCeMUJlPBIo4r5CSYXDsqQdz6UgZUsHMDZFaV8MPuXkQ/85DXkrBsxWCF0FKfmg== +static-fs@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.9.1.tgz#6eb9ae28238074e9f087176f731414a6467f4962" + integrity sha512-7Etp0mLvlNwoaGVe0jGOgoHP2GN3m0ysMQBaR+RUI70pRnFePg8rVd4+dCi7klvghl0KAdFe3iXyAJGe6w32pQ== static-module@^2.2.0: version "2.2.5" From 2c1a78dde0093fc21bc47f508e19df0fccbbd61d Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 4 May 2020 23:26:19 +0100 Subject: [PATCH 57/60] chore(NA): update to last static-fs version 1.10.0 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index cc016581d8622..a3e41dd10c86e 100644 --- a/package.json +++ b/package.json @@ -490,7 +490,7 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.9.1", + "static-fs": "1.10.0", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 05940e8983eda..96f3b80be0803 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27790,10 +27790,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.9.1.tgz#6eb9ae28238074e9f087176f731414a6467f4962" - integrity sha512-7Etp0mLvlNwoaGVe0jGOgoHP2GN3m0ysMQBaR+RUI70pRnFePg8rVd4+dCi7klvghl0KAdFe3iXyAJGe6w32pQ== +static-fs@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.10.0.tgz#3f80d4047c5d575ac9d70007961d2fceae3c9a19" + integrity sha512-MmlegjZZXsLiKO51zFHvwJIluZEeRb0UwqFBEz1tweHPPa4fCouTVuLusCo1JMEefzVyKuPl/u7iJd5FkYLDDA== static-module@^2.2.0: version "2.2.5" From 2795415fdf61da95b883d4f07be9b00009524c6c Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 5 May 2020 04:17:12 +0100 Subject: [PATCH 58/60] chore(NA): moving to @elastic/static-fs package --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index a3e41dd10c86e..73f2a264b03a0 100644 --- a/package.json +++ b/package.json @@ -297,6 +297,7 @@ "@elastic/eslint-plugin-eui": "0.0.2", "@elastic/github-checks-reporter": "0.0.20b3", "@elastic/makelogs": "^5.0.1", + "@elastic/static-fs": "1.0.0", "@kbn/dev-utils": "1.0.0", "@kbn/es": "1.0.0", "@kbn/eslint-import-resolver-kibana": "2.0.0", @@ -490,7 +491,6 @@ "simple-git": "1.116.0", "simplebar-react": "^2.1.0", "sinon": "^7.4.2", - "static-fs": "1.10.0", "strip-ansi": "^3.0.1", "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", diff --git a/yarn.lock b/yarn.lock index 96f3b80be0803..32e97a3461d27 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1427,6 +1427,11 @@ "@types/node-jose" "1.1.0" node-jose "1.1.0" +"@elastic/static-fs@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@elastic/static-fs/-/static-fs-1.0.0.tgz#9fc762aabc6a19f59807590f1fb3761377b80123" + integrity sha512-mDPt4NDn2lROrb7kMYsooOdjSv64AjRGJRxYgtAYL/q/gijzHsote4qWCvaMIZVCkRI1n+Xfs2kHoaZpVcy2sA== + "@elastic/ui-ace@0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@elastic/ui-ace/-/ui-ace-0.2.3.tgz#5281aed47a79b7216c55542b0675e435692f20cd" @@ -27790,11 +27795,6 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-fs@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/static-fs/-/static-fs-1.10.0.tgz#3f80d4047c5d575ac9d70007961d2fceae3c9a19" - integrity sha512-MmlegjZZXsLiKO51zFHvwJIluZEeRb0UwqFBEz1tweHPPa4fCouTVuLusCo1JMEefzVyKuPl/u7iJd5FkYLDDA== - static-module@^2.2.0: version "2.2.5" resolved "https://registry.yarnpkg.com/static-module/-/static-module-2.2.5.tgz#bd40abceae33da6b7afb84a0e4329ff8852bfbbf" From 881252cff3ef567c13de7c336d3ee7b549eb8ac3 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 5 May 2020 04:51:50 +0100 Subject: [PATCH 59/60] fix(NA): change import to the new package --- src/dev/build/tasks/create_static_fs_with_node_modules_task.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dev/build/tasks/create_static_fs_with_node_modules_task.js b/src/dev/build/tasks/create_static_fs_with_node_modules_task.js index 5427a11aa1253..0ab296fc5c163 100644 --- a/src/dev/build/tasks/create_static_fs_with_node_modules_task.js +++ b/src/dev/build/tasks/create_static_fs_with_node_modules_task.js @@ -20,7 +20,7 @@ import del from 'del'; import globby from 'globby'; import { resolve } from 'path'; -import { generateStaticFsVolume } from 'static-fs'; +import { generateStaticFsVolume } from '@elastic/static-fs'; async function deletePathsList(list) { for (const path of list) { From e87b90371b704a39c779e093cc5d9e96bdbc779d Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 5 May 2020 18:22:30 +0100 Subject: [PATCH 60/60] chore(NA): bump elastic static-fs to 1.0.1 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f433d7ea73c9b..f5f9713143a52 100644 --- a/package.json +++ b/package.json @@ -297,7 +297,7 @@ "@elastic/eslint-plugin-eui": "0.0.2", "@elastic/github-checks-reporter": "0.0.20b3", "@elastic/makelogs": "^5.0.1", - "@elastic/static-fs": "1.0.0", + "@elastic/static-fs": "1.0.1", "@kbn/dev-utils": "1.0.0", "@kbn/es": "1.0.0", "@kbn/eslint-import-resolver-kibana": "2.0.0", diff --git a/yarn.lock b/yarn.lock index d835c4d5c2265..c78b0942da845 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1427,10 +1427,10 @@ "@types/node-jose" "1.1.0" node-jose "1.1.0" -"@elastic/static-fs@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@elastic/static-fs/-/static-fs-1.0.0.tgz#9fc762aabc6a19f59807590f1fb3761377b80123" - integrity sha512-mDPt4NDn2lROrb7kMYsooOdjSv64AjRGJRxYgtAYL/q/gijzHsote4qWCvaMIZVCkRI1n+Xfs2kHoaZpVcy2sA== +"@elastic/static-fs@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@elastic/static-fs/-/static-fs-1.0.1.tgz#2e084e9fc321dd4c7fb4579021ca8a6b26f3464e" + integrity sha512-Vl40Va/h0P6aDUrzgDeTabGVUb/s/W92le64E1UXTcG5927cZtTnOu0datMjr98xdr9C6RAJ3mr6zgxfox5TNw== "@elastic/ui-ace@0.2.3": version "0.2.3"