Revert "Integration of a static filesystem for the node_modules (#47998)" (#67124) (#67134)

This reverts commit 33376fc368.
This commit is contained in:
Brandon Kobel 2020-05-20 14:35:16 -07:00 committed by GitHub
parent ba965fb7f7
commit 2b515b1390
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 2 additions and 75 deletions

View file

@ -293,7 +293,6 @@
"@elastic/eslint-plugin-eui": "0.0.2",
"@elastic/github-checks-reporter": "0.0.20b3",
"@elastic/makelogs": "^5.0.1",
"@elastic/static-fs": "1.0.2",
"@kbn/dev-utils": "1.0.0",
"@kbn/es": "1.0.0",
"@kbn/eslint-import-resolver-kibana": "2.0.0",

View file

@ -17,6 +17,6 @@
* under the License.
*/
require('../src/setup_node_env');
require('../src/apm')(process.env.ELASTIC_APM_PROXY_SERVICE_NAME || 'kibana-proxy');
require('../src/setup_node_env');
require('../src/cli/cli');

View file

@ -17,6 +17,6 @@
* under the License.
*/
require('../setup_node_env');
require('../apm')();
require('../setup_node_env');
require('./cli');

View file

@ -40,7 +40,6 @@ import {
CreatePackageJsonTask,
CreateReadmeTask,
CreateRpmPackageTask,
CreateStaticFsWithNodeModulesTask,
DownloadNodeBuildsTask,
ExtractNodeBuildsTask,
InstallDependenciesTask,
@ -127,7 +126,6 @@ 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

View file

@ -1,64 +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 del from 'del';
import globby from 'globby';
import { resolve } from 'path';
import { generateStaticFsVolume } from '@elastic/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/**/*'], {
cwd: rootDir,
onlyDirectories: true,
});
return nodeModulesFoldersForCwd.map(folder => 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 = [build.resolvePath('src/setup_node_env/index.js')];
// Creates the static filesystem with
// every node_module we have
const staticFsAddedPaths = await generateStaticFsVolume(
rootDir,
nodeModulesFolders,
rootEntryPoints
);
// Delete node_modules folder
await deletePathsList(staticFsAddedPaths);
},
};

View file

@ -25,7 +25,6 @@ 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';

View file

@ -1393,11 +1393,6 @@
"@types/node-jose" "1.1.0"
node-jose "1.1.0"
"@elastic/static-fs@1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@elastic/static-fs/-/static-fs-1.0.2.tgz#c1e5fea6a1b35abcd005cecf7880156ed0f273ae"
integrity sha512-0cZc5D9Wg6pJsc8Sa2ns1eOuxtXEidE7GBb2B0KZdJq9nZzUCxMyplURqT0Nr3i5XpoHb6ZEmxWsji86j1KjDw==
"@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"