mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
* fix(NA): get dll entries across platforms * chore(NA): some more improvements
This commit is contained in:
parent
cf6c35ae6b
commit
08190cbcd4
2 changed files with 10 additions and 7 deletions
|
@ -39,8 +39,9 @@ module.exports = function(root) {
|
|||
const kibanaExtraDir = resolve(root, '../../kibana');
|
||||
const kibanaPluginsDir = resolve(root, '../../');
|
||||
const isPluginOnKibanaExtra = pluginPackageJsonPath.includes(kibanaExtraDir);
|
||||
const isPluginXpack = pkg.name === 'x-pack';
|
||||
|
||||
if (isPluginOnKibanaExtra) {
|
||||
if (isPluginOnKibanaExtra && !isPluginXpack) {
|
||||
console.warn(
|
||||
`In the future we will disable ../kibana-extra/{pluginName}. You should move your plugin ${pkg.name} as soon as possible to ./plugins/{pluginName}`
|
||||
);
|
||||
|
@ -51,7 +52,7 @@ module.exports = function(root) {
|
|||
return Object.assign(
|
||||
{
|
||||
root: root,
|
||||
kibanaRoot: pkg.name === 'x-pack' ? resolve(root, '..') : kibanaRootWhenNotXpackPlugin,
|
||||
kibanaRoot: isPluginXpack ? resolve(root, '..') : kibanaRootWhenNotXpackPlugin,
|
||||
serverTestPatterns: ['server/**/__tests__/**/*.js'],
|
||||
buildSourcePatterns: buildSourcePatterns,
|
||||
skipInstallDependencies: false,
|
||||
|
|
|
@ -18,9 +18,10 @@
|
|||
*/
|
||||
|
||||
import { deleteAll, isFileAccessible, read, write } from '../../lib';
|
||||
import { dirname, sep, relative, resolve } from 'path';
|
||||
import { dirname, relative, resolve } from 'path';
|
||||
import pkgUp from 'pkg-up';
|
||||
import globby from 'globby';
|
||||
import normalizePosixPath from 'normalize-path';
|
||||
|
||||
function checkDllEntryAccess(entry, baseDir = '') {
|
||||
const resolvedPath = baseDir ? resolve(baseDir, entry) : entry;
|
||||
|
@ -48,7 +49,7 @@ export async function getDllEntries(manifestPath, whiteListedModules, baseDir =
|
|||
// Only includes modules who are not in the white list of modules
|
||||
// and that are node_modules
|
||||
return modules.filter(entry => {
|
||||
const isWhiteListed = whiteListedModules.some(nonEntry => entry.includes(`node_modules${sep}${nonEntry}${sep}`));
|
||||
const isWhiteListed = whiteListedModules.some(nonEntry => normalizePosixPath(entry).includes(`node_modules/${nonEntry}`));
|
||||
const isNodeModule = entry.includes('node_modules');
|
||||
|
||||
// NOTE: when using dynamic imports on webpack the entry paths could be created
|
||||
|
@ -69,6 +70,7 @@ export async function cleanDllModuleFromEntryPath(logger, entryPath) {
|
|||
const modulePkgPath = await pkgUp(entryPath);
|
||||
const modulePkg = JSON.parse(await read(modulePkgPath));
|
||||
const moduleDir = dirname(modulePkgPath);
|
||||
const normalizedModuleDir = normalizePosixPath(moduleDir);
|
||||
|
||||
// Cancel the cleanup for this module as it
|
||||
// was already done.
|
||||
|
@ -93,9 +95,9 @@ export async function cleanDllModuleFromEntryPath(logger, entryPath) {
|
|||
// until the following issue gets closed
|
||||
// https://github.com/sindresorhus/globby/issues/87
|
||||
const filesToDelete = await globby([
|
||||
`${moduleDir}/**`,
|
||||
`!${moduleDir}/**/*.+(css)`,
|
||||
`!${moduleDir}/**/*.+(gif|ico|jpeg|jpg|tiff|tif|svg|png|webp)`,
|
||||
`${normalizedModuleDir}/**`,
|
||||
`!${normalizedModuleDir}/**/*.+(css)`,
|
||||
`!${normalizedModuleDir}/**/*.+(gif|ico|jpeg|jpg|tiff|tif|svg|png|webp)`,
|
||||
]);
|
||||
|
||||
await deleteAll(filesToDelete.filter(path => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue