Skip to content

Commit

Permalink
chore: update glob package (#12709)
Browse files Browse the repository at this point in the history
  • Loading branch information
Semigradsky committed May 6, 2022
1 parent 9093915 commit 3fc78ac
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 10 deletions.
4 changes: 3 additions & 1 deletion constraints.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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`));

Expand Down
14 changes: 9 additions & 5 deletions scripts/cleanE2e.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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 => {
Expand Down
34 changes: 33 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 3fc78ac

Please sign in to comment.