From b5f095f15383a8f4bdb64fd8fdf187003fcbd023 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Fri, 7 Mar 2025 09:01:01 +0000 Subject: [PATCH] switch from forEachPackage to listAllPackages --- scripts/find-packages-on-old-config.js | 6 +++--- scripts/update-electron.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/find-packages-on-old-config.js b/scripts/find-packages-on-old-config.js index 93a10ee71cf..3968ef15ecc 100644 --- a/scripts/find-packages-on-old-config.js +++ b/scripts/find-packages-on-old-config.js @@ -2,10 +2,10 @@ const fs = require('fs'); const path = require('path'); -const { forEachPackage } = require('@mongodb-js/monorepo-tools'); +const { listAllPackages } = require('@mongodb-js/monorepo-tools'); -forEachPackage((props) => { +for await (const props of listAllPackages()) { if (!fs.existsSync(path.resolve(props.location, '.prettierrc.json'))) { console.log(props.name); } -}); +} diff --git a/scripts/update-electron.js b/scripts/update-electron.js index 07c37c9f4f9..4ab3cb47d48 100644 --- a/scripts/update-electron.js +++ b/scripts/update-electron.js @@ -3,7 +3,7 @@ const semver = require('semver'); const fetch = require('make-fetch-happen'); const fs = require('fs'); const path = require('path'); -const { forEachPackage } = require('@mongodb-js/monorepo-tools'); +const { listAllPackages } = require('@mongodb-js/monorepo-tools'); const { runInDir } = require('./run-in-dir'); async function cleanAndBootstrap(newVersions) { @@ -125,11 +125,11 @@ async function main() { console.log('Updating the following packages:', newVersions); - forEachPackage((props) => { + for await (const props of listAllPackages()) { const packageJsonPath = path.resolve(props.location, 'package.json'); updatePackageVersions(packageJsonPath, newVersions); - }); + } console.log('Cleaning node_modules and rebootstrapping'); cleanAndBootstrap(newVersions);