async function generateDependencyInfo()

in dev-tools/dep-info.js [55:91]


async function generateDependencyInfo(deps) {
  var allLicenses = [];
  await Promise.all(
    deps.map(async function (d) {
      const modulesPath = join(ROOT_NODE_MODULES, d);

      const dep = { name: d };

      const license = getFileContent(modulesPath, 'LICENSE');
      if (license) {
        dep.license = license;
      } else if (d === 'playwright') {
        const { version: playwrightTag } = require(join(modulesPath, 'package.json'));
        // playwright-core doesn't ship with a license file in the package,
        // this pulls the main playwright license file from the repo.
        const { statusCode, body } = await request(
          `https://raw.githubusercontent.com/microsoft/playwright/refs/tags/v${playwrightTag}/LICENSE`
        );
        const bodyStr = await body.text();
        if (statusCode !== 200) {
          throw new Error(
            `Failed to fetch playwright license info. status: ${statusCode}, reason: ${bodyStr}.`
          );
        }
        dep.license = bodyStr;
      }

      const notice = getFileContent(modulesPath, 'NOTICE');
      if (notice) {
        dep.notice = notice;
      }

      allLicenses.push(dep);
    })
  );
  return allLicenses;
}