From 3fc78ace375c0d158fc85b315ced42d7798f426b Mon Sep 17 00:00:00 2001 From: Dmitry Semigradsky Date: Fri, 6 May 2022 14:52:07 +0300 Subject: [PATCH] chore: update `glob` package (#12709) --- constraints.pro | 4 +++- package.json | 2 +- scripts/build.mjs | 5 +++-- scripts/cleanE2e.mjs | 14 +++++++++----- yarn.lock | 34 +++++++++++++++++++++++++++++++++- 5 files changed, 49 insertions(+), 10 deletions(-) diff --git a/constraints.pro b/constraints.pro index 9baf9b0da392..546d78a74a0d 100644 --- a/constraints.pro +++ b/constraints.pro @@ -26,7 +26,9 @@ gen_enforced_dependency(WorkspaceCwd, DependencyIdent, DependencyRange2, Depende % Allow enzyme example workspace use a older version react and react-dom, because enzyme don't support react 17 'react', 'react-dom', % @types/node in the root need to stay on ~12.12.0 - '@types/node' + '@types/node', + % upgrading the entire repository is a breaking change + 'glob' ]). % Enforces that a dependency doesn't appear in both `dependencies` and `devDependencies` diff --git a/package.json b/package.json index 378ac4c16b78..889277186322 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "execa": "^5.0.0", "fast-check": "^2.0.0", "find-process": "^1.4.1", - "glob": "^7.1.3", + "glob": "^8.0.0", "globby": "^11.0.1", "graceful-fs": "^4.2.9", "isbinaryfile": "^5.0.0", diff --git a/scripts/build.mjs b/scripts/build.mjs index 4fa3eb2662d1..f373a9e1c4d5 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -62,8 +62,9 @@ function getBuildPath(file, buildFolder) { function buildNodePackage({packageDir, pkg}) { const srcDir = path.resolve(packageDir, SRC_DIR); - const pattern = path.resolve(srcDir, '**/*'); - const files = glob.sync(pattern, {nodir: true}); + const files = glob + .sync('**/*', {cwd: srcDir, nodir: true}) + .map(res => path.join(srcDir, res)); process.stdout.write(adjustToTerminalWidth(`${pkg.name}\n`)); diff --git a/scripts/cleanE2e.mjs b/scripts/cleanE2e.mjs index 09ee9d620f1d..5aea03fac923 100644 --- a/scripts/cleanE2e.mjs +++ b/scripts/cleanE2e.mjs @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import {dirname, normalize, resolve} from 'path'; +import {dirname, join, normalize, resolve} from 'path'; import {fileURLToPath} from 'url'; import glob from 'glob'; import rimraf from 'rimraf'; @@ -21,11 +21,15 @@ const excludedModules = [ 'e2e/retain-all-files/node_modules/', ].map(dir => normalize(dir)); -const e2eNodeModules = glob - .sync('e2e/*/node_modules/') - .concat(glob.sync('e2e/*/*/node_modules/')) +const rootDir = resolve(dirname(fileURLToPath(import.meta.url)), '..'); + +const e2eNodeModules = [ + ...glob.sync('e2e/*/node_modules/', {cwd: rootDir}), + ...glob.sync('e2e/*/*/node_modules/', {cwd: rootDir}), +] + .map(res => join(rootDir, res)) .filter(dir => !excludedModules.includes(dir)) - .map(dir => resolve(dirname(fileURLToPath(import.meta.url)), '..', dir)) + .map(dir => resolve(rootDir, dir)) .sort(); e2eNodeModules.forEach(dir => { diff --git a/yarn.lock b/yarn.lock index 0610cd4ccd84..0603f77e46df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2692,7 +2692,7 @@ __metadata: execa: ^5.0.0 fast-check: ^2.0.0 find-process: ^1.4.1 - glob: ^7.1.3 + glob: ^8.0.0 globby: ^11.0.1 graceful-fs: ^4.2.9 isbinaryfile: ^5.0.0 @@ -7118,6 +7118,15 @@ __metadata: languageName: node linkType: hard +"brace-expansion@npm:^2.0.1": + version: 2.0.1 + resolution: "brace-expansion@npm:2.0.1" + dependencies: + balanced-match: ^1.0.0 + checksum: a61e7cd2e8a8505e9f0036b3b6108ba5e926b4b55089eeb5550cd04a471fe216c96d4fe7e4c7f995c728c554ae20ddfc4244cad10aef255e72b62930afd233d1 + languageName: node + linkType: hard + "braces@npm:^2.3.1": version: 2.3.2 resolution: "braces@npm:2.3.2" @@ -11267,6 +11276,20 @@ __metadata: languageName: node linkType: hard +"glob@npm:^8.0.0": + version: 8.0.1 + resolution: "glob@npm:8.0.1" + dependencies: + fs.realpath: ^1.0.0 + inflight: ^1.0.4 + inherits: 2 + minimatch: ^5.0.1 + once: ^1.3.0 + path-is-absolute: ^1.0.0 + checksum: 7ac782f3ef1c08005884447479e68ceb0ad56997eb2003e1e9aefae71bad3cb48eb7c49190d3d6736f2ffcd8af4985d53a46831b3d5e0052cc5756822a38b61a + languageName: node + linkType: hard + "global-dirs@npm:^3.0.0": version: 3.0.0 resolution: "global-dirs@npm:3.0.0" @@ -15679,6 +15702,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^5.0.1": + version: 5.0.1 + resolution: "minimatch@npm:5.0.1" + dependencies: + brace-expansion: ^2.0.1 + checksum: b34b98463da4754bc526b244d680c69d4d6089451ebe512edaf6dd9eeed0279399cfa3edb19233513b8f830bf4bfcad911dddcdf125e75074100d52f724774f0 + languageName: node + linkType: hard + "minimist-options@npm:4.1.0": version: 4.1.0 resolution: "minimist-options@npm:4.1.0"