diff --git a/.github/ISSUE_TEMPLATE/functional-tests-for-a-component.md b/.github/ISSUE_TEMPLATE/functional-tests-for-a-component.md index 3f18ce9e5..bd932a920 100644 --- a/.github/ISSUE_TEMPLATE/functional-tests-for-a-component.md +++ b/.github/ISSUE_TEMPLATE/functional-tests-for-a-component.md @@ -2,9 +2,8 @@ name: Functional tests for a component about: Use this template to create issues for writing functional tests for c... title: Functional tests for [Component] -labels: '' -assignees: '' - +labels: "" +assignees: "" --- - [ ] Align with design, product, other engineers, if necessary, on what functionality to test @@ -12,12 +11,14 @@ assignees: '' - [ ] Write the tests in the index.test.tsx for the component. ### Tips for writing functional tests: + - Consider the various types of [queries within the React Testing Library and when to use which](https://testing-library.com/docs/queries/about/#types-of-queries) - [React Testing Library Cheatsheet](https://testing-library.com/docs/react-testing-library/cheatsheet/) - [Guiding principles](https://testing-library.com/docs/guiding-principles/) from React Testing Library - Consider when to group test cases into a single test, for example “if search bar included, it appears in menu” can be combined with “if search bar included, entered text filters to exclude non-matches” in the same test ### Tips for running the tests: + - Make sure the test will fail when it should, too (or even make these test cases themselves to keep as permanent tests). For example, write a test such that if there should be an icon but there’s not, it will fail, in addition to writing a test for if there is an icon it will pass - To save time when running the tests, in Terminal, use the command `lerna run test -- [INSERT LOCAL PATH TO TEST FILE]` to limit the tests that are run to those within a given component’s test file only (e.g. `lerna run test -- /Users/quigley/sci-components/packages/components/src/core/Button/button.test.tsx` for running tests for the Button component only) - To save even more time and to help isolate an individual test when troubleshooting, you can limit to a single test to run within the component’s suite by adding `.only` directly after `it` for the particular test as such: `it.only(“...` diff --git a/.github/ISSUE_TEMPLATE/visual-tests-for-a-component.md b/.github/ISSUE_TEMPLATE/visual-tests-for-a-component.md index a40c9fe05..b15e2720c 100644 --- a/.github/ISSUE_TEMPLATE/visual-tests-for-a-component.md +++ b/.github/ISSUE_TEMPLATE/visual-tests-for-a-component.md @@ -1,15 +1,15 @@ --- name: Visual tests for a component -about: Use this template to create issues for writing visual (Chromatic) tests for +about: + Use this template to create issues for writing visual (Chromatic) tests for components title: Visual tests for [Component] labels: Test Cases Epic -assignees: '' - +assignees: "" --- - [ ] Align with design, product, and other engineers, if necessary, on what visual traits to include as permutation dimensions for the Chromatic test -- As a starting point, you can find the component in this doc: [Chromatic tests: Which component dimensions to consider looping through](https://docs.google.com/document/d/1i40YV1rX61dNzGsqbhqJAD8PL1puCecX7rnHgD_FawE/edit#heading=h.s63zmnx3lqv1) +- As a starting point, you can find the component in this doc: [Chromatic tests: Which component dimensions to consider looping through](https://docs.google.com/document/d/1i40YV1rX61dNzGsqbhqJAD8PL1puCecX7rnHgD_FawE/edit#heading=h.s63zmnx3lqv1) - Permutation dimensions may include the component’s props, but it may not always be necessary to include every prop - If the component can be interacted with, or if part of it can (e.g. an “x” button or similar within it), it may need pseudo state as a permutation dimension. (The SDS codebase already has a [pseudo state addon for Storybook integrated](https://storybook.js.org/addons/storybook-addon-pseudo-states), but each relevant state will need to be looped through, see next bullet for an example.) diff --git a/.yarn/releases/yarn-1.19.0.js b/.yarn/releases/yarn-1.19.0.js index 76bd3be94..226c89cb4 100755 --- a/.yarn/releases/yarn-1.19.0.js +++ b/.yarn/releases/yarn-1.19.0.js @@ -194,8 +194,8 @@ and limitations under the License. c < 3 ? target : desc === null - ? (desc = Object.getOwnPropertyDescriptor(target, key)) - : desc, + ? (desc = Object.getOwnPropertyDescriptor(target, key)) + : desc, d; if ( typeof Reflect === "object" && @@ -290,8 +290,8 @@ and limitations under the License. op[0] & 2 ? y["return"] : op[0] - ? y["throw"] || ((t = y["return"]) && t.call(y), 0) - : y.next) && + ? y["throw"] || ((t = y["return"]) && t.call(y), 0) + : y.next) && !(t = t.call(y, op[1])).done) ) return t; @@ -466,8 +466,8 @@ and limitations under the License. return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f - ? f(v) - : v; + ? f(v) + : v; } : f; } @@ -638,421 +638,421 @@ and limitations under the License. let buildActionsForCopy = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - queue, - events, - possibleExtraneous, - reporter - ) { - // - let build = (() => { - var _ref5 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)( - function* (data) { - const src = data.src, - dest = data.dest, - type = data.type; - - const onFresh = data.onFresh || noop; - const onDone = data.onDone || noop; - - // TODO https://github.com/yarnpkg/yarn/issues/3751 - // related to bundled dependencies handling - if (files.has(dest.toLowerCase())) { - reporter.verbose( - `The case-insensitive file ${dest} shouldn't be copied twice in one bulk copy` - ); - } else { - files.add(dest.toLowerCase()); - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (queue, events, possibleExtraneous, reporter) { + // + let build = (() => { + var _ref5 = (0, + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (data) { + const src = data.src, + dest = data.dest, + type = data.type; - if (type === "symlink") { - yield mkdirp((_path || _load_path()).default.dirname(dest)); - onFresh(); - actions.symlink.push({ - dest, - linkname: src, - }); - onDone(); - return; - } + const onFresh = data.onFresh || noop; + const onDone = data.onDone || noop; - if ( - events.ignoreBasenames.indexOf( - (_path || _load_path()).default.basename(src) - ) >= 0 - ) { - // ignored file - return; - } + // TODO https://github.com/yarnpkg/yarn/issues/3751 + // related to bundled dependencies handling + if (files.has(dest.toLowerCase())) { + reporter.verbose( + `The case-insensitive file ${dest} shouldn't be copied twice in one bulk copy` + ); + } else { + files.add(dest.toLowerCase()); + } - const srcStat = yield lstat(src); - let srcFiles; + if (type === "symlink") { + yield mkdirp((_path || _load_path()).default.dirname(dest)); + onFresh(); + actions.symlink.push({ + dest, + linkname: src, + }); + onDone(); + return; + } - if (srcStat.isDirectory()) { - srcFiles = yield readdir(src); - } + if ( + events.ignoreBasenames.indexOf( + (_path || _load_path()).default.basename(src) + ) >= 0 + ) { + // ignored file + return; + } - let destStat; - try { - // try accessing the destination - destStat = yield lstat(dest); - } catch (e) { - // proceed if destination doesn't exist, otherwise error - if (e.code !== "ENOENT") { - throw e; + const srcStat = yield lstat(src); + let srcFiles; + + if (srcStat.isDirectory()) { + srcFiles = yield readdir(src); + } + + let destStat; + try { + // try accessing the destination + destStat = yield lstat(dest); + } catch (e) { + // proceed if destination doesn't exist, otherwise error + if (e.code !== "ENOENT") { + throw e; + } } - } - // if destination exists - if (destStat) { - const bothSymlinks = - srcStat.isSymbolicLink() && destStat.isSymbolicLink(); - const bothFolders = - srcStat.isDirectory() && destStat.isDirectory(); - const bothFiles = srcStat.isFile() && destStat.isFile(); + // if destination exists + if (destStat) { + const bothSymlinks = + srcStat.isSymbolicLink() && destStat.isSymbolicLink(); + const bothFolders = + srcStat.isDirectory() && destStat.isDirectory(); + const bothFiles = srcStat.isFile() && destStat.isFile(); - // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving - // us modes that aren't valid. investigate this, it's generally safe to proceed. + // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving + // us modes that aren't valid. investigate this, it's generally safe to proceed. - /* if (srcStat.mode !== destStat.mode) { + /* if (srcStat.mode !== destStat.mode) { try { await access(dest, srcStat.mode); } catch (err) {} } */ - if (bothFiles && artifactFiles.has(dest)) { - // this file gets changed during build, likely by a custom install script. Don't bother checking it. - onDone(); - reporter.verbose( - reporter.lang("verboseFileSkipArtifact", src) - ); - return; - } + if (bothFiles && artifactFiles.has(dest)) { + // this file gets changed during build, likely by a custom install script. Don't bother checking it. + onDone(); + reporter.verbose( + reporter.lang("verboseFileSkipArtifact", src) + ); + return; + } - if ( - bothFiles && - srcStat.size === destStat.size && - (0, (_fsNormalized || _load_fsNormalized()).fileDatesEqual)( - srcStat.mtime, - destStat.mtime - ) - ) { - // we can safely assume this is the same file - onDone(); - reporter.verbose( - reporter.lang( - "verboseFileSkip", - src, - dest, - srcStat.size, - +srcStat.mtime + if ( + bothFiles && + srcStat.size === destStat.size && + (0, + (_fsNormalized || _load_fsNormalized()).fileDatesEqual)( + srcStat.mtime, + destStat.mtime ) - ); - return; - } - - if (bothSymlinks) { - const srcReallink = yield readlink(src); - if (srcReallink === (yield readlink(dest))) { - // if both symlinks are the same then we can continue on + ) { + // we can safely assume this is the same file onDone(); reporter.verbose( reporter.lang( - "verboseFileSkipSymlink", + "verboseFileSkip", src, dest, - srcReallink + srcStat.size, + +srcStat.mtime ) ); return; } - } - if (bothFolders) { - // mark files that aren't in this folder as possibly extraneous - const destFiles = yield readdir(dest); - invariant(srcFiles, "src files not initialised"); + if (bothSymlinks) { + const srcReallink = yield readlink(src); + if (srcReallink === (yield readlink(dest))) { + // if both symlinks are the same then we can continue on + onDone(); + reporter.verbose( + reporter.lang( + "verboseFileSkipSymlink", + src, + dest, + srcReallink + ) + ); + return; + } + } - for ( - var _iterator4 = destFiles, - _isArray4 = Array.isArray(_iterator4), - _i4 = 0, - _iterator4 = _isArray4 - ? _iterator4 - : _iterator4[Symbol.iterator](); - ; + if (bothFolders) { + // mark files that aren't in this folder as possibly extraneous + const destFiles = yield readdir(dest); + invariant(srcFiles, "src files not initialised"); - ) { - var _ref6; + for ( + var _iterator4 = destFiles, + _isArray4 = Array.isArray(_iterator4), + _i4 = 0, + _iterator4 = _isArray4 + ? _iterator4 + : _iterator4[Symbol.iterator](); + ; - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref6 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref6 = _i4.value; - } + ) { + var _ref6; - const file = _ref6; + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref6 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref6 = _i4.value; + } - if (srcFiles.indexOf(file) < 0) { - const loc = (_path || _load_path()).default.join( - dest, - file - ); - possibleExtraneous.add(loc); - - if ((yield lstat(loc)).isDirectory()) { - for ( - var _iterator5 = yield readdir(loc), - _isArray5 = Array.isArray(_iterator5), - _i5 = 0, - _iterator5 = _isArray5 - ? _iterator5 - : _iterator5[Symbol.iterator](); - ; + const file = _ref6; - ) { - var _ref7; + if (srcFiles.indexOf(file) < 0) { + const loc = (_path || _load_path()).default.join( + dest, + file + ); + possibleExtraneous.add(loc); - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref7 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref7 = _i5.value; - } + if ((yield lstat(loc)).isDirectory()) { + for ( + var _iterator5 = yield readdir(loc), + _isArray5 = Array.isArray(_iterator5), + _i5 = 0, + _iterator5 = _isArray5 + ? _iterator5 + : _iterator5[Symbol.iterator](); + ; - const file = _ref7; + ) { + var _ref7; - possibleExtraneous.add( - (_path || _load_path()).default.join(loc, file) - ); + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref7 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref7 = _i5.value; + } + + const file = _ref7; + + possibleExtraneous.add( + (_path || _load_path()).default.join(loc, file) + ); + } } } } } } - } - - if (destStat && destStat.isSymbolicLink()) { - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)( - dest - ); - destStat = null; - } - - if (srcStat.isSymbolicLink()) { - onFresh(); - const linkname = yield readlink(src); - actions.symlink.push({ - dest, - linkname, - }); - onDone(); - } else if (srcStat.isDirectory()) { - if (!destStat) { - reporter.verbose(reporter.lang("verboseFileFolder", dest)); - yield mkdirp(dest); - } - const destParts = dest.split( - (_path || _load_path()).default.sep - ); - while (destParts.length) { - files.add( - destParts - .join((_path || _load_path()).default.sep) - .toLowerCase() + if (destStat && destStat.isSymbolicLink()) { + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)( + dest ); - destParts.pop(); + destStat = null; } - // push all files to queue - invariant(srcFiles, "src files not initialised"); - let remaining = srcFiles.length; - if (!remaining) { + if (srcStat.isSymbolicLink()) { + onFresh(); + const linkname = yield readlink(src); + actions.symlink.push({ + dest, + linkname, + }); onDone(); - } - for ( - var _iterator6 = srcFiles, - _isArray6 = Array.isArray(_iterator6), - _i6 = 0, - _iterator6 = _isArray6 - ? _iterator6 - : _iterator6[Symbol.iterator](); - ; + } else if (srcStat.isDirectory()) { + if (!destStat) { + reporter.verbose( + reporter.lang("verboseFileFolder", dest) + ); + yield mkdirp(dest); + } - ) { - var _ref8; + const destParts = dest.split( + (_path || _load_path()).default.sep + ); + while (destParts.length) { + files.add( + destParts + .join((_path || _load_path()).default.sep) + .toLowerCase() + ); + destParts.pop(); + } - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref8 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref8 = _i6.value; + // push all files to queue + invariant(srcFiles, "src files not initialised"); + let remaining = srcFiles.length; + if (!remaining) { + onDone(); } + for ( + var _iterator6 = srcFiles, + _isArray6 = Array.isArray(_iterator6), + _i6 = 0, + _iterator6 = _isArray6 + ? _iterator6 + : _iterator6[Symbol.iterator](); + ; - const file = _ref8; + ) { + var _ref8; - queue.push({ - dest: (_path || _load_path()).default.join(dest, file), - onFresh, - onDone: (function (_onDone) { - function onDone() { - return _onDone.apply(this, arguments); - } + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref8 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref8 = _i6.value; + } - onDone.toString = function () { - return _onDone.toString(); - }; + const file = _ref8; - return onDone; - })(function () { - if (--remaining === 0) { - onDone(); - } - }), - src: (_path || _load_path()).default.join(src, file), + queue.push({ + dest: (_path || _load_path()).default.join(dest, file), + onFresh, + onDone: (function (_onDone) { + function onDone() { + return _onDone.apply(this, arguments); + } + + onDone.toString = function () { + return _onDone.toString(); + }; + + return onDone; + })(function () { + if (--remaining === 0) { + onDone(); + } + }), + src: (_path || _load_path()).default.join(src, file), + }); + } + } else if (srcStat.isFile()) { + onFresh(); + actions.file.push({ + src, + dest, + atime: srcStat.atime, + mtime: srcStat.mtime, + mode: srcStat.mode, }); + onDone(); + } else { + throw new Error(`unsure how to copy this: ${src}`); } - } else if (srcStat.isFile()) { - onFresh(); - actions.file.push({ - src, - dest, - atime: srcStat.atime, - mtime: srcStat.mtime, - mode: srcStat.mode, - }); - onDone(); - } else { - throw new Error(`unsure how to copy this: ${src}`); } - } - ); + ); - return function build(_x5) { - return _ref5.apply(this, arguments); - }; - })(); + return function build(_x5) { + return _ref5.apply(this, arguments); + }; + })(); - const artifactFiles = new Set(events.artifactFiles || []); - const files = new Set(); + const artifactFiles = new Set(events.artifactFiles || []); + const files = new Set(); - // initialise events - for ( - var _iterator = queue, - _isArray = Array.isArray(_iterator), - _i = 0, - _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); - ; + // initialise events + for ( + var _iterator = queue, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); + ; - ) { - var _ref2; + ) { + var _ref2; - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; - } + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } - const item = _ref2; + const item = _ref2; - const onDone = item.onDone; - item.onDone = function () { - events.onProgress(item.dest); - if (onDone) { - onDone(); - } - }; - } - events.onStart(queue.length); + const onDone = item.onDone; + item.onDone = function () { + events.onProgress(item.dest); + if (onDone) { + onDone(); + } + }; + } + events.onStart(queue.length); - // start building actions - const actions = { - file: [], - symlink: [], - link: [], - }; + // start building actions + const actions = { + file: [], + symlink: [], + link: [], + }; - // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items - // at a time due to the requirement to push items onto the queue - while (queue.length) { - const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); - yield Promise.all(items.map(build)); - } + // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items + // at a time due to the requirement to push items onto the queue + while (queue.length) { + const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); + yield Promise.all(items.map(build)); + } - // simulate the existence of some files to prevent considering them extraneous - for ( - var _iterator2 = artifactFiles, - _isArray2 = Array.isArray(_iterator2), - _i2 = 0, - _iterator2 = _isArray2 - ? _iterator2 - : _iterator2[Symbol.iterator](); - ; + // simulate the existence of some files to prevent considering them extraneous + for ( + var _iterator2 = artifactFiles, + _isArray2 = Array.isArray(_iterator2), + _i2 = 0, + _iterator2 = _isArray2 + ? _iterator2 + : _iterator2[Symbol.iterator](); + ; - ) { - var _ref3; + ) { + var _ref3; - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref3 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref3 = _i2.value; - } + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } - const file = _ref3; + const file = _ref3; - if (possibleExtraneous.has(file)) { - reporter.verbose( - reporter.lang("verboseFilePhantomExtraneous", file) - ); - possibleExtraneous.delete(file); + if (possibleExtraneous.has(file)) { + reporter.verbose( + reporter.lang("verboseFilePhantomExtraneous", file) + ); + possibleExtraneous.delete(file); + } } - } - for ( - var _iterator3 = possibleExtraneous, - _isArray3 = Array.isArray(_iterator3), - _i3 = 0, - _iterator3 = _isArray3 - ? _iterator3 - : _iterator3[Symbol.iterator](); - ; + for ( + var _iterator3 = possibleExtraneous, + _isArray3 = Array.isArray(_iterator3), + _i3 = 0, + _iterator3 = _isArray3 + ? _iterator3 + : _iterator3[Symbol.iterator](); + ; - ) { - var _ref4; + ) { + var _ref4; - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref4 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref4 = _i3.value; - } + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } - const loc = _ref4; + const loc = _ref4; - if (files.has(loc.toLowerCase())) { - possibleExtraneous.delete(loc); + if (files.has(loc.toLowerCase())) { + possibleExtraneous.delete(loc); + } } - } - return actions; - }); + return actions; + } + ); return function buildActionsForCopy(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -1061,381 +1061,378 @@ and limitations under the License. let buildActionsForHardlink = (() => { var _ref9 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - queue, - events, - possibleExtraneous, - reporter - ) { - // - let build = (() => { - var _ref13 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)( - function* (data) { - const src = data.src, - dest = data.dest; - - const onFresh = data.onFresh || noop; - const onDone = data.onDone || noop; - if (files.has(dest.toLowerCase())) { - // Fixes issue https://github.com/yarnpkg/yarn/issues/2734 - // When bulk hardlinking we have A -> B structure that we want to hardlink to A1 -> B1, - // package-linker passes that modules A1 and B1 need to be hardlinked, - // the recursive linking algorithm of A1 ends up scheduling files in B1 to be linked twice which will case - // an exception. - onDone(); - return; - } - files.add(dest.toLowerCase()); - - if ( - events.ignoreBasenames.indexOf( - (_path || _load_path()).default.basename(src) - ) >= 0 - ) { - // ignored file - return; - } - - const srcStat = yield lstat(src); - let srcFiles; - - if (srcStat.isDirectory()) { - srcFiles = yield readdir(src); - } - - const destExists = yield exists(dest); - if (destExists) { - const destStat = yield lstat(dest); - - const bothSymlinks = - srcStat.isSymbolicLink() && destStat.isSymbolicLink(); - const bothFolders = - srcStat.isDirectory() && destStat.isDirectory(); - const bothFiles = srcStat.isFile() && destStat.isFile(); - - if (srcStat.mode !== destStat.mode) { - try { - yield access(dest, srcStat.mode); - } catch (err) { - // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving - // us modes that aren't valid. investigate this, it's generally safe to proceed. - reporter.verbose(err); - } - } - - if (bothFiles && artifactFiles.has(dest)) { - // this file gets changed during build, likely by a custom install script. Don't bother checking it. + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (queue, events, possibleExtraneous, reporter) { + // + let build = (() => { + var _ref13 = (0, + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (data) { + const src = data.src, + dest = data.dest; + + const onFresh = data.onFresh || noop; + const onDone = data.onDone || noop; + if (files.has(dest.toLowerCase())) { + // Fixes issue https://github.com/yarnpkg/yarn/issues/2734 + // When bulk hardlinking we have A -> B structure that we want to hardlink to A1 -> B1, + // package-linker passes that modules A1 and B1 need to be hardlinked, + // the recursive linking algorithm of A1 ends up scheduling files in B1 to be linked twice which will case + // an exception. onDone(); - reporter.verbose( - reporter.lang("verboseFileSkipArtifact", src) - ); return; } + files.add(dest.toLowerCase()); - // correct hardlink if ( - bothFiles && - srcStat.ino !== null && - srcStat.ino === destStat.ino + events.ignoreBasenames.indexOf( + (_path || _load_path()).default.basename(src) + ) >= 0 ) { - onDone(); - reporter.verbose( - reporter.lang("verboseFileSkip", src, dest, srcStat.ino) - ); + // ignored file return; } - if (bothSymlinks) { - const srcReallink = yield readlink(src); - if (srcReallink === (yield readlink(dest))) { - // if both symlinks are the same then we can continue on + const srcStat = yield lstat(src); + let srcFiles; + + if (srcStat.isDirectory()) { + srcFiles = yield readdir(src); + } + + const destExists = yield exists(dest); + if (destExists) { + const destStat = yield lstat(dest); + + const bothSymlinks = + srcStat.isSymbolicLink() && destStat.isSymbolicLink(); + const bothFolders = + srcStat.isDirectory() && destStat.isDirectory(); + const bothFiles = srcStat.isFile() && destStat.isFile(); + + if (srcStat.mode !== destStat.mode) { + try { + yield access(dest, srcStat.mode); + } catch (err) { + // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving + // us modes that aren't valid. investigate this, it's generally safe to proceed. + reporter.verbose(err); + } + } + + if (bothFiles && artifactFiles.has(dest)) { + // this file gets changed during build, likely by a custom install script. Don't bother checking it. onDone(); reporter.verbose( - reporter.lang( - "verboseFileSkipSymlink", - src, - dest, - srcReallink - ) + reporter.lang("verboseFileSkipArtifact", src) ); return; } - } - - if (bothFolders) { - // mark files that aren't in this folder as possibly extraneous - const destFiles = yield readdir(dest); - invariant(srcFiles, "src files not initialised"); - - for ( - var _iterator10 = destFiles, - _isArray10 = Array.isArray(_iterator10), - _i10 = 0, - _iterator10 = _isArray10 - ? _iterator10 - : _iterator10[Symbol.iterator](); - ; + // correct hardlink + if ( + bothFiles && + srcStat.ino !== null && + srcStat.ino === destStat.ino ) { - var _ref14; + onDone(); + reporter.verbose( + reporter.lang("verboseFileSkip", src, dest, srcStat.ino) + ); + return; + } - if (_isArray10) { - if (_i10 >= _iterator10.length) break; - _ref14 = _iterator10[_i10++]; - } else { - _i10 = _iterator10.next(); - if (_i10.done) break; - _ref14 = _i10.value; + if (bothSymlinks) { + const srcReallink = yield readlink(src); + if (srcReallink === (yield readlink(dest))) { + // if both symlinks are the same then we can continue on + onDone(); + reporter.verbose( + reporter.lang( + "verboseFileSkipSymlink", + src, + dest, + srcReallink + ) + ); + return; } + } - const file = _ref14; + if (bothFolders) { + // mark files that aren't in this folder as possibly extraneous + const destFiles = yield readdir(dest); + invariant(srcFiles, "src files not initialised"); - if (srcFiles.indexOf(file) < 0) { - const loc = (_path || _load_path()).default.join( - dest, - file - ); - possibleExtraneous.add(loc); - - if ((yield lstat(loc)).isDirectory()) { - for ( - var _iterator11 = yield readdir(loc), - _isArray11 = Array.isArray(_iterator11), - _i11 = 0, - _iterator11 = _isArray11 - ? _iterator11 - : _iterator11[Symbol.iterator](); - ; + for ( + var _iterator10 = destFiles, + _isArray10 = Array.isArray(_iterator10), + _i10 = 0, + _iterator10 = _isArray10 + ? _iterator10 + : _iterator10[Symbol.iterator](); + ; - ) { - var _ref15; + ) { + var _ref14; - if (_isArray11) { - if (_i11 >= _iterator11.length) break; - _ref15 = _iterator11[_i11++]; - } else { - _i11 = _iterator11.next(); - if (_i11.done) break; - _ref15 = _i11.value; - } + if (_isArray10) { + if (_i10 >= _iterator10.length) break; + _ref14 = _iterator10[_i10++]; + } else { + _i10 = _iterator10.next(); + if (_i10.done) break; + _ref14 = _i10.value; + } - const file = _ref15; + const file = _ref14; - possibleExtraneous.add( - (_path || _load_path()).default.join(loc, file) - ); + if (srcFiles.indexOf(file) < 0) { + const loc = (_path || _load_path()).default.join( + dest, + file + ); + possibleExtraneous.add(loc); + + if ((yield lstat(loc)).isDirectory()) { + for ( + var _iterator11 = yield readdir(loc), + _isArray11 = Array.isArray(_iterator11), + _i11 = 0, + _iterator11 = _isArray11 + ? _iterator11 + : _iterator11[Symbol.iterator](); + ; + + ) { + var _ref15; + + if (_isArray11) { + if (_i11 >= _iterator11.length) break; + _ref15 = _iterator11[_i11++]; + } else { + _i11 = _iterator11.next(); + if (_i11.done) break; + _ref15 = _i11.value; + } + + const file = _ref15; + + possibleExtraneous.add( + (_path || _load_path()).default.join(loc, file) + ); + } } } } } } - } - if (srcStat.isSymbolicLink()) { - onFresh(); - const linkname = yield readlink(src); - actions.symlink.push({ - dest, - linkname, - }); - onDone(); - } else if (srcStat.isDirectory()) { - reporter.verbose(reporter.lang("verboseFileFolder", dest)); - yield mkdirp(dest); + if (srcStat.isSymbolicLink()) { + onFresh(); + const linkname = yield readlink(src); + actions.symlink.push({ + dest, + linkname, + }); + onDone(); + } else if (srcStat.isDirectory()) { + reporter.verbose(reporter.lang("verboseFileFolder", dest)); + yield mkdirp(dest); - const destParts = dest.split( - (_path || _load_path()).default.sep - ); - while (destParts.length) { - files.add( - destParts - .join((_path || _load_path()).default.sep) - .toLowerCase() + const destParts = dest.split( + (_path || _load_path()).default.sep ); - destParts.pop(); - } + while (destParts.length) { + files.add( + destParts + .join((_path || _load_path()).default.sep) + .toLowerCase() + ); + destParts.pop(); + } - // push all files to queue - invariant(srcFiles, "src files not initialised"); - let remaining = srcFiles.length; - if (!remaining) { - onDone(); - } - for ( - var _iterator12 = srcFiles, - _isArray12 = Array.isArray(_iterator12), - _i12 = 0, - _iterator12 = _isArray12 - ? _iterator12 - : _iterator12[Symbol.iterator](); - ; + // push all files to queue + invariant(srcFiles, "src files not initialised"); + let remaining = srcFiles.length; + if (!remaining) { + onDone(); + } + for ( + var _iterator12 = srcFiles, + _isArray12 = Array.isArray(_iterator12), + _i12 = 0, + _iterator12 = _isArray12 + ? _iterator12 + : _iterator12[Symbol.iterator](); + ; - ) { - var _ref16; + ) { + var _ref16; - if (_isArray12) { - if (_i12 >= _iterator12.length) break; - _ref16 = _iterator12[_i12++]; - } else { - _i12 = _iterator12.next(); - if (_i12.done) break; - _ref16 = _i12.value; - } + if (_isArray12) { + if (_i12 >= _iterator12.length) break; + _ref16 = _iterator12[_i12++]; + } else { + _i12 = _iterator12.next(); + if (_i12.done) break; + _ref16 = _i12.value; + } - const file = _ref16; + const file = _ref16; - queue.push({ - onFresh, - src: (_path || _load_path()).default.join(src, file), - dest: (_path || _load_path()).default.join(dest, file), - onDone: (function (_onDone2) { - function onDone() { - return _onDone2.apply(this, arguments); - } + queue.push({ + onFresh, + src: (_path || _load_path()).default.join(src, file), + dest: (_path || _load_path()).default.join(dest, file), + onDone: (function (_onDone2) { + function onDone() { + return _onDone2.apply(this, arguments); + } - onDone.toString = function () { - return _onDone2.toString(); - }; + onDone.toString = function () { + return _onDone2.toString(); + }; - return onDone; - })(function () { - if (--remaining === 0) { - onDone(); - } - }), + return onDone; + })(function () { + if (--remaining === 0) { + onDone(); + } + }), + }); + } + } else if (srcStat.isFile()) { + onFresh(); + actions.link.push({ + src, + dest, + removeDest: destExists, }); + onDone(); + } else { + throw new Error(`unsure how to copy this: ${src}`); } - } else if (srcStat.isFile()) { - onFresh(); - actions.link.push({ - src, - dest, - removeDest: destExists, - }); - onDone(); - } else { - throw new Error(`unsure how to copy this: ${src}`); } - } - ); + ); - return function build(_x10) { - return _ref13.apply(this, arguments); - }; - })(); + return function build(_x10) { + return _ref13.apply(this, arguments); + }; + })(); - const artifactFiles = new Set(events.artifactFiles || []); - const files = new Set(); + const artifactFiles = new Set(events.artifactFiles || []); + const files = new Set(); - // initialise events - for ( - var _iterator7 = queue, - _isArray7 = Array.isArray(_iterator7), - _i7 = 0, - _iterator7 = _isArray7 - ? _iterator7 - : _iterator7[Symbol.iterator](); - ; + // initialise events + for ( + var _iterator7 = queue, + _isArray7 = Array.isArray(_iterator7), + _i7 = 0, + _iterator7 = _isArray7 + ? _iterator7 + : _iterator7[Symbol.iterator](); + ; - ) { - var _ref10; + ) { + var _ref10; - if (_isArray7) { - if (_i7 >= _iterator7.length) break; - _ref10 = _iterator7[_i7++]; - } else { - _i7 = _iterator7.next(); - if (_i7.done) break; - _ref10 = _i7.value; - } + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref10 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref10 = _i7.value; + } - const item = _ref10; + const item = _ref10; - const onDone = item.onDone || noop; - item.onDone = function () { - events.onProgress(item.dest); - onDone(); - }; - } - events.onStart(queue.length); + const onDone = item.onDone || noop; + item.onDone = function () { + events.onProgress(item.dest); + onDone(); + }; + } + events.onStart(queue.length); - // start building actions - const actions = { - file: [], - symlink: [], - link: [], - }; + // start building actions + const actions = { + file: [], + symlink: [], + link: [], + }; - // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items - // at a time due to the requirement to push items onto the queue - while (queue.length) { - const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); - yield Promise.all(items.map(build)); - } + // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items + // at a time due to the requirement to push items onto the queue + while (queue.length) { + const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); + yield Promise.all(items.map(build)); + } - // simulate the existence of some files to prevent considering them extraneous - for ( - var _iterator8 = artifactFiles, - _isArray8 = Array.isArray(_iterator8), - _i8 = 0, - _iterator8 = _isArray8 - ? _iterator8 - : _iterator8[Symbol.iterator](); - ; + // simulate the existence of some files to prevent considering them extraneous + for ( + var _iterator8 = artifactFiles, + _isArray8 = Array.isArray(_iterator8), + _i8 = 0, + _iterator8 = _isArray8 + ? _iterator8 + : _iterator8[Symbol.iterator](); + ; - ) { - var _ref11; + ) { + var _ref11; - if (_isArray8) { - if (_i8 >= _iterator8.length) break; - _ref11 = _iterator8[_i8++]; - } else { - _i8 = _iterator8.next(); - if (_i8.done) break; - _ref11 = _i8.value; - } + if (_isArray8) { + if (_i8 >= _iterator8.length) break; + _ref11 = _iterator8[_i8++]; + } else { + _i8 = _iterator8.next(); + if (_i8.done) break; + _ref11 = _i8.value; + } - const file = _ref11; + const file = _ref11; - if (possibleExtraneous.has(file)) { - reporter.verbose( - reporter.lang("verboseFilePhantomExtraneous", file) - ); - possibleExtraneous.delete(file); + if (possibleExtraneous.has(file)) { + reporter.verbose( + reporter.lang("verboseFilePhantomExtraneous", file) + ); + possibleExtraneous.delete(file); + } } - } - for ( - var _iterator9 = possibleExtraneous, - _isArray9 = Array.isArray(_iterator9), - _i9 = 0, - _iterator9 = _isArray9 - ? _iterator9 - : _iterator9[Symbol.iterator](); - ; + for ( + var _iterator9 = possibleExtraneous, + _isArray9 = Array.isArray(_iterator9), + _i9 = 0, + _iterator9 = _isArray9 + ? _iterator9 + : _iterator9[Symbol.iterator](); + ; - ) { - var _ref12; + ) { + var _ref12; - if (_isArray9) { - if (_i9 >= _iterator9.length) break; - _ref12 = _iterator9[_i9++]; - } else { - _i9 = _iterator9.next(); - if (_i9.done) break; - _ref12 = _i9.value; - } + if (_isArray9) { + if (_i9 >= _iterator9.length) break; + _ref12 = _iterator9[_i9++]; + } else { + _i9 = _iterator9.next(); + if (_i9.done) break; + _ref12 = _i9.value; + } - const loc = _ref12; + const loc = _ref12; - if (files.has(loc.toLowerCase())) { - possibleExtraneous.delete(loc); + if (files.has(loc.toLowerCase())) { + possibleExtraneous.delete(loc); + } } - } - return actions; - }); + return actions; + } + ); return function buildActionsForHardlink(_x6, _x7, _x8, _x9) { return _ref9.apply(this, arguments); @@ -1444,85 +1441,83 @@ and limitations under the License. let copyBulk = (exports.copyBulk = (() => { var _ref17 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - queue, - reporter, - _events - ) { - const events = { - onStart: (_events && _events.onStart) || noop, - onProgress: (_events && _events.onProgress) || noop, - possibleExtraneous: _events - ? _events.possibleExtraneous - : new Set(), - ignoreBasenames: (_events && _events.ignoreBasenames) || [], - artifactFiles: (_events && _events.artifactFiles) || [], - }; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (queue, reporter, _events) { + const events = { + onStart: (_events && _events.onStart) || noop, + onProgress: (_events && _events.onProgress) || noop, + possibleExtraneous: _events + ? _events.possibleExtraneous + : new Set(), + ignoreBasenames: (_events && _events.ignoreBasenames) || [], + artifactFiles: (_events && _events.artifactFiles) || [], + }; - const actions = yield buildActionsForCopy( - queue, - events, - events.possibleExtraneous, - reporter - ); - events.onStart( - actions.file.length + actions.symlink.length + actions.link.length - ); + const actions = yield buildActionsForCopy( + queue, + events, + events.possibleExtraneous, + reporter + ); + events.onStart( + actions.file.length + actions.symlink.length + actions.link.length + ); - const fileActions = actions.file; + const fileActions = actions.file; - const currentlyWriting = new Map(); + const currentlyWriting = new Map(); - yield (_promise || _load_promise()).queue( - fileActions, - (() => { - var _ref18 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)( - function* (data) { - let writePromise; - while ((writePromise = currentlyWriting.get(data.dest))) { - yield writePromise; - } - - reporter.verbose( - reporter.lang("verboseFileCopy", data.src, data.dest) - ); - const copier = (0, - (_fsNormalized || _load_fsNormalized()).copyFile)( - data, - function () { - return currentlyWriting.delete(data.dest); + yield (_promise || _load_promise()).queue( + fileActions, + (() => { + var _ref18 = (0, + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (data) { + let writePromise; + while ((writePromise = currentlyWriting.get(data.dest))) { + yield writePromise; } - ); - currentlyWriting.set(data.dest, copier); - events.onProgress(data.dest); - return copier; - } - ); - return function (_x14) { - return _ref18.apply(this, arguments); - }; - })(), - CONCURRENT_QUEUE_ITEMS - ); + reporter.verbose( + reporter.lang("verboseFileCopy", data.src, data.dest) + ); + const copier = (0, + (_fsNormalized || _load_fsNormalized()).copyFile)( + data, + function () { + return currentlyWriting.delete(data.dest); + } + ); + currentlyWriting.set(data.dest, copier); + events.onProgress(data.dest); + return copier; + } + ); - // we need to copy symlinks last as they could reference files we were copying - const symlinkActions = actions.symlink; - yield (_promise || _load_promise()).queue( - symlinkActions, - function (data) { - const linkname = (_path || _load_path()).default.resolve( - (_path || _load_path()).default.dirname(data.dest), - data.linkname - ); - reporter.verbose( - reporter.lang("verboseFileSymlink", data.dest, linkname) - ); - return symlink(linkname, data.dest); - } - ); - }); + return function (_x14) { + return _ref18.apply(this, arguments); + }; + })(), + CONCURRENT_QUEUE_ITEMS + ); + + // we need to copy symlinks last as they could reference files we were copying + const symlinkActions = actions.symlink; + yield (_promise || _load_promise()).queue( + symlinkActions, + function (data) { + const linkname = (_path || _load_path()).default.resolve( + (_path || _load_path()).default.dirname(data.dest), + data.linkname + ); + reporter.verbose( + reporter.lang("verboseFileSymlink", data.dest, linkname) + ); + return symlink(linkname, data.dest); + } + ); + } + ); return function copyBulk(_x11, _x12, _x13) { return _ref17.apply(this, arguments); @@ -1531,74 +1526,72 @@ and limitations under the License. let hardlinkBulk = (exports.hardlinkBulk = (() => { var _ref19 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - queue, - reporter, - _events - ) { - const events = { - onStart: (_events && _events.onStart) || noop, - onProgress: (_events && _events.onProgress) || noop, - possibleExtraneous: _events - ? _events.possibleExtraneous - : new Set(), - artifactFiles: (_events && _events.artifactFiles) || [], - ignoreBasenames: [], - }; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (queue, reporter, _events) { + const events = { + onStart: (_events && _events.onStart) || noop, + onProgress: (_events && _events.onProgress) || noop, + possibleExtraneous: _events + ? _events.possibleExtraneous + : new Set(), + artifactFiles: (_events && _events.artifactFiles) || [], + ignoreBasenames: [], + }; - const actions = yield buildActionsForHardlink( - queue, - events, - events.possibleExtraneous, - reporter - ); - events.onStart( - actions.file.length + actions.symlink.length + actions.link.length - ); + const actions = yield buildActionsForHardlink( + queue, + events, + events.possibleExtraneous, + reporter + ); + events.onStart( + actions.file.length + actions.symlink.length + actions.link.length + ); - const fileActions = actions.link; + const fileActions = actions.link; - yield (_promise || _load_promise()).queue( - fileActions, - (() => { - var _ref20 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)( - function* (data) { - reporter.verbose( - reporter.lang("verboseFileLink", data.src, data.dest) - ); - if (data.removeDest) { - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)( - data.dest + yield (_promise || _load_promise()).queue( + fileActions, + (() => { + var _ref20 = (0, + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (data) { + reporter.verbose( + reporter.lang("verboseFileLink", data.src, data.dest) ); + if (data.removeDest) { + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)( + data.dest + ); + } + yield link(data.src, data.dest); } - yield link(data.src, data.dest); - } - ); + ); - return function (_x18) { - return _ref20.apply(this, arguments); - }; - })(), - CONCURRENT_QUEUE_ITEMS - ); + return function (_x18) { + return _ref20.apply(this, arguments); + }; + })(), + CONCURRENT_QUEUE_ITEMS + ); - // we need to copy symlinks last as they could reference files we were copying - const symlinkActions = actions.symlink; - yield (_promise || _load_promise()).queue( - symlinkActions, - function (data) { - const linkname = (_path || _load_path()).default.resolve( - (_path || _load_path()).default.dirname(data.dest), - data.linkname - ); - reporter.verbose( - reporter.lang("verboseFileSymlink", data.dest, linkname) - ); - return symlink(linkname, data.dest); - } - ); - }); + // we need to copy symlinks last as they could reference files we were copying + const symlinkActions = actions.symlink; + yield (_promise || _load_promise()).queue( + symlinkActions, + function (data) { + const linkname = (_path || _load_path()).default.resolve( + (_path || _load_path()).default.dirname(data.dest), + data.linkname + ); + reporter.verbose( + reporter.lang("verboseFileSymlink", data.dest, linkname) + ); + return symlink(linkname, data.dest); + } + ); + } + ); return function hardlinkBulk(_x15, _x16, _x17) { return _ref19.apply(this, arguments); @@ -1607,38 +1600,38 @@ and limitations under the License. let readFileAny = (exports.readFileAny = (() => { var _ref21 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - files - ) { - for ( - var _iterator13 = files, - _isArray13 = Array.isArray(_iterator13), - _i13 = 0, - _iterator13 = _isArray13 - ? _iterator13 - : _iterator13[Symbol.iterator](); - ; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (files) { + for ( + var _iterator13 = files, + _isArray13 = Array.isArray(_iterator13), + _i13 = 0, + _iterator13 = _isArray13 + ? _iterator13 + : _iterator13[Symbol.iterator](); + ; - ) { - var _ref22; + ) { + var _ref22; - if (_isArray13) { - if (_i13 >= _iterator13.length) break; - _ref22 = _iterator13[_i13++]; - } else { - _i13 = _iterator13.next(); - if (_i13.done) break; - _ref22 = _i13.value; - } + if (_isArray13) { + if (_i13 >= _iterator13.length) break; + _ref22 = _iterator13[_i13++]; + } else { + _i13 = _iterator13.next(); + if (_i13.done) break; + _ref22 = _i13.value; + } - const file = _ref22; + const file = _ref22; - if (yield exists(file)) { - return readFile(file); + if (yield exists(file)) { + return readFile(file); + } } + return null; } - return null; - }); + ); return function readFileAny(_x19) { return _ref21.apply(this, arguments); @@ -1647,11 +1640,11 @@ and limitations under the License. let readJson = (exports.readJson = (() => { var _ref23 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - loc - ) { - return (yield readJsonAndFile(loc)).object; - }); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (loc) { + return (yield readJsonAndFile(loc)).object; + } + ); return function readJson(_x20) { return _ref23.apply(this, arguments); @@ -1660,22 +1653,22 @@ and limitations under the License. let readJsonAndFile = (exports.readJsonAndFile = (() => { var _ref24 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - loc - ) { - const file = yield readFile(loc); - try { - return { - object: (0, (_map || _load_map()).default)( - JSON.parse(stripBOM(file)) - ), - content: file, - }; - } catch (err) { - err.message = `${loc}: ${err.message}`; - throw err; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (loc) { + const file = yield readFile(loc); + try { + return { + object: (0, (_map || _load_map()).default)( + JSON.parse(stripBOM(file)) + ), + content: file, + }; + } catch (err) { + err.message = `${loc}: ${err.message}`; + throw err; + } } - }); + ); return function readJsonAndFile(_x21) { return _ref24.apply(this, arguments); @@ -1684,26 +1677,25 @@ and limitations under the License. let find = (exports.find = (() => { var _ref25 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - filename, - dir - ) { - const parts = dir.split((_path || _load_path()).default.sep); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (filename, dir) { + const parts = dir.split((_path || _load_path()).default.sep); - while (parts.length) { - const loc = parts - .concat(filename) - .join((_path || _load_path()).default.sep); + while (parts.length) { + const loc = parts + .concat(filename) + .join((_path || _load_path()).default.sep); - if (yield exists(loc)) { - return loc; - } else { - parts.pop(); + if (yield exists(loc)) { + return loc; + } else { + parts.pop(); + } } - } - return false; - }); + return false; + } + ); return function find(_x22, _x23) { return _ref25.apply(this, arguments); @@ -1712,45 +1704,44 @@ and limitations under the License. let symlink = (exports.symlink = (() => { var _ref26 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - src, - dest - ) { - if (process.platform !== "win32") { - // use relative paths otherwise which will be retained if the directory is moved - src = (_path || _load_path()).default.relative( - (_path || _load_path()).default.dirname(dest), - src - ); - // When path.relative returns an empty string for the current directory, we should instead use - // '.', which is a valid fs.symlink target. - src = src || "."; - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (src, dest) { + if (process.platform !== "win32") { + // use relative paths otherwise which will be retained if the directory is moved + src = (_path || _load_path()).default.relative( + (_path || _load_path()).default.dirname(dest), + src + ); + // When path.relative returns an empty string for the current directory, we should instead use + // '.', which is a valid fs.symlink target. + src = src || "."; + } - try { - const stats = yield lstat(dest); - if (stats.isSymbolicLink()) { - const resolved = dest; - if (resolved === src) { - return; + try { + const stats = yield lstat(dest); + if (stats.isSymbolicLink()) { + const resolved = dest; + if (resolved === src) { + return; + } + } + } catch (err) { + if (err.code !== "ENOENT") { + throw err; } } - } catch (err) { - if (err.code !== "ENOENT") { - throw err; - } - } - // We use rimraf for unlink which never throws an ENOENT on missing target - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest); + // We use rimraf for unlink which never throws an ENOENT on missing target + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest); - if (process.platform === "win32") { - // use directory junctions if possible on win32, this requires absolute paths - yield fsSymlink(src, dest, "junction"); - } else { - yield fsSymlink(src, dest); + if (process.platform === "win32") { + // use directory junctions if possible on win32, this requires absolute paths + yield fsSymlink(src, dest, "junction"); + } else { + yield fsSymlink(src, dest); + } } - }); + ); return function symlink(_x24, _x25) { return _ref26.apply(this, arguments); @@ -1824,15 +1815,15 @@ and limitations under the License. let getFileSizeOnDisk = (exports.getFileSizeOnDisk = (() => { var _ref29 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - loc - ) { - const stat = yield lstat(loc); - const size = stat.size, - blockSize = stat.blksize; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (loc) { + const stat = yield lstat(loc); + const size = stat.size, + blockSize = stat.blksize; - return Math.ceil(size / blockSize) * blockSize; - }); + return Math.ceil(size / blockSize) * blockSize; + } + ); return function getFileSizeOnDisk(_x28) { return _ref29.apply(this, arguments); @@ -1841,25 +1832,25 @@ and limitations under the License. let getEolFromFile = (() => { var _ref30 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - path - ) { - if (!(yield exists(path))) { - return undefined; - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (path) { + if (!(yield exists(path))) { + return undefined; + } - const buffer = yield readFileBuffer(path); + const buffer = yield readFileBuffer(path); - for (let i = 0; i < buffer.length; ++i) { - if (buffer[i] === cr) { - return "\r\n"; - } - if (buffer[i] === lf) { - return "\n"; + for (let i = 0; i < buffer.length; ++i) { + if (buffer[i] === cr) { + return "\r\n"; + } + if (buffer[i] === lf) { + return "\n"; + } } + return undefined; } - return undefined; - }); + ); return function getEolFromFile(_x29) { return _ref30.apply(this, arguments); @@ -1868,17 +1859,16 @@ and limitations under the License. let writeFilePreservingEol = (exports.writeFilePreservingEol = (() => { var _ref31 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - path, - data - ) { - const eol = - (yield getEolFromFile(path)) || (_os || _load_os()).default.EOL; - if (eol !== "\n") { - data = data.replace(/\n/g, eol); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (path, data) { + const eol = + (yield getEolFromFile(path)) || (_os || _load_os()).default.EOL; + if (eol !== "\n") { + data = data.replace(/\n/g, eol); + } + yield writeFile(path, data); } - yield writeFile(path, data); - }); + ); return function writeFilePreservingEol(_x30, _x31) { return _ref31.apply(this, arguments); @@ -1887,26 +1877,28 @@ and limitations under the License. let hardlinksWork = (exports.hardlinksWork = (() => { var _ref32 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - dir - ) { - const filename = "test-file" + Math.random(); - const file = (_path || _load_path()).default.join(dir, filename); - const fileLink = (_path || _load_path()).default.join( - dir, - filename + "-link" - ); - try { - yield writeFile(file, "test"); - yield link(file, fileLink); - } catch (err) { - return false; - } finally { - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(file); - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(fileLink); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (dir) { + const filename = "test-file" + Math.random(); + const file = (_path || _load_path()).default.join(dir, filename); + const fileLink = (_path || _load_path()).default.join( + dir, + filename + "-link" + ); + try { + yield writeFile(file, "test"); + yield link(file, fileLink); + } catch (err) { + return false; + } finally { + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(file); + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)( + fileLink + ); + } + return true; } - return true; - }); + ); return function hardlinksWork(_x32) { return _ref32.apply(this, arguments); @@ -1917,17 +1909,17 @@ and limitations under the License. let makeTempDir = (exports.makeTempDir = (() => { var _ref33 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - prefix - ) { - const dir = (_path || _load_path()).default.join( - (_os || _load_os()).default.tmpdir(), - `yarn-${prefix || ""}-${Date.now()}-${Math.random()}` - ); - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dir); - yield mkdirp(dir); - return dir; - }); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (prefix) { + const dir = (_path || _load_path()).default.join( + (_os || _load_os()).default.tmpdir(), + `yarn-${prefix || ""}-${Date.now()}-${Math.random()}` + ); + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dir); + yield mkdirp(dir); + return dir; + } + ); return function makeTempDir(_x33) { return _ref33.apply(this, arguments); @@ -1937,43 +1929,43 @@ and limitations under the License. let readFirstAvailableStream = (exports.readFirstAvailableStream = (() => { var _ref34 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - paths - ) { - for ( - var _iterator15 = paths, - _isArray15 = Array.isArray(_iterator15), - _i15 = 0, - _iterator15 = _isArray15 - ? _iterator15 - : _iterator15[Symbol.iterator](); - ; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (paths) { + for ( + var _iterator15 = paths, + _isArray15 = Array.isArray(_iterator15), + _i15 = 0, + _iterator15 = _isArray15 + ? _iterator15 + : _iterator15[Symbol.iterator](); + ; - ) { - var _ref35; + ) { + var _ref35; - if (_isArray15) { - if (_i15 >= _iterator15.length) break; - _ref35 = _iterator15[_i15++]; - } else { - _i15 = _iterator15.next(); - if (_i15.done) break; - _ref35 = _i15.value; - } + if (_isArray15) { + if (_i15 >= _iterator15.length) break; + _ref35 = _iterator15[_i15++]; + } else { + _i15 = _iterator15.next(); + if (_i15.done) break; + _ref35 = _i15.value; + } - const path = _ref35; + const path = _ref35; - try { - const fd = yield open(path, "r"); - return (_fs || _load_fs()).default.createReadStream(path, { - fd, - }); - } catch (err) { - // Try the next one + try { + const fd = yield open(path, "r"); + return (_fs || _load_fs()).default.createReadStream(path, { + fd, + }); + } catch (err) { + // Try the next one + } } + return null; } - return null; - }); + ); return function readFirstAvailableStream(_x34) { return _ref34.apply(this, arguments); @@ -3544,9 +3536,9 @@ and limitations under the License. typeof window != "undefined" && window.Math == Math ? window : typeof self != "undefined" && self.Math == Math - ? self - : // eslint-disable-next-line no-new-func - Function("return this")()); + ? self + : // eslint-disable-next-line no-new-func + Function("return this")()); if (typeof __g == "number") __g = global; // eslint-disable-line no-undef /***/ @@ -4629,12 +4621,12 @@ and limitations under the License. return anum && !bnum ? -1 : bnum && !anum - ? 1 - : a < b - ? -1 - : a > b - ? 1 - : 0; + ? 1 + : a < b + ? -1 + : a > b + ? 1 + : 0; } exports.rcompareIdentifiers = rcompareIdentifiers; @@ -7269,23 +7261,25 @@ and limitations under the License. let install = (exports.install = (() => { var _ref29 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - lockfile - ) { - yield wrapLifecycle( - config, - flags, - (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)( - function* () { - const install = new Install(flags, config, reporter, lockfile); - yield install.init(); - } - ) - ); - }); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, lockfile) { + yield wrapLifecycle( + config, + flags, + (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* () { + const install = new Install( + flags, + config, + reporter, + lockfile + ); + yield install.init(); + } + ) + ); + } + ); return function install(_x7, _x8, _x9, _x10) { return _ref29.apply(this, arguments); @@ -7294,52 +7288,49 @@ and limitations under the License. let run = (exports.run = (() => { var _ref31 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - let lockfile; - let error = "installCommandRenamed"; - if (flags.lockfile === false) { - lockfile = new (_lockfile || _load_lockfile()).default(); - } else { - lockfile = yield ( - _lockfile || _load_lockfile() - ).default.fromDirectory(config.lockfileFolder, reporter); - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + let lockfile; + let error = "installCommandRenamed"; + if (flags.lockfile === false) { + lockfile = new (_lockfile || _load_lockfile()).default(); + } else { + lockfile = yield ( + _lockfile || _load_lockfile() + ).default.fromDirectory(config.lockfileFolder, reporter); + } - if (args.length) { - const exampleArgs = args.slice(); + if (args.length) { + const exampleArgs = args.slice(); - if (flags.saveDev) { - exampleArgs.push("--dev"); - } - if (flags.savePeer) { - exampleArgs.push("--peer"); - } - if (flags.saveOptional) { - exampleArgs.push("--optional"); - } - if (flags.saveExact) { - exampleArgs.push("--exact"); - } - if (flags.saveTilde) { - exampleArgs.push("--tilde"); - } - let command = "add"; - if (flags.global) { - error = "globalFlagRemoved"; - command = "global add"; + if (flags.saveDev) { + exampleArgs.push("--dev"); + } + if (flags.savePeer) { + exampleArgs.push("--peer"); + } + if (flags.saveOptional) { + exampleArgs.push("--optional"); + } + if (flags.saveExact) { + exampleArgs.push("--exact"); + } + if (flags.saveTilde) { + exampleArgs.push("--tilde"); + } + let command = "add"; + if (flags.global) { + error = "globalFlagRemoved"; + command = "global add"; + } + throw new (_errors || _load_errors()).MessageError( + reporter.lang(error, `yarn ${command} ${exampleArgs.join(" ")}`) + ); } - throw new (_errors || _load_errors()).MessageError( - reporter.lang(error, `yarn ${command} ${exampleArgs.join(" ")}`) - ); - } - yield install(config, reporter, flags, lockfile); - }); + yield install(config, reporter, flags, lockfile); + } + ); return function run(_x11, _x12, _x13, _x14) { return _ref31.apply(this, arguments); @@ -7348,26 +7339,24 @@ and limitations under the License. let wrapLifecycle = (exports.wrapLifecycle = (() => { var _ref32 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - flags, - factory - ) { - yield config.executeLifecycleScript("preinstall"); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, flags, factory) { + yield config.executeLifecycleScript("preinstall"); - yield factory(); + yield factory(); - // npm behaviour, seems kinda funky but yay compatibility - yield config.executeLifecycleScript("install"); - yield config.executeLifecycleScript("postinstall"); + // npm behaviour, seems kinda funky but yay compatibility + yield config.executeLifecycleScript("install"); + yield config.executeLifecycleScript("postinstall"); - if (!config.production) { - if (!config.disablePrepublish) { - yield config.executeLifecycleScript("prepublish"); + if (!config.production) { + if (!config.disablePrepublish) { + yield config.executeLifecycleScript("prepublish"); + } + yield config.executeLifecycleScript("prepare"); } - yield config.executeLifecycleScript("prepare"); } - }); + ); return function wrapLifecycle(_x15, _x16, _x17) { return _ref32.apply(this, arguments); @@ -8015,9 +8004,8 @@ and limitations under the License. let workspaceManifestJson = projectManifestJson; if (!cwdIsRoot) { // the manifest we read before was a child workspace, so get the root - workspaceManifestJson = yield _this.config.readJson( - workspaceLoc - ); + workspaceManifestJson = + yield _this.config.readJson(workspaceLoc); yield (0, (_index || _load_index()).default)( workspaceManifestJson, workspacesRoot, @@ -8567,9 +8555,8 @@ and limitations under the License. } ); topLevelPatterns = _this6.preparePatterns(rawPatterns); - flattenedTopLevelPatterns = yield _this6.flatten( - topLevelPatterns - ); + flattenedTopLevelPatterns = + yield _this6.flatten(topLevelPatterns); return { bailout: !_this6.flags.audit && @@ -9190,17 +9177,17 @@ and limitations under the License. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)( function* () { const resolvedPatterns = {}; - Object.keys(_this11.resolver.patterns).forEach(function ( - pattern - ) { - if ( - !workspaceLayout || - !workspaceLayout.getManifestByPattern(pattern) - ) { - resolvedPatterns[pattern] = - _this11.resolver.patterns[pattern]; + Object.keys(_this11.resolver.patterns).forEach( + function (pattern) { + if ( + !workspaceLayout || + !workspaceLayout.getManifestByPattern(pattern) + ) { + resolvedPatterns[pattern] = + _this11.resolver.patterns[pattern]; + } } - }); + ); // TODO this code is duplicated in a few places, need a common way to filter out workspace patterns from lockfile patterns = patterns.filter(function (p) { @@ -12849,8 +12836,8 @@ and limitations under the License. ? getAllKeysIn : getAllKeys : isFlat - ? keysIn - : keys; + ? keysIn + : keys; var props = isArr ? undefined : keysFunc(value); arrayEach(props || value, function (subValue, key) { @@ -14293,8 +14280,8 @@ and limitations under the License. newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) - ? [] - : {}; + ? [] + : {}; } } assignValue(nested, key, newValue); @@ -19642,14 +19629,14 @@ and limitations under the License. args: [interceptor], thisArg: undefined, }); - return new LodashWrapper(value, this.__chain__).thru(function ( - array - ) { - if (length && !array.length) { - array.push(undefined); + return new LodashWrapper(value, this.__chain__).thru( + function (array) { + if (length && !array.length) { + array.push(undefined); + } + return array; } - return array; - }); + ); }); /** @@ -23329,8 +23316,8 @@ and limitations under the License. tag == mapTag ? mapToArray : tag == setTag - ? setToArray - : values; + ? setToArray + : values; return func(value); } @@ -23483,8 +23470,8 @@ and limitations under the License. return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) - ? NAN - : +value; + ? NAN + : +value; } /** @@ -23547,8 +23534,8 @@ and limitations under the License. MAX_SAFE_INTEGER ) : value === 0 - ? value - : 0; + ? value + : 0; } /** @@ -23686,14 +23673,11 @@ and limitations under the License. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ - var assignInWith = createAssigner(function ( - object, - source, - srcIndex, - customizer - ) { - copyObject(source, keysIn(source), object, customizer); - }); + var assignInWith = createAssigner( + function (object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); + } + ); /** * This method is like `_.assign` except that it accepts `customizer` @@ -23723,14 +23707,11 @@ and limitations under the License. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ - var assignWith = createAssigner(function ( - object, - source, - srcIndex, - customizer - ) { - copyObject(source, keys(source), object, customizer); - }); + var assignWith = createAssigner( + function (object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); + } + ); /** * Creates an array of values corresponding to `paths` of `object`. @@ -24512,14 +24493,11 @@ and limitations under the License. * _.mergeWith(object, other, customizer); * // => { 'a': [1, 3], 'b': [2, 4] } */ - var mergeWith = createAssigner(function ( - object, - source, - srcIndex, - customizer - ) { - baseMerge(object, source, srcIndex, customizer); - }); + var mergeWith = createAssigner( + function (object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); + } + ); /** * The opposite of `_.pick`; this method creates an object composed of the @@ -27579,8 +27557,7 @@ and limitations under the License. multiplicand ) { return multiplier * multiplicand; - }, - 1); + }, 1); /** * Computes `number` rounded to `precision`. @@ -29268,57 +29245,54 @@ and limitations under the License. exports.default = function (rootCommandName, subCommands, usage = []) { let run = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const subName = (0, (_misc || _load_misc()).camelCase)( - args.shift() || "" - ); - if (subName && subCommands[subName]) { - const command = subCommands[subName]; - const res = yield command(config, reporter, flags, args); - if (res !== false) { - return Promise.resolve(); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const subName = (0, (_misc || _load_misc()).camelCase)( + args.shift() || "" + ); + if (subName && subCommands[subName]) { + const command = subCommands[subName]; + const res = yield command(config, reporter, flags, args); + if (res !== false) { + return Promise.resolve(); + } } - } - if (usage && usage.length) { - reporter.error(`${reporter.lang("usage")}:`); - for ( - var _iterator = usage, - _isArray = Array.isArray(_iterator), - _i = 0, - _iterator = _isArray - ? _iterator - : _iterator[Symbol.iterator](); - ; + if (usage && usage.length) { + reporter.error(`${reporter.lang("usage")}:`); + for ( + var _iterator = usage, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray + ? _iterator + : _iterator[Symbol.iterator](); + ; - ) { - var _ref2; + ) { + var _ref2; - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; - } + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } - const msg = _ref2; + const msg = _ref2; - reporter.error(`yarn ${rootCommandName} ${msg}`); + reporter.error(`yarn ${rootCommandName} ${msg}`); + } } + return Promise.reject( + new (_errors || _load_errors()).MessageError( + reporter.lang("invalidCommand", subCommandNames.join(", ")) + ) + ); } - return Promise.reject( - new (_errors || _load_errors()).MessageError( - reporter.lang("invalidCommand", subCommandNames.join(", ")) - ) - ); - }); + ); return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -29385,8 +29359,8 @@ and limitations under the License. var target = IS_GLOBAL ? global : IS_STATIC - ? global[name] - : (global[name] || {})[PROTOTYPE]; + ? global[name] + : (global[name] || {})[PROTOTYPE]; var key, own, out; if (IS_GLOBAL) source = name; for (key in source) { @@ -29400,32 +29374,32 @@ and limitations under the License. IS_GLOBAL && typeof target[key] != "function" ? source[key] : // bind timers to global for call from export context - IS_BIND && own - ? ctx(out, global) - : // wrap global constructors for prevent change them in library - IS_WRAP && target[key] == out - ? (function (C) { - var F = function (a, b, c) { - if (this instanceof C) { - switch (arguments.length) { - case 0: - return new C(); - case 1: - return new C(a); - case 2: - return new C(a, b); - } - return new C(a, b, c); - } - return C.apply(this, arguments); - }; - F[PROTOTYPE] = C[PROTOTYPE]; - return F; - // make static versions for prototype methods - })(out) - : IS_PROTO && typeof out == "function" - ? ctx(Function.call, out) - : out; + IS_BIND && own + ? ctx(out, global) + : // wrap global constructors for prevent change them in library + IS_WRAP && target[key] == out + ? (function (C) { + var F = function (a, b, c) { + if (this instanceof C) { + switch (arguments.length) { + case 0: + return new C(); + case 1: + return new C(a); + case 2: + return new C(a, b); + } + return new C(a, b, c); + } + return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) + : IS_PROTO && typeof out == "function" + ? ctx(Function.call, out) + : out; // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% if (IS_PROTO) { (exports.virtual || (exports.virtual = {}))[key] = out; @@ -36958,9 +36932,9 @@ and limitations under the License. pattern.charAt(0) === "." ? "" // anything : // not (start or / followed by . or .. followed by / or end) - options.dot - ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" - : "(?!\\.)"; + options.dot + ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" + : "(?!\\.)"; var self = this; function clearStateChar() { @@ -37328,8 +37302,8 @@ and limitations under the License. var twoStar = options.noglobstar ? star : options.dot - ? twoStarDot - : twoStarNoDot; + ? twoStarDot + : twoStarNoDot; var flags = options.nocase ? "i" : ""; var re = set @@ -37339,8 +37313,8 @@ and limitations under the License. return p === GLOBSTAR ? twoStar : typeof p === "string" - ? regExpEscape(p) - : p._src; + ? regExpEscape(p) + : p._src; }) .join("\\/"); }) @@ -40661,8 +40635,8 @@ and limitations under the License. return typeof key == "number" ? "[" + key + "]" : IDENTIFIER.test(key) - ? "." + key - : "['" + escapeQuotes(key) + "']"; + ? "." + key + : "['" + escapeQuotes(key) + "']"; } function escapeQuotes(str) { @@ -40745,8 +40719,8 @@ and limitations under the License. expr + (isNumber ? "" : ".replace(/~/g, '~0').replace(/\\//g, '~1')") : isNumber - ? "'[' + " + expr + " + ']'" - : "'[\\'' + " + expr + " + '\\']'"; + ? "'[' + " + expr + " + ']'" + : "'[\\'' + " + expr + " + '\\']'"; return joinPaths(currentPath, path); } @@ -40845,36 +40819,35 @@ and limitations under the License. let getCredentials = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter - ) { - var _config$registries$ya = config.registries.yarn.config; - let username = _config$registries$ya.username, - email = _config$registries$ya.email; - - if (username) { - reporter.info(`${reporter.lang("npmUsername")}: ${username}`); - } else { - username = yield reporter.question(reporter.lang("npmUsername")); - if (!username) { - return null; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter) { + var _config$registries$ya = config.registries.yarn.config; + let username = _config$registries$ya.username, + email = _config$registries$ya.email; + + if (username) { + reporter.info(`${reporter.lang("npmUsername")}: ${username}`); + } else { + username = yield reporter.question(reporter.lang("npmUsername")); + if (!username) { + return null; + } } - } - if (email) { - reporter.info(`${reporter.lang("npmEmail")}: ${email}`); - } else { - email = yield reporter.question(reporter.lang("npmEmail")); - if (!email) { - return null; + if (email) { + reporter.info(`${reporter.lang("npmEmail")}: ${email}`); + } else { + email = yield reporter.question(reporter.lang("npmEmail")); + if (!email) { + return null; + } } - } - yield config.registries.yarn.saveHomeConfig({ username, email }); + yield config.registries.yarn.saveHomeConfig({ username, email }); - return { username, email }; - }); + return { username, email }; + } + ); return function getCredentials(_x, _x2) { return _ref.apply(this, arguments); @@ -41003,14 +40976,11 @@ and limitations under the License. let run = (exports.run = (() => { var _ref4 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - yield getCredentials(config, reporter); - }); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + yield getCredentials(config, reporter); + } + ); return function run(_x5, _x6, _x7, _x8) { return _ref4.apply(this, arguments); @@ -41933,36 +41903,30 @@ and limitations under the License. let getWrappersFolder = (exports.getWrappersFolder = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config - ) { - if (wrappersFolder) { - return wrappersFolder; - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config) { + if (wrappersFolder) { + return wrappersFolder; + } - wrappersFolder = yield (_fs || _load_fs()).makeTempDir(); + wrappersFolder = yield (_fs || _load_fs()).makeTempDir(); - yield (0, - (_portableScript || _load_portableScript()).makePortableProxyScript)( - process.execPath, - wrappersFolder, - { + yield (0, + (_portableScript || _load_portableScript()) + .makePortableProxyScript)(process.execPath, wrappersFolder, { proxyBasename: "node", - } - ); + }); - yield (0, - (_portableScript || _load_portableScript()).makePortableProxyScript)( - process.execPath, - wrappersFolder, - { + yield (0, + (_portableScript || _load_portableScript()) + .makePortableProxyScript)(process.execPath, wrappersFolder, { proxyBasename: "yarn", prependArguments: [process.argv[1]], - } - ); + }); - return wrappersFolder; - }); + return wrappersFolder; + } + ); return function getWrappersFolder(_x) { return _ref.apply(this, arguments); @@ -41971,354 +41935,352 @@ and limitations under the License. let makeEnv = (exports.makeEnv = (() => { var _ref2 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - stage, - cwd, - config - ) { - const env = (0, (_extends2 || _load_extends()).default)( - { - NODE: process.execPath, - INIT_CWD: process.cwd(), - }, - process.env - ); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (stage, cwd, config) { + const env = (0, (_extends2 || _load_extends()).default)( + { + NODE: process.execPath, + INIT_CWD: process.cwd(), + }, + process.env + ); - // Merge in the `env` object specified in .yarnrc - const customEnv = config.getOption("env"); - if (customEnv && typeof customEnv === "object") { - Object.assign(env, customEnv); - } - - env.npm_lifecycle_event = stage; - env.npm_node_execpath = env.NODE; - env.npm_execpath = - env.npm_execpath || - (process.mainModule && process.mainModule.filename); - - // Set the env to production for npm compat if production mode. - // https://github.com/npm/npm/blob/30d75e738b9cb7a6a3f9b50e971adcbe63458ed3/lib/utils/lifecycle.js#L336 - if (config.production) { - env.NODE_ENV = "production"; - } - - // Note: npm_config_argv environment variable contains output of nopt - command-line - // parser used by npm. Since we use other parser, we just roughly emulate it's output. (See: #684) - env.npm_config_argv = JSON.stringify({ - remain: [], - cooked: - config.commandName === "run" - ? [config.commandName, stage] - : [config.commandName], - original: process.argv.slice(2), - }); + // Merge in the `env` object specified in .yarnrc + const customEnv = config.getOption("env"); + if (customEnv && typeof customEnv === "object") { + Object.assign(env, customEnv); + } + + env.npm_lifecycle_event = stage; + env.npm_node_execpath = env.NODE; + env.npm_execpath = + env.npm_execpath || + (process.mainModule && process.mainModule.filename); + + // Set the env to production for npm compat if production mode. + // https://github.com/npm/npm/blob/30d75e738b9cb7a6a3f9b50e971adcbe63458ed3/lib/utils/lifecycle.js#L336 + if (config.production) { + env.NODE_ENV = "production"; + } + + // Note: npm_config_argv environment variable contains output of nopt - command-line + // parser used by npm. Since we use other parser, we just roughly emulate it's output. (See: #684) + env.npm_config_argv = JSON.stringify({ + remain: [], + cooked: + config.commandName === "run" + ? [config.commandName, stage] + : [config.commandName], + original: process.argv.slice(2), + }); - const manifest = yield config.maybeReadManifest(cwd); - if (manifest) { - if ( - manifest.scripts && - Object.prototype.hasOwnProperty.call(manifest.scripts, stage) - ) { - env.npm_lifecycle_script = manifest.scripts[stage]; - } + const manifest = yield config.maybeReadManifest(cwd); + if (manifest) { + if ( + manifest.scripts && + Object.prototype.hasOwnProperty.call(manifest.scripts, stage) + ) { + env.npm_lifecycle_script = manifest.scripts[stage]; + } - // add npm_package_* - const queue = [["", manifest]]; - while (queue.length) { - var _queue$pop = queue.pop(); + // add npm_package_* + const queue = [["", manifest]]; + while (queue.length) { + var _queue$pop = queue.pop(); - const key = _queue$pop[0], - val = _queue$pop[1]; + const key = _queue$pop[0], + val = _queue$pop[1]; - if (typeof val === "object") { - for (const subKey in val) { - const fullKey = [key, subKey].filter(Boolean).join("_"); - if ( - fullKey && - fullKey[0] !== "_" && - !IGNORE_MANIFEST_KEYS.has(fullKey) - ) { - queue.push([fullKey, val[subKey]]); + if (typeof val === "object") { + for (const subKey in val) { + const fullKey = [key, subKey].filter(Boolean).join("_"); + if ( + fullKey && + fullKey[0] !== "_" && + !IGNORE_MANIFEST_KEYS.has(fullKey) + ) { + queue.push([fullKey, val[subKey]]); + } + } + } else { + let cleanVal = String(val); + if (cleanVal.indexOf("\n") >= 0) { + cleanVal = JSON.stringify(cleanVal); } - } - } else { - let cleanVal = String(val); - if (cleanVal.indexOf("\n") >= 0) { - cleanVal = JSON.stringify(cleanVal); - } - //replacing invalid chars with underscore - const cleanKey = key.replace(INVALID_CHAR_REGEX, "_"); + //replacing invalid chars with underscore + const cleanKey = key.replace(INVALID_CHAR_REGEX, "_"); - env[`npm_package_${cleanKey}`] = cleanVal; + env[`npm_package_${cleanKey}`] = cleanVal; + } } } - } - - // add npm_config_* and npm_package_config_* from yarn config - const keys = new Set([ - ...Object.keys(config.registries.yarn.config), - ...Object.keys(config.registries.npm.config), - ]); - const cleaned = Array.from(keys) - .filter(function (key) { - return !key.match(/:_/) && IGNORE_CONFIG_KEYS.indexOf(key) === -1; - }) - .map(function (key) { - let val = config.getOption(key); - if (!val) { - val = ""; - } else if (typeof val === "number") { - val = "" + val; - } else if (typeof val !== "string") { - val = JSON.stringify(val); - } - if (val.indexOf("\n") >= 0) { - val = JSON.stringify(val); - } - return [key, val]; - }); - // add npm_config_* - for ( - var _iterator = cleaned, - _isArray = Array.isArray(_iterator), - _i = 0, - _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); - ; - - ) { - var _ref4; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref4 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref4 = _i.value; - } - - const _ref3 = _ref4; - const key = _ref3[0]; - const val = _ref3[1]; + // add npm_config_* and npm_package_config_* from yarn config + const keys = new Set([ + ...Object.keys(config.registries.yarn.config), + ...Object.keys(config.registries.npm.config), + ]); + const cleaned = Array.from(keys) + .filter(function (key) { + return ( + !key.match(/:_/) && IGNORE_CONFIG_KEYS.indexOf(key) === -1 + ); + }) + .map(function (key) { + let val = config.getOption(key); + if (!val) { + val = ""; + } else if (typeof val === "number") { + val = "" + val; + } else if (typeof val !== "string") { + val = JSON.stringify(val); + } - const cleanKey = key.replace(/^_+/, ""); - const envKey = `npm_config_${cleanKey}`.replace( - INVALID_CHAR_REGEX, - "_" - ); - env[envKey] = val; - } - // add npm_package_config_* - if (manifest && manifest.name) { - const packageConfigPrefix = `${manifest.name}:`; + if (val.indexOf("\n") >= 0) { + val = JSON.stringify(val); + } + return [key, val]; + }); + // add npm_config_* for ( - var _iterator2 = cleaned, - _isArray2 = Array.isArray(_iterator2), - _i2 = 0, - _iterator2 = _isArray2 - ? _iterator2 - : _iterator2[Symbol.iterator](); + var _iterator = cleaned, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) { - var _ref6; + var _ref4; - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref6 = _iterator2[_i2++]; + if (_isArray) { + if (_i >= _iterator.length) break; + _ref4 = _iterator[_i++]; } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref6 = _i2.value; + _i = _iterator.next(); + if (_i.done) break; + _ref4 = _i.value; } - const _ref5 = _ref6; - const key = _ref5[0]; - const val = _ref5[1]; + const _ref3 = _ref4; + const key = _ref3[0]; + const val = _ref3[1]; - if (key.indexOf(packageConfigPrefix) !== 0) { - continue; - } - const cleanKey = key - .replace(/^_+/, "") - .replace(packageConfigPrefix, ""); - const envKey = `npm_package_config_${cleanKey}`.replace( + const cleanKey = key.replace(/^_+/, ""); + const envKey = `npm_config_${cleanKey}`.replace( INVALID_CHAR_REGEX, "_" ); env[envKey] = val; } - } - - // split up the path - const envPath = env[(_constants || _load_constants()).ENV_PATH_KEY]; - const pathParts = envPath ? envPath.split(path.delimiter) : []; - - // Include node-gyp version that was bundled with the current Node.js version, - // if available. - pathParts.unshift( - path.join( - path.dirname(process.execPath), - "node_modules", - "npm", - "bin", - "node-gyp-bin" - ) - ); - pathParts.unshift( - path.join( - path.dirname(process.execPath), - "..", - "lib", - "node_modules", - "npm", - "bin", - "node-gyp-bin" - ) - ); - // Include node-gyp version from homebrew managed npm, if available. - pathParts.unshift( - path.join( - path.dirname(process.execPath), - "..", - "libexec", - "lib", - "node_modules", - "npm", - "bin", - "node-gyp-bin" - ) - ); - - // Add global bin folder if it is not present already, as some packages depend - // on a globally-installed version of node-gyp. - const globalBin = yield (0, (_global || _load_global()).getBinFolder)( - config, - {} - ); - if (pathParts.indexOf(globalBin) === -1) { - pathParts.unshift(globalBin); - } - - // Add node_modules .bin folders to the PATH - for ( - var _iterator3 = config.registryFolders, - _isArray3 = Array.isArray(_iterator3), - _i3 = 0, - _iterator3 = _isArray3 - ? _iterator3 - : _iterator3[Symbol.iterator](); - ; + // add npm_package_config_* + if (manifest && manifest.name) { + const packageConfigPrefix = `${manifest.name}:`; + for ( + var _iterator2 = cleaned, + _isArray2 = Array.isArray(_iterator2), + _i2 = 0, + _iterator2 = _isArray2 + ? _iterator2 + : _iterator2[Symbol.iterator](); + ; - ) { - var _ref7; + ) { + var _ref6; - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref7 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref7 = _i3.value; - } + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref6 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref6 = _i2.value; + } - const registryFolder = _ref7; + const _ref5 = _ref6; + const key = _ref5[0]; + const val = _ref5[1]; - const binFolder = path.join(registryFolder, ".bin"); - if (config.workspacesEnabled && config.workspaceRootFolder) { - pathParts.unshift( - path.join(config.workspaceRootFolder, binFolder) - ); + if (key.indexOf(packageConfigPrefix) !== 0) { + continue; + } + const cleanKey = key + .replace(/^_+/, "") + .replace(packageConfigPrefix, ""); + const envKey = `npm_package_config_${cleanKey}`.replace( + INVALID_CHAR_REGEX, + "_" + ); + env[envKey] = val; + } } - pathParts.unshift(path.join(config.linkFolder, binFolder)); - pathParts.unshift(path.join(cwd, binFolder)); - } - let pnpFile; + // split up the path + const envPath = env[(_constants || _load_constants()).ENV_PATH_KEY]; + const pathParts = envPath ? envPath.split(path.delimiter) : []; - if (process.versions.pnp) { - pnpFile = ( - _dynamicRequire || _load_dynamicRequire() - ).dynamicRequire.resolve("pnpapi"); - } else { - const candidate = `${config.lockfileFolder}/${ - (_constants || _load_constants()).PNP_FILENAME - }`; - if (yield (_fs || _load_fs()).exists(candidate)) { - pnpFile = candidate; - } - } - - if (pnpFile) { - const pnpApi = (0, - (_dynamicRequire || _load_dynamicRequire()).dynamicRequire)( - pnpFile + // Include node-gyp version that was bundled with the current Node.js version, + // if available. + pathParts.unshift( + path.join( + path.dirname(process.execPath), + "node_modules", + "npm", + "bin", + "node-gyp-bin" + ) + ); + pathParts.unshift( + path.join( + path.dirname(process.execPath), + "..", + "lib", + "node_modules", + "npm", + "bin", + "node-gyp-bin" + ) + ); + // Include node-gyp version from homebrew managed npm, if available. + pathParts.unshift( + path.join( + path.dirname(process.execPath), + "..", + "libexec", + "lib", + "node_modules", + "npm", + "bin", + "node-gyp-bin" + ) ); - const packageLocator = pnpApi.findPackageLocator(`${cwd}/`); - const packageInformation = - pnpApi.getPackageInformation(packageLocator); + // Add global bin folder if it is not present already, as some packages depend + // on a globally-installed version of node-gyp. + const globalBin = yield (0, + (_global || _load_global()).getBinFolder)(config, {}); + if (pathParts.indexOf(globalBin) === -1) { + pathParts.unshift(globalBin); + } + // Add node_modules .bin folders to the PATH for ( - var _iterator4 = packageInformation.packageDependencies.entries(), - _isArray4 = Array.isArray(_iterator4), - _i4 = 0, - _iterator4 = _isArray4 - ? _iterator4 - : _iterator4[Symbol.iterator](); + var _iterator3 = config.registryFolders, + _isArray3 = Array.isArray(_iterator3), + _i3 = 0, + _iterator3 = _isArray3 + ? _iterator3 + : _iterator3[Symbol.iterator](); ; ) { - var _ref9; + var _ref7; - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref9 = _iterator4[_i4++]; + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref7 = _iterator3[_i3++]; } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref9 = _i4.value; + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref7 = _i3.value; } - const _ref8 = _ref9; - const name = _ref8[0]; - const reference = _ref8[1]; + const registryFolder = _ref7; - const dependencyInformation = pnpApi.getPackageInformation({ - name, - reference, - }); - - if ( - !dependencyInformation || - !dependencyInformation.packageLocation - ) { - continue; + const binFolder = path.join(registryFolder, ".bin"); + if (config.workspacesEnabled && config.workspaceRootFolder) { + pathParts.unshift( + path.join(config.workspaceRootFolder, binFolder) + ); } + pathParts.unshift(path.join(config.linkFolder, binFolder)); + pathParts.unshift(path.join(cwd, binFolder)); + } - const binFolder = `${dependencyInformation.packageLocation}/.bin`; - if (yield (_fs || _load_fs()).exists(binFolder)) { - pathParts.unshift(binFolder); + let pnpFile; + + if (process.versions.pnp) { + pnpFile = ( + _dynamicRequire || _load_dynamicRequire() + ).dynamicRequire.resolve("pnpapi"); + } else { + const candidate = `${config.lockfileFolder}/${ + (_constants || _load_constants()).PNP_FILENAME + }`; + if (yield (_fs || _load_fs()).exists(candidate)) { + pnpFile = candidate; } } - // Note that NODE_OPTIONS doesn't support any style of quoting its arguments at the moment - // For this reason, it won't work if the user has a space inside its $PATH - env.NODE_OPTIONS = env.NODE_OPTIONS || ""; - env.NODE_OPTIONS = `--require ${pnpFile} ${env.NODE_OPTIONS}`; - } + if (pnpFile) { + const pnpApi = (0, + (_dynamicRequire || _load_dynamicRequire()).dynamicRequire)( + pnpFile + ); - pathParts.unshift(yield getWrappersFolder(config)); + const packageLocator = pnpApi.findPackageLocator(`${cwd}/`); + const packageInformation = + pnpApi.getPackageInformation(packageLocator); - // join path back together - env[(_constants || _load_constants()).ENV_PATH_KEY] = pathParts.join( - path.delimiter - ); + for ( + var _iterator4 = + packageInformation.packageDependencies.entries(), + _isArray4 = Array.isArray(_iterator4), + _i4 = 0, + _iterator4 = _isArray4 + ? _iterator4 + : _iterator4[Symbol.iterator](); + ; - return env; - }); + ) { + var _ref9; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref9 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref9 = _i4.value; + } + + const _ref8 = _ref9; + const name = _ref8[0]; + const reference = _ref8[1]; + + const dependencyInformation = pnpApi.getPackageInformation({ + name, + reference, + }); + + if ( + !dependencyInformation || + !dependencyInformation.packageLocation + ) { + continue; + } + + const binFolder = `${dependencyInformation.packageLocation}/.bin`; + if (yield (_fs || _load_fs()).exists(binFolder)) { + pathParts.unshift(binFolder); + } + } + + // Note that NODE_OPTIONS doesn't support any style of quoting its arguments at the moment + // For this reason, it won't work if the user has a space inside its $PATH + env.NODE_OPTIONS = env.NODE_OPTIONS || ""; + env.NODE_OPTIONS = `--require ${pnpFile} ${env.NODE_OPTIONS}`; + } + + pathParts.unshift(yield getWrappersFolder(config)); + + // join path back together + env[(_constants || _load_constants()).ENV_PATH_KEY] = + pathParts.join(path.delimiter); + + return env; + } + ); return function makeEnv(_x2, _x3, _x4) { return _ref2.apply(this, arguments); @@ -42385,37 +42347,36 @@ and limitations under the License. let _checkForGyp = (() => { var _ref11 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - paths - ) { - const reporter = config.reporter; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, paths) { + const reporter = config.reporter; - // Check every directory in the PATH + // Check every directory in the PATH - const allChecks = yield Promise.all( - paths.map(function (dir) { - return (_fs || _load_fs()).exists(path.join(dir, "node-gyp")); - }) - ); - if (allChecks.some(Boolean)) { - // node-gyp is available somewhere - return; - } + const allChecks = yield Promise.all( + paths.map(function (dir) { + return (_fs || _load_fs()).exists(path.join(dir, "node-gyp")); + }) + ); + if (allChecks.some(Boolean)) { + // node-gyp is available somewhere + return; + } - reporter.info(reporter.lang("packageRequiresNodeGyp")); + reporter.info(reporter.lang("packageRequiresNodeGyp")); - try { - yield (0, (_global || _load_global()).run)(config, reporter, {}, [ - "add", - "node-gyp", - ]); - } catch (e) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("nodeGypAutoInstallFailed", e.message) - ); + try { + yield (0, (_global || _load_global()).run)(config, reporter, {}, [ + "add", + "node-gyp", + ]); + } catch (e) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("nodeGypAutoInstallFailed", e.message) + ); + } } - }); + ); return function _checkForGyp(_x6, _x7) { return _ref11.apply(this, arguments); @@ -42424,27 +42385,25 @@ and limitations under the License. let execFromManifest = (exports.execFromManifest = (() => { var _ref12 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - commandName, - cwd - ) { - const pkg = yield config.maybeReadManifest(cwd); - if (!pkg || !pkg.scripts) { - return; - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, commandName, cwd) { + const pkg = yield config.maybeReadManifest(cwd); + if (!pkg || !pkg.scripts) { + return; + } - const cmd = pkg.scripts[commandName]; - if (cmd) { - yield execCommand({ - stage: commandName, - config, - cmd, - cwd, - isInteractive: true, - }); + const cmd = pkg.scripts[commandName]; + if (cmd) { + yield execCommand({ + stage: commandName, + config, + cmd, + cwd, + isInteractive: true, + }); + } } - }); + ); return function execFromManifest(_x8, _x9, _x10) { return _ref12.apply(this, arguments); @@ -43531,22 +43490,22 @@ and limitations under the License. let updateCwd = (() => { var _ref2 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config - ) { - yield (_fs || _load_fs()).mkdirp(config.globalFolder); - - yield config.init({ - cwd: config.globalFolder, - offline: config.offline, - binLinks: true, - globalFolder: config.globalFolder, - cacheFolder: config._cacheRootFolder, - linkFolder: config.linkFolder, - enableDefaultRc: config.enableDefaultRc, - extraneousYarnrcFiles: config.extraneousYarnrcFiles, - }); - }); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config) { + yield (_fs || _load_fs()).mkdirp(config.globalFolder); + + yield config.init({ + cwd: config.globalFolder, + offline: config.offline, + binLinks: true, + globalFolder: config.globalFolder, + cacheFolder: config._cacheRootFolder, + linkFolder: config.linkFolder, + enableDefaultRc: config.enableDefaultRc, + extraneousYarnrcFiles: config.extraneousYarnrcFiles, + }); + } + ); return function updateCwd(_x) { return _ref2.apply(this, arguments); @@ -43555,96 +43514,98 @@ and limitations under the License. let getBins = (() => { var _ref3 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config - ) { - // build up list of registry folders to search for binaries - const dirs = []; - for ( - var _iterator2 = Object.keys((_index || _load_index()).registries), - _isArray2 = Array.isArray(_iterator2), - _i2 = 0, - _iterator2 = _isArray2 - ? _iterator2 - : _iterator2[Symbol.iterator](); - ; - - ) { - var _ref4; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref4 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref4 = _i2.value; - } - - const registryName = _ref4; - - const registry = config.registries[registryName]; - dirs.push(registry.loc); - } - - // build up list of binary files - const paths = new Set(); - for ( - var _iterator3 = dirs, - _isArray3 = Array.isArray(_iterator3), - _i3 = 0, - _iterator3 = _isArray3 - ? _iterator3 - : _iterator3[Symbol.iterator](); - ; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config) { + // build up list of registry folders to search for binaries + const dirs = []; + for ( + var _iterator2 = Object.keys( + (_index || _load_index()).registries + ), + _isArray2 = Array.isArray(_iterator2), + _i2 = 0, + _iterator2 = _isArray2 + ? _iterator2 + : _iterator2[Symbol.iterator](); + ; - ) { - var _ref5; + ) { + var _ref4; - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref5 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref5 = _i3.value; - } + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref4 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref4 = _i2.value; + } - const dir = _ref5; + const registryName = _ref4; - const binDir = path.join(dir, ".bin"); - if (!(yield (_fs || _load_fs()).exists(binDir))) { - continue; + const registry = config.registries[registryName]; + dirs.push(registry.loc); } + // build up list of binary files + const paths = new Set(); for ( - var _iterator4 = yield (_fs || _load_fs()).readdir(binDir), - _isArray4 = Array.isArray(_iterator4), - _i4 = 0, - _iterator4 = _isArray4 - ? _iterator4 - : _iterator4[Symbol.iterator](); + var _iterator3 = dirs, + _isArray3 = Array.isArray(_iterator3), + _i3 = 0, + _iterator3 = _isArray3 + ? _iterator3 + : _iterator3[Symbol.iterator](); ; ) { - var _ref6; + var _ref5; - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref6 = _iterator4[_i4++]; + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref5 = _iterator3[_i3++]; } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref6 = _i4.value; + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref5 = _i3.value; } - const name = _ref6; + const dir = _ref5; - paths.add(path.join(binDir, name)); + const binDir = path.join(dir, ".bin"); + if (!(yield (_fs || _load_fs()).exists(binDir))) { + continue; + } + + for ( + var _iterator4 = yield (_fs || _load_fs()).readdir(binDir), + _isArray4 = Array.isArray(_iterator4), + _i4 = 0, + _iterator4 = _isArray4 + ? _iterator4 + : _iterator4[Symbol.iterator](); + ; + + ) { + var _ref6; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref6 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref6 = _i4.value; + } + + const name = _ref6; + + paths.add(path.join(binDir, name)); + } } + return paths; } - return paths; - }); + ); return function getBins(_x2) { return _ref3.apply(this, arguments); @@ -43653,61 +43614,60 @@ and limitations under the License. let getGlobalPrefix = (() => { var _ref7 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - flags - ) { - if (flags.prefix) { - return flags.prefix; - } else if (config.getOption("prefix", true)) { - return String(config.getOption("prefix", true)); - } else if (process.env.PREFIX) { - return process.env.PREFIX; - } - - const potentialPrefixFolders = [ - (_constants || _load_constants()).FALLBACK_GLOBAL_PREFIX, - ]; - if (process.platform === "win32") { - // %LOCALAPPDATA%\Yarn --> C:\Users\Alice\AppData\Local\Yarn - if (process.env.LOCALAPPDATA) { + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, flags) { + if (flags.prefix) { + return flags.prefix; + } else if (config.getOption("prefix", true)) { + return String(config.getOption("prefix", true)); + } else if (process.env.PREFIX) { + return process.env.PREFIX; + } + + const potentialPrefixFolders = [ + (_constants || _load_constants()).FALLBACK_GLOBAL_PREFIX, + ]; + if (process.platform === "win32") { + // %LOCALAPPDATA%\Yarn --> C:\Users\Alice\AppData\Local\Yarn + if (process.env.LOCALAPPDATA) { + potentialPrefixFolders.unshift( + path.join(process.env.LOCALAPPDATA, "Yarn") + ); + } + } else { potentialPrefixFolders.unshift( - path.join(process.env.LOCALAPPDATA, "Yarn") + (_constants || _load_constants()).POSIX_GLOBAL_PREFIX ); } - } else { - potentialPrefixFolders.unshift( - (_constants || _load_constants()).POSIX_GLOBAL_PREFIX - ); - } - const binFolders = potentialPrefixFolders.map(function (prefix) { - return path.join(prefix, "bin"); - }); - const prefixFolderQueryResult = yield ( - _fs || _load_fs() - ).getFirstSuitableFolder(binFolders); - const prefix = - prefixFolderQueryResult.folder && - path.dirname(prefixFolderQueryResult.folder); - - if (!prefix) { - config.reporter.warn( - config.reporter.lang( - "noGlobalFolder", - prefixFolderQueryResult.skipped - .map(function (item) { - return path.dirname(item.folder); - }) - .join(", ") - ) - ); + const binFolders = potentialPrefixFolders.map(function (prefix) { + return path.join(prefix, "bin"); + }); + const prefixFolderQueryResult = yield ( + _fs || _load_fs() + ).getFirstSuitableFolder(binFolders); + const prefix = + prefixFolderQueryResult.folder && + path.dirname(prefixFolderQueryResult.folder); + + if (!prefix) { + config.reporter.warn( + config.reporter.lang( + "noGlobalFolder", + prefixFolderQueryResult.skipped + .map(function (item) { + return path.dirname(item.folder); + }) + .join(", ") + ) + ); - return (_constants || _load_constants()).FALLBACK_GLOBAL_PREFIX; - } + return (_constants || _load_constants()).FALLBACK_GLOBAL_PREFIX; + } - return prefix; - }); + return prefix; + } + ); return function getGlobalPrefix(_x3, _x4) { return _ref7.apply(this, arguments); @@ -43716,13 +43676,12 @@ and limitations under the License. let getBinFolder = (exports.getBinFolder = (() => { var _ref8 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - flags - ) { - const prefix = yield getGlobalPrefix(config, flags); - return path.resolve(prefix, "bin"); - }); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, flags) { + const prefix = yield getGlobalPrefix(config, flags); + return path.resolve(prefix, "bin"); + } + ); return function getBinFolder(_x5, _x6) { return _ref8.apply(this, arguments); @@ -43731,117 +43690,117 @@ and limitations under the License. let initUpdateBins = (() => { var _ref9 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags - ) { - const beforeBins = yield getBins(config); - const binFolder = yield getBinFolder(config, flags); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags) { + const beforeBins = yield getBins(config); + const binFolder = yield getBinFolder(config, flags); - function throwPermError(err, dest) { - if (err.code === "EACCES") { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("noPermission", dest) - ); - } else { - throw err; + function throwPermError(err, dest) { + if (err.code === "EACCES") { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("noPermission", dest) + ); + } else { + throw err; + } } - } - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)( - function* () { - try { - yield (_fs || _load_fs()).mkdirp(binFolder); - } catch (err) { - throwPermError(err, binFolder); - } + return (0, + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* () { + try { + yield (_fs || _load_fs()).mkdirp(binFolder); + } catch (err) { + throwPermError(err, binFolder); + } - const afterBins = yield getBins(config); + const afterBins = yield getBins(config); - // remove old bins - for ( - var _iterator5 = beforeBins, - _isArray5 = Array.isArray(_iterator5), - _i5 = 0, - _iterator5 = _isArray5 - ? _iterator5 - : _iterator5[Symbol.iterator](); - ; + // remove old bins + for ( + var _iterator5 = beforeBins, + _isArray5 = Array.isArray(_iterator5), + _i5 = 0, + _iterator5 = _isArray5 + ? _iterator5 + : _iterator5[Symbol.iterator](); + ; - ) { - var _ref11; + ) { + var _ref11; - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref11 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref11 = _i5.value; - } + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref11 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref11 = _i5.value; + } - const src = _ref11; + const src = _ref11; - if (afterBins.has(src)) { - // not old - continue; - } + if (afterBins.has(src)) { + // not old + continue; + } - // remove old bin - const dest = path.join(binFolder, path.basename(src)); - try { - yield (_fs || _load_fs()).unlink(dest); - } catch (err) { - throwPermError(err, dest); + // remove old bin + const dest = path.join(binFolder, path.basename(src)); + try { + yield (_fs || _load_fs()).unlink(dest); + } catch (err) { + throwPermError(err, dest); + } } - } - // add new bins - for ( - var _iterator6 = afterBins, - _isArray6 = Array.isArray(_iterator6), - _i6 = 0, - _iterator6 = _isArray6 - ? _iterator6 - : _iterator6[Symbol.iterator](); - ; + // add new bins + for ( + var _iterator6 = afterBins, + _isArray6 = Array.isArray(_iterator6), + _i6 = 0, + _iterator6 = _isArray6 + ? _iterator6 + : _iterator6[Symbol.iterator](); + ; - ) { - var _ref12; + ) { + var _ref12; - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref12 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref12 = _i6.value; - } + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref12 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref12 = _i6.value; + } - const src = _ref12; + const src = _ref12; - // insert new bin - const dest = path.join(binFolder, path.basename(src)); - try { - yield (_fs || _load_fs()).unlink(dest); - yield (0, (_packageLinker || _load_packageLinker()).linkBin)( - src, - dest - ); - if ( - process.platform === "win32" && - dest.indexOf(".cmd") !== -1 - ) { - yield (_fs || _load_fs()).rename(dest + ".cmd", dest); + // insert new bin + const dest = path.join(binFolder, path.basename(src)); + try { + yield (_fs || _load_fs()).unlink(dest); + yield (0, + (_packageLinker || _load_packageLinker()).linkBin)( + src, + dest + ); + if ( + process.platform === "win32" && + dest.indexOf(".cmd") !== -1 + ) { + yield (_fs || _load_fs()).rename(dest + ".cmd", dest); + } + } catch (err) { + throwPermError(err, dest); } - } catch (err) { - throwPermError(err, dest); } } - } - ); - }); + ); + } + ); return function initUpdateBins(_x7, _x8, _x9) { return _ref9.apply(this, arguments); @@ -43850,54 +43809,52 @@ and limitations under the License. let list = (() => { var _ref13 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - yield updateCwd(config); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + yield updateCwd(config); - // install so we get hard file paths - const lockfile = yield ( - _lockfile || _load_lockfile() - ).default.fromDirectory(config.cwd); - const install = new (_install || _load_install()).Install( - {}, - config, - new (_baseReporter || _load_baseReporter()).default(), - lockfile - ); - const patterns = yield install.getFlattenedDeps(); + // install so we get hard file paths + const lockfile = yield ( + _lockfile || _load_lockfile() + ).default.fromDirectory(config.cwd); + const install = new (_install || _load_install()).Install( + {}, + config, + new (_baseReporter || _load_baseReporter()).default(), + lockfile + ); + const patterns = yield install.getFlattenedDeps(); - // dump global modules - for ( - var _iterator7 = patterns, - _isArray7 = Array.isArray(_iterator7), - _i7 = 0, - _iterator7 = _isArray7 - ? _iterator7 - : _iterator7[Symbol.iterator](); - ; + // dump global modules + for ( + var _iterator7 = patterns, + _isArray7 = Array.isArray(_iterator7), + _i7 = 0, + _iterator7 = _isArray7 + ? _iterator7 + : _iterator7[Symbol.iterator](); + ; - ) { - var _ref14; + ) { + var _ref14; - if (_isArray7) { - if (_i7 >= _iterator7.length) break; - _ref14 = _iterator7[_i7++]; - } else { - _i7 = _iterator7.next(); - if (_i7.done) break; - _ref14 = _i7.value; - } + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref14 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref14 = _i7.value; + } - const pattern = _ref14; + const pattern = _ref14; - const manifest = install.resolver.getStrictResolvedPattern(pattern); - ls(manifest, reporter, false); + const manifest = + install.resolver.getStrictResolvedPattern(pattern); + ls(manifest, reporter, false); + } } - }); + ); return function list(_x10, _x11, _x12, _x13) { return _ref13.apply(this, arguments); @@ -45732,17 +45689,17 @@ and limitations under the License. return it === undefined ? "Undefined" : it === null - ? "Null" - : // @@toStringTag case - typeof (T = tryGet((O = Object(it)), TAG)) == "string" - ? T - : // builtinTag case - ARG - ? cof(O) - : // ES3 arguments fallback - (B = cof(O)) == "Object" && typeof O.callee == "function" - ? "Arguments" - : B; + ? "Null" + : // @@toStringTag case + typeof (T = tryGet((O = Object(it)), TAG)) == "string" + ? T + : // builtinTag case + ARG + ? cof(O) + : // ES3 arguments fallback + (B = cof(O)) == "Object" && typeof O.callee == "function" + ? "Arguments" + : B; }; /***/ @@ -50722,11 +50679,11 @@ and limitations under the License. .join("|"); const trailingPattern = `/+(${registryFilenames})`; // anything under folder (node_modules) should be ignored, thus use the '**' instead of shallow match "*" - const ignorePatterns = _this9.registryFolders.map(function ( - folder - ) { - return `/${folder}/**/+(${registryFilenames})`; - }); + const ignorePatterns = _this9.registryFolders.map( + function (folder) { + return `/${folder}/**/+(${registryFilenames})`; + } + ); const files = yield Promise.all( patterns.map(function (pattern) { @@ -51138,39 +51095,36 @@ and limitations under the License. let run = (exports.run = (() => { var _ref7 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - if (!args.length) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("missingAddDependencies") - ); - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + if (!args.length) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("missingAddDependencies") + ); + } - const lockfile = yield ( - _lockfile || _load_lockfile() - ).default.fromDirectory(config.lockfileFolder, reporter); + const lockfile = yield ( + _lockfile || _load_lockfile() + ).default.fromDirectory(config.lockfileFolder, reporter); - yield (0, (_install || _load_install()).wrapLifecycle)( - config, - flags, - (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)( - function* () { - const install = new Add( - args, - flags, - config, - reporter, - lockfile - ); - yield install.init(); - } - ) - ); - }); + yield (0, (_install || _load_install()).wrapLifecycle)( + config, + flags, + (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* () { + const install = new Add( + args, + flags, + config, + reporter, + lockfile + ); + yield install.init(); + } + ) + ); + } + ); return function run(_x, _x2, _x3, _x4) { return _ref7.apply(this, arguments); @@ -51554,34 +51508,30 @@ and limitations under the License. _install || _load_install() ).Install.prototype.fetchRequestFromCwd.call(_this3); - _this3._iterateAddedPackages(function ( - pattern, - registry, - dependencyType, - pkgName, - version - ) { - // add it to manifest - const object = manifests[registry].object; + _this3._iterateAddedPackages( + function (pattern, registry, dependencyType, pkgName, version) { + // add it to manifest + const object = manifests[registry].object; - object[dependencyType] = object[dependencyType] || {}; - object[dependencyType][pkgName] = version; - if ( - SILENCE_DEPENDENCY_TYPE_WARNINGS.indexOf( - _this3.config.commandName - ) === -1 && - dependencyType !== _this3.flagToOrigin - ) { - _this3.reporter.warn( - _this3.reporter.lang( - "moduleAlreadyInManifest", - pkgName, - dependencyType, - _this3.flagToOrigin - ) - ); + object[dependencyType] = object[dependencyType] || {}; + object[dependencyType][pkgName] = version; + if ( + SILENCE_DEPENDENCY_TYPE_WARNINGS.indexOf( + _this3.config.commandName + ) === -1 && + dependencyType !== _this3.flagToOrigin + ) { + _this3.reporter.warn( + _this3.reporter.lang( + "moduleAlreadyInManifest", + pkgName, + dependencyType, + _this3.flagToOrigin + ) + ); + } } - }); + ); return true; } @@ -52003,11 +51953,11 @@ and limitations under the License. const relative = path.relative(config.cwd, name); // Don't ignore directories, since we need to recurse inside them to check for unignored files. if (fs2.lstatSync(name).isDirectory()) { - const isParentOfKeptFile = Array.from(keepFiles).some(function ( - name - ) { - return !path.relative(relative, name).startsWith(".."); - }); + const isParentOfKeptFile = Array.from(keepFiles).some( + function (name) { + return !path.relative(relative, name).startsWith(".."); + } + ); return !isParentOfKeptFile; } // Otherwise, ignore a file if we're not supposed to keep it. @@ -52024,14 +51974,14 @@ and limitations under the License. let pack = (exports.pack = (() => { var _ref6 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config - ) { - const packer = yield packTarball(config); - const compressor = packer.pipe(new zlib.Gzip()); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config) { + const packer = yield packTarball(config); + const compressor = packer.pipe(new zlib.Gzip()); - return compressor; - }); + return compressor; + } + ); return function pack(_x2) { return _ref6.apply(this, arguments); @@ -52040,48 +51990,45 @@ and limitations under the License. let run = (exports.run = (() => { var _ref7 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const pkg = yield config.readRootManifest(); - if (!pkg.name) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("noName") - ); - } - if (!pkg.version) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("noVersion") - ); - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const pkg = yield config.readRootManifest(); + if (!pkg.name) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("noName") + ); + } + if (!pkg.version) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("noVersion") + ); + } - const normaliseScope = function normaliseScope(name) { - return name[0] === "@" ? name.substr(1).replace("/", "-") : name; - }; - const filename = - flags.filename || - path.join( - config.cwd, - `${normaliseScope(pkg.name)}-v${pkg.version}.tgz` - ); + const normaliseScope = function normaliseScope(name) { + return name[0] === "@" ? name.substr(1).replace("/", "-") : name; + }; + const filename = + flags.filename || + path.join( + config.cwd, + `${normaliseScope(pkg.name)}-v${pkg.version}.tgz` + ); - yield config.executeLifecycleScript("prepack"); + yield config.executeLifecycleScript("prepack"); - const stream = yield pack(config); + const stream = yield pack(config); - yield new Promise(function (resolve, reject) { - stream.pipe(fs2.createWriteStream(filename)); - stream.on("error", reject); - stream.on("close", resolve); - }); + yield new Promise(function (resolve, reject) { + stream.pipe(fs2.createWriteStream(filename)); + stream.on("error", reject); + stream.on("close", resolve); + }); - yield config.executeLifecycleScript("postpack"); + yield config.executeLifecycleScript("postpack"); - reporter.success(reporter.lang("packWroteTarball", filename)); - }); + reporter.success(reporter.lang("packWroteTarball", filename)); + } + ); return function run(_x3, _x4, _x5, _x6) { return _ref7.apply(this, arguments); @@ -56075,72 +56022,69 @@ and limitations under the License. let run = (exports.run = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - let addArgs = []; - const upgradeAll = - args.length === 0 && - typeof flags.scope === "undefined" && - typeof flags.pattern === "undefined"; - const addFlags = Object.assign({}, flags, { - force: true, - ignoreWorkspaceRootCheck: true, - workspaceRootIsCwd: config.cwd === config.lockfileFolder, - }); - const lockfile = yield ( - _lockfile || _load_lockfile() - ).default.fromDirectory(config.lockfileFolder, reporter); - const deps = yield getOutdated( - config, - reporter, - flags, - lockfile, - args - ); - const install = new (_install || _load_install()).Install( - flags, - config, - reporter, - lockfile - ); - - var _ref2 = yield install.fetchRequestFromCwd(); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + let addArgs = []; + const upgradeAll = + args.length === 0 && + typeof flags.scope === "undefined" && + typeof flags.pattern === "undefined"; + const addFlags = Object.assign({}, flags, { + force: true, + ignoreWorkspaceRootCheck: true, + workspaceRootIsCwd: config.cwd === config.lockfileFolder, + }); + const lockfile = yield ( + _lockfile || _load_lockfile() + ).default.fromDirectory(config.lockfileFolder, reporter); + const deps = yield getOutdated( + config, + reporter, + flags, + lockfile, + args + ); + const install = new (_install || _load_install()).Install( + flags, + config, + reporter, + lockfile + ); - const packagePatterns = _ref2.requests; + var _ref2 = yield install.fetchRequestFromCwd(); - setUserRequestedPackageVersions( - deps, - args, - flags.latest, - packagePatterns, - reporter - ); - cleanLockfile(lockfile, deps, packagePatterns, reporter); - addArgs = deps.map(function (dep) { - return dep.upgradeTo; - }); + const packagePatterns = _ref2.requests; - if (flags.scope && validScopeRegex.test(flags.scope)) { - addArgs = addArgs.filter(function (depName) { - return depName.startsWith(flags.scope); + setUserRequestedPackageVersions( + deps, + args, + flags.latest, + packagePatterns, + reporter + ); + cleanLockfile(lockfile, deps, packagePatterns, reporter); + addArgs = deps.map(function (dep) { + return dep.upgradeTo; }); - } - const add = new (_add || _load_add()).Add( - addArgs, - addFlags, - config, - reporter, - upgradeAll - ? new (_lockfile || _load_lockfile()).default() - : lockfile - ); - yield add.init(); - }); + if (flags.scope && validScopeRegex.test(flags.scope)) { + addArgs = addArgs.filter(function (depName) { + return depName.startsWith(flags.scope); + }); + } + + const add = new (_add || _load_add()).Add( + addArgs, + addFlags, + config, + reporter, + upgradeAll + ? new (_lockfile || _load_lockfile()).default() + : lockfile + ); + yield add.init(); + } + ); return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -56149,72 +56093,68 @@ and limitations under the License. let getOutdated = (exports.getOutdated = (() => { var _ref3 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - lockfile, - patterns - ) { - const install = new (_install || _load_install()).Install( - flags, - config, - reporter, - lockfile - ); - const outdatedFieldName = flags.latest ? "latest" : "wanted"; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, lockfile, patterns) { + const install = new (_install || _load_install()).Install( + flags, + config, + reporter, + lockfile + ); + const outdatedFieldName = flags.latest ? "latest" : "wanted"; - // ensure scope is of the form `@scope/` - const normalizeScope = function normalizeScope() { - if (flags.scope) { - if (!flags.scope.startsWith("@")) { - flags.scope = "@" + flags.scope; - } + // ensure scope is of the form `@scope/` + const normalizeScope = function normalizeScope() { + if (flags.scope) { + if (!flags.scope.startsWith("@")) { + flags.scope = "@" + flags.scope; + } - if (!flags.scope.endsWith("/")) { - flags.scope += "/"; + if (!flags.scope.endsWith("/")) { + flags.scope += "/"; + } } - } - }; + }; - const versionFilter = function versionFilter(dep) { - return dep.current !== dep[outdatedFieldName]; - }; + const versionFilter = function versionFilter(dep) { + return dep.current !== dep[outdatedFieldName]; + }; - if (!flags.latest) { - // these flags only have an affect when --latest is used - flags.tilde = false; - flags.exact = false; - flags.caret = false; - } + if (!flags.latest) { + // these flags only have an affect when --latest is used + flags.tilde = false; + flags.exact = false; + flags.caret = false; + } - normalizeScope(); + normalizeScope(); - const deps = (yield ( - _packageRequest || _load_packageRequest() - ).default.getOutdatedPackages( - lockfile, - install, - config, - reporter, - patterns, - flags - )) - .filter(versionFilter) - .filter(scopeFilter.bind(this, flags)); - deps.forEach(function (dep) { - dep.upgradeTo = buildPatternToUpgradeTo(dep, flags); - reporter.verbose( - reporter.lang( - "verboseUpgradeBecauseOutdated", - dep.name, - dep.upgradeTo - ) - ); - }); + const deps = (yield ( + _packageRequest || _load_packageRequest() + ).default.getOutdatedPackages( + lockfile, + install, + config, + reporter, + patterns, + flags + )) + .filter(versionFilter) + .filter(scopeFilter.bind(this, flags)); + deps.forEach(function (dep) { + dep.upgradeTo = buildPatternToUpgradeTo(dep, flags); + reporter.verbose( + reporter.lang( + "verboseUpgradeBecauseOutdated", + dep.name, + dep.upgradeTo + ) + ); + }); - return deps; - }); + return deps; + } + ); return function getOutdated(_x5, _x6, _x7, _x8, _x9) { return _ref3.apply(this, arguments); @@ -57683,48 +57623,45 @@ and limitations under the License. let fetchCache = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - dest, - fetcher, - config, - remote - ) { - // $FlowFixMe: This error doesn't make sense - var _ref2 = yield config.readPackageMetadata(dest); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (dest, fetcher, config, remote) { + // $FlowFixMe: This error doesn't make sense + var _ref2 = yield config.readPackageMetadata(dest); - const hash = _ref2.hash, - pkg = _ref2.package, - cacheRemote = _ref2.remote; + const hash = _ref2.hash, + pkg = _ref2.package, + cacheRemote = _ref2.remote; - if (remote.integrity) { - if ( - !cacheRemote.integrity || - !ssri.parse(remote.integrity).match(cacheRemote.integrity) - ) { - // eslint-disable-next-line yarn-internal/warn-language - throw new (_errors || _load_errors()).MessageError( - "Incorrect integrity when fetching from the cache" - ); + if (remote.integrity) { + if ( + !cacheRemote.integrity || + !ssri.parse(remote.integrity).match(cacheRemote.integrity) + ) { + // eslint-disable-next-line yarn-internal/warn-language + throw new (_errors || _load_errors()).MessageError( + "Incorrect integrity when fetching from the cache" + ); + } } - } - if (remote.hash) { - if (!cacheRemote.hash || cacheRemote.hash !== remote.hash) { - // eslint-disable-next-line yarn-internal/warn-language - throw new (_errors || _load_errors()).MessageError( - "Incorrect integrity when fetching from the cache" - ); + if (remote.hash) { + if (!cacheRemote.hash || cacheRemote.hash !== remote.hash) { + // eslint-disable-next-line yarn-internal/warn-language + throw new (_errors || _load_errors()).MessageError( + "Incorrect integrity when fetching from the cache" + ); + } } - } - yield fetcher.setupMirrorFromCache(); - return { - package: pkg, - hash, - dest, - cached: true, - }; - }); + yield fetcher.setupMirrorFromCache(); + return { + package: pkg, + hash, + dest, + cached: true, + }; + } + ); return function fetchCache(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -57733,54 +57670,50 @@ and limitations under the License. let fetchOneRemote = (exports.fetchOneRemote = (() => { var _ref3 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - remote, - name, - version, - dest, - config - ) { - // Mock metadata for symlinked dependencies - if (remote.type === "link") { - const mockPkg = { _uid: "", name: "", version: "0.0.0" }; - return Promise.resolve({ - resolved: null, - hash: "", - dest, - package: mockPkg, - cached: false, - }); - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (remote, name, version, dest, config) { + // Mock metadata for symlinked dependencies + if (remote.type === "link") { + const mockPkg = { _uid: "", name: "", version: "0.0.0" }; + return Promise.resolve({ + resolved: null, + hash: "", + dest, + package: mockPkg, + cached: false, + }); + } - const Fetcher = (_index || _load_index())[remote.type]; - if (!Fetcher) { - throw new (_errors || _load_errors()).MessageError( - config.reporter.lang("unknownFetcherFor", remote.type) - ); - } + const Fetcher = (_index || _load_index())[remote.type]; + if (!Fetcher) { + throw new (_errors || _load_errors()).MessageError( + config.reporter.lang("unknownFetcherFor", remote.type) + ); + } - const fetcher = new Fetcher(dest, remote, config); - if (yield config.isValidModuleDest(dest)) { - return fetchCache(dest, fetcher, config, remote); - } + const fetcher = new Fetcher(dest, remote, config); + if (yield config.isValidModuleDest(dest)) { + return fetchCache(dest, fetcher, config, remote); + } - // remove as the module may be invalid - yield (_fs || _load_fs()).unlink(dest); + // remove as the module may be invalid + yield (_fs || _load_fs()).unlink(dest); - try { - return yield fetcher.fetch({ - name, - version, - }); - } catch (err) { try { - yield (_fs || _load_fs()).unlink(dest); - } catch (err2) { - // what do? + return yield fetcher.fetch({ + name, + version, + }); + } catch (err) { + try { + yield (_fs || _load_fs()).unlink(dest); + } catch (err2) { + // what do? + } + throw err; } - throw err; } - }); + ); return function fetchOneRemote(_x5, _x6, _x7, _x8, _x9) { return _ref3.apply(this, arguments); @@ -57789,21 +57722,20 @@ and limitations under the License. let maybeFetchOne = (() => { var _ref4 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - ref, - config - ) { - try { - return yield fetchOne(ref, config); - } catch (err) { - if (ref.optional) { - config.reporter.error(err.message); - return null; - } else { - throw err; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (ref, config) { + try { + return yield fetchOne(ref, config); + } catch (err) { + if (ref.optional) { + config.reporter.error(err.message); + return null; + } else { + throw err; + } } } - }); + ); return function maybeFetchOne(_x10, _x11) { return _ref4.apply(this, arguments); @@ -57982,25 +57914,24 @@ and limitations under the License. let linkBin = (exports.linkBin = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - src, - dest - ) { - if (process.platform === "win32") { - const unlockMutex = yield (0, (_mutex || _load_mutex()).default)( - src - ); - try { - yield cmdShim(src, dest, { createPwshFile: false }); - } finally { - unlockMutex(); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (src, dest) { + if (process.platform === "win32") { + const unlockMutex = yield (0, (_mutex || _load_mutex()).default)( + src + ); + try { + yield cmdShim(src, dest, { createPwshFile: false }); + } finally { + unlockMutex(); + } + } else { + yield (_fs || _load_fs()).mkdirp(path.dirname(dest)); + yield (_fs || _load_fs()).symlink(src, dest); + yield (_fs || _load_fs()).chmod(dest, "755"); } - } else { - yield (_fs || _load_fs()).mkdirp(path.dirname(dest)); - yield (_fs || _load_fs()).symlink(src, dest); - yield (_fs || _load_fs()).chmod(dest, "755"); } - }); + ); return function linkBin(_x, _x2) { return _ref.apply(this, arguments); @@ -60554,9 +60485,8 @@ and limitations under the License. _npmRegistry || _load_npmRegistry() ).default.escapeName(_this.name); const desiredRange = desiredVersion || _this.range; - const body = yield _this.config.registries.npm.request( - escapedName - ); + const body = + yield _this.config.registries.npm.request(escapedName); if (body) { return NpmResolver.findVersionInRegistryResponse( @@ -60815,56 +60745,54 @@ and limitations under the License. // * On OSX you can open with read permissions and still call `fs.futimes`. let fixTimes = (() => { var _ref3 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - fd, - dest, - data - ) { - const doOpen = fd === undefined; - let openfd = fd ? fd : -1; - - if (disableTimestampCorrection === undefined) { - // if timestamps match already, no correction is needed. - // the need to correct timestamps varies based on OS and node versions. - const destStat = yield lstat(dest); - disableTimestampCorrection = fileDatesEqual( - destStat.mtime, - data.mtime - ); - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (fd, dest, data) { + const doOpen = fd === undefined; + let openfd = fd ? fd : -1; + + if (disableTimestampCorrection === undefined) { + // if timestamps match already, no correction is needed. + // the need to correct timestamps varies based on OS and node versions. + const destStat = yield lstat(dest); + disableTimestampCorrection = fileDatesEqual( + destStat.mtime, + data.mtime + ); + } - if (disableTimestampCorrection) { - return; - } + if (disableTimestampCorrection) { + return; + } - if (doOpen) { - try { - openfd = yield open(dest, "a", data.mode); - } catch (er) { - // file is likely read-only + if (doOpen) { try { - openfd = yield open(dest, "r", data.mode); - } catch (err) { - // We can't even open this file for reading. - return; + openfd = yield open(dest, "a", data.mode); + } catch (er) { + // file is likely read-only + try { + openfd = yield open(dest, "r", data.mode); + } catch (err) { + // We can't even open this file for reading. + return; + } } } - } - try { - if (openfd) { - yield futimes(openfd, data.atime, data.mtime); - } - } catch (er) { - // If `futimes` throws an exception, we probably have a case of a read-only file on Windows. - // In this case we can just return. The incorrect timestamp will just cause that file to be recopied - // on subsequent installs, which will effect yarn performance but not break anything. - } finally { - if (doOpen && openfd) { - yield close(openfd); + try { + if (openfd) { + yield futimes(openfd, data.atime, data.mtime); + } + } catch (er) { + // If `futimes` throws an exception, we probably have a case of a read-only file on Windows. + // In this case we can just return. The incorrect timestamp will just cause that file to be recopied + // on subsequent installs, which will effect yarn performance but not break anything. + } finally { + if (doOpen && openfd) { + yield close(openfd); + } } } - }); + ); return function fixTimes(_x7, _x8, _x9) { return _ref3.apply(this, arguments); @@ -60929,22 +60857,21 @@ and limitations under the License. */ const copyFile = (exports.copyFile = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - data, - cleanup - ) { - // $FlowFixMe: Flow doesn't currently support COPYFILE_FICLONE - const ficloneFlag = - (_fs2 || _load_fs2()).constants.COPYFILE_FICLONE || 0; - try { - yield unlink(data.dest); - yield copyFilePoly(data.src, data.dest, ficloneFlag, data); - } finally { - if (cleanup) { - cleanup(); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (data, cleanup) { + // $FlowFixMe: Flow doesn't currently support COPYFILE_FICLONE + const ficloneFlag = + (_fs2 || _load_fs2()).constants.COPYFILE_FICLONE || 0; + try { + yield unlink(data.dest); + yield copyFilePoly(data.src, data.dest, ficloneFlag, data); + } finally { + if (cleanup) { + cleanup(); + } } } - }); + ); return function copyFile(_x, _x2) { return _ref.apply(this, arguments); @@ -60973,23 +60900,20 @@ and limitations under the License. const copyWithBuffer = (() => { var _ref2 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - src, - dest, - flags, - data - ) { - // Use open -> write -> futimes -> close sequence to avoid opening the file twice: - // one with writeFile and one with utimes - const fd = yield open(dest, "w", data.mode); - try { - const buffer = yield readFileBuffer(src); - yield write(fd, buffer, 0, buffer.length); - yield fixTimes(fd, dest, data); - } finally { - yield close(fd); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (src, dest, flags, data) { + // Use open -> write -> futimes -> close sequence to avoid opening the file twice: + // one with writeFile and one with utimes + const fd = yield open(dest, "w", data.mode); + try { + const buffer = yield readFileBuffer(src); + yield write(fd, buffer, 0, buffer.length); + yield fixTimes(fd, dest, data); + } finally { + yield close(fd); + } } - }); + ); return function copyWithBuffer(_x3, _x4, _x5, _x6) { return _ref2.apply(this, arguments); @@ -61899,67 +61823,64 @@ and limitations under the License. exports.default = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - info, - moduleLoc, - config, - isRoot - ) { - // create human readable name - const name = info.name, - version = info.version; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (info, moduleLoc, config, isRoot) { + // create human readable name + const name = info.name, + version = info.version; - let human; - if (typeof name === "string") { - human = name; - } - if (human && typeof version === "string" && version) { - human += `@${version}`; - } - if (isRoot && info._loc) { - human = path.relative(config.cwd, info._loc); - } - - function warn(msg) { - if (human) { - msg = `${human}: ${msg}`; + let human; + if (typeof name === "string") { + human = name; + } + if (human && typeof version === "string" && version) { + human += `@${version}`; + } + if (isRoot && info._loc) { + human = path.relative(config.cwd, info._loc); } - config.reporter.warn(msg); - } - - yield (0, (_fix || _load_fix()).default)( - info, - moduleLoc, - config.reporter, - warn, - config.looseSemver - ); - (0, (_resolveRelative || _load_resolveRelative()).default)( - info, - moduleLoc, - config.lockfileFolder - ); - if (config.cwd === config.globalFolder) { - return info; - } + function warn(msg) { + if (human) { + msg = `${human}: ${msg}`; + } + config.reporter.warn(msg); + } - try { - (0, (_validate || _load_validate()).default)( + yield (0, (_fix || _load_fix()).default)( info, - isRoot, + moduleLoc, config.reporter, - warn + warn, + config.looseSemver ); - } catch (err) { - if (human) { - err.message = `${human}: ${err.message}`; + (0, (_resolveRelative || _load_resolveRelative()).default)( + info, + moduleLoc, + config.lockfileFolder + ); + + if (config.cwd === config.globalFolder) { + return info; } - throw err; - } - return info; - }); + try { + (0, (_validate || _load_validate()).default)( + info, + isRoot, + config.reporter, + warn + ); + } catch (err) { + if (human) { + err.message = `${human}: ${err.message}`; + } + throw err; + } + + return info; + } + ); return function (_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -63365,8 +63286,8 @@ and limitations under the License. ? s.charAt(i) : a : TO_STRING - ? s.slice(i, i + 2) - : ((a - 0xd800) << 10) + (b - 0xdc00) + 0x10000; + ? s.slice(i, i + 2) + : ((a - 0xd800) << 10) + (b - 0xdc00) + 0x10000; }; }; @@ -65344,8 +65265,8 @@ and limitations under the License. return this.matchJSX("{") ? this.parseJSXExpressionAttribute() : this.matchJSX("<") - ? this.parseJSXElement() - : this.parseJSXStringLiteralAttribute(); + ? this.parseJSXElement() + : this.parseJSXStringLiteralAttribute(); }; JSXParser.prototype.parseJSXNameValueAttribute = function () { var node = this.createJSXNode(); @@ -66649,14 +66570,14 @@ and limitations under the License. token.type === 2 /* EOF */ ? messages_1.Messages.UnexpectedEOS : token.type === 3 /* Identifier */ - ? messages_1.Messages.UnexpectedIdentifier - : token.type === 6 /* NumericLiteral */ - ? messages_1.Messages.UnexpectedNumber - : token.type === 8 /* StringLiteral */ - ? messages_1.Messages.UnexpectedString - : token.type === 10 /* Template */ - ? messages_1.Messages.UnexpectedTemplate - : messages_1.Messages.UnexpectedToken; + ? messages_1.Messages.UnexpectedIdentifier + : token.type === 6 /* NumericLiteral */ + ? messages_1.Messages.UnexpectedNumber + : token.type === 8 /* StringLiteral */ + ? messages_1.Messages.UnexpectedString + : token.type === 10 /* Template */ + ? messages_1.Messages.UnexpectedTemplate + : messages_1.Messages.UnexpectedToken; if (token.type === 4 /* Keyword */) { if (this.scanner.isFutureReservedWord(token.value)) { msg = messages_1.Messages.UnexpectedReserved; @@ -69200,14 +69121,14 @@ and limitations under the License. new Node.ForStatement(init, test, update, body) ) : forIn - ? this.finalize( - node, - new Node.ForInStatement(left, right, body) - ) - : this.finalize( - node, - new Node.ForOfStatement(left, right, body) - ); + ? this.finalize( + node, + new Node.ForInStatement(left, right, body) + ) + : this.finalize( + node, + new Node.ForOfStatement(left, right, body) + ); }; // https://tc39.github.io/ecma262/#sec-continue-statement Parser.prototype.parseContinueStatement = function () { @@ -70528,8 +70449,8 @@ and limitations under the License. var declaration = this.match("{") ? this.parseObjectInitializer() : this.match("[") - ? this.parseArrayInitializer() - : this.parseAssignmentExpression(); + ? this.parseArrayInitializer() + : this.parseAssignmentExpression(); this.consumeSemicolon(); exportDeclaration = this.finalize( node, @@ -77223,40 +77144,40 @@ declare var __webpack_require__: mixed; return c === 0x30 /* 0 */ ? "\x00" : c === 0x61 /* a */ - ? "\x07" - : c === 0x62 /* b */ - ? "\x08" - : c === 0x74 /* t */ - ? "\x09" - : c === 0x09 /* Tab */ - ? "\x09" - : c === 0x6e /* n */ - ? "\x0A" - : c === 0x76 /* v */ - ? "\x0B" - : c === 0x66 /* f */ - ? "\x0C" - : c === 0x72 /* r */ - ? "\x0D" - : c === 0x65 /* e */ - ? "\x1B" - : c === 0x20 /* Space */ - ? " " - : c === 0x22 /* " */ - ? "\x22" - : c === 0x2f /* / */ - ? "/" - : c === 0x5c /* \ */ - ? "\x5C" - : c === 0x4e /* N */ - ? "\x85" - : c === 0x5f /* _ */ - ? "\xA0" - : c === 0x4c /* L */ - ? "\u2028" - : c === 0x50 /* P */ - ? "\u2029" - : ""; + ? "\x07" + : c === 0x62 /* b */ + ? "\x08" + : c === 0x74 /* t */ + ? "\x09" + : c === 0x09 /* Tab */ + ? "\x09" + : c === 0x6e /* n */ + ? "\x0A" + : c === 0x76 /* v */ + ? "\x0B" + : c === 0x66 /* f */ + ? "\x0C" + : c === 0x72 /* r */ + ? "\x0D" + : c === 0x65 /* e */ + ? "\x1B" + : c === 0x20 /* Space */ + ? " " + : c === 0x22 /* " */ + ? "\x22" + : c === 0x2f /* / */ + ? "/" + : c === 0x5c /* \ */ + ? "\x5C" + : c === 0x4e /* N */ + ? "\x85" + : c === 0x5f /* _ */ + ? "\xA0" + : c === 0x4c /* L */ + ? "\u2028" + : c === 0x50 /* P */ + ? "\u2029" + : ""; } function charFromCodepoint(c) { @@ -78259,7 +78180,7 @@ declare var __webpack_require__: mixed; // first for the key (denoted by "?") and second for the value (denoted by ":") // if ( - (ch === 0x3f /* ? */ || ch === 0x3a /*: */) && + (ch === 0x3f /* ? */ || ch === 0x3a) /*: */ && is_WS_OR_EOL(following) ) { if (ch === 0x3f /* ? */) { @@ -81744,8 +81665,8 @@ object-assign var toRespond = !this.toRespond ? 0 : oldVal === NONE - ? --this.toRespond - : this.toRespond; + ? --this.toRespond + : this.toRespond; values[outerIndex] = innerValue; if (toRespond === 0) { if (this.resultSelector) { @@ -87702,69 +87623,66 @@ object-assign let run = (exports.run = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const DEFAULT_LOG_LEVEL = "info"; - const audit = new Audit(config, reporter, { - groups: - flags.groups || - (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES, - level: flags.level || DEFAULT_LOG_LEVEL, - }); - const lockfile = yield ( - _lockfile || _load_lockfile() - ).default.fromDirectory(config.lockfileFolder, reporter); - const install = new (_install || _load_install()).Install( - {}, - config, - reporter, - lockfile - ); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const DEFAULT_LOG_LEVEL = "info"; + const audit = new Audit(config, reporter, { + groups: + flags.groups || + (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES, + level: flags.level || DEFAULT_LOG_LEVEL, + }); + const lockfile = yield ( + _lockfile || _load_lockfile() + ).default.fromDirectory(config.lockfileFolder, reporter); + const install = new (_install || _load_install()).Install( + {}, + config, + reporter, + lockfile + ); - var _ref2 = yield install.fetchRequestFromCwd(); + var _ref2 = yield install.fetchRequestFromCwd(); - const manifest = _ref2.manifest, - requests = _ref2.requests, - patterns = _ref2.patterns, - workspaceLayout = _ref2.workspaceLayout; + const manifest = _ref2.manifest, + requests = _ref2.requests, + patterns = _ref2.patterns, + workspaceLayout = _ref2.workspaceLayout; - yield install.resolver.init(requests, { - workspaceLayout, - }); + yield install.resolver.init(requests, { + workspaceLayout, + }); - const vulnerabilities = yield audit.performAudit( - manifest, - lockfile, - install.resolver, - install.linker, - patterns - ); + const vulnerabilities = yield audit.performAudit( + manifest, + lockfile, + install.resolver, + install.linker, + patterns + ); - const EXIT_INFO = 1; - const EXIT_LOW = 2; - const EXIT_MODERATE = 4; - const EXIT_HIGH = 8; - const EXIT_CRITICAL = 16; - - const exitCode = - (vulnerabilities.info ? EXIT_INFO : 0) + - (vulnerabilities.low ? EXIT_LOW : 0) + - (vulnerabilities.moderate ? EXIT_MODERATE : 0) + - (vulnerabilities.high ? EXIT_HIGH : 0) + - (vulnerabilities.critical ? EXIT_CRITICAL : 0); - - if (flags.summary) { - audit.summary(); - } else { - audit.report(); - } + const EXIT_INFO = 1; + const EXIT_LOW = 2; + const EXIT_MODERATE = 4; + const EXIT_HIGH = 8; + const EXIT_CRITICAL = 16; + + const exitCode = + (vulnerabilities.info ? EXIT_INFO : 0) + + (vulnerabilities.low ? EXIT_LOW : 0) + + (vulnerabilities.moderate ? EXIT_MODERATE : 0) + + (vulnerabilities.high ? EXIT_HIGH : 0) + + (vulnerabilities.critical ? EXIT_CRITICAL : 0); + + if (flags.summary) { + audit.summary(); + } else { + audit.report(); + } - return exitCode; - }); + return exitCode; + } + ); return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -88139,221 +88057,220 @@ object-assign let clean = (exports.clean = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter - ) { - const loc = path.join( - config.lockfileFolder, - (_constants || _load_constants()).CLEAN_FILENAME - ); - const file = yield (_fs || _load_fs()).readFile(loc); - const lines = file.split("\n"); - const filters = (0, (_filter || _load_filter()).ignoreLinesToRegex)( - lines - ); - - let removedFiles = 0; - let removedSize = 0; - - // build list of possible module folders - const locs = new Set(); - for ( - var _iterator = config.registryFolders, - _isArray = Array.isArray(_iterator), - _i = 0, - _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); - ; - - ) { - var _ref2; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; - } - - const registryFolder = _ref2; - - locs.add(path.resolve(config.lockfileFolder, registryFolder)); - } - - const workspaceRootFolder = config.workspaceRootFolder; - if (workspaceRootFolder) { - const manifest = yield config.findManifest( - workspaceRootFolder, - false + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter) { + const loc = path.join( + config.lockfileFolder, + (_constants || _load_constants()).CLEAN_FILENAME ); - invariant( - manifest && manifest.workspaces, - 'We must find a manifest with a "workspaces" property' + const file = yield (_fs || _load_fs()).readFile(loc); + const lines = file.split("\n"); + const filters = (0, (_filter || _load_filter()).ignoreLinesToRegex)( + lines ); - const workspaces = yield config.resolveWorkspaces( - workspaceRootFolder, - manifest - ); + let removedFiles = 0; + let removedSize = 0; + // build list of possible module folders + const locs = new Set(); for ( - var _iterator2 = Object.keys(workspaces), - _isArray2 = Array.isArray(_iterator2), - _i2 = 0, - _iterator2 = _isArray2 - ? _iterator2 - : _iterator2[Symbol.iterator](); + var _iterator = config.registryFolders, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) { - var _ref3; + var _ref2; - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref3 = _iterator2[_i2++]; + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref3 = _i2.value; + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; } - const workspaceName = _ref3; + const registryFolder = _ref2; + + locs.add(path.resolve(config.lockfileFolder, registryFolder)); + } + + const workspaceRootFolder = config.workspaceRootFolder; + if (workspaceRootFolder) { + const manifest = yield config.findManifest( + workspaceRootFolder, + false + ); + invariant( + manifest && manifest.workspaces, + 'We must find a manifest with a "workspaces" property' + ); + + const workspaces = yield config.resolveWorkspaces( + workspaceRootFolder, + manifest + ); for ( - var _iterator3 = (_index || _load_index()).registryNames, - _isArray3 = Array.isArray(_iterator3), - _i3 = 0, - _iterator3 = _isArray3 - ? _iterator3 - : _iterator3[Symbol.iterator](); + var _iterator2 = Object.keys(workspaces), + _isArray2 = Array.isArray(_iterator2), + _i2 = 0, + _iterator2 = _isArray2 + ? _iterator2 + : _iterator2[Symbol.iterator](); ; ) { - var _ref4; + var _ref3; - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref4 = _iterator3[_i3++]; + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref4 = _i3.value; + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; } - const name = _ref4; + const workspaceName = _ref3; - const registry = config.registries[name]; - locs.add( - path.join(workspaces[workspaceName].loc, registry.folder) - ); - } - } - } + for ( + var _iterator3 = (_index || _load_index()).registryNames, + _isArray3 = Array.isArray(_iterator3), + _i3 = 0, + _iterator3 = _isArray3 + ? _iterator3 + : _iterator3[Symbol.iterator](); + ; - for ( - var _iterator4 = locs, - _isArray4 = Array.isArray(_iterator4), - _i4 = 0, - _iterator4 = _isArray4 - ? _iterator4 - : _iterator4[Symbol.iterator](); - ; + ) { + var _ref4; - ) { - var _ref5; + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref5 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref5 = _i4.value; + const name = _ref4; + + const registry = config.registries[name]; + locs.add( + path.join(workspaces[workspaceName].loc, registry.folder) + ); + } + } } - const folder = _ref5; + for ( + var _iterator4 = locs, + _isArray4 = Array.isArray(_iterator4), + _i4 = 0, + _iterator4 = _isArray4 + ? _iterator4 + : _iterator4[Symbol.iterator](); + ; - if (!(yield (_fs || _load_fs()).exists(folder))) { - continue; - } + ) { + var _ref5; - const spinner = reporter.activity(); - const files = yield (_fs || _load_fs()).walk(folder); + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref5 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref5 = _i4.value; + } - var _sortFilter = (0, (_filter || _load_filter()).sortFilter)( - files, - filters - ); + const folder = _ref5; - const ignoreFiles = _sortFilter.ignoreFiles; + if (!(yield (_fs || _load_fs()).exists(folder))) { + continue; + } - spinner.end(); + const spinner = reporter.activity(); + const files = yield (_fs || _load_fs()).walk(folder); - const tick = reporter.progress(ignoreFiles.size); - // TODO make sure `main` field of all modules isn't ignored + var _sortFilter = (0, (_filter || _load_filter()).sortFilter)( + files, + filters + ); - for ( - var _iterator5 = ignoreFiles, - _isArray5 = Array.isArray(_iterator5), - _i5 = 0, - _iterator5 = _isArray5 - ? _iterator5 - : _iterator5[Symbol.iterator](); - ; + const ignoreFiles = _sortFilter.ignoreFiles; - ) { - var _ref6; + spinner.end(); - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref6 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref6 = _i5.value; - } + const tick = reporter.progress(ignoreFiles.size); + // TODO make sure `main` field of all modules isn't ignored - const file = _ref6; + for ( + var _iterator5 = ignoreFiles, + _isArray5 = Array.isArray(_iterator5), + _i5 = 0, + _iterator5 = _isArray5 + ? _iterator5 + : _iterator5[Symbol.iterator](); + ; - const loc = path.join(folder, file); - const stat = yield (_fs || _load_fs()).lstat(loc); - removedSize += stat.size; - removedFiles++; - } + ) { + var _ref6; - for ( - var _iterator6 = ignoreFiles, - _isArray6 = Array.isArray(_iterator6), - _i6 = 0, - _iterator6 = _isArray6 - ? _iterator6 - : _iterator6[Symbol.iterator](); - ; + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref6 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref6 = _i5.value; + } - ) { - var _ref7; + const file = _ref6; - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref7 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref7 = _i6.value; + const loc = path.join(folder, file); + const stat = yield (_fs || _load_fs()).lstat(loc); + removedSize += stat.size; + removedFiles++; } - const file = _ref7; + for ( + var _iterator6 = ignoreFiles, + _isArray6 = Array.isArray(_iterator6), + _i6 = 0, + _iterator6 = _isArray6 + ? _iterator6 + : _iterator6[Symbol.iterator](); + ; + + ) { + var _ref7; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref7 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref7 = _i6.value; + } + + const file = _ref7; - const loc = path.join(folder, file); - yield (_fs || _load_fs()).unlink(loc); - tick(); + const loc = path.join(folder, file); + yield (_fs || _load_fs()).unlink(loc); + tick(); + } } - } - return { removedFiles, removedSize }; - }); + return { removedFiles, removedSize }; + } + ); return function clean(_x, _x2) { return _ref.apply(this, arguments); @@ -88362,32 +88279,35 @@ object-assign let runInit = (() => { var _ref8 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - cwd, - reporter - ) { - reporter.step( - 1, - 1, - reporter.lang( - "cleanCreatingFile", - (_constants || _load_constants()).CLEAN_FILENAME - ) - ); - const cleanLoc = path.join( - cwd, - (_constants || _load_constants()).CLEAN_FILENAME - ); - yield (_fs || _load_fs()).writeFile(cleanLoc, `${DEFAULT_FILTER}\n`, { - flag: "wx", - }); - reporter.info( - reporter.lang( - "cleanCreatedFile", + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (cwd, reporter) { + reporter.step( + 1, + 1, + reporter.lang( + "cleanCreatingFile", + (_constants || _load_constants()).CLEAN_FILENAME + ) + ); + const cleanLoc = path.join( + cwd, (_constants || _load_constants()).CLEAN_FILENAME - ) - ); - }); + ); + yield (_fs || _load_fs()).writeFile( + cleanLoc, + `${DEFAULT_FILTER}\n`, + { + flag: "wx", + } + ); + reporter.info( + reporter.lang( + "cleanCreatedFile", + (_constants || _load_constants()).CLEAN_FILENAME + ) + ); + } + ); return function runInit(_x3, _x4) { return _ref8.apply(this, arguments); @@ -88396,25 +88316,24 @@ object-assign let runAutoClean = (() => { var _ref9 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter - ) { - reporter.step(1, 1, reporter.lang("cleaning")); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter) { + reporter.step(1, 1, reporter.lang("cleaning")); - var _ref10 = yield clean(config, reporter); + var _ref10 = yield clean(config, reporter); - const removedFiles = _ref10.removedFiles, - removedSize = _ref10.removedSize; + const removedFiles = _ref10.removedFiles, + removedSize = _ref10.removedSize; - reporter.info(reporter.lang("cleanRemovedFiles", removedFiles)); - reporter.info( - reporter.lang( - "cleanSavedSize", - Number((removedSize / 1024 / 1024).toFixed(2)) - ) - ); - }); + reporter.info(reporter.lang("cleanRemovedFiles", removedFiles)); + reporter.info( + reporter.lang( + "cleanSavedSize", + Number((removedSize / 1024 / 1024).toFixed(2)) + ) + ); + } + ); return function runAutoClean(_x5, _x6) { return _ref9.apply(this, arguments); @@ -88423,16 +88342,16 @@ object-assign let checkForCleanFile = (() => { var _ref11 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - cwd - ) { - const cleanLoc = path.join( - cwd, - (_constants || _load_constants()).CLEAN_FILENAME - ); - const exists = yield (_fs || _load_fs()).exists(cleanLoc); - return exists; - }); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (cwd) { + const cleanLoc = path.join( + cwd, + (_constants || _load_constants()).CLEAN_FILENAME + ); + const exists = yield (_fs || _load_fs()).exists(cleanLoc); + return exists; + } + ); return function checkForCleanFile(_x7) { return _ref11.apply(this, arguments); @@ -88441,41 +88360,38 @@ object-assign let run = (exports.run = (() => { var _ref12 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const cleanFileExists = yield checkForCleanFile(config.cwd); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const cleanFileExists = yield checkForCleanFile(config.cwd); - if (flags.init && cleanFileExists) { - reporter.info( - reporter.lang( - "cleanAlreadyExists", - (_constants || _load_constants()).CLEAN_FILENAME - ) - ); - } else if (flags.init) { - yield runInit(config.cwd, reporter); - } else if (flags.force && cleanFileExists) { - yield runAutoClean(config, reporter); - } else if (cleanFileExists) { - reporter.info( - reporter.lang( - "cleanRequiresForce", - (_constants || _load_constants()).CLEAN_FILENAME - ) - ); - } else { - reporter.info( - reporter.lang( - "cleanDoesNotExist", - (_constants || _load_constants()).CLEAN_FILENAME - ) - ); + if (flags.init && cleanFileExists) { + reporter.info( + reporter.lang( + "cleanAlreadyExists", + (_constants || _load_constants()).CLEAN_FILENAME + ) + ); + } else if (flags.init) { + yield runInit(config.cwd, reporter); + } else if (flags.force && cleanFileExists) { + yield runAutoClean(config, reporter); + } else if (cleanFileExists) { + reporter.info( + reporter.lang( + "cleanRequiresForce", + (_constants || _load_constants()).CLEAN_FILENAME + ) + ); + } else { + reporter.info( + reporter.lang( + "cleanDoesNotExist", + (_constants || _load_constants()).CLEAN_FILENAME + ) + ); + } } - }); + ); return function run(_x8, _x9, _x10, _x11) { return _ref12.apply(this, arguments); @@ -88630,130 +88546,129 @@ wercker.yml let getCachedPackagesDirs = (exports.getCachedPackagesDirs = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - currentPath - ) { - const results = []; - const stat = yield (_fs || _load_fs()).lstat(currentPath); - - if (!stat.isDirectory()) { - return results; - } - - const folders = yield (_fs || _load_fs()).readdir(currentPath); - for ( - var _iterator = folders, - _isArray = Array.isArray(_iterator), - _i = 0, - _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); - ; - - ) { - var _ref2; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; - } - - const folder = _ref2; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, currentPath) { + const results = []; + const stat = yield (_fs || _load_fs()).lstat(currentPath); - if (folder[0] === ".") { - continue; + if (!stat.isDirectory()) { + return results; } - const packageParentPath = path.join( - currentPath, - folder, - "node_modules" - ); - - const candidates = yield (_fs || _load_fs()).readdir( - packageParentPath - ); - invariant( - candidates.length === 1, - `There should only be one folder in a package cache (got ${candidates.join( - "," - )} in ${packageParentPath})` - ); + const folders = yield (_fs || _load_fs()).readdir(currentPath); for ( - var _iterator2 = candidates, - _isArray2 = Array.isArray(_iterator2), - _i2 = 0, - _iterator2 = _isArray2 - ? _iterator2 - : _iterator2[Symbol.iterator](); + var _iterator = folders, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) { - var _ref3; + var _ref2; - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref3 = _iterator2[_i2++]; + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref3 = _i2.value; + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; } - const candidate = _ref3; + const folder = _ref2; - const candidatePath = path.join(packageParentPath, candidate); - if (candidate.charAt(0) === "@") { - const subCandidates = yield (_fs || _load_fs()).readdir( - candidatePath - ); - invariant( - subCandidates.length === 1, - `There should only be one folder in a package cache (got ${subCandidates.join( - "," - )} in ${candidatePath})` - ); + if (folder[0] === ".") { + continue; + } + const packageParentPath = path.join( + currentPath, + folder, + "node_modules" + ); - for ( - var _iterator3 = subCandidates, - _isArray3 = Array.isArray(_iterator3), - _i3 = 0, - _iterator3 = _isArray3 - ? _iterator3 - : _iterator3[Symbol.iterator](); - ; + const candidates = yield (_fs || _load_fs()).readdir( + packageParentPath + ); + invariant( + candidates.length === 1, + `There should only be one folder in a package cache (got ${candidates.join( + "," + )} in ${packageParentPath})` + ); - ) { - var _ref4; + for ( + var _iterator2 = candidates, + _isArray2 = Array.isArray(_iterator2), + _i2 = 0, + _iterator2 = _isArray2 + ? _iterator2 + : _iterator2[Symbol.iterator](); + ; - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref4 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref4 = _i3.value; - } + ) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } - const subCandidate = _ref4; + const candidate = _ref3; - const subCandidatePath = path.join( - candidatePath, - subCandidate + const candidatePath = path.join(packageParentPath, candidate); + if (candidate.charAt(0) === "@") { + const subCandidates = yield (_fs || _load_fs()).readdir( + candidatePath ); - results.push(subCandidatePath); + invariant( + subCandidates.length === 1, + `There should only be one folder in a package cache (got ${subCandidates.join( + "," + )} in ${candidatePath})` + ); + + for ( + var _iterator3 = subCandidates, + _isArray3 = Array.isArray(_iterator3), + _i3 = 0, + _iterator3 = _isArray3 + ? _iterator3 + : _iterator3[Symbol.iterator](); + ; + + ) { + var _ref4; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } + + const subCandidate = _ref4; + + const subCandidatePath = path.join( + candidatePath, + subCandidate + ); + results.push(subCandidatePath); + } + } else { + results.push(candidatePath); } - } else { - results.push(candidatePath); } } - } - return results; - }); + return results; + } + ); return function getCachedPackagesDirs(_x, _x2) { return _ref.apply(this, arguments); @@ -88762,19 +88677,22 @@ wercker.yml let getCachedPackages = (() => { var _ref5 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config - ) { - const paths = yield getCachedPackagesDirs(config, config.cacheFolder); - return _getMetadataWithPath( - config.readPackageMetadata.bind(config), - paths - ).then(function (packages) { - return packages.filter(function (p) { - return !!p; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config) { + const paths = yield getCachedPackagesDirs( + config, + config.cacheFolder + ); + return _getMetadataWithPath( + config.readPackageMetadata.bind(config), + paths + ).then(function (packages) { + return packages.filter(function (p) { + return !!p; + }); }); - }); - }); + } + ); return function getCachedPackages(_x3) { return _ref5.apply(this, arguments); @@ -88783,43 +88701,40 @@ wercker.yml let list = (() => { var _ref6 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const filterOut = function filterOut({ - registry, - package: manifest, - remote, - } = {}) { - if ( - flags.pattern && - !micromatch.contains(manifest.name, flags.pattern) - ) { - return false; - } - return true; - }; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const filterOut = function filterOut({ + registry, + package: manifest, + remote, + } = {}) { + if ( + flags.pattern && + !micromatch.contains(manifest.name, flags.pattern) + ) { + return false; + } + return true; + }; - const forReport = function forReport({ - registry, - package: manifest, - remote, - } = {}) { - return [ - manifest.name, - manifest.version, + const forReport = function forReport({ registry, - (remote && remote.resolved) || "", - ]; - }; + package: manifest, + remote, + } = {}) { + return [ + manifest.name, + manifest.version, + registry, + (remote && remote.resolved) || "", + ]; + }; - const packages = yield getCachedPackages(config); - const body = packages.filter(filterOut).map(forReport); - reporter.table(["Name", "Version", "Registry", "Resolved"], body); - }); + const packages = yield getCachedPackages(config); + const body = packages.filter(filterOut).map(forReport); + reporter.table(["Name", "Version", "Registry", "Resolved"], body); + } + ); return function list(_x4, _x5, _x6, _x7) { return _ref6.apply(this, arguments); @@ -88828,75 +88743,72 @@ wercker.yml let clean = (() => { var _ref7 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - if (config.cacheFolder) { - const activity = reporter.activity(); - - if (args.length > 0) { - // Clear named packages from cache - const packages = yield getCachedPackages(config); - const shouldDelete = function shouldDelete({ - registry, - package: manifest, - remote, - } = {}) { - return args.indexOf(manifest.name) !== -1; - }; - const packagesToDelete = packages.filter(shouldDelete); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + if (config.cacheFolder) { + const activity = reporter.activity(); + + if (args.length > 0) { + // Clear named packages from cache + const packages = yield getCachedPackages(config); + const shouldDelete = function shouldDelete({ + registry, + package: manifest, + remote, + } = {}) { + return args.indexOf(manifest.name) !== -1; + }; + const packagesToDelete = packages.filter(shouldDelete); - for ( - var _iterator4 = packagesToDelete, - _isArray4 = Array.isArray(_iterator4), - _i4 = 0, - _iterator4 = _isArray4 - ? _iterator4 - : _iterator4[Symbol.iterator](); - ; + for ( + var _iterator4 = packagesToDelete, + _isArray4 = Array.isArray(_iterator4), + _i4 = 0, + _iterator4 = _isArray4 + ? _iterator4 + : _iterator4[Symbol.iterator](); + ; - ) { - var _ref8; + ) { + var _ref8; - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref8 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref8 = _i4.value; - } + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref8 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref8 = _i4.value; + } - const manifest = _ref8; + const manifest = _ref8; - let relativePath = path.relative( - config.cacheFolder, - manifest._path - ); - while (relativePath && relativePath !== ".") { - yield (_fs || _load_fs()).unlink( - path.resolve(config.cacheFolder, relativePath) + let relativePath = path.relative( + config.cacheFolder, + manifest._path ); - relativePath = path.dirname(relativePath); + while (relativePath && relativePath !== ".") { + yield (_fs || _load_fs()).unlink( + path.resolve(config.cacheFolder, relativePath) + ); + relativePath = path.dirname(relativePath); + } } - } - activity.end(); - reporter.success( - reporter.lang("clearedPackageFromCache", args[0]) - ); - } else { - // Clear all cache - yield (_fs || _load_fs()).unlink(config._cacheRootFolder); - yield (_fs || _load_fs()).mkdirp(config.cacheFolder); - activity.end(); - reporter.success(reporter.lang("clearedCache")); + activity.end(); + reporter.success( + reporter.lang("clearedPackageFromCache", args[0]) + ); + } else { + // Clear all cache + yield (_fs || _load_fs()).unlink(config._cacheRootFolder); + yield (_fs || _load_fs()).mkdirp(config.cacheFolder); + activity.end(); + reporter.success(reporter.lang("clearedCache")); + } } } - }); + ); return function clean(_x8, _x9, _x10, _x11) { return _ref7.apply(this, arguments); @@ -89021,169 +88933,166 @@ wercker.yml let verifyTreeCheck = (exports.verifyTreeCheck = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - let errCount = 0; - function reportError(msg, ...vars) { - reporter.error(reporter.lang(msg, ...vars)); - errCount++; - } - // check all dependencies recursively without relying on internal resolver - const registryName = "yarn"; - const registryFolder = config.registryFolders[0]; - const cwd = config.workspaceRootFolder - ? config.lockfileFolder - : config.cwd; - const rootManifest = yield config.readManifest(cwd, registryName); - - const dependenciesToCheckVersion = []; - if (rootManifest.dependencies) { - for (const name in rootManifest.dependencies) { - const version = rootManifest.dependencies[name]; - // skip linked dependencies - const isLinkedDependency = - /^link:/i.test(version) || - (/^file:/i.test(version) && config.linkFileDependencies); - if (isLinkedDependency) { - continue; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + let errCount = 0; + function reportError(msg, ...vars) { + reporter.error(reporter.lang(msg, ...vars)); + errCount++; + } + // check all dependencies recursively without relying on internal resolver + const registryName = "yarn"; + const registryFolder = config.registryFolders[0]; + const cwd = config.workspaceRootFolder + ? config.lockfileFolder + : config.cwd; + const rootManifest = yield config.readManifest(cwd, registryName); + + const dependenciesToCheckVersion = []; + if (rootManifest.dependencies) { + for (const name in rootManifest.dependencies) { + const version = rootManifest.dependencies[name]; + // skip linked dependencies + const isLinkedDependency = + /^link:/i.test(version) || + (/^file:/i.test(version) && config.linkFileDependencies); + if (isLinkedDependency) { + continue; + } + dependenciesToCheckVersion.push({ + name, + originalKey: name, + parentCwd: cwd, + version, + }); } - dependenciesToCheckVersion.push({ - name, - originalKey: name, - parentCwd: cwd, - version, - }); } - } - if (rootManifest.devDependencies && !config.production) { - for (const name in rootManifest.devDependencies) { - const version = rootManifest.devDependencies[name]; - // skip linked dependencies - const isLinkedDependency = - /^link:/i.test(version) || - (/^file:/i.test(version) && config.linkFileDependencies); - if (isLinkedDependency) { - continue; + if (rootManifest.devDependencies && !config.production) { + for (const name in rootManifest.devDependencies) { + const version = rootManifest.devDependencies[name]; + // skip linked dependencies + const isLinkedDependency = + /^link:/i.test(version) || + (/^file:/i.test(version) && config.linkFileDependencies); + if (isLinkedDependency) { + continue; + } + dependenciesToCheckVersion.push({ + name, + originalKey: name, + parentCwd: cwd, + version, + }); } - dependenciesToCheckVersion.push({ - name, - originalKey: name, - parentCwd: cwd, - version, - }); } - } - const locationsVisited = new Set(); - while (dependenciesToCheckVersion.length) { - const dep = dependenciesToCheckVersion.shift(); - const manifestLoc = path.resolve( - dep.parentCwd, - registryFolder, - dep.name - ); - if (locationsVisited.has(manifestLoc + `@${dep.version}`)) { - continue; - } - locationsVisited.add(manifestLoc + `@${dep.version}`); - // When plugnplay is enabled, packages aren't copied to the node_modules folder, so this check doesn't make sense - // TODO: We ideally should check that the packages are located inside the cache instead - if (config.plugnplayEnabled) { - continue; - } - if (!(yield (_fs || _load_fs()).exists(manifestLoc))) { - reportError("packageNotInstalled", `${dep.originalKey}`); - continue; - } - if ( - !(yield (_fs || _load_fs()).exists( - path.join(manifestLoc, "package.json") - )) - ) { - continue; - } - const pkg = yield config.readManifest(manifestLoc, registryName); - if ( - semver.validRange(dep.version, config.looseSemver) && - !semver.satisfies(pkg.version, dep.version, config.looseSemver) - ) { - reportError( - "packageWrongVersion", - dep.originalKey, - dep.version, - pkg.version + const locationsVisited = new Set(); + while (dependenciesToCheckVersion.length) { + const dep = dependenciesToCheckVersion.shift(); + const manifestLoc = path.resolve( + dep.parentCwd, + registryFolder, + dep.name ); - continue; - } - const dependencies = pkg.dependencies; - if (dependencies) { - for (const subdep in dependencies) { - const subDepPath = path.resolve( - manifestLoc, - registryFolder, - subdep + if (locationsVisited.has(manifestLoc + `@${dep.version}`)) { + continue; + } + locationsVisited.add(manifestLoc + `@${dep.version}`); + // When plugnplay is enabled, packages aren't copied to the node_modules folder, so this check doesn't make sense + // TODO: We ideally should check that the packages are located inside the cache instead + if (config.plugnplayEnabled) { + continue; + } + if (!(yield (_fs || _load_fs()).exists(manifestLoc))) { + reportError("packageNotInstalled", `${dep.originalKey}`); + continue; + } + if ( + !(yield (_fs || _load_fs()).exists( + path.join(manifestLoc, "package.json") + )) + ) { + continue; + } + const pkg = yield config.readManifest(manifestLoc, registryName); + if ( + semver.validRange(dep.version, config.looseSemver) && + !semver.satisfies(pkg.version, dep.version, config.looseSemver) + ) { + reportError( + "packageWrongVersion", + dep.originalKey, + dep.version, + pkg.version ); - let found = false; - const relative = path.relative(cwd, subDepPath); - const locations = path - .normalize(relative) - .split(registryFolder + path.sep) - .filter(function (dir) { - return !!dir; - }); - locations.pop(); - while (locations.length >= 0) { - let possiblePath; - if (locations.length > 0) { - possiblePath = path.join( - cwd, - registryFolder, - locations.join(path.sep + registryFolder + path.sep) - ); - } else { - possiblePath = cwd; - } - if ( - yield (_fs || _load_fs()).exists( - path.resolve(possiblePath, registryFolder, subdep) - ) - ) { - dependenciesToCheckVersion.push({ - name: subdep, - originalKey: `${dep.originalKey}#${subdep}`, - parentCwd: possiblePath, - version: dependencies[subdep], + continue; + } + const dependencies = pkg.dependencies; + if (dependencies) { + for (const subdep in dependencies) { + const subDepPath = path.resolve( + manifestLoc, + registryFolder, + subdep + ); + let found = false; + const relative = path.relative(cwd, subDepPath); + const locations = path + .normalize(relative) + .split(registryFolder + path.sep) + .filter(function (dir) { + return !!dir; }); - found = true; - break; + locations.pop(); + while (locations.length >= 0) { + let possiblePath; + if (locations.length > 0) { + possiblePath = path.join( + cwd, + registryFolder, + locations.join(path.sep + registryFolder + path.sep) + ); + } else { + possiblePath = cwd; + } + if ( + yield (_fs || _load_fs()).exists( + path.resolve(possiblePath, registryFolder, subdep) + ) + ) { + dependenciesToCheckVersion.push({ + name: subdep, + originalKey: `${dep.originalKey}#${subdep}`, + parentCwd: possiblePath, + version: dependencies[subdep], + }); + found = true; + break; + } + if (!locations.length) { + break; + } + locations.pop(); } - if (!locations.length) { - break; + if (!found) { + reportError( + "packageNotInstalled", + `${dep.originalKey}#${subdep}` + ); } - locations.pop(); - } - if (!found) { - reportError( - "packageNotInstalled", - `${dep.originalKey}#${subdep}` - ); } } } - } - if (errCount > 0) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("foundErrors", errCount) - ); - } else { - reporter.success(reporter.lang("folderInSync")); + if (errCount > 0) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("foundErrors", errCount) + ); + } else { + reporter.success(reporter.lang("folderInSync")); + } } - }); + ); return function verifyTreeCheck(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -89192,88 +89101,85 @@ wercker.yml let integrityHashCheck = (() => { var _ref2 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - let errCount = 0; - function reportError(msg, ...vars) { - reporter.error(reporter.lang(msg, ...vars)); - errCount++; - } - const integrityChecker = new ( - _integrityChecker || _load_integrityChecker() - ).default(config); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + let errCount = 0; + function reportError(msg, ...vars) { + reporter.error(reporter.lang(msg, ...vars)); + errCount++; + } + const integrityChecker = new ( + _integrityChecker || _load_integrityChecker() + ).default(config); - const lockfile = yield ( - _lockfile || _load_lockfile() - ).default.fromDirectory(config.cwd); - const install = new (_install || _load_install()).Install( - flags, - config, - reporter, - lockfile - ); + const lockfile = yield ( + _lockfile || _load_lockfile() + ).default.fromDirectory(config.cwd); + const install = new (_install || _load_install()).Install( + flags, + config, + reporter, + lockfile + ); - // get patterns that are installed when running `yarn install` + // get patterns that are installed when running `yarn install` - var _ref3 = yield install.fetchRequestFromCwd(); + var _ref3 = yield install.fetchRequestFromCwd(); - const patterns = _ref3.patterns, - workspaceLayout = _ref3.workspaceLayout; + const patterns = _ref3.patterns, + workspaceLayout = _ref3.workspaceLayout; - const match = yield integrityChecker.check( - patterns, - lockfile.cache, - flags, - workspaceLayout - ); - for ( - var _iterator = match.missingPatterns, - _isArray = Array.isArray(_iterator), - _i = 0, - _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); - ; + const match = yield integrityChecker.check( + patterns, + lockfile.cache, + flags, + workspaceLayout + ); + for ( + var _iterator = match.missingPatterns, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); + ; - ) { - var _ref4; + ) { + var _ref4; - if (_isArray) { - if (_i >= _iterator.length) break; - _ref4 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref4 = _i.value; - } + if (_isArray) { + if (_i >= _iterator.length) break; + _ref4 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref4 = _i.value; + } - const pattern = _ref4; + const pattern = _ref4; - reportError("lockfileNotContainPattern", pattern); - } - if (match.integrityFileMissing) { - reportError("noIntegrityFile"); - } - if (match.integrityMatches === false) { - reporter.warn( - reporter.lang( - (_integrityChecker2 || _load_integrityChecker2()) - .integrityErrors[match.integrityError] - ) - ); - reportError("integrityCheckFailed"); - } + reportError("lockfileNotContainPattern", pattern); + } + if (match.integrityFileMissing) { + reportError("noIntegrityFile"); + } + if (match.integrityMatches === false) { + reporter.warn( + reporter.lang( + (_integrityChecker2 || _load_integrityChecker2()) + .integrityErrors[match.integrityError] + ) + ); + reportError("integrityCheckFailed"); + } - if (errCount > 0) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("foundErrors", errCount) - ); - } else { - reporter.success(reporter.lang("folderInSync")); + if (errCount > 0) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("foundErrors", errCount) + ); + } else { + reporter.success(reporter.lang("folderInSync")); + } } - }); + ); return function integrityHashCheck(_x5, _x6, _x7, _x8) { return _ref2.apply(this, arguments); @@ -89282,377 +89188,384 @@ wercker.yml let run = (exports.run = (() => { var _ref5 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - if (flags.verifyTree) { - yield verifyTreeCheck(config, reporter, flags, args); - return; - } else if (flags.integrity) { - yield integrityHashCheck(config, reporter, flags, args); - return; - } - - const lockfile = yield ( - _lockfile || _load_lockfile() - ).default.fromDirectory(config.cwd); - const install = new (_install || _load_install()).Install( - flags, - config, - reporter, - lockfile - ); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + if (flags.verifyTree) { + yield verifyTreeCheck(config, reporter, flags, args); + return; + } else if (flags.integrity) { + yield integrityHashCheck(config, reporter, flags, args); + return; + } - function humaniseLocation(loc) { - const relative = path.relative( - path.join(config.cwd, "node_modules"), - loc + const lockfile = yield ( + _lockfile || _load_lockfile() + ).default.fromDirectory(config.cwd); + const install = new (_install || _load_install()).Install( + flags, + config, + reporter, + lockfile ); - const normalized = path.normalize(relative).split(path.sep); - return normalized - .filter((p) => p !== "node_modules") - .reduce((result, part) => { - const length = result.length; - if ( - length && - result[length - 1].startsWith("@") && - result[length - 1].indexOf(path.sep) === -1 - ) { - result[length - 1] += path.sep + part; - } else { - result.push(part); - } - return result; - }, []); - } - let warningCount = 0; - let errCount = 0; - function reportError(msg, ...vars) { - reporter.error(reporter.lang(msg, ...vars)); - errCount++; - } + function humaniseLocation(loc) { + const relative = path.relative( + path.join(config.cwd, "node_modules"), + loc + ); + const normalized = path.normalize(relative).split(path.sep); + return normalized + .filter((p) => p !== "node_modules") + .reduce((result, part) => { + const length = result.length; + if ( + length && + result[length - 1].startsWith("@") && + result[length - 1].indexOf(path.sep) === -1 + ) { + result[length - 1] += path.sep + part; + } else { + result.push(part); + } + return result; + }, []); + } - // get patterns that are installed when running `yarn install` + let warningCount = 0; + let errCount = 0; + function reportError(msg, ...vars) { + reporter.error(reporter.lang(msg, ...vars)); + errCount++; + } - var _ref6 = yield install.hydrate(); + // get patterns that are installed when running `yarn install` - const rawPatterns = _ref6.patterns, - workspaceLayout = _ref6.workspaceLayout; + var _ref6 = yield install.hydrate(); - const patterns = yield install.flatten(rawPatterns); + const rawPatterns = _ref6.patterns, + workspaceLayout = _ref6.workspaceLayout; - // check if patterns exist in lockfile - for ( - var _iterator2 = patterns, - _isArray2 = Array.isArray(_iterator2), - _i2 = 0, - _iterator2 = _isArray2 - ? _iterator2 - : _iterator2[Symbol.iterator](); - ; + const patterns = yield install.flatten(rawPatterns); - ) { - var _ref7; + // check if patterns exist in lockfile + for ( + var _iterator2 = patterns, + _isArray2 = Array.isArray(_iterator2), + _i2 = 0, + _iterator2 = _isArray2 + ? _iterator2 + : _iterator2[Symbol.iterator](); + ; - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref7 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref7 = _i2.value; - } + ) { + var _ref7; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref7 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref7 = _i2.value; + } - const pattern = _ref7; + const pattern = _ref7; - if ( - !lockfile.getLocked(pattern) && - (!workspaceLayout || - !workspaceLayout.getManifestByPattern(pattern)) - ) { - reportError("lockfileNotContainPattern", pattern); + if ( + !lockfile.getLocked(pattern) && + (!workspaceLayout || + !workspaceLayout.getManifestByPattern(pattern)) + ) { + reportError("lockfileNotContainPattern", pattern); + } } - } - const bundledDeps = {}; - // check if any of the node_modules are out of sync - const res = yield install.linker.getFlatHoistedTree( - patterns, - workspaceLayout - ); - for ( - var _iterator3 = res, - _isArray3 = Array.isArray(_iterator3), - _i3 = 0, - _iterator3 = _isArray3 - ? _iterator3 - : _iterator3[Symbol.iterator](); - ; + const bundledDeps = {}; + // check if any of the node_modules are out of sync + const res = yield install.linker.getFlatHoistedTree( + patterns, + workspaceLayout + ); + for ( + var _iterator3 = res, + _isArray3 = Array.isArray(_iterator3), + _i3 = 0, + _iterator3 = _isArray3 + ? _iterator3 + : _iterator3[Symbol.iterator](); + ; - ) { - var _ref9; + ) { + var _ref9; - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref9 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref9 = _i3.value; - } + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref9 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref9 = _i3.value; + } - const _ref8 = _ref9; - const loc = _ref8[0]; - var _ref8$ = _ref8[1]; - const originalKey = _ref8$.originalKey; - const pkg = _ref8$.pkg; - const ignore = _ref8$.ignore; + const _ref8 = _ref9; + const loc = _ref8[0]; + var _ref8$ = _ref8[1]; + const originalKey = _ref8$.originalKey; + const pkg = _ref8$.pkg; + const ignore = _ref8$.ignore; - if (ignore) { - continue; - } + if (ignore) { + continue; + } - const parts = humaniseLocation(loc); + const parts = humaniseLocation(loc); - // grey out hoisted portions of key - let human = originalKey; - const hoistedParts = parts.slice(); - const hoistedKey = parts.join("#"); - if (human !== hoistedKey) { - const humanParts = human.split("#"); + // grey out hoisted portions of key + let human = originalKey; + const hoistedParts = parts.slice(); + const hoistedKey = parts.join("#"); + if (human !== hoistedKey) { + const humanParts = human.split("#"); - for (let i = 0; i < humanParts.length; i++) { - const humanPart = humanParts[i]; + for (let i = 0; i < humanParts.length; i++) { + const humanPart = humanParts[i]; - if (hoistedParts[0] === humanPart) { - hoistedParts.shift(); + if (hoistedParts[0] === humanPart) { + hoistedParts.shift(); - if (i < humanParts.length - 1) { - humanParts[i] += "#"; + if (i < humanParts.length - 1) { + humanParts[i] += "#"; + } + } else { + humanParts[i] = reporter.format.dim(`${humanPart}#`); } - } else { - humanParts[i] = reporter.format.dim(`${humanPart}#`); } - } - human = humanParts.join(""); - } + human = humanParts.join(""); + } - // skip unnecessary checks for linked dependencies - const remoteType = pkg._reference.remote.type; - const isLinkedDependency = - remoteType === "link" || - remoteType === "workspace" || - (remoteType === "file" && config.linkFileDependencies); - const isResolution = pkg._reference.hint === "resolution"; - if (isLinkedDependency || isResolution) { - continue; - } + // skip unnecessary checks for linked dependencies + const remoteType = pkg._reference.remote.type; + const isLinkedDependency = + remoteType === "link" || + remoteType === "workspace" || + (remoteType === "file" && config.linkFileDependencies); + const isResolution = pkg._reference.hint === "resolution"; + if (isLinkedDependency || isResolution) { + continue; + } - if (!(yield (_fs || _load_fs()).exists(loc))) { - if (pkg._reference.optional) { - reporter.warn(reporter.lang("optionalDepNotInstalled", human)); - } else { - reportError("packageNotInstalled", human); + if (!(yield (_fs || _load_fs()).exists(loc))) { + if (pkg._reference.optional) { + reporter.warn( + reporter.lang("optionalDepNotInstalled", human) + ); + } else { + reportError("packageNotInstalled", human); + } + continue; } - continue; - } - const pkgLoc = path.join(loc, "package.json"); + const pkgLoc = path.join(loc, "package.json"); - if (yield (_fs || _load_fs()).exists(pkgLoc)) { - const packageJson = yield config.readJson(pkgLoc); - packageJson.version = semver.clean(packageJson.version); + if (yield (_fs || _load_fs()).exists(pkgLoc)) { + const packageJson = yield config.readJson(pkgLoc); + packageJson.version = semver.clean(packageJson.version); - if (pkg.version !== packageJson.version) { - // node_modules contains wrong version - reportError( - "packageWrongVersion", - human, - pkg.version, - packageJson.version - ); - } + if (pkg.version !== packageJson.version) { + // node_modules contains wrong version + reportError( + "packageWrongVersion", + human, + pkg.version, + packageJson.version + ); + } - const deps = Object.assign( - {}, - packageJson.dependencies, - packageJson.peerDependencies - ); - bundledDeps[packageJson.name] = - packageJson.bundledDependencies || []; + const deps = Object.assign( + {}, + packageJson.dependencies, + packageJson.peerDependencies + ); + bundledDeps[packageJson.name] = + packageJson.bundledDependencies || []; - for (const name in deps) { - const range = deps[name]; - if (!semver.validRange(range, config.looseSemver)) { - continue; // exotic - } + for (const name in deps) { + const range = deps[name]; + if (!semver.validRange(range, config.looseSemver)) { + continue; // exotic + } - const subHuman = `${human}#${name}@${range}`; + const subHuman = `${human}#${name}@${range}`; - // find the package that this will resolve to, factoring in hoisting - const possibles = []; - let depLoc; - for (let i = parts.length; i >= 0; i--) { - const myParts = parts.slice(0, i).concat(name); + // find the package that this will resolve to, factoring in hoisting + const possibles = []; + let depLoc; + for (let i = parts.length; i >= 0; i--) { + const myParts = parts.slice(0, i).concat(name); - // build package.json location for this position - const myDepPkgLoc = path.join( - config.cwd, - "node_modules", - myParts.join(`${path.sep}node_modules${path.sep}`) - ); + // build package.json location for this position + const myDepPkgLoc = path.join( + config.cwd, + "node_modules", + myParts.join(`${path.sep}node_modules${path.sep}`) + ); - possibles.push(myDepPkgLoc); - } - while (possibles.length) { - const myDepPkgLoc = possibles.shift(); - if (yield (_fs || _load_fs()).exists(myDepPkgLoc)) { - depLoc = myDepPkgLoc; - break; + possibles.push(myDepPkgLoc); + } + while (possibles.length) { + const myDepPkgLoc = possibles.shift(); + if (yield (_fs || _load_fs()).exists(myDepPkgLoc)) { + depLoc = myDepPkgLoc; + break; + } + } + if (!depLoc) { + // we'll hit the module not install error above when this module is hit + continue; } - } - if (!depLoc) { - // we'll hit the module not install error above when this module is hit - continue; - } - const depPkgLoc = path.join(depLoc, "package.json"); + const depPkgLoc = path.join(depLoc, "package.json"); - if (yield (_fs || _load_fs()).exists(depPkgLoc)) { - const depPkg = yield config.readJson(depPkgLoc); - const foundHuman = `${humaniseLocation( - path.dirname(depPkgLoc) - ).join("#")}@${depPkg.version}`; - if ( - !semver.satisfies(depPkg.version, range, config.looseSemver) - ) { - // module isn't correct semver - const resPattern = install.resolutionMap.find( - name, - originalKey.split("#") - ); - if (resPattern) { - const resHuman = `${human}#${resPattern}`; + if (yield (_fs || _load_fs()).exists(depPkgLoc)) { + const depPkg = yield config.readJson(depPkgLoc); + const foundHuman = `${humaniseLocation( + path.dirname(depPkgLoc) + ).join("#")}@${depPkg.version}`; + if ( + !semver.satisfies( + depPkg.version, + range, + config.looseSemver + ) + ) { + // module isn't correct semver + const resPattern = install.resolutionMap.find( + name, + originalKey.split("#") + ); + if (resPattern) { + const resHuman = `${human}#${resPattern}`; - var _normalizePattern = (0, - (_normalizePattern2 || _load_normalizePattern()) - .normalizePattern)(resPattern); + var _normalizePattern = (0, + (_normalizePattern2 || _load_normalizePattern()) + .normalizePattern)(resPattern); - const resRange = _normalizePattern.range; + const resRange = _normalizePattern.range; - if ( - semver.satisfies( - depPkg.version, - resRange, - config.looseSemver - ) - ) { - reporter.warn( - reporter.lang( - "incompatibleResolutionVersion", - foundHuman, - subHuman + if ( + semver.satisfies( + depPkg.version, + resRange, + config.looseSemver ) - ); - warningCount++; + ) { + reporter.warn( + reporter.lang( + "incompatibleResolutionVersion", + foundHuman, + subHuman + ) + ); + warningCount++; + } else { + reportError( + "packageDontSatisfy", + resHuman, + foundHuman + ); + } } else { - reportError("packageDontSatisfy", resHuman, foundHuman); + reportError("packageDontSatisfy", subHuman, foundHuman); } - } else { - reportError("packageDontSatisfy", subHuman, foundHuman); - } - continue; - } + continue; + } - // check for modules above us that this could be deduped to - for ( - var _iterator4 = possibles, - _isArray4 = Array.isArray(_iterator4), - _i4 = 0, - _iterator4 = _isArray4 - ? _iterator4 - : _iterator4[Symbol.iterator](); - ; + // check for modules above us that this could be deduped to + for ( + var _iterator4 = possibles, + _isArray4 = Array.isArray(_iterator4), + _i4 = 0, + _iterator4 = _isArray4 + ? _iterator4 + : _iterator4[Symbol.iterator](); + ; - ) { - var _ref10; + ) { + var _ref10; - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref10 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref10 = _i4.value; - } + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref10 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref10 = _i4.value; + } - const loc = _ref10; + const loc = _ref10; - const locPkg = path.join(loc, "package.json"); + const locPkg = path.join(loc, "package.json"); - if (!(yield (_fs || _load_fs()).exists(locPkg))) { - continue; - } + if (!(yield (_fs || _load_fs()).exists(locPkg))) { + continue; + } - const packageJson = yield config.readJson(locPkg); - const packagePath = originalKey.split("#"); - const rootDep = packagePath[0]; - const packageName = packagePath[1] || packageJson.name; + const packageJson = yield config.readJson(locPkg); + const packagePath = originalKey.split("#"); + const rootDep = packagePath[0]; + const packageName = packagePath[1] || packageJson.name; - const bundledDep = - bundledDeps[rootDep] && - bundledDeps[rootDep].indexOf(packageName) !== -1; - if ( - !bundledDep && - (packageJson.version === depPkg.version || - (semver.satisfies( - packageJson.version, - range, - config.looseSemver - ) && - semver.gt( + const bundledDep = + bundledDeps[rootDep] && + bundledDeps[rootDep].indexOf(packageName) !== -1; + if ( + !bundledDep && + (packageJson.version === depPkg.version || + (semver.satisfies( packageJson.version, - depPkg.version, + range, config.looseSemver - ))) - ) { - reporter.warn( - reporter.lang( - "couldBeDeduped", - subHuman, - packageJson.version, - `${humaniseLocation(path.dirname(locPkg)).join( - "#" - )}@${packageJson.version}` - ) - ); - warningCount++; + ) && + semver.gt( + packageJson.version, + depPkg.version, + config.looseSemver + ))) + ) { + reporter.warn( + reporter.lang( + "couldBeDeduped", + subHuman, + packageJson.version, + `${humaniseLocation(path.dirname(locPkg)).join( + "#" + )}@${packageJson.version}` + ) + ); + warningCount++; + } + break; } - break; } } } } - } - if (warningCount > 1) { - reporter.info(reporter.lang("foundWarnings", warningCount)); - } + if (warningCount > 1) { + reporter.info(reporter.lang("foundWarnings", warningCount)); + } - if (errCount > 0) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("foundErrors", errCount) - ); - } else { - reporter.success(reporter.lang("folderInSync")); + if (errCount > 0) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("foundErrors", errCount) + ); + } else { + reporter.success(reporter.lang("folderInSync")); + } } - }); + ); return function run(_x9, _x10, _x11, _x12) { return _ref5.apply(this, arguments); @@ -89765,25 +89678,24 @@ wercker.yml let getRegistryFolder = (exports.getRegistryFolder = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - name - ) { - if (config.modulesFolder) { - return config.modulesFolder; - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, name) { + if (config.modulesFolder) { + return config.modulesFolder; + } - const src = path.join(config.linkFolder, name); + const src = path.join(config.linkFolder, name); - var _ref2 = yield config.readManifest(src); + var _ref2 = yield config.readManifest(src); - const _registry = _ref2._registry; + const _registry = _ref2._registry; - invariant(_registry, "expected registry"); + invariant(_registry, "expected registry"); - const registryFolder = config.registries[_registry].folder; - return path.join(config.cwd, registryFolder); - }); + const registryFolder = config.registries[_registry].folder; + return path.join(config.cwd, registryFolder); + } + ); return function getRegistryFolder(_x, _x2) { return _ref.apply(this, arguments); @@ -89792,95 +89704,97 @@ wercker.yml let run = (exports.run = (() => { var _ref3 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - if (args.length) { - for ( - var _iterator = args, - _isArray = Array.isArray(_iterator), - _i = 0, - _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); - ; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + if (args.length) { + for ( + var _iterator = args, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray + ? _iterator + : _iterator[Symbol.iterator](); + ; - ) { - var _ref4; + ) { + var _ref4; - if (_isArray) { - if (_i >= _iterator.length) break; - _ref4 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref4 = _i.value; - } + if (_isArray) { + if (_i >= _iterator.length) break; + _ref4 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref4 = _i.value; + } - const name = _ref4; + const name = _ref4; - const src = path.join(config.linkFolder, name); + const src = path.join(config.linkFolder, name); - if (yield (_fs || _load_fs()).exists(src)) { - const folder = yield getRegistryFolder(config, name); - const dest = path.join(folder, name); + if (yield (_fs || _load_fs()).exists(src)) { + const folder = yield getRegistryFolder(config, name); + const dest = path.join(folder, name); - yield (_fs || _load_fs()).unlink(dest); - yield (_fs || _load_fs()).mkdirp(path.dirname(dest)); - yield (_fs || _load_fs()).symlink(src, dest); - reporter.success(reporter.lang("linkUsing", name)); - } else { + yield (_fs || _load_fs()).unlink(dest); + yield (_fs || _load_fs()).mkdirp(path.dirname(dest)); + yield (_fs || _load_fs()).symlink(src, dest); + reporter.success(reporter.lang("linkUsing", name)); + } else { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("linkMissing", name) + ); + } + } + } else { + // add cwd module to the global registry + const manifest = yield config.readRootManifest(); + const name = manifest.name; + if (!name) { throw new (_errors || _load_errors()).MessageError( - reporter.lang("linkMissing", name) + reporter.lang("unknownPackageName") ); } - } - } else { - // add cwd module to the global registry - const manifest = yield config.readRootManifest(); - const name = manifest.name; - if (!name) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("unknownPackageName") - ); - } - const linkLoc = path.join(config.linkFolder, name); - if (yield (_fs || _load_fs()).exists(linkLoc)) { - reporter.warn(reporter.lang("linkCollision", name)); - } else { - yield (_fs || _load_fs()).mkdirp(path.dirname(linkLoc)); - yield (_fs || _load_fs()).symlink(config.cwd, linkLoc); - - // If there is a `bin` defined in the package.json, - // link each bin to the global bin - if (manifest.bin) { - const globalBinFolder = yield (0, - (_global || _load_global()).getBinFolder)(config, flags); - for (const binName in manifest.bin) { - const binSrc = manifest.bin[binName]; - const binSrcLoc = path.join(linkLoc, binSrc); - const binDestLoc = path.join(globalBinFolder, binName); - if (yield (_fs || _load_fs()).exists(binDestLoc)) { - reporter.warn(reporter.lang("binLinkCollision", binName)); - } else { - if (process.platform === "win32") { - yield cmdShim(binSrcLoc, binDestLoc, { - createPwshFile: false, - }); + const linkLoc = path.join(config.linkFolder, name); + if (yield (_fs || _load_fs()).exists(linkLoc)) { + reporter.warn(reporter.lang("linkCollision", name)); + } else { + yield (_fs || _load_fs()).mkdirp(path.dirname(linkLoc)); + yield (_fs || _load_fs()).symlink(config.cwd, linkLoc); + + // If there is a `bin` defined in the package.json, + // link each bin to the global bin + if (manifest.bin) { + const globalBinFolder = yield (0, + (_global || _load_global()).getBinFolder)(config, flags); + for (const binName in manifest.bin) { + const binSrc = manifest.bin[binName]; + const binSrcLoc = path.join(linkLoc, binSrc); + const binDestLoc = path.join(globalBinFolder, binName); + if (yield (_fs || _load_fs()).exists(binDestLoc)) { + reporter.warn(reporter.lang("binLinkCollision", binName)); } else { - yield (_fs || _load_fs()).symlink(binSrcLoc, binDestLoc); + if (process.platform === "win32") { + yield cmdShim(binSrcLoc, binDestLoc, { + createPwshFile: false, + }); + } else { + yield (_fs || _load_fs()).symlink( + binSrcLoc, + binDestLoc + ); + } } } } - } - reporter.success(reporter.lang("linkRegistered", name)); - reporter.info(reporter.lang("linkRegisteredMessage", name)); + reporter.success(reporter.lang("linkRegistered", name)); + reporter.info(reporter.lang("linkRegisteredMessage", name)); + } } } - }); + ); return function run(_x3, _x4, _x5, _x6) { return _ref3.apply(this, arguments); @@ -89962,238 +89876,240 @@ wercker.yml let buildTree = (exports.buildTree = (() => { var _ref2 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - resolver, - linker, - patterns, - opts, - onlyFresh, - ignoreHoisted - ) { - const treesByKey = {}; - const trees = []; - const flatTree = yield linker.getFlatHoistedTree(patterns); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* ( + resolver, + linker, + patterns, + opts, + onlyFresh, + ignoreHoisted + ) { + const treesByKey = {}; + const trees = []; + const flatTree = yield linker.getFlatHoistedTree(patterns); - // If using workspaces, filter out the virtual manifest - const workspaceLayout = resolver.workspaceLayout; + // If using workspaces, filter out the virtual manifest + const workspaceLayout = resolver.workspaceLayout; - const hoisted = - workspaceLayout && workspaceLayout.virtualManifestName - ? flatTree.filter(function ([key]) { - return ( - key.indexOf(workspaceLayout.virtualManifestName) === -1 - ); - }) - : flatTree; - - const hoistedByKey = {}; - for ( - var _iterator2 = hoisted, - _isArray2 = Array.isArray(_iterator2), - _i2 = 0, - _iterator2 = _isArray2 - ? _iterator2 - : _iterator2[Symbol.iterator](); - ; + const hoisted = + workspaceLayout && workspaceLayout.virtualManifestName + ? flatTree.filter(function ([key]) { + return ( + key.indexOf(workspaceLayout.virtualManifestName) === -1 + ); + }) + : flatTree; - ) { - var _ref4; + const hoistedByKey = {}; + for ( + var _iterator2 = hoisted, + _isArray2 = Array.isArray(_iterator2), + _i2 = 0, + _iterator2 = _isArray2 + ? _iterator2 + : _iterator2[Symbol.iterator](); + ; - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref4 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref4 = _i2.value; - } + ) { + var _ref4; - const _ref3 = _ref4; - const key = _ref3[0]; - const info = _ref3[1]; + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref4 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref4 = _i2.value; + } - hoistedByKey[key] = info; - } + const _ref3 = _ref4; + const key = _ref3[0]; + const info = _ref3[1]; - // build initial trees - for ( - var _iterator3 = hoisted, - _isArray3 = Array.isArray(_iterator3), - _i3 = 0, - _iterator3 = _isArray3 - ? _iterator3 - : _iterator3[Symbol.iterator](); - ; + hoistedByKey[key] = info; + } - ) { - var _ref6; + // build initial trees + for ( + var _iterator3 = hoisted, + _isArray3 = Array.isArray(_iterator3), + _i3 = 0, + _iterator3 = _isArray3 + ? _iterator3 + : _iterator3[Symbol.iterator](); + ; - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref6 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref6 = _i3.value; - } + ) { + var _ref6; - const _ref5 = _ref6; - const info = _ref5[1]; + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref6 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref6 = _i3.value; + } - const ref = info.pkg._reference; - const hint = null; - const parent = getParent(info.key, treesByKey); - const children = []; - let depth = 0; - let color = "bold"; - invariant(ref, "expected reference"); + const _ref5 = _ref6; + const info = _ref5[1]; + + const ref = info.pkg._reference; + const hint = null; + const parent = getParent(info.key, treesByKey); + const children = []; + let depth = 0; + let color = "bold"; + invariant(ref, "expected reference"); - if (onlyFresh) { - let isFresh = false; - for ( - var _iterator5 = ref.patterns, - _isArray5 = Array.isArray(_iterator5), - _i5 = 0, - _iterator5 = _isArray5 - ? _iterator5 - : _iterator5[Symbol.iterator](); - ; + if (onlyFresh) { + let isFresh = false; + for ( + var _iterator5 = ref.patterns, + _isArray5 = Array.isArray(_iterator5), + _i5 = 0, + _iterator5 = _isArray5 + ? _iterator5 + : _iterator5[Symbol.iterator](); + ; - ) { - var _ref9; + ) { + var _ref9; - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref9 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref9 = _i5.value; - } + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref9 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref9 = _i5.value; + } - const pattern = _ref9; + const pattern = _ref9; - if (resolver.isNewPattern(pattern)) { - isFresh = true; - break; + if (resolver.isNewPattern(pattern)) { + isFresh = true; + break; + } + } + if (!isFresh) { + continue; } } - if (!isFresh) { - continue; - } - } - if (info.originalKey !== info.key || opts.reqDepth === 0) { - // was hoisted - color = null; - } - // check parent to obtain next depth - if (parent && parent.depth > 0) { - depth = parent.depth + 1; - } else { - depth = 0; - } + if (info.originalKey !== info.key || opts.reqDepth === 0) { + // was hoisted + color = null; + } + // check parent to obtain next depth + if (parent && parent.depth > 0) { + depth = parent.depth + 1; + } else { + depth = 0; + } - const topLevel = opts.reqDepth === 0 && !parent; - const showAll = opts.reqDepth === -1; - const nextDepthIsValid = depth + 1 <= Number(opts.reqDepth); + const topLevel = opts.reqDepth === 0 && !parent; + const showAll = opts.reqDepth === -1; + const nextDepthIsValid = depth + 1 <= Number(opts.reqDepth); - if (topLevel || nextDepthIsValid || showAll) { - treesByKey[info.key] = { - name: `${info.pkg.name}@${info.pkg.version}`, - children, - hint, - color, - depth, - }; - } + if (topLevel || nextDepthIsValid || showAll) { + treesByKey[info.key] = { + name: `${info.pkg.name}@${info.pkg.version}`, + children, + hint, + color, + depth, + }; + } - // add in dummy children for hoisted dependencies - const nextChildDepthIsValid = depth + 1 < Number(opts.reqDepth); - invariant(ref, "expected reference"); - if ((!ignoreHoisted && nextDepthIsValid) || showAll) { - for ( - var _iterator6 = resolver.dedupePatterns(ref.dependencies), - _isArray6 = Array.isArray(_iterator6), - _i6 = 0, - _iterator6 = _isArray6 - ? _iterator6 - : _iterator6[Symbol.iterator](); - ; + // add in dummy children for hoisted dependencies + const nextChildDepthIsValid = depth + 1 < Number(opts.reqDepth); + invariant(ref, "expected reference"); + if ((!ignoreHoisted && nextDepthIsValid) || showAll) { + for ( + var _iterator6 = resolver.dedupePatterns(ref.dependencies), + _isArray6 = Array.isArray(_iterator6), + _i6 = 0, + _iterator6 = _isArray6 + ? _iterator6 + : _iterator6[Symbol.iterator](); + ; - ) { - var _ref10; + ) { + var _ref10; - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref10 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref10 = _i6.value; - } + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref10 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref10 = _i6.value; + } - const pattern = _ref10; + const pattern = _ref10; - const pkg = resolver.getStrictResolvedPattern(pattern); + const pkg = resolver.getStrictResolvedPattern(pattern); - if ( - !hoistedByKey[`${info.key}#${pkg.name}`] && - (nextChildDepthIsValid || showAll) - ) { - children.push({ - name: pattern, - color: "dim", - shadow: true, - }); + if ( + !hoistedByKey[`${info.key}#${pkg.name}`] && + (nextChildDepthIsValid || showAll) + ) { + children.push({ + name: pattern, + color: "dim", + shadow: true, + }); + } } } } - } - // add children - for ( - var _iterator4 = hoisted, - _isArray4 = Array.isArray(_iterator4), - _i4 = 0, - _iterator4 = _isArray4 - ? _iterator4 - : _iterator4[Symbol.iterator](); - ; + // add children + for ( + var _iterator4 = hoisted, + _isArray4 = Array.isArray(_iterator4), + _i4 = 0, + _iterator4 = _isArray4 + ? _iterator4 + : _iterator4[Symbol.iterator](); + ; - ) { - var _ref8; + ) { + var _ref8; - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref8 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref8 = _i4.value; - } + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref8 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref8 = _i4.value; + } - const _ref7 = _ref8; - const info = _ref7[1]; + const _ref7 = _ref8; + const info = _ref7[1]; - const tree = treesByKey[info.key]; - const parent = getParent(info.key, treesByKey); - if (!tree) { - continue; - } + const tree = treesByKey[info.key]; + const parent = getParent(info.key, treesByKey); + if (!tree) { + continue; + } - if (info.key.split("#").length === 1) { - trees.push(tree); - continue; - } + if (info.key.split("#").length === 1) { + trees.push(tree); + continue; + } - if (parent) { - parent.children.push(tree); + if (parent) { + parent.children.push(tree); + } } - } - return { trees, count: buildCount(trees) }; - }); + return { trees, count: buildCount(trees) }; + } + ); return function buildTree(_x, _x2, _x3, _x4, _x5, _x6) { return _ref2.apply(this, arguments); @@ -90202,69 +90118,66 @@ wercker.yml let run = (exports.run = (() => { var _ref11 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const lockfile = yield ( - _lockfile || _load_lockfile() - ).default.fromDirectory(config.lockfileFolder, reporter); - const install = new (_install || _load_install()).Install( - flags, - config, - reporter, - lockfile - ); - - var _ref12 = yield install.fetchRequestFromCwd(); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const lockfile = yield ( + _lockfile || _load_lockfile() + ).default.fromDirectory(config.lockfileFolder, reporter); + const install = new (_install || _load_install()).Install( + flags, + config, + reporter, + lockfile + ); - const depRequests = _ref12.requests, - patterns = _ref12.patterns, - manifest = _ref12.manifest, - workspaceLayout = _ref12.workspaceLayout; + var _ref12 = yield install.fetchRequestFromCwd(); - yield install.resolver.init(depRequests, { - isFlat: install.flags.flat, - isFrozen: install.flags.frozenLockfile, - workspaceLayout, - }); + const depRequests = _ref12.requests, + patterns = _ref12.patterns, + manifest = _ref12.manifest, + workspaceLayout = _ref12.workspaceLayout; - let activePatterns = []; - if (config.production) { - const devDeps = getDevDeps(manifest); - activePatterns = patterns.filter(function (pattern) { - return !devDeps.has(pattern); + yield install.resolver.init(depRequests, { + isFlat: install.flags.flat, + isFrozen: install.flags.frozenLockfile, + workspaceLayout, }); - } else { - activePatterns = patterns; - } - const opts = { - reqDepth: getReqDepth(flags.depth), - }; + let activePatterns = []; + if (config.production) { + const devDeps = getDevDeps(manifest); + activePatterns = patterns.filter(function (pattern) { + return !devDeps.has(pattern); + }); + } else { + activePatterns = patterns; + } - var _ref13 = yield buildTree( - install.resolver, - install.linker, - activePatterns, - opts - ); + const opts = { + reqDepth: getReqDepth(flags.depth), + }; - let trees = _ref13.trees; + var _ref13 = yield buildTree( + install.resolver, + install.linker, + activePatterns, + opts + ); - if (args.length) { - reporter.warn(reporter.lang("deprecatedListArgs")); - } - if (args.length || flags.pattern) { - trees = trees.filter(function (tree) { - return filterTree(tree, args, flags.pattern); - }); - } + let trees = _ref13.trees; - reporter.tree("list", trees, { force: true }); - }); + if (args.length) { + reporter.warn(reporter.lang("deprecatedListArgs")); + } + if (args.length || flags.pattern) { + trees = trees.filter(function (tree) { + return filterTree(tree, args, flags.pattern); + }); + } + + reporter.tree("list", trees, { force: true }); + } + ); return function run(_x7, _x8, _x9, _x10) { return _ref11.apply(this, arguments); @@ -90420,208 +90333,205 @@ wercker.yml let run = (exports.run = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const isWorkspaceRoot = - config.workspaceRootFolder && - config.cwd === config.workspaceRootFolder; - - if (!args.length) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("tooFewArguments", 1) - ); - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const isWorkspaceRoot = + config.workspaceRootFolder && + config.cwd === config.workspaceRootFolder; - // running "yarn remove something" in a workspace root is often a mistake - if (isWorkspaceRoot && !flags.ignoreWorkspaceRootCheck) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("workspacesRemoveRootCheck") - ); - } - - const totalSteps = args.length + 1; - let step = 0; - - // load manifests - const lockfile = yield ( - _lockfile || _load_lockfile() - ).default.fromDirectory(config.lockfileFolder); - const rootManifests = yield config.getRootManifests(); - const manifests = []; - - for ( - var _iterator = args, - _isArray = Array.isArray(_iterator), - _i = 0, - _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); - ; - - ) { - var _ref2; + if (!args.length) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("tooFewArguments", 1) + ); + } - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; + // running "yarn remove something" in a workspace root is often a mistake + if (isWorkspaceRoot && !flags.ignoreWorkspaceRootCheck) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("workspacesRemoveRootCheck") + ); } - const name = _ref2; + const totalSteps = args.length + 1; + let step = 0; - reporter.step( - ++step, - totalSteps, - `Removing module ${name}`, - emoji.get("wastebasket") - ); - - let found = false; + // load manifests + const lockfile = yield ( + _lockfile || _load_lockfile() + ).default.fromDirectory(config.lockfileFolder); + const rootManifests = yield config.getRootManifests(); + const manifests = []; for ( - var _iterator2 = Object.keys( - (_index || _load_index()).registries - ), - _isArray2 = Array.isArray(_iterator2), - _i3 = 0, - _iterator2 = _isArray2 - ? _iterator2 - : _iterator2[Symbol.iterator](); + var _iterator = args, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) { - var _ref3; + var _ref2; - if (_isArray2) { - if (_i3 >= _iterator2.length) break; - _ref3 = _iterator2[_i3++]; + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; } else { - _i3 = _iterator2.next(); - if (_i3.done) break; - _ref3 = _i3.value; + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; } - const registryName = _ref3; + const name = _ref2; - const registry = config.registries[registryName]; - const object = rootManifests[registryName].object; + reporter.step( + ++step, + totalSteps, + `Removing module ${name}`, + emoji.get("wastebasket") + ); + + let found = false; for ( - var _iterator3 = (_constants || _load_constants()) - .DEPENDENCY_TYPES, - _isArray3 = Array.isArray(_iterator3), - _i4 = 0, - _iterator3 = _isArray3 - ? _iterator3 - : _iterator3[Symbol.iterator](); + var _iterator2 = Object.keys( + (_index || _load_index()).registries + ), + _isArray2 = Array.isArray(_iterator2), + _i3 = 0, + _iterator2 = _isArray2 + ? _iterator2 + : _iterator2[Symbol.iterator](); ; ) { - var _ref4; + var _ref3; - if (_isArray3) { - if (_i4 >= _iterator3.length) break; - _ref4 = _iterator3[_i4++]; + if (_isArray2) { + if (_i3 >= _iterator2.length) break; + _ref3 = _iterator2[_i3++]; } else { - _i4 = _iterator3.next(); - if (_i4.done) break; - _ref4 = _i4.value; + _i3 = _iterator2.next(); + if (_i3.done) break; + _ref3 = _i3.value; } - const type = _ref4; + const registryName = _ref3; - const deps = object[type]; - if (deps && deps[name]) { - found = true; - delete deps[name]; + const registry = config.registries[registryName]; + const object = rootManifests[registryName].object; + + for ( + var _iterator3 = (_constants || _load_constants()) + .DEPENDENCY_TYPES, + _isArray3 = Array.isArray(_iterator3), + _i4 = 0, + _iterator3 = _isArray3 + ? _iterator3 + : _iterator3[Symbol.iterator](); + ; + + ) { + var _ref4; + + if (_isArray3) { + if (_i4 >= _iterator3.length) break; + _ref4 = _iterator3[_i4++]; + } else { + _i4 = _iterator3.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + const type = _ref4; + + const deps = object[type]; + if (deps && deps[name]) { + found = true; + delete deps[name]; + } } - } - const possibleManifestLoc = path.join( - config.cwd, - registry.folder, - name - ); - if (yield (_fs || _load_fs()).exists(possibleManifestLoc)) { - const manifest = yield config.maybeReadManifest( - possibleManifestLoc, - registryName + const possibleManifestLoc = path.join( + config.cwd, + registry.folder, + name ); - if (manifest) { - manifests.push([possibleManifestLoc, manifest]); + if (yield (_fs || _load_fs()).exists(possibleManifestLoc)) { + const manifest = yield config.maybeReadManifest( + possibleManifestLoc, + registryName + ); + if (manifest) { + manifests.push([possibleManifestLoc, manifest]); + } } } - } - if (!found) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("moduleNotInManifest") - ); + if (!found) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("moduleNotInManifest") + ); + } } - } - // save manifests - yield config.saveRootManifests(rootManifests); + // save manifests + yield config.saveRootManifests(rootManifests); - // run hooks - npm runs these one after another - var _arr = ["preuninstall", "uninstall", "postuninstall"]; - for (var _i2 = 0; _i2 < _arr.length; _i2++) { - const action = _arr[_i2]; - for ( - var _iterator4 = manifests, - _isArray4 = Array.isArray(_iterator4), - _i5 = 0, - _iterator4 = _isArray4 - ? _iterator4 - : _iterator4[Symbol.iterator](); - ; + // run hooks - npm runs these one after another + var _arr = ["preuninstall", "uninstall", "postuninstall"]; + for (var _i2 = 0; _i2 < _arr.length; _i2++) { + const action = _arr[_i2]; + for ( + var _iterator4 = manifests, + _isArray4 = Array.isArray(_iterator4), + _i5 = 0, + _iterator4 = _isArray4 + ? _iterator4 + : _iterator4[Symbol.iterator](); + ; - ) { - var _ref6; + ) { + var _ref6; - if (_isArray4) { - if (_i5 >= _iterator4.length) break; - _ref6 = _iterator4[_i5++]; - } else { - _i5 = _iterator4.next(); - if (_i5.done) break; - _ref6 = _i5.value; - } + if (_isArray4) { + if (_i5 >= _iterator4.length) break; + _ref6 = _iterator4[_i5++]; + } else { + _i5 = _iterator4.next(); + if (_i5.done) break; + _ref6 = _i5.value; + } - const _ref5 = _ref6; - const loc = _ref5[0]; + const _ref5 = _ref6; + const loc = _ref5[0]; - yield config.executeLifecycleScript(action, loc); + yield config.executeLifecycleScript(action, loc); + } } - } - // reinstall so we can get the updated lockfile - reporter.step( - ++step, - totalSteps, - reporter.lang("uninstallRegenerate"), - emoji.get("hammer") - ); - const installFlags = (0, (_extends2 || _load_extends()).default)( - { force: true, workspaceRootIsCwd: true }, - flags - ); - const reinstall = new (_install || _load_install()).Install( - installFlags, - config, - new (_index2 || _load_index2()).NoopReporter(), - lockfile - ); - yield reinstall.init(); + // reinstall so we can get the updated lockfile + reporter.step( + ++step, + totalSteps, + reporter.lang("uninstallRegenerate"), + emoji.get("hammer") + ); + const installFlags = (0, (_extends2 || _load_extends()).default)( + { force: true, workspaceRootIsCwd: true }, + flags + ); + const reinstall = new (_install || _load_install()).Install( + installFlags, + config, + new (_index2 || _load_index2()).NoopReporter(), + lockfile + ); + yield reinstall.init(); - // - reporter.success(reporter.lang("uninstalledPackages")); - }); + // + reporter.success(reporter.lang("uninstalledPackages")); + } + ); return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -90735,151 +90645,156 @@ wercker.yml let getBinEntries = (exports.getBinEntries = (() => { var _ref3 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config - ) { - const binFolders = new Set(); - const binEntries = new Map(); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config) { + const binFolders = new Set(); + const binEntries = new Map(); - // Setup the node_modules/.bin folders for analysis - for ( - var _iterator2 = config.registryFolders, - _isArray2 = Array.isArray(_iterator2), - _i2 = 0, - _iterator2 = _isArray2 - ? _iterator2 - : _iterator2[Symbol.iterator](); - ; + // Setup the node_modules/.bin folders for analysis + for ( + var _iterator2 = config.registryFolders, + _isArray2 = Array.isArray(_iterator2), + _i2 = 0, + _iterator2 = _isArray2 + ? _iterator2 + : _iterator2[Symbol.iterator](); + ; - ) { - var _ref4; + ) { + var _ref4; - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref4 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref4 = _i2.value; - } + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref4 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref4 = _i2.value; + } - const registryFolder = _ref4; + const registryFolder = _ref4; - binFolders.add( - path.resolve(config.lockfileFolder, registryFolder, ".bin") - ); - } + binFolders.add( + path.resolve(config.lockfileFolder, registryFolder, ".bin") + ); + } - // Same thing, but for the pnp dependencies, located inside the cache - if ( - yield (_fs || _load_fs()).exists( - `${config.lockfileFolder}/${ - (_constants || _load_constants()).PNP_FILENAME - }` - ) - ) { - const pnpApi = (0, - (_dynamicRequire || _load_dynamicRequire()).dynamicRequire)( - `${config.lockfileFolder}/${ - (_constants || _load_constants()).PNP_FILENAME - }` - ); + // Same thing, but for the pnp dependencies, located inside the cache + if ( + yield (_fs || _load_fs()).exists( + `${config.lockfileFolder}/${ + (_constants || _load_constants()).PNP_FILENAME + }` + ) + ) { + const pnpApi = (0, + (_dynamicRequire || _load_dynamicRequire()).dynamicRequire)( + `${config.lockfileFolder}/${ + (_constants || _load_constants()).PNP_FILENAME + }` + ); - const packageLocator = pnpApi.findPackageLocator(`${config.cwd}/`); - const packageInformation = - pnpApi.getPackageInformation(packageLocator); + const packageLocator = pnpApi.findPackageLocator( + `${config.cwd}/` + ); + const packageInformation = + pnpApi.getPackageInformation(packageLocator); - for ( - var _iterator3 = packageInformation.packageDependencies.entries(), - _isArray3 = Array.isArray(_iterator3), - _i3 = 0, - _iterator3 = _isArray3 - ? _iterator3 - : _iterator3[Symbol.iterator](); - ; + for ( + var _iterator3 = + packageInformation.packageDependencies.entries(), + _isArray3 = Array.isArray(_iterator3), + _i3 = 0, + _iterator3 = _isArray3 + ? _iterator3 + : _iterator3[Symbol.iterator](); + ; - ) { - var _ref6; + ) { + var _ref6; - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref6 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref6 = _i3.value; - } + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref6 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref6 = _i3.value; + } - const _ref5 = _ref6; - const name = _ref5[0]; - const reference = _ref5[1]; + const _ref5 = _ref6; + const name = _ref5[0]; + const reference = _ref5[1]; - const dependencyInformation = pnpApi.getPackageInformation({ - name, - reference, - }); + const dependencyInformation = pnpApi.getPackageInformation({ + name, + reference, + }); - if (dependencyInformation.packageLocation) { - binFolders.add(`${dependencyInformation.packageLocation}/.bin`); + if (dependencyInformation.packageLocation) { + binFolders.add( + `${dependencyInformation.packageLocation}/.bin` + ); + } } } - } - // Build up a list of possible scripts by exploring the folders marked for analysis - for ( - var _iterator4 = binFolders, - _isArray4 = Array.isArray(_iterator4), - _i4 = 0, - _iterator4 = _isArray4 - ? _iterator4 - : _iterator4[Symbol.iterator](); - ; + // Build up a list of possible scripts by exploring the folders marked for analysis + for ( + var _iterator4 = binFolders, + _isArray4 = Array.isArray(_iterator4), + _i4 = 0, + _iterator4 = _isArray4 + ? _iterator4 + : _iterator4[Symbol.iterator](); + ; - ) { - var _ref7; + ) { + var _ref7; - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref7 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref7 = _i4.value; - } + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref7 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref7 = _i4.value; + } - const binFolder = _ref7; + const binFolder = _ref7; - if (yield (_fs || _load_fs()).exists(binFolder)) { - for ( - var _iterator5 = yield (_fs || _load_fs()).readdir(binFolder), - _isArray5 = Array.isArray(_iterator5), - _i5 = 0, - _iterator5 = _isArray5 - ? _iterator5 - : _iterator5[Symbol.iterator](); - ; + if (yield (_fs || _load_fs()).exists(binFolder)) { + for ( + var _iterator5 = yield (_fs || _load_fs()).readdir(binFolder), + _isArray5 = Array.isArray(_iterator5), + _i5 = 0, + _iterator5 = _isArray5 + ? _iterator5 + : _iterator5[Symbol.iterator](); + ; - ) { - var _ref8; + ) { + var _ref8; - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref8 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref8 = _i5.value; - } + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref8 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref8 = _i5.value; + } - const name = _ref8; + const name = _ref8; - binEntries.set(name, path.join(binFolder, name)); + binEntries.set(name, path.join(binFolder, name)); + } } } - } - return binEntries; - }); + return binEntries; + } + ); return function getBinEntries(_x) { return _ref3.apply(this, arguments); @@ -90888,281 +90803,284 @@ wercker.yml let run = (exports.run = (() => { var _ref9 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - let realRunCommand = (() => { - var _ref13 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)( - function* (action, args) { - // build up list of commands - const cmds = []; - - if (pkgScripts && action in pkgScripts) { - const preAction = `pre${action}`; - if (preAction in pkgScripts) { - cmds.push([preAction, pkgScripts[preAction]]); - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + let realRunCommand = (() => { + var _ref13 = (0, + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (action, args) { + // build up list of commands + const cmds = []; + + if (pkgScripts && action in pkgScripts) { + const preAction = `pre${action}`; + if (preAction in pkgScripts) { + cmds.push([preAction, pkgScripts[preAction]]); + } - const script = scripts.get(action); - invariant(script, "Script must exist"); - cmds.push([action, script]); + const script = scripts.get(action); + invariant(script, "Script must exist"); + cmds.push([action, script]); - const postAction = `post${action}`; - if (postAction in pkgScripts) { - cmds.push([postAction, pkgScripts[postAction]]); + const postAction = `post${action}`; + if (postAction in pkgScripts) { + cmds.push([postAction, pkgScripts[postAction]]); + } + } else if (scripts.has(action)) { + const script = scripts.get(action); + invariant(script, "Script must exist"); + cmds.push([action, script]); } - } else if (scripts.has(action)) { - const script = scripts.get(action); - invariant(script, "Script must exist"); - cmds.push([action, script]); - } - if (cmds.length) { - const ignoreEngines = !!( - flags.ignoreEngines || config.getOption("ignore-engines") - ); - try { - yield (0, - (_packageCompatibility || _load_packageCompatibility()) - .checkOne)(pkg, config, ignoreEngines); - } catch (err) { - throw err instanceof - (_errors || _load_errors()).MessageError - ? new (_errors || _load_errors()).MessageError( - reporter.lang("cannotRunWithIncompatibleEnv") - ) - : err; - } + if (cmds.length) { + const ignoreEngines = !!( + flags.ignoreEngines || config.getOption("ignore-engines") + ); + try { + yield (0, + (_packageCompatibility || _load_packageCompatibility()) + .checkOne)(pkg, config, ignoreEngines); + } catch (err) { + throw err instanceof + (_errors || _load_errors()).MessageError + ? new (_errors || _load_errors()).MessageError( + reporter.lang("cannotRunWithIncompatibleEnv") + ) + : err; + } - // Disable wrapper in executed commands - process.env.YARN_WRAP_OUTPUT = "false"; - for ( - var _iterator8 = cmds, - _isArray8 = Array.isArray(_iterator8), - _i8 = 0, - _iterator8 = _isArray8 - ? _iterator8 - : _iterator8[Symbol.iterator](); - ; + // Disable wrapper in executed commands + process.env.YARN_WRAP_OUTPUT = "false"; + for ( + var _iterator8 = cmds, + _isArray8 = Array.isArray(_iterator8), + _i8 = 0, + _iterator8 = _isArray8 + ? _iterator8 + : _iterator8[Symbol.iterator](); + ; - ) { - var _ref15; + ) { + var _ref15; - if (_isArray8) { - if (_i8 >= _iterator8.length) break; - _ref15 = _iterator8[_i8++]; - } else { - _i8 = _iterator8.next(); - if (_i8.done) break; - _ref15 = _i8.value; - } + if (_isArray8) { + if (_i8 >= _iterator8.length) break; + _ref15 = _iterator8[_i8++]; + } else { + _i8 = _iterator8.next(); + if (_i8.done) break; + _ref15 = _i8.value; + } - const _ref14 = _ref15; - const stage = _ref14[0]; - const cmd = _ref14[1]; + const _ref14 = _ref15; + const stage = _ref14[0]; + const cmd = _ref14[1]; - // only tack on trailing arguments for default script, ignore for pre and post - #1595 - const cmdWithArgs = - stage === action ? sh`${unquoted(cmd)} ${args}` : cmd; - const customShell = config.getOption("script-shell"); - yield (0, - (_executeLifecycleScript || _load_executeLifecycleScript()) - .execCommand)({ - stage, - config, - cmd: cmdWithArgs, - cwd: flags.into || config.cwd, - isInteractive: true, - customShell: customShell - ? String(customShell) - : undefined, - }); - } - } else if (action === "env") { - reporter.log( - JSON.stringify( + // only tack on trailing arguments for default script, ignore for pre and post - #1595 + const cmdWithArgs = + stage === action ? sh`${unquoted(cmd)} ${args}` : cmd; + const customShell = config.getOption("script-shell"); yield (0, ( _executeLifecycleScript || _load_executeLifecycleScript() - ).makeEnv)("env", config.cwd, config), - null, - 2 - ), - { force: true } - ); - } else { - let suggestion; + ).execCommand)({ + stage, + config, + cmd: cmdWithArgs, + cwd: flags.into || config.cwd, + isInteractive: true, + customShell: customShell + ? String(customShell) + : undefined, + }); + } + } else if (action === "env") { + reporter.log( + JSON.stringify( + yield (0, + ( + _executeLifecycleScript || + _load_executeLifecycleScript() + ).makeEnv)("env", config.cwd, config), + null, + 2 + ), + { force: true } + ); + } else { + let suggestion; - for (const commandName in scripts) { - const steps = leven(commandName, action); - if (steps < 2) { - suggestion = commandName; + for (const commandName in scripts) { + const steps = leven(commandName, action); + if (steps < 2) { + suggestion = commandName; + } } - } - let msg = `Command ${JSON.stringify(action)} not found.`; - if (suggestion) { - msg += ` Did you mean ${JSON.stringify(suggestion)}?`; + let msg = `Command ${JSON.stringify(action)} not found.`; + if (suggestion) { + msg += ` Did you mean ${JSON.stringify(suggestion)}?`; + } + throw new (_errors || _load_errors()).MessageError(msg); } - throw new (_errors || _load_errors()).MessageError(msg); } - } - ); - - return function realRunCommand(_x6, _x7) { - return _ref13.apply(this, arguments); - }; - })(); - - // list possible scripts if none specified - - const pkg = yield config.readManifest(config.cwd); - - const binCommands = new Set(); - const pkgCommands = new Set(); - - const scripts = new Map(); + ); - for ( - var _iterator6 = yield getBinEntries(config), - _isArray6 = Array.isArray(_iterator6), - _i6 = 0, - _iterator6 = _isArray6 - ? _iterator6 - : _iterator6[Symbol.iterator](); - ; + return function realRunCommand(_x6, _x7) { + return _ref13.apply(this, arguments); + }; + })(); - ) { - var _ref11; + // list possible scripts if none specified - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref11 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref11 = _i6.value; - } + const pkg = yield config.readManifest(config.cwd); - const _ref10 = _ref11; - const name = _ref10[0]; - const loc = _ref10[1]; + const binCommands = new Set(); + const pkgCommands = new Set(); - scripts.set(name, quoteForShell(loc)); - binCommands.add(name); - } + const scripts = new Map(); - const pkgScripts = pkg.scripts; - - if (pkgScripts) { for ( - var _iterator7 = Object.keys(pkgScripts).sort(), - _isArray7 = Array.isArray(_iterator7), - _i7 = 0, - _iterator7 = _isArray7 - ? _iterator7 - : _iterator7[Symbol.iterator](); + var _iterator6 = yield getBinEntries(config), + _isArray6 = Array.isArray(_iterator6), + _i6 = 0, + _iterator6 = _isArray6 + ? _iterator6 + : _iterator6[Symbol.iterator](); ; ) { - var _ref12; + var _ref11; - if (_isArray7) { - if (_i7 >= _iterator7.length) break; - _ref12 = _iterator7[_i7++]; + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref11 = _iterator6[_i6++]; } else { - _i7 = _iterator7.next(); - if (_i7.done) break; - _ref12 = _i7.value; + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref11 = _i6.value; } - const name = _ref12; + const _ref10 = _ref11; + const name = _ref10[0]; + const loc = _ref10[1]; - scripts.set(name, pkgScripts[name] || ""); - pkgCommands.add(name); + scripts.set(name, quoteForShell(loc)); + binCommands.add(name); } - } - function runCommand([action, ...args]) { - return (0, (_hooks || _load_hooks()).callThroughHook)( - "runScript", - () => realRunCommand(action, args), - { action, args } - ); - } + const pkgScripts = pkg.scripts; - if (args.length === 0) { - if (binCommands.size > 0) { - reporter.info( - `${ - reporter.lang("binCommands") + - Array.from(binCommands).join(", ") - }` - ); - } else { - reporter.error(reporter.lang("noBinAvailable")); - } + if (pkgScripts) { + for ( + var _iterator7 = Object.keys(pkgScripts).sort(), + _isArray7 = Array.isArray(_iterator7), + _i7 = 0, + _iterator7 = _isArray7 + ? _iterator7 + : _iterator7[Symbol.iterator](); + ; - const printedCommands = new Map(); + ) { + var _ref12; - for ( - var _iterator9 = pkgCommands, - _isArray9 = Array.isArray(_iterator9), - _i9 = 0, - _iterator9 = _isArray9 - ? _iterator9 - : _iterator9[Symbol.iterator](); - ; + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref12 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref12 = _i7.value; + } - ) { - var _ref16; + const name = _ref12; - if (_isArray9) { - if (_i9 >= _iterator9.length) break; - _ref16 = _iterator9[_i9++]; + scripts.set(name, pkgScripts[name] || ""); + pkgCommands.add(name); + } + } + + function runCommand([action, ...args]) { + return (0, (_hooks || _load_hooks()).callThroughHook)( + "runScript", + () => realRunCommand(action, args), + { action, args } + ); + } + + if (args.length === 0) { + if (binCommands.size > 0) { + reporter.info( + `${ + reporter.lang("binCommands") + + Array.from(binCommands).join(", ") + }` + ); } else { - _i9 = _iterator9.next(); - if (_i9.done) break; - _ref16 = _i9.value; + reporter.error(reporter.lang("noBinAvailable")); } - const pkgCommand = _ref16; + const printedCommands = new Map(); - const action = scripts.get(pkgCommand); - invariant(action, "Action must exists"); - printedCommands.set(pkgCommand, action); - } + for ( + var _iterator9 = pkgCommands, + _isArray9 = Array.isArray(_iterator9), + _i9 = 0, + _iterator9 = _isArray9 + ? _iterator9 + : _iterator9[Symbol.iterator](); + ; - if (pkgCommands.size > 0) { - reporter.info(`${reporter.lang("possibleCommands")}`); - reporter.list( - "possibleCommands", - Array.from(pkgCommands), - toObject(printedCommands) - ); - if (!flags.nonInteractive) { - yield reporter.question(reporter.lang("commandQuestion")).then( - function (answer) { - return runCommand(answer.trim().split(" ")); - }, - function () { - return reporter.error(reporter.lang("commandNotSpecified")); - } + ) { + var _ref16; + + if (_isArray9) { + if (_i9 >= _iterator9.length) break; + _ref16 = _iterator9[_i9++]; + } else { + _i9 = _iterator9.next(); + if (_i9.done) break; + _ref16 = _i9.value; + } + + const pkgCommand = _ref16; + + const action = scripts.get(pkgCommand); + invariant(action, "Action must exists"); + printedCommands.set(pkgCommand, action); + } + + if (pkgCommands.size > 0) { + reporter.info(`${reporter.lang("possibleCommands")}`); + reporter.list( + "possibleCommands", + Array.from(pkgCommands), + toObject(printedCommands) ); + if (!flags.nonInteractive) { + yield reporter + .question(reporter.lang("commandQuestion")) + .then( + function (answer) { + return runCommand(answer.trim().split(" ")); + }, + function () { + return reporter.error( + reporter.lang("commandNotSpecified") + ); + } + ); + } + } else { + reporter.error(reporter.lang("noScriptsAvailable")); } + return Promise.resolve(); } else { - reporter.error(reporter.lang("noScriptsAvailable")); + return runCommand(args); } - return Promise.resolve(); - } else { - return runCommand(args); } - }); + ); return function run(_x2, _x3, _x4, _x5) { return _ref9.apply(this, arguments); @@ -91310,35 +91228,34 @@ wercker.yml let getName = (exports.getName = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - args, - config - ) { - let name = args.shift(); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (args, config) { + let name = args.shift(); - if (!name) { - const pkg = yield config.readRootManifest(); - name = pkg.name; - } + if (!name) { + const pkg = yield config.readRootManifest(); + name = pkg.name; + } - if (name) { - if ( - !(0, (_validate || _load_validate()).isValidPackageName)(name) - ) { + if (name) { + if ( + !(0, (_validate || _load_validate()).isValidPackageName)(name) + ) { + throw new (_errors || _load_errors()).MessageError( + config.reporter.lang("invalidPackageName") + ); + } + + return (_npmRegistry || _load_npmRegistry()).default.escapeName( + name + ); + } else { throw new (_errors || _load_errors()).MessageError( - config.reporter.lang("invalidPackageName") + config.reporter.lang("unknownPackageName") ); } - - return (_npmRegistry || _load_npmRegistry()).default.escapeName( - name - ); - } else { - throw new (_errors || _load_errors()).MessageError( - config.reporter.lang("unknownPackageName") - ); } - }); + ); return function getName(_x, _x2) { return _ref.apply(this, arguments); @@ -91347,32 +91264,29 @@ wercker.yml let list = (() => { var _ref2 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const name = yield getName(args, config); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const name = yield getName(args, config); - reporter.step(1, 1, reporter.lang("gettingTags")); - const tags = yield config.registries.npm.request( - `-/package/${name}/dist-tags` - ); + reporter.step(1, 1, reporter.lang("gettingTags")); + const tags = yield config.registries.npm.request( + `-/package/${name}/dist-tags` + ); - if (tags) { - reporter.info(`Package ${name}`); - for (const name in tags) { - reporter.info(`${name}: ${tags[name]}`); + if (tags) { + reporter.info(`Package ${name}`); + for (const name in tags) { + reporter.info(`${name}: ${tags[name]}`); + } } - } - if (!tags) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("packageNotFoundRegistry", name, "npm") - ); + if (!tags) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("packageNotFoundRegistry", name, "npm") + ); + } } - }); + ); return function list(_x3, _x4, _x5, _x6) { return _ref2.apply(this, arguments); @@ -91381,49 +91295,46 @@ wercker.yml let remove = (() => { var _ref3 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - if (args.length !== 2) { - return false; - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + if (args.length !== 2) { + return false; + } - const name = yield getName(args, config); - const tag = args.shift(); + const name = yield getName(args, config); + const tag = args.shift(); - reporter.step(1, 3, reporter.lang("loggingIn")); - const revoke = yield (0, (_login || _load_login()).getToken)( - config, - reporter, - name - ); + reporter.step(1, 3, reporter.lang("loggingIn")); + const revoke = yield (0, (_login || _load_login()).getToken)( + config, + reporter, + name + ); - reporter.step(2, 3, reporter.lang("deletingTags")); - const result = yield config.registries.npm.request( - `-/package/${name}/dist-tags/${encodeURI(tag)}`, - { - method: "DELETE", - } - ); + reporter.step(2, 3, reporter.lang("deletingTags")); + const result = yield config.registries.npm.request( + `-/package/${name}/dist-tags/${encodeURI(tag)}`, + { + method: "DELETE", + } + ); - if (result === false) { - reporter.error(reporter.lang("deletedTagFail")); - } else { - reporter.success(reporter.lang("deletedTag")); - } + if (result === false) { + reporter.error(reporter.lang("deletedTagFail")); + } else { + reporter.success(reporter.lang("deletedTag")); + } - reporter.step(3, 3, reporter.lang("revokingToken")); - yield revoke(); + reporter.step(3, 3, reporter.lang("revokingToken")); + yield revoke(); - if (result === false) { - throw new Error(); - } else { - return true; + if (result === false) { + throw new Error(); + } else { + return true; + } } - }); + ); return function remove(_x7, _x8, _x9, _x10) { return _ref3.apply(this, arguments); @@ -91628,285 +91539,295 @@ wercker.yml let run = (exports.run = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const outdatedFieldName = flags.latest ? "latest" : "wanted"; - const lockfile = yield ( - _lockfile || _load_lockfile() - ).default.fromDirectory(config.lockfileFolder); - - const deps = yield (0, (_upgrade || _load_upgrade()).getOutdated)( - config, - reporter, - (0, (_extends2 || _load_extends()).default)({}, flags, { - includeWorkspaceDeps: true, - }), - lockfile, - args - ); - - if (deps.length === 0) { - reporter.success(reporter.lang("allDependenciesUpToDate")); - return; - } - - // Fail early with runtime compatibility checks so that it doesn't fail after you've made your selections - const install = new (_install || _load_install()).Install( - flags, - config, - reporter, - lockfile - ); - yield install.checkCompatibility(); - - const usesWorkspaces = !!config.workspaceRootFolder; - - const maxLengthArr = { - name: "name".length, - current: "from".length, - range: "latest".length, - [outdatedFieldName]: "to".length, - workspaceName: "workspace".length, - }; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const outdatedFieldName = flags.latest ? "latest" : "wanted"; + const lockfile = yield ( + _lockfile || _load_lockfile() + ).default.fromDirectory(config.lockfileFolder); - const keysWithDynamicLength = ["name", "current", outdatedFieldName]; + const deps = yield (0, (_upgrade || _load_upgrade()).getOutdated)( + config, + reporter, + (0, (_extends2 || _load_extends()).default)({}, flags, { + includeWorkspaceDeps: true, + }), + lockfile, + args + ); - if (!flags.latest) { - maxLengthArr.range = "range".length; - keysWithDynamicLength.push("range"); - } + if (deps.length === 0) { + reporter.success(reporter.lang("allDependenciesUpToDate")); + return; + } - if (usesWorkspaces) { - keysWithDynamicLength.push("workspaceName"); - } + // Fail early with runtime compatibility checks so that it doesn't fail after you've made your selections + const install = new (_install || _load_install()).Install( + flags, + config, + reporter, + lockfile + ); + yield install.checkCompatibility(); - deps.forEach(function (dep) { - return keysWithDynamicLength.forEach(function (key) { - maxLengthArr[key] = Math.max(maxLengthArr[key], dep[key].length); - }); - }); + const usesWorkspaces = !!config.workspaceRootFolder; - // Depends on maxLengthArr - const addPadding = function addPadding(dep) { - return function (key) { - return `${dep[key]}${" ".repeat( - maxLengthArr[key] - dep[key].length - )}`; + const maxLengthArr = { + name: "name".length, + current: "from".length, + range: "latest".length, + [outdatedFieldName]: "to".length, + workspaceName: "workspace".length, }; - }; - const headerPadding = function headerPadding(header, key) { - return `${reporter.format.bold.underline(header)}${" ".repeat( - maxLengthArr[key] - header.length - )}`; - }; - const colorizeName = function colorizeName(from, to) { - return reporter.format[ - (0, (_colorForVersions || _load_colorForVersions()).default)( - from, - to - ) + const keysWithDynamicLength = [ + "name", + "current", + outdatedFieldName, ]; - }; - - const getNameFromHint = function getNameFromHint(hint) { - return hint ? `${hint}Dependencies` : "dependencies"; - }; - const makeRow = function makeRow(dep) { - const padding = addPadding(dep); - const name = colorizeName( - dep.current, - dep[outdatedFieldName] - )(padding("name")); - const current = reporter.format.blue(padding("current")); - const latest = (0, (_colorizeDiff || _load_colorizeDiff()).default)( - dep.current, - padding(outdatedFieldName), - reporter - ); - const url = reporter.format.cyan(dep.url); - const range = reporter.format.blue( - flags.latest ? "latest" : padding("range") - ); - if (usesWorkspaces) { - const workspace = padding("workspaceName"); - return `${name} ${range} ${current} ❯ ${latest} ${workspace} ${url}`; - } else { - return `${name} ${range} ${current} ❯ ${latest} ${url}`; + if (!flags.latest) { + maxLengthArr.range = "range".length; + keysWithDynamicLength.push("range"); } - }; - const makeHeaderRow = function makeHeaderRow() { - const name = headerPadding("name", "name"); - const range = headerPadding("range", "range"); - const from = headerPadding("from", "current"); - const to = headerPadding("to", outdatedFieldName); - const url = reporter.format.bold.underline("url"); if (usesWorkspaces) { - const workspace = headerPadding("workspace", "workspaceName"); - return ` ${name} ${range} ${from} ${to} ${workspace} ${url}`; - } else { - return ` ${name} ${range} ${from} ${to} ${url}`; + keysWithDynamicLength.push("workspaceName"); } - }; - const groupedDeps = deps.reduce(function (acc, dep) { - const hint = dep.hint, - name = dep.name, - upgradeTo = dep.upgradeTo; - - const version = dep[outdatedFieldName]; - const key = getNameFromHint(hint); - const xs = acc[key] || []; - acc[key] = xs.concat({ - name: makeRow(dep), - value: dep, - short: `${name}@${version}`, - upgradeTo, + deps.forEach(function (dep) { + return keysWithDynamicLength.forEach(function (key) { + maxLengthArr[key] = Math.max( + maxLengthArr[key], + dep[key].length + ); + }); }); - return acc; - }, {}); - const flatten = function flatten(xs) { - return xs.reduce(function (ys, y) { - return ys.concat(Array.isArray(y) ? flatten(y) : y); - }, []); - }; + // Depends on maxLengthArr + const addPadding = function addPadding(dep) { + return function (key) { + return `${dep[key]}${" ".repeat( + maxLengthArr[key] - dep[key].length + )}`; + }; + }; + const headerPadding = function headerPadding(header, key) { + return `${reporter.format.bold.underline(header)}${" ".repeat( + maxLengthArr[key] - header.length + )}`; + }; - const choices = flatten( - Object.keys(groupedDeps).map(function (key) { - return [ - new (_inquirer || _load_inquirer()).default.Separator( - reporter.format.bold.underline.green(key) - ), - new (_inquirer || _load_inquirer()).default.Separator( - makeHeaderRow() - ), - groupedDeps[key], - new (_inquirer || _load_inquirer()).default.Separator(" "), + const colorizeName = function colorizeName(from, to) { + return reporter.format[ + (0, (_colorForVersions || _load_colorForVersions()).default)( + from, + to + ) ]; - }) - ); + }; - try { - const red = reporter.format.red(""); - const yellow = reporter.format.yellow(""); - const green = reporter.format.green(""); - reporter.info( - reporter.lang("legendColorsForVersionUpdates", red, yellow, green) - ); + const getNameFromHint = function getNameFromHint(hint) { + return hint ? `${hint}Dependencies` : "dependencies"; + }; - const answers = yield reporter.prompt( - "Choose which packages to update.", - choices, - { - name: "packages", - type: "checkbox", - validate: function validate(answer) { - return ( - !!answer.length || "You must choose at least one package." - ); - }, + const makeRow = function makeRow(dep) { + const padding = addPadding(dep); + const name = colorizeName( + dep.current, + dep[outdatedFieldName] + )(padding("name")); + const current = reporter.format.blue(padding("current")); + const latest = (0, + (_colorizeDiff || _load_colorizeDiff()).default)( + dep.current, + padding(outdatedFieldName), + reporter + ); + const url = reporter.format.cyan(dep.url); + const range = reporter.format.blue( + flags.latest ? "latest" : padding("range") + ); + if (usesWorkspaces) { + const workspace = padding("workspaceName"); + return `${name} ${range} ${current} ❯ ${latest} ${workspace} ${url}`; + } else { + return `${name} ${range} ${current} ❯ ${latest} ${url}`; } - ); - - const getPattern = function getPattern({ upgradeTo }) { - return upgradeTo; - }; - const isHint = function isHint(x) { - return function ({ hint }) { - return hint === x; - }; }; - var _arr = [null, "dev", "optional", "peer"]; - for (var _i = 0; _i < _arr.length; _i++) { - const hint = _arr[_i]; - // Reset dependency flags - flags.dev = hint === "dev"; - flags.peer = hint === "peer"; - flags.optional = hint === "optional"; - flags.ignoreWorkspaceRootCheck = true; - flags.includeWorkspaceDeps = false; - flags.workspaceRootIsCwd = false; - const deps = answers.filter(isHint(hint)); - if (deps.length) { - const install = new (_install || _load_install()).Install( - flags, - config, - reporter, - lockfile - ); - - var _ref2 = yield install.fetchRequestFromCwd(); + const makeHeaderRow = function makeHeaderRow() { + const name = headerPadding("name", "name"); + const range = headerPadding("range", "range"); + const from = headerPadding("from", "current"); + const to = headerPadding("to", outdatedFieldName); + const url = reporter.format.bold.underline("url"); + if (usesWorkspaces) { + const workspace = headerPadding("workspace", "workspaceName"); + return ` ${name} ${range} ${from} ${to} ${workspace} ${url}`; + } else { + return ` ${name} ${range} ${from} ${to} ${url}`; + } + }; - const packagePatterns = _ref2.requests; + const groupedDeps = deps.reduce(function (acc, dep) { + const hint = dep.hint, + name = dep.name, + upgradeTo = dep.upgradeTo; + + const version = dep[outdatedFieldName]; + const key = getNameFromHint(hint); + const xs = acc[key] || []; + acc[key] = xs.concat({ + name: makeRow(dep), + value: dep, + short: `${name}@${version}`, + upgradeTo, + }); + return acc; + }, {}); - const depsByWorkspace = deps.reduce(function (acc, dep) { - const workspaceLoc = dep.workspaceLoc; + const flatten = function flatten(xs) { + return xs.reduce(function (ys, y) { + return ys.concat(Array.isArray(y) ? flatten(y) : y); + }, []); + }; - const xs = acc[workspaceLoc] || []; - acc[workspaceLoc] = xs.concat(dep); - return acc; - }, {}); - const cwd = config.cwd; - for ( - var _iterator = Object.keys(depsByWorkspace), - _isArray = Array.isArray(_iterator), - _i2 = 0, - _iterator = _isArray - ? _iterator - : _iterator[Symbol.iterator](); - ; + const choices = flatten( + Object.keys(groupedDeps).map(function (key) { + return [ + new (_inquirer || _load_inquirer()).default.Separator( + reporter.format.bold.underline.green(key) + ), + new (_inquirer || _load_inquirer()).default.Separator( + makeHeaderRow() + ), + groupedDeps[key], + new (_inquirer || _load_inquirer()).default.Separator(" "), + ]; + }) + ); - ) { - var _ref3; + try { + const red = reporter.format.red(""); + const yellow = reporter.format.yellow(""); + const green = reporter.format.green(""); + reporter.info( + reporter.lang( + "legendColorsForVersionUpdates", + red, + yellow, + green + ) + ); - if (_isArray) { - if (_i2 >= _iterator.length) break; - _ref3 = _iterator[_i2++]; - } else { - _i2 = _iterator.next(); - if (_i2.done) break; - _ref3 = _i2.value; - } + const answers = yield reporter.prompt( + "Choose which packages to update.", + choices, + { + name: "packages", + type: "checkbox", + validate: function validate(answer) { + return ( + !!answer.length || "You must choose at least one package." + ); + }, + } + ); - const loc = _ref3; + const getPattern = function getPattern({ upgradeTo }) { + return upgradeTo; + }; + const isHint = function isHint(x) { + return function ({ hint }) { + return hint === x; + }; + }; - const patterns = depsByWorkspace[loc].map(getPattern); - (0, (_upgrade || _load_upgrade()).cleanLockfile)( - lockfile, - deps, - packagePatterns, - reporter - ); - reporter.info( - reporter.lang("updateInstalling", getNameFromHint(hint)) - ); - if (loc !== "") { - config.cwd = path.resolve(path.dirname(loc)); - } - const add = new (_add || _load_add()).Add( - patterns, + var _arr = [null, "dev", "optional", "peer"]; + for (var _i = 0; _i < _arr.length; _i++) { + const hint = _arr[_i]; + // Reset dependency flags + flags.dev = hint === "dev"; + flags.peer = hint === "peer"; + flags.optional = hint === "optional"; + flags.ignoreWorkspaceRootCheck = true; + flags.includeWorkspaceDeps = false; + flags.workspaceRootIsCwd = false; + const deps = answers.filter(isHint(hint)); + if (deps.length) { + const install = new (_install || _load_install()).Install( flags, config, reporter, lockfile ); - yield add.init(); - config.cwd = cwd; + + var _ref2 = yield install.fetchRequestFromCwd(); + + const packagePatterns = _ref2.requests; + + const depsByWorkspace = deps.reduce(function (acc, dep) { + const workspaceLoc = dep.workspaceLoc; + + const xs = acc[workspaceLoc] || []; + acc[workspaceLoc] = xs.concat(dep); + return acc; + }, {}); + const cwd = config.cwd; + for ( + var _iterator = Object.keys(depsByWorkspace), + _isArray = Array.isArray(_iterator), + _i2 = 0, + _iterator = _isArray + ? _iterator + : _iterator[Symbol.iterator](); + ; + + ) { + var _ref3; + + if (_isArray) { + if (_i2 >= _iterator.length) break; + _ref3 = _iterator[_i2++]; + } else { + _i2 = _iterator.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + const loc = _ref3; + + const patterns = depsByWorkspace[loc].map(getPattern); + (0, (_upgrade || _load_upgrade()).cleanLockfile)( + lockfile, + deps, + packagePatterns, + reporter + ); + reporter.info( + reporter.lang("updateInstalling", getNameFromHint(hint)) + ); + if (loc !== "") { + config.cwd = path.resolve(path.dirname(loc)); + } + const add = new (_add || _load_add()).Add( + patterns, + flags, + config, + reporter, + lockfile + ); + yield add.init(); + config.cwd = cwd; + } } } + } catch (e) { + Promise.reject(e); } - } catch (e) { - Promise.reject(e); } - }); + ); return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -92022,262 +91943,268 @@ wercker.yml let setVersion = (exports.setVersion = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args, - required - ) { - const pkg = yield config.readRootManifest(); - const pkgLoc = pkg._loc; - const scripts = (0, (_map || _load_map()).default)(); - let newVersion = flags.newVersion; - let identifier = undefined; - if (flags.preid) { - identifier = flags.preid; - } - invariant(pkgLoc, "expected package location"); - - if (args.length && !newVersion) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("invalidVersionArgument", NEW_VERSION_FLAG) - ); - } - - function runLifecycle(lifecycle) { - if (scripts[lifecycle]) { - return (0, - (_executeLifecycleScript || _load_executeLifecycleScript()) - .execCommand)({ - stage: lifecycle, - config, - cmd: scripts[lifecycle], - cwd: config.cwd, - isInteractive: true, - }); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args, required) { + const pkg = yield config.readRootManifest(); + const pkgLoc = pkg._loc; + const scripts = (0, (_map || _load_map()).default)(); + let newVersion = flags.newVersion; + let identifier = undefined; + if (flags.preid) { + identifier = flags.preid; } + invariant(pkgLoc, "expected package location"); - return Promise.resolve(); - } - - function isCommitHooksDisabled() { - return ( - flags.commitHooks === false || - config.getOption("version-commit-hooks") === false - ); - } - - if (pkg.scripts) { - // inherit `scripts` from manifest - Object.assign(scripts, pkg.scripts); - } + if (args.length && !newVersion) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("invalidVersionArgument", NEW_VERSION_FLAG) + ); + } - // get old version - let oldVersion = pkg.version; - if (oldVersion) { - reporter.info(`${reporter.lang("currentVersion")}: ${oldVersion}`); - } else { - oldVersion = "0.0.0"; - } + function runLifecycle(lifecycle) { + if (scripts[lifecycle]) { + return (0, + (_executeLifecycleScript || _load_executeLifecycleScript()) + .execCommand)({ + stage: lifecycle, + config, + cmd: scripts[lifecycle], + cwd: config.cwd, + isInteractive: true, + }); + } - // get new version - if ( - newVersion && - !isValidNewVersion( - oldVersion, - newVersion, - config.looseSemver, - identifier - ) - ) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("invalidVersion") - ); - } + return Promise.resolve(); + } - // get new version by bumping old version, if requested - if (!newVersion) { - if (flags.major) { - newVersion = semver.inc(oldVersion, "major"); - } else if (flags.minor) { - newVersion = semver.inc(oldVersion, "minor"); - } else if (flags.patch) { - newVersion = semver.inc(oldVersion, "patch"); - } else if (flags.premajor) { - newVersion = semver.inc(oldVersion, "premajor", identifier); - } else if (flags.preminor) { - newVersion = semver.inc(oldVersion, "preminor", identifier); - } else if (flags.prepatch) { - newVersion = semver.inc(oldVersion, "prepatch", identifier); - } else if (flags.prerelease) { - newVersion = semver.inc(oldVersion, "prerelease", identifier); - } - } - - // wasn't passed a version arg so ask interactively - while (!newVersion) { - // make sure we're not running in non-interactive mode before asking for new version - if (flags.nonInteractive || config.nonInteractive) { - // if no version is specified, use current version in package.json - newVersion = oldVersion; - break; + function isCommitHooksDisabled() { + return ( + flags.commitHooks === false || + config.getOption("version-commit-hooks") === false + ); } - // Make sure we dont exit with an error message when pressing Ctrl-C or enter to abort - try { - newVersion = yield reporter.question(reporter.lang("newVersion")); - if (!newVersion) { - newVersion = oldVersion; - } - } catch (err) { - newVersion = oldVersion; + if (pkg.scripts) { + // inherit `scripts` from manifest + Object.assign(scripts, pkg.scripts); } - if (!required && !newVersion) { + // get old version + let oldVersion = pkg.version; + if (oldVersion) { reporter.info( - `${reporter.lang("noVersionOnPublish")}: ${oldVersion}` + `${reporter.lang("currentVersion")}: ${oldVersion}` ); - return function () { - return Promise.resolve(); - }; + } else { + oldVersion = "0.0.0"; } + // get new version if ( - isValidNewVersion( + newVersion && + !isValidNewVersion( oldVersion, newVersion, config.looseSemver, identifier ) ) { - break; - } else { - newVersion = null; - reporter.error(reporter.lang("invalidSemver")); + throw new (_errors || _load_errors()).MessageError( + reporter.lang("invalidVersion") + ); } - } - if (newVersion) { - newVersion = - semver.inc( - oldVersion, - newVersion, - config.looseSemver, - identifier - ) || newVersion; - } - invariant(newVersion, "expected new version"); - - if (newVersion === pkg.version) { - return function () { - return Promise.resolve(); - }; - } - yield runLifecycle("preversion"); + // get new version by bumping old version, if requested + if (!newVersion) { + if (flags.major) { + newVersion = semver.inc(oldVersion, "major"); + } else if (flags.minor) { + newVersion = semver.inc(oldVersion, "minor"); + } else if (flags.patch) { + newVersion = semver.inc(oldVersion, "patch"); + } else if (flags.premajor) { + newVersion = semver.inc(oldVersion, "premajor", identifier); + } else if (flags.preminor) { + newVersion = semver.inc(oldVersion, "preminor", identifier); + } else if (flags.prepatch) { + newVersion = semver.inc(oldVersion, "prepatch", identifier); + } else if (flags.prerelease) { + newVersion = semver.inc(oldVersion, "prerelease", identifier); + } + } + + // wasn't passed a version arg so ask interactively + while (!newVersion) { + // make sure we're not running in non-interactive mode before asking for new version + if (flags.nonInteractive || config.nonInteractive) { + // if no version is specified, use current version in package.json + newVersion = oldVersion; + break; + } - // update version - reporter.info(`${reporter.lang("newVersion")}: ${newVersion}`); - pkg.version = newVersion; + // Make sure we dont exit with an error message when pressing Ctrl-C or enter to abort + try { + newVersion = yield reporter.question( + reporter.lang("newVersion") + ); + if (!newVersion) { + newVersion = oldVersion; + } + } catch (err) { + newVersion = oldVersion; + } - // update versions in manifests - const manifests = yield config.getRootManifests(); - for ( - var _iterator = (_index || _load_index()).registryNames, - _isArray = Array.isArray(_iterator), - _i = 0, - _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); - ; + if (!required && !newVersion) { + reporter.info( + `${reporter.lang("noVersionOnPublish")}: ${oldVersion}` + ); + return function () { + return Promise.resolve(); + }; + } - ) { - var _ref2; + if ( + isValidNewVersion( + oldVersion, + newVersion, + config.looseSemver, + identifier + ) + ) { + break; + } else { + newVersion = null; + reporter.error(reporter.lang("invalidSemver")); + } + } + if (newVersion) { + newVersion = + semver.inc( + oldVersion, + newVersion, + config.looseSemver, + identifier + ) || newVersion; + } + invariant(newVersion, "expected new version"); - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; + if (newVersion === pkg.version) { + return function () { + return Promise.resolve(); + }; } - const registryName = _ref2; + yield runLifecycle("preversion"); + + // update version + reporter.info(`${reporter.lang("newVersion")}: ${newVersion}`); + pkg.version = newVersion; + + // update versions in manifests + const manifests = yield config.getRootManifests(); + for ( + var _iterator = (_index || _load_index()).registryNames, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); + ; + + ) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + const registryName = _ref2; - const manifest = manifests[registryName]; - if (manifest.exists) { - manifest.object.version = newVersion; + const manifest = manifests[registryName]; + if (manifest.exists) { + manifest.object.version = newVersion; + } } - } - yield config.saveRootManifests(manifests); + yield config.saveRootManifests(manifests); - yield runLifecycle("version"); + yield runLifecycle("version"); - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)( - function* () { - invariant(newVersion, "expected version"); - - // check if a new git tag should be created - if (flags.gitTagVersion && config.getOption("version-git-tag")) { - // add git commit and tag - let isGit = false; - const parts = config.cwd.split(path.sep); - while (parts.length) { - isGit = yield (_fs || _load_fs()).exists( - path.join(parts.join(path.sep), ".git") - ); - if (isGit) { - break; - } else { - parts.pop(); + return (0, + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* () { + invariant(newVersion, "expected version"); + + // check if a new git tag should be created + if ( + flags.gitTagVersion && + config.getOption("version-git-tag") + ) { + // add git commit and tag + let isGit = false; + const parts = config.cwd.split(path.sep); + while (parts.length) { + isGit = yield (_fs || _load_fs()).exists( + path.join(parts.join(path.sep), ".git") + ); + if (isGit) { + break; + } else { + parts.pop(); + } } - } - if (isGit) { - const message = ( - flags.message || - String(config.getOption("version-git-message")) - ).replace(/%s/g, newVersion); - const sign = Boolean( - config.getOption("version-sign-git-tag") - ); - const flag = sign ? "-sm" : "-am"; - const prefix = String(config.getOption("version-tag-prefix")); - const args = [ - "commit", - "-m", - message, - ...(isCommitHooksDisabled() ? ["-n"] : []), - ]; + if (isGit) { + const message = ( + flags.message || + String(config.getOption("version-git-message")) + ).replace(/%s/g, newVersion); + const sign = Boolean( + config.getOption("version-sign-git-tag") + ); + const flag = sign ? "-sm" : "-am"; + const prefix = String( + config.getOption("version-tag-prefix") + ); + const args = [ + "commit", + "-m", + message, + ...(isCommitHooksDisabled() ? ["-n"] : []), + ]; - const gitRoot = (yield (0, - (_gitSpawn || _load_gitSpawn()).spawn)( - ["rev-parse", "--show-toplevel"], - { cwd: config.cwd } - )).trim(); + const gitRoot = (yield (0, + (_gitSpawn || _load_gitSpawn()).spawn)( + ["rev-parse", "--show-toplevel"], + { cwd: config.cwd } + )).trim(); - // add manifest - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)( - ["add", path.relative(gitRoot, pkgLoc)], - { cwd: gitRoot } - ); + // add manifest + yield (0, (_gitSpawn || _load_gitSpawn()).spawn)( + ["add", path.relative(gitRoot, pkgLoc)], + { cwd: gitRoot } + ); - // create git commit - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(args, { - cwd: gitRoot, - }); + // create git commit + yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(args, { + cwd: gitRoot, + }); - // create git tag - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)( - ["tag", `${prefix}${newVersion}`, flag, message], - { cwd: gitRoot } - ); + // create git tag + yield (0, (_gitSpawn || _load_gitSpawn()).spawn)( + ["tag", `${prefix}${newVersion}`, flag, message], + { cwd: gitRoot } + ); + } } - } - yield runLifecycle("postversion"); - } - ); - }); + yield runLifecycle("postversion"); + } + ); + } + ); return function setVersion(_x, _x2, _x3, _x4, _x5) { return _ref.apply(this, arguments); @@ -92286,15 +92213,18 @@ wercker.yml let run = (exports.run = (() => { var _ref4 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const commit = yield setVersion(config, reporter, flags, args, true); - yield commit(); - }); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const commit = yield setVersion( + config, + reporter, + flags, + args, + true + ); + yield commit(); + } + ); return function run(_x6, _x7, _x8, _x9) { return _ref4.apply(this, arguments); @@ -92926,8 +92856,8 @@ wercker.yml const isRelativePath = urlParse.protocol ? urlParse.protocol.match(/^[a-z]:$/i) : urlParse.pathname - ? urlParse.pathname.match(/^(?:\.{1,2})?[\\\/]/) - : false; + ? urlParse.pathname.match(/^(?:\.{1,2})?[\\\/]/) + : false; if (isFilePath || isRelativePath) { return this.fetchFromLocal(this.reference); @@ -100139,8 +100069,8 @@ wercker.yml return this._dest ? this._dest.isTTY : this._src - ? this._src.isTTY - : false; + ? this._src.isTTY + : false; } // basically just get replace the getter/setter with a regular value @@ -100158,8 +100088,8 @@ wercker.yml return this._dest ? this._dest.rows : this._src - ? this._src.rows - : undefined; + ? this._src.rows + : undefined; }, enumerable: true, configurable: true, @@ -100170,8 +100100,8 @@ wercker.yml return this._dest ? this._dest.columns : this._src - ? this._src.columns - : undefined; + ? this._src.columns + : undefined; }, enumerable: true, configurable: true, @@ -117283,8 +117213,8 @@ threshold" typeof meta == "object" ? self._getId(meta) || meta : self.getSchema(META_SCHEMA_ID) - ? META_SCHEMA_ID - : undefined; + ? META_SCHEMA_ID + : undefined; return self._opts.defaultMeta; } @@ -122554,8 +122484,8 @@ threshold" typeof defaultMeta == "string" ? { $ref: defaultMeta } : ajv.getSchema(META_SCHEMA_ID) - ? { $ref: META_SCHEMA_ID } - : {}; + ? { $ref: META_SCHEMA_ID } + : {}; ajv.addKeyword("patternGroups", { // implemented in properties.jst @@ -124044,7 +123974,7 @@ threshold" }; Writer.prototype.writeStringArray = function (strings) { - if (!strings instanceof Array) + if ((!strings) instanceof Array) throw new TypeError("argument must be an Array[String]"); var self = this; @@ -124217,9 +124147,9 @@ threshold" typeof setImmediate == "function" ? setImmediate : typeof process == "object" && - typeof process.nextTick == "function" - ? process.nextTick - : null; + typeof process.nextTick == "function" + ? process.nextTick + : null; if (nextTick) { nextTick(fn); @@ -124788,8 +124718,8 @@ threshold" obj[key] = !Array.isArray(query[key]) ? query[key] : firstValOnly - ? query[key][0] - : query[key].slice().sort(); + ? query[key][0] + : query[key].slice().sort(); return obj; }, {}) ) @@ -125117,34 +125047,31 @@ threshold" let run = (exports.run = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const binFolder = path.join( - config.cwd, - config.registryFolders[0], - ".bin" - ); - if (args.length === 0) { - reporter.log(binFolder, { force: true }); - } else { - const binEntries = yield (0, (_run || _load_run()).getBinEntries)( - config + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const binFolder = path.join( + config.cwd, + config.registryFolders[0], + ".bin" ); + if (args.length === 0) { + reporter.log(binFolder, { force: true }); + } else { + const binEntries = yield (0, (_run || _load_run()).getBinEntries)( + config + ); - const binName = args[0]; - const binPath = binEntries.get(binName); + const binName = args[0]; + const binPath = binEntries.get(binName); - if (binPath) { - reporter.log(binPath, { force: true }); - } else { - reporter.error(reporter.lang("packageBinaryNotFound", binName)); + if (binPath) { + reporter.log(binPath, { force: true }); + } else { + reporter.error(reporter.lang("packageBinaryNotFound", binName)); + } } } - }); + ); return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -125283,22 +125210,19 @@ threshold" delete: (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - if (args.length !== 1) { - return false; - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + if (args.length !== 1) { + return false; + } - const key = args[0]; - const yarnConfig = config.registries.yarn; - yield yarnConfig.saveHomeConfig({ [key]: undefined }); - reporter.success(reporter.lang("configDelete", key)); - return true; - }); + const key = args[0]; + const yarnConfig = config.registries.yarn; + yield yarnConfig.saveHomeConfig({ [key]: undefined }); + reporter.success(reporter.lang("configDelete", key)); + return true; + } + ); function _delete(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -125364,54 +125288,46 @@ threshold" let run = (exports.run = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const builderName = args[0], - rest = args.slice(1); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const builderName = args[0], + rest = args.slice(1); - if (!builderName) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("invalidPackageName") - ); - } + if (!builderName) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("invalidPackageName") + ); + } - var _coerceCreatePackageN = coerceCreatePackageName(builderName); + var _coerceCreatePackageN = coerceCreatePackageName(builderName); - const packageName = _coerceCreatePackageN.fullName, - commandName = _coerceCreatePackageN.name; + const packageName = _coerceCreatePackageN.fullName, + commandName = _coerceCreatePackageN.name; - const linkLoc = path.join(config.linkFolder, commandName); - if (yield (_fs || _load_fs()).exists(linkLoc)) { - reporter.info(reporter.lang("linkUsing", packageName)); - } else { - yield (0, (_global || _load_global()).run)(config, reporter, {}, [ - "add", - packageName, - ]); - } + const linkLoc = path.join(config.linkFolder, commandName); + if (yield (_fs || _load_fs()).exists(linkLoc)) { + reporter.info(reporter.lang("linkUsing", packageName)); + } else { + yield (0, (_global || _load_global()).run)(config, reporter, {}, [ + "add", + packageName, + ]); + } - const binFolder = yield (0, (_global || _load_global()).getBinFolder)( - config, - {} - ); - const command = path.resolve(binFolder, commandName); - const env = yield (0, - (_executeLifecycleScript || _load_executeLifecycleScript()).makeEnv)( - "create", - config.cwd, - config - ); + const binFolder = yield (0, + (_global || _load_global()).getBinFolder)(config, {}); + const command = path.resolve(binFolder, commandName); + const env = yield (0, + (_executeLifecycleScript || _load_executeLifecycleScript()) + .makeEnv)("create", config.cwd, config); - yield (_child || _load_child()).spawn(command, rest, { - stdio: `inherit`, - shell: true, - env, - }); - }); + yield (_child || _load_child()).spawn(command, rest, { + stdio: `inherit`, + shell: true, + env, + }); + } + ); return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -125545,33 +125461,27 @@ threshold" let run = (exports.run = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const env = yield (0, - (_executeLifecycleScript || _load_executeLifecycleScript()).makeEnv)( - `exec`, - config.cwd, - config - ); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const env = yield (0, + (_executeLifecycleScript || _load_executeLifecycleScript()) + .makeEnv)(`exec`, config.cwd, config); - if (args.length < 1) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("execMissingCommand") - ); - } + if (args.length < 1) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("execMissingCommand") + ); + } - const execName = args[0], - rest = args.slice(1); + const execName = args[0], + rest = args.slice(1); - yield (_child || _load_child()).spawn(execName, rest, { - stdio: "inherit", - env, - }); - }); + yield (_child || _load_child()).spawn(execName, rest, { + stdio: "inherit", + env, + }); + } + ); return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -125646,47 +125556,44 @@ threshold" let run = (exports.run = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - let manifest; - if (flags.useManifest) { - manifest = yield config.readJson(flags.useManifest); - } else { - manifest = yield config.readRootManifest(); - } - if (!manifest.name) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("noName") - ); - } - if (!manifest.version) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("noVersion") + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + let manifest; + if (flags.useManifest) { + manifest = yield config.readJson(flags.useManifest); + } else { + manifest = yield config.readRootManifest(); + } + if (!manifest.name) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("noName") + ); + } + if (!manifest.version) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("noVersion") + ); + } + + const entry = { + name: manifest.name, + version: manifest.version, + resolved: flags.resolved, + registry: flags.registry || manifest._registry, + optionalDependencies: manifest.optionalDependencies, + dependencies: manifest.dependencies, + }; + const pattern = flags.pattern || `${entry.name}@${entry.version}`; + reporter.log( + (0, (_lockfile || _load_lockfile()).stringify)({ + [pattern]: (0, (_lockfile || _load_lockfile()).implodeEntry)( + pattern, + entry + ), + }) ); } - - const entry = { - name: manifest.name, - version: manifest.version, - resolved: flags.resolved, - registry: flags.registry || manifest._registry, - optionalDependencies: manifest.optionalDependencies, - dependencies: manifest.dependencies, - }; - const pattern = flags.pattern || `${entry.name}@${entry.version}`; - reporter.log( - (0, (_lockfile || _load_lockfile()).stringify)({ - [pattern]: (0, (_lockfile || _load_lockfile()).implodeEntry)( - pattern, - entry - ), - }) - ); - }); + ); return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -125925,20 +125832,17 @@ threshold" let run = (exports.run = (() => { var _ref5 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const imp = new Import( - flags, - config, - reporter, - new (_lockfile || _load_lockfile()).default({ cache: {} }) - ); - yield imp.init(); - }); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const imp = new Import( + flags, + config, + reporter, + new (_lockfile || _load_lockfile()).default({ cache: {} }) + ); + yield imp.init(); + } + ); return function run(_x, _x2, _x3, _x4) { return _ref5.apply(this, arguments); @@ -126831,71 +126735,68 @@ threshold" let run = (exports.run = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - if (args.length > 2) { - reporter.error(reporter.lang("tooManyArguments", 2)); - return; - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + if (args.length > 2) { + reporter.error(reporter.lang("tooManyArguments", 2)); + return; + } - let packageName = args.shift() || "."; + let packageName = args.shift() || "."; - // Handle the case when we are referencing a local package. - if (packageName === ".") { - packageName = (yield config.readRootManifest()).name; - } + // Handle the case when we are referencing a local package. + if (packageName === ".") { + packageName = (yield config.readRootManifest()).name; + } - const packageInput = ( - _npmRegistry || _load_npmRegistry() - ).default.escapeName(packageName); + const packageInput = ( + _npmRegistry || _load_npmRegistry() + ).default.escapeName(packageName); - var _parsePackageName = (0, - (_parsePackageName2 || _load_parsePackageName()).default)( - packageInput - ); + var _parsePackageName = (0, + (_parsePackageName2 || _load_parsePackageName()).default)( + packageInput + ); - const name = _parsePackageName.name, - version = _parsePackageName.version; + const name = _parsePackageName.name, + version = _parsePackageName.version; - let result; - try { - result = yield config.registries.npm.request(name, { - unfiltered: true, - }); - } catch (e) { - reporter.error(reporter.lang("infoFail")); - return; - } - if (!result) { - reporter.error(reporter.lang("infoFail")); - return; - } + let result; + try { + result = yield config.registries.npm.request(name, { + unfiltered: true, + }); + } catch (e) { + reporter.error(reporter.lang("infoFail")); + return; + } + if (!result) { + reporter.error(reporter.lang("infoFail")); + return; + } - result = clean(result); + result = clean(result); - const versions = result.versions; - // $FlowFixMe - result.versions = Object.keys(versions).sort(semver.compareLoose); - result.version = version || result["dist-tags"].latest; - result = Object.assign(result, versions[result.version]); + const versions = result.versions; + // $FlowFixMe + result.versions = Object.keys(versions).sort(semver.compareLoose); + result.version = version || result["dist-tags"].latest; + result = Object.assign(result, versions[result.version]); - const fieldPath = args.shift(); - const fields = fieldPath ? fieldPath.split(".") : []; + const fieldPath = args.shift(); + const fields = fieldPath ? fieldPath.split(".") : []; - // Readmes can be long so exclude them unless explicitly asked for. - if (fields[0] !== "readme") { - delete result.readme; - } + // Readmes can be long so exclude them unless explicitly asked for. + if (fields[0] !== "readme") { + delete result.readme; + } - result = fields.reduce(function (prev, cur) { - return prev && prev[cur]; - }, result); - reporter.inspect(result); - }); + result = fields.reduce(function (prev, cur) { + return prev && prev[cur]; + }, result); + reporter.inspect(result); + } + ); return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -126987,269 +126888,270 @@ threshold" let run = (exports.run = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const manifests = yield config.getRootManifests(); - - let repository = {}; - const author = { - name: config.getOption("init-author-name"), - email: config.getOption("init-author-email"), - url: config.getOption("init-author-url"), - }; - if (yield (_fs || _load_fs()).exists(path.join(config.cwd, ".git"))) { - // get git origin of the cwd - try { - repository = { - type: "git", - url: yield (_child || _load_child()).spawn( - "git", - ["config", "remote.origin.url"], - { - cwd: config.cwd, - } - ), - }; - } catch (ex) { - // Ignore - Git repo may not have an origin URL yet (eg. if it only exists locally) - } - - if (author.name === undefined) { - author.name = yield getGitConfigInfo("user.name"); - } - - if (author.email === undefined) { - author.email = yield getGitConfigInfo("user.email"); - } - } - - const keys = [ - { - key: "name", - question: "name", - default: path.basename(config.cwd), - validation: (_validate || _load_validate()).isValidPackageName, - validationError: "invalidPackageName", - }, - { - key: "version", - question: "version", - default: String(config.getOption("init-version")), - }, - { - key: "description", - question: "description", - default: "", - }, - { - key: "main", - question: "entry point", - default: "index.js", - }, - { - key: "repository", - question: "repository url", - default: (0, (_util || _load_util()).extractRepositoryUrl)( - repository - ), - }, - { - key: "author", - question: "author", - default: (0, (_util || _load_util()).stringifyPerson)(author), - }, - { - key: "license", - question: "license", - default: String(config.getOption("init-license")), - }, - { - key: "private", - question: "private", - default: config.getOption("init-private") || "", - inputFormatter: yn, - }, - ]; - - // get answers - const pkg = {}; - for ( - var _iterator = keys, - _isArray = Array.isArray(_iterator), - _i = 0, - _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); - ; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const manifests = yield config.getRootManifests(); + + let repository = {}; + const author = { + name: config.getOption("init-author-name"), + email: config.getOption("init-author-email"), + url: config.getOption("init-author-url"), + }; + if ( + yield (_fs || _load_fs()).exists(path.join(config.cwd, ".git")) + ) { + // get git origin of the cwd + try { + repository = { + type: "git", + url: yield (_child || _load_child()).spawn( + "git", + ["config", "remote.origin.url"], + { + cwd: config.cwd, + } + ), + }; + } catch (ex) { + // Ignore - Git repo may not have an origin URL yet (eg. if it only exists locally) + } - ) { - var _ref2; + if (author.name === undefined) { + author.name = yield getGitConfigInfo("user.name"); + } - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; + if (author.email === undefined) { + author.email = yield getGitConfigInfo("user.email"); + } } - const entry = _ref2; - const yes = flags.yes, - privateFlag = flags.private; - const manifestKey = entry.key; - let question = entry.question, - def = entry.default; + const keys = [ + { + key: "name", + question: "name", + default: path.basename(config.cwd), + validation: (_validate || _load_validate()).isValidPackageName, + validationError: "invalidPackageName", + }, + { + key: "version", + question: "version", + default: String(config.getOption("init-version")), + }, + { + key: "description", + question: "description", + default: "", + }, + { + key: "main", + question: "entry point", + default: "index.js", + }, + { + key: "repository", + question: "repository url", + default: (0, (_util || _load_util()).extractRepositoryUrl)( + repository + ), + }, + { + key: "author", + question: "author", + default: (0, (_util || _load_util()).stringifyPerson)(author), + }, + { + key: "license", + question: "license", + default: String(config.getOption("init-license")), + }, + { + key: "private", + question: "private", + default: config.getOption("init-private") || "", + inputFormatter: yn, + }, + ]; + // get answers + const pkg = {}; for ( - var _iterator4 = (_index || _load_index()).registryNames, - _isArray4 = Array.isArray(_iterator4), - _i4 = 0, - _iterator4 = _isArray4 - ? _iterator4 - : _iterator4[Symbol.iterator](); + var _iterator = keys, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) { - var _ref5; + var _ref2; - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref5 = _iterator4[_i4++]; + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref5 = _i4.value; + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; } - const registryName = _ref5; - const object = manifests[registryName].object; + const entry = _ref2; + const yes = flags.yes, + privateFlag = flags.private; + const manifestKey = entry.key; + let question = entry.question, + def = entry.default; - let val = objectPath.get(object, manifestKey); - if (!val) { - break; - } - if (typeof val === "object") { - if (manifestKey === "author") { - val = (0, (_util || _load_util()).stringifyPerson)(val); - } else if (manifestKey === "repository") { - val = (0, (_util || _load_util()).extractRepositoryUrl)(val); + for ( + var _iterator4 = (_index || _load_index()).registryNames, + _isArray4 = Array.isArray(_iterator4), + _i4 = 0, + _iterator4 = _isArray4 + ? _iterator4 + : _iterator4[Symbol.iterator](); + ; + + ) { + var _ref5; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref5 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref5 = _i4.value; + } + + const registryName = _ref5; + const object = manifests[registryName].object; + + let val = objectPath.get(object, manifestKey); + if (!val) { + break; + } + if (typeof val === "object") { + if (manifestKey === "author") { + val = (0, (_util || _load_util()).stringifyPerson)(val); + } else if (manifestKey === "repository") { + val = (0, (_util || _load_util()).extractRepositoryUrl)( + val + ); + } } + def = val; } - def = val; - } - if (manifestKey === "private" && privateFlag) { - def = true; - } + if (manifestKey === "private" && privateFlag) { + def = true; + } - if (def) { - question += ` (${String(def)})`; - } + if (def) { + question += ` (${String(def)})`; + } - let answer; - let validAnswer = false; + let answer; + let validAnswer = false; - if (yes) { - answer = def; - } else { - // loop until a valid answer is provided, if validation is on entry - if (entry.validation) { - while (!validAnswer) { - answer = (yield reporter.question(question)) || def; - // validate answer - if (entry.validation(String(answer))) { - validAnswer = true; - } else { - reporter.error(reporter.lang("invalidPackageName")); + if (yes) { + answer = def; + } else { + // loop until a valid answer is provided, if validation is on entry + if (entry.validation) { + while (!validAnswer) { + answer = (yield reporter.question(question)) || def; + // validate answer + if (entry.validation(String(answer))) { + validAnswer = true; + } else { + reporter.error(reporter.lang("invalidPackageName")); + } } + } else { + answer = (yield reporter.question(question)) || def; } - } else { - answer = (yield reporter.question(question)) || def; } - } - if (answer) { - if (entry.inputFormatter) { - answer = entry.inputFormatter(answer); + if (answer) { + if (entry.inputFormatter) { + answer = entry.inputFormatter(answer); + } + objectPath.set(pkg, manifestKey, answer); } - objectPath.set(pkg, manifestKey, answer); } - } - if ( - pkg.repository && - (_githubResolver || _load_githubResolver()).default.isVersion( - pkg.repository - ) - ) { - pkg.repository = `https://github.com/${pkg.repository}`; - } + if ( + pkg.repository && + (_githubResolver || _load_githubResolver()).default.isVersion( + pkg.repository + ) + ) { + pkg.repository = `https://github.com/${pkg.repository}`; + } - // save answers - const targetManifests = []; - for ( - var _iterator2 = (_index || _load_index()).registryNames, - _isArray2 = Array.isArray(_iterator2), - _i2 = 0, - _iterator2 = _isArray2 - ? _iterator2 - : _iterator2[Symbol.iterator](); - ; + // save answers + const targetManifests = []; + for ( + var _iterator2 = (_index || _load_index()).registryNames, + _isArray2 = Array.isArray(_iterator2), + _i2 = 0, + _iterator2 = _isArray2 + ? _iterator2 + : _iterator2[Symbol.iterator](); + ; - ) { - var _ref3; + ) { + var _ref3; - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref3 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref3 = _i2.value; - } + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } - const registryName = _ref3; + const registryName = _ref3; - const info = manifests[registryName]; - if (info.exists) { - targetManifests.push(info); + const info = manifests[registryName]; + if (info.exists) { + targetManifests.push(info); + } } - } - if (!targetManifests.length) { - targetManifests.push(manifests.npm); - } - for ( - var _iterator3 = targetManifests, - _isArray3 = Array.isArray(_iterator3), - _i3 = 0, - _iterator3 = _isArray3 - ? _iterator3 - : _iterator3[Symbol.iterator](); - ; + if (!targetManifests.length) { + targetManifests.push(manifests.npm); + } + for ( + var _iterator3 = targetManifests, + _isArray3 = Array.isArray(_iterator3), + _i3 = 0, + _iterator3 = _isArray3 + ? _iterator3 + : _iterator3[Symbol.iterator](); + ; - ) { - var _ref4; + ) { + var _ref4; - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref4 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref4 = _i3.value; - } + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } - const targetManifest = _ref4; + const targetManifest = _ref4; - Object.assign(targetManifest.object, pkg); - reporter.success(`Saved ${path.basename(targetManifest.loc)}`); - } + Object.assign(targetManifest.object, pkg); + reporter.success(`Saved ${path.basename(targetManifest.loc)}`); + } - yield config.saveRootManifests(manifests); - }); + yield config.saveRootManifests(manifests); + } + ); return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -127384,51 +127286,50 @@ threshold" let getManifests = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - flags - ) { - const lockfile = yield ( - _lockfile || _load_lockfile() - ).default.fromDirectory(config.cwd); - const install = new (_install || _load_install()).Install( - (0, (_extends2 || _load_extends()).default)( - { skipIntegrityCheck: true }, - flags - ), - config, - new (_baseReporter || _load_baseReporter()).default(), - lockfile - ); - yield install.hydrate(true); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, flags) { + const lockfile = yield ( + _lockfile || _load_lockfile() + ).default.fromDirectory(config.cwd); + const install = new (_install || _load_install()).Install( + (0, (_extends2 || _load_extends()).default)( + { skipIntegrityCheck: true }, + flags + ), + config, + new (_baseReporter || _load_baseReporter()).default(), + lockfile + ); + yield install.hydrate(true); - let manifests = install.resolver.getManifests(); + let manifests = install.resolver.getManifests(); - // sort by name - manifests = manifests.sort(function (a, b) { - if (!a.name && !b.name) { - return 0; - } + // sort by name + manifests = manifests.sort(function (a, b) { + if (!a.name && !b.name) { + return 0; + } - if (!a.name) { - return 1; - } + if (!a.name) { + return 1; + } - if (!b.name) { - return -1; - } + if (!b.name) { + return -1; + } - return a.name.localeCompare(b.name); - }); + return a.name.localeCompare(b.name); + }); - // filter ignored manifests - manifests = manifests.filter(function (manifest) { - const ref = manifest._reference; - return !!ref && !ref.ignore; - }); + // filter ignored manifests + manifests = manifests.filter(function (manifest) { + const ref = manifest._reference; + return !!ref && !ref.ignore; + }); - return manifests; - }); + return manifests; + } + ); return function getManifests(_x, _x2) { return _ref.apply(this, arguments); @@ -127437,138 +127338,144 @@ threshold" let list = (() => { var _ref2 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const manifests = yield getManifests(config, flags); - const manifestsByLicense = new Map(); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const manifests = yield getManifests(config, flags); + const manifestsByLicense = new Map(); - for ( - var _iterator = manifests, - _isArray = Array.isArray(_iterator), - _i = 0, - _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); - ; - - ) { - var _ref4; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref4 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref4 = _i.value; - } + for ( + var _iterator = manifests, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); + ; - const _ref3 = _ref4; - const name = _ref3.name, - version = _ref3.version, - license = _ref3.license, - repository = _ref3.repository, - homepage = _ref3.homepage, - author = _ref3.author; + ) { + var _ref4; - const licenseKey = license || "UNKNOWN"; - const url = repository ? repository.url : homepage; - const vendorUrl = homepage || (author && author.url); - const vendorName = author && author.name; + if (_isArray) { + if (_i >= _iterator.length) break; + _ref4 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref4 = _i.value; + } - if (!manifestsByLicense.has(licenseKey)) { - manifestsByLicense.set(licenseKey, new Map()); - } + const _ref3 = _ref4; + const name = _ref3.name, + version = _ref3.version, + license = _ref3.license, + repository = _ref3.repository, + homepage = _ref3.homepage, + author = _ref3.author; - const byLicense = manifestsByLicense.get(licenseKey); - invariant(byLicense, "expected value"); - byLicense.set(`${name}@${version}`, { - name, - version, - url, - vendorUrl, - vendorName, - }); - } + const licenseKey = license || "UNKNOWN"; + const url = repository ? repository.url : homepage; + const vendorUrl = homepage || (author && author.url); + const vendorName = author && author.name; - if (flags.json) { - const body = []; + if (!manifestsByLicense.has(licenseKey)) { + manifestsByLicense.set(licenseKey, new Map()); + } - manifestsByLicense.forEach(function (license, licenseKey) { - license.forEach(function ({ + const byLicense = manifestsByLicense.get(licenseKey); + invariant(byLicense, "expected value"); + byLicense.set(`${name}@${version}`, { name, version, url, vendorUrl, vendorName, - }) { - body.push([ + }); + } + + if (flags.json) { + const body = []; + + manifestsByLicense.forEach(function (license, licenseKey) { + license.forEach(function ({ name, version, - licenseKey, - url || "Unknown", - vendorUrl || "Unknown", - vendorName || "Unknown", - ]); + url, + vendorUrl, + vendorName, + }) { + body.push([ + name, + version, + licenseKey, + url || "Unknown", + vendorUrl || "Unknown", + vendorName || "Unknown", + ]); + }); }); - }); - reporter.table( - ["Name", "Version", "License", "URL", "VendorUrl", "VendorName"], - body - ); - } else { - const trees = []; + reporter.table( + [ + "Name", + "Version", + "License", + "URL", + "VendorUrl", + "VendorName", + ], + body + ); + } else { + const trees = []; - manifestsByLicense.forEach(function (license, licenseKey) { - const licenseTree = []; + manifestsByLicense.forEach(function (license, licenseKey) { + const licenseTree = []; - license.forEach(function ({ - name, - version, - url, - vendorUrl, - vendorName, - }) { - const children = []; + license.forEach(function ({ + name, + version, + url, + vendorUrl, + vendorName, + }) { + const children = []; + + if (url) { + children.push({ + name: `${reporter.format.bold("URL:")} ${url}`, + }); + } - if (url) { - children.push({ - name: `${reporter.format.bold("URL:")} ${url}`, - }); - } + if (vendorUrl) { + children.push({ + name: `${reporter.format.bold( + "VendorUrl:" + )} ${vendorUrl}`, + }); + } - if (vendorUrl) { - children.push({ - name: `${reporter.format.bold("VendorUrl:")} ${vendorUrl}`, - }); - } + if (vendorName) { + children.push({ + name: `${reporter.format.bold( + "VendorName:" + )} ${vendorName}`, + }); + } - if (vendorName) { - children.push({ - name: `${reporter.format.bold( - "VendorName:" - )} ${vendorName}`, + licenseTree.push({ + name: `${name}@${version}`, + children, }); - } - - licenseTree.push({ - name: `${name}@${version}`, - children, }); - }); - trees.push({ - name: licenseKey, - children: licenseTree, + trees.push({ + name: licenseKey, + children: licenseTree, + }); }); - }); - reporter.tree("licenses", trees, { force: true }); + reporter.tree("licenses", trees, { force: true }); + } } - }); + ); return function list(_x3, _x4, _x5, _x6) { return _ref2.apply(this, arguments); @@ -127834,19 +127741,16 @@ threshold" let run = (exports.run = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - yield config.registries.yarn.saveHomeConfig({ - username: undefined, - email: undefined, - }); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + yield config.registries.yarn.saveHomeConfig({ + username: undefined, + email: undefined, + }); - reporter.success(reporter.lang("clearedCredentials")); - }); + reporter.success(reporter.lang("clearedCredentials")); + } + ); return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -127895,39 +127799,36 @@ threshold" let run = (exports.run = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const pnpPath = `${config.lockfileFolder}/${ - (_constants || _load_constants()).PNP_FILENAME - }`; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const pnpPath = `${config.lockfileFolder}/${ + (_constants || _load_constants()).PNP_FILENAME + }`; - let nodeOptions = process.env.NODE_OPTIONS || ""; - if (yield (_fs || _load_fs()).exists(pnpPath)) { - nodeOptions = `--require ${pnpPath} ${nodeOptions}`; - } + let nodeOptions = process.env.NODE_OPTIONS || ""; + if (yield (_fs || _load_fs()).exists(pnpPath)) { + nodeOptions = `--require ${pnpPath} ${nodeOptions}`; + } - try { - yield (_child || _load_child()).spawn( - (_constants || _load_constants()).NODE_BIN_PATH, - args, - { - stdio: "inherit", - cwd: flags.into || config.cwd, - env: (0, (_extends2 || _load_extends()).default)( - {}, - process.env, - { NODE_OPTIONS: nodeOptions } - ), - } - ); - } catch (err) { - throw err; + try { + yield (_child || _load_child()).spawn( + (_constants || _load_constants()).NODE_BIN_PATH, + args, + { + stdio: "inherit", + cwd: flags.into || config.cwd, + env: (0, (_extends2 || _load_extends()).default)( + {}, + process.env, + { NODE_OPTIONS: nodeOptions } + ), + } + ); + } catch (err) { + throw err; + } } - }); + ); return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -128017,98 +127918,100 @@ threshold" let run = (exports.run = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const lockfile = yield ( - _lockfile || _load_lockfile() - ).default.fromDirectory(config.lockfileFolder); - const install = new (_install || _load_install()).Install( - (0, (_extends2 || _load_extends()).default)({}, flags, { - includeWorkspaceDeps: true, - }), - config, - reporter, - lockfile - ); - let deps = yield ( - _packageRequest || _load_packageRequest() - ).default.getOutdatedPackages(lockfile, install, config, reporter); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const lockfile = yield ( + _lockfile || _load_lockfile() + ).default.fromDirectory(config.lockfileFolder); + const install = new (_install || _load_install()).Install( + (0, (_extends2 || _load_extends()).default)({}, flags, { + includeWorkspaceDeps: true, + }), + config, + reporter, + lockfile + ); + let deps = yield ( + _packageRequest || _load_packageRequest() + ).default.getOutdatedPackages(lockfile, install, config, reporter); - if (args.length) { - const requested = new Set(args); + if (args.length) { + const requested = new Set(args); - deps = deps.filter(function ({ name }) { - return requested.has(name); - }); - } + deps = deps.filter(function ({ name }) { + return requested.has(name); + }); + } - const getNameFromHint = function getNameFromHint(hint) { - return hint ? `${hint}Dependencies` : "dependencies"; - }; - const colorizeName = function colorizeName({ - current, - latest, - name, - }) { - return reporter.format[ - (0, (_colorForVersions || _load_colorForVersions()).default)( - current, - latest - ) - ](name); - }; + const getNameFromHint = function getNameFromHint(hint) { + return hint ? `${hint}Dependencies` : "dependencies"; + }; + const colorizeName = function colorizeName({ + current, + latest, + name, + }) { + return reporter.format[ + (0, (_colorForVersions || _load_colorForVersions()).default)( + current, + latest + ) + ](name); + }; - if (deps.length) { - const usesWorkspaces = !!config.workspaceRootFolder; - const body = deps.map(function (info) { - const row = [ - colorizeName(info), - info.current, - (0, (_colorizeDiff || _load_colorizeDiff()).default)( + if (deps.length) { + const usesWorkspaces = !!config.workspaceRootFolder; + const body = deps.map(function (info) { + const row = [ + colorizeName(info), info.current, - info.wanted, - reporter - ), - reporter.format.cyan(info.latest), - info.workspaceName || "", - getNameFromHint(info.hint), - reporter.format.cyan(info.url), + (0, (_colorizeDiff || _load_colorizeDiff()).default)( + info.current, + info.wanted, + reporter + ), + reporter.format.cyan(info.latest), + info.workspaceName || "", + getNameFromHint(info.hint), + reporter.format.cyan(info.url), + ]; + if (!usesWorkspaces) { + row.splice(4, 1); + } + return row; + }); + + const red = reporter.format.red(""); + const yellow = reporter.format.yellow(""); + const green = reporter.format.green(""); + reporter.info( + reporter.lang( + "legendColorsForVersionUpdates", + red, + yellow, + green + ) + ); + + const header = [ + "Package", + "Current", + "Wanted", + "Latest", + "Workspace", + "Package Type", + "URL", ]; if (!usesWorkspaces) { - row.splice(4, 1); + header.splice(4, 1); } - return row; - }); + reporter.table(header, body); - const red = reporter.format.red(""); - const yellow = reporter.format.yellow(""); - const green = reporter.format.green(""); - reporter.info( - reporter.lang("legendColorsForVersionUpdates", red, yellow, green) - ); - - const header = [ - "Package", - "Current", - "Wanted", - "Latest", - "Workspace", - "Package Type", - "URL", - ]; - if (!usesWorkspaces) { - header.splice(4, 1); + return 1; } - reporter.table(header, body); - - return 1; + return 0; } - return 0; - }); + ); return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -128194,88 +128097,86 @@ threshold" let mutate = (exports.mutate = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - args, - config, - reporter, - buildMessages, - mutator - ) { - if (args.length !== 2 && args.length !== 1) { - return false; - } - - const username = args.shift(); - const name = yield (0, (_tag || _load_tag()).getName)(args, config); - if (!(0, (_validate || _load_validate()).isValidPackageName)(name)) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("invalidPackageName") - ); - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (args, config, reporter, buildMessages, mutator) { + if (args.length !== 2 && args.length !== 1) { + return false; + } - const msgs = buildMessages(username, name); - reporter.step(1, 3, reporter.lang("loggingIn")); - const revoke = yield (0, (_login || _load_login()).getToken)( - config, - reporter, - name - ); + const username = args.shift(); + const name = yield (0, (_tag || _load_tag()).getName)(args, config); + if ( + !(0, (_validate || _load_validate()).isValidPackageName)(name) + ) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("invalidPackageName") + ); + } - reporter.step(2, 3, msgs.info); - const user = yield config.registries.npm.request( - `-/user/org.couchdb.user:${username}` - ); - let error = false; - if (user) { - // get package - const pkg = yield config.registries.npm.request( - (_npmRegistry || _load_npmRegistry()).default.escapeName(name) + const msgs = buildMessages(username, name); + reporter.step(1, 3, reporter.lang("loggingIn")); + const revoke = yield (0, (_login || _load_login()).getToken)( + config, + reporter, + name ); - if (pkg) { - pkg.maintainers = pkg.maintainers || []; - error = mutator({ name: user.name, email: user.email }, pkg); - } else { - error = true; - reporter.error(reporter.lang("unknownPackage", name)); - } - // update package - if (pkg && !error) { - const res = yield config.registries.npm.request( - `${(_npmRegistry || _load_npmRegistry()).default.escapeName( - name - )}/-rev/${pkg._rev}`, - { - method: "PUT", - body: { - _id: pkg._id, - _rev: pkg._rev, - maintainers: pkg.maintainers, - }, - } + reporter.step(2, 3, msgs.info); + const user = yield config.registries.npm.request( + `-/user/org.couchdb.user:${username}` + ); + let error = false; + if (user) { + // get package + const pkg = yield config.registries.npm.request( + (_npmRegistry || _load_npmRegistry()).default.escapeName(name) ); - - if (res != null && res.success) { - reporter.success(msgs.success); + if (pkg) { + pkg.maintainers = pkg.maintainers || []; + error = mutator({ name: user.name, email: user.email }, pkg); } else { error = true; - reporter.error(msgs.error); + reporter.error(reporter.lang("unknownPackage", name)); + } + + // update package + if (pkg && !error) { + const res = yield config.registries.npm.request( + `${(_npmRegistry || _load_npmRegistry()).default.escapeName( + name + )}/-rev/${pkg._rev}`, + { + method: "PUT", + body: { + _id: pkg._id, + _rev: pkg._rev, + maintainers: pkg.maintainers, + }, + } + ); + + if (res != null && res.success) { + reporter.success(msgs.success); + } else { + error = true; + reporter.error(msgs.error); + } } + } else { + error = true; + reporter.error(reporter.lang("unknownUser", username)); } - } else { - error = true; - reporter.error(reporter.lang("unknownUser", username)); - } - reporter.step(3, 3, reporter.lang("revokingToken")); - yield revoke(); + reporter.step(3, 3, reporter.lang("revokingToken")); + yield revoke(); - if (error) { - throw new Error(); - } else { - return true; + if (error) { + throw new Error(); + } else { + return true; + } } - }); + ); return function mutate(_x, _x2, _x3, _x4, _x5) { return _ref.apply(this, arguments); @@ -128284,61 +128185,58 @@ threshold" let list = (() => { var _ref2 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - if (args.length > 1) { - return false; - } - const name = yield (0, (_tag || _load_tag()).getName)(args, config); - reporter.step(1, 1, reporter.lang("ownerGetting", name)); - const pkg = yield config.registries.npm.request(name, { - unfiltered: true, - }); - if (pkg) { - const owners = pkg.maintainers; - if (!owners || !owners.length) { - reporter.warn(reporter.lang("ownerNone")); - } else { - for ( - var _iterator = owners, - _isArray = Array.isArray(_iterator), - _i = 0, - _iterator = _isArray - ? _iterator - : _iterator[Symbol.iterator](); - ; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + if (args.length > 1) { + return false; + } + const name = yield (0, (_tag || _load_tag()).getName)(args, config); + reporter.step(1, 1, reporter.lang("ownerGetting", name)); + const pkg = yield config.registries.npm.request(name, { + unfiltered: true, + }); + if (pkg) { + const owners = pkg.maintainers; + if (!owners || !owners.length) { + reporter.warn(reporter.lang("ownerNone")); + } else { + for ( + var _iterator = owners, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray + ? _iterator + : _iterator[Symbol.iterator](); + ; - ) { - var _ref3; + ) { + var _ref3; - if (_isArray) { - if (_i >= _iterator.length) break; - _ref3 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref3 = _i.value; - } + if (_isArray) { + if (_i >= _iterator.length) break; + _ref3 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref3 = _i.value; + } - const owner = _ref3; + const owner = _ref3; - reporter.info(`${owner.name} <${owner.email}>`); + reporter.info(`${owner.name} <${owner.email}>`); + } } + } else { + reporter.error(reporter.lang("ownerGettingFailed")); } - } else { - reporter.error(reporter.lang("ownerGettingFailed")); - } - if (pkg) { - return true; - } else { - throw new Error(); + if (pkg) { + return true; + } else { + throw new Error(); + } } - }); + ); return function list(_x6, _x7, _x8, _x9) { return _ref2.apply(this, arguments); @@ -128755,125 +128653,127 @@ threshold" let publish = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - pkg, - flags, - dir - ) { - let access = flags.access; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, pkg, flags, dir) { + let access = flags.access; - // if no access level is provided, check package.json for `publishConfig.access` - // see: https://docs.npmjs.com/files/package.json#publishconfig - if (!access && pkg && pkg.publishConfig && pkg.publishConfig.access) { - access = pkg.publishConfig.access; - } + // if no access level is provided, check package.json for `publishConfig.access` + // see: https://docs.npmjs.com/files/package.json#publishconfig + if ( + !access && + pkg && + pkg.publishConfig && + pkg.publishConfig.access + ) { + access = pkg.publishConfig.access; + } - // validate access argument - if (access && access !== "public" && access !== "restricted") { - throw new (_errors || _load_errors()).MessageError( - config.reporter.lang("invalidAccess") - ); - } + // validate access argument + if (access && access !== "public" && access !== "restricted") { + throw new (_errors || _load_errors()).MessageError( + config.reporter.lang("invalidAccess") + ); + } - // TODO this might modify package.json, do we need to reload it? - yield config.executeLifecycleScript("prepublish"); - yield config.executeLifecycleScript("prepare"); - yield config.executeLifecycleScript("prepublishOnly"); - yield config.executeLifecycleScript("prepack"); + // TODO this might modify package.json, do we need to reload it? + yield config.executeLifecycleScript("prepublish"); + yield config.executeLifecycleScript("prepare"); + yield config.executeLifecycleScript("prepublishOnly"); + yield config.executeLifecycleScript("prepack"); - // get tarball stream - const stat = yield (_fs || _load_fs()).lstat(dir); - let stream; - if (stat.isDirectory()) { - stream = yield (0, (_pack || _load_pack()).pack)(config); - } else if (stat.isFile()) { - stream = fs2.createReadStream(dir); - } else { - throw new Error("Don't know how to handle this file type"); - } - const buffer = yield new Promise(function (resolve, reject) { - const data = []; - invariant(stream, "expected stream"); - stream - .on("data", data.push.bind(data)) - .on("end", function () { - return resolve(Buffer.concat(data)); - }) - .on("error", reject); - }); + // get tarball stream + const stat = yield (_fs || _load_fs()).lstat(dir); + let stream; + if (stat.isDirectory()) { + stream = yield (0, (_pack || _load_pack()).pack)(config); + } else if (stat.isFile()) { + stream = fs2.createReadStream(dir); + } else { + throw new Error("Don't know how to handle this file type"); + } + const buffer = yield new Promise(function (resolve, reject) { + const data = []; + invariant(stream, "expected stream"); + stream + .on("data", data.push.bind(data)) + .on("end", function () { + return resolve(Buffer.concat(data)); + }) + .on("error", reject); + }); - yield config.executeLifecycleScript("postpack"); + yield config.executeLifecycleScript("postpack"); - // copy normalized package and remove internal keys as they may be sensitive or yarn specific - pkg = Object.assign({}, pkg); - for (const key in pkg) { - if (key[0] === "_") { - delete pkg[key]; + // copy normalized package and remove internal keys as they may be sensitive or yarn specific + pkg = Object.assign({}, pkg); + for (const key in pkg) { + if (key[0] === "_") { + delete pkg[key]; + } } - } - const tag = flags.tag || "latest"; - const tbName = `${pkg.name}-${pkg.version}.tgz`; - const tbURI = `${pkg.name}/-/${tbName}`; + const tag = flags.tag || "latest"; + const tbName = `${pkg.name}-${pkg.version}.tgz`; + const tbURI = `${pkg.name}/-/${tbName}`; - // create body - const root = { - _id: pkg.name, - access, - name: pkg.name, - description: pkg.description, - "dist-tags": { - [tag]: pkg.version, - }, - versions: { - [pkg.version]: pkg, - }, - readme: pkg.readme || "", - _attachments: { - [tbName]: { - content_type: "application/octet-stream", - data: buffer.toString("base64"), - length: buffer.length, + // create body + const root = { + _id: pkg.name, + access, + name: pkg.name, + description: pkg.description, + "dist-tags": { + [tag]: pkg.version, }, - }, - }; + versions: { + [pkg.version]: pkg, + }, + readme: pkg.readme || "", + _attachments: { + [tbName]: { + content_type: "application/octet-stream", + data: buffer.toString("base64"), + length: buffer.length, + }, + }, + }; - pkg._id = `${pkg.name}@${pkg.version}`; - pkg.dist = pkg.dist || {}; - pkg.dist.shasum = crypto - .createHash("sha1") - .update(buffer) - .digest("hex"); - pkg.dist.integrity = ssri.fromData(buffer).toString(); + pkg._id = `${pkg.name}@${pkg.version}`; + pkg.dist = pkg.dist || {}; + pkg.dist.shasum = crypto + .createHash("sha1") + .update(buffer) + .digest("hex"); + pkg.dist.integrity = ssri.fromData(buffer).toString(); - const registry = String(config.getOption("registry")); - pkg.dist.tarball = url - .resolve(registry, tbURI) - .replace(/^https:\/\//, "http://"); + const registry = String(config.getOption("registry")); + pkg.dist.tarball = url + .resolve(registry, tbURI) + .replace(/^https:\/\//, "http://"); - // publish package - try { - yield config.registries.npm.request( - (_npmRegistry || _load_npmRegistry()).default.escapeName( - pkg.name - ), - { - registry: - pkg && pkg.publishConfig && pkg.publishConfig.registry, - method: "PUT", - body: root, - } - ); - } catch (error) { - throw new (_errors || _load_errors()).MessageError( - config.reporter.lang("publishFail", error.message) - ); - } + // publish package + try { + yield config.registries.npm.request( + (_npmRegistry || _load_npmRegistry()).default.escapeName( + pkg.name + ), + { + registry: + pkg && pkg.publishConfig && pkg.publishConfig.registry, + method: "PUT", + body: root, + } + ); + } catch (error) { + throw new (_errors || _load_errors()).MessageError( + config.reporter.lang("publishFail", error.message) + ); + } - yield config.executeLifecycleScript("publish"); - yield config.executeLifecycleScript("postpublish"); - }); + yield config.executeLifecycleScript("publish"); + yield config.executeLifecycleScript("postpublish"); + } + ); return function publish(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -128882,84 +128782,81 @@ threshold" let run = (exports.run = (() => { var _ref2 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - // validate arguments - const dir = args[0] - ? (_path || _load_path()).default.resolve(config.cwd, args[0]) - : config.cwd; - if (args.length > 1) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("tooManyArguments", 1) - ); - } - if (!(yield (_fs || _load_fs()).exists(dir))) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("unknownFolderOrTarball") - ); - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + // validate arguments + const dir = args[0] + ? (_path || _load_path()).default.resolve(config.cwd, args[0]) + : config.cwd; + if (args.length > 1) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("tooManyArguments", 1) + ); + } + if (!(yield (_fs || _load_fs()).exists(dir))) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("unknownFolderOrTarball") + ); + } - const stat = yield (_fs || _load_fs()).lstat(dir); - let publishPath = dir; - if (stat.isDirectory()) { - config.cwd = (_path || _load_path()).default.resolve(dir); - publishPath = config.cwd; - } + const stat = yield (_fs || _load_fs()).lstat(dir); + let publishPath = dir; + if (stat.isDirectory()) { + config.cwd = (_path || _load_path()).default.resolve(dir); + publishPath = config.cwd; + } - // validate package fields that are required for publishing - // $FlowFixMe - const pkg = yield config.readRootManifest(); - if (pkg.private) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("publishPrivate") - ); - } - if (!pkg.name) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("noName") - ); - } + // validate package fields that are required for publishing + // $FlowFixMe + const pkg = yield config.readRootManifest(); + if (pkg.private) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("publishPrivate") + ); + } + if (!pkg.name) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("noName") + ); + } - let registry = ""; + let registry = ""; - if (pkg && pkg.publishConfig && pkg.publishConfig.registry) { - registry = pkg.publishConfig.registry; - } + if (pkg && pkg.publishConfig && pkg.publishConfig.registry) { + registry = pkg.publishConfig.registry; + } - reporter.step(1, 4, reporter.lang("bumpingVersion")); - const commitVersion = yield (0, - (_version || _load_version()).setVersion)( - config, - reporter, - flags, - [], - false - ); + reporter.step(1, 4, reporter.lang("bumpingVersion")); + const commitVersion = yield (0, + (_version || _load_version()).setVersion)( + config, + reporter, + flags, + [], + false + ); - // - reporter.step(2, 4, reporter.lang("loggingIn")); - const revoke = yield (0, (_login || _load_login()).getToken)( - config, - reporter, - pkg.name, - flags, - registry - ); + // + reporter.step(2, 4, reporter.lang("loggingIn")); + const revoke = yield (0, (_login || _load_login()).getToken)( + config, + reporter, + pkg.name, + flags, + registry + ); - // - reporter.step(3, 4, reporter.lang("publishing")); - yield publish(config, pkg, flags, publishPath); - yield commitVersion(); - reporter.success(reporter.lang("published")); + // + reporter.step(3, 4, reporter.lang("publishing")); + yield publish(config, pkg, flags, publishPath); + yield commitVersion(); + reporter.success(reporter.lang("published")); - // - reporter.step(4, 4, reporter.lang("revokingToken")); - yield revoke(); - }); + // + reporter.step(4, 4, reporter.lang("revokingToken")); + yield revoke(); + } + ); return function run(_x5, _x6, _x7, _x8) { return _ref2.apply(this, arguments); @@ -129079,25 +128976,23 @@ threshold" let removeTeamUser = (() => { var _ref2 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - parts, - config, - reporter - ) { - reporter.step(2, 3, reporter.lang("teamRemovingUser")); - reporter.inspect( - yield config.registries.npm.request( - `team/${parts.scope}/${parts.team}/user`, - { - method: "DELETE", - body: { - user: parts.user, - }, - } - ) - ); - return true; - }); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (parts, config, reporter) { + reporter.step(2, 3, reporter.lang("teamRemovingUser")); + reporter.inspect( + yield config.registries.npm.request( + `team/${parts.scope}/${parts.team}/user`, + { + method: "DELETE", + body: { + user: parts.user, + }, + } + ) + ); + return true; + } + ); return function removeTeamUser(_x5, _x6, _x7) { return _ref2.apply(this, arguments); @@ -129106,28 +129001,26 @@ threshold" let list = (() => { var _ref3 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - parts, - config, - reporter - ) { - reporter.step(2, 3, reporter.lang("teamListing")); - const uriParams = "?format=cli"; - if (parts.team) { - reporter.inspect( - yield config.registries.npm.request( - `team/${parts.scope}/${parts.team}/user${uriParams}` - ) - ); - } else { - reporter.inspect( - yield config.registries.npm.request( - `org/${parts.scope}/team${uriParams}` - ) - ); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (parts, config, reporter) { + reporter.step(2, 3, reporter.lang("teamListing")); + const uriParams = "?format=cli"; + if (parts.team) { + reporter.inspect( + yield config.registries.npm.request( + `team/${parts.scope}/${parts.team}/user${uriParams}` + ) + ); + } else { + reporter.inspect( + yield config.registries.npm.request( + `org/${parts.scope}/team${uriParams}` + ) + ); + } + return true; } - return true; - }); + ); return function list(_x8, _x9, _x10) { return _ref3.apply(this, arguments); @@ -129190,40 +129083,37 @@ threshold" function wrapRequired(callback, requireTeam, deprecationInfo) { return (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - if (deprecationInfo) { - warnDeprecation(reporter, deprecationInfo); - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + if (deprecationInfo) { + warnDeprecation(reporter, deprecationInfo); + } - if (!args.length) { - return false; - } + if (!args.length) { + return false; + } - const parts = explodeScopeTeam(args[0], requireTeam, reporter); - if (!parts) { - return false; - } + const parts = explodeScopeTeam(args[0], requireTeam, reporter); + if (!parts) { + return false; + } - reporter.step(1, 3, reporter.lang("loggingIn")); - const revoke = yield (0, (_login || _load_login()).getToken)( - config, - reporter - ); + reporter.step(1, 3, reporter.lang("loggingIn")); + const revoke = yield (0, (_login || _load_login()).getToken)( + config, + reporter + ); - const res = yield callback(parts, config, reporter, flags, args); - if (!res) { - return res; - } + const res = yield callback(parts, config, reporter, flags, args); + if (!res) { + return res; + } - reporter.step(3, 3, reporter.lang("revokingToken")); - yield revoke(); - return true; - }); + reporter.step(3, 3, reporter.lang("revokingToken")); + yield revoke(); + return true; + } + ); return function (_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -129367,15 +129257,11 @@ threshold" } ), - remove: wrapRequiredUser(function ( - parts, - config, - reporter, - flags, - args - ) { - removeTeamUser(parts, config, reporter); - }), + remove: wrapRequiredUser( + function (parts, config, reporter, flags, args) { + removeTeamUser(parts, config, reporter); + } + ), ls: wrapRequiredTeam( function (parts, config, reporter, flags, args) { @@ -129396,8 +129282,7 @@ threshold" args ) { list(parts, config, reporter); - }, - false), + }, false), }, [ "create ", @@ -129436,92 +129321,91 @@ threshold" let run = (exports.run = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - if (args.length) { - for ( - var _iterator = args, - _isArray = Array.isArray(_iterator), - _i = 0, - _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); - ; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + if (args.length) { + for ( + var _iterator = args, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray + ? _iterator + : _iterator[Symbol.iterator](); + ; - ) { - var _ref2; + ) { + var _ref2; - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; - } + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } - const name = _ref2; + const name = _ref2; - const linkLoc = path.join(config.linkFolder, name); - if (yield (_fs || _load_fs()).exists(linkLoc)) { - yield (_fs || _load_fs()).unlink( - path.join( - yield (0, (_link || _load_link()).getRegistryFolder)( - config, + const linkLoc = path.join(config.linkFolder, name); + if (yield (_fs || _load_fs()).exists(linkLoc)) { + yield (_fs || _load_fs()).unlink( + path.join( + yield (0, (_link || _load_link()).getRegistryFolder)( + config, + name + ), name - ), - name - ) - ); - reporter.success(reporter.lang("linkDisusing", name)); - reporter.info(reporter.lang("linkDisusingMessage", name)); - } else { + ) + ); + reporter.success(reporter.lang("linkDisusing", name)); + reporter.info(reporter.lang("linkDisusingMessage", name)); + } else { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("linkMissing", name) + ); + } + } + } else { + // remove from registry + const manifest = yield config.readRootManifest(); + const name = manifest.name; + if (!name) { throw new (_errors || _load_errors()).MessageError( - reporter.lang("linkMissing", name) + reporter.lang("unknownPackageName") ); } - } - } else { - // remove from registry - const manifest = yield config.readRootManifest(); - const name = manifest.name; - if (!name) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("unknownPackageName") - ); - } - const linkLoc = path.join(config.linkFolder, name); - if (yield (_fs || _load_fs()).exists(linkLoc)) { - // If there is a `bin` defined in the package.json, - // link each bin to the global bin - if (manifest.bin) { - const globalBinFolder = yield (0, - (_global || _load_global()).getBinFolder)(config, flags); - for (const binName in manifest.bin) { - const binDestLoc = path.join(globalBinFolder, binName); - if (yield (_fs || _load_fs()).exists(binDestLoc)) { - yield (_fs || _load_fs()).unlink(binDestLoc); - if (process.platform === "win32") { - yield (_fs || _load_fs()).unlink(binDestLoc + ".cmd"); + const linkLoc = path.join(config.linkFolder, name); + if (yield (_fs || _load_fs()).exists(linkLoc)) { + // If there is a `bin` defined in the package.json, + // link each bin to the global bin + if (manifest.bin) { + const globalBinFolder = yield (0, + (_global || _load_global()).getBinFolder)(config, flags); + for (const binName in manifest.bin) { + const binDestLoc = path.join(globalBinFolder, binName); + if (yield (_fs || _load_fs()).exists(binDestLoc)) { + yield (_fs || _load_fs()).unlink(binDestLoc); + if (process.platform === "win32") { + yield (_fs || _load_fs()).unlink(binDestLoc + ".cmd"); + } } } } - } - yield (_fs || _load_fs()).unlink(linkLoc); + yield (_fs || _load_fs()).unlink(linkLoc); - reporter.success(reporter.lang("linkUnregistered", name)); - reporter.info(reporter.lang("linkUnregisteredMessage", name)); - } else { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("linkMissing", name) - ); + reporter.success(reporter.lang("linkUnregistered", name)); + reporter.info(reporter.lang("linkUnregisteredMessage", name)); + } else { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("linkMissing", name) + ); + } } } - }); + ); return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -129608,81 +129492,78 @@ threshold" let run = (exports.run = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - if (!config.plugnplayEnabled) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("unplugDisabled") - ); - } - if (!args.length && flags.clear) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("tooFewArguments", 1) - ); - } - if (args.length && flags.clearAll) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("noArguments") - ); - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + if (!config.plugnplayEnabled) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("unplugDisabled") + ); + } + if (!args.length && flags.clear) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("tooFewArguments", 1) + ); + } + if (args.length && flags.clearAll) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("noArguments") + ); + } - if (flags.clearAll) { - yield clearAll(config); - } else if (flags.clear) { - yield clearSome(config, new Set(args)); - } else if (args.length > 0) { - const lockfile = yield ( - _lockfile || _load_lockfile() - ).default.fromDirectory(config.lockfileFolder, reporter); - yield (0, (_install || _load_install()).wrapLifecycle)( - config, - flags, - (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)( - function* () { - const install = new (_install || _load_install()).Install( - flags, - config, - reporter, - lockfile - ); - install.linker.unplugged = args; - yield install.init(); - } - ) - ); - } + if (flags.clearAll) { + yield clearAll(config); + } else if (flags.clear) { + yield clearSome(config, new Set(args)); + } else if (args.length > 0) { + const lockfile = yield ( + _lockfile || _load_lockfile() + ).default.fromDirectory(config.lockfileFolder, reporter); + yield (0, (_install || _load_install()).wrapLifecycle)( + config, + flags, + (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* () { + const install = new (_install || _load_install()).Install( + flags, + config, + reporter, + lockfile + ); + install.linker.unplugged = args; + yield install.init(); + } + ) + ); + } - const unpluggedPackageFolders = - yield config.listUnpluggedPackageFolders(); + const unpluggedPackageFolders = + yield config.listUnpluggedPackageFolders(); - for ( - var _iterator = unpluggedPackageFolders.values(), - _isArray = Array.isArray(_iterator), - _i = 0, - _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); - ; + for ( + var _iterator = unpluggedPackageFolders.values(), + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); + ; - ) { - var _ref3; + ) { + var _ref3; - if (_isArray) { - if (_i >= _iterator.length) break; - _ref3 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref3 = _i.value; - } + if (_isArray) { + if (_i >= _iterator.length) break; + _ref3 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref3 = _i.value; + } - const target = _ref3; + const target = _ref3; - reporter.log(target, { force: true }); + reporter.log(target, { force: true }); + } } - }); + ); return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -129691,84 +129572,83 @@ threshold" let clearSome = (exports.clearSome = (() => { var _ref4 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - filters - ) { - const unpluggedPackageFolders = - yield config.listUnpluggedPackageFolders(); - const removeList = []; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, filters) { + const unpluggedPackageFolders = + yield config.listUnpluggedPackageFolders(); + const removeList = []; - for ( - var _iterator2 = unpluggedPackageFolders.entries(), - _isArray2 = Array.isArray(_iterator2), - _i2 = 0, - _iterator2 = _isArray2 - ? _iterator2 - : _iterator2[Symbol.iterator](); - ; + for ( + var _iterator2 = unpluggedPackageFolders.entries(), + _isArray2 = Array.isArray(_iterator2), + _i2 = 0, + _iterator2 = _isArray2 + ? _iterator2 + : _iterator2[Symbol.iterator](); + ; - ) { - var _ref6; + ) { + var _ref6; - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref6 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref6 = _i2.value; - } + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref6 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref6 = _i2.value; + } - const _ref5 = _ref6; - const unpluggedName = _ref5[0]; - const target = _ref5[1]; + const _ref5 = _ref6; + const unpluggedName = _ref5[0]; + const target = _ref5[1]; - var _ref8 = yield (_fs || _load_fs()).readJson( - path.join(target, "package.json") - ); + var _ref8 = yield (_fs || _load_fs()).readJson( + path.join(target, "package.json") + ); - const name = _ref8.name; + const name = _ref8.name; - const toBeRemoved = filters.has(name); + const toBeRemoved = filters.has(name); - if (toBeRemoved) { - removeList.push( - path.join(config.getUnpluggedPath(), unpluggedName) - ); + if (toBeRemoved) { + removeList.push( + path.join(config.getUnpluggedPath(), unpluggedName) + ); + } } - } - if (removeList.length === unpluggedPackageFolders.size) { - yield (_fs || _load_fs()).unlink(config.getUnpluggedPath()); - } else { - for ( - var _iterator3 = removeList, - _isArray3 = Array.isArray(_iterator3), - _i3 = 0, - _iterator3 = _isArray3 - ? _iterator3 - : _iterator3[Symbol.iterator](); - ; + if (removeList.length === unpluggedPackageFolders.size) { + yield (_fs || _load_fs()).unlink(config.getUnpluggedPath()); + } else { + for ( + var _iterator3 = removeList, + _isArray3 = Array.isArray(_iterator3), + _i3 = 0, + _iterator3 = _isArray3 + ? _iterator3 + : _iterator3[Symbol.iterator](); + ; - ) { - var _ref7; + ) { + var _ref7; - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref7 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref7 = _i3.value; - } + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref7 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref7 = _i3.value; + } - const unpluggedPackagePath = _ref7; + const unpluggedPackagePath = _ref7; - yield (_fs || _load_fs()).unlink(unpluggedPackagePath); + yield (_fs || _load_fs()).unlink(unpluggedPackagePath); + } } } - }); + ); return function clearSome(_x5, _x6) { return _ref4.apply(this, arguments); @@ -129777,11 +129657,11 @@ threshold" let clearAll = (exports.clearAll = (() => { var _ref9 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config - ) { - yield (_fs || _load_fs()).unlink(config.getUnpluggedPath()); - }); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config) { + yield (_fs || _load_fs()).unlink(config.getUnpluggedPath()); + } + ); return function clearAll(_x7) { return _ref9.apply(this, arguments); @@ -129871,25 +129751,22 @@ threshold" let run = (exports.run = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const versions = { - yarn: (_yarnVersion || _load_yarnVersion()).version, - }; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const versions = { + yarn: (_yarnVersion || _load_yarnVersion()).version, + }; - const pkg = yield config.maybeReadManifest(config.cwd); - if (pkg && pkg.name && pkg.version) { - versions[pkg.name] = pkg.version; - } + const pkg = yield config.maybeReadManifest(config.cwd); + if (pkg && pkg.name && pkg.version) { + versions[pkg.name] = pkg.version; + } - Object.assign(versions, process.versions); + Object.assign(versions, process.versions); - reporter.inspect(versions); - }); + reporter.inspect(versions); + } + ); return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -129940,42 +129817,41 @@ threshold" let cleanQuery = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - query - ) { - // if a location was passed then turn it into a hash query - if ( - path.isAbsolute(query) && - (yield (_fs || _load_fs()).exists(query)) - ) { - // absolute path - query = path.relative(config.cwd, query); - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, query) { + // if a location was passed then turn it into a hash query + if ( + path.isAbsolute(query) && + (yield (_fs || _load_fs()).exists(query)) + ) { + // absolute path + query = path.relative(config.cwd, query); + } - // remove references to node_modules with hashes - query = query.replace(/([\\/]|^)node_modules[\\/]/g, "#"); + // remove references to node_modules with hashes + query = query.replace(/([\\/]|^)node_modules[\\/]/g, "#"); - // remove trailing hashes - query = query.replace(/^#+/g, ""); + // remove trailing hashes + query = query.replace(/^#+/g, ""); - // remove trailing paths from each part of the query, skip second part of path for scoped packages - let queryParts = query.split("#"); - queryParts = queryParts.map(function (part) { - let parts = part.split(/[\\/]/g); + // remove trailing paths from each part of the query, skip second part of path for scoped packages + let queryParts = query.split("#"); + queryParts = queryParts.map(function (part) { + let parts = part.split(/[\\/]/g); - if (part[0] === "@") { - parts = parts.slice(0, 2); - } else { - parts = parts.slice(0, 1); - } + if (part[0] === "@") { + parts = parts.slice(0, 2); + } else { + parts = parts.slice(0, 1); + } - return parts.join("/"); - }); - query = queryParts.join("#"); + return parts.join("/"); + }); + query = queryParts.join("#"); - return query; - }); + return query; + } + ); return function cleanQuery(_x, _x2) { return _ref.apply(this, arguments); @@ -129984,28 +129860,28 @@ threshold" let getPackageSize = (() => { var _ref2 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - tuple - ) { - const loc = tuple[0]; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (tuple) { + const loc = tuple[0]; - const files = yield (_fs || _load_fs()).walk( - loc, - null, - new Set([ - (_constants || _load_constants()).METADATA_FILENAME, - (_constants || _load_constants()).TARBALL_FILENAME, - ]) - ); + const files = yield (_fs || _load_fs()).walk( + loc, + null, + new Set([ + (_constants || _load_constants()).METADATA_FILENAME, + (_constants || _load_constants()).TARBALL_FILENAME, + ]) + ); - const sizes = yield Promise.all( - files.map(function (walkFile) { - return (_fs || _load_fs()).getFileSizeOnDisk(walkFile.absolute); - }) - ); + const sizes = yield Promise.all( + files.map(function (walkFile) { + return (_fs || _load_fs()).getFileSizeOnDisk(walkFile.absolute); + }) + ); - return sum(sizes); - }); + return sum(sizes); + } + ); return function getPackageSize(_x3) { return _ref2.apply(this, arguments); @@ -130014,298 +129890,295 @@ threshold" let run = (exports.run = (() => { var _ref6 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - if (!args.length) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("missingWhyDependency") - ); - } - if (args.length > 1) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("tooManyArguments", 1) - ); - } + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + if (!args.length) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("missingWhyDependency") + ); + } + if (args.length > 1) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("tooManyArguments", 1) + ); + } - const query = yield cleanQuery(config, args[0]); + const query = yield cleanQuery(config, args[0]); - reporter.step( - 1, - 4, - reporter.lang("whyStart", args[0]), - emoji.get("thinking_face") - ); + reporter.step( + 1, + 4, + reporter.lang("whyStart", args[0]), + emoji.get("thinking_face") + ); - // init - reporter.step( - 2, - 4, - reporter.lang("whyInitGraph"), - emoji.get("truck") - ); - const lockfile = yield ( - _lockfile || _load_lockfile() - ).default.fromDirectory(config.lockfileFolder, reporter); - const install = new (_install || _load_install()).Install( - flags, - config, - reporter, - lockfile - ); + // init + reporter.step( + 2, + 4, + reporter.lang("whyInitGraph"), + emoji.get("truck") + ); + const lockfile = yield ( + _lockfile || _load_lockfile() + ).default.fromDirectory(config.lockfileFolder, reporter); + const install = new (_install || _load_install()).Install( + flags, + config, + reporter, + lockfile + ); - var _ref7 = yield install.fetchRequestFromCwd(); + var _ref7 = yield install.fetchRequestFromCwd(); - const depRequests = _ref7.requests, - patterns = _ref7.patterns, - workspaceLayout = _ref7.workspaceLayout; + const depRequests = _ref7.requests, + patterns = _ref7.patterns, + workspaceLayout = _ref7.workspaceLayout; - yield install.resolver.init(depRequests, { - isFlat: install.flags.flat, - isFrozen: install.flags.frozenLockfile, - workspaceLayout, - }); - const hoisted = yield install.linker.getFlatHoistedTree(patterns); + yield install.resolver.init(depRequests, { + isFlat: install.flags.flat, + isFrozen: install.flags.frozenLockfile, + workspaceLayout, + }); + const hoisted = yield install.linker.getFlatHoistedTree(patterns); - // finding - reporter.step(3, 4, reporter.lang("whyFinding"), emoji.get("mag")); + // finding + reporter.step(3, 4, reporter.lang("whyFinding"), emoji.get("mag")); - const matches = queryWhy(query, hoisted); + const matches = queryWhy(query, hoisted); - if (matches.length <= 0) { - reporter.error(reporter.lang("whyUnknownMatch")); - return; - } + if (matches.length <= 0) { + reporter.error(reporter.lang("whyUnknownMatch")); + return; + } - const processMatch = (() => { - var _ref8 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)( - function* (match) { - const matchInfo = match[1]; + const processMatch = (() => { + var _ref8 = (0, + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (match) { + const matchInfo = match[1]; - const matchRef = matchInfo.pkg._reference; - invariant(matchRef, "expected reference"); + const matchRef = matchInfo.pkg._reference; + invariant(matchRef, "expected reference"); - const distinctMatchPatterns = new Set(matchRef.patterns); - const reasons = []; + const distinctMatchPatterns = new Set(matchRef.patterns); + const reasons = []; - // reason: dependency of these modules - if (matchInfo.originalParentPath.length > 0) { - reasons.push({ - type: "whyDependedOn", - typeSimple: "whyDependedOnSimple", - value: toStandardPathString(matchInfo.originalParentPath), - }); - } + // reason: dependency of these modules + if (matchInfo.originalParentPath.length > 0) { + reasons.push({ + type: "whyDependedOn", + typeSimple: "whyDependedOnSimple", + value: toStandardPathString(matchInfo.originalParentPath), + }); + } - // reason: exists in manifest - let rootType; - for ( - var _iterator3 = distinctMatchPatterns, - _isArray3 = Array.isArray(_iterator3), - _i3 = 0, - _iterator3 = _isArray3 - ? _iterator3 - : _iterator3[Symbol.iterator](); - ; + // reason: exists in manifest + let rootType; + for ( + var _iterator3 = distinctMatchPatterns, + _isArray3 = Array.isArray(_iterator3), + _i3 = 0, + _iterator3 = _isArray3 + ? _iterator3 + : _iterator3[Symbol.iterator](); + ; - ) { - var _ref9; + ) { + var _ref9; - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref9 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref9 = _i3.value; - } + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref9 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref9 = _i3.value; + } - const pattern = _ref9; + const pattern = _ref9; - rootType = install.rootPatternsToOrigin[pattern]; - if (rootType) { - reasons.push({ - type: "whySpecified", - typeSimple: "whySpecifiedSimple", - value: rootType, - }); + rootType = install.rootPatternsToOrigin[pattern]; + if (rootType) { + reasons.push({ + type: "whySpecified", + typeSimple: "whySpecifiedSimple", + value: rootType, + }); + } } - } - // reason: this is hoisted from these modules - for ( - var _iterator4 = matchInfo.previousPaths, - _isArray4 = Array.isArray(_iterator4), - _i4 = 0, - _iterator4 = _isArray4 - ? _iterator4 - : _iterator4[Symbol.iterator](); - ; - - ) { - var _ref10; + // reason: this is hoisted from these modules + for ( + var _iterator4 = matchInfo.previousPaths, + _isArray4 = Array.isArray(_iterator4), + _i4 = 0, + _iterator4 = _isArray4 + ? _iterator4 + : _iterator4[Symbol.iterator](); + ; - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref10 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref10 = _i4.value; - } + ) { + var _ref10; - const path = _ref10; + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref10 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref10 = _i4.value; + } - reasons.push({ - type: "whyHoistedFrom", - typeSimple: "whyHoistedFromSimple", - value: toStandardPathString(path), - }); - } + const path = _ref10; - // package sizes - let packageSize = 0; - let directSizes = []; - let transitiveSizes = []; - try { - packageSize = yield getPackageSize(match); - } catch (e) {} + reasons.push({ + type: "whyHoistedFrom", + typeSimple: "whyHoistedFromSimple", + value: toStandardPathString(path), + }); + } - const dependencies = Array.from( - collect(hoisted, new Set(), match) - ); - const transitiveDependencies = Array.from( - collect(hoisted, new Set(), match, { recursive: true }) - ); + // package sizes + let packageSize = 0; + let directSizes = []; + let transitiveSizes = []; + try { + packageSize = yield getPackageSize(match); + } catch (e) {} - try { - directSizes = yield Promise.all( - dependencies.map(getPackageSize) + const dependencies = Array.from( + collect(hoisted, new Set(), match) ); - transitiveSizes = yield Promise.all( - transitiveDependencies.map(getPackageSize) + const transitiveDependencies = Array.from( + collect(hoisted, new Set(), match, { recursive: true }) ); - } catch (e) {} - - const transitiveKeys = new Set( - transitiveDependencies.map(function ([, info]) { - return info.key; - }) - ); - const sharedDependencies = getSharedDependencies( - hoisted, - transitiveKeys - ); - // prepare output: populate reporter - reporter.info( - reporter.lang( - "whyMatch", - `${matchInfo.key}@${matchInfo.pkg.version}` - ) - ); - // - // reason: hoisted/nohoist - if (matchInfo.isNohoist) { - reasons.push({ - type: "whyNotHoisted", - typeSimple: "whyNotHoistedSimple", - value: matchInfo.nohoistList, - }); - } else if (query === matchInfo.originalKey) { - reporter.info(reporter.lang("whyHoistedTo", matchInfo.key)); - } + try { + directSizes = yield Promise.all( + dependencies.map(getPackageSize) + ); + transitiveSizes = yield Promise.all( + transitiveDependencies.map(getPackageSize) + ); + } catch (e) {} - if (reasons.length === 1) { - reporter.info( - reporter.lang(reasons[0].typeSimple, reasons[0].value) - ); - } else if (reasons.length > 1) { - reporter.info(reporter.lang("whyReasons")); - reporter.list( - "reasons", - reasons.map(function (reason) { - return reporter.lang(reason.type, reason.value); + const transitiveKeys = new Set( + transitiveDependencies.map(function ([, info]) { + return info.key; }) ); - } else { - reporter.error(reporter.lang("whyWhoKnows")); - } - - if (packageSize) { - // stats: file size of this dependency without any dependencies - reporter.info( - reporter.lang("whyDiskSizeWithout", bytes(packageSize)) + const sharedDependencies = getSharedDependencies( + hoisted, + transitiveKeys ); - // stats: file size of this dependency including dependencies that aren't shared + // prepare output: populate reporter reporter.info( reporter.lang( - "whyDiskSizeUnique", - bytes(packageSize + sum(directSizes)) + "whyMatch", + `${matchInfo.key}@${matchInfo.pkg.version}` ) ); + // + // reason: hoisted/nohoist + if (matchInfo.isNohoist) { + reasons.push({ + type: "whyNotHoisted", + typeSimple: "whyNotHoistedSimple", + value: matchInfo.nohoistList, + }); + } else if (query === matchInfo.originalKey) { + reporter.info(reporter.lang("whyHoistedTo", matchInfo.key)); + } - // stats: file size of this dependency including dependencies - reporter.info( - reporter.lang( - "whyDiskSizeTransitive", - bytes(packageSize + sum(transitiveSizes)) - ) - ); + if (reasons.length === 1) { + reporter.info( + reporter.lang(reasons[0].typeSimple, reasons[0].value) + ); + } else if (reasons.length > 1) { + reporter.info(reporter.lang("whyReasons")); + reporter.list( + "reasons", + reasons.map(function (reason) { + return reporter.lang(reason.type, reason.value); + }) + ); + } else { + reporter.error(reporter.lang("whyWhoKnows")); + } - // stats: shared transitive dependencies - reporter.info( - reporter.lang( - "whySharedDependencies", - sharedDependencies.size - ) - ); + if (packageSize) { + // stats: file size of this dependency without any dependencies + reporter.info( + reporter.lang("whyDiskSizeWithout", bytes(packageSize)) + ); + + // stats: file size of this dependency including dependencies that aren't shared + reporter.info( + reporter.lang( + "whyDiskSizeUnique", + bytes(packageSize + sum(directSizes)) + ) + ); + + // stats: file size of this dependency including dependencies + reporter.info( + reporter.lang( + "whyDiskSizeTransitive", + bytes(packageSize + sum(transitiveSizes)) + ) + ); + + // stats: shared transitive dependencies + reporter.info( + reporter.lang( + "whySharedDependencies", + sharedDependencies.size + ) + ); + } } - } - ); + ); - return function processMatch(_x8) { - return _ref8.apply(this, arguments); - }; - })(); + return function processMatch(_x8) { + return _ref8.apply(this, arguments); + }; + })(); - reporter.step( - 4, - 4, - reporter.lang("whyCalculating"), - emoji.get("aerial_tramway") - ); - for ( - var _iterator5 = matches, - _isArray5 = Array.isArray(_iterator5), - _i5 = 0, - _iterator5 = _isArray5 - ? _iterator5 - : _iterator5[Symbol.iterator](); - ; + reporter.step( + 4, + 4, + reporter.lang("whyCalculating"), + emoji.get("aerial_tramway") + ); + for ( + var _iterator5 = matches, + _isArray5 = Array.isArray(_iterator5), + _i5 = 0, + _iterator5 = _isArray5 + ? _iterator5 + : _iterator5[Symbol.iterator](); + ; - ) { - var _ref11; + ) { + var _ref11; - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref11 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref11 = _i5.value; - } + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref11 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref11 = _i5.value; + } - const match = _ref11; + const match = _ref11; - yield processMatch(match); + yield processMatch(match); + } } - }); + ); return function run(_x4, _x5, _x6, _x7) { return _ref6.apply(this, arguments); @@ -130548,74 +130421,71 @@ threshold" let run = (exports.run = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const workspaceRootFolder = config.workspaceRootFolder; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const workspaceRootFolder = config.workspaceRootFolder; - if (!workspaceRootFolder) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("workspaceRootNotFound", config.cwd) - ); - } + if (!workspaceRootFolder) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("workspaceRootNotFound", config.cwd) + ); + } - if (flags.originalArgs < 1) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("workspaceMissingWorkspace") - ); - } + if (flags.originalArgs < 1) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("workspaceMissingWorkspace") + ); + } - if (flags.originalArgs < 2) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("workspaceMissingCommand") - ); - } + if (flags.originalArgs < 2) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("workspaceMissingCommand") + ); + } - const manifest = yield config.findManifest( - workspaceRootFolder, - false - ); - invariant( - manifest && manifest.workspaces, - 'We must find a manifest with a "workspaces" property' - ); + const manifest = yield config.findManifest( + workspaceRootFolder, + false + ); + invariant( + manifest && manifest.workspaces, + 'We must find a manifest with a "workspaces" property' + ); - const workspaces = yield config.resolveWorkspaces( - workspaceRootFolder, - manifest - ); + const workspaces = yield config.resolveWorkspaces( + workspaceRootFolder, + manifest + ); - var _ref2 = flags.originalArgs || []; + var _ref2 = flags.originalArgs || []; - const workspaceName = _ref2[0], - rest = _ref2.slice(1); + const workspaceName = _ref2[0], + rest = _ref2.slice(1); - if ( - !Object.prototype.hasOwnProperty.call(workspaces, workspaceName) - ) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("workspaceUnknownWorkspace", workspaceName) - ); - } + if ( + !Object.prototype.hasOwnProperty.call(workspaces, workspaceName) + ) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("workspaceUnknownWorkspace", workspaceName) + ); + } - const workspace = workspaces[workspaceName]; + const workspace = workspaces[workspaceName]; - try { - yield (_child || _load_child()).spawn( - (_constants || _load_constants()).NODE_BIN_PATH, - [(_constants || _load_constants()).YARN_BIN_PATH, ...rest], - { - stdio: "inherit", - cwd: workspace.loc, - } - ); - } catch (err) { - throw err; + try { + yield (_child || _load_child()).spawn( + (_constants || _load_constants()).NODE_BIN_PATH, + [(_constants || _load_constants()).YARN_BIN_PATH, ...rest], + { + stdio: "inherit", + cwd: workspace.loc, + } + ); + } catch (err) { + throw err; + } } - }); + ); return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -130697,151 +130567,150 @@ threshold" let info = (exports.info = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const workspaceRootFolder = config.workspaceRootFolder; - - if (!workspaceRootFolder) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("workspaceRootNotFound", config.cwd) - ); - } - - const manifest = yield config.findManifest( - workspaceRootFolder, - false - ); - invariant( - manifest && manifest.workspaces, - 'We must find a manifest with a "workspaces" property' - ); - - const workspaces = yield config.resolveWorkspaces( - workspaceRootFolder, - manifest - ); - - const publicData = {}; - - for ( - var _iterator = Object.keys(workspaces), - _isArray = Array.isArray(_iterator), - _i = 0, - _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); - ; - - ) { - var _ref2; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const workspaceRootFolder = config.workspaceRootFolder; - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; + if (!workspaceRootFolder) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("workspaceRootNotFound", config.cwd) + ); } - const workspaceName = _ref2; - var _workspaces$workspace = workspaces[workspaceName]; - const loc = _workspaces$workspace.loc, - manifest = _workspaces$workspace.manifest; + const manifest = yield config.findManifest( + workspaceRootFolder, + false + ); + invariant( + manifest && manifest.workspaces, + 'We must find a manifest with a "workspaces" property' + ); + + const workspaces = yield config.resolveWorkspaces( + workspaceRootFolder, + manifest + ); - const workspaceDependencies = new Set(); - const mismatchedWorkspaceDependencies = new Set(); + const publicData = {}; for ( - var _iterator2 = (_constants || _load_constants()) - .DEPENDENCY_TYPES, - _isArray2 = Array.isArray(_iterator2), - _i2 = 0, - _iterator2 = _isArray2 - ? _iterator2 - : _iterator2[Symbol.iterator](); + var _iterator = Object.keys(workspaces), + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) { - var _ref3; + var _ref2; - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref3 = _iterator2[_i2++]; + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref3 = _i2.value; + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; } - const dependencyType = _ref3; + const workspaceName = _ref2; + var _workspaces$workspace = workspaces[workspaceName]; + const loc = _workspaces$workspace.loc, + manifest = _workspaces$workspace.manifest; - if (dependencyType !== "peerDependencies") { - for ( - var _iterator3 = Object.keys(manifest[dependencyType] || {}), - _isArray3 = Array.isArray(_iterator3), - _i3 = 0, - _iterator3 = _isArray3 - ? _iterator3 - : _iterator3[Symbol.iterator](); - ; + const workspaceDependencies = new Set(); + const mismatchedWorkspaceDependencies = new Set(); - ) { - var _ref4; + for ( + var _iterator2 = (_constants || _load_constants()) + .DEPENDENCY_TYPES, + _isArray2 = Array.isArray(_iterator2), + _i2 = 0, + _iterator2 = _isArray2 + ? _iterator2 + : _iterator2[Symbol.iterator](); + ; - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref4 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref4 = _i3.value; - } + ) { + var _ref3; - const dependencyName = _ref4; + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + const dependencyType = _ref3; + + if (dependencyType !== "peerDependencies") { + for ( + var _iterator3 = Object.keys( + manifest[dependencyType] || {} + ), + _isArray3 = Array.isArray(_iterator3), + _i3 = 0, + _iterator3 = _isArray3 + ? _iterator3 + : _iterator3[Symbol.iterator](); + ; - if ( - Object.prototype.hasOwnProperty.call( - workspaces, - dependencyName - ) ) { - invariant( - manifest && manifest[dependencyType], - "The request should exist" - ); - const requestedRange = - manifest[dependencyType][dependencyName]; + var _ref4; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } + + const dependencyName = _ref4; + if ( - semver.satisfies( - workspaces[dependencyName].manifest.version, - requestedRange + Object.prototype.hasOwnProperty.call( + workspaces, + dependencyName ) ) { - workspaceDependencies.add(dependencyName); - } else { - mismatchedWorkspaceDependencies.add(dependencyName); + invariant( + manifest && manifest[dependencyType], + "The request should exist" + ); + const requestedRange = + manifest[dependencyType][dependencyName]; + if ( + semver.satisfies( + workspaces[dependencyName].manifest.version, + requestedRange + ) + ) { + workspaceDependencies.add(dependencyName); + } else { + mismatchedWorkspaceDependencies.add(dependencyName); + } } } } } + + publicData[workspaceName] = { + location: path + .relative(config.lockfileFolder, loc) + .replace(/\\/g, "/"), + workspaceDependencies: Array.from(workspaceDependencies), + mismatchedWorkspaceDependencies: Array.from( + mismatchedWorkspaceDependencies + ), + }; } - publicData[workspaceName] = { - location: path - .relative(config.lockfileFolder, loc) - .replace(/\\/g, "/"), - workspaceDependencies: Array.from(workspaceDependencies), - mismatchedWorkspaceDependencies: Array.from( - mismatchedWorkspaceDependencies - ), - }; + reporter.log(JSON.stringify(publicData, null, 2), { force: true }); } - - reporter.log(JSON.stringify(publicData, null, 2), { force: true }); - }); + ); return function info(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -130850,77 +130719,74 @@ threshold" let runScript = (exports.runScript = (() => { var _ref5 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - config, - reporter, - flags, - args - ) { - const workspaceRootFolder = config.workspaceRootFolder; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (config, reporter, flags, args) { + const workspaceRootFolder = config.workspaceRootFolder; - if (!workspaceRootFolder) { - throw new (_errors || _load_errors()).MessageError( - reporter.lang("workspaceRootNotFound", config.cwd) - ); - } + if (!workspaceRootFolder) { + throw new (_errors || _load_errors()).MessageError( + reporter.lang("workspaceRootNotFound", config.cwd) + ); + } - const manifest = yield config.findManifest( - workspaceRootFolder, - false - ); - invariant( - manifest && manifest.workspaces, - 'We must find a manifest with a "workspaces" property' - ); + const manifest = yield config.findManifest( + workspaceRootFolder, + false + ); + invariant( + manifest && manifest.workspaces, + 'We must find a manifest with a "workspaces" property' + ); - const workspaces = yield config.resolveWorkspaces( - workspaceRootFolder, - manifest - ); + const workspaces = yield config.resolveWorkspaces( + workspaceRootFolder, + manifest + ); - try { - var _ref6 = flags.originalArgs || []; + try { + var _ref6 = flags.originalArgs || []; - const _ = _ref6[0], - rest = _ref6.slice(1); + const _ = _ref6[0], + rest = _ref6.slice(1); - for ( - var _iterator4 = Object.keys(workspaces), - _isArray4 = Array.isArray(_iterator4), - _i4 = 0, - _iterator4 = _isArray4 - ? _iterator4 - : _iterator4[Symbol.iterator](); - ; + for ( + var _iterator4 = Object.keys(workspaces), + _isArray4 = Array.isArray(_iterator4), + _i4 = 0, + _iterator4 = _isArray4 + ? _iterator4 + : _iterator4[Symbol.iterator](); + ; - ) { - var _ref7; + ) { + var _ref7; - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref7 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref7 = _i4.value; - } + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref7 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref7 = _i4.value; + } - const workspaceName = _ref7; - const loc = workspaces[workspaceName].loc; + const workspaceName = _ref7; + const loc = workspaces[workspaceName].loc; - yield (_child || _load_child()).spawn( - (_constants2 || _load_constants2()).NODE_BIN_PATH, - [(_constants2 || _load_constants2()).YARN_BIN_PATH, ...rest], - { - stdio: "inherit", - cwd: loc, - } - ); + yield (_child || _load_child()).spawn( + (_constants2 || _load_constants2()).NODE_BIN_PATH, + [(_constants2 || _load_constants2()).YARN_BIN_PATH, ...rest], + { + stdio: "inherit", + cwd: loc, + } + ); + } + } catch (err) { + throw err; } - } catch (err) { - throw err; } - }); + ); return function runScript(_x5, _x6, _x7, _x8) { return _ref5.apply(this, arguments); @@ -132022,11 +131888,11 @@ threshold" process.exitCode = exitCode; } else { // ignore all arguments after a -- - const doubleDashIndex = process.argv.findIndex(function ( - element - ) { - return element === "--"; - }); + const doubleDashIndex = process.argv.findIndex( + function (element) { + return element === "--"; + } + ); const startArgs = process.argv.slice(0, 2); const args = process.argv.slice( 2, @@ -132969,144 +132835,141 @@ threshold" let buildTree = (exports.buildTree = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - resolver, - linker, - patterns, - ignoreHoisted - ) { - const treesByKey = {}; - const trees = []; - const flatTree = yield linker.getFlatHoistedTree(patterns); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (resolver, linker, patterns, ignoreHoisted) { + const treesByKey = {}; + const trees = []; + const flatTree = yield linker.getFlatHoistedTree(patterns); - // If using workspaces, filter out the virtual manifest - const workspaceLayout = resolver.workspaceLayout; + // If using workspaces, filter out the virtual manifest + const workspaceLayout = resolver.workspaceLayout; - const hoisted = - workspaceLayout && workspaceLayout.virtualManifestName - ? flatTree.filter(function ([key]) { - return ( - key.indexOf(workspaceLayout.virtualManifestName) === -1 - ); - }) - : flatTree; + const hoisted = + workspaceLayout && workspaceLayout.virtualManifestName + ? flatTree.filter(function ([key]) { + return ( + key.indexOf(workspaceLayout.virtualManifestName) === -1 + ); + }) + : flatTree; - const hoistedByKey = {}; - for ( - var _iterator = hoisted, - _isArray = Array.isArray(_iterator), - _i = 0, - _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); - ; + const hoistedByKey = {}; + for ( + var _iterator = hoisted, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); + ; - ) { - var _ref3; + ) { + var _ref3; - if (_isArray) { - if (_i >= _iterator.length) break; - _ref3 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref3 = _i.value; + if (_isArray) { + if (_i >= _iterator.length) break; + _ref3 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref3 = _i.value; + } + + const _ref2 = _ref3; + const key = _ref2[0]; + const info = _ref2[1]; + + hoistedByKey[key] = info; } - const _ref2 = _ref3; - const key = _ref2[0]; - const info = _ref2[1]; + // build initial trees + for ( + var _iterator2 = hoisted, + _isArray2 = Array.isArray(_iterator2), + _i2 = 0, + _iterator2 = _isArray2 + ? _iterator2 + : _iterator2[Symbol.iterator](); + ; - hoistedByKey[key] = info; - } + ) { + var _ref5; - // build initial trees - for ( - var _iterator2 = hoisted, - _isArray2 = Array.isArray(_iterator2), - _i2 = 0, - _iterator2 = _isArray2 - ? _iterator2 - : _iterator2[Symbol.iterator](); - ; + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref5 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref5 = _i2.value; + } - ) { - var _ref5; + const _ref4 = _ref5; + const info = _ref4[1]; - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref5 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref5 = _i2.value; - } + const ref = info.pkg._reference; + // const parent = getParent(info.key, treesByKey); + const children = []; + // let depth = 0; + invariant(ref, "expected reference"); - const _ref4 = _ref5; - const info = _ref4[1]; + // check parent to obtain next depth + // if (parent && parent.depth > 0) { + // depth = parent.depth + 1; + // } else { + // depth = 0; + // } - const ref = info.pkg._reference; - // const parent = getParent(info.key, treesByKey); - const children = []; - // let depth = 0; - invariant(ref, "expected reference"); + treesByKey[info.key] = { + name: info.pkg.name, + version: info.pkg.version, + children, + manifest: info, + }; + } - // check parent to obtain next depth - // if (parent && parent.depth > 0) { - // depth = parent.depth + 1; - // } else { - // depth = 0; - // } - - treesByKey[info.key] = { - name: info.pkg.name, - version: info.pkg.version, - children, - manifest: info, - }; - } + // add children + for ( + var _iterator3 = hoisted, + _isArray3 = Array.isArray(_iterator3), + _i3 = 0, + _iterator3 = _isArray3 + ? _iterator3 + : _iterator3[Symbol.iterator](); + ; - // add children - for ( - var _iterator3 = hoisted, - _isArray3 = Array.isArray(_iterator3), - _i3 = 0, - _iterator3 = _isArray3 - ? _iterator3 - : _iterator3[Symbol.iterator](); - ; + ) { + var _ref7; - ) { - var _ref7; + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref7 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref7 = _i3.value; + } - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref7 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref7 = _i3.value; - } + const _ref6 = _ref7; + const info = _ref6[1]; - const _ref6 = _ref7; - const info = _ref6[1]; + const tree = treesByKey[info.key]; + const parent = getParent(info.key, treesByKey); + if (!tree) { + continue; + } - const tree = treesByKey[info.key]; - const parent = getParent(info.key, treesByKey); - if (!tree) { - continue; - } + if (info.key.split("#").length === 1) { + trees.push(tree); + continue; + } - if (info.key.split("#").length === 1) { - trees.push(tree); - continue; + if (parent) { + parent.children.push(tree); + } } - if (parent) { - parent.children.push(tree); - } + return trees; } - - return trees; - }); + ); return function buildTree(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); @@ -138716,12 +138579,12 @@ threshold" const peerDependencies = new Set( Array.from(Object.keys(pkg.peerDependencies || {})) ); - const directDependencies = ref.dependencies.filter(function ( - pattern - ) { - const pkg = resolver.getStrictResolvedPattern(pattern); - return !pkg || !peerDependencies.has(pkg.name); - }); + const directDependencies = ref.dependencies.filter( + function (pattern) { + const pkg = resolver.getStrictResolvedPattern(pattern); + return !pkg || !peerDependencies.has(pkg.name); + } + ); // We inject the partial information in the store right now so that we won't cycle indefinitely packageInformationStore.set( @@ -139646,15 +139509,15 @@ threshold" const tryVersionAsSemverRange = (() => { var _ref6 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - options - ) { - const names = computeSemverNames(options); - return ( - (yield tryVersionAsTagSemver(options, names)) || - tryVersionAsBranchSemver(options, names) - ); - }); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (options) { + const names = computeSemverNames(options); + return ( + (yield tryVersionAsTagSemver(options, names)) || + tryVersionAsBranchSemver(options, names) + ); + } + ); return function tryVersionAsSemverRange(_x5) { return _ref6.apply(this, arguments); @@ -139680,39 +139543,39 @@ threshold" const resolveVersion = (exports.resolveVersion = (() => { var _ref7 = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - options - ) { - for ( - var _iterator3 = VERSION_RESOLUTION_STEPS, - _isArray3 = Array.isArray(_iterator3), - _i3 = 0, - _iterator3 = _isArray3 - ? _iterator3 - : _iterator3[Symbol.iterator](); - ; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (options) { + for ( + var _iterator3 = VERSION_RESOLUTION_STEPS, + _isArray3 = Array.isArray(_iterator3), + _i3 = 0, + _iterator3 = _isArray3 + ? _iterator3 + : _iterator3[Symbol.iterator](); + ; - ) { - var _ref8; + ) { + var _ref8; - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref8 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref8 = _i3.value; - } + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref8 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref8 = _i3.value; + } - const testFunction = _ref8; + const testFunction = _ref8; - const result = yield testFunction(options); - if (result !== null) { - return result; + const result = yield testFunction(options); + if (result !== null) { + return result; + } } + return null; } - return null; - }); + ); return function resolveVersion(_x6) { return _ref7.apply(this, arguments); @@ -139906,512 +139769,524 @@ threshold" exports.default = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - info, - moduleLoc, - reporter, - warn, - looseSemver - ) { - const files = yield (_fs || _load_fs()).readdir(moduleLoc); + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (info, moduleLoc, reporter, warn, looseSemver) { + const files = yield (_fs || _load_fs()).readdir(moduleLoc); - // clean info.version - if (typeof info.version === "string") { - info.version = - semver.clean(info.version, looseSemver) || info.version; - } + // clean info.version + if (typeof info.version === "string") { + info.version = + semver.clean(info.version, looseSemver) || info.version; + } - // if name or version aren't set then set them to empty strings - info.name = info.name || ""; - info.version = info.version || ""; + // if name or version aren't set then set them to empty strings + info.name = info.name || ""; + info.version = info.version || ""; - // if the man field is a string then coerce it to an array - if (typeof info.man === "string") { - info.man = [info.man]; - } + // if the man field is a string then coerce it to an array + if (typeof info.man === "string") { + info.man = [info.man]; + } - // if the keywords field is a string then split it on any whitespace - if (typeof info.keywords === "string") { - info.keywords = info.keywords.split(/\s+/g); - } + // if the keywords field is a string then split it on any whitespace + if (typeof info.keywords === "string") { + info.keywords = info.keywords.split(/\s+/g); + } - // if there's no contributors field but an authors field then expand it - if (!info.contributors && files.indexOf("AUTHORS") >= 0) { - const authorsFilepath = path.join(moduleLoc, "AUTHORS"); - const authorsFilestats = yield (_fs || _load_fs()).stat( - authorsFilepath - ); - if (authorsFilestats.isFile()) { - let authors = yield (_fs || _load_fs()).readFile(authorsFilepath); - authors = authors - .split(/\r?\n/g) // split on lines - .map(function (line) { - return line.replace(/^\s*#.*$/, "").trim(); - }) // remove comments - .filter(function (line) { - return !!line; - }); // remove empty lines - info.contributors = authors; + // if there's no contributors field but an authors field then expand it + if (!info.contributors && files.indexOf("AUTHORS") >= 0) { + const authorsFilepath = path.join(moduleLoc, "AUTHORS"); + const authorsFilestats = yield (_fs || _load_fs()).stat( + authorsFilepath + ); + if (authorsFilestats.isFile()) { + let authors = yield (_fs || _load_fs()).readFile( + authorsFilepath + ); + authors = authors + .split(/\r?\n/g) // split on lines + .map(function (line) { + return line.replace(/^\s*#.*$/, "").trim(); + }) // remove comments + .filter(function (line) { + return !!line; + }); // remove empty lines + info.contributors = authors; + } } - } - // expand people fields to objects - if ( - typeof info.author === "string" || - typeof info.author === "object" - ) { - info.author = (0, (_util || _load_util()).normalizePerson)( - info.author - ); - } - if (Array.isArray(info.contributors)) { - info.contributors = info.contributors.map( - (_util || _load_util()).normalizePerson - ); - } - if (Array.isArray(info.maintainers)) { - info.maintainers = info.maintainers.map( - (_util || _load_util()).normalizePerson - ); - } + // expand people fields to objects + if ( + typeof info.author === "string" || + typeof info.author === "object" + ) { + info.author = (0, (_util || _load_util()).normalizePerson)( + info.author + ); + } + if (Array.isArray(info.contributors)) { + info.contributors = info.contributors.map( + (_util || _load_util()).normalizePerson + ); + } + if (Array.isArray(info.maintainers)) { + info.maintainers = info.maintainers.map( + (_util || _load_util()).normalizePerson + ); + } - // if there's no readme field then load the README file from the cwd - if (!info.readme) { - const readmeCandidates = files - .filter(function (filename) { - const lower = filename.toLowerCase(); - return lower === "readme" || lower.indexOf("readme.") === 0; - }) - .sort(function (filename1, filename2) { - // favor files with extensions - return filename2.indexOf(".") - filename1.indexOf("."); - }); + // if there's no readme field then load the README file from the cwd + if (!info.readme) { + const readmeCandidates = files + .filter(function (filename) { + const lower = filename.toLowerCase(); + return lower === "readme" || lower.indexOf("readme.") === 0; + }) + .sort(function (filename1, filename2) { + // favor files with extensions + return filename2.indexOf(".") - filename1.indexOf("."); + }); - for ( - var _iterator = readmeCandidates, - _isArray = Array.isArray(_iterator), - _i = 0, - _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); - ; + for ( + var _iterator = readmeCandidates, + _isArray = Array.isArray(_iterator), + _i = 0, + _iterator = _isArray + ? _iterator + : _iterator[Symbol.iterator](); + ; - ) { - var _ref2; + ) { + var _ref2; - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; - } + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } - const readmeFilename = _ref2; + const readmeFilename = _ref2; - const readmeFilepath = path.join(moduleLoc, readmeFilename); - const readmeFileStats = yield (_fs || _load_fs()).stat( - readmeFilepath - ); - if (readmeFileStats.isFile()) { - info.readmeFilename = readmeFilename; - info.readme = yield (_fs || _load_fs()).readFile( + const readmeFilepath = path.join(moduleLoc, readmeFilename); + const readmeFileStats = yield (_fs || _load_fs()).stat( readmeFilepath ); - break; + if (readmeFileStats.isFile()) { + info.readmeFilename = readmeFilename; + info.readme = yield (_fs || _load_fs()).readFile( + readmeFilepath + ); + break; + } } } - } - // if there's no description then take the first paragraph from the readme - if (!info.description && info.readme) { - const desc = (0, (_util || _load_util()).extractDescription)( - info.readme - ); - if (desc) { - info.description = desc; + // if there's no description then take the first paragraph from the readme + if (!info.description && info.readme) { + const desc = (0, (_util || _load_util()).extractDescription)( + info.readme + ); + if (desc) { + info.description = desc; + } } - } - // support array of engine keys - if (Array.isArray(info.engines)) { - const engines = {}; - for ( - var _iterator2 = info.engines, - _isArray2 = Array.isArray(_iterator2), - _i2 = 0, - _iterator2 = _isArray2 - ? _iterator2 - : _iterator2[Symbol.iterator](); - ; + // support array of engine keys + if (Array.isArray(info.engines)) { + const engines = {}; + for ( + var _iterator2 = info.engines, + _isArray2 = Array.isArray(_iterator2), + _i2 = 0, + _iterator2 = _isArray2 + ? _iterator2 + : _iterator2[Symbol.iterator](); + ; - ) { - var _ref3; + ) { + var _ref3; - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref3 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref3 = _i2.value; - } + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } - const str = _ref3; + const str = _ref3; - if (typeof str === "string") { - var _str$trim$split = str.trim().split(/ +/g); + if (typeof str === "string") { + var _str$trim$split = str.trim().split(/ +/g); - const name = _str$trim$split[0], - patternParts = _str$trim$split.slice(1); + const name = _str$trim$split[0], + patternParts = _str$trim$split.slice(1); - engines[name] = patternParts.join(" "); + engines[name] = patternParts.join(" "); + } } + info.engines = engines; } - info.engines = engines; - } - // if the repository field is a string then assume it's a git repo and expand it - if (typeof info.repository === "string") { - info.repository = { - type: "git", - url: info.repository, - }; - } + // if the repository field is a string then assume it's a git repo and expand it + if (typeof info.repository === "string") { + info.repository = { + type: "git", + url: info.repository, + }; + } - const repo = info.repository; + const repo = info.repository; - // explode info.repository.url if it's a hosted git shorthand - if ( - repo && - typeof repo === "object" && - typeof repo.url === "string" - ) { - repo.url = (0, (_index || _load_index()).hostedGitFragmentToGitUrl)( - repo.url, - reporter - ); - } + // explode info.repository.url if it's a hosted git shorthand + if ( + repo && + typeof repo === "object" && + typeof repo.url === "string" + ) { + repo.url = (0, + (_index || _load_index()).hostedGitFragmentToGitUrl)( + repo.url, + reporter + ); + } - // allow bugs to be specified as a string, expand it to an object with a single url prop - if (typeof info.bugs === "string") { - info.bugs = { url: info.bugs }; - } + // allow bugs to be specified as a string, expand it to an object with a single url prop + if (typeof info.bugs === "string") { + info.bugs = { url: info.bugs }; + } - // normalize homepage url to http - if (typeof info.homepage === "string") { - const parts = url.parse(info.homepage); - parts.protocol = parts.protocol || "http:"; - if (parts.pathname && !parts.hostname) { - parts.hostname = parts.pathname; - parts.pathname = ""; + // normalize homepage url to http + if (typeof info.homepage === "string") { + const parts = url.parse(info.homepage); + parts.protocol = parts.protocol || "http:"; + if (parts.pathname && !parts.hostname) { + parts.hostname = parts.pathname; + parts.pathname = ""; + } + info.homepage = url.format(parts); } - info.homepage = url.format(parts); - } - // if the `bin` field is as string then expand it to an object with a single property - // based on the original `bin` field and `name field` - // { name: "foo", bin: "cli.js" } -> { name: "foo", bin: { foo: "cli.js" } } - if ( - typeof info.name === "string" && - typeof info.bin === "string" && - info.bin.length > 0 - ) { - // Remove scoped package name for consistency with NPM's bin field fixing behaviour - const name = info.name.replace(/^@[^\/]+\//, ""); - info.bin = { [name]: info.bin }; - } + // if the `bin` field is as string then expand it to an object with a single property + // based on the original `bin` field and `name field` + // { name: "foo", bin: "cli.js" } -> { name: "foo", bin: { foo: "cli.js" } } + if ( + typeof info.name === "string" && + typeof info.bin === "string" && + info.bin.length > 0 + ) { + // Remove scoped package name for consistency with NPM's bin field fixing behaviour + const name = info.name.replace(/^@[^\/]+\//, ""); + info.bin = { [name]: info.bin }; + } - // bundleDependencies is an alias for bundledDependencies - if (info.bundledDependencies) { - info.bundleDependencies = info.bundledDependencies; - delete info.bundledDependencies; - } + // bundleDependencies is an alias for bundledDependencies + if (info.bundledDependencies) { + info.bundleDependencies = info.bundledDependencies; + delete info.bundledDependencies; + } - let scripts; + let scripts; - // dummy script object to shove file inferred scripts onto - if (info.scripts && typeof info.scripts === "object") { - scripts = info.scripts; - } else { - scripts = {}; - } + // dummy script object to shove file inferred scripts onto + if (info.scripts && typeof info.scripts === "object") { + scripts = info.scripts; + } else { + scripts = {}; + } - // if there's a server.js file and no start script then set it to `node server.js` - if (!scripts.start && files.indexOf("server.js") >= 0) { - scripts.start = "node server.js"; - } + // if there's a server.js file and no start script then set it to `node server.js` + if (!scripts.start && files.indexOf("server.js") >= 0) { + scripts.start = "node server.js"; + } - // if there's a binding.gyp file and no install script then set it to `node-gyp rebuild` - if (!scripts.install && files.indexOf("binding.gyp") >= 0) { - scripts.install = "node-gyp rebuild"; - } + // if there's a binding.gyp file and no install script then set it to `node-gyp rebuild` + if (!scripts.install && files.indexOf("binding.gyp") >= 0) { + scripts.install = "node-gyp rebuild"; + } - // set scripts if we've polluted the empty object - if (Object.keys(scripts).length) { - info.scripts = scripts; - } + // set scripts if we've polluted the empty object + if (Object.keys(scripts).length) { + info.scripts = scripts; + } - const dirs = info.directories; + const dirs = info.directories; - if (dirs && typeof dirs === "object") { - const binDir = dirs.bin; + if (dirs && typeof dirs === "object") { + const binDir = dirs.bin; - if (!info.bin && binDir && typeof binDir === "string") { - const bin = (info.bin = {}); - const fullBinDir = path.join(moduleLoc, binDir); + if (!info.bin && binDir && typeof binDir === "string") { + const bin = (info.bin = {}); + const fullBinDir = path.join(moduleLoc, binDir); - if (yield (_fs || _load_fs()).exists(fullBinDir)) { - for ( - var _iterator3 = yield (_fs || _load_fs()).readdir( - fullBinDir - ), - _isArray3 = Array.isArray(_iterator3), - _i3 = 0, - _iterator3 = _isArray3 - ? _iterator3 - : _iterator3[Symbol.iterator](); - ; + if (yield (_fs || _load_fs()).exists(fullBinDir)) { + for ( + var _iterator3 = yield (_fs || _load_fs()).readdir( + fullBinDir + ), + _isArray3 = Array.isArray(_iterator3), + _i3 = 0, + _iterator3 = _isArray3 + ? _iterator3 + : _iterator3[Symbol.iterator](); + ; - ) { - var _ref4; + ) { + var _ref4; - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref4 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref4 = _i3.value; - } + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } - const scriptName = _ref4; + const scriptName = _ref4; - if (scriptName[0] === ".") { - continue; + if (scriptName[0] === ".") { + continue; + } + bin[scriptName] = path.join(".", binDir, scriptName); } - bin[scriptName] = path.join(".", binDir, scriptName); + } else { + warn( + reporter.lang( + "manifestDirectoryNotFound", + binDir, + info.name + ) + ); } - } else { - warn( - reporter.lang("manifestDirectoryNotFound", binDir, info.name) - ); } - } - const manDir = dirs.man; + const manDir = dirs.man; - if (!info.man && typeof manDir === "string") { - const man = (info.man = []); - const fullManDir = path.join(moduleLoc, manDir); + if (!info.man && typeof manDir === "string") { + const man = (info.man = []); + const fullManDir = path.join(moduleLoc, manDir); - if (yield (_fs || _load_fs()).exists(fullManDir)) { - for ( - var _iterator4 = yield (_fs || _load_fs()).readdir( - fullManDir - ), - _isArray4 = Array.isArray(_iterator4), - _i4 = 0, - _iterator4 = _isArray4 - ? _iterator4 - : _iterator4[Symbol.iterator](); - ; + if (yield (_fs || _load_fs()).exists(fullManDir)) { + for ( + var _iterator4 = yield (_fs || _load_fs()).readdir( + fullManDir + ), + _isArray4 = Array.isArray(_iterator4), + _i4 = 0, + _iterator4 = _isArray4 + ? _iterator4 + : _iterator4[Symbol.iterator](); + ; - ) { - var _ref5; + ) { + var _ref5; - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref5 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref5 = _i4.value; - } + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref5 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref5 = _i4.value; + } - const filename = _ref5; + const filename = _ref5; - if (/^(.*?)\.[0-9]$/.test(filename)) { - man.push(path.join(".", manDir, filename)); + if (/^(.*?)\.[0-9]$/.test(filename)) { + man.push(path.join(".", manDir, filename)); + } } + } else { + warn( + reporter.lang( + "manifestDirectoryNotFound", + manDir, + info.name + ) + ); } - } else { - warn( - reporter.lang("manifestDirectoryNotFound", manDir, info.name) - ); } } - } - delete info.directories; + delete info.directories; - // normalize licenses field - const licenses = info.licenses; - if (Array.isArray(licenses) && !info.license) { - let licenseTypes = []; + // normalize licenses field + const licenses = info.licenses; + if (Array.isArray(licenses) && !info.license) { + let licenseTypes = []; - for ( - var _iterator5 = licenses, - _isArray5 = Array.isArray(_iterator5), - _i5 = 0, - _iterator5 = _isArray5 - ? _iterator5 - : _iterator5[Symbol.iterator](); - ; + for ( + var _iterator5 = licenses, + _isArray5 = Array.isArray(_iterator5), + _i5 = 0, + _iterator5 = _isArray5 + ? _iterator5 + : _iterator5[Symbol.iterator](); + ; - ) { - var _ref6; + ) { + var _ref6; - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref6 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref6 = _i5.value; - } + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref6 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref6 = _i5.value; + } - let license = _ref6; + let license = _ref6; - if (license && typeof license === "object") { - license = license.type; - } - if (typeof license === "string") { - licenseTypes.push(license); + if (license && typeof license === "object") { + license = license.type; + } + if (typeof license === "string") { + licenseTypes.push(license); + } } - } - licenseTypes = licenseTypes.filter( - (_util || _load_util()).isValidLicense - ); + licenseTypes = licenseTypes.filter( + (_util || _load_util()).isValidLicense + ); - if (licenseTypes.length === 1) { - info.license = licenseTypes[0]; - } else if (licenseTypes.length) { - info.license = `(${licenseTypes.join(" OR ")})`; + if (licenseTypes.length === 1) { + info.license = licenseTypes[0]; + } else if (licenseTypes.length) { + info.license = `(${licenseTypes.join(" OR ")})`; + } } - } - const license = info.license; + const license = info.license; - // normalize license - if (license && typeof license === "object") { - info.license = license.type; - } + // normalize license + if (license && typeof license === "object") { + info.license = license.type; + } - // get license file - const licenseFile = files.find(function (filename) { - const lower = filename.toLowerCase(); - return ( - lower === "license" || - lower.startsWith("license.") || - lower === "unlicense" || - lower.startsWith("unlicense.") - ); - }); - if (licenseFile) { - const licenseFilepath = path.join(moduleLoc, licenseFile); - const licenseFileStats = yield (_fs || _load_fs()).stat( - licenseFilepath - ); - if (licenseFileStats.isFile()) { - const licenseContent = yield (_fs || _load_fs()).readFile( + // get license file + const licenseFile = files.find(function (filename) { + const lower = filename.toLowerCase(); + return ( + lower === "license" || + lower.startsWith("license.") || + lower === "unlicense" || + lower.startsWith("unlicense.") + ); + }); + if (licenseFile) { + const licenseFilepath = path.join(moduleLoc, licenseFile); + const licenseFileStats = yield (_fs || _load_fs()).stat( licenseFilepath ); - const inferredLicense = (0, - (_inferLicense || _load_inferLicense()).default)(licenseContent); - info.licenseText = licenseContent; + if (licenseFileStats.isFile()) { + const licenseContent = yield (_fs || _load_fs()).readFile( + licenseFilepath + ); + const inferredLicense = (0, + (_inferLicense || _load_inferLicense()).default)( + licenseContent + ); + info.licenseText = licenseContent; - const license = info.license; + const license = info.license; - if (typeof license === "string") { - if ( - inferredLicense && - (0, (_util || _load_util()).isValidLicense)( - inferredLicense - ) && - !(0, (_util || _load_util()).isValidLicense)(license) - ) { - // some packages don't specify their license version but we can infer it based on their license file - const basicLicense = license - .toLowerCase() - .replace(/(-like|\*)$/g, ""); - const expandedLicense = inferredLicense.toLowerCase(); - if (expandedLicense.startsWith(basicLicense)) { - // TODO consider doing something to notify the user - info.license = inferredLicense; - } - } - } else if (inferredLicense) { - // if there's no license then infer it based on the license file - info.license = inferredLicense; - } else { - // valid expression to refer to a license in a file - info.license = `SEE LICENSE IN ${licenseFile}`; + if (typeof license === "string") { + if ( + inferredLicense && + (0, (_util || _load_util()).isValidLicense)( + inferredLicense + ) && + !(0, (_util || _load_util()).isValidLicense)(license) + ) { + // some packages don't specify their license version but we can infer it based on their license file + const basicLicense = license + .toLowerCase() + .replace(/(-like|\*)$/g, ""); + const expandedLicense = inferredLicense.toLowerCase(); + if (expandedLicense.startsWith(basicLicense)) { + // TODO consider doing something to notify the user + info.license = inferredLicense; + } + } + } else if (inferredLicense) { + // if there's no license then infer it based on the license file + info.license = inferredLicense; + } else { + // valid expression to refer to a license in a file + info.license = `SEE LICENSE IN ${licenseFile}`; + } } } - } - if (typeof info.license === "string") { - // sometimes licenses are known by different names, reduce them - info.license = LICENSE_RENAMES[info.license] || info.license; - } else if (typeof info.readme === "string") { - // the license might be at the bottom of the README - const inferredLicense = (0, - (_inferLicense || _load_inferLicense()).default)(info.readme); - if (inferredLicense) { - info.license = inferredLicense; + if (typeof info.license === "string") { + // sometimes licenses are known by different names, reduce them + info.license = LICENSE_RENAMES[info.license] || info.license; + } else if (typeof info.readme === "string") { + // the license might be at the bottom of the README + const inferredLicense = (0, + (_inferLicense || _load_inferLicense()).default)(info.readme); + if (inferredLicense) { + info.license = inferredLicense; + } } - } - // get notice file - const noticeFile = files.find(function (filename) { - const lower = filename.toLowerCase(); - return lower === "notice" || lower.startsWith("notice."); - }); - if (noticeFile) { - const noticeFilepath = path.join(moduleLoc, noticeFile); - const noticeFileStats = yield (_fs || _load_fs()).stat( - noticeFilepath - ); - if (noticeFileStats.isFile()) { - info.noticeText = yield (_fs || _load_fs()).readFile( + // get notice file + const noticeFile = files.find(function (filename) { + const lower = filename.toLowerCase(); + return lower === "notice" || lower.startsWith("notice."); + }); + if (noticeFile) { + const noticeFilepath = path.join(moduleLoc, noticeFile); + const noticeFileStats = yield (_fs || _load_fs()).stat( noticeFilepath ); + if (noticeFileStats.isFile()) { + info.noticeText = yield (_fs || _load_fs()).readFile( + noticeFilepath + ); + } } - } - for ( - var _iterator6 = (_constants || _load_constants()).MANIFEST_FIELDS, - _isArray6 = Array.isArray(_iterator6), - _i6 = 0, - _iterator6 = _isArray6 - ? _iterator6 - : _iterator6[Symbol.iterator](); - ; + for ( + var _iterator6 = (_constants || _load_constants()) + .MANIFEST_FIELDS, + _isArray6 = Array.isArray(_iterator6), + _i6 = 0, + _iterator6 = _isArray6 + ? _iterator6 + : _iterator6[Symbol.iterator](); + ; - ) { - var _ref7; + ) { + var _ref7; - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref7 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref7 = _i6.value; - } + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref7 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref7 = _i6.value; + } - const dependencyType = _ref7; + const dependencyType = _ref7; - const dependencyList = info[dependencyType]; - if (dependencyList && typeof dependencyList === "object") { - delete dependencyList["//"]; - for (const name in dependencyList) { - dependencyList[name] = dependencyList[name] || ""; + const dependencyList = info[dependencyType]; + if (dependencyList && typeof dependencyList === "object") { + delete dependencyList["//"]; + for (const name in dependencyList) { + dependencyList[name] = dependencyList[name] || ""; + } } } } - }); + ); return function (_x, _x2, _x3, _x4, _x5) { return _ref.apply(this, arguments); @@ -140767,62 +140642,60 @@ threshold" let makePortableProxyScriptUnix = (() => { var _ref = (0, - (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ( - source, - destination, - options - ) { - const environment = options.extraEnvironment - ? Array.from(options.extraEnvironment.entries()) - .map(function ([key, value]) { - return `${key}="${value}"`; - }) - .join(" ") + " " - : ""; + (_asyncToGenerator2 || _load_asyncToGenerator()).default)( + function* (source, destination, options) { + const environment = options.extraEnvironment + ? Array.from(options.extraEnvironment.entries()) + .map(function ([key, value]) { + return `${key}="${value}"`; + }) + .join(" ") + " " + : ""; - const prependedArguments = options.prependArguments - ? " " + - options.prependArguments - .map(function (arg) { - return `"${arg}"`; - }) - .join(" ") - : ""; - const appendedArguments = options.appendArguments - ? " " + - options.appendArguments - .map(function (arg) { - return `"${arg}"`; - }) - .join(" ") - : ""; + const prependedArguments = options.prependArguments + ? " " + + options.prependArguments + .map(function (arg) { + return `"${arg}"`; + }) + .join(" ") + : ""; + const appendedArguments = options.appendArguments + ? " " + + options.appendArguments + .map(function (arg) { + return `"${arg}"`; + }) + .join(" ") + : ""; - const filePath = `${destination}/${ - options.proxyBasename || path.basename(source) - }`; + const filePath = `${destination}/${ + options.proxyBasename || path.basename(source) + }`; - // Unless impossible we want to preserve any symlinks used to call us when forwarding the call to the binary (so we - // cannot use realpath or transform relative paths into absolute ones), but we also need to tell the sh interpreter - // that the symlink should be resolved relative to the script directory (hence dirname "$0" at runtime). - const sourcePath = path.isAbsolute(source) - ? source - : `$(dirname "$0")/../${source}`; + // Unless impossible we want to preserve any symlinks used to call us when forwarding the call to the binary (so we + // cannot use realpath or transform relative paths into absolute ones), but we also need to tell the sh interpreter + // that the symlink should be resolved relative to the script directory (hence dirname "$0" at runtime). + const sourcePath = path.isAbsolute(source) + ? source + : `$(dirname "$0")/../${source}`; - yield (_fs || _load_fs()).mkdirp(destination); + yield (_fs || _load_fs()).mkdirp(destination); - if (process.platform === "win32") { - yield (_fs || _load_fs()).writeFile( - filePath + ".cmd", - `@${environment}"${sourcePath}" ${prependedArguments} ${appendedArguments} %*\r\n` - ); - } else { - yield (_fs || _load_fs()).writeFile( - filePath, - `#!/bin/sh\n\n${environment}exec "${sourcePath}"${prependedArguments} "$@"${appendedArguments}\n` - ); - yield (_fs || _load_fs()).chmod(filePath, 0o755); + if (process.platform === "win32") { + yield (_fs || _load_fs()).writeFile( + filePath + ".cmd", + `@${environment}"${sourcePath}" ${prependedArguments} ${appendedArguments} %*\r\n` + ); + } else { + yield (_fs || _load_fs()).writeFile( + filePath, + `#!/bin/sh\n\n${environment}exec "${sourcePath}"${prependedArguments} "$@"${appendedArguments}\n` + ); + yield (_fs || _load_fs()).chmod(filePath, 0o755); + } } - }); + ); return function makePortableProxyScriptUnix(_x, _x2, _x3) { return _ref.apply(this, arguments); @@ -141662,8 +141535,8 @@ threshold" const prefix = flag.startsWith("-") ? "" : flag.length === 1 - ? "-" - : "--"; + ? "-" + : "--"; const pos = argv.indexOf(prefix + flag); const terminatorPos = argv.indexOf("--"); return ( @@ -144047,11 +143920,11 @@ THE SOFTWARE. if ("CI" in env) { if ( - ["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some(function ( - sign - ) { - return sign in env; - }) || + ["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some( + function (sign) { + return sign in env; + } + ) || env.CI_NAME === "codeship" ) { return 1; @@ -144146,9 +144019,9 @@ THE SOFTWARE. typeof setImmediate == "function" ? setImmediate : typeof process == "object" && - typeof process.nextTick == "function" - ? process.nextTick - : null; + typeof process.nextTick == "function" + ? process.nextTick + : null; if (nextTick) { nextTick(fn); @@ -148428,11 +148301,11 @@ THE SOFTWARE. dependencies.push(thePackage); - return Object.keys(thePackage.dependencies || {}).forEach(function ( - dep - ) { - again(dep, thePackage.baseDir); - }); + return Object.keys(thePackage.dependencies || {}).forEach( + function (dep) { + again(dep, thePackage.baseDir); + } + ); })(name, dir); return dependencies; @@ -153822,10 +153695,10 @@ util.inherits(module.exports.ISO_8859_7, sbcs); var editor = process.env.VISUAL ? process.env.VISUAL : process.env.EDITOR - ? process.env.EDITOR - : /^win/.test(process.platform) - ? "notepad" - : "vim"; + ? process.env.EDITOR + : /^win/.test(process.platform) + ? "notepad" + : "vim"; var editorOpts = ExternalEditor.splitStringBySpace(editor).map( function (piece) { return piece.replace("\\ ", " "); @@ -158127,7 +158000,10 @@ util.inherits(module.exports.ISO_8859_7, sbcs); 9, "+-±×", ], - ["8180", "÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"], + [ + "8180", + "÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓", + ], ["81b8", "∈∋⊆⊇⊂⊃∪∩"], ["81c8", "∧∨¬⇒⇔∀∃"], ["81da", "∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], @@ -160174,8 +160050,8 @@ empty list will be returned. A validation error will have two properties: ? typeof i == "number" ? "[" + i + "]" : typeof i == "undefined" - ? "" - : "." + i + ? "" + : "." + i : i; function addError(message) { errors.push({ property: path, message: message }); @@ -161335,8 +161211,8 @@ empty list will be returned. A validation error will have two properties: ? ret + 1 : tmp2 : tmp2 > tmp - ? tmp + 1 - : tmp2; + ? tmp + 1 + : tmp2; } } @@ -172672,8 +172548,8 @@ empty list will be returned. A validation error will have two properties: scope === null ? 0 : scope.depth !== -1 - ? scope.depth - : (scope.depth = getDepth(scope.parent) + scope.depthDelta); + ? scope.depth + : (scope.depth = getDepth(scope.parent) + scope.depthDelta); const newScope = (parent) => ({ parent, depthDelta: 0, depth: -1 }); const CARET = "^".charCodeAt(); const QUOTE = '"'.charCodeAt(); @@ -172982,8 +172858,8 @@ empty list will be returned. A validation error will have two properties: type === TOKEN_QUOTE ? null : type === TOKEN_SEMI - ? shellStringSemicolon - : templateSpan.substring(tokenStart, pos); + ? shellStringSemicolon + : templateSpan.substring(tokenStart, pos); if (type >= TOKEN_SEMI) { // This branch handles semicolons, unquoted text, spaces, and // redirects. shellStringSemicolon is already a formatSymbol object; @@ -175772,8 +175648,7 @@ empty list will be returned. A validation error will have two properties: ) { headers[header.name] = header.value; return headers; - }, - {}); + }, {}); } // construct Cookie header diff --git a/packages/components/src/common/svgs/IconBarChartHorizontal3Small.svg b/packages/components/src/common/svgs/IconBarChartHorizontal3Small.svg index f89983d09..066dddd31 100644 --- a/packages/components/src/common/svgs/IconBarChartHorizontal3Small.svg +++ b/packages/components/src/common/svgs/IconBarChartHorizontal3Small.svg @@ -1,4 +1,5 @@ - - - - \ No newline at end of file + + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconBarChartVertical3Small.svg b/packages/components/src/common/svgs/IconBarChartVertical3Small.svg index bf2aefc2c..4ced5cb22 100644 --- a/packages/components/src/common/svgs/IconBarChartVertical3Small.svg +++ b/packages/components/src/common/svgs/IconBarChartVertical3Small.svg @@ -1,9 +1,5 @@ - - - IconChartSmall - - - - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconBarChartVertical4Small.svg b/packages/components/src/common/svgs/IconBarChartVertical4Small.svg index 86be71f0d..99804cbf8 100644 --- a/packages/components/src/common/svgs/IconBarChartVertical4Small.svg +++ b/packages/components/src/common/svgs/IconBarChartVertical4Small.svg @@ -1,9 +1,6 @@ - - - IconCoverageSmall@1x - - - - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconBookLarge.svg b/packages/components/src/common/svgs/IconBookLarge.svg index 7de4d9f49..4331084d9 100755 --- a/packages/components/src/common/svgs/IconBookLarge.svg +++ b/packages/components/src/common/svgs/IconBookLarge.svg @@ -1,3 +1,4 @@ - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconCheckSmall.svg b/packages/components/src/common/svgs/IconCheckSmall.svg index 907fb396a..4c4e030dd 100644 --- a/packages/components/src/common/svgs/IconCheckSmall.svg +++ b/packages/components/src/common/svgs/IconCheckSmall.svg @@ -1,9 +1,5 @@ - - - IconCheckSmall@1x - - - - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconChevronDownLarge.svg b/packages/components/src/common/svgs/IconChevronDownLarge.svg index 337563a92..60b497b3e 100644 --- a/packages/components/src/common/svgs/IconChevronDownLarge.svg +++ b/packages/components/src/common/svgs/IconChevronDownLarge.svg @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconChevronDownSmall.svg b/packages/components/src/common/svgs/IconChevronDownSmall.svg index 81202e5d4..8e9a49c51 100644 --- a/packages/components/src/common/svgs/IconChevronDownSmall.svg +++ b/packages/components/src/common/svgs/IconChevronDownSmall.svg @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconChevronLeft2Small.svg b/packages/components/src/common/svgs/IconChevronLeft2Small.svg index 11b802f57..0b3f9134d 100644 --- a/packages/components/src/common/svgs/IconChevronLeft2Small.svg +++ b/packages/components/src/common/svgs/IconChevronLeft2Small.svg @@ -1,11 +1,6 @@ - - - - - - - - - - - + + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconChevronLeftLarge.svg b/packages/components/src/common/svgs/IconChevronLeftLarge.svg index 923a9eed6..76301dc34 100644 --- a/packages/components/src/common/svgs/IconChevronLeftLarge.svg +++ b/packages/components/src/common/svgs/IconChevronLeftLarge.svg @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconChevronLeftSmall.svg b/packages/components/src/common/svgs/IconChevronLeftSmall.svg index 564e14a70..3481be729 100644 --- a/packages/components/src/common/svgs/IconChevronLeftSmall.svg +++ b/packages/components/src/common/svgs/IconChevronLeftSmall.svg @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconChevronRight2Small.svg b/packages/components/src/common/svgs/IconChevronRight2Small.svg index 43f5a1dec..c0cbd4440 100644 --- a/packages/components/src/common/svgs/IconChevronRight2Small.svg +++ b/packages/components/src/common/svgs/IconChevronRight2Small.svg @@ -1,11 +1,6 @@ - - - - - - - - - - - + + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconChevronRightLarge.svg b/packages/components/src/common/svgs/IconChevronRightLarge.svg index 9eadf82b6..5ea612bec 100644 --- a/packages/components/src/common/svgs/IconChevronRightLarge.svg +++ b/packages/components/src/common/svgs/IconChevronRightLarge.svg @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconChevronRightSmall.svg b/packages/components/src/common/svgs/IconChevronRightSmall.svg index 7273c7e3c..9ef9e5c70 100644 --- a/packages/components/src/common/svgs/IconChevronRightSmall.svg +++ b/packages/components/src/common/svgs/IconChevronRightSmall.svg @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconChevronUpLarge.svg b/packages/components/src/common/svgs/IconChevronUpLarge.svg index 21dc13525..14c389cc6 100644 --- a/packages/components/src/common/svgs/IconChevronUpLarge.svg +++ b/packages/components/src/common/svgs/IconChevronUpLarge.svg @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconChevronUpSmall.svg b/packages/components/src/common/svgs/IconChevronUpSmall.svg index 1507ebd64..c50bc91b7 100644 --- a/packages/components/src/common/svgs/IconChevronUpSmall.svg +++ b/packages/components/src/common/svgs/IconChevronUpSmall.svg @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconCirclesOverlapSmall.svg b/packages/components/src/common/svgs/IconCirclesOverlapSmall.svg index 6d49a5fe8..d4cee7977 100755 --- a/packages/components/src/common/svgs/IconCirclesOverlapSmall.svg +++ b/packages/components/src/common/svgs/IconCirclesOverlapSmall.svg @@ -1,4 +1,6 @@ - - - + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconCodeLarge.svg b/packages/components/src/common/svgs/IconCodeLarge.svg index 2378cec9b..9c6194210 100644 --- a/packages/components/src/common/svgs/IconCodeLarge.svg +++ b/packages/components/src/common/svgs/IconCodeLarge.svg @@ -1,5 +1,8 @@ - - - - - + + + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconCopyLarge.svg b/packages/components/src/common/svgs/IconCopyLarge.svg index 050c18b50..4f9806788 100644 --- a/packages/components/src/common/svgs/IconCopyLarge.svg +++ b/packages/components/src/common/svgs/IconCopyLarge.svg @@ -1,6 +1,9 @@ - - - + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconCopySmall.svg b/packages/components/src/common/svgs/IconCopySmall.svg index 29193fcbb..c58d34ed0 100644 --- a/packages/components/src/common/svgs/IconCopySmall.svg +++ b/packages/components/src/common/svgs/IconCopySmall.svg @@ -1,4 +1,5 @@ - + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconCubeLarge.svg b/packages/components/src/common/svgs/IconCubeLarge.svg index dad63a541..8f098637a 100644 --- a/packages/components/src/common/svgs/IconCubeLarge.svg +++ b/packages/components/src/common/svgs/IconCubeLarge.svg @@ -1,5 +1,8 @@ - - - - - + + + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconDotsHorizontal3Large.svg b/packages/components/src/common/svgs/IconDotsHorizontal3Large.svg index 15a8691c3..806704496 100644 --- a/packages/components/src/common/svgs/IconDotsHorizontal3Large.svg +++ b/packages/components/src/common/svgs/IconDotsHorizontal3Large.svg @@ -1,6 +1,9 @@ - - - + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconDotsHorizontal3Small.svg b/packages/components/src/common/svgs/IconDotsHorizontal3Small.svg index ef7b501c7..b5ed8196e 100644 --- a/packages/components/src/common/svgs/IconDotsHorizontal3Small.svg +++ b/packages/components/src/common/svgs/IconDotsHorizontal3Small.svg @@ -1,5 +1,8 @@ - - - - + + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconDownloadLarge.svg b/packages/components/src/common/svgs/IconDownloadLarge.svg index b1e022cdb..ec1fbe1cd 100644 --- a/packages/components/src/common/svgs/IconDownloadLarge.svg +++ b/packages/components/src/common/svgs/IconDownloadLarge.svg @@ -1,4 +1,5 @@ - + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconDownloadSmall.svg b/packages/components/src/common/svgs/IconDownloadSmall.svg index 3550fa61a..b7f856655 100644 --- a/packages/components/src/common/svgs/IconDownloadSmall.svg +++ b/packages/components/src/common/svgs/IconDownloadSmall.svg @@ -1,9 +1,6 @@ - - - IconDownloadSmall@1x - - - - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconEditSmall.svg b/packages/components/src/common/svgs/IconEditSmall.svg index 4cc6fc961..a53e4c633 100644 --- a/packages/components/src/common/svgs/IconEditSmall.svg +++ b/packages/components/src/common/svgs/IconEditSmall.svg @@ -1,9 +1,7 @@ - - - IconEditSmall@1x - - - - - + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconEyeOpenSmall.svg b/packages/components/src/common/svgs/IconEyeOpenSmall.svg index 62943ba21..8254ebac5 100644 --- a/packages/components/src/common/svgs/IconEyeOpenSmall.svg +++ b/packages/components/src/common/svgs/IconEyeOpenSmall.svg @@ -1,8 +1,9 @@ - - - Icons / Small / IconViewSmall - - - - + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconFlagCheckSmall.svg b/packages/components/src/common/svgs/IconFlagCheckSmall.svg index 03e18b00a..59e8442b7 100644 --- a/packages/components/src/common/svgs/IconFlagCheckSmall.svg +++ b/packages/components/src/common/svgs/IconFlagCheckSmall.svg @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconFlagOutlineSmall.svg b/packages/components/src/common/svgs/IconFlagOutlineSmall.svg index 631ceaac3..7b5d7211e 100644 --- a/packages/components/src/common/svgs/IconFlagOutlineSmall.svg +++ b/packages/components/src/common/svgs/IconFlagOutlineSmall.svg @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconFlagQuestionmarkSmall.svg b/packages/components/src/common/svgs/IconFlagQuestionmarkSmall.svg index 46ecf0454..cbfd9d37f 100644 --- a/packages/components/src/common/svgs/IconFlagQuestionmarkSmall.svg +++ b/packages/components/src/common/svgs/IconFlagQuestionmarkSmall.svg @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconFlagXmarkSmall.svg b/packages/components/src/common/svgs/IconFlagXmarkSmall.svg index 5f9281fc4..c5e07eebe 100644 --- a/packages/components/src/common/svgs/IconFlagXmarkSmall.svg +++ b/packages/components/src/common/svgs/IconFlagXmarkSmall.svg @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconFlaskPublicLarge.svg b/packages/components/src/common/svgs/IconFlaskPublicLarge.svg index 0b9b34494..635dfbfb6 100644 --- a/packages/components/src/common/svgs/IconFlaskPublicLarge.svg +++ b/packages/components/src/common/svgs/IconFlaskPublicLarge.svg @@ -1,7 +1,5 @@ - - \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconGlobeSmall.svg b/packages/components/src/common/svgs/IconGlobeSmall.svg index 564c4309c..9e2fdadb0 100644 --- a/packages/components/src/common/svgs/IconGlobeSmall.svg +++ b/packages/components/src/common/svgs/IconGlobeSmall.svg @@ -1,11 +1,6 @@ - - - IconMapSmall@1x - - - - - - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconGridThreeDotsLarge.svg b/packages/components/src/common/svgs/IconGridThreeDotsLarge.svg new file mode 100644 index 000000000..89dd9e7f2 --- /dev/null +++ b/packages/components/src/common/svgs/IconGridThreeDotsLarge.svg @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconLightBulbSmall.svg b/packages/components/src/common/svgs/IconLightBulbSmall.svg index 8b3ef80d0..010684b2f 100644 --- a/packages/components/src/common/svgs/IconLightBulbSmall.svg +++ b/packages/components/src/common/svgs/IconLightBulbSmall.svg @@ -1,9 +1,6 @@ - - - IconInsightSmall@1x - - - - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconLinesDashed3Solid1Small.svg b/packages/components/src/common/svgs/IconLinesDashed3Solid1Small.svg index 59e71b5b1..759ab5697 100644 --- a/packages/components/src/common/svgs/IconLinesDashed3Solid1Small.svg +++ b/packages/components/src/common/svgs/IconLinesDashed3Solid1Small.svg @@ -1,9 +1,16 @@ - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconLinesHorizontalSmall.svg b/packages/components/src/common/svgs/IconLinesHorizontalSmall.svg index 3fb86effe..c4384ec39 100644 --- a/packages/components/src/common/svgs/IconLinesHorizontalSmall.svg +++ b/packages/components/src/common/svgs/IconLinesHorizontalSmall.svg @@ -1,9 +1,7 @@ - - - IconAlignmentSmall@1x - - - - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconLinkSmall.svg b/packages/components/src/common/svgs/IconLinkSmall.svg index b5195e9d2..105c6824d 100644 --- a/packages/components/src/common/svgs/IconLinkSmall.svg +++ b/packages/components/src/common/svgs/IconLinkSmall.svg @@ -1,9 +1,6 @@ - - - IconBrowserSmall@1x - - - - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconListSmall.svg b/packages/components/src/common/svgs/IconListSmall.svg index 750ed4ef6..b082f3fb9 100644 --- a/packages/components/src/common/svgs/IconListSmall.svg +++ b/packages/components/src/common/svgs/IconListSmall.svg @@ -1,9 +1,6 @@ - - - IconListSmall@1x - - - - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconLockCircleSmall.svg b/packages/components/src/common/svgs/IconLockCircleSmall.svg index 180c267a7..8baf1b562 100644 --- a/packages/components/src/common/svgs/IconLockCircleSmall.svg +++ b/packages/components/src/common/svgs/IconLockCircleSmall.svg @@ -1,5 +1,8 @@ - - - - + + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconLockSmall.svg b/packages/components/src/common/svgs/IconLockSmall.svg index 2a2abcbeb..dda9ca693 100644 --- a/packages/components/src/common/svgs/IconLockSmall.svg +++ b/packages/components/src/common/svgs/IconLockSmall.svg @@ -1,9 +1,6 @@ - - - IconPrivateSmall@1x - - - - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconOpenSmall.svg b/packages/components/src/common/svgs/IconOpenSmall.svg index 0b47566b5..b52b134bd 100644 --- a/packages/components/src/common/svgs/IconOpenSmall.svg +++ b/packages/components/src/common/svgs/IconOpenSmall.svg @@ -1,3 +1,4 @@ - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconPeopleSmall.svg b/packages/components/src/common/svgs/IconPeopleSmall.svg index 7734dd14b..cd4692bad 100644 --- a/packages/components/src/common/svgs/IconPeopleSmall.svg +++ b/packages/components/src/common/svgs/IconPeopleSmall.svg @@ -1,9 +1,6 @@ - - - IconMemberSmall@1x - - - - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconPercentageSmall.svg b/packages/components/src/common/svgs/IconPercentageSmall.svg index f5f7b5659..ba2d858c2 100644 --- a/packages/components/src/common/svgs/IconPercentageSmall.svg +++ b/packages/components/src/common/svgs/IconPercentageSmall.svg @@ -1,5 +1,8 @@ - - - - + + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconPersonLarge.svg b/packages/components/src/common/svgs/IconPersonLarge.svg index 06ad9644d..99b86146f 100644 --- a/packages/components/src/common/svgs/IconPersonLarge.svg +++ b/packages/components/src/common/svgs/IconPersonLarge.svg @@ -1,4 +1,5 @@ - + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconPersonSmall.svg b/packages/components/src/common/svgs/IconPersonSmall.svg index 905eb9cd0..406548d93 100644 --- a/packages/components/src/common/svgs/IconPersonSmall.svg +++ b/packages/components/src/common/svgs/IconPersonSmall.svg @@ -1,4 +1,6 @@ - - - + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconPinLocationSmall.svg b/packages/components/src/common/svgs/IconPinLocationSmall.svg index d0cb2f48b..49ae199ae 100644 --- a/packages/components/src/common/svgs/IconPinLocationSmall.svg +++ b/packages/components/src/common/svgs/IconPinLocationSmall.svg @@ -1,10 +1,4 @@ - - - - - - - - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconPinSmall.svg b/packages/components/src/common/svgs/IconPinSmall.svg index b01a384e7..871b0d943 100644 --- a/packages/components/src/common/svgs/IconPinSmall.svg +++ b/packages/components/src/common/svgs/IconPinSmall.svg @@ -1,3 +1,4 @@ - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconPlusCircleSmall.svg b/packages/components/src/common/svgs/IconPlusCircleSmall.svg index 0d4ec44b6..dd497b9d4 100644 --- a/packages/components/src/common/svgs/IconPlusCircleSmall.svg +++ b/packages/components/src/common/svgs/IconPlusCircleSmall.svg @@ -1,9 +1,6 @@ - - - IconPlusCircleSmall@1x - - - - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconPuzzlePieceSmall.svg b/packages/components/src/common/svgs/IconPuzzlePieceSmall.svg index ee9efbb17..96e638934 100644 --- a/packages/components/src/common/svgs/IconPuzzlePieceSmall.svg +++ b/packages/components/src/common/svgs/IconPuzzlePieceSmall.svg @@ -1,9 +1,6 @@ - - - IconContigSmall@1x - - - - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconQuoteLarge.svg b/packages/components/src/common/svgs/IconQuoteLarge.svg index bce857934..3998d0a06 100644 --- a/packages/components/src/common/svgs/IconQuoteLarge.svg +++ b/packages/components/src/common/svgs/IconQuoteLarge.svg @@ -1,3 +1,4 @@ - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconRadioChecked.svg b/packages/components/src/common/svgs/IconRadioChecked.svg index 7420b23de..ecc361e83 100644 --- a/packages/components/src/common/svgs/IconRadioChecked.svg +++ b/packages/components/src/common/svgs/IconRadioChecked.svg @@ -1,4 +1,8 @@ - - - + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconRadioUnchecked.svg b/packages/components/src/common/svgs/IconRadioUnchecked.svg index 1ccb97e2c..7f7d160d7 100644 --- a/packages/components/src/common/svgs/IconRadioUnchecked.svg +++ b/packages/components/src/common/svgs/IconRadioUnchecked.svg @@ -1,4 +1,8 @@ - - - + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconReadLarge.svg b/packages/components/src/common/svgs/IconReadLarge.svg new file mode 100644 index 000000000..d4fb8621f --- /dev/null +++ b/packages/components/src/common/svgs/IconReadLarge.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconRocketLarge.svg b/packages/components/src/common/svgs/IconRocketLarge.svg new file mode 100644 index 000000000..ddb0a31fc --- /dev/null +++ b/packages/components/src/common/svgs/IconRocketLarge.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconTableSmall.svg b/packages/components/src/common/svgs/IconTableSmall.svg index d05438403..a1ad03707 100644 --- a/packages/components/src/common/svgs/IconTableSmall.svg +++ b/packages/components/src/common/svgs/IconTableSmall.svg @@ -1,9 +1,6 @@ - - - IconTableSmall@1x - - - - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconTrashCanLarge.svg b/packages/components/src/common/svgs/IconTrashCanLarge.svg index d35e81d70..72260c68f 100644 --- a/packages/components/src/common/svgs/IconTrashCanLarge.svg +++ b/packages/components/src/common/svgs/IconTrashCanLarge.svg @@ -1,4 +1,4 @@ - + diff --git a/packages/components/src/common/svgs/IconTrashCanSmall.svg b/packages/components/src/common/svgs/IconTrashCanSmall.svg index 333585959..731ce47ec 100644 --- a/packages/components/src/common/svgs/IconTrashCanSmall.svg +++ b/packages/components/src/common/svgs/IconTrashCanSmall.svg @@ -1,3 +1,4 @@ - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconTreeHorizontalSmall.svg b/packages/components/src/common/svgs/IconTreeHorizontalSmall.svg index 62aef3ab5..16599603f 100644 --- a/packages/components/src/common/svgs/IconTreeHorizontalSmall.svg +++ b/packages/components/src/common/svgs/IconTreeHorizontalSmall.svg @@ -1,9 +1,6 @@ - - - IconPhylotreeSmall@1x - - - - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconTreeVerticalSmall.svg b/packages/components/src/common/svgs/IconTreeVerticalSmall.svg index 00cba61c5..2227c621b 100644 --- a/packages/components/src/common/svgs/IconTreeVerticalSmall.svg +++ b/packages/components/src/common/svgs/IconTreeVerticalSmall.svg @@ -1,9 +1,6 @@ - - - IconTreeSmall@1x - - - - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconTriangleDownSmall.svg b/packages/components/src/common/svgs/IconTriangleDownSmall.svg index d06ea3e4b..1093da341 100755 --- a/packages/components/src/common/svgs/IconTriangleDownSmall.svg +++ b/packages/components/src/common/svgs/IconTriangleDownSmall.svg @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconTriangleLeftSmall.svg b/packages/components/src/common/svgs/IconTriangleLeftSmall.svg index 161be9b50..31e9969ad 100755 --- a/packages/components/src/common/svgs/IconTriangleLeftSmall.svg +++ b/packages/components/src/common/svgs/IconTriangleLeftSmall.svg @@ -1,3 +1,4 @@ - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconTriangleRightSmall.svg b/packages/components/src/common/svgs/IconTriangleRightSmall.svg index b6d63d423..33e1935f5 100755 --- a/packages/components/src/common/svgs/IconTriangleRightSmall.svg +++ b/packages/components/src/common/svgs/IconTriangleRightSmall.svg @@ -1,3 +1,4 @@ - - + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconUpdatedLarge.svg b/packages/components/src/common/svgs/IconUpdatedLarge.svg new file mode 100644 index 000000000..94f1afa4c --- /dev/null +++ b/packages/components/src/common/svgs/IconUpdatedLarge.svg @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconUploadSmall.svg b/packages/components/src/common/svgs/IconUploadSmall.svg index 339efa832..8f24bd4bd 100644 --- a/packages/components/src/common/svgs/IconUploadSmall.svg +++ b/packages/components/src/common/svgs/IconUploadSmall.svg @@ -1,4 +1,4 @@ - + diff --git a/packages/components/src/common/svgs/IconVirusCircleSLarge.svg b/packages/components/src/common/svgs/IconVirusCircleSLarge.svg index ff1c7d1ab..071cc764c 100644 --- a/packages/components/src/common/svgs/IconVirusCircleSLarge.svg +++ b/packages/components/src/common/svgs/IconVirusCircleSLarge.svg @@ -1,7 +1,12 @@ - - - - - - - + + + + + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconVirusLarge.svg b/packages/components/src/common/svgs/IconVirusLarge.svg index 59ed3901d..3ec9e0cec 100644 --- a/packages/components/src/common/svgs/IconVirusLarge.svg +++ b/packages/components/src/common/svgs/IconVirusLarge.svg @@ -1,6 +1,10 @@ - - - - - - + + + + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconWidgetLarge.svg b/packages/components/src/common/svgs/IconWidgetLarge.svg new file mode 100644 index 000000000..7ba455ea2 --- /dev/null +++ b/packages/components/src/common/svgs/IconWidgetLarge.svg @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/packages/components/src/common/svgs/IconXMarkCircleSmall.svg b/packages/components/src/common/svgs/IconXMarkCircleSmall.svg index ee5877068..d9411fce0 100644 --- a/packages/components/src/common/svgs/IconXMarkCircleSmall.svg +++ b/packages/components/src/common/svgs/IconXMarkCircleSmall.svg @@ -1,3 +1,4 @@ - - + + \ No newline at end of file diff --git a/packages/components/src/core/Autocomplete/components/AutocompleteBase/index.tsx b/packages/components/src/core/Autocomplete/components/AutocompleteBase/index.tsx index 04dfb5c98..0117a581c 100644 --- a/packages/components/src/core/Autocomplete/components/AutocompleteBase/index.tsx +++ b/packages/components/src/core/Autocomplete/components/AutocompleteBase/index.tsx @@ -80,7 +80,7 @@ type CustomAutocompleteProps< T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, - FreeSolo extends boolean | undefined + FreeSolo extends boolean | undefined, > = Omit< MuiAutocompleteProps, "renderInput" | "nonce" | "rev" | "rel" | "autoFocus" | "content" @@ -90,7 +90,7 @@ export type AutocompleteBaseProps< T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, - FreeSolo extends boolean | undefined + FreeSolo extends boolean | undefined, > = CustomAutocompleteProps & ExtraAutocompleteProps; @@ -98,7 +98,7 @@ const AutocompleteBase = < T extends DefaultAutocompleteOption, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, - FreeSolo extends boolean | undefined + FreeSolo extends boolean | undefined, >( props: AutocompleteBaseProps ): JSX.Element => { diff --git a/packages/components/src/core/Autocomplete/components/AutocompleteGroup/index.tsx b/packages/components/src/core/Autocomplete/components/AutocompleteGroup/index.tsx index 98833d440..310c45606 100644 --- a/packages/components/src/core/Autocomplete/components/AutocompleteGroup/index.tsx +++ b/packages/components/src/core/Autocomplete/components/AutocompleteGroup/index.tsx @@ -15,7 +15,7 @@ interface ExtraAutocompleteGroupProps< T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, - FreeSolo extends boolean | undefined + FreeSolo extends boolean | undefined, > { autocompleteProps: AutocompleteMultiColumnOption< T, @@ -38,7 +38,7 @@ type CustomAutocompleteProps< T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, - FreeSolo extends boolean | undefined + FreeSolo extends boolean | undefined, > = Omit< AutocompleteBaseProps, | "renderInput" @@ -56,7 +56,7 @@ export type AutocompleteGroupProps< T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, - FreeSolo extends boolean | undefined + FreeSolo extends boolean | undefined, > = CustomAutocompleteProps & ExtraAutocompleteGroupProps; @@ -64,7 +64,7 @@ const AutocompleteGroup = < T extends DefaultAutocompleteOption, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, - FreeSolo extends boolean | undefined + FreeSolo extends boolean | undefined, >( props: AutocompleteGroupProps ) => { diff --git a/packages/components/src/core/Autocomplete/components/AutocompleteMultiColumn/index.tsx b/packages/components/src/core/Autocomplete/components/AutocompleteMultiColumn/index.tsx index f9b861263..78ab35e6c 100644 --- a/packages/components/src/core/Autocomplete/components/AutocompleteMultiColumn/index.tsx +++ b/packages/components/src/core/Autocomplete/components/AutocompleteMultiColumn/index.tsx @@ -35,7 +35,7 @@ interface ExtraAutocompleteMultiColumnProps< T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, - FreeSolo extends boolean | undefined + FreeSolo extends boolean | undefined, > extends StyleProps { keepSearchOnSelect?: boolean; renderInput?: (params: AutocompleteRenderInputParams) => React.ReactNode; @@ -76,7 +76,7 @@ type CustomAutocompleteProps< T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, - FreeSolo extends boolean | undefined + FreeSolo extends boolean | undefined, > = Omit< AutocompleteBaseProps, | "renderInput" @@ -94,7 +94,7 @@ export type AutocompleteMultiColumnProps< T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, - FreeSolo extends boolean | undefined + FreeSolo extends boolean | undefined, > = CustomAutocompleteProps & ExtraAutocompleteMultiColumnProps; @@ -102,7 +102,7 @@ const AutocompleteMultiColumn = < T extends DefaultAutocompleteOption, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, - FreeSolo extends boolean | undefined + FreeSolo extends boolean | undefined, >( props: AutocompleteMultiColumnProps ): JSX.Element => { diff --git a/packages/components/src/core/ButtonIcon/style.ts b/packages/components/src/core/ButtonIcon/style.ts index aed269d74..91a746f09 100644 --- a/packages/components/src/core/ButtonIcon/style.ts +++ b/packages/components/src/core/ButtonIcon/style.ts @@ -18,7 +18,7 @@ export interface ButtonIconSizeToTypes { large: "primary" | "secondary" | "tertiary"; } export interface ButtonIconExtraProps< - ButtonIconSize extends keyof ButtonIconSizeToTypes + ButtonIconSize extends keyof ButtonIconSizeToTypes, > extends CommonThemeProps { on?: boolean; disabled?: boolean; diff --git a/packages/components/src/core/ComplexFilter/ComplexFilter.namespace-test.tsx b/packages/components/src/core/ComplexFilter/ComplexFilter.namespace-test.tsx index 34999af38..770e190ff 100644 --- a/packages/components/src/core/ComplexFilter/ComplexFilter.namespace-test.tsx +++ b/packages/components/src/core/ComplexFilter/ComplexFilter.namespace-test.tsx @@ -22,7 +22,7 @@ const ComplexFilterNameSpaceTest = < T extends DefaultAutocompleteOption, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, - FreeSolo extends boolean | undefined + FreeSolo extends boolean | undefined, >( props: ComplexFilterProps ) => { diff --git a/packages/components/src/core/Dropdown/Dropdown.namespace-test.tsx b/packages/components/src/core/Dropdown/Dropdown.namespace-test.tsx index 34202ed48..870078506 100644 --- a/packages/components/src/core/Dropdown/Dropdown.namespace-test.tsx +++ b/packages/components/src/core/Dropdown/Dropdown.namespace-test.tsx @@ -23,7 +23,7 @@ const DropdownNameSpaceTest = < T extends DefaultAutocompleteOption, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, - FreeSolo extends boolean | undefined + FreeSolo extends boolean | undefined, >( props: DropdownProps ) => { diff --git a/packages/components/src/core/Icon/map.ts b/packages/components/src/core/Icon/map.ts index 086c01fd7..88453352f 100644 --- a/packages/components/src/core/Icon/map.ts +++ b/packages/components/src/core/Icon/map.ts @@ -52,6 +52,7 @@ import { ReactComponent as IconGlobeSmall } from "../../common/svgs/IconGlobeSma import { ReactComponent as IconGridLarge } from "../../common/svgs/IconGridLarge.svg"; import { ReactComponent as IconGridPrivateLarge } from "../../common/svgs/IconGridPrivateLarge.svg"; import { ReactComponent as IconGridPublicLarge } from "../../common/svgs/IconGridPublicLarge.svg"; +import { ReactComponent as IconGridThreeDotsLarge } from "../../common/svgs/IconGridThreeDotsLarge.svg"; import { ReactComponent as IconHouseSmall } from "../../common/svgs/IconHouseSmall.svg"; import { ReactComponent as IconInfoCircleLarge } from "../../common/svgs/IconInfoCircleLarge.svg"; import { ReactComponent as IconInfoCircleSmall } from "../../common/svgs/IconInfoCircleSmall.svg"; @@ -86,8 +87,10 @@ import { ReactComponent as IconProjectPublicLarge } from "../../common/svgs/Icon import { ReactComponent as IconPuzzlePieceSmall } from "../../common/svgs/IconPuzzlePieceSmall.svg"; import { ReactComponent as IconQuestionMarkLarge } from "../../common/svgs/IconQuestionMarkLarge.svg"; import { ReactComponent as IconQuoteLarge } from "../../common/svgs/IconQuoteLarge.svg"; +import { ReactComponent as IconReadLarge } from "../../common/svgs/IconReadLarge.svg"; import { ReactComponent as IconRefreshLarge } from "../../common/svgs/IconRefreshLarge.svg"; import { ReactComponent as IconRefreshSmall } from "../../common/svgs/IconRefreshSmall.svg"; +import { ReactComponent as IconRocketLarge } from "../../common/svgs/IconRocketLarge.svg"; import { ReactComponent as IconSaveLarge } from "../../common/svgs/IconSaveLarge.svg"; import { ReactComponent as IconSearchLarge } from "../../common/svgs/IconSearchLarge.svg"; import { ReactComponent as IconSearchLinesHorizontalLarge } from "../../common/svgs/IconSearchLinesHorizontalLarge.svg"; @@ -97,8 +100,8 @@ import { ReactComponent as IconShareLarge } from "../../common/svgs/IconShareLar import { ReactComponent as IconSlidersHorizontalLarge } from "../../common/svgs/IconSlidersHorizontalLarge.svg"; import { ReactComponent as IconSpeechBubblesLarge } from "../../common/svgs/IconSpeechBubblesLarge.svg"; import { ReactComponent as IconSquareOnDashedSquareLarge } from "../../common/svgs/IconSquareOnDashedSquareLarge.svg"; -import { ReactComponent as IconStarLarge } from "../../common/svgs/IconStarLarge.svg"; import { ReactComponent as IconStarburstSmall } from "../../common/svgs/IconStarburstSmall.svg"; +import { ReactComponent as IconStarLarge } from "../../common/svgs/IconStarLarge.svg"; import { ReactComponent as IconTableSmall } from "../../common/svgs/IconTableSmall.svg"; import { ReactComponent as IconTrashCanLarge } from "../../common/svgs/IconTrashCanLarge.svg"; import { ReactComponent as IconTrashCanSmall } from "../../common/svgs/IconTrashCanSmall.svg"; @@ -113,10 +116,12 @@ import { ReactComponent as IconTriangleDownSmall } from "../../common/svgs/IconT import { ReactComponent as IconTriangleLeftSmall } from "../../common/svgs/IconTriangleLeftSmall.svg"; import { ReactComponent as IconTriangleRightSmall } from "../../common/svgs/IconTriangleRightSmall.svg"; import { ReactComponent as IconTriangleUpSmall } from "../../common/svgs/IconTriangleUpSmall.svg"; +import { ReactComponent as IconUpdatedLarge } from "../../common/svgs/IconUpdatedLarge.svg"; import { ReactComponent as IconUploadLarge } from "../../common/svgs/IconUploadLarge.svg"; import { ReactComponent as IconUploadSmall } from "../../common/svgs/IconUploadSmall.svg"; import { ReactComponent as IconVirusCircleSLarge } from "../../common/svgs/IconVirusCircleSLarge.svg"; import { ReactComponent as IconVirusLarge } from "../../common/svgs/IconVirusLarge.svg"; +import { ReactComponent as IconWidgetLarge } from "../../common/svgs/IconWidgetLarge.svg"; import { ReactComponent as IconXMarkCircleSmall } from "../../common/svgs/IconXMarkCircleSmall.svg"; import { ReactComponent as IconXMarkLarge } from "../../common/svgs/IconXMarkLarge.svg"; import { ReactComponent as IconXMarkSmall } from "../../common/svgs/IconXMarkSmall.svg"; @@ -163,6 +168,7 @@ export interface IconNameToSizes { grid: "l" | "xl"; gridPrivate: "l" | "xl"; gridPublic: "l" | "xl"; + gridThreeDots: "l" | "xl"; house: "xs" | "s"; infoCircle: "xs" | "s" | "l" | "xl"; infoSpeechBubble: "l" | "xl"; @@ -190,7 +196,9 @@ export interface IconNameToSizes { puzzlePiece: "xs" | "s"; questionMark: "l" | "xl"; quote: "l" | "xl"; + read: "l" | "xl"; refresh: "xs" | "s" | "l" | "xl"; + rocket: "l" | "xl"; save: "l" | "xl"; search: "xs" | "s" | "l" | "xl"; searchLinesHorizontal: "xs" | "s" | "l" | "xl"; @@ -212,9 +220,11 @@ export interface IconNameToSizes { triangleLeft: "xs" | "s"; triangleRight: "xs" | "s"; triangleUp: "xs" | "s"; + updated: "l" | "xl"; upload: "l" | "xl"; virus: "l" | "xl"; virusCircleS: "l" | "xl"; + widget: "l" | "xl"; xMark: "xs" | "s" | "l" | "xl"; xMarkCircle: "xs" | "s"; } @@ -392,6 +402,10 @@ export const iconMap: Props = { largeIcon: IconGridPublicLarge, smallIcon: null, }, + gridThreeDots: { + largeIcon: IconGridThreeDotsLarge, + smallIcon: null, + }, house: { largeIcon: null, smallIcon: IconHouseSmall, @@ -500,10 +514,18 @@ export const iconMap: Props = { largeIcon: IconQuoteLarge, smallIcon: null, }, + read: { + largeIcon: IconReadLarge, + smallIcon: null, + }, refresh: { largeIcon: IconRefreshLarge, smallIcon: IconRefreshSmall, }, + rocket: { + largeIcon: IconRocketLarge, + smallIcon: null, + }, save: { largeIcon: IconSaveLarge, smallIcon: null, @@ -588,6 +610,10 @@ export const iconMap: Props = { largeIcon: null, smallIcon: IconTriangleUpSmall, }, + updated: { + largeIcon: IconUpdatedLarge, + smallIcon: null, + }, upload: { largeIcon: IconUploadLarge, smallIcon: IconUploadSmall, @@ -600,6 +626,10 @@ export const iconMap: Props = { largeIcon: IconVirusCircleSLarge, smallIcon: null, }, + widget: { + largeIcon: IconWidgetLarge, + smallIcon: null, + }, xMark: { largeIcon: IconXMarkLarge, smallIcon: IconXMarkSmall, diff --git a/packages/components/src/core/InputDropdown/index.stories.tsx b/packages/components/src/core/InputDropdown/index.stories.tsx index 96ee2300c..35982901f 100644 --- a/packages/components/src/core/InputDropdown/index.stories.tsx +++ b/packages/components/src/core/InputDropdown/index.stories.tsx @@ -23,7 +23,7 @@ type FreeSolo = false; const InputDropdown = < T extends DefaultAutocompleteOption, - Multiple extends boolean | undefined + Multiple extends boolean | undefined, >( props: Args ): JSX.Element => { diff --git a/packages/components/src/core/InputSearch/style.ts b/packages/components/src/core/InputSearch/style.ts index 4c6b9b2da..289787635 100644 --- a/packages/components/src/core/InputSearch/style.ts +++ b/packages/components/src/core/InputSearch/style.ts @@ -107,8 +107,8 @@ const userInput = (props: InputSearchExtraProps): SerializedStyles => { intent === "error" ? borders?.error[400] : intent === "warning" - ? borders?.warning[400] - : borders?.primary[400]; + ? borders?.warning[400] + : borders?.primary[400]; const color = intent === "default" ? colors?.primary[400] : colors?.gray[500]; diff --git a/packages/components/src/core/InputText/style.ts b/packages/components/src/core/InputText/style.ts index 7081b566a..4b4875cf6 100644 --- a/packages/components/src/core/InputText/style.ts +++ b/packages/components/src/core/InputText/style.ts @@ -129,8 +129,8 @@ const userInput = (props: InputTextExtraProps): SerializedStyles => { intent === "error" ? borders?.error[400] : intent === "warning" - ? borders?.warning[400] - : borders?.primary[400]; + ? borders?.warning[400] + : borders?.primary[400]; return css` .${outlinedInputClasses.root} .${outlinedInputClasses.notchedOutline} { diff --git a/packages/data-viz/src/core/HeatmapChart/hooks/utils.ts b/packages/data-viz/src/core/HeatmapChart/hooks/utils.ts index e42faf2ce..e376e9363 100644 --- a/packages/data-viz/src/core/HeatmapChart/hooks/utils.ts +++ b/packages/data-viz/src/core/HeatmapChart/hooks/utils.ts @@ -178,14 +178,13 @@ type OrdinalRawValue = string | number; /** * (thuang): This copies echarts' CategoryAxisBaseOption["data"] type, since it's not exported */ -type CategoryAxisData = - | ( - | OrdinalRawValue - | { - value: OrdinalRawValue; - /** - * (thuang): This should be echarts `TextCommonOption` type, but it's not exported - */ - textStyle?: never; - } - )[]; +type CategoryAxisData = ( + | OrdinalRawValue + | { + value: OrdinalRawValue; + /** + * (thuang): This should be echarts `TextCommonOption` type, but it's not exported + */ + textStyle?: never; + } +)[];