fetchRequestFromCwd(excludePatterns = [], ignoreUnusedPatterns = false) {
    var _this = this;

    return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
      const patterns = [];
      const deps = [];
      let resolutionDeps = [];
      const manifest = {};

      const ignorePatterns = [];
      const usedPatterns = [];
      let workspaceLayout;

      // some commands should always run in the context of the entire workspace
      const cwd = _this.flags.includeWorkspaceDeps || _this.flags.workspaceRootIsCwd ? _this.config.lockfileFolder : _this.config.cwd;

      // non-workspaces are always root, otherwise check for workspace root
      const cwdIsRoot = !_this.config.workspaceRootFolder || _this.config.lockfileFolder === cwd;

      // exclude package names that are in install args
      const excludeNames = [];
      for (var _iterator = excludePatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
        var _ref;

        if (_isArray) {
          if (_i >= _iterator.length) break;
          _ref = _iterator[_i++];
        } else {
          _i = _iterator.next();
          if (_i.done) break;
          _ref = _i.value;
        }

        const pattern = _ref;

        if ((0, (_index3 || _load_index3()).getExoticResolver)(pattern)) {
          excludeNames.push((0, (_guessName || _load_guessName()).default)(pattern));
        } else {
          // extract the name
          const parts = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern);
          excludeNames.push(parts.name);
        }
      }

      const stripExcluded = function stripExcluded(manifest) {
        for (var _iterator2 = excludeNames, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
          var _ref2;

          if (_isArray2) {
            if (_i2 >= _iterator2.length) break;
            _ref2 = _iterator2[_i2++];
          } else {
            _i2 = _iterator2.next();
            if (_i2.done) break;
            _ref2 = _i2.value;
          }

          const exclude = _ref2;

          if (manifest.dependencies && manifest.dependencies[exclude]) {
            delete manifest.dependencies[exclude];
          }
          if (manifest.devDependencies && manifest.devDependencies[exclude]) {
            delete manifest.devDependencies[exclude];
          }
          if (manifest.optionalDependencies && manifest.optionalDependencies[exclude]) {
            delete manifest.optionalDependencies[exclude];
          }
        }
      };

      for (var _iterator3 = Object.keys((_index2 || _load_index2()).registries), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
        var _ref3;

        if (_isArray3) {
          if (_i3 >= _iterator3.length) break;
          _ref3 = _iterator3[_i3++];
        } else {
          _i3 = _iterator3.next();
          if (_i3.done) break;
          _ref3 = _i3.value;
        }

        const registry = _ref3;

        const filename = (_index2 || _load_index2()).registries[registry].filename;

        const loc = path.join(cwd, filename);
        if (!(yield (_fs || _load_fs()).exists(loc))) {
          continue;
        }

        _this.rootManifestRegistries.push(registry);

        const projectManifestJson = yield _this.config.readJson(loc);
        yield (0, (_index || _load_index()).default)(projectManifestJson, cwd, _this.config, cwdIsRoot);

        Object.assign(_this.resolutions, projectManifestJson.resolutions);
        Object.assign(manifest, projectManifestJson);

        _this.resolutionMap.init(_this.resolutions);
        for (var _iterator4 = Object.keys(_this.resolutionMap.resolutionsByPackage), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
          var _ref4;

          if (_isArray4) {
            if (_i4 >= _iterator4.length) break;
            _ref4 = _iterator4[_i4++];
          } else {
            _i4 = _iterator4.next();
            if (_i4.done) break;
            _ref4 = _i4.value;
          }

          const packageName = _ref4;

          const optional = (_objectPath || _load_objectPath()).default.has(manifest.optionalDependencies, packageName) && _this.flags.ignoreOptional;
          for (var _iterator8 = _this.resolutionMap.resolutionsByPackage[packageName], _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) {
            var _ref9;

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

            const _ref8 = _ref9;
            const pattern = _ref8.pattern;

            resolutionDeps = [...resolutionDeps, { registry, pattern, optional, hint: 'resolution' }];
          }
        }

        const pushDeps = function pushDeps(depType, manifest, { hint, optional }, isUsed) {
          if (ignoreUnusedPatterns && !isUsed) {
            return;
          }
          // We only take unused dependencies into consideration to get deterministic hoisting.
          // Since flat mode doesn't care about hoisting and everything is top level and specified then we can safely
          // leave these out.
          if (_this.flags.flat && !isUsed) {
            return;
          }
          const depMap = manifest[depType];
          for (const name in depMap) {
            if (excludeNames.indexOf(name) >= 0) {
              continue;
            }

            let pattern = name;
            if (!_this.lockfile.getLocked(pattern)) {
              // when we use --save we save the dependency to the lockfile with just the name rather than the
              // version combo
              pattern += '@' + depMap[name];
            }

            // normalization made sure packages are mentioned only once
            if (isUsed) {
              usedPatterns.push(pattern);
            } else {
              ignorePatterns.push(pattern);
            }

            _this.rootPatternsToOrigin[pattern] = depType;
            patterns.push(pattern);
            deps.push({ pattern, registry, hint, optional, workspaceName: manifest.name, workspaceLoc: manifest._loc });
          }
        };

        if (cwdIsRoot) {
          pushDeps('dependencies', projectManifestJson, { hint: null, optional: false }, true);
          pushDeps('devDependencies', projectManifestJson, { hint: 'dev', optional: false }, !_this.config.production);
          pushDeps('optionalDependencies', projectManifestJson, { hint: 'optional', optional: true }, true);
        }

        if (_this.config.workspaceRootFolder) {
          const workspaceLoc = cwdIsRoot ? loc : path.join(_this.config.lockfileFolder, filename);
          const workspacesRoot = path.dirname(workspaceLoc);

          let workspaceManifestJson = projectManifestJson;
          if (!cwdIsRoot) {
            // the manifest we read before was a child workspace, so get the root
            workspaceManifestJson = yield _this.config.readJson(workspaceLoc);
            yield (0, (_index || _load_index()).default)(workspaceManifestJson, workspacesRoot, _this.config, true);
          }

          const workspaces = yield _this.config.resolveWorkspaces(workspacesRoot, workspaceManifestJson);
          workspaceLayout = new (_workspaceLayout || _load_workspaceLayout()).default(workspaces, _this.config);

          // add virtual manifest that depends on all workspaces, this way package hoisters and resolvers will work fine
          const workspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.dependencies);
          for (var _iterator5 = Object.keys(workspaces), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
            var _ref5;

            if (_isArray5) {
              if (_i5 >= _iterator5.length) break;
              _ref5 = _iterator5[_i5++];
            } else {
              _i5 = _iterator5.next();
              if (_i5.done) break;
              _ref5 = _i5.value;
            }

            const workspaceName = _ref5;

            const workspaceManifest = workspaces[workspaceName].manifest;
            workspaceDependencies[workspaceName] = workspaceManifest.version;

            // include dependencies from all workspaces
            if (_this.flags.includeWorkspaceDeps) {
              pushDeps('dependencies', workspaceManifest, { hint: null, optional: false }, true);
              pushDeps('devDependencies', workspaceManifest, { hint: 'dev', optional: false }, !_this.config.production);
              pushDeps('optionalDependencies', workspaceManifest, { hint: 'optional', optional: true }, true);
            }
          }
          const virtualDependencyManifest = {
            _uid: '',
            name: `workspace-aggregator-${uuid.v4()}`,
            version: '1.0.0',
            _registry: 'npm',
            _loc: workspacesRoot,
            dependencies: workspaceDependencies,
            devDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.devDependencies),
            optionalDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.optionalDependencies),
            private: workspaceManifestJson.private,
            workspaces: workspaceManifestJson.workspaces
          };
          workspaceLayout.virtualManifestName = virtualDependencyManifest.name;
          const virtualDep = {};
          virtualDep[virtualDependencyManifest.name] = virtualDependencyManifest.version;
          workspaces[virtualDependencyManifest.name] = { loc: workspacesRoot, manifest: virtualDependencyManifest };

          // ensure dependencies that should be excluded are stripped from the correct manifest
          stripExcluded(cwdIsRoot ? virtualDependencyManifest : workspaces[projectManifestJson.name].manifest);

          pushDeps('workspaces', { workspaces: virtualDep }, { hint: 'workspaces', optional: false }, true);

          const implicitWorkspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceDependencies);

          for (var _iterator6 = (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
            var _ref6;

            if (_isArray6) {
              if (_i6 >= _iterator6.length) break;
              _ref6 = _iterator6[_i6++];
            } else {
              _i6 = _iterator6.next();
              if (_i6.done) break;
              _ref6 = _i6.value;
            }

            const type = _ref6;

            for (var _iterator7 = Object.keys(projectManifestJson[type] || {}), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) {
              var _ref7;

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

              const dependencyName = _ref7;

              delete implicitWorkspaceDependencies[dependencyName];
            }
          }

          pushDeps('dependencies', { dependencies: implicitWorkspaceDependencies }, { hint: 'workspaces', optional: false }, true);
        }

        break;
      }

      // inherit root flat flag
      if (manifest.flat) {
        _this.flags.flat = true;
      }

      return {
        requests: [...resolutionDeps, ...deps],
        patterns,
        manifest,
        usedPatterns,
        ignorePatterns,
        workspaceLayout
      };
    })();
  }
Create a list of dependency requests from the current directories manifests.