getFolder(pkg) {
    let registryName = pkg._registry;
    if (!registryName) {
      const ref = pkg._reference;
      invariant(ref, 'expected reference');
      registryName = ref.registry;
    }
    return this.registries[registryName].folder;
  }
/+(${registryFilenames})`;
      });

      const files = yield Promise.all(patterns.map(function (pattern) {
        return (_fs || _load_fs()).glob(pattern.replace(/\/?$/, trailingPattern), {
          cwd: root,
          ignore: ignorePatterns.map(function (ignorePattern) {
            return pattern.replace(/\/?$/, ignorePattern);
          })
        });
      }));

      for (var _iterator7 = new Set([].concat(...files)), _isArray7 = Array.isArray(_iterator7), _i8 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) {
        var _ref9;

        if (_isArray7) {
          if (_i8 >= _iterator7.length) break;
          _ref9 = _iterator7[_i8++];
        } else {
          _i8 = _iterator7.next();
          if (_i8.done) break;
          _ref9 = _i8.value;
        }

        const file = _ref9;

        const loc = path.join(root, path.dirname(file));
        const manifest = yield _this9.findManifest(loc, false);

        if (!manifest) {
          continue;
        }

        if (!manifest.name) {
          _this9.reporter.warn(_this9.reporter.lang('workspaceNameMandatory', loc));
          continue;
        }
        if (!manifest.version) {
          _this9.reporter.warn(_this9.reporter.lang('workspaceVersionMandatory', loc));
          continue;
        }

        if (Object.prototype.hasOwnProperty.call(workspaces, manifest.name)) {
          throw new (_errors || _load_errors()).MessageError(_this9.reporter.lang('workspaceNameDuplicate', manifest.name));
        }

        workspaces[manifest.name] = { loc, manifest };
      }

      return workspaces;
    })();
  }

  // workspaces functions
  getWorkspaces(manifest, shouldThrow = false) {
    if (!manifest || !this.workspacesEnabled) {
      return undefined;
    }

    const ws = extractWorkspaces(manifest);

    if (!ws) {
      return ws;
    }

    // validate eligibility
    let wsCopy = (0, (_extends2 || _load_extends()).default)({}, ws);
    const warnings = [];
    const errors = [];

    // packages
    if (wsCopy.packages && wsCopy.packages.length > 0 && !manifest.private) {
      errors.push(this.reporter.lang('workspacesRequirePrivateProjects'));
      wsCopy = undefined;
    }
    // nohoist
    if (wsCopy && wsCopy.nohoist && wsCopy.nohoist.length > 0) {
      if (!this.workspacesNohoistEnabled) {
        warnings.push(this.reporter.lang('workspacesNohoistDisabled', manifest.name));
        wsCopy.nohoist = undefined;
      } else if (!manifest.private) {
        errors.push(this.reporter.lang('workspacesNohoistRequirePrivatePackages', manifest.name));
        wsCopy.nohoist = undefined;
      }
    }

    if (errors.length > 0 && shouldThrow) {
      throw new (_errors || _load_errors()).MessageError(errors.join('\n'));
    }

    const msg = errors.concat(warnings).join('\n');
    if (msg.length > 0) {
      this.reporter.warn(msg);
    }

    return wsCopy;
  }

  /**
Description