MCPcopy
hub / github.com/Kong/insomnia / fetchRequestFromCwd

Method fetchRequestFromCwd

packages/insomnia/bin/yarn-standalone.js:6243–6535  ·  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

6241 */
6242
6243 fetchRequestFromCwd(excludePatterns = [], ignoreUnusedPatterns = false) {
6244 var _this = this;
6245
6246 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
6247 const patterns = [];
6248 const deps = [];
6249 let resolutionDeps = [];
6250 const manifest = {};
6251
6252 const ignorePatterns = [];
6253 const usedPatterns = [];
6254 let workspaceLayout;
6255
6256 // some commands should always run in the context of the entire workspace
6257 const cwd = _this.flags.includeWorkspaceDeps || _this.flags.workspaceRootIsCwd ? _this.config.lockfileFolder : _this.config.cwd;
6258
6259 // non-workspaces are always root, otherwise check for workspace root
6260 const cwdIsRoot = !_this.config.workspaceRootFolder || _this.config.lockfileFolder === cwd;
6261
6262 // exclude package names that are in install args
6263 const excludeNames = [];
6264 for (var _iterator = excludePatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
6265 var _ref;
6266
6267 if (_isArray) {
6268 if (_i >= _iterator.length) break;
6269 _ref = _iterator[_i++];
6270 } else {
6271 _i = _iterator.next();
6272 if (_i.done) break;
6273 _ref = _i.value;
6274 }
6275
6276 const pattern = _ref;
6277
6278 if ((0, (_index3 || _load_index3()).getExoticResolver)(pattern)) {
6279 excludeNames.push((0, (_guessName || _load_guessName()).default)(pattern));
6280 } else {
6281 // extract the name
6282 const parts = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern);
6283 excludeNames.push(parts.name);
6284 }
6285 }
6286
6287 const stripExcluded = function stripExcluded(manifest) {
6288 for (var _iterator2 = excludeNames, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
6289 var _ref2;
6290
6291 if (_isArray2) {
6292 if (_i2 >= _iterator2.length) break;
6293 _ref2 = _iterator2[_i2++];
6294 } else {
6295 _i2 = _iterator2.next();
6296 if (_i2.done) break;
6297 _ref2 = _i2.value;
6298 }
6299
6300 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_workspaceLayoutFunction · 0.85
_load_extendsFunction · 0.85
_load_constantsFunction · 0.85
readJsonMethod · 0.80
resolveWorkspacesMethod · 0.80

Tested by

no test coverage detected