MCPcopy
hub / github.com/vercel/hyper / fetchRequestFromCwd

Method fetchRequestFromCwd

bin/yarn-standalone.js:6326–6619  ·  view source on GitHub ↗

* Create a list of dependency requests from the current directories manifests.

(excludePatterns = [], ignoreUnusedPatterns = false)

Source from the content-addressed store, hash-verified

6324 */
6325
6326 fetchRequestFromCwd(excludePatterns = [], ignoreUnusedPatterns = false) {
6327 var _this = this;
6328
6329 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
6330 const patterns = [];
6331 const deps = [];
6332 let resolutionDeps = [];
6333 const manifest = {};
6334
6335 const ignorePatterns = [];
6336 const usedPatterns = [];
6337 let workspaceLayout;
6338
6339 // some commands should always run in the context of the entire workspace
6340 const cwd = _this.flags.includeWorkspaceDeps || _this.flags.workspaceRootIsCwd ? _this.config.lockfileFolder : _this.config.cwd;
6341
6342 // non-workspaces are always root, otherwise check for workspace root
6343 const cwdIsRoot = !_this.config.workspaceRootFolder || _this.config.lockfileFolder === cwd;
6344
6345 // exclude package names that are in install args
6346 const excludeNames = [];
6347 for (var _iterator = excludePatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
6348 var _ref;
6349
6350 if (_isArray) {
6351 if (_i >= _iterator.length) break;
6352 _ref = _iterator[_i++];
6353 } else {
6354 _i = _iterator.next();
6355 if (_i.done) break;
6356 _ref = _i.value;
6357 }
6358
6359 const pattern = _ref;
6360
6361 if ((0, (_index3 || _load_index3()).getExoticResolver)(pattern)) {
6362 excludeNames.push((0, (_guessName || _load_guessName()).default)(pattern));
6363 } else {
6364 // extract the name
6365 const parts = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern);
6366 excludeNames.push(parts.name);
6367 }
6368 }
6369
6370 const stripExcluded = function stripExcluded(manifest) {
6371 for (var _iterator2 = excludeNames, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
6372 var _ref2;
6373
6374 if (_isArray2) {
6375 if (_i2 >= _iterator2.length) break;
6376 _ref2 = _iterator2[_i2++];
6377 } else {
6378 _i2 = _iterator2.next();
6379 if (_i2.done) break;
6380 _ref2 = _i2.value;
6381 }
6382
6383 const exclude = _ref2;

Callers

nothing calls this directly

Calls 15

_load_asyncToGeneratorFunction · 0.85
_load_index3Function · 0.85
_load_guessNameFunction · 0.85
_load_normalizePatternFunction · 0.85
_load_index2Function · 0.85
_load_fsFunction · 0.85
_load_indexFunction · 0.85
_load_objectPathFunction · 0.85
_load_workspaceLayoutFunction · 0.85
_load_extendsFunction · 0.85
_load_constantsFunction · 0.85
readJsonMethod · 0.80

Tested by

no test coverage detected