buildModuleRecords(sources) {
    const records = entries(sources).flatMap((entry) =>
      this.buildModuleRecordsForSource(...entry)
    )

    if (this.#missingModules.size) {
      const nicePath = hrPath(this.renames[this.compartment.location])
      let msg = `Ensure all dependencies are properly installed. Package ${hrLabel(this.canonicalName)} (${nicePath}) references unresolvable module(s). Unresolvable modules may be "optional" or otherwise unlisted in ${hrPath(PACKAGE_JSON)}. ${chalk.italic('Execution will most likely fail')} unless accounted for in policy overrides:`
      for (const missingModule of this.#missingModules) {
        msg += `\n- ${chalk.yellow(missingModule)}`
      }
      this.#log.warning(msg)
    }

    return records
  }
Creates {@link LavamoatModuleRecord}s from {@link CompartmentSources}.

@param {CompartmentSources} sources
@returns {LavamoatModuleRecord[]}