mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[globby] normalize paths for windows support (#96476)
Co-authored-by: spalger <spalger@users.noreply.github.com>
This commit is contained in:
parent
71c326c8bf
commit
d8ef85e85b
4 changed files with 21 additions and 11 deletions
|
@ -9,6 +9,7 @@
|
|||
import Path from 'path';
|
||||
|
||||
import globby from 'globby';
|
||||
import normalize from 'normalize-path';
|
||||
|
||||
import { parseKibanaPlatformPlugin } from './parse_kibana_platform_plugin';
|
||||
|
||||
|
@ -32,7 +33,7 @@ export function simpleKibanaPlatformPluginDiscovery(scanDirs: string[], pluginPa
|
|||
),
|
||||
...pluginPaths.map((path) => Path.resolve(path, `kibana.json`)),
|
||||
])
|
||||
);
|
||||
).map((path) => normalize(path));
|
||||
|
||||
const manifestPaths = globby.sync(patterns, { absolute: true }).map((path) =>
|
||||
// absolute paths returned from globby are using normalize or
|
||||
|
|
|
@ -11,6 +11,7 @@ import Path from 'path';
|
|||
import { REPO_ROOT } from '@kbn/utils';
|
||||
import { run, createFailError, createFlagError } from '@kbn/dev-utils';
|
||||
import globby from 'globby';
|
||||
import normalize from 'normalize-path';
|
||||
|
||||
import { getFailures, TestFailure } from './get_failures';
|
||||
import { GithubApi, GithubIssueMini } from './github_api';
|
||||
|
@ -61,7 +62,9 @@ export function runFailedTestsReporterCli() {
|
|||
throw createFlagError('Missing --build-url or process.env.BUILD_URL');
|
||||
}
|
||||
|
||||
const patterns = flags._.length ? flags._ : DEFAULT_PATTERNS;
|
||||
const patterns = (flags._.length ? flags._ : DEFAULT_PATTERNS).map((p) =>
|
||||
normalize(Path.resolve(p))
|
||||
);
|
||||
log.info('Searching for reports at', patterns);
|
||||
const reportPaths = await globby(patterns, {
|
||||
absolute: true,
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import Path from 'path';
|
||||
import globby from 'globby';
|
||||
import normalize from 'normalize-path';
|
||||
// @ts-ignore
|
||||
import { parseEntries, dependenciesParseStrategy } from '@kbn/babel-code-parser';
|
||||
|
||||
|
@ -21,16 +23,16 @@ export async function findUsedDependencies(listedPkgDependencies: any, baseDir:
|
|||
// Define the entry points for the server code in order to
|
||||
// start here later looking for the server side dependencies
|
||||
const mainCodeEntries = [
|
||||
`${baseDir}/src/cli/dist.js`,
|
||||
`${baseDir}/src/cli_keystore/dist.js`,
|
||||
`${baseDir}/src/cli_plugin/dist.js`,
|
||||
Path.resolve(baseDir, `src/cli/dist.js`),
|
||||
Path.resolve(baseDir, `src/cli_keystore/dist.js`),
|
||||
Path.resolve(baseDir, `src/cli_plugin/dist.js`),
|
||||
];
|
||||
|
||||
const discoveredPluginEntries = await globby([
|
||||
`${baseDir}/src/plugins/*/server/index.js`,
|
||||
`!${baseDir}/src/plugins/**/public`,
|
||||
`${baseDir}/x-pack/plugins/*/server/index.js`,
|
||||
`!${baseDir}/x-pack/plugins/**/public`,
|
||||
normalize(Path.resolve(baseDir, `src/plugins/*/server/index.js`)),
|
||||
`!${normalize(Path.resolve(baseDir, `/src/plugins/**/public`))}`,
|
||||
normalize(Path.resolve(baseDir, `x-pack/plugins/*/server/index.js`)),
|
||||
`!${normalize(Path.resolve(baseDir, `/x-pack/plugins/**/public`))}`,
|
||||
]);
|
||||
|
||||
// It will include entries that cannot be discovered
|
||||
|
@ -40,7 +42,7 @@ export async function findUsedDependencies(listedPkgDependencies: any, baseDir:
|
|||
// Another way would be to include an index file and import all the functions
|
||||
// using named imports
|
||||
const dynamicRequiredEntries = await globby([
|
||||
`${baseDir}/src/plugins/vis_type_timelion/server/**/*.js`,
|
||||
normalize(Path.resolve(baseDir, 'src/plugins/vis_type_timelion/server/**/*.js')),
|
||||
]);
|
||||
|
||||
// Compose all the needed entries
|
||||
|
|
|
@ -12,6 +12,7 @@ import Fs from 'fs';
|
|||
import del from 'del';
|
||||
import cpy from 'cpy';
|
||||
import globby from 'globby';
|
||||
import normalize from 'normalize-path';
|
||||
import {
|
||||
ToolingLog,
|
||||
createAbsolutePathSerializer,
|
||||
|
@ -98,7 +99,10 @@ it('creates and extracts caches, ingoring dirs with matching merge-base file and
|
|||
|
||||
const files = Object.fromEntries(
|
||||
globby
|
||||
.sync(outDirs, { dot: true })
|
||||
.sync(
|
||||
outDirs.map((p) => normalize(p)),
|
||||
{ dot: true }
|
||||
)
|
||||
.map((path) => [Path.relative(TMP, path), Fs.readFileSync(path, 'utf-8')])
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue