How to use the lerna/lib/PackageUtilities.getPackages function in lerna

To help you get started, we’ve selected a few lerna examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webiny / webiny-js / packages-utils / webiny-semantic-release / bin / webiny-semantic-release.js View on Github external
function getAllPackages() {
    const repository = new Repository();
    return PackageUtilities.getPackages(repository);
}
github streamich / git-cz / lib / lernaUtils.js View on Github external
const getAllPackages = function () {
  const Repository = require('lerna/lib/Repository');
  const PackageUtilities = require('lerna/lib/PackageUtilities');

  return PackageUtilities.getPackages(new Repository());
};
github wix / lerna-script / lerna-script / lib / packages.js View on Github external
function loadPackages({log = npmlog, packageConfigs} = {log: npmlog}) {
  const repo = new Repository()
  const effectivePackageConfigs = packageConfigs || repo.packageConfigs
  if (packageConfigs) {
    log.verbose('loadPackages', 'using provided packageConfigs', {
      packageConfigs: effectivePackageConfigs
    })
  } else {
    log.verbose('loadPackages', 'using default packageConfigs', {
      packageConfigs: effectivePackageConfigs
    })
  }

  const loadedPackages = PackageUtilities.getPackages({
    rootPath: repo.rootPath,
    packageConfigs: effectivePackageConfigs
  })

  const batched = PackageUtilities.topologicallyBatchPackages(loadedPackages)
  return _.flatten(batched)
}