pathsToIdentifiers = () => {
    /** @type {PathMapping} */
    const mapping = {}
    for (const p of paths) {
      if (p.path) {
        mapping[p.path] = {
          aa: getPackageNameForModulePath(canonicalNameMap, p.path),
          moduleId: p.moduleId,
        }
      }
    }
    for (const c of contextModules) {
      const resourceId = getPackageNameForModulePath(
        canonicalNameMap,
        c.context
      )
      // The context in Context Module represents a package the CM is capable of loading from.
      // If the context can't be resolved to a package, the CM won't be usable.
      if (resourceId && !mapping[c.context]) {
        mapping[c.context] = {
          aa: resourceId,
          moduleId: c.moduleId,
        }
      }
    }
    return mapping
  }
@typedef {Record<string, { aa: string; moduleId: number | string }>} PathMapping