Skip to content

Commit

Permalink
Remove node_modules/x-pack
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
  • Loading branch information
Tyler Smalley committed Mar 18, 2019
1 parent 1f2309c commit 70e5be4
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 96 deletions.
2 changes: 1 addition & 1 deletion packages/kbn-pm/dist/index.js
Expand Up @@ -31901,7 +31901,7 @@ let copyToBuild = (() => {
// We want the package to have the same relative location within the build
const relativeProjectPath = (0, _path.relative)(kibanaRoot, project.path);
const buildProjectPath = (0, _path.resolve)(buildRoot, relativeProjectPath);
yield (0, _cpy2.default)(['**/*'], buildProjectPath, {
yield (0, _cpy2.default)(['**/*', '!node_modules/**'], buildProjectPath, {
cwd: project.getIntermediateBuildDirectory(),
dot: true,
nodir: true,
Expand Down
Expand Up @@ -122,7 +122,7 @@ async function copyToBuild(project: Project, kibanaRoot: string, buildRoot: stri
const relativeProjectPath = relative(kibanaRoot, project.path);
const buildProjectPath = resolve(buildRoot, relativeProjectPath);

await copy(['**/*'], buildProjectPath, {
await copy(['**/*', '!node_modules/**'], buildProjectPath, {
cwd: project.getIntermediateBuildDirectory(),
dot: true,
nodir: true,
Expand Down
202 changes: 108 additions & 94 deletions src/dev/build/tasks/clean_tasks.js
Expand Up @@ -18,6 +18,7 @@
*/

import minimatch from 'minimatch';
import { existsSync } from 'fs';

import { deleteAll, deleteEmptyFolders, scanDelete } from '../lib';

Expand Down Expand Up @@ -69,103 +70,116 @@ export const CleanExtraFilesFromModulesTask = {
minimatch.makeRe(pattern, { nocase: true })
);

const regularExpressions = makeRegexps([
// tests
'**/test',
'**/tests',
'**/__tests__',
'**/mocha.opts',
'**/*.test.js',
'**/*.snap',
'**/coverage',

// docs
'**/doc',
'**/docs',
'**/CONTRIBUTING.md',
'**/Contributing.md',
'**/contributing.md',
'**/History.md',
'**/HISTORY.md',
'**/history.md',
'**/CHANGELOG.md',
'**/Changelog.md',
'**/changelog.md',

// examples
'**/example',
'**/examples',
'**/demo',
'**/samples',

// bins
'**/.bin',

// linters
'**/.eslintrc',
'**/.eslintrc.js',
'**/.eslintrc.yml',
'**/.prettierrc',
'**/.jshintrc',
'**/.babelrc',
'**/.jscs.json',
'**/.lint',

// hints
'**/*.flow',
'**/*.webidl',
'**/*.map',
'**/@types',

// scripts
'**/*.sh',
'**/*.bat',
'**/*.exe',
'**/Gruntfile.js',
'**/gulpfile.js',
'**/Makefile',

// untranspiled sources
'**/*.coffee',
'**/*.scss',
'**/*.sass',
'**/.ts',
'**/.tsx',

// editors
'**/.editorconfig',
'**/.vscode',

// git
'**/.gitattributes',
'**/.gitkeep',
'**/.gitempty',
'**/.gitmodules',
'**/.keep',
'**/.empty',

// ci
'**/.travis.yml',
'**/.coveralls.yml',
'**/.instanbul.yml',
'**/appveyor.yml',
'**/.zuul.yml',

// metadata
'**/package-lock.json',
'**/component.json',
'**/bower.json',
'**/yarn.lock',

// misc
'**/.*ignore',
'**/.DS_Store',
'**/Dockerfile',
'**/docker-compose.yml',
]);

log.info('Deleted %d files', await scanDelete({
directory: build.resolvePath('node_modules'),
regularExpressions: makeRegexps([
// tests
'**/test',
'**/tests',
'**/__tests__',
'**/mocha.opts',
'**/*.test.js',
'**/*.snap',
'**/coverage',

// docs
'**/doc',
'**/docs',
'**/CONTRIBUTING.md',
'**/Contributing.md',
'**/contributing.md',
'**/History.md',
'**/HISTORY.md',
'**/history.md',
'**/CHANGELOG.md',
'**/Changelog.md',
'**/changelog.md',

// examples
'**/example',
'**/examples',
'**/demo',
'**/samples',

// bins
'**/.bin',

// linters
'**/.eslintrc',
'**/.eslintrc.js',
'**/.eslintrc.yml',
'**/.prettierrc',
'**/.jshintrc',
'**/.babelrc',
'**/.jscs.json',
'**/.lint',

// hints
'**/*.flow',
'**/*.webidl',
'**/*.map',
'**/@types',

// scripts
'**/*.sh',
'**/*.bat',
'**/*.exe',
'**/Gruntfile.js',
'**/gulpfile.js',
'**/Makefile',

// untranspiled sources
'**/*.coffee',
'**/*.scss',
'**/*.sass',
'**/.ts',
'**/.tsx',

// editors
'**/.editorconfig',
'**/.vscode',

// git
'**/.gitattributes',
'**/.gitkeep',
'**/.gitempty',
'**/.gitmodules',
'**/.keep',
'**/.empty',

// ci
'**/.travis.yml',
'**/.coveralls.yml',
'**/.instanbul.yml',
'**/appveyor.yml',
'**/.zuul.yml',

// metadata
'**/package-lock.json',
'**/component.json',
'**/bower.json',
'**/yarn.lock',

// misc
'**/.*ignore',
'**/.DS_Store',
'**/Dockerfile',
'**/docker-compose.yml'
])
regularExpressions
}));

log.info('Deleted %d files', await scanDelete({
directory: build.resolvePath('x-pack/node_modules'),
regularExpressions
}));

if (existsSync(build.resolvePath('node_modules/x-pack'))) {
await deleteAll([
build.resolvePath('node_modules/x-pack')
], log);
}
},
};

Expand Down

0 comments on commit 70e5be4

Please sign in to comment.