diff --git a/desktop/scripts/package.json b/desktop/scripts/package.json index 9d4c2695776..4b62366d5a4 100644 --- a/desktop/scripts/package.json +++ b/desktop/scripts/package.json @@ -21,6 +21,7 @@ "dotenv": "^14.2.0", "electron-builder": "23.0.3", "express": "^4.17.3", + "fast-glob": "3.3.1", "flipper-common": "0.0.0", "flipper-pkg-lib": "0.0.0", "flipper-plugin-lib": "0.0.0", diff --git a/desktop/scripts/verify-types-dependencies.tsx b/desktop/scripts/verify-types-dependencies.tsx index 9e2f1d63ce4..d68347d0ce0 100644 --- a/desktop/scripts/verify-types-dependencies.tsx +++ b/desktop/scripts/verify-types-dependencies.tsx @@ -7,9 +7,9 @@ * @format */ -import cp from 'child_process'; import fs from 'fs-extra'; import semver from 'semver'; +import fg from 'fast-glob'; /** * Lists all dependencies that DO NOT have to match their type declaration package major versions @@ -107,11 +107,9 @@ async function validatePackageJson( } async function main() { - const out = cp.execSync( - 'find . -name "package.json" -not -path "*/node_modules/*"', - ); - - const packageJsons = out.toString().trim().split('\n'); + const packageJsons = await fg('**/package.json', { + ignore: ['**/node_modules'], + }); const unmatched = await Promise.all( packageJsons.map(validatePackageJson), diff --git a/desktop/yarn.lock b/desktop/yarn.lock index de2757d4935..b9ee96d4ee7 100644 --- a/desktop/yarn.lock +++ b/desktop/yarn.lock @@ -8223,6 +8223,17 @@ fast-diff@^1.1.2: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== +fast-glob@3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4" + integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + fast-glob@^3.0.3: version "3.2.7" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1"