From 5d6b99c529f168411d0dab8188db15cd9bb9d2bb Mon Sep 17 00:00:00 2001 From: Mehmet Erim Date: Wed, 22 Sep 2021 10:21:30 +0300 Subject: [PATCH] use fast-glob instead of regular glob package --- npm/package.json | 1 + npm/update-gulp.js | 14 +++++++++----- npm/yarn.lock | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/npm/package.json b/npm/package.json index 6de0301e60..2838e8eac0 100644 --- a/npm/package.json +++ b/npm/package.json @@ -16,6 +16,7 @@ "dependencies": { "commander": "^6.0.0", "execa": "^3.4.0", + "fast-glob": "^3.2.7", "fs-extra": "^8.1.0", "semver": "^7.3.5" } diff --git a/npm/update-gulp.js b/npm/update-gulp.js index 6f95dfb8a1..678c6a043b 100644 --- a/npm/update-gulp.js +++ b/npm/update-gulp.js @@ -1,4 +1,4 @@ -const glob = require('glob'); +const glob = require('fast-glob'); var path = require('path'); const childProcess = require('child_process'); const execa = require('execa'); @@ -18,6 +18,7 @@ const gulp = (folderPath) => { } try { + fse.removeSync(`${folderPath}/wwwroot/libs`); execa.sync('yarn', ['install'], { cwd: folderPath, stdio: 'inherit' }); execa.sync('yarn', ['gulp'], { cwd: folderPath, stdio: 'inherit' }); } catch (error) { @@ -40,8 +41,9 @@ const updatePackages = (pkgJsonPath) => { } }; -console.time(); -glob('../**/package.json', {}, (er, files) => { +(async () => { + console.time(); + let files = await glob('../**/package.json'); files = files.filter( (f) => f && @@ -53,7 +55,9 @@ glob('../**/package.json', {}, (er, files) => { files.forEach((file) => { updatePackages(file); - gulp(file.replace('package.json', '')); + const folderPath = file.replace('package.json', ''); + gulp(folderPath); }); + console.timeEnd(); -}); +})(); diff --git a/npm/yarn.lock b/npm/yarn.lock index 5924e105bb..38e7e00716 100644 --- a/npm/yarn.lock +++ b/npm/yarn.lock @@ -2266,7 +2266,7 @@ fast-glob@^2.2.6: merge2 "^1.2.3" micromatch "^3.1.10" -fast-glob@^3.1.1: +fast-glob@^3.1.1, fast-glob@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==