Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Integration of a static filesystem for the node_modules #47998

Merged
merged 151 commits into from
May 5, 2020
Merged
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
e0b1cdc
feat(NA): added new build step to generate a static file system for n…
mistic Aug 13, 2018
41b785d
chore(NA): updated lockfile.
mistic Aug 13, 2018
8b104e1
chore(NA): replace import to the correct static-fs files.
mistic Aug 13, 2018
084fc7a
chore(NA): solve conflicts merging with master.
mistic Aug 13, 2018
34106f7
fix(NA): resolve for a correct static fs loader.
mistic Aug 13, 2018
b60c33d
chore(NA): last static-fs working version.
mistic Aug 14, 2018
956e538
feat(NA): changed patched entryPoints.
mistic Aug 15, 2018
470e125
chore(NA): update to last static fs.
mistic Aug 15, 2018
c59aaa8
Merge branch 'master' into static-filesystem
mistic Aug 21, 2018
6fcd7e5
Merge branch 'master' into static-filesystem
mistic Aug 22, 2018
bc6db67
fix(NA): fix imports on webpack shims. chore(NA): added new static-fs…
mistic Aug 22, 2018
64f40b5
chore(NA): update to static-fs with stat and statSync.
mistic Aug 22, 2018
319011b
fix(NA): vendor chunk filtering in order to include default node modu…
mistic Aug 22, 2018
00cb528
refact(NA): major refact on create static modules fs task.
mistic Aug 22, 2018
0654b49
Merge branch 'master' into static-filesystem
mistic Aug 22, 2018
635d82f
fix(NA): remove global from clean empty folders task.
mistic Aug 22, 2018
f42c59c
chore(NA): merge and solve with last master. - UNTESTED
mistic Apr 29, 2019
b56f779
Merge branch 'master' into static-filesystem
mistic May 15, 2019
112f3ec
chore(NA): change args order for deleteAll.
mistic May 15, 2019
7819ca3
Merge branch 'master' into static-filesystem
mistic Jun 4, 2019
ce1ba90
chore(NA): move to the new static fs
mistic Jun 19, 2019
6a7a5e8
Merge branch 'master' into static-filesystem
mistic Jun 28, 2019
c87057d
feat(NA): migrate to last apis of static fs
mistic Jul 1, 2019
5d769c3
fix(NA): patch correct entry file.
mistic Jul 1, 2019
4179ac7
Merge branch 'master' into static-filesystem
mistic Jul 29, 2019
58faf4e
chore(NA): merge and solve conflicts with master
mistic Aug 2, 2019
b8e5cfd
chore(NA): last stable integration with static-fs task
mistic Aug 7, 2019
38724c4
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic Aug 7, 2019
b0bf35e
chore(NA): rollback some unecessary changes
mistic Aug 7, 2019
16f0fa1
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic Aug 12, 2019
9152fd6
Merge branch 'master' into static-filesystem
mistic Aug 13, 2019
b81b1cc
chore(NA): remove changes on sinon webpackshim
mistic Aug 14, 2019
a396e86
Merge branch 'master' into static-filesystem
mistic Aug 21, 2019
fbc6537
Merge branch 'master' into static-filesystem
mistic Aug 23, 2019
ef30bd9
chore(NA): integrate with official static-fs version
mistic Aug 23, 2019
05a5e8e
chore(NA): integrate last thread-loader version
mistic Aug 24, 2019
73ba884
Merge branch 'master' into static-filesystem
mistic Aug 24, 2019
c508c24
chore(NA): added last static-fs version
mistic Aug 24, 2019
8416d9a
Merge branch 'master' of github.com:elastic/kibana into static-filesy…
mistic Aug 24, 2019
18216f6
chore(NA): merge and solve conflicts with master
mistic Aug 26, 2019
8b7573a
Merge branch 'static-filesystem' of github.com:mistic/kibana into sta…
mistic Aug 26, 2019
5f2ac47
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic Aug 26, 2019
71b1d3f
chore(NA): upgrade to last static-fs version
mistic Aug 27, 2019
2134a30
Merge branch 'master' into static-filesystem
mistic Aug 29, 2019
72faf6d
chore(NA): upgrade to last static-fs version 1.1.1
mistic Aug 29, 2019
f7fa66a
chore(NA): rever static-fs version to 1.1.0
mistic Aug 29, 2019
4bc2090
chore(NA): upgrade static-fs to 1.1.1
mistic Aug 29, 2019
4965d63
Merge branch 'master' into static-filesystem
mistic Aug 29, 2019
35ba2e4
chore(NA): upgrade static-fs for last 1.2.0 version
mistic Aug 29, 2019
f80a759
Merge branch 'master' of github.com:elastic/kibana into static-filesy…
Sep 5, 2019
ce3db91
Merge branch 'master' of github.com:elastic/kibana into static-filesy…
Sep 6, 2019
1513d1c
Merge branch 'master' into static-filesystem
elasticmachine Sep 16, 2019
1cc1fb6
Merge branch 'master' into static-filesystem
elasticmachine Sep 30, 2019
69c476e
Merge branch 'master' into static-filesystem
elasticmachine Oct 2, 2019
b961d8c
Merge commit '393c366' into static-filesystem
mistic Oct 11, 2019
b8dba39
Merge commit '2e00927' into static-filesystem
mistic Oct 12, 2019
f933bf2
Merge branch 'master' into static-filesystem
mistic Oct 15, 2019
77effc8
Merge branch 'master' into static-filesystem
elasticmachine Oct 18, 2019
f5d30fb
Merge branch 'master' into static-filesystem
elasticmachine Oct 22, 2019
8431390
Merge branch 'master' into static-filesystem
mistic Oct 30, 2019
ebb14b6
chore(NA): update package.json
mistic Oct 30, 2019
be80910
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic Oct 30, 2019
774b6ba
Merge branch 'static-filesystem' of github.com:mistic/kibana into sta…
mistic Oct 30, 2019
847eedc
chore(NA): merge and solve conflicts with last master
mistic Jan 22, 2020
d0fe186
chore(NA): run apm after patched environment
mistic Jan 23, 2020
a704e9f
chore(NA): specify rule to disable eslint for
mistic Jan 23, 2020
4a098c6
chore(NA): remove changes in the src/apm file
mistic Jan 23, 2020
a8edaad
chore(NA): change apm order in the dev scripts
mistic Jan 27, 2020
4c2db20
chore(na): update static-fs versin
mistic Jan 27, 2020
c1bd8c8
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic Jan 27, 2020
060c6ae
chore(NA): bump static fs version
mistic Jan 27, 2020
f35f79e
chore(NA): correctly lint task file
mistic Jan 27, 2020
34ee9d7
Merge branch 'master' into static-filesystem
mistic Jan 27, 2020
898164d
chore(NA): move away from rimraf to del
mistic Jan 27, 2020
8f3a2d8
chore(NA): bump static-fs version
mistic Jan 28, 2020
b0116f9
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic Jan 29, 2020
2ef72af
chore(NA): bump static-fs version
mistic Jan 29, 2020
468f806
Merge branch 'master' into static-filesystem
elasticmachine Jan 29, 2020
63aebae
Merge branch 'master' into static-filesystem
elasticmachine Feb 4, 2020
b042d08
Merge branch 'master' into static-filesystem
elasticmachine Feb 4, 2020
bdc1f4d
Merge branch 'master' into static-filesystem
mistic Feb 12, 2020
363897e
Merge branch 'master' into static-filesystem
mistic Feb 13, 2020
3150f7d
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic Feb 13, 2020
d232304
Merge branch 'master' into static-filesystem
mistic Feb 13, 2020
839d432
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic Feb 14, 2020
6de6906
chore(NA): bump static-fs version
mistic Feb 14, 2020
70b794e
Merge branch 'master' into static-filesystem
mistic Feb 18, 2020
caf2f14
Merge branch 'master' into static-filesystem
mistic Feb 19, 2020
3c97de7
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic Feb 20, 2020
f0b0abd
chore(NA): bump static-fs version
mistic Feb 21, 2020
2ec9d6e
Merge branch 'master' into static-filesystem
mistic Feb 21, 2020
c8c8ea7
chore(NA): bump to last static-fs version
mistic Feb 22, 2020
8456310
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic Feb 24, 2020
510a530
chore(NA): apply changed according PR review feedback
mistic Feb 24, 2020
85833d8
chore(NA): remove changes to base optimizer
mistic Feb 24, 2020
f51cf96
chore(NA): fix discover pattern
mistic Feb 24, 2020
0511751
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic Feb 24, 2020
55caa30
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic Feb 25, 2020
bbb9366
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic Feb 27, 2020
6a01515
Merge branch 'master' into static-filesystem
mistic Feb 28, 2020
43bcdcf
Merge branch 'master' into static-filesystem
elasticmachine Mar 1, 2020
2531e28
chore(NA): bump static-fs version
mistic Mar 2, 2020
a7d2d56
Merge branch 'static-filesystem' of github.com:mistic/kibana into sta…
mistic Mar 2, 2020
f13e129
Merge branch 'master' into static-filesystem
elasticmachine Mar 4, 2020
8dca2e2
Merge branch 'master' into static-filesystem
elasticmachine Mar 4, 2020
7b0bc29
Merge branch 'master' into static-filesystem
elasticmachine Mar 4, 2020
c84ae2d
Merge branch 'master' into static-filesystem
mistic Mar 9, 2020
d38819e
Merge branch 'static-filesystem' of github.com:mistic/kibana into sta…
mistic Mar 9, 2020
9a78e57
Merge branch 'master' into static-filesystem
elasticmachine Mar 10, 2020
028ec4a
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic Mar 11, 2020
5e6fd14
chore(NA): bump static fs to 1.6.3
mistic Mar 11, 2020
333ff9e
Merge branch 'master' into static-filesystem
mistic Mar 12, 2020
4cbf000
chore(NA): bump static-fs to 1.6.4
mistic Mar 12, 2020
331c10d
Merge branch 'master' into static-filesystem
elasticmachine Mar 16, 2020
85ec2f3
Merge branch 'master' into static-filesystem
elasticmachine Mar 18, 2020
073040c
Merge branch 'master' into static-filesystem
mistic Mar 20, 2020
26c5a2e
chore(NA): bump static-fs to last version
mistic Mar 20, 2020
8ab60b1
chore(NA): bump static-fs to last version
mistic Mar 21, 2020
8faa3df
chore(NA): bump static-fs to last version
mistic Mar 21, 2020
502ecb9
chore(NA): bump static-fs to last version
mistic Mar 21, 2020
3c0fbaf
chore(NA): bump static-fs to last version
mistic Mar 21, 2020
2def2f7
chore(NA): bump static-fs to last version
mistic Mar 21, 2020
65897c9
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic Mar 21, 2020
c3d88f5
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic Mar 23, 2020
44285c2
Merge branch 'master' into static-filesystem
mistic Mar 24, 2020
a653b3f
Merge branch 'master' into static-filesystem
elasticmachine Mar 26, 2020
84535ef
Merge branch 'static-filesystem' of github.com:mistic/kibana into sta…
mistic Mar 30, 2020
e85296d
Merge branch 'master' into static-filesystem
mistic Mar 30, 2020
ff8e63e
chore(NA): bump static-fs for 1.8.3
mistic Apr 1, 2020
e3eb77e
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic Apr 1, 2020
9f6e03c
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic Apr 3, 2020
d8eeb71
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic Apr 3, 2020
4e989dd
Merge branch 'master' into static-filesystem
elasticmachine Apr 6, 2020
543eec6
Merge branch 'master' into static-filesystem
mistic Apr 7, 2020
b8ebe24
Merge branch 'master' into static-filesystem
elasticmachine Apr 9, 2020
40feb88
Merge branch 'master' into static-filesystem
elasticmachine Apr 13, 2020
f607c3b
Merge branch 'master' into static-filesystem
elasticmachine Apr 17, 2020
6afa7d1
chore(NA): bump static-fs to 1.9.0
mistic Apr 17, 2020
da98fe3
Merge branch 'master' into static-filesystem
elasticmachine Apr 20, 2020
b171260
Merge branch 'master' into static-filesystem
elasticmachine Apr 22, 2020
c97ba58
Merge branch 'master' into static-filesystem
elasticmachine Apr 24, 2020
1dfa0c0
chore(NA): bump static-fs to 1.9.1
mistic Apr 24, 2020
10328c9
Merge branch 'master' into static-filesystem
elasticmachine Apr 27, 2020
52b722b
Merge branch 'master' into static-filesystem
elasticmachine Apr 29, 2020
4c55401
Merge remote-tracking branch 'upstream/master' into static-filesystem
mistic May 4, 2020
2c1a78d
chore(NA): update to last static-fs version 1.10.0
mistic May 4, 2020
76cc629
Merge branch 'master' into static-filesystem
elasticmachine May 5, 2020
2795415
chore(NA): moving to @elastic/static-fs package
mistic May 5, 2020
ecc446d
Merge branch 'static-filesystem' of github.com:mistic/kibana into sta…
mistic May 5, 2020
881252c
fix(NA): change import to the new package
mistic May 5, 2020
e87b903
chore(NA): bump elastic static-fs to 1.0.1
mistic May 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@
"simple-git": "1.116.0",
"simplebar-react": "^2.1.0",
"sinon": "^7.4.2",
"static-fs": "1.3.0",
"strip-ansi": "^3.0.1",
"supertest": "^3.1.0",
"supertest-as-promised": "^4.0.2",
Expand Down
2 changes: 1 addition & 1 deletion scripts/kibana.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
2 changes: 1 addition & 1 deletion src/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
* under the License.
*/

require('../apm')();
require('../setup_node_env');
require('../apm')();
mistic marked this conversation as resolved.
Show resolved Hide resolved
require('./cli');
2 changes: 2 additions & 0 deletions src/dev/build/build_distributables.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
CreatePackageJsonTask,
CreateReadmeTask,
CreateRpmPackageTask,
CreateStaticFsWithNodeModulesTask,
DownloadNodeBuildsTask,
ExtractNodeBuildsTask,
InstallDependenciesTask,
Expand Down Expand Up @@ -123,6 +124,7 @@ export async function buildDistributables(options) {
await run(CleanTypescriptTask);
await run(CleanExtraFilesFromModulesTask);
await run(CleanEmptyFoldersTask);
await run(CreateStaticFsWithNodeModulesTask);

/**
* copy generic build outputs into platform-specific build
Expand Down
68 changes: 68 additions & 0 deletions src/dev/build/tasks/create_static_fs_with_node_modules_task.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* 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 del from 'del';
import globby from 'globby';
import normalizePath from 'normalize-path';
import { resolve } from 'path';
import { generateStaticFsVolume } from 'static-fs';

async function deletePathsList(list) {
for (const path of list) {
await del(path);
}
}

async function getTopLevelNodeModulesFolders(rootDir) {
const nodeModulesFoldersForCwd = await globby(
['**/node_modules', '!**/node_modules/**/node_modules'],
mistic marked this conversation as resolved.
Show resolved Hide resolved
{
cwd: rootDir,
onlyDirectories: true,
}
);

return nodeModulesFoldersForCwd.map(folder => normalizePath(resolve(rootDir, folder)));
mistic marked this conversation as resolved.
Show resolved Hide resolved
}

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'))];
mistic marked this conversation as resolved.
Show resolved Hide resolved

// Creates the static filesystem with
// every node_module we have
const staticFsAddedPaths = await generateStaticFsVolume(
rootDir,
nodeModulesFolders,
rootEntryPoints
);

// Delete node_modules folder
await deletePathsList(staticFsAddedPaths);
},
};
1 change: 1 addition & 0 deletions src/dev/build/tasks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +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_fs_with_node_modules_task';
export * from './install_dependencies_task';
export * from './license_file_task';
export * from './nodejs';
Expand Down
6 changes: 1 addition & 5 deletions src/optimize/base_optimizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,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)
: [];
const parsedNodeOptions = process.env.NODE_OPTIONS ? process.env.NODE_OPTIONS.split(/\s/) : [];
mistic marked this conversation as resolved.
Show resolved Hide resolved

return {
name: 'optimizer-thread-loader-main-pool',
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -27498,6 +27498,11 @@ 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-module@^2.2.0:
version "2.2.5"
resolved "https://registry.yarnpkg.com/static-module/-/static-module-2.2.5.tgz#bd40abceae33da6b7afb84a0e4329ff8852bfbbf"
Expand Down