diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5bdb9eff6..6498990e0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: mixed-line-ending args: [--fix=lf] - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v2.7.1" + rev: "v3.1.0" hooks: - id: prettier exclude_types: [markdown, yaml] diff --git a/.yarn/releases/yarn-1.19.0.cjs b/.yarn/releases/yarn-1.19.0.cjs index 80a6d8b21..1fd817d77 100644 --- a/.yarn/releases/yarn-1.19.0.cjs +++ b/.yarn/releases/yarn-1.19.0.cjs @@ -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`. @@ -28316,10 +28293,10 @@ and limitations under the License. // Export to the global object. root._ = _; } - }.call(this)); + }).call(this); /* WEBPACK VAR INJECTION */ - }.call(exports, __webpack_require__(163)(module))); + }).call(exports, __webpack_require__(163)(module)); /***/ }, @@ -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; @@ -36656,7 +36630,7 @@ and limitations under the License. this.BigInteger = BigInteger; this.SecureRandom = SecureRandom; } - }.call(this)); + }).call(this); /***/ }, @@ -36959,9 +36933,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() { @@ -37329,8 +37303,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 @@ -37340,8 +37314,8 @@ and limitations under the License. return p === GLOBSTAR ? twoStar : typeof p === "string" - ? regExpEscape(p) - : p._src; + ? regExpEscape(p) + : p._src; }) .join("\\/"); }) @@ -40663,8 +40637,8 @@ and limitations under the License. return typeof key == "number" ? "[" + key + "]" : IDENTIFIER.test(key) - ? "." + key - : "['" + escapeQuotes(key) + "']"; + ? "." + key + : "['" + escapeQuotes(key) + "']"; } function escapeQuotes(str) { @@ -40747,8 +40721,8 @@ and limitations under the License. expr + (isNumber ? "" : ".replace(/~/g, '~0').replace(/\\//g, '~1')") : isNumber - ? "'[' + " + expr + " + ']'" - : "'[\\'' + " + expr + " + '\\']'"; + ? "'[' + " + expr + " + ']'" + : "'[\\'' + " + expr + " + '\\']'"; return joinPaths(currentPath, path); } @@ -40847,36 +40821,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); @@ -41005,14 +40978,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); @@ -41935,36 +41905,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); @@ -41973,354 +41937,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); @@ -42387,37 +42349,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); @@ -42426,27 +42387,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); @@ -43533,22 +43492,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); @@ -43557,96 +43516,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); @@ -43655,61 +43616,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); @@ -43718,13 +43678,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); @@ -43733,117 +43692,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); @@ -43852,54 +43811,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); @@ -45734,17 +45691,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; }; /***/ @@ -50726,11 +50683,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) { @@ -51142,39 +51099,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); @@ -51558,34 +51512,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; } @@ -52007,11 +51957,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. @@ -52028,14 +51978,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); @@ -52044,48 +51994,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); @@ -56079,72 +56026,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); @@ -56153,72 +56097,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); @@ -57687,48 +57627,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); @@ -57737,54 +57674,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); @@ -57793,21 +57726,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); @@ -57986,25 +57918,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); @@ -60558,9 +60489,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( @@ -60819,56 +60749,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); @@ -60933,22 +60861,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); @@ -60977,23 +60904,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); @@ -61903,67 +61827,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); @@ -63369,8 +63290,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; }; }; @@ -65348,8 +65269,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(); @@ -66653,14 +66574,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; @@ -69204,14 +69125,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 () { @@ -70532,8 +70453,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, @@ -77228,40 +77149,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) { @@ -78264,7 +78185,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 /* ? */) { @@ -81749,8 +81670,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) { @@ -87707,69 +87628,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); @@ -88144,221 +88062,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); @@ -88367,32 +88284,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); @@ -88401,25 +88321,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); @@ -88428,16 +88347,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); @@ -88446,41 +88365,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); @@ -88635,130 +88551,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); @@ -88767,19 +88682,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); @@ -88788,43 +88706,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); @@ -88833,75 +88748,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); @@ -89026,169 +88938,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); @@ -89197,88 +89106,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); @@ -89287,377 +89193,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); @@ -89770,25 +89683,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); @@ -89797,95 +89709,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); @@ -89967,238 +89881,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); @@ -90207,69 +90123,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); @@ -90425,208 +90338,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); @@ -90740,151 +90650,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); @@ -90893,281 +90808,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); @@ -91315,35 +91233,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); @@ -91352,32 +91269,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); @@ -91386,49 +91300,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); @@ -91633,285 +91544,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); @@ -92027,262 +91948,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); @@ -92291,15 +92218,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); @@ -92931,8 +92861,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); @@ -100144,8 +100074,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 @@ -100163,8 +100093,8 @@ wercker.yml return this._dest ? this._dest.rows : this._src - ? this._src.rows - : undefined; + ? this._src.rows + : undefined; }, enumerable: true, configurable: true, @@ -100175,8 +100105,8 @@ wercker.yml return this._dest ? this._dest.columns : this._src - ? this._src.columns - : undefined; + ? this._src.columns + : undefined; }, enumerable: true, configurable: true, @@ -117288,8 +117218,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; } @@ -122559,8 +122489,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 @@ -123170,7 +123100,7 @@ threshold" }); /* WEBPACK VAR INJECTION */ - }.call(exports, __webpack_require__(163)(module))); + }).call(exports, __webpack_require__(163)(module)); /***/ }, @@ -124049,7 +123979,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; @@ -124222,9 +124152,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); @@ -124793,8 +124723,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; }, {}) ) @@ -125122,34 +125052,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); @@ -125288,22 +125215,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); @@ -125369,54 +125293,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); @@ -125550,33 +125466,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); @@ -125651,47 +125561,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); @@ -125930,20 +125837,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); @@ -126836,71 +126740,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); @@ -126992,269 +126893,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.tsx", - }, - { - 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.tsx", + }, + { + 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); @@ -127389,51 +127291,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); @@ -127442,138 +127343,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); @@ -127839,19 +127746,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); @@ -127900,39 +127804,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); @@ -128022,98 +127923,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); @@ -128199,88 +128102,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); @@ -128289,61 +128190,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); @@ -128760,125 +128658,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); @@ -128887,84 +128787,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); @@ -129084,25 +128981,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); @@ -129111,28 +129006,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); @@ -129195,40 +129088,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); @@ -129372,15 +129262,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) { @@ -129401,8 +129287,7 @@ threshold" args ) { list(parts, config, reporter); - }, - false), + }, false), }, [ "create ", @@ -129441,92 +129326,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); @@ -129613,81 +129497,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); @@ -129696,84 +129577,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); @@ -129782,11 +129662,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); @@ -129876,25 +129756,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); @@ -129945,42 +129822,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); @@ -129989,28 +129865,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); @@ -130019,298 +129895,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); @@ -130553,74 +130426,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); @@ -130702,151 +130572,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); @@ -130855,77 +130724,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); @@ -132027,11 +131893,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, @@ -132263,7 +132129,7 @@ threshold" exports.default = start; /* WEBPACK VAR INJECTION */ - }.call(exports, __webpack_require__(163)(module))); + }).call(exports, __webpack_require__(163)(module)); /***/ }, @@ -132974,144 +132840,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); @@ -138721,12 +138584,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( @@ -139651,15 +139514,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); @@ -139685,39 +139548,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); @@ -139911,512 +139774,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); @@ -140772,62 +140647,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); @@ -141667,8 +141540,8 @@ threshold" const prefix = flag.startsWith("-") ? "" : flag.length === 1 - ? "-" - : "--"; + ? "-" + : "--"; const pos = argv.indexOf(prefix + flag); const terminatorPos = argv.indexOf("--"); return ( @@ -144052,11 +143925,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; @@ -144151,9 +144024,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); @@ -148433,11 +148306,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; @@ -153827,10 +153700,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("\\ ", " "); @@ -158132,7 +158005,10 @@ util.inherits(module.exports.ISO_8859_7, sbcs); 9, "+-±×", ], - ["8180", "÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"], + [ + "8180", + "÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓", + ], ["81b8", "∈∋⊆⊇⊂⊃∪∩"], ["81c8", "∧∨¬⇒⇔∀∃"], ["81da", "∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], @@ -160179,8 +160055,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 }); @@ -161340,8 +161216,8 @@ empty list will be returned. A validation error will have two properties: ? ret + 1 : tmp2 : tmp2 > tmp - ? tmp + 1 - : tmp2; + ? tmp + 1 + : tmp2; } } @@ -163265,7 +163141,7 @@ empty list will be returned. A validation error will have two properties: module.exports = baseClone; /* WEBPACK VAR INJECTION */ - }.call(exports, __webpack_require__(163)(module))); + }).call(exports, __webpack_require__(163)(module)); /***/ }, @@ -172391,7 +172267,7 @@ empty list will be returned. A validation error will have two properties: }; loadTime = new Date().getTime(); } - }.call(this)); + }).call(this); //# sourceMappingURL=performance-now.js.map @@ -172677,8 +172553,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(); @@ -172987,8 +172863,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; @@ -175777,8 +175653,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/apps/cyberstorm-remix/app/Error.module.css b/apps/cyberstorm-remix/app/Error.module.css index d5bd2945a..1412c6d8a 100644 --- a/apps/cyberstorm-remix/app/Error.module.css +++ b/apps/cyberstorm-remix/app/Error.module.css @@ -10,7 +10,7 @@ } .description { - color: var(--color-text--accent); + color: var(--color-text-accent); font-weight: var(--font-weight-semibold); line-height: 1; } @@ -43,16 +43,22 @@ top: 10px; left: 15px; color: var(--glitch-color-1); - animation: paths 5s step-end infinite, opacity 5s step-end infinite, - font 8s step-end infinite, movement 10s step-end infinite; + animation: + paths 5s step-end infinite, + opacity 5s step-end infinite, + font 8s step-end infinite, + movement 10s step-end infinite; } .glitch::after { top: 5px; left: -10px; color: var(--glitch-color-2); - animation: paths 5s step-end infinite, opacity 5s step-end infinite, - font 7s step-end infinite, movement 8s step-end infinite; + animation: + paths 5s step-end infinite, + opacity 5s step-end infinite, + font 7s step-end infinite, + movement 8s step-end infinite; } @keyframes paths { diff --git a/apps/cyberstorm-remix/app/c/Community.css b/apps/cyberstorm-remix/app/c/Community.css new file mode 100644 index 000000000..34e6ccf23 --- /dev/null +++ b/apps/cyberstorm-remix/app/c/Community.css @@ -0,0 +1,120 @@ +@layer nimbus-layout { + .nimbus-community__metaitem { + display: flex; + gap: var(--gap-xs); + align-items: center; + color: var(--Meta-item-text-color--default, #c6c3ff); + font-weight: var(--font-weight-bold); + font-size: var(--font-size-body-md); + line-height: var(--line-height-lg); + + & > svg { + inline-size: var(--space-16); + } + } + + .nimbus-community__metalink { + display: flex; + gap: var(--gap-xs); + align-items: center; + font-weight: var(--font-weight-bold); + font-size: var(--font-size-body-md); + line-height: var(--line-height-lg); + + & > svg { + inline-size: var(--space-16); + } + } + + .nimbus-community__heroimg__wrapper { + --w: 56vw; + + position: absolute; + top: calc(-1 * (var(--header-height) + var(--content-padding-top-desktop))); + right: 0; + + z-index: -1; + width: var(--w); + height: calc(var(--w) * 0.45); + overflow: hidden; + } + + .nimbus-community__heroimg { + --w: 56vw; + + position: absolute; + + /* top: calc(-1 * (var(--header-height) + var(--content-padding-top-desktop))); */ + right: 0; + + z-index: -1; + width: var(--w); + height: calc(var(--w) * 0.45); + background-repeat: no-repeat; + background-position: 50%; + background-size: cover; + opacity: 0.6; + + /* stylelint-disable property-no-vendor-prefix */ + -webkit-mask-image: var(--gradients); + -webkit-mask-composite: source-in; + /* stylelint-enable property-no-vendor-prefix */ + mask-image: var(--gradients); + mask-composite: intersect; + + --gradients: linear-gradient( + 90deg, + transparent 0%, + white 70%, + transparent 100% + ), + linear-gradient(180deg, white 40%, transparent 95%); + } + + @media (width < 87.5rem) { + .nimbus-community__heroimg__wrapper { + width: 60vw; + height: 30vw; + } + + .nimbus-community__heroimg { + width: 60vw; + height: 30vw; + } + } + + @media (width <= 63.5rem) { + .nimbus-community__heroimg__wrapper { + top: calc(-1 * var(--header-height)); + width: 75vw; + height: 40vw; + } + + .nimbus-community__heroimg { + width: 75vw; + height: 40vw; + } + } + + @media (width <= 48rem) { + .nimbus-community__metaitem { + font-size: var(--font-size-body-sm); + } + + .nimbus-community__heroimg { + right: -2.5rem; + } + } + + @media (width < 25rem) { + .nimbus-community__heroimg__wrapper { + width: 80vw; + height: 60vw; + } + + .nimbus-community__heroimg { + width: 80vw; + height: 60vw; + } + } +} diff --git a/apps/cyberstorm-remix/app/c/CommunityCard.module.css b/apps/cyberstorm-remix/app/c/CommunityCard.module.css deleted file mode 100644 index 451271e30..000000000 --- a/apps/cyberstorm-remix/app/c/CommunityCard.module.css +++ /dev/null @@ -1,75 +0,0 @@ -.root { - display: flex; - flex-direction: row; - gap: var(--space-32); -} - -.image { - flex: 0 0 9rem; -} - -.info { - display: flex; - flex-direction: column; - gap: var(--space-4); - min-width: 0; -} - -@media (width <= 30rem) { - .root { - gap: var(--space-16); - } -} - -.meta { - display: flex; - flex-direction: row; - gap: var(--space-16); - padding-top: var(--space-16); -} - -.skeletonImage { - height: 12rem; - aspect-ratio: 3/4; -} - -.skeletonTitle { - width: 22rem; - height: 2.875rem; -} - -.skeletonMetas { - width: 6.5rem; - height: 1rem; -} - -.backgroundImg { - --w: 56vw; - - position: absolute; - top: calc(-1 * (var(--header-height) + var(--content-padding-top-desktop))); - right: 0; - - z-index: -1; - width: var(--w); - height: calc(var(--w) * 0.45); - background-repeat: no-repeat; - background-position: 50%; - background-size: cover; - opacity: 0.3; - - /* stylelint-disable property-no-vendor-prefix */ - -webkit-mask-image: var(--gradients); - -webkit-mask-composite: source-in; - /* stylelint-enable property-no-vendor-prefix */ - mask-image: var(--gradients); - mask-composite: intersect; - - --gradients: linear-gradient( - 90deg, - transparent 0%, - white 70%, - transparent 100% - ), - linear-gradient(180deg, white 40%, transparent 95%); -} diff --git a/apps/cyberstorm-remix/app/c/community.tsx b/apps/cyberstorm-remix/app/c/community.tsx index b642fab01..ef2f9561d 100644 --- a/apps/cyberstorm-remix/app/c/community.tsx +++ b/apps/cyberstorm-remix/app/c/community.tsx @@ -1,26 +1,21 @@ import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node"; import { useLoaderData } from "@remix-run/react"; import { - BreadCrumbs, - Button, - CollapsibleText, - CyberstormLink, - ImageWithFallback, - MetaItem, - Title, + Image, + NewBreadCrumbs, + NewIcon, + NewLink, } from "@thunderstore/cyberstorm"; -import styles from "./CommunityCard.module.css"; -import { formatInteger } from "@thunderstore/cyberstorm/src/utils/utils"; +import "./Community.css"; import { getDapper } from "cyberstorm/dapper/sessionUtils"; import { PackageSearch } from "~/commonComponents/PackageSearch/PackageSearch"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { - faBoxOpen, - faDownload, - faArrowUpRightFromSquare, -} from "@fortawesome/free-solid-svg-icons"; +import { faBook } from "@fortawesome/free-solid-svg-icons"; import { faDiscord } from "@fortawesome/free-brands-svg-icons"; import { ApiError } from "@thunderstore/thunderstore-api"; +import { PackageOrderOptions } from "~/commonComponents/PackageSearch/PackageOrder"; +import { faArrowUpRight } from "@fortawesome/pro-solid-svg-icons"; +import { PageHeader } from "~/commonComponents/PageHeader/PageHeader"; export const meta: MetaFunction = ({ data }) => { return [ @@ -34,7 +29,8 @@ export async function loader({ request, params }: LoaderFunctionArgs) { try { const dapper = await getDapper(); const searchParams = new URL(request.url).searchParams; - const order = searchParams.get("order"); + const ordering = + searchParams.get("ordering") ?? PackageOrderOptions.Updated; const page = searchParams.get("page"); const search = searchParams.get("search"); const includedCategories = searchParams.get("includedCategories"); @@ -42,34 +38,30 @@ export async function loader({ request, params }: LoaderFunctionArgs) { const section = searchParams.get("section"); const nsfw = searchParams.get("nsfw"); const deprecated = searchParams.get("deprecated"); - const created_recent = searchParams.get("created_recent"); - const updated_recent = searchParams.get("updated_recent"); - const created_after = searchParams.get("created_after"); - const created_before = searchParams.get("created_before"); - const updated_after = searchParams.get("updated_after"); - const updated_before = searchParams.get("updated_before"); + const community = await dapper.getCommunity(params.communityId); + const filters = await dapper.getCommunityFilters(params.communityId); return { - community: await dapper.getCommunity(params.communityId), - filters: await dapper.getCommunityFilters(params.communityId), + community: community, + filters: filters, listings: await dapper.getPackageListings( { kind: "community", communityId: params.communityId, }, - order ?? "", + ordering ?? "", page === null ? undefined : Number(page), search ?? "", includedCategories?.split(",") ?? undefined, excludedCategories?.split(",") ?? undefined, - section ?? "", + section + ? section === "all" + ? "" + : section + : filters.sections && filters.sections[0] + ? filters.sections[0].uuid + : "", nsfw === "true" ? true : false, - deprecated === "true" ? true : false, - created_recent ?? "", - updated_recent ?? "", - created_after ?? "", - created_before ?? "", - updated_after ?? "", - updated_before ?? "" + deprecated === "true" ? true : false ), }; } catch (error) { @@ -89,7 +81,8 @@ export async function clientLoader({ request, params }: LoaderFunctionArgs) { try { const dapper = await getDapper(true); const searchParams = new URL(request.url).searchParams; - const order = searchParams.get("order"); + const ordering = + searchParams.get("ordering") ?? PackageOrderOptions.Updated; const page = searchParams.get("page"); const search = searchParams.get("search"); const includedCategories = searchParams.get("includedCategories"); @@ -97,34 +90,30 @@ export async function clientLoader({ request, params }: LoaderFunctionArgs) { const section = searchParams.get("section"); const nsfw = searchParams.get("nsfw"); const deprecated = searchParams.get("deprecated"); - const created_recent = searchParams.get("created_recent"); - const updated_recent = searchParams.get("updated_recent"); - const created_after = searchParams.get("created_after"); - const created_before = searchParams.get("created_before"); - const updated_after = searchParams.get("updated_after"); - const updated_before = searchParams.get("updated_before"); + const community = await dapper.getCommunity(params.communityId); + const filters = await dapper.getCommunityFilters(params.communityId); return { - community: await dapper.getCommunity(params.communityId), - filters: await dapper.getCommunityFilters(params.communityId), + community: community, + filters: filters, listings: await dapper.getPackageListings( { kind: "community", communityId: params.communityId, }, - order ?? "", + ordering ?? "", page === null ? undefined : Number(page), search ?? "", includedCategories?.split(",") ?? undefined, excludedCategories?.split(",") ?? undefined, - section ?? "", + section + ? section === "all" + ? "" + : section + : filters.sections && filters.sections[0] + ? filters.sections[0].uuid + : "", nsfw === "true" ? true : false, - deprecated === "true" ? true : false, - created_recent ?? "", - updated_recent ?? "", - created_after ?? "", - created_before ?? "", - updated_after ?? "", - updated_before ?? "" + deprecated === "true" ? true : false ), }; } catch (error) { @@ -146,74 +135,89 @@ export default function Community() { return ( <> - {community.background_image_url ? ( -
+ {community.hero_image_url ? ( +
+
+
) : null} - - Communities - - {community.name} - - -
-
-
- -
-
- - {community.description ? ( - <CollapsibleText text={community.description} maxLength={85} /> + <NewBreadCrumbs rootClasses="nimbus-root__breadcrumbs"> + <NewLink + primitiveType="cyberstormLink" + linkId="Communities" + csVariant="cyber" + > + Communities + </NewLink> + {community.name} + </NewBreadCrumbs> + <PageHeader + image={ + <Image + src={community.cover_image_url} + cardType="community" + intrinsicWidth={360} + intrinsicHeight={480} + /> + } + heading={community.name} + headingLevel="1" + headingSize="3" + description={community.short_description} + meta={ + <> + {community.wiki_url ? ( + <NewLink + primitiveType="link" + href={community.wiki_url} + key="meta-wiki" + csVariant="cyber" + rootClasses="nimbus-community__metalink" + > + <NewIcon csMode="inline" noWrapper> + <FontAwesomeIcon icon={faBook} /> + </NewIcon> + <span className="nimbus-community__metaitem__text"> + <span className="nimbus-community__metaitem__text__prefix nimbus-hide-m"> + {community.name} modding{" "} + </span> + Wiki + </span> + <NewIcon csMode="inline" noWrapper> + <FontAwesomeIcon icon={faArrowUpRight} /> + </NewIcon> + </NewLink> ) : null} - <div className={styles.meta}> - {[ - <MetaItem - key="meta-packages" - label={`${formatInteger( - community.total_package_count - )} packages`} - icon={<FontAwesomeIcon icon={faBoxOpen} />} - colorScheme="accent" - size="bold_large" - />, - <MetaItem - key="meta-downloads" - label={`${formatInteger( - community.total_download_count - )} downloads`} - icon={<FontAwesomeIcon icon={faDownload} />} - colorScheme="accent" - size="bold_large" - />, - community.discord_url ? ( - <a key="meta-link" href="{community.discord_url}"> - <Button.Root colorScheme="transparentPrimary"> - <Button.ButtonIcon> - <FontAwesomeIcon icon={faDiscord} /> - </Button.ButtonIcon> - <Button.ButtonLabel> - Join our community - </Button.ButtonLabel> - <Button.ButtonIcon> - <FontAwesomeIcon icon={faArrowUpRightFromSquare} /> - </Button.ButtonIcon> - </Button.Root> - </a> - ) : null, - ]} - </div> - </div> - </div> - </header> - <main className="project-root__main"> + {community.discord_url ? ( + <NewLink + primitiveType="link" + href={community.discord_url} + key="meta-discord" + csVariant="cyber" + rootClasses="nimbus-community__metalink" + > + <NewIcon csMode="inline" noWrapper> + <FontAwesomeIcon icon={faDiscord} /> + </NewIcon> + <span className="nimbus-community__metaitem__text"> + <span className="nimbus-community__metaitem__text__prefix nimbus-hide-m"> + {community.name} modding{" "} + </span> + Discord + </span> + <NewIcon csMode="inline" noWrapper> + <FontAwesomeIcon icon={faArrowUpRight} /> + </NewIcon> + </NewLink> + ) : null} + </> + } + /> + <main className="nimbus-root__main"> <PackageSearch listings={listings} packageCategories={filters.package_categories} diff --git a/apps/cyberstorm-remix/app/commonComponents/CollapsibleText/CollapsibleText.css b/apps/cyberstorm-remix/app/commonComponents/CollapsibleText/CollapsibleText.css new file mode 100644 index 000000000..98131cb2d --- /dev/null +++ b/apps/cyberstorm-remix/app/commonComponents/CollapsibleText/CollapsibleText.css @@ -0,0 +1,57 @@ +.nimbus-commoncomponents-collapsibletext { + display: flex; + flex-direction: row; + gap: var(--space-8); + align-items: center; + min-width: 0; + max-width: 100%; +} + +.nimbus-commoncomponents-collapsibletext:has( + .nimbus-commoncomponents-collapsibletext__opened + ) { + flex-direction: column; + align-items: flex-start; +} + +.nimbus-commoncomponents-collapsibletext__text { + width: 100%; + min-width: 0; + max-width: 80ch; + max-height: 1lh; + overflow: hidden; + color: var(--color-text-tertiary); + font-weight: var(--font-weight-regular); + font-size: var(--font-size-body-lg); + line-height: var(--line-height-md); + white-space: nowrap; + text-overflow: ellipsis; + text-shadow: 0 1px 1px #0d0d21; + transition: max-height 500ms cubic-bezier(0, 1, 0, 1); +} + +.nimbus-commoncomponents-collapsibletext__opened { + max-height: 30rem; + white-space: normal; + transition: max-height 500ms; +} + +.nimbus-commoncomponents-collapsibletext__show { + color: var(--color-text-accent); + font-weight: var(--font-weight-bold); + font-size: var(--font-size-body-md); + line-height: normal; + text-wrap: nowrap; + background-color: transparent; +} + +@media (width <= 48rem) { + .nimbus-commoncomponents-collapsibletext__text { + font-size: var(--font-size-body-md); + line-height: var(--line-height-sm); + } + + .nimbus-commoncomponents-collapsibletext__show { + font-size: var(--font-size-body-sm); + } +} diff --git a/packages/cyberstorm/src/components/CollapsibleText/CollapsibleText.tsx b/apps/cyberstorm-remix/app/commonComponents/CollapsibleText/CollapsibleText.tsx similarity index 54% rename from packages/cyberstorm/src/components/CollapsibleText/CollapsibleText.tsx rename to apps/cyberstorm-remix/app/commonComponents/CollapsibleText/CollapsibleText.tsx index ac70c2834..c5469426a 100644 --- a/packages/cyberstorm/src/components/CollapsibleText/CollapsibleText.tsx +++ b/apps/cyberstorm-remix/app/commonComponents/CollapsibleText/CollapsibleText.tsx @@ -1,6 +1,5 @@ -"use client"; -import { classnames } from "../../utils/utils"; -import styles from "./CollapsibleText.module.css"; +import { classnames } from "@thunderstore/cyberstorm/src/utils/utils"; +import "./CollapsibleText.css"; import { ReactElement, useState } from "react"; export interface CollapsibleTextProps { @@ -9,9 +8,6 @@ export interface CollapsibleTextProps { meta?: ReactElement[]; } -/** - * Cyberstorm CollapsibleText - */ export function CollapsibleText(props: CollapsibleTextProps) { const { text = "", maxLength = 80 } = props; @@ -19,12 +15,20 @@ export function CollapsibleText(props: CollapsibleTextProps) { const [opened, setOpened] = useState(!textIsTooLong); return ( - <div className={styles.root}> - <p className={classnames(styles.text, opened ? styles.opened : null)}> + <div className="nimbus-commoncomponents-collapsibletext"> + <p + className={classnames( + "nimbus-commoncomponents-collapsibletext__text", + opened ? "nimbus-commoncomponents-collapsibletext__opened" : null + )} + > {text} </p> {textIsTooLong ? ( - <button className={styles.show} onClick={() => setOpened(!opened)}> + <button + className="nimbus-commoncomponents-collapsibletext__show" + onClick={() => setOpened(!opened)} + > {opened ? "Show less" : "Show more"} </button> ) : null} diff --git a/apps/cyberstorm-remix/app/commonComponents/Footer/Footer.css b/apps/cyberstorm-remix/app/commonComponents/Footer/Footer.css index db3d46898..e14718e9d 100644 --- a/apps/cyberstorm-remix/app/commonComponents/Footer/Footer.css +++ b/apps/cyberstorm-remix/app/commonComponents/Footer/Footer.css @@ -1,39 +1,40 @@ -@layer project-layout { - .project-footer { +@layer nimbus-layout { + .nimbus-footer { width: 100%; + padding-top: 4.5rem; --border: var(--space-px) solid #27275d; } @media (width <= 63.5rem) { - .project-footer__item { + .nimbus-footer__item { padding-right: 1.5rem; padding-left: 1.5rem; } } - .project-footer__main { + .nimbus-footer__main { display: flex; flex-direction: column; } - .project-footer__section { + .nimbus-footer__section { display: flex; flex-direction: column; } - .project-footer__item { + .nimbus-footer__item { display: flex; flex: 1; border-top: var(--border); } - .project-footer__extra { + .nimbus-footer__extra { position: relative; order: -1; } - .project-footer__extra::before { + .nimbus-footer__extra::before { position: absolute; right: 0; bottom: 0; @@ -51,22 +52,22 @@ aspect-ratio: 5/1; } - .project-footer__inner { + .nimbus-footer__inner { display: flex; flex: 1; padding-block: var(--space-32); width: 100%; } - .project-footer__adwrapper .project-footer__inner { + .nimbus-footer__adwrapper .nimbus-footer__inner { padding-bottom: 0; } - .project-footer__company { + .nimbus-footer__company { order: 2; } - .project-footer__footnote { + .nimbus-footer__footnote { padding-block: var(--space-32); padding-block-end: 5.5rem; @@ -74,7 +75,7 @@ --link-color-hover: var(--color-text-primary); } - .project-footer__footnotecopyright { + .nimbus-footer__footnotecopyright { color: rgb(197 194 255 / 0.6) !important; font-weight: var(--font-weight-regular); font-size: var(--font-size-body-sm); @@ -82,7 +83,7 @@ text-align: center; } - .project-footer__footnoteinner { + .nimbus-footer__footnoteinner { display: flex; flex-direction: column; gap: 1.5rem; @@ -94,27 +95,27 @@ margin-inline: auto; } - .project-footer__nav { + .nimbus-footer__nav { display: flex; gap: var(--space-40); justify-content: center; width: 100%; } - .project-footer__navsection { + .nimbus-footer__navsection { display: flex; flex-direction: column; gap: var(--space-24); } - .project-footer__ad { + .nimbus-footer__ad { display: flex; flex-direction: column; gap: var(--space-32); max-width: 100%; } - .project-footer__adtext { + .nimbus-footer__adtext { display: flex; flex: 1; flex-direction: column; @@ -122,7 +123,7 @@ padding-bottom: 1rem; } - .project-footer__addescription { + .nimbus-footer__addescription { max-width: 29rem; color: var(--color-text-accent); font-weight: 400; @@ -130,11 +131,11 @@ line-height: var(--line-height-md); } - .project-footer__getmanagerbutton { + .nimbus-footer__getmanagerbutton { width: fit-content; } - .project-footer__img { + .nimbus-footer__img { position: relative; aspect-ratio: 2.5/1; object-fit: cover; @@ -142,24 +143,24 @@ box-shadow: -36px -36px 40px 0 rgb(0 0 0 / 0.35); } - .project-footer__logoandlinks { + .nimbus-footer__logoandlinks { display: flex; flex-direction: column; gap: var(--gap-xxxl); align-items: center; } - .project-footer__logo { + .nimbus-footer__logo { height: 2rem; } - .project-footer__iconlinks { + .nimbus-footer__iconlinks { display: flex; gap: 30px; color: var(--color-text-accent); } - .project-footer__iconlink { + .nimbus-footer__iconlink { display: flex; align-items: center; justify-content: center; @@ -167,14 +168,14 @@ border-radius: var(--radius-md); } - .project-footer__footerpageslinks { + .nimbus-footer__footerpageslinks { display: flex; gap: var(--gap-xxxl); font-weight: var(--font-weight-regular); font-size: var(--font-size-body-sm); } - .project-footer__footerlist { + .nimbus-footer__footerlist { display: flex; flex-direction: column; gap: var(--gap-xs); @@ -183,83 +184,87 @@ list-style-type: none; } - .project-footer__info { + .nimbus-footer__opensource { + color: var(--color-text-accent); + } + + .nimbus-footer__info { --link-color: var(--color-text-accent); --link-color-hover: var(--color-text-primary); } @media (width >= calc(63.5rem + 1px)) { - .project-footer__logoandlinks { + .nimbus-footer__logoandlinks { flex-direction: row; justify-content: space-between; } } @media (width >= calc(63.5rem + 1px)) { - .project-footer__main { + .nimbus-footer__main { flex-direction: row; } - .project-footer__section { + .nimbus-footer__section { flex: 0 0 50%; } - .project-footer__info .project-footer__item { + .nimbus-footer__info .nimbus-footer__item { justify-content: flex-end; } - .project-footer__inner { + .nimbus-footer__inner { flex: 0 1 45rem; padding-block: 4.5rem; } - .project-footer__company .project-footer__inner, - .project-footer__linkswrapper .project-footer__inner { + .nimbus-footer__company .nimbus-footer__inner, + .nimbus-footer__linkswrapper .nimbus-footer__inner { padding-right: 3.5rem; } - .project-footer__company { + .nimbus-footer__company { align-items: center; order: 0; } - .project-footer__extra { + .nimbus-footer__extra { order: 0; border-left: var(--border); } - .project-footer__adwrapper .project-footer__inner { + .nimbus-footer__adwrapper .nimbus-footer__inner { padding-top: 5rem; padding-bottom: 0; padding-left: 5rem; } - .project-footer__logoandlinks, - .project-footer__navlinks { + .nimbus-footer__logoandlinks, + .nimbus-footer__navlinks { margin-left: 4.5rem; } - .project-footer__footnote { + .nimbus-footer__footnote { padding-block-end: var(--space-32); } - .project-footer__nav { + .nimbus-footer__nav { gap: 7rem; justify-content: flex-start; } - .project-footer__footnoteinner { + .nimbus-footer__footnoteinner { flex-direction: row; justify-content: space-between; } - .project-footer__ad { + .nimbus-footer__ad { padding-right: 3.125rem; } } @media (width <= 23.25rem) { - .project-footer__nav { + .nimbus-footer__nav { flex-flow: wrap; justify-content: flex-start; } diff --git a/apps/cyberstorm-remix/app/commonComponents/Footer/Footer.tsx b/apps/cyberstorm-remix/app/commonComponents/Footer/Footer.tsx index dc0ecf5fc..7c7927f26 100644 --- a/apps/cyberstorm-remix/app/commonComponents/Footer/Footer.tsx +++ b/apps/cyberstorm-remix/app/commonComponents/Footer/Footer.tsx @@ -1,17 +1,15 @@ import "./Footer.css"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faDiscord, faGithub } from "@fortawesome/free-brands-svg-icons"; -import { - faArrowUpRightFromSquare, - faBoltLightning, -} from "@fortawesome/free-solid-svg-icons"; +import { faBoltLightning } from "@fortawesome/free-solid-svg-icons"; import { ThunderstoreLogoHorizontal } from "@thunderstore/cyberstorm/src/svg/svg"; import { Heading, - LinkButton, + NewButton, NewIcon, NewLink, } from "@thunderstore/cyberstorm/src"; +import { faArrowUpRight } from "@fortawesome/pro-solid-svg-icons"; const AD_IMAGE_SRC = "/cyberstorm-static/images/tsmm_screenshot.png"; const DISCORD_URL = "https://discord.thunderstore.io/"; @@ -22,20 +20,20 @@ const GITHUB_URL = "https://github.com/thunderstore-io"; */ export function Footer() { return ( - <footer className="project-footer" aria-label="Footer"> - <div className="project-footer__main"> - <div className="project-footer__section project-footer__info"> - <div className="project-footer__item project-footer__company"> - <div className="project-footer__inner project-footer__logoandlinks"> - <NewIcon csVariant="accent" wrapperClasses="project-footer__logo"> + <footer className="nimbus-footer" aria-label="Footer"> + <div className="nimbus-footer__main"> + <div className="nimbus-footer__section nimbus-footer__info"> + <div className="nimbus-footer__item nimbus-footer__company"> + <div className="nimbus-footer__inner nimbus-footer__logoandlinks"> + <NewIcon csVariant="accent" wrapperClasses="nimbus-footer__logo"> <ThunderstoreLogoHorizontal /> </NewIcon> - <div className="project-footer__iconlinks"> + <div className="nimbus-footer__iconlinks"> <NewLink primitiveType="link" tooltipText="Join our Discord" href={DISCORD_URL} - rootClasses="project-footer__iconlink" + rootClasses="nimbus-footer__iconlink" aria-label="Invite link to Thunderstores Discord server" > <NewIcon noWrapper> @@ -46,7 +44,7 @@ export function Footer() { primitiveType="link" tooltipText="Check out our GitHub" href={GITHUB_URL} - rootClasses="project-footer__iconlink" + rootClasses="nimbus-footer__iconlink" aria-label="Link to Thunderstores Github" > <NewIcon noWrapper> @@ -56,10 +54,10 @@ export function Footer() { </div> </div> </div> - <div className="project-footer__item project-footer__linkswrapper"> - <div className="project-footer__inner project-footer__navlinks"> - <nav className="project-footer__nav" aria-label="Footer links"> - <div className="project-footer__navsection"> + <div className="nimbus-footer__item nimbus-footer__linkswrapper"> + <div className="nimbus-footer__inner nimbus-footer__navlinks"> + <nav className="nimbus-footer__nav" aria-label="Footer links"> + <div className="nimbus-footer__navsection"> <Heading csVariant="primary" mode="heading" @@ -68,7 +66,7 @@ export function Footer() { > Thunderstore </Heading> - <ul className="project-footer__footerlist"> + <ul className="nimbus-footer__footerlist"> <li> <NewLink primitiveType="cyberstormLink" @@ -79,7 +77,7 @@ export function Footer() { </li> </ul> </div> - <div className="project-footer__navsection"> + <div className="nimbus-footer__navsection"> <Heading csVariant="primary" mode="heading" @@ -88,7 +86,7 @@ export function Footer() { > Developers </Heading> - <ul className="project-footer__footerlist"> + <ul className="nimbus-footer__footerlist"> <li> <NewLink primitiveType="link" href="/api/docs"> API Documentation @@ -133,38 +131,40 @@ export function Footer() { </div> </div> - <div className="project-footer__section project-footer__extra"> - <div className="project-footer__item project-footer__adwrapper"> - <div className="project-footer__inner"> - <div className="project-footer__ad"> - <div className="project-footer__adtext"> + <div className="nimbus-footer__section nimbus-footer__extra"> + <div className="nimbus-footer__item nimbus-footer__adwrapper"> + <div className="nimbus-footer__inner"> + <div className="nimbus-footer__ad"> + <div className="nimbus-footer__adtext"> <Heading mode="display" csLevel="2" csSize="3"> Thunderstore Mod Manager </Heading> - <div className="project-footer__addescription"> + <div className="nimbus-footer__addescription"> You are prepared. Download Thunderstore Mod Manager for desktop and enter a world of Thunder{" "} <NewIcon csMode="inline" noWrapper> <FontAwesomeIcon icon={faBoltLightning} /> </NewIcon> </div> - <LinkButton + <NewButton primitiveType="link" href="https://www.overwolf.com/app/Thunderstore-Thunderstore_Mod_Manager" csSize="big" csVariant="accent" - rootClasses="project-footer__getmanagerbutton" + rootClasses="nimbus-footer__getmanagerbutton" > Get Manager <NewIcon csMode="inline" noWrapper> - <FontAwesomeIcon icon={faArrowUpRightFromSquare} /> + <FontAwesomeIcon icon={faArrowUpRight} /> </NewIcon> - </LinkButton> + </NewButton> </div> <img alt="Screenshot of the Thunderstore Mod Manager" + width="1350" + height="811" src={AD_IMAGE_SRC} - className="project-footer__img" + className="nimbus-footer__img" /> </div> </div> @@ -172,9 +172,9 @@ export function Footer() { </div> </div> - <div className="project-footer__item project-footer__footnote"> - <div className="project-footer__footnoteinner"> - <div className="project-footer__footerpageslinks"> + <div className="nimbus-footer__item nimbus-footer__footnote"> + <div className="nimbus-footer__footnoteinner"> + <div className="nimbus-footer__footerpageslinks"> <NewLink primitiveType="link" href="https://pages.thunderstore.io/p/contact-us" @@ -191,13 +191,13 @@ export function Footer() { News </NewLink> </div> - <div className="project-footer__footnotecopyright"> + <div className="nimbus-footer__footnotecopyright"> © 2024 Thunderstore and contributors. This page is{" "} <NewLink primitiveType="link" href="https://github.com/thunderstore-io/thunderstore-ui/" aria-label="This page is open source, link to Thunderstore UIs Github page" - rootClasses="project-footer__opensource" + rootClasses="nimbus-footer__opensource" > open-source ❤ </NewLink> diff --git a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/CategoryTagCloud/CategoryTagCloud.module.css b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/CategoryTagCloud/CategoryTagCloud.module.css index 6512d1965..28a1abb0b 100644 --- a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/CategoryTagCloud/CategoryTagCloud.module.css +++ b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/CategoryTagCloud/CategoryTagCloud.module.css @@ -21,10 +21,16 @@ } .icon { - height: var(--space-16); + width: var(--space-14); + height: var(--space-14); color: var(--text-color); } .tag.exclude .icon { --text-color: var(--old--color-accent-red-3); } + +.clearButton { + height: var(--button-xs-height); + color: var(--color-text-accent); +} diff --git a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/CategoryTagCloud/CategoryTagCloud.tsx b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/CategoryTagCloud/CategoryTagCloud.tsx index b7899581a..6a9aaa872 100644 --- a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/CategoryTagCloud/CategoryTagCloud.tsx +++ b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/CategoryTagCloud/CategoryTagCloud.tsx @@ -1,16 +1,15 @@ -import { faXmark } from "@fortawesome/free-solid-svg-icons"; +import { faBan, faXmark } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { Dispatch, SetStateAction } from "react"; import styles from "./CategoryTagCloud.module.css"; import { CategorySelection, CATEGORY_STATES } from "../types"; -import { Button } from "@thunderstore/cyberstorm"; +import { NewButton, NewIcon, NewTag } from "@thunderstore/cyberstorm"; const OFF = CATEGORY_STATES[0]; interface Props { categories: CategorySelection[]; - setCategories: Dispatch<SetStateAction<CategorySelection[]>>; + setCategories: (v: CategorySelection[]) => void; } /** @@ -35,26 +34,39 @@ export const CategoryTagCloud = (props: Props) => { return ( <div className={styles.root}> {visible.map((c) => ( - <Button.Root + <NewTag + csMode="button" key={c.slug} onClick={() => clearCategory(c.id)} - colorScheme={c.selection === "exclude" ? "danger" : "default"} - paddingSize="small" - style={{ gap: "0.5rem" }} + csVariant={c.selection === "exclude" ? "red" : "primary"} + csSize="medium" + csModifiers={ + c.selection === "exclude" ? ["dark", "hoverable"] : ["hoverable"] + } > - <Button.ButtonLabel>{c.name}</Button.ButtonLabel> - <Button.ButtonIcon> - <FontAwesomeIcon icon={faXmark} className={styles.icon} /> - </Button.ButtonIcon> - </Button.Root> + {c.selection === "exclude" ? ( + <NewIcon csMode="inline"> + <FontAwesomeIcon icon={faBan} /> + </NewIcon> + ) : undefined} + {c.name} + <NewIcon csMode="inline" noWrapper rootClasses={styles.icon}> + <FontAwesomeIcon icon={faXmark} /> + </NewIcon> + </NewTag> ))} - <Button.Root + <NewButton onClick={clearAll} - colorScheme="transparentTertiary" - paddingSize="small" + csVariant="secondary" + csSize="small" + csModifiers={["ghost"]} + rootClasses={styles.clearButton} > - <Button.ButtonLabel>Clear all</Button.ButtonLabel> - </Button.Root> + Clear all + <NewIcon csMode="inline" noWrapper> + <FontAwesomeIcon icon={faXmark} className={styles.icon} /> + </NewIcon> + </NewButton> </div> ); }; diff --git a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CategoryMenu.tsx b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CategoryMenu.tsx index 4b24faf4d..ef90fabff 100644 --- a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CategoryMenu.tsx +++ b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CategoryMenu.tsx @@ -1,16 +1,21 @@ -import { faCheck, faXmark } from "@fortawesome/free-solid-svg-icons"; +import { + faSquare, + faSquareCheck, + faSquareXmark, +} from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import * as Checkbox from "@radix-ui/react-checkbox"; -import { Dispatch, SetStateAction } from "react"; import styles from "./FilterMenu.module.css"; import { CategorySelection, CATEGORY_STATES as STATES } from "../types"; -import { Icon } from "@thunderstore/cyberstorm"; +import { NewIcon } from "@thunderstore/cyberstorm"; import { classnames } from "@thunderstore/cyberstorm/src/utils/utils"; interface Props { categories: CategorySelection[]; - setCategories: Dispatch<SetStateAction<CategorySelection[]>>; + includedCategories: string; + excludedCategories: string; + setCategories: (v: CategorySelection[]) => void; } /** @@ -19,33 +24,43 @@ interface Props { * TODO TS-1715: show number of packages on each category. */ export const CategoryMenu = (props: Props) => { - const { categories, setCategories } = props; + const { categories, includedCategories, excludedCategories, setCategories } = + props; - const toggleCategory = (id: string) => setCategories(toggle(categories, id)); + const parsedCategories = parseCategories( + categories, + includedCategories, + excludedCategories + ); + const toggleCategory = (id: string) => + setCategories(toggle(parsedCategories, id)); - if (categories.length) { + if (parsedCategories.length) { return ( <ol className={styles.list}> - {categories.map((c) => ( + {parsedCategories.map((c) => ( <li key={c.slug}> - <label - className={classnames( - styles.label, - c.selection !== "off" ? styles[c.selection] : undefined - )} - > + <label className={classnames(styles.label, styles[c.selection])}> <Checkbox.Root checked={c.selection !== "off"} onCheckedChange={() => toggleCategory(c.id)} className={styles.checkbox} > - <Checkbox.Indicator> - <Icon> + {c.selection === "off" ? ( + <NewIcon csMode="inline" noWrapper> + <FontAwesomeIcon icon={faSquare} /> + </NewIcon> + ) : null} + <Checkbox.Indicator asChild> + <NewIcon csMode="inline" noWrapper> <FontAwesomeIcon - icon={c.selection === "include" ? faCheck : faXmark} - className={styles.icon} + icon={ + c.selection === "include" + ? faSquareCheck + : faSquareXmark + } /> - </Icon> + </NewIcon> </Checkbox.Indicator> </Checkbox.Root> {c.name} @@ -55,7 +70,7 @@ export const CategoryMenu = (props: Props) => { </ol> ); } else { - return <p className={styles.empty}>No categories</p>; + return <p>No categories</p>; } }; @@ -74,3 +89,19 @@ const toggle = (categories: CategorySelection[], targetId: string) => } return c; }); + +function parseCategories( + categories: CategorySelection[], + includedCategories: string, + excludedCategories: string +): CategorySelection[] { + const iCArr = includedCategories.split(","); + const eCArr = excludedCategories.split(","); + return categories.map((c) => + iCArr.includes(c.id) + ? { ...c, selection: "include" } + : eCArr.includes(c.id) + ? { ...c, selection: "exclude" } + : c + ); +} diff --git a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CollapsibleMenu.module.css b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CollapsibleMenu.module.css index 592807e87..85b13d386 100644 --- a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CollapsibleMenu.module.css +++ b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CollapsibleMenu.module.css @@ -1,97 +1,14 @@ .root { display: flex; flex-direction: column; - font-size: var(--font-size-body-lg); -} - -.header, -.empty { - padding: var(--space-8) var(--space-12); - font-weight: var(--font-weight-boldest); - font-size: var(--font-size-body-xxxxl); + font-size: var(--font-size-body-md); } .header { display: flex; + gap: var(--gap-md); justify-content: space-between; -} - -.list { - list-style: none; -} - -.label { - display: flex; - gap: var(--gap-sm); - align-items: center; padding: var(--space-8) var(--space-12); - border-radius: var(--radius-md); - color: var(--color-text--secondary); font-weight: var(--font-weight-bold); - cursor: pointer; - transition: var(--animation-duration-xs); - user-select: none; - - --mark-color: var(--old--color-accent-purple-6); -} - -.label:hover { - background-color: var(--color-surface-4); - - --mark-color: var(--old--color-accent-purple-2); -} - -.checkbox { - width: var(--space-18); - height: var(--space-18); - border-radius: var(--radius-xs); - background-color: var(--mark-color); - transition: ease-out var(--animation-duration-xs); -} - -.label:hover .checkbox { - --mark-color: #4343a3; -} - -.label.include, -.label.include .checkbox { - color: var(--color-highlight); - - --mark-color: var(--color-highlight); -} - -.label.exclude, -.label.exclude .checkbox { - color: var(--color-danger); - - --mark-color: var(--color-danger); -} - -.icon { - height: var(--space-16); - color: var(--color-surface-0); -} - -.radio { - display: flex; - align-items: center; - justify-content: center; - width: var(--space-16); - height: var(--space-16); - border: var(--space-2) solid var(--color-surface-7); - border-radius: var(--radius-md); - background-color: transparent; - transition: ease-out var(--animation-duration-xs); -} - -.radio.radioSelected { - border-color: var(--mark-color); -} - -.radioIndicator { - display: block; - width: var(--space-6); - height: var(--space-6); - border-radius: 50%; - background-color: var(--mark-color); + font-size: var(--font-size-body-lg); } diff --git a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CollapsibleMenu.tsx b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CollapsibleMenu.tsx index 76e30be37..109f42116 100644 --- a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CollapsibleMenu.tsx +++ b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CollapsibleMenu.tsx @@ -2,7 +2,8 @@ import { PropsWithChildren } from "react"; import { faCaretDown } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import styles from "./CollapsibleMenu.module.css"; -import { Icon } from "@thunderstore/cyberstorm"; +import { NewIcon } from "@thunderstore/cyberstorm"; +import { classnames } from "@thunderstore/cyberstorm/src/utils/utils"; interface Props extends PropsWithChildren { headerTitle: string; @@ -17,11 +18,16 @@ export const CollapsibleMenu = (props: Props) => { return ( <details className={styles.root} open={defaultOpen}> - <summary className={styles.header}> + <summary + className={classnames( + "ts-button ts-variant--secondary ts-size--big ts-modifier--ghost", + styles.header + )} + > {headerTitle} - <Icon inline> + <NewIcon csMode="inline" noWrapper> <FontAwesomeIcon icon={faCaretDown} /> - </Icon> + </NewIcon> </summary> {children} </details> diff --git a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/FilterMenu.module.css b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/FilterMenu.module.css index 3d7ed801e..e05004d6e 100644 --- a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/FilterMenu.module.css +++ b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/FilterMenu.module.css @@ -1,91 +1,125 @@ -.root { - display: flex; - flex-direction: column; - font-size: var(--font-size-body-lg); -} - -.header, -.empty { - padding: var(--space-8) var(--space-12); - font-size: var(--font-size-body-lg); -} - -.list { - list-style: none; -} - .label { display: flex; gap: var(--gap-sm); align-items: center; padding: var(--space-8) var(--space-12); border-radius: var(--radius-md); - color: var(--color-text--secondary); - font-weight: var(--font-weight-bold); + color: var(--color-text-secondary); + font-weight: var(--font-weight-regular); + font-size: var(--font-size-body-md); cursor: pointer; transition: var(--animation-duration-xs); user-select: none; - --mark-color: var(--old--color-accent-purple-6); -} + &.unselected { + --icon-color: var(--color-surface-a8); + } -.label:hover { - background-color: var(--color-surface-4); + &.selected { + color: var(--color-cyber-green-7); + font-weight: var(--font-weight-bold); - --mark-color: var(--old--color-accent-purple-2); -} + --icon-color: var(--color-cyber-green-7); + } -.checkbox { - width: var(--space-18); - height: var(--space-18); - border-radius: var(--radius-xs); - background-color: var(--mark-color); - transition: ease-out var(--animation-duration-xs); -} + &.off { + color: var(--color-text-secondary); -.label:hover .checkbox { - --mark-color: #4343a3; -} + & > .checkbox > svg { + --icon-color: var(--color-surface-a8); + } + } -.label.include, -.label.include .checkbox { - color: var(--color-highlight); + &.include { + color: var(--color-cyber-green-7); + font-weight: var(--font-weight-bold); - --mark-color: var(--color-highlight); -} + & > .checkbox > svg { + --icon-color: var(--color-cyber-green-7); + } + } -.label.exclude, -.label.exclude .checkbox { - color: var(--color-danger); + &.exclude { + color: var(--color-accent-red-7); + font-weight: var(--font-weight-bold); - --mark-color: var(--color-danger); -} + & > .checkbox > svg { + --icon-color: var(--color-accent-red-7); + } + } -.icon { - height: var(--space-16); - color: var(--color-surface-0); + &:hover { + color: var(--color-text-primary); + background-color: var(--color-surface-a5); + + &.unselected { + --icon-color: var(--color-surface-a10); + } + + &.selected { + color: var(--color-cyber-green-8); + + --icon-color: var(--color-cyber-green-8); + } + + &.off { + color: var(--color-text-primary); + + & > .checkbox > svg { + --icon-color: var(--color-surface-a10); + } + } + + &.include { + color: var(--color-cyber-green-8); + + & > .checkbox > svg { + --icon-color: var(--color-cyber-green-8); + } + } + + &.exclude { + color: var(--color-accent-red-8); + + & > .checkbox > svg { + --icon-color: var(--color-accent-red-8); + } + } + } } +/* RADIO GROUP */ .radio { display: flex; align-items: center; justify-content: center; width: var(--space-16); height: var(--space-16); - border: var(--space-2) solid var(--color-surface-7); - border-radius: var(--radius-md); background-color: transparent; transition: ease-out var(--animation-duration-xs); } -.radio.radioSelected { - border-color: var(--mark-color); -} - .radioIndicator { + position: absolute; display: block; - width: var(--space-6); - height: var(--space-6); - border-radius: 50%; - background-color: var(--mark-color); + width: var(--space-16); + height: var(--space-16); +} + +/* CATEGORY MENU */ +.list { + list-style: none; +} + +.checkbox { + display: flex; + align-items: center; + justify-content: center; + width: var(--space-20); + height: var(--space-20); + + --icon-inline-size: var(--space-20); + + background-color: transparent; + transition: ease-out var(--animation-duration-xs); } diff --git a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/OthersMenu.tsx b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/OthersMenu.tsx index a05a294e8..e5e319dae 100644 --- a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/OthersMenu.tsx +++ b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/OthersMenu.tsx @@ -1,24 +1,23 @@ -import { faCheck } from "@fortawesome/free-solid-svg-icons"; +import { faSquare, faSquareCheck } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import * as Checkbox from "@radix-ui/react-checkbox"; -import { Dispatch, SetStateAction } from "react"; import styles from "./FilterMenu.module.css"; -import { Icon } from "@thunderstore/cyberstorm"; +import { NewIcon } from "@thunderstore/cyberstorm"; import { classnames } from "@thunderstore/cyberstorm/src/utils/utils"; interface Props { deprecated: boolean; - setDeprecated: Dispatch<SetStateAction<boolean>>; + setDeprecated: (v: boolean) => void; nsfw: boolean; - setNsfw: Dispatch<SetStateAction<boolean>>; + setNsfw: (v: boolean) => void; } /** * Allow filtering packages by other attributes on PackageSearch. */ export const OthersMenu = (props: Props) => { - const filters: [boolean, Dispatch<SetStateAction<boolean>>, string][] = [ + const filters: [boolean, (v: boolean) => void, string][] = [ [props.nsfw, props.setNsfw, "NSFW"], [props.deprecated, props.setDeprecated, "Deprecated"], ]; @@ -30,7 +29,7 @@ export const OthersMenu = (props: Props) => { <label className={classnames( styles.label, - checked ? styles.include : null + checked ? styles.include : styles.off )} > <Checkbox.Root @@ -38,11 +37,9 @@ export const OthersMenu = (props: Props) => { onCheckedChange={() => setChecked(!checked)} className={styles.checkbox} > - <Checkbox.Indicator> - <Icon> - <FontAwesomeIcon icon={faCheck} className={styles.icon} /> - </Icon> - </Checkbox.Indicator> + <NewIcon csMode="inline" noWrapper> + <FontAwesomeIcon icon={checked ? faSquareCheck : faSquare} /> + </NewIcon> </Checkbox.Root> {label} </label> diff --git a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/SectionMenu.tsx b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/SectionMenu.tsx index 24200b314..7492b0862 100644 --- a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/SectionMenu.tsx +++ b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/SectionMenu.tsx @@ -1,14 +1,15 @@ import * as RadioGroup from "@radix-ui/react-radio-group"; import { Section } from "@thunderstore/dapper/types"; -import { Dispatch, SetStateAction } from "react"; - +import { faCircle, faCircleDot } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import styles from "./FilterMenu.module.css"; import { classnames } from "@thunderstore/cyberstorm/src/utils/utils"; +import { NewIcon } from "@thunderstore/cyberstorm"; interface Props { allSections: Section[]; selected: string; - setSelected: Dispatch<SetStateAction<string>>; + setSelected: (v: string) => void; } /** @@ -24,21 +25,53 @@ export const SectionMenu = (props: Props) => { key={s.slug} className={classnames( styles.label, - s.uuid === selected ? styles.include : null + s.uuid === selected ? styles.selected : styles.unselected )} > - <RadioGroup.Item - value={s.uuid} - className={classnames( - styles.radio, - s.uuid === selected ? styles.radioSelected : null - )} - > - <RadioGroup.Indicator className={styles.radioIndicator} /> + <RadioGroup.Item value={s.uuid} className={styles.radio}> + {s.uuid !== selected ? ( + <NewIcon csMode="inline" noWrapper> + <FontAwesomeIcon icon={faCircle} /> + </NewIcon> + ) : undefined} + <RadioGroup.Indicator asChild> + <NewIcon + csMode="inline" + noWrapper + rootClasses={styles.radioIndicator} + > + <FontAwesomeIcon icon={faCircleDot} /> + </NewIcon> + </RadioGroup.Indicator> </RadioGroup.Item> {s.name} </label> ))} + <label + key={"all"} + className={classnames( + styles.label, + selected === "all" ? styles.selected : styles.unselected + )} + > + <RadioGroup.Item value={"all"} className={styles.radio}> + {selected !== "all" ? ( + <NewIcon csMode="inline" noWrapper> + <FontAwesomeIcon icon={faCircle} /> + </NewIcon> + ) : undefined} + <RadioGroup.Indicator asChild> + <NewIcon + csMode="inline" + noWrapper + rootClasses={styles.radioIndicator} + > + <FontAwesomeIcon icon={faCircleDot} /> + </NewIcon> + </RadioGroup.Indicator> + </RadioGroup.Item> + All + </label> </RadioGroup.Root> ); }; diff --git a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageList.module.css b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageList.module.css index 94373bfee..81e78798e 100644 --- a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageList.module.css +++ b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageList.module.css @@ -7,13 +7,15 @@ .top { display: flex; flex-direction: row-reverse; + gap: var(--gap-md); align-items: center; justify-content: space-between; } .packageCount { - color: var(--color-text--tertiary); - font-size: var(--font-size-body-lg); + width: max-content; + color: var(--color-text-tertiary); + font-size: var(--font-size-body-md); } .order { @@ -24,7 +26,7 @@ } .sortByText { - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); font-weight: var(--font-weight-bold); font-size: var(--font-size-body-lg); white-space: nowrap; @@ -33,11 +35,7 @@ .packages { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); - gap: var(--gap-xl); -} - -.packagesIsFiltersVisible { - grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); + gap: var(--gap-sm); } .packageCardSkeleton { @@ -64,6 +62,12 @@ height: var(--space-36); } +@media (width < 63.5rem) { + .packages { + grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); + } +} + @media (width <= 43.75rem) { .top { flex-direction: column-reverse; @@ -79,4 +83,14 @@ .sortByText { display: none; } + + .packages { + grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); + } +} + +@media (width < 31rem) { + .packages { + grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); + } } diff --git a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageOrder.tsx b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageOrder.tsx index b5bf952e4..798a8ab1e 100644 --- a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageOrder.tsx +++ b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageOrder.tsx @@ -1,21 +1,20 @@ import { - faClock, + faClockRotateLeft, faDownload, faThumbsUp, } from "@fortawesome/free-solid-svg-icons"; -import { faHandSparkles } from "@fortawesome/free-solid-svg-icons"; +import { faSparkles } from "@fortawesome/pro-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { Dispatch, SetStateAction } from "react"; -import { Select } from "@thunderstore/cyberstorm"; +import { NewSelect } from "@thunderstore/cyberstorm"; interface Props { - order: PackageOrderOptions; - setOrder: Dispatch<SetStateAction<PackageOrderOptions>>; + order: PackageOrderOptionsType; + setOrder: (val: PackageOrderOptionsType) => void; } export const PackageOrder = (props: Props) => ( - <Select + <NewSelect options={selectOptions} value={props.order} onChange={props.setOrder} @@ -29,17 +28,18 @@ export enum PackageOrderOptions { Rated = "top-rated", Updated = "last-updated", } +export type PackageOrderOptionsType = `${PackageOrderOptions}`; const selectOptions = [ { value: PackageOrderOptions.Updated, label: "Last updated", - leftIcon: <FontAwesomeIcon icon={faClock} />, + leftIcon: <FontAwesomeIcon icon={faClockRotateLeft} />, }, { value: PackageOrderOptions.Created, label: "Newest", - leftIcon: <FontAwesomeIcon icon={faHandSparkles} />, + leftIcon: <FontAwesomeIcon icon={faSparkles} />, }, { value: PackageOrderOptions.Downloaded, diff --git a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageRecent.tsx b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageRecent.tsx deleted file mode 100644 index 8b9817e78..000000000 --- a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageRecent.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { Dispatch, SetStateAction } from "react"; - -import { Select } from "@thunderstore/cyberstorm"; - -interface Props { - value: PackageRecentOptions; - setValue: Dispatch<SetStateAction<PackageRecentOptions>>; - id: string; -} - -export const PackageRecent = (props: Props) => ( - <Select - options={selectOptions} - value={props.value} - onChange={props.setValue} - id={props.id} - /> -); - -export enum PackageRecentOptions { - OneDay = "1", - TwoDays = "2", - SevenDays = "7", - ThirtyDays = "30", - ThreeHundredSixtyFiveDays = "365", - AllTime = "0", -} - -const selectOptions = [ - { - value: PackageRecentOptions.OneDay, - label: "1 Day", - }, - { - value: PackageRecentOptions.TwoDays, - label: "2 Days", - }, - { - value: PackageRecentOptions.SevenDays, - label: "7 Days", - }, - { - value: PackageRecentOptions.ThirtyDays, - label: "30 Days", - }, - { - value: PackageRecentOptions.ThreeHundredSixtyFiveDays, - label: "365 Days", - }, - { - value: PackageRecentOptions.AllTime, - label: "All time", - }, -]; - -PackageRecent.displayName = "PackageRecent"; diff --git a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageSearch.module.css b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageSearch.module.css index 2621f75ed..eb5b19e61 100644 --- a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageSearch.module.css +++ b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageSearch.module.css @@ -1,127 +1,181 @@ -.root, +.root { + display: flex; + flex-direction: column; + flex-grow: 1; + gap: var(--space-24); +} + .content { display: flex; + flex-basis: min-content; flex-direction: column; flex-grow: 1; gap: var(--gap-xxxl); + width: 100%; } .contentWrapper { display: flex; flex-direction: row; - gap: var(--gap-xl); + gap: var(--gap-md); align-items: flex-start; } .sidebar { position: sticky; - top: var(--header-height); + top: calc(var(--header-height) + 1rem); display: flex; - flex-basis: 20%; flex-direction: column; gap: var(--gap-md); + width: 16.6rem; + max-height: calc(100vh - var(--header-height) - 1rem); + padding-right: var(--space-8); + padding-bottom: var(--space-16); + overflow-y: auto; + + /* Slightly modified version of this https://css-tricks.com/books/greatest-css-tricks/scroll-shadows/ */ + + /* to make it a bit clearer that the sidebar is scrollable */ + background: + /* Shadow Cover TOP */ + linear-gradient(var(--body-bg-color) 30%, rgb(255 255 255 / 0)) center top, + /* Shadow Cover BOTTOM */ + linear-gradient(rgb(255 255 255 / 0), var(--body-bg-color) 70%) center + bottom, + /* Shadow TOP */ + radial-gradient(farthest-side at 50% 0, rgb(0 0 0 / 0.2), rgb(0 0 0 / 0)) + center top, + /* Shadow BOTTOM */ + radial-gradient( + farthest-side at 50% 100%, + rgb(0 0 0 / 0.2), + rgb(0 0 0 / 0) + ) + center bottom; + + background-repeat: no-repeat; + background-size: + 100% 40px, + 100% 40px, + 100% 14px, + 100% 14px; + background-attachment: local, local, scroll, scroll; + transition: var(--animation-duration-md) all allow-discrete; } .sidebarIsHidden { display: none; -} - -.skeletonSearch { - width: auto; - height: 2.75rem; -} - -.skeletonFilters { - height: 18rem; -} - -.skeletonContent { - height: 38rem; + opacity: 0; } .dateFilterHeader { - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); font-weight: var(--font-weight-bold); font-size: var(--font-size-body-lg); white-space: nowrap; } -.dateFilterInputs { +.searchWrapper { display: flex; - flex-direction: column; - gap: 0.25rem; - margin-bottom: 1rem; + gap: var(--gap-md); + align-items: flex-start; + align-self: stretch; } -.dateFilterInputsSet { +.searchGroupOne { display: flex; - flex-direction: column; - max-width: fit-content; + flex: 1 0 0; + flex-direction: row; + gap: var(--gap-md); + width: 100%; } -.dateFilterInput { +.searchRowItemGroup { display: flex; flex-direction: row; - align-items: center; - padding: var(--space-10) var(--space-14); - border: var(--border-width--2) solid var(--border-color); - - border-radius: var(--radius-md); - color: var(--color-text--tertiary); - font-weight: var(--font-weight-medium); - - font-size: var(--font-size-body-xxxxl); - line-height: normal; - background-color: var(--color-surface-4); - outline: none; - transition: ease-out var(--animation-duration-lg); - - --border-color: transparent; -} - -.dateFilterInput:hover { - --border-color: var(--color-border--highlight); + gap: var(--gap-md); } -.dateFilterInput:focus-within { - color: var(--color-text--default); - background-color: var(--color-black); - - --border-color: var(--color-border--highlight); +.searchFilters { + display: flex; + flex-direction: column; + gap: var(--gap-xs); + align-items: flex-start; } -.dateFilterInput::placeholder { - color: var(--color-text--tertiary); +.searchSearch { + display: flex; + flex: 1 0 0; + flex-direction: column; + gap: var(--gap-xs); + align-items: flex-start; } -.searchWrapper { +.listingOptions { display: flex; - flex-direction: row; - gap: 1rem; + gap: var(--gap-md); + align-items: center; + justify-content: flex-end; } .searchRowItemWrapper { display: flex; flex-direction: column; + gap: var(--gap-xs); } .searchInputWrapper { width: 100%; } +.bgWrapper { + border-radius: var(--radius-md); + background-color: var(--body-bg-color); +} + .searchText { - color: var(--color-text--tertiary); + width: min-content; + color: var(--color-text-tertiary); font-weight: var(--font-weight-bold); - font-size: var(--font-size-body-lg); + font-size: var(--font-size-body-md); white-space: nowrap; } -.sortByButton { - --border-color: transparent; +@media (width <= 48rem) { + .searchWrapper { + flex-direction: column; + } + + .contentWrapper { + flex-direction: column; + } - border: var(--border-width--2) solid var(--border-color); + .sidebar { + position: static; + top: 0; + width: 100%; + max-height: max-content; + padding: 0; + background: transparent; + background-size: contain; + background-attachment: scroll; + } + + .searchRowItemWrapper { + flex-grow: 1; + } + + .listingOptions { + width: 100%; + } } -.sortByButton:hover { - --border-color: var(--color-border--highlight); +@keyframes fade-in { + from { + opacity: 0; + } + + to { + opacity: 1; + } } diff --git a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageSearch.tsx b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageSearch.tsx index e1f6a1ddf..54e566dc2 100644 --- a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageSearch.tsx +++ b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageSearch.tsx @@ -1,12 +1,12 @@ -import { faSearch } from "@fortawesome/free-solid-svg-icons"; -import { faXmark, faSliders } from "@fortawesome/free-solid-svg-icons"; +import { faGhost, faSearch } from "@fortawesome/free-solid-svg-icons"; +import { faFilterList, faXmarkLarge } from "@fortawesome/pro-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { PackageCategory, PackageListings, Section, } from "@thunderstore/dapper/types"; -import { useDeferredValue, useEffect, useState } from "react"; +import { useEffect, useState } from "react"; import { useDebounce } from "use-debounce"; import { CategoryTagCloud } from "./CategoryTagCloud/CategoryTagCloud"; @@ -17,18 +17,28 @@ import styles from "./PackageSearch.module.css"; import packageListStyles from "./PackageList.module.css"; import { CategorySelection } from "./types"; import { - Button, - PackageCard, - Pagination, - TextInput, + CardPackage, + EmptyState, + NewButton, + NewIcon, + NewPagination, + NewTextInput, } from "@thunderstore/cyberstorm"; -import { useNavigation, useSearchParams } from "@remix-run/react"; +import { + useNavigation, + useNavigationType, + useSearchParams, +} from "@remix-run/react"; import { StalenessIndicator } from "@thunderstore/cyberstorm/src/components/StalenessIndicator/StalenessIndicator"; import { PackageCount } from "./PackageCount"; -import { PackageOrder, PackageOrderOptions } from "./PackageOrder"; +import { + PackageOrder, + PackageOrderOptions, + PackageOrderOptionsType, +} from "./PackageOrder"; import { CollapsibleMenu } from "./FilterMenus/CollapsibleMenu"; -import { PackageRecent, PackageRecentOptions } from "./PackageRecent"; import { classnames } from "@thunderstore/cyberstorm/src/utils/utils"; +import { getPublicEnvVariables } from "cyberstorm/security/publicEnvVariables"; const PER_PAGE = 20; @@ -38,240 +48,302 @@ interface Props { sections: Section[]; } +type SearchParamsType = { + order?: PackageOrderOptionsType; + section: string; + deprecated: boolean; + nsfw: boolean; + page: number; + includedCategories: string; + excludedCategories: string; +}; + /** * Component for filtering and rendering a PackageList */ export function PackageSearch(props: Props) { const { listings, packageCategories: allCategories, sections } = props; + // TODO: Remove this customization when /p is doned + const domain = getPublicEnvVariables(["PUBLIC_SITE_URL"]).PUBLIC_SITE_URL; const allSections = sections.sort((a, b) => a.priority - b.priority); - const [searchParams, setSearchParams] = useSearchParams(); + // const [searchParams, setSearchParams] = useSearchParams(); const navigation = useNavigation(); + // REMIX START + + const navigationType = useNavigationType(); + + const [searchParams, setSearchParams] = useSearchParams(); + + const [searchParamsBlob, setSearchParamsBlob] = useState<SearchParamsType>({ + order: undefined, + section: allSections.length === 0 ? "" : allSections[0]?.uuid, + deprecated: false, + nsfw: false, + page: 1, + includedCategories: "", + excludedCategories: "", + }); + + // TODO: Disabled until we can figure out how a proper way to display skeletons + // const navigation = useNavigation(); + + // Order start + const changeOrder = (v: PackageOrderOptionsType) => { + setSearchParamsBlob({ ...searchParamsBlob, order: v }); + }; + // Order end + + // Search start const [searchValue, setSearchValue] = useState( searchParams.getAll("search").join(" ") ); - const [categories, setCategories] = useState<CategorySelection[]>( - allCategories - .sort((a, b) => a.slug.localeCompare(b.slug)) - .map((c) => ({ ...c, selection: "off" })) - ); - const [section, setSection] = useState(allSections[0]?.uuid ?? ""); - const [deprecated, setDeprecated] = useState(false); - const [nsfw, setNsfw] = useState(false); - const [page, setPage] = useState(1); - const [order, setOrder] = useState(PackageOrderOptions.Updated); - const [recentUpload, setRecentUpload] = useState( - PackageRecentOptions.AllTime - ); - const [recentUpdate, setRecentUpdate] = useState( - PackageRecentOptions.AllTime - ); - const [createdAfter, setCreatedAfter] = useState(""); - const [createdBefore, setCreatedBefore] = useState(""); - const [updatedAfter, setUpdatedAfter] = useState(""); - const [updatedBefore, setUpdatedBefore] = useState(""); - - const deferredCategories = useDeferredValue(categories); - const deferredDeprecated = useDeferredValue(deprecated); - const deferredNsfw = useDeferredValue(nsfw); - const deferredSection = useDeferredValue(section); - - const deferredPage = useDeferredValue(page); - const deferredOrder = useDeferredValue(order); - const deferredRecentUpload = useDeferredValue(recentUpload); - const deferredRecentUpdate = useDeferredValue(recentUpdate); - - const deferredIncludedCategories = deferredCategories - .filter((c) => c.selection === "include") - .map((c) => c.id); - const deferredExcludedCategories = deferredCategories - .filter((c) => c.selection === "exclude") - .map((c) => c.id); + useEffect(() => { + if (navigationType === "POP") { + setSearchValue(searchParams.getAll("search").join(" ")); + } + }, [searchParams]); const [debouncedSearchValue] = useDebounce(searchValue, 300, { maxWait: 300, }); - const deferredCreatedAfter = useDeferredValue(createdAfter); - const deferredCreatedBefore = useDeferredValue(createdBefore); - const deferredUpdatedAfter = useDeferredValue(updatedAfter); - const deferredUpdatedBefore = useDeferredValue(updatedBefore); - useEffect(() => { if (debouncedSearchValue === "") { searchParams.delete("search"); + setSearchParams(searchParams, { replace: true }); } else { searchParams.set("search", debouncedSearchValue); + setSearchParams(searchParams, { replace: true }); + } + }, [debouncedSearchValue]); + // Search end + + const setSection = (v: string) => { + setSearchParamsBlob({ ...searchParamsBlob, section: v }); + }; + + const setDeprecated = (v: boolean) => { + setSearchParamsBlob({ ...searchParamsBlob, deprecated: v }); + }; + + const setNsfw = (v: boolean) => { + setSearchParamsBlob({ ...searchParamsBlob, nsfw: v }); + }; + + const setPage = (v: number) => { + setSearchParamsBlob({ ...searchParamsBlob, page: v }); + }; + + // Categories start + const categories: CategorySelection[] = allCategories + .sort((a, b) => a.slug.localeCompare(b.slug)) + .map((c) => ({ ...c, selection: "off" })); + + const setCategories = (v: CategorySelection[]) => { + const newSearchParams = { ...searchParamsBlob }; + const includedCategories = v + .filter((c) => c.selection === "include") + .map((c) => c.id); + if (includedCategories.length === 0) { + newSearchParams.includedCategories = ""; + } else { + newSearchParams.includedCategories = includedCategories.join(","); } + const excludedCategories = v + .filter((c) => c.selection === "exclude") + .map((c) => c.id); + if (excludedCategories.length === 0) { + newSearchParams.excludedCategories = ""; + } else { + newSearchParams.excludedCategories = excludedCategories.join(","); + } + setSearchParamsBlob(newSearchParams); + }; + // Categories end + + const resetParams = () => { + setSearchParamsBlob({ + order: undefined, + section: allSections.length === 0 ? "" : allSections[0]?.uuid, + deprecated: false, + nsfw: false, + page: 1, + includedCategories: "", + excludedCategories: "", + }); + setSearchValue(""); + }; + + const [debouncedSearchParamsBlob] = useDebounce(searchParamsBlob, 750, { + maxWait: 750, + }); - if (deferredDeprecated === false) { + useEffect(() => { + // Order + if ( + debouncedSearchParamsBlob.order === undefined || + debouncedSearchParamsBlob.order === PackageOrderOptions.Updated + ) { + searchParams.delete("ordering"); + } else { + searchParams.set("ordering", debouncedSearchParamsBlob.order); + } + // Section + if ( + allSections.length === 0 || + debouncedSearchParamsBlob.section === allSections[0]?.uuid || + debouncedSearchParamsBlob.section === "" + ) { + searchParams.delete("section"); + } else { + searchParams.set("section", debouncedSearchParamsBlob.section); + } + // Deprecated + if (debouncedSearchParamsBlob.deprecated === false) { searchParams.delete("deprecated"); } else { searchParams.set("deprecated", "true"); } - - if (deferredNsfw === false) { + // NSFW + if (debouncedSearchParamsBlob.nsfw === false) { searchParams.delete("nsfw"); } else { searchParams.set("nsfw", "true"); } - - if (deferredSection === allSections[0]?.uuid) { - searchParams.delete("section"); + // Page number + if (debouncedSearchParamsBlob.page === 1) { + searchParams.delete("page"); } else { - searchParams.set("section", deferredSection); + searchParams.set("page", String(debouncedSearchParamsBlob.page)); } - - if (deferredIncludedCategories.length === 0) { + // Categories + if (debouncedSearchParamsBlob.includedCategories === "") { searchParams.delete("includedCategories"); } else { searchParams.set( "includedCategories", - deferredIncludedCategories.join(",") + debouncedSearchParamsBlob.includedCategories ); } - - if (deferredExcludedCategories.length === 0) { + if (debouncedSearchParamsBlob.excludedCategories === "") { searchParams.delete("excludedCategories"); } else { searchParams.set( "excludedCategories", - deferredExcludedCategories.join(",") + debouncedSearchParamsBlob.excludedCategories ); } - - if (deferredPage === 1) { - searchParams.delete("page"); - } else { - searchParams.set("page", String(deferredPage)); - } - - if (deferredOrder === PackageOrderOptions.Updated) { - searchParams.delete("order"); - } else { - searchParams.set("order", deferredOrder); - } - - if (deferredRecentUpload === PackageRecentOptions.AllTime) { - searchParams.delete("created_recent"); - } else { - searchParams.set("created_recent", deferredRecentUpload); - } - - if (deferredRecentUpdate === PackageRecentOptions.AllTime) { - searchParams.delete("updated_recent"); - } else { - searchParams.set("updated_recent", deferredRecentUpdate); - } - - if (deferredCreatedAfter === "") { - searchParams.delete("created_after"); - } else { - searchParams.set("created_after", deferredCreatedAfter); - } - - if (deferredCreatedBefore === "") { - searchParams.delete("created_before"); - } else { - searchParams.set("created_before", deferredCreatedBefore); - } - - if (deferredUpdatedAfter === "") { - searchParams.delete("updated_after"); - } else { - searchParams.set("updated_after", deferredUpdatedAfter); - } - - if (deferredUpdatedBefore === "") { - searchParams.delete("updated_before"); - } else { - searchParams.set("updated_before", deferredUpdatedBefore); - } - setSearchParams(searchParams); - }, [ - debouncedSearchValue, - deferredDeprecated, - deferredNsfw, - deferredSection, - deferredCategories, - deferredPage, - deferredOrder, - deferredCreatedAfter, - deferredCreatedBefore, - deferredUpdatedAfter, - deferredUpdatedBefore, - deferredRecentUpload, - deferredRecentUpdate, - ]); + }, [debouncedSearchParamsBlob]); + + function parseCategories( + includedCategories: string, + excludedCategories: string + ): CategorySelection[] { + const iCArr = includedCategories.split(","); + const eCArr = excludedCategories.split(","); + return categories.map((c) => + iCArr.includes(c.id) + ? { ...c, selection: "include" } + : eCArr.includes(c.id) + ? { ...c, selection: "exclude" } + : c + ); + } const [isFiltersVisible, setIsFiltersVisible] = useState(true); return ( <div className={styles.root}> <div className={styles.searchWrapper}> - <div className={styles.searchRowItemWrapper}> - <label className={styles.searchText} htmlFor="packageOrder"> - Sort by - </label> - <Button.Root - iconAlignment="side" - colorScheme="primary" - paddingSize="largeBorderCompensated" - onClick={() => setIsFiltersVisible(!isFiltersVisible)} + <div className={styles.searchGroupOne}> + <div + className={classnames( + styles.searchRowItemGroup, + styles.searchFilters + )} > - <Button.ButtonIcon> - <FontAwesomeIcon icon={isFiltersVisible ? faXmark : faSliders} /> - </Button.ButtonIcon> - <Button.ButtonLabel> - {isFiltersVisible ? "Close" : "Open"} - </Button.ButtonLabel> - </Button.Root> + <div className={styles.searchRowItemWrapper}> + <label + className={classnames(styles.searchText, "nimbus-hide-s")} + htmlFor="filtersMenuToggle" + > + Filters + </label> + <div className={styles.bgWrapper}> + <NewButton + onClick={() => setIsFiltersVisible(!isFiltersVisible)} + id="filtersMenuToggle" + csVariant={isFiltersVisible ? "primary" : "secondary"} + > + <NewIcon csMode="inline" noWrapper> + <FontAwesomeIcon + icon={isFiltersVisible ? faXmarkLarge : faFilterList} + /> + </NewIcon> + <span className={"nimbus-hide-s"}>Filters</span> + </NewButton> + </div> + </div> + </div> + <div + className={classnames( + styles.searchRowItemGroup, + styles.searchSearch + )} + > + <div + className={classnames( + styles.searchInputWrapper, + styles.searchRowItemWrapper + )} + > + <label + className={classnames(styles.searchText, "nimbus-hide-s")} + htmlFor="searchInput" + > + Search + </label> + <div className={styles.bgWrapper}> + <NewTextInput + placeholder="Filter Mods..." + value={searchValue} + onChange={(e) => setSearchValue(e.target.value)} + clearValue={() => setSearchValue("")} + leftIcon={<FontAwesomeIcon icon={faSearch} />} + id="searchInput" + type="search" + /> + </div> + </div> + </div> </div> <div className={classnames( - styles.searchInputWrapper, - styles.searchRowItemWrapper + styles.searchRowItemGroup, + styles.listingOptions )} > - <label className={styles.searchText} htmlFor="searchInput"> - Search - </label> - <TextInput - placeholder="Filter Mods..." - value={searchValue} - onChange={(e) => setSearchValue(e.target.value)} - leftIcon={<FontAwesomeIcon icon={faSearch} />} - id="searchInput" - /> - </div> - <div className={styles.searchRowItemWrapper}> - <label className={styles.searchText} htmlFor="packageOrder"> - Sort by - </label> - <PackageOrder order={order} setOrder={setOrder} /> - </div> - <div className={styles.searchRowItemWrapper}> - <label className={styles.searchText} htmlFor="packageRecentUpload"> - Upload time - </label> - <PackageRecent - id={"packageRecentUpload"} - value={recentUpload} - setValue={setRecentUpload} - /> - </div> - <div className={styles.searchRowItemWrapper}> - <label className={styles.searchText} htmlFor="packageRecentUpdate"> - Update time - </label> - <PackageRecent - id={"packageRecentUpdate"} - value={recentUpdate} - setValue={setRecentUpdate} - /> + <div className={styles.searchRowItemWrapper}> + <label + className={classnames(styles.searchText, "nimbus-hide-s")} + htmlFor="packageOrder" + > + Sort by + </label> + <div className={styles.bgWrapper}> + <PackageOrder + order={ + (searchParamsBlob.order as PackageOrderOptions) ?? + PackageOrderOptions.Updated + } + setOrder={changeOrder} + /> + </div> + </div> </div> </div> @@ -283,91 +355,32 @@ export function PackageSearch(props: Props) { )} id="desktopSidebar" > - <CollapsibleMenu headerTitle="Date filters" defaultOpen={false}> - <div className={styles.dateFilterInputs}> - <div className={styles.dateFilterInputsSet}> - <label - className={styles.dateFilterHeader} - htmlFor="updatedAfter" - > - Updated after - </label> - <input - type="date" - className={styles.dateFilterInput} - onChange={(e) => setUpdatedAfter(e.target.value)} - id="updatedAfter" - /> - </div> - <div className={styles.dateFilterInputsSet}> - <label - className={styles.dateFilterHeader} - htmlFor="updatedBefore" - > - Updated before - </label> - <input - type="date" - className={styles.dateFilterInput} - onChange={(e) => setUpdatedBefore(e.target.value)} - id="updatedBefore" - /> - </div> - </div> - <div className={styles.dateFilterInputs}> - <div className={styles.dateFilterInputsSet}> - <label - className={styles.dateFilterHeader} - htmlFor="createdAfter" - > - Created after - </label> - <input - type="date" - className={styles.dateFilterInput} - onChange={(e) => setCreatedAfter(e.target.value)} - id="createdAfter" - /> - </div> - <div className={styles.dateFilterInputsSet}> - <label - className={styles.dateFilterHeader} - htmlFor="createdBefore" - > - Created before - </label> - <input - type="date" - className={styles.dateFilterInput} - onChange={(e) => setCreatedBefore(e.target.value)} - id="createdBefore" - /> - </div> - </div> - </CollapsibleMenu> - {allSections.length > 0 ? ( <CollapsibleMenu headerTitle="Sections" defaultOpen> <SectionMenu allSections={allSections} - selected={section} + selected={searchParamsBlob.section ?? allSections[0]?.uuid} setSelected={setSection} /> </CollapsibleMenu> ) : null} - <CollapsibleMenu headerTitle="Categories" defaultOpen> - <CategoryMenu - categories={categories} - setCategories={setCategories} - /> - </CollapsibleMenu> + {categories.length > 0 ? ( + <CollapsibleMenu headerTitle="Categories" defaultOpen> + <CategoryMenu + categories={categories} + includedCategories={searchParamsBlob.includedCategories} + excludedCategories={searchParamsBlob.excludedCategories} + setCategories={setCategories} + /> + </CollapsibleMenu> + ) : null} <CollapsibleMenu headerTitle="Other filters" defaultOpen> <OthersMenu - deprecated={deprecated} + deprecated={searchParamsBlob.deprecated ? true : false} setDeprecated={setDeprecated} - nsfw={nsfw} + nsfw={searchParamsBlob.nsfw ? true : false} setNsfw={setNsfw} /> </CollapsibleMenu> @@ -376,46 +389,78 @@ export function PackageSearch(props: Props) { <div className={styles.content}> <div className={styles.root}> <div className={packageListStyles.top}> - <StalenessIndicator - isStale={navigation.state === "loading" ? true : false} - > - <PackageCount - page={page} - pageSize={PER_PAGE} - searchQuery={debouncedSearchValue} - totalCount={listings.count} - /> - </StalenessIndicator> + <PackageCount + page={searchParamsBlob.page ? Number(searchParamsBlob.page) : 1} + pageSize={PER_PAGE} + searchQuery={debouncedSearchValue} + totalCount={listings.count} + /> <CategoryTagCloud - categories={categories} + categories={parseCategories( + searchParamsBlob.includedCategories ?? "", + searchParamsBlob.excludedCategories ?? "" + )} setCategories={setCategories} /> </div> <StalenessIndicator isStale={navigation.state === "loading" ? true : false} - className={classnames( - packageListStyles.packages, - isFiltersVisible - ? undefined - : packageListStyles.packagesIsFiltersVisible - )} > - {listings.results.map((p) => ( - <PackageCard key={`${p.namespace}-${p.name}`} package={p} /> - ))} - </StalenessIndicator> - <StalenessIndicator - isStale={navigation.state === "loading" ? true : false} - > - <Pagination - currentPage={page} - onPageChange={setPage} - pageSize={PER_PAGE} - siblingCount={2} - totalCount={listings.count} - /> + {listings.results.length > 0 ? ( + <div className={packageListStyles.packages}> + {listings.results.map((p) => ( + <CardPackage + key={`${p.namespace}-${p.name}`} + packageData={p} + // TODO: Remove this customization when /p is doned + domain={domain ?? "https://thunderstore.io"} + /> + ))} + </div> + ) : searchParams.size > 0 ? ( + <EmptyState.Root className="nimbus-noresult"> + <EmptyState.Icon wrapperClasses="nimbus-noresult__ghostbounce"> + <FontAwesomeIcon icon={faSearch} /> + </EmptyState.Icon> + <div className="nimbus-noresult__info"> + <EmptyState.Title>No results found</EmptyState.Title> + <EmptyState.Message> + Make sure all keywords are spelled correctly or try + different search parameters. + </EmptyState.Message> + </div> + <NewButton + onClick={resetParams} + rootClasses="nimbus-noresult__button" + > + Clean all filters + </NewButton> + </EmptyState.Root> + ) : ( + <EmptyState.Root className="nimbus-noresult"> + <EmptyState.Icon wrapperClasses="nimbus-noresult__ghostbounce"> + <FontAwesomeIcon icon={faGhost} /> + </EmptyState.Icon> + <div className="nimbus-noresult__info"> + <EmptyState.Title>It's empty in here</EmptyState.Title> + <EmptyState.Message> + Be the first to upload a mod! + </EmptyState.Message> + </div> + </EmptyState.Root> + )} </StalenessIndicator> + + <NewPagination + currentPage={ + searchParamsBlob.page ? Number(searchParamsBlob.page) : 1 + } + onPageChange={setPage} + pageSize={PER_PAGE} + siblingCount={4} + totalCount={listings.count} + /> </div> </div> </div> diff --git a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/types.ts b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/types.ts index f1b8b0a7d..efdefd4e1 100644 --- a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/types.ts +++ b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/types.ts @@ -5,5 +5,5 @@ export const CATEGORY_STATES = ["off", "include", "exclude"] as const; export interface CategorySelection extends PackageCategory { // TODO: IDE disagrees with what precommit prettier wants, fix config. // eslint-disable-next-line prettier/prettier - selection: typeof CATEGORY_STATES[number]; + selection: (typeof CATEGORY_STATES)[number]; } diff --git a/apps/cyberstorm-remix/app/commonComponents/PageHeader/PageHeader.css b/apps/cyberstorm-remix/app/commonComponents/PageHeader/PageHeader.css new file mode 100644 index 000000000..4ead5c958 --- /dev/null +++ b/apps/cyberstorm-remix/app/commonComponents/PageHeader/PageHeader.css @@ -0,0 +1,60 @@ +@layer nimbus-layout { + .nimbus-commoncomponents-page-header { + display: flex; + flex-direction: row; + gap: var(--space-32); + align-items: flex-start; + align-self: stretch; + padding: var(--space-24) 0; + } + + .nimbus-commoncomponents-page-header__image { + flex: 0 0 6rem; + } + + .nimbus-commoncomponents-page-header__content { + display: flex; + flex-direction: column; + gap: var(--space-12); + + /* To ensure collapsibletext doesnt spill over */ + min-width: 0; + } + + .nimbus-commoncomponents-page-header__info { + display: flex; + flex-direction: column; + gap: var(--space-4); + align-items: flex-start; + align-self: stretch; + + > h1 { + --display-line-height: 1; + } + } + + .nimbus-commoncomponents-page-header__meta { + display: flex; + flex-flow: row wrap; + gap: var(--space-32); + } + + @media (width <= 48rem) { + .nimbus-commoncomponents-page-header { + gap: var(--space-16); + padding: var(--space-6) 0; + } + + .nimbus-commoncomponents-page-header__info > h1 { + --display-font-size: 1.75rem; + } + + .nimbus-commoncomponents-page-header__image { + flex: 0 0 5rem; + } + + .nimbus-commoncomponents-page-header__meta { + gap: var(--space-16); + } + } +} diff --git a/apps/cyberstorm-remix/app/commonComponents/PageHeader/PageHeader.module.css b/apps/cyberstorm-remix/app/commonComponents/PageHeader/PageHeader.module.css deleted file mode 100644 index 27282f0a5..000000000 --- a/apps/cyberstorm-remix/app/commonComponents/PageHeader/PageHeader.module.css +++ /dev/null @@ -1,29 +0,0 @@ -.root { - display: flex; - flex-direction: row; - gap: var(--space-32); -} - -.image { - flex: 0 0 9rem; -} - -.info { - display: flex; - flex-direction: column; - gap: var(--space-4); - min-width: 0; -} - -@media (width <= 30rem) { - .root { - gap: var(--space-16); - } -} - -.meta { - display: flex; - flex-direction: row; - gap: var(--space-16); - padding-top: var(--space-16); -} diff --git a/apps/cyberstorm-remix/app/commonComponents/PageHeader/PageHeader.tsx b/apps/cyberstorm-remix/app/commonComponents/PageHeader/PageHeader.tsx index b6d79267f..1189ec9a3 100644 --- a/apps/cyberstorm-remix/app/commonComponents/PageHeader/PageHeader.tsx +++ b/apps/cyberstorm-remix/app/commonComponents/PageHeader/PageHeader.tsx @@ -1,33 +1,56 @@ -import { CollapsibleText, Title } from "@thunderstore/cyberstorm"; -import styles from "./PageHeader.module.css"; +import { Heading } from "@thunderstore/cyberstorm"; +import "./PageHeader.css"; import { ReactElement } from "react"; +import { CollapsibleText } from "../CollapsibleText/CollapsibleText"; +import { HeadingSizes } from "@thunderstore/cyberstorm-theme/src/components"; export interface PageHeaderProps { image?: ReactElement; - title: string; + heading: string; + headingSize: HeadingSizes; + headingLevel: "1" | "2" | "3" | "4" | "5" | "6"; description?: string | null; - meta?: (ReactElement | null)[]; + meta?: ReactElement; } -/** - * Cyberstorm PageHeader - */ export function PageHeader(props: PageHeaderProps) { - const { title, description = null, image = null, meta = [] } = props; - const metas = meta.filter(Boolean); + const { + heading, + headingSize, + headingLevel, + description = null, + image = null, + meta, + } = props; return ( - <div className={styles.root}> - {image ? <div className={styles.image}>{image}</div> : null} - <div className={styles.info}> - <Title text={title} /> - {description ? ( - <CollapsibleText text={description} maxLength={85} /> + <header className="nimbus-commoncomponents-page-header"> + {image ? ( + <div className="nimbus-commoncomponents-page-header__image nimbus-hide-s"> + {image} + </div> + ) : null} + <div className="nimbus-commoncomponents-page-header__content"> + <div className="nimbus-commoncomponents-page-header__info"> + <Heading + csLevel={headingLevel} + csSize={headingSize} + csVariant="primary" + mode="display" + > + {heading} + </Heading> + {description ? ( + <CollapsibleText text={description} maxLength={85} /> + ) : null} + </div> + {meta ? ( + <div className="nimbus-commoncomponents-page-header__meta"> + {meta} + </div> ) : null} - - {metas.length ? <div className={styles.meta}>{metas}</div> : null} </div> - </div> + </header> ); } diff --git a/apps/cyberstorm-remix/app/communities/Communities.module.css b/apps/cyberstorm-remix/app/communities/Communities.module.css deleted file mode 100644 index 072d6230c..000000000 --- a/apps/cyberstorm-remix/app/communities/Communities.module.css +++ /dev/null @@ -1,5 +0,0 @@ -@media (width <= 40rem) { - .breadcrumbs { - display: none; - } -} diff --git a/apps/cyberstorm-remix/app/communities/CommunityList.module.css b/apps/cyberstorm-remix/app/communities/CommunityList.module.css index 80469f81d..5bdce4682 100644 --- a/apps/cyberstorm-remix/app/communities/CommunityList.module.css +++ b/apps/cyberstorm-remix/app/communities/CommunityList.module.css @@ -5,29 +5,6 @@ gap: 3rem 1.5rem; } -.noResultPadding { - padding-top: 5rem; - padding-bottom: 5rem; -} - -.ghostBounce { - animation: ghost-bounce 3s ease-in-out infinite; -} - -@keyframes ghost-bounce { - 0% { - transform: translateY(0); - } - - 50% { - transform: translateY(-5px); - } - - 100% { - transform: translateY(0); - } -} - @media (width <= 27.5rem) { .root { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); diff --git a/apps/cyberstorm-remix/app/communities/communities.tsx b/apps/cyberstorm-remix/app/communities/communities.tsx index 3822b31d1..309c56e66 100644 --- a/apps/cyberstorm-remix/app/communities/communities.tsx +++ b/apps/cyberstorm-remix/app/communities/communities.tsx @@ -3,13 +3,11 @@ import { CardCommunity, CommunityCardSkeleton, EmptyState, - Heading, NewBreadCrumbs, range, NewTextInput, NewSelect, } from "@thunderstore/cyberstorm"; -import styles from "./Communities.module.css"; import searchAndOrderStyles from "./SearchAndOrder.module.css"; import communitiesListStyles from "./CommunityList.module.css"; import { useState, useEffect } from "react"; @@ -29,6 +27,7 @@ import { } from "@remix-run/react"; import { Communities } from "@thunderstore/dapper/types"; import { getDapper } from "cyberstorm/dapper/sessionUtils"; +import { PageHeader } from "~/commonComponents/PageHeader/PageHeader"; export const meta: MetaFunction = () => { return [ @@ -126,15 +125,16 @@ export default function CommunitiesPage() { return ( <> - <NewBreadCrumbs rootClasses={styles.breadcrumbs}> + <NewBreadCrumbs rootClasses="nimbus-root__breadcrumbs"> Communities </NewBreadCrumbs> - <header className="project-root__page-header"> + <PageHeader heading="Communities" headingLevel="1" headingSize="2" /> + {/* <header className="nimbus-root__page-header"> <Heading csLevel="1" csSize="2" csVariant="primary" mode="display"> Communities </Heading> - </header> - <main className="project-root__main"> + </header> */} + <main className="nimbus-root__main"> <div className={searchAndOrderStyles.root}> <div className={searchAndOrderStyles.searchTextInput}> <label htmlFor="communitiesSearchInput">Search</label> @@ -192,8 +192,8 @@ function CommunitiesList(props: { communitiesData: Communities }) { ); } else { return ( - <EmptyState.Root className={communitiesListStyles.noResultPadding}> - <EmptyState.Icon wrapperClasses={communitiesListStyles.ghostBounce}> + <EmptyState.Root className="nimbus-noresult"> + <EmptyState.Icon wrapperClasses="nimbus-noresult__ghostbounce"> <FontAwesomeIcon icon={faGhost} /> </EmptyState.Icon> <EmptyState.Title>It's empty in there.</EmptyState.Title> diff --git a/apps/cyberstorm-remix/app/namespace/namespace.tsx b/apps/cyberstorm-remix/app/namespace/namespace.tsx index 8cebde875..3c3285648 100644 --- a/apps/cyberstorm-remix/app/namespace/namespace.tsx +++ b/apps/cyberstorm-remix/app/namespace/namespace.tsx @@ -3,7 +3,6 @@ import { useLoaderData } from "@remix-run/react"; import { BreadCrumbs, Button, - CollapsibleText, CyberstormLink, ImageWithFallback, MetaItem, @@ -14,13 +13,11 @@ import { formatInteger } from "@thunderstore/cyberstorm/src/utils/utils"; import { getDapper } from "cyberstorm/dapper/sessionUtils"; import { PackageSearch } from "~/commonComponents/PackageSearch/PackageSearch"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { - faBoxOpen, - faDownload, - faArrowUpRightFromSquare, -} from "@fortawesome/free-solid-svg-icons"; +import { faBoxOpen, faDownload } from "@fortawesome/free-solid-svg-icons"; import { faDiscord } from "@fortawesome/free-brands-svg-icons"; import { ApiError } from "@thunderstore/thunderstore-api"; +import { faArrowUpRight } from "@fortawesome/pro-solid-svg-icons"; +import { CollapsibleText } from "~/commonComponents/CollapsibleText/CollapsibleText"; export const meta: MetaFunction<typeof loader> = ({ data }) => { return [ @@ -128,7 +125,7 @@ export default function Community() { {community.name} </CyberstormLink> </BreadCrumbs> - <header className="project-root__page-header"> + <header className="nimbus-root__page-header"> <div className={styles.root}> <div className={styles.image}> <ImageWithFallback @@ -171,7 +168,7 @@ export default function Community() { Join our community </Button.ButtonLabel> <Button.ButtonIcon> - <FontAwesomeIcon icon={faArrowUpRightFromSquare} /> + <FontAwesomeIcon icon={faArrowUpRight} /> </Button.ButtonIcon> </Button.Root> </a> @@ -181,7 +178,7 @@ export default function Community() { </div> </div> </header> - <main className="project-root__main"> + <main className="nimbus-root__main"> <PackageSearch listings={listings} packageCategories={filters.package_categories} diff --git a/apps/cyberstorm-remix/app/p/Tabs.module.css b/apps/cyberstorm-remix/app/p/Tabs.module.css index f042799a6..4da2f8775 100644 --- a/apps/cyberstorm-remix/app/p/Tabs.module.css +++ b/apps/cyberstorm-remix/app/p/Tabs.module.css @@ -46,7 +46,7 @@ } .button:not(.active, :disabled):hover > .icon { - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); } .label { diff --git a/apps/cyberstorm-remix/app/p/components/Dependencies/Dependencies.module.css b/apps/cyberstorm-remix/app/p/components/Dependencies/Dependencies.module.css index 5a78ba448..319e72923 100644 --- a/apps/cyberstorm-remix/app/p/components/Dependencies/Dependencies.module.css +++ b/apps/cyberstorm-remix/app/p/components/Dependencies/Dependencies.module.css @@ -7,7 +7,7 @@ .countDescription { padding: 0 var(--space-8); - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); font-size: var(--font-size-body-lg); } @@ -37,7 +37,7 @@ .itemDescription { overflow: hidden; - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); font-size: var(--font-size-body-lg); line-height: var(--line-height--m); white-space: nowrap; diff --git a/apps/cyberstorm-remix/app/p/components/Dependencies/DependencyDialog/DependencyDialog.module.css b/apps/cyberstorm-remix/app/p/components/Dependencies/DependencyDialog/DependencyDialog.module.css index fcb5d5279..d0538bfeb 100644 --- a/apps/cyberstorm-remix/app/p/components/Dependencies/DependencyDialog/DependencyDialog.module.css +++ b/apps/cyberstorm-remix/app/p/components/Dependencies/DependencyDialog/DependencyDialog.module.css @@ -14,7 +14,7 @@ } .description { - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); font-weight: var(--font-weight-medium); font-size: var(--font-size-body-lg); line-height: var(--line-height--m); @@ -34,7 +34,7 @@ .preferredVersion { padding-top: var(--space-6); - color: var(--color-text--accent); + color: var(--color-text-accent); font-weight: var(--font-weight-medium); font-size: var(--font-size-body-md); line-height: var(--line-height--s); diff --git a/apps/cyberstorm-remix/app/p/components/TeamMembers/TeamMembers.module.css b/apps/cyberstorm-remix/app/p/components/TeamMembers/TeamMembers.module.css index 2371ae6dd..d3ab015df 100644 --- a/apps/cyberstorm-remix/app/p/components/TeamMembers/TeamMembers.module.css +++ b/apps/cyberstorm-remix/app/p/components/TeamMembers/TeamMembers.module.css @@ -20,7 +20,7 @@ } .itemDescription { - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); font-weight: var(--font-weight-medium); font-size: var(--font-size-body-lg); line-height: var(--line-height--m); diff --git a/apps/cyberstorm-remix/app/p/dependants/Dependants.module.css b/apps/cyberstorm-remix/app/p/dependants/Dependants.module.css index e7a9bcfda..faa58dfdb 100644 --- a/apps/cyberstorm-remix/app/p/dependants/Dependants.module.css +++ b/apps/cyberstorm-remix/app/p/dependants/Dependants.module.css @@ -4,7 +4,7 @@ gap: var(--space-32); } -@media (width <= 30rem) { +@media (width <= 48rem) { .root { gap: var(--space-16); } diff --git a/apps/cyberstorm-remix/app/p/dependants/Dependants.tsx b/apps/cyberstorm-remix/app/p/dependants/Dependants.tsx index 5a0a75b6e..c0630f7b2 100644 --- a/apps/cyberstorm-remix/app/p/dependants/Dependants.tsx +++ b/apps/cyberstorm-remix/app/p/dependants/Dependants.tsx @@ -26,12 +26,6 @@ export async function loader({ request, params }: LoaderFunctionArgs) { const section = searchParams.get("section"); const nsfw = searchParams.get("nsfw"); const deprecated = searchParams.get("deprecated"); - const created_recent = searchParams.get("created_recent"); - const updated_recent = searchParams.get("updated_recent"); - const created_after = searchParams.get("created_after"); - const created_before = searchParams.get("created_before"); - const updated_after = searchParams.get("updated_after"); - const updated_before = searchParams.get("updated_before"); return { community: await dapper.getCommunity(params.communityId), filters: await dapper.getCommunityFilters(params.communityId), @@ -54,13 +48,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) { excludedCategories?.split(",") ?? undefined, section ?? "", nsfw === "true" ? true : false, - deprecated === "true" ? true : false, - created_recent ?? "", - updated_recent ?? "", - created_after ?? "", - created_before ?? "", - updated_after ?? "", - updated_before ?? "" + deprecated === "true" ? true : false ), }; } catch (error) { @@ -88,12 +76,6 @@ export async function clientLoader({ request, params }: LoaderFunctionArgs) { const section = searchParams.get("section"); const nsfw = searchParams.get("nsfw"); const deprecated = searchParams.get("deprecated"); - const created_recent = searchParams.get("created_recent"); - const updated_recent = searchParams.get("updated_recent"); - const created_after = searchParams.get("created_after"); - const created_before = searchParams.get("created_before"); - const updated_after = searchParams.get("updated_after"); - const updated_before = searchParams.get("updated_before"); return { community: await dapper.getCommunity(params.communityId), filters: await dapper.getCommunityFilters(params.communityId), @@ -116,13 +98,7 @@ export async function clientLoader({ request, params }: LoaderFunctionArgs) { excludedCategories?.split(",") ?? undefined, section ?? "", nsfw === "true" ? true : false, - deprecated === "true" ? true : false, - created_recent ?? "", - updated_recent ?? "", - created_after ?? "", - created_before ?? "", - updated_after ?? "", - updated_before ?? "" + deprecated === "true" ? true : false ), }; } catch (error) { @@ -137,18 +113,18 @@ export async function clientLoader({ request, params }: LoaderFunctionArgs) { throw new Response("Community not found", { status: 404 }); } -export default function Community() { +export default function Dependants() { const { community, filters, listing, listings } = useLoaderData< typeof loader | typeof clientLoader >(); return ( <> - {community.background_image_url ? ( + {community.hero_image_url ? ( <div className={styles.backgroundImg} style={{ - backgroundImage: `url(${community.background_image_url})`, + backgroundImage: `url(${community.hero_image_url})`, }} /> ) : null} @@ -170,7 +146,7 @@ export default function Community() { </CyberstormLink> Dependants </BreadCrumbs> - <header className="project-root__page-header"> + <header className="nimbus-root__page-header"> <div className={styles.root}> <div className={styles.header}> Mods that depend on{" "} @@ -193,7 +169,7 @@ export default function Community() { </div> </div> </header> - <main className="project-root__main"> + <main className="nimbus-root__main"> <PackageSearch listings={listings} packageCategories={filters.package_categories} diff --git a/apps/cyberstorm-remix/app/p/packageListing.tsx b/apps/cyberstorm-remix/app/p/packageListing.tsx index 4daa46791..3cb5361c2 100644 --- a/apps/cyberstorm-remix/app/p/packageListing.tsx +++ b/apps/cyberstorm-remix/app/p/packageListing.tsx @@ -23,7 +23,6 @@ import { ApiError } from "@thunderstore/thunderstore-api"; import { ThunderstoreLogo } from "@thunderstore/cyberstorm/src/svg/svg"; import { faCog, - faArrowUpRightFromSquare, faUsers, faHandHoldingHeart, faDownload, @@ -50,6 +49,7 @@ import { PackageLikeAction, } from "@thunderstore/cyberstorm-forms"; import { PageHeader } from "~/commonComponents/PageHeader/PageHeader"; +import { faArrowUpRight } from "@fortawesome/pro-solid-svg-icons"; export const meta: MetaFunction<typeof loader> = ({ data }) => { return [ @@ -154,35 +154,35 @@ export default function Community() { } } - // Header helpers - const packageDetailsMeta = [ - <CyberstormLink - linkId="Team" - key="team" - community={listing.community_identifier} - team={listing.namespace} - > - <Button.Root plain colorScheme="transparentPrimary" paddingSize="small"> - <Button.ButtonIcon> - <FontAwesomeIcon icon={faUsers} /> - </Button.ButtonIcon> - <Button.ButtonLabel>{listing.namespace}</Button.ButtonLabel> - </Button.Root> - </CyberstormLink>, - ]; + // // Header helpers + // const packageDetailsMeta = [ + // <CyberstormLink + // linkId="Team" + // key="team" + // community={listing.community_identifier} + // team={listing.namespace} + // > + // <Button.Root plain colorScheme="transparentPrimary" paddingSize="small"> + // <Button.ButtonIcon> + // <FontAwesomeIcon icon={faUsers} /> + // </Button.ButtonIcon> + // <Button.ButtonLabel>{listing.namespace}</Button.ButtonLabel> + // </Button.Root> + // </CyberstormLink>, + // ]; - if (listing.website_url) { - packageDetailsMeta.push( - <a key="website" href={listing.website_url}> - <Button.Root plain colorScheme="transparentPrimary" paddingSize="small"> - <Button.ButtonLabel>{listing.website_url}</Button.ButtonLabel> - <Button.ButtonIcon> - <FontAwesomeIcon icon={faArrowUpRightFromSquare} /> - </Button.ButtonIcon> - </Button.Root> - </a> - ); - } + // if (listing.website_url) { + // packageDetailsMeta.push( + // <a key="website" href={listing.website_url}> + // <Button.Root plain colorScheme="transparentPrimary" paddingSize="small"> + // <Button.ButtonLabel>{listing.website_url}</Button.ButtonLabel> + // <Button.ButtonIcon> + // <FontAwesomeIcon icon={faArrowUpRight} /> + // </Button.ButtonIcon> + // </Button.Root> + // </a> + // ); + // } // Sidebar helpers const mappedPackageTagList = listing.categories.map((category) => { @@ -199,12 +199,12 @@ export default function Community() { const currentTab = location.pathname.endsWith("/changelog") ? "changelog" : location.pathname.endsWith("/versions") - ? "versions" - : location.pathname.endsWith("/wiki") - ? "wiki" - : location.pathname.endsWith("/source") - ? "source" - : "details"; + ? "versions" + : location.pathname.endsWith("/wiki") + ? "wiki" + : location.pathname.endsWith("/source") + ? "source" + : "details"; return ( <> @@ -218,19 +218,58 @@ export default function Community() { </CyberstormLink> {listing.name} </BreadCrumbs> - <header className="project-root__page-header"> + <header className="nimbus-root__page-header"> <div className={headerStyles.packageInfo}> <PageHeader - title={listing.name} + heading={listing.name} + headingLevel="1" + headingSize="3" image={ <img className={headerStyles.modImage} alt="" src={listing.icon_url} + // TODO: Add intrinsic width and height /> } description={listing.description} - meta={packageDetailsMeta} + meta={ + <> + <CyberstormLink + linkId="Team" + key="team" + community={listing.community_identifier} + team={listing.namespace} + > + <Button.Root + plain + colorScheme="transparentPrimary" + paddingSize="small" + > + <Button.ButtonIcon> + <FontAwesomeIcon icon={faUsers} /> + </Button.ButtonIcon> + <Button.ButtonLabel>{listing.namespace}</Button.ButtonLabel> + </Button.Root> + </CyberstormLink> + {listing.website_url ? ( + <a key="website" href={listing.website_url}> + <Button.Root + plain + colorScheme="transparentPrimary" + paddingSize="small" + > + <Button.ButtonLabel> + {listing.website_url} + </Button.ButtonLabel> + <Button.ButtonIcon> + <FontAwesomeIcon icon={faArrowUpRight} /> + </Button.ButtonIcon> + </Button.Root> + </a> + ) : null} + </> + } /> <div className={headerStyles.headerActions}> <a @@ -298,7 +337,7 @@ export default function Community() { </div> </div> </header> - <main className="project-root__main"> + <main className="nimbus-root__main"> <div className={styles.packageContainer}> <div className={tabsStyles.root}> <div className={tabsStyles.buttons}> diff --git a/apps/cyberstorm-remix/app/root.tsx b/apps/cyberstorm-remix/app/root.tsx index e51f376c2..fa979736e 100644 --- a/apps/cyberstorm-remix/app/root.tsx +++ b/apps/cyberstorm-remix/app/root.tsx @@ -7,7 +7,7 @@ import { MetaFunction, Outlet, Scripts, - ScrollRestoration, + // ScrollRestoration, isRouteErrorResponse, useLoaderData, useLocation, @@ -128,12 +128,12 @@ function Root() { const shouldShowAds = location.pathname.startsWith("/teams") ? false : location.pathname.startsWith("/settings") - ? false - : location.pathname.startsWith("/package/create") - ? false - : location.pathname.startsWith("/tools") - ? false - : true; + ? false + : location.pathname.startsWith("/package/create") + ? false + : location.pathname.startsWith("/tools") + ? false + : true; const isHydrated = useHydrated(); const startsHydrated = useRef(isHydrated); @@ -196,8 +196,8 @@ function Root() { > <LinkingProvider value={LinkLibrary}> <Toast.Provider toastDuration={10000}> - <RadixTooltip delayDuration={300}> - <div className="project-root"> + <RadixTooltip delayDuration={80}> + <div className="nimbus-root"> {/* REMIX TODO: For whatever reason the Navigation seems to cause suspense boundary errors. Couldn't find a reason why */} <Navigation hydrationCheck={!startsHydrated.current && isHydrated} @@ -209,12 +209,11 @@ function Root() { ) : ( <MobileUserPopoverContent /> )} - <section className="project-root__content"> - <div className="project-root__side-containers" /> - <div className="project-root__middle-container"> + <section className="nimbus-root__content"> + <div className="nimbus-root__outlet"> <Outlet /> </div> - <div className="project-root__side-containers"> + <div className="nimbus-root__ads-container"> {shouldShowAds ? adContainerIds.map((cid, k_i) => ( <AdContainer key={k_i} containerId={cid} /> @@ -228,7 +227,7 @@ function Root() { </Toast.Provider> </LinkingProvider> </SessionProvider> - <ScrollRestoration /> + {/* <ScrollRestoration /> */} <Scripts /> {shouldShowAds ? <AdsInit /> : null} </body> @@ -269,29 +268,29 @@ export function ErrorBoundary() { <LinkingProvider value={LinkLibrary}> <Toast.Provider toastDuration={10000}> <RadixTooltip delayDuration={300}> - <div className="project-root"> + <div className="nimbus-root"> {/* <Navigation user={getEmptyUser} /> */} - <section className="project-root__content"> - <div className="project-root__side-containers" /> - <div className="project-root__middle-container"> - <div className="project-error"> + <section className="nimbus-root__content"> + <div className="nimbus-root__side-containers" /> + <div className="nimbus-root__middle-container"> + <div className="nimbus-error"> <div - className="project-error__glitch" + className="nimbus-error__glitch" data-text={isResponseError ? error.status : 500} > <span>{isResponseError ? error.status : 500}</span> </div> - <div className="project-error__description"> + <div className="nimbus-error__description"> {isResponseError ? error.data : "Internal server error"} </div> {!isResponseError && ( - <div className="project-error__flavor"> + <div className="nimbus-error__flavor"> Beep boop. Server something error happens. </div> )} </div> </div> - <div className="project-root__side-containers"></div> + <div className="nimbus-root__side-containers"></div> </section> <Footer /> </div> diff --git a/apps/cyberstorm-remix/app/settings/teams/Teams.tsx b/apps/cyberstorm-remix/app/settings/teams/Teams.tsx index ea6660694..c2bfb6bec 100644 --- a/apps/cyberstorm-remix/app/settings/teams/Teams.tsx +++ b/apps/cyberstorm-remix/app/settings/teams/Teams.tsx @@ -62,10 +62,10 @@ export default function Teams() { <BreadCrumbs> <CyberstormLink linkId="Teams">Teams</CyberstormLink> </BreadCrumbs> - <header className="project-root__page-header"> + <header className="nimbus-root__page-header"> <PageHeader title="Teams" /> </header> - <main className="project-root__main"> + <main className="nimbus-root__main"> <SettingItem title="Teams" description="Manage your teams" diff --git a/apps/cyberstorm-remix/app/settings/teams/team/Tabs.module.css b/apps/cyberstorm-remix/app/settings/teams/team/Tabs.module.css index f042799a6..4da2f8775 100644 --- a/apps/cyberstorm-remix/app/settings/teams/team/Tabs.module.css +++ b/apps/cyberstorm-remix/app/settings/teams/team/Tabs.module.css @@ -46,7 +46,7 @@ } .button:not(.active, :disabled):hover > .icon { - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); } .label { diff --git a/apps/cyberstorm-remix/app/settings/teams/team/tabs/Members/TeamMembers.module.css b/apps/cyberstorm-remix/app/settings/teams/team/tabs/Members/TeamMembers.module.css index 160960bb7..3cd1135d5 100644 --- a/apps/cyberstorm-remix/app/settings/teams/team/tabs/Members/TeamMembers.module.css +++ b/apps/cyberstorm-remix/app/settings/teams/team/tabs/Members/TeamMembers.module.css @@ -41,7 +41,7 @@ } .description { - color: var(--color-text--secondary); + color: var(--color-text-secondary); font-weight: var(--font-weight-medium); font-size: var(--font-size-body-xxxxl); line-height: var(--line-height--l); diff --git a/apps/cyberstorm-remix/app/settings/teams/team/tabs/ServiceAccounts/TeamServiceAccounts.module.css b/apps/cyberstorm-remix/app/settings/teams/team/tabs/ServiceAccounts/TeamServiceAccounts.module.css index f183fb271..9bd4f4be1 100644 --- a/apps/cyberstorm-remix/app/settings/teams/team/tabs/ServiceAccounts/TeamServiceAccounts.module.css +++ b/apps/cyberstorm-remix/app/settings/teams/team/tabs/ServiceAccounts/TeamServiceAccounts.module.css @@ -16,7 +16,7 @@ } .description { - color: var(--color-text--secondary); + color: var(--color-text-secondary); font-weight: var(--font-weight-medium); font-size: var(--font-size-body-xxxxl); line-height: var(--line-height--l); diff --git a/apps/cyberstorm-remix/app/settings/teams/team/teamSettings.tsx b/apps/cyberstorm-remix/app/settings/teams/team/teamSettings.tsx index c96229d4f..39909781f 100644 --- a/apps/cyberstorm-remix/app/settings/teams/team/teamSettings.tsx +++ b/apps/cyberstorm-remix/app/settings/teams/team/teamSettings.tsx @@ -53,10 +53,10 @@ export default function Community() { const currentTab = location.pathname.endsWith("/settings") ? "settings" : location.pathname.endsWith("/members") - ? "members" - : location.pathname.endsWith("/service-accounts") - ? "service-accounts" - : "profile"; + ? "members" + : location.pathname.endsWith("/service-accounts") + ? "service-accounts" + : "profile"; return ( <> @@ -64,12 +64,12 @@ export default function Community() { <CyberstormLink linkId="Teams">Teams</CyberstormLink> {team.name} </BreadCrumbs> - <header className="project-root__page-header"> + <header className="nimbus-root__page-header"> <div className={styles.header}> <PageHeader title="Teams" /> </div> </header> - <main className="project-root__main"> + <main className="nimbus-root__main"> <div className={styles.teamContainer}> <div className={tabsStyles.root}> <div className={tabsStyles.buttons}> diff --git a/apps/cyberstorm-remix/app/settings/user/Connections/Connections.module.css b/apps/cyberstorm-remix/app/settings/user/Connections/Connections.module.css index e919e8d0b..258298d7a 100644 --- a/apps/cyberstorm-remix/app/settings/user/Connections/Connections.module.css +++ b/apps/cyberstorm-remix/app/settings/user/Connections/Connections.module.css @@ -78,7 +78,7 @@ } .connectedAsDescription { - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); font-weight: var(--font-weight-medium); font-size: var(--font-size-body-lg); line-height: 1; @@ -91,7 +91,7 @@ line-height: normal; } -@media (width <= 30rem) { +@media (width <= 48rem) { .item { flex-direction: column; gap: var(--gap-xs); diff --git a/apps/cyberstorm-remix/app/settings/user/Settings.tsx b/apps/cyberstorm-remix/app/settings/user/Settings.tsx index 40d60db58..188576f5d 100644 --- a/apps/cyberstorm-remix/app/settings/user/Settings.tsx +++ b/apps/cyberstorm-remix/app/settings/user/Settings.tsx @@ -35,12 +35,12 @@ export default function Community() { <BreadCrumbs> <CyberstormLink linkId="Settings">Settings</CyberstormLink> </BreadCrumbs> - <header className="project-root__page-header"> + <header className="nimbus-root__page-header"> <div className={styles.header}> <PageHeader title="Settings" /> </div> </header> - <main className="project-root__main"> + <main className="nimbus-root__main"> <div className={styles.tabContent}> <div className={tabsStyles.root}> <div className={tabsStyles.buttons}> diff --git a/apps/cyberstorm-remix/app/settings/user/Tabs.module.css b/apps/cyberstorm-remix/app/settings/user/Tabs.module.css index f042799a6..4da2f8775 100644 --- a/apps/cyberstorm-remix/app/settings/user/Tabs.module.css +++ b/apps/cyberstorm-remix/app/settings/user/Tabs.module.css @@ -46,7 +46,7 @@ } .button:not(.active, :disabled):hover > .icon { - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); } .label { diff --git a/apps/cyberstorm-remix/app/styles/emptyGhost.css b/apps/cyberstorm-remix/app/styles/emptyGhost.css new file mode 100644 index 000000000..ccb233c5b --- /dev/null +++ b/apps/cyberstorm-remix/app/styles/emptyGhost.css @@ -0,0 +1,36 @@ +@layer nimbus-layout { + .nimbus-noresult { + display: flex; + flex-direction: column; + align-items: center; + padding-top: 5rem; + padding-bottom: 5rem; + } + + .nimbus-noresult__ghostbounce { + animation: ghost-bounce 3s ease-in-out infinite; + } + + .nimbus-noresult__info { + display: flex; + flex-direction: column; + } + + .nimbus-noresult__button { + width: fit-content; + } + + @keyframes ghost-bounce { + 0% { + transform: translateY(0); + } + + 50% { + transform: translateY(-5px); + } + + 100% { + transform: translateY(0); + } + } +} diff --git a/apps/cyberstorm-remix/app/styles/error.css b/apps/cyberstorm-remix/app/styles/error.css index ae6e07eca..e672d88c6 100644 --- a/apps/cyberstorm-remix/app/styles/error.css +++ b/apps/cyberstorm-remix/app/styles/error.css @@ -1,5 +1,5 @@ -@layer project-layout { - .project-error { +@layer nimbus-layout { + .nimbus-error { display: flex; flex-direction: column; gap: var(--space-32); @@ -10,20 +10,20 @@ --glitch-color-2: var(--old--color-accent-pink-50); } - .project-error__description { - color: var(--color-text--accent); + .nimbus-error__description { + color: var(--color-text-accent); font-weight: var(--font-weight-semibold); line-height: 1; } - .project-error__flavor { + .nimbus-error__flavor { font-weight: var(--font-weight-bold); font-size: var(--space-32); line-height: 1; text-align: center; } - .project-error__glitch { + .nimbus-error__glitch { position: relative; margin-top: var(--space-32); margin-bottom: var(--space-48); @@ -32,35 +32,37 @@ line-height: 1; } - .project-error__glitch::before, - .project-error__glitch::after { + .nimbus-error__glitch::before, + .nimbus-error__glitch::after { position: absolute; z-index: -1; width: 110%; content: attr(data-text); } - .project-error__glitch::before { + .nimbus-error__glitch::before { top: 10px; left: 15px; color: var(--glitch-color-1); - animation: project-error-paths 5s step-end infinite, - project-error-opacity 5s step-end infinite, - project-error-font 8s step-end infinite, - project-error-movement 10s step-end infinite; + animation: + nimbus-error-paths 5s step-end infinite, + nimbus-error-opacity 5s step-end infinite, + nimbus-error-font 8s step-end infinite, + nimbus-error-movement 10s step-end infinite; } - .project-error__glitch::after { + .nimbus-error__glitch::after { top: 5px; left: -10px; color: var(--glitch-color-2); - animation: project-error-paths 5s step-end infinite, - project-error-opacity 5s step-end infinite, - project-error-font 7s step-end infinite, - project-error-movement 8s step-end infinite; + animation: + nimbus-error-paths 5s step-end infinite, + nimbus-error-opacity 5s step-end infinite, + nimbus-error-font 7s step-end infinite, + nimbus-error-movement 8s step-end infinite; } - @keyframes project-error-paths { + @keyframes nimbus-error-paths { 0% { clip-path: polygon( 0% 43%, @@ -312,7 +314,7 @@ } } - @keyframes project-error-movement { + @keyframes nimbus-error-movement { 0% { top: 0; left: -20px; @@ -339,7 +341,7 @@ } } - @keyframes project-error-opacity { + @keyframes nimbus-error-opacity { 0% { opacity: 0.1; } @@ -374,7 +376,7 @@ } } - @keyframes project-error-font { + @keyframes nimbus-error-font { 0% { color: var(--glitch-color-1); font-weight: 100; @@ -401,7 +403,7 @@ } } - .project-error__glitch span { + .nimbus-error__glitch span { animation: paths 5s step-end infinite; } } diff --git a/apps/cyberstorm-remix/app/styles/index.css b/apps/cyberstorm-remix/app/styles/index.css index 23ba7001a..eec962601 100644 --- a/apps/cyberstorm-remix/app/styles/index.css +++ b/apps/cyberstorm-remix/app/styles/index.css @@ -1,5 +1,6 @@ -@layer utils, components, colors, theme, theme-components, project-layout, project-overrides; +@layer utils, components, colors, theme, theme-components, nimbus-layout, nimbus-overrides; @import "layout.css"; @import "overrides.css"; @import "error.css"; +@import "emptyGhost.css"; diff --git a/apps/cyberstorm-remix/app/styles/layout.css b/apps/cyberstorm-remix/app/styles/layout.css index 1b0cc5638..deffac358 100644 --- a/apps/cyberstorm-remix/app/styles/layout.css +++ b/apps/cyberstorm-remix/app/styles/layout.css @@ -1,106 +1,80 @@ -@layer project-layout { +@layer nimbus-layout { :root { /* Header dimensions */ --header-height: 3.5rem; --content-padding-top-desktop: 2rem; } - .project-root { + .nimbus-root { display: flex; flex-direction: column; + align-items: center; min-height: 100vh; } - .project-root__content { + .nimbus-root__content { display: flex; - flex: 1; - flex-direction: row; - gap: 3rem; + gap: 4rem; align-items: flex-start; justify-content: center; width: 100%; - max-width: 100%; - padding: var(--content-padding-top-desktop) 1rem 6rem; } - .project-root__middle-container { + .nimbus-root__outlet { position: relative; display: flex; flex: 1 1 auto; flex-direction: column; gap: 1rem; - width: 100%; - max-width: 83.5rem; + min-width: 0; + padding: 1rem 0 2rem 2rem; } - .project-root__side-containers { + .nimbus-root__ads-container { position: sticky; top: var(--header-height); display: flex; - flex-basis: 0; flex-direction: column; - flex-grow: 1; - gap: 2rem; + gap: 1rem; align-items: flex-start; - padding-top: 1rem; - } - - .project-root__page-header { - padding: 0; - } - - .project-root__page-body { - display: flex; - flex-direction: column; + padding-top: 4.5rem; + padding-right: 2rem; } - .project-root__layout-sidebar { + .nimbus-root__page-body { display: flex; flex-direction: column; - gap: 2rem; } - .project-root__main { + .nimbus-root__main { display: flex; flex-direction: column; gap: 2rem; } - @media (width >= 60rem) { - .project-root__layout-sidebar { - flex-flow: row wrap; + @media (width <= 92.125rem) { + .nimbus-root__ads-container { + display: none; } - .project-root__sidebar { - flex: 0 1 16rem; + .nimbus-root__outlet { + padding: 1rem 2rem 2rem; } + } - .project-root__main { + @media (width >= 60rem) { + .nimbus-root__main { flex: 1; } - .project-root__fullwidth { - flex: 0 0 100%; - } - - .project-root__page-header { - padding: 2.5rem 0; - } - - .project-root__middle-container { + .nimbus-root__outlet { gap: 0; } } - @media (width <= 92.125rem) { - .project-root__side-containers { - display: none; - } - } - - @media (width < 23.75rem) { - .project-root__page-header > h1 { - --display-font-size: var(--space-32); + @media (width <= 48rem) { + .nimbus-root__outlet { + padding: 1rem; } } } diff --git a/apps/cyberstorm-remix/app/styles/overrides.css b/apps/cyberstorm-remix/app/styles/overrides.css index b6a5cb70e..2641fcb4c 100644 --- a/apps/cyberstorm-remix/app/styles/overrides.css +++ b/apps/cyberstorm-remix/app/styles/overrides.css @@ -1,5 +1,23 @@ -@layer project-overrides { +@layer nimbus-overrides { :root { - --project-not-used-token: black; + --nimbus-not-used-token: black; + } + + @media (width <= 63.5rem) { + .nimbus-hide-l { + display: none; + } + } + + @media (width <= 40rem) { + .nimbus-hide-m { + display: none; + } + } + + @media (width <= 48rem) { + .nimbus-hide-s { + display: none; + } } } diff --git a/apps/cyberstorm-remix/app/tools/manifest-validator/manifestValidator.tsx b/apps/cyberstorm-remix/app/tools/manifest-validator/manifestValidator.tsx index 3d127828b..3ff917a95 100644 --- a/apps/cyberstorm-remix/app/tools/manifest-validator/manifestValidator.tsx +++ b/apps/cyberstorm-remix/app/tools/manifest-validator/manifestValidator.tsx @@ -75,10 +75,10 @@ export default function ManifestValidator() { Manifest Validator </CyberstormLink> </BreadCrumbs> - <header className="project-root__page-header"> + <header className="nimbus-root__page-header"> <PageHeader title="Manifest Validator" /> </header> - <main className="project-root__main"> + <main className="nimbus-root__main"> <SettingItem title="Manifest Validator" description="Select a team to validate a package" diff --git a/apps/cyberstorm-remix/app/tools/markdown-preview/markdownPreview.tsx b/apps/cyberstorm-remix/app/tools/markdown-preview/markdownPreview.tsx index 2564be04e..408f2fdf0 100644 --- a/apps/cyberstorm-remix/app/tools/markdown-preview/markdownPreview.tsx +++ b/apps/cyberstorm-remix/app/tools/markdown-preview/markdownPreview.tsx @@ -60,10 +60,10 @@ export default function MarkdownPreview() { Markdown Preview </CyberstormLink> </BreadCrumbs> - <header className="project-root__page-header"> + <header className="nimbus-root__page-header"> <PageHeader title="Markdown Preview" /> </header> - <main className="project-root__main"> + <main className="nimbus-root__main"> <div className={styles.root}> <SettingItem title="Markdown input" diff --git a/apps/cyberstorm-remix/app/tools/package-format-docs/packageFormatDocs.tsx b/apps/cyberstorm-remix/app/tools/package-format-docs/packageFormatDocs.tsx index 9474d1cee..d49c64969 100644 --- a/apps/cyberstorm-remix/app/tools/package-format-docs/packageFormatDocs.tsx +++ b/apps/cyberstorm-remix/app/tools/package-format-docs/packageFormatDocs.tsx @@ -18,10 +18,10 @@ export default function PackageFormatDocs() { Package Format Docs </CyberstormLink> </BreadCrumbs> - <header className="project-root__page-header"> + <header className="nimbus-root__page-header"> <PageHeader title="Package Format Docs" /> </header> - <main className="project-root__main"> + <main className="nimbus-root__main"> <div className={styles.root}> <p> A valid package is a zip file that contains the following files: diff --git a/apps/cyberstorm-remix/cyberstorm/dapper/sessionUtils.ts b/apps/cyberstorm-remix/cyberstorm/dapper/sessionUtils.ts index f012fd678..85803ed7d 100644 --- a/apps/cyberstorm-remix/cyberstorm/dapper/sessionUtils.ts +++ b/apps/cyberstorm-remix/cyberstorm/dapper/sessionUtils.ts @@ -89,8 +89,8 @@ export async function getDapper(isClient = false) { const existingDapper = shouldRemakeDapper ? createNewDapper() : dapper - ? dapper - : new DapperTs(newConfig, removeSession); + ? dapper + : new DapperTs(newConfig, removeSession); return existingDapper; } else { diff --git a/apps/cyberstorm-remix/cyberstorm/navigation/DesktopUserDropdown.tsx b/apps/cyberstorm-remix/cyberstorm/navigation/DesktopUserDropdown.tsx index c657709ae..339af92ab 100644 --- a/apps/cyberstorm-remix/cyberstorm/navigation/DesktopUserDropdown.tsx +++ b/apps/cyberstorm-remix/cyberstorm/navigation/DesktopUserDropdown.tsx @@ -2,7 +2,7 @@ import { faSignOut, faUsers, faCog } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import styles from "./Navigation.module.css"; -import dropdownStyles from "../../../../packages/cyberstorm/src/newComponents/DropDown/DropDown.module.css"; +// import dropdownStyles from "../../../../packages/cyberstorm/src/newComponents/DropDown/DropDown.module.css"; import { Avatar, NewDropDown, @@ -37,10 +37,7 @@ export function DesktopUserDropdown(props: { user: CurrentUser }) { <NewLink primitiveType="cyberstormLink" linkId="Settings" - rootClasses={classnames( - dropdownStyles.dropdownItem, - styles.dropDownItem - )} + rootClasses={classnames("ts-dropdown__item", styles.dropDownItem)} > <NewIcon csMode="inline" noWrapper csVariant="tertiary"> <FontAwesomeIcon icon={faCog} /> @@ -52,10 +49,7 @@ export function DesktopUserDropdown(props: { user: CurrentUser }) { <NewLink primitiveType="cyberstormLink" linkId="Teams" - rootClasses={classnames( - dropdownStyles.dropdownItem, - styles.dropDownItem - )} + rootClasses={classnames("ts-dropdown__item", styles.dropDownItem)} > <NewIcon csMode="inline" noWrapper csVariant="tertiary"> <FontAwesomeIcon icon={faUsers} /> @@ -67,10 +61,7 @@ export function DesktopUserDropdown(props: { user: CurrentUser }) { <NewLink primitiveType="link" href="/logout" - rootClasses={classnames( - dropdownStyles.dropdownItem, - styles.dropDownItem - )} + rootClasses={classnames("ts-dropdown__item", styles.dropDownItem)} > <NewIcon csMode="inline" noWrapper csVariant="tertiary"> <FontAwesomeIcon icon={faSignOut} /> diff --git a/apps/cyberstorm-remix/cyberstorm/navigation/DevelopersDropDown.module.css b/apps/cyberstorm-remix/cyberstorm/navigation/DevelopersDropDown.module.css index 7d1d02a83..ee465f250 100644 --- a/apps/cyberstorm-remix/cyberstorm/navigation/DevelopersDropDown.module.css +++ b/apps/cyberstorm-remix/cyberstorm/navigation/DevelopersDropDown.module.css @@ -2,9 +2,6 @@ display: flex; align-items: center; justify-content: space-between; - color: var(--color-text-primary); - font-weight: var(--font-weight-regular); - font-size: var(--font-size-body-md); } .focus:not([data-highlighted]) a svg { @@ -14,9 +11,3 @@ .root { min-width: 14rem; } - -.link { - color: var(--color-text-primary); - font-weight: var(--font-weight-regular); - font-size: var(--font-size-body-md); -} diff --git a/apps/cyberstorm-remix/cyberstorm/navigation/DevelopersDropDown.tsx b/apps/cyberstorm-remix/cyberstorm/navigation/DevelopersDropDown.tsx index d065294e1..fc86d8705 100644 --- a/apps/cyberstorm-remix/cyberstorm/navigation/DevelopersDropDown.tsx +++ b/apps/cyberstorm-remix/cyberstorm/navigation/DevelopersDropDown.tsx @@ -1,6 +1,5 @@ import { faCaretDown } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { faArrowUpRightFromSquare } from "@fortawesome/free-solid-svg-icons"; import styles from "./DevelopersDropDown.module.css"; import { @@ -10,6 +9,8 @@ import { NewButton, NewLink, } from "@thunderstore/cyberstorm"; +import { faArrowUpRight } from "@fortawesome/pro-solid-svg-icons"; +import { classnames } from "@thunderstore/cyberstorm/src/utils/utils"; export function DevelopersDropDown() { return ( @@ -28,7 +29,7 @@ export function DevelopersDropDown() { <NewDropDownItem> <NewLink primitiveType="link" - rootClasses={styles.link} + rootClasses={classnames(styles.link, "ts-dropdown__item")} href="/api/docs" > API Docs @@ -37,7 +38,7 @@ export function DevelopersDropDown() { <NewDropDownItem> <NewLink primitiveType="link" - rootClasses={styles.link} + rootClasses={classnames(styles.link, "ts-dropdown__item")} href="/package/create/docs/" > Package Format Docs @@ -46,7 +47,7 @@ export function DevelopersDropDown() { <NewDropDownItem> <NewLink primitiveType="link" - rootClasses={styles.link} + rootClasses={classnames(styles.link, "ts-dropdown__item")} href="/tools/manifest-v1-validator/" > Manifest Validator @@ -55,7 +56,7 @@ export function DevelopersDropDown() { <NewDropDownItem> <NewLink primitiveType="link" - rootClasses={styles.link} + rootClasses={classnames(styles.link, "ts-dropdown__item")} href="/tools/markdown-preview/" > Markdown Preview @@ -64,12 +65,12 @@ export function DevelopersDropDown() { <NewDropDownItem rootClasses={styles.focus}> <NewLink primitiveType="link" - rootClasses={styles.externalLink} + rootClasses={classnames(styles.externalLink, "ts-dropdown__item")} href="https://github.com/thunderstore-io" > Github <NewIcon csMode="inline" noWrapper> - <FontAwesomeIcon icon={faArrowUpRightFromSquare} /> + <FontAwesomeIcon icon={faArrowUpRight} /> </NewIcon> </NewLink> </NewDropDownItem> diff --git a/apps/cyberstorm-remix/cyberstorm/navigation/MobileUserPopoverContent.tsx b/apps/cyberstorm-remix/cyberstorm/navigation/MobileUserPopoverContent.tsx index 2334b601e..a1c40e5db 100644 --- a/apps/cyberstorm-remix/cyberstorm/navigation/MobileUserPopoverContent.tsx +++ b/apps/cyberstorm-remix/cyberstorm/navigation/MobileUserPopoverContent.tsx @@ -44,7 +44,7 @@ export function MobileUserPopoverContent(props: { user: CurrentUser }) { aria-label="Back" csSize="medium" csVariant="secondary" - csModifiers={["ghost", "dimmed"]} + csModifiers={["ghost"]} icon={faLongArrowLeft} /> } diff --git a/apps/cyberstorm-remix/cyberstorm/navigation/Navigation.tsx b/apps/cyberstorm-remix/cyberstorm/navigation/Navigation.tsx index 5a02413db..be6ab85ff 100644 --- a/apps/cyberstorm-remix/cyberstorm/navigation/Navigation.tsx +++ b/apps/cyberstorm-remix/cyberstorm/navigation/Navigation.tsx @@ -9,7 +9,6 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import styles from "./Navigation.module.css"; import { Menu, - LinkButton, NewLink, NewIcon, Avatar, @@ -54,7 +53,7 @@ export function Navigation(props: { <ThunderstoreLogo /> </NewIcon> </NewLink> - <LinkButton + <NewButton primitiveType="cyberstormLink" linkId="Communities" csSize="big" @@ -62,11 +61,11 @@ export function Navigation(props: { csModifiers={["ghost"]} > Communities - </LinkButton> + </NewButton> <DevelopersDropDown /> </nav> <div className={styles.headerRightSide}> - <LinkButton + <NewButton primitiveType="link" href="https://www.overwolf.com/app/Thunderstore-Thunderstore_Mod_Manager" csSize="medium" @@ -75,7 +74,7 @@ export function Navigation(props: { aria-label="Get Thunderstore Mod Manager App" > Get App - </LinkButton> + </NewButton> {/* Disabled until we have "rated_packages_cyberstorm" available in the currentUser django endpoint */} {/* {hydrationCheck && currentUser ? ( <DesktopUserDropdown user={currentUser} /> @@ -173,7 +172,7 @@ export function MobileNavigationMenu() { aria-label="Back to previous menu" csSize="medium" csVariant="secondary" - csModifiers={["ghost", "dimmed"]} + csModifiers={["ghost"]} icon={faLongArrowLeft} /> } diff --git a/apps/cyberstorm-remix/package.json b/apps/cyberstorm-remix/package.json index cc1e41f7b..f372866e6 100644 --- a/apps/cyberstorm-remix/package.json +++ b/apps/cyberstorm-remix/package.json @@ -12,6 +12,7 @@ "typecheck": "tsc" }, "dependencies": { + "@fortawesome/pro-solid-svg-icons": "6.6.0", "@remix-run/node": "^2.12.1", "@remix-run/react": "^2.12.1", "@remix-run/serve": "^2.12.1", diff --git a/apps/cyberstorm-remix/vite.config.ts b/apps/cyberstorm-remix/vite.config.ts index e7b6f9cc2..e123cd349 100644 --- a/apps/cyberstorm-remix/vite.config.ts +++ b/apps/cyberstorm-remix/vite.config.ts @@ -25,8 +25,8 @@ export default defineConfig({ index: true, id: "landing-page", }); + route("/c/:communityId", "c/community.tsx"); if (process.env.ENABLE_BROKEN_PAGES) { - route("/c/:communityId", "c/community.tsx"); route( "/c/:communityId/p/:namespaceId/:packageId", "p/packageListing.tsx", diff --git a/apps/cyberstorm-storybook/stories/components/CommunityCard.stories.tsx b/apps/cyberstorm-storybook/stories/components/CommunityCard.stories.tsx index e35077367..41374400d 100644 --- a/apps/cyberstorm-storybook/stories/components/CommunityCard.stories.tsx +++ b/apps/cyberstorm-storybook/stories/components/CommunityCard.stories.tsx @@ -14,10 +14,12 @@ const style: React.CSSProperties = { const defaultCommunity = { name: "Risk of Rain 2", identifier: "", + short_description: "", description: "", + wiki_url: "", discord_url: "", datetime_created: "", - background_image_url: "", + hero_image_url: "", cover_image_url: "", icon_url: "", total_download_count: 0, diff --git a/apps/cyberstorm-storybook/stories/newComponents/Button.stories.tsx b/apps/cyberstorm-storybook/stories/newComponents/Button.stories.tsx index 847700399..1490773f6 100644 --- a/apps/cyberstorm-storybook/stories/newComponents/Button.stories.tsx +++ b/apps/cyberstorm-storybook/stories/newComponents/Button.stories.tsx @@ -20,129 +20,184 @@ const meta = { const defaultArgs = {}; const Template: StoryFn<typeof NewButton> = () => { - const Buttons = ButtonSizesList.map((size) => { - const variantBlock = ButtonVariantsList.map((variant) => { - const modifierBlock = ButtonModifiersList.map((modifier) => { + function genButtons(isLink: boolean) { + const Buttons = ButtonSizesList.map((size) => { + const variantBlock = ButtonVariantsList.map((variant) => { + const modifierBlock = ButtonModifiersList.map((modifier) => { + return isLink ? ( + <NewButton + primitiveType={"link"} + href="https://example.com" + key={`${size}-${variant}-${modifier}`} + csVariant={variant} + csSize={size} + csModifiers={[modifier]} + > + {size}-{variant}-{modifier} + <NewIcon csMode={"inline"} noWrapper> + <FontAwesomeIcon icon={faChevronDown} /> + </NewIcon> + </NewButton> + ) : ( + <NewButton + key={`${size}-${variant}-${modifier}`} + csVariant={variant} + csSize={size} + csModifiers={[modifier]} + > + {size}-{variant}-{modifier} + <NewIcon csMode={"inline"} noWrapper> + <FontAwesomeIcon icon={faChevronDown} /> + </NewIcon> + </NewButton> + ); + }); return ( - <NewButton - key={`${size}-${variant}-${modifier}`} - csVariant={variant} - csSize={size} - csModifiers={[modifier]} + <div + key={`${size}-${variant}`} + style={{ + display: "flex", + flexDirection: "row", + gap: "0.5rem", + }} > - {size}-{variant}-{modifier} - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </NewButton> + {isLink ? ( + <NewButton + primitiveType={"link"} + href="https://example.com" + key={`${size}-${variant}-noModifier`} + csVariant={variant} + csSize={size} + > + {size}-{variant}-noModifier + <NewIcon csMode={"inline"} noWrapper> + <FontAwesomeIcon icon={faChevronDown} /> + </NewIcon> + </NewButton> + ) : ( + <NewButton + key={`${size}-${variant}-noModifier`} + csVariant={variant} + csSize={size} + > + {size}-{variant}-noModifier + <NewIcon csMode={"inline"} noWrapper> + <FontAwesomeIcon icon={faChevronDown} /> + </NewIcon> + </NewButton> + )} + {modifierBlock} + </div> ); }); return ( <div - key={`${size}-${variant}`} + key={`${size}`} style={{ display: "flex", - flexDirection: "row", + flexDirection: "column", gap: "0.5rem", }} > - <NewButton - key={`${size}-${variant}-noModifier`} - csVariant={variant} - csSize={size} - > - {size}-{variant}-noModifier - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </NewButton> - {modifierBlock} + {variantBlock} </div> ); }); + return ( <div - key={`${size}`} style={{ display: "flex", flexDirection: "column", gap: "0.5rem", }} > - {variantBlock} + {Buttons} </div> ); - }); + } - const buttonOptions = ( - <div - style={{ - display: "flex", - flexDirection: "column", - gap: "0.5rem", - }} - > - {Buttons} - </div> - ); - - const IconButtons = IconButtonSizesList.map((size) => { - const variantBlock = IconButtonVariantsList.map((variant) => { - const modifierBlock = IconButtonModifiersList.map((modifier) => { + function genIconButtons(isLink: boolean) { + const IconButtons = IconButtonSizesList.map((size) => { + const variantBlock = IconButtonVariantsList.map((variant) => { + const modifierBlock = IconButtonModifiersList.map((modifier) => { + return isLink ? ( + <NewButton + primitiveType={"link"} + href="https://example.com" + key={`${size}-${variant}-${modifier}`} + csVariant={variant} + csSize={size} + csModifiers={[modifier]} + icon={faChevronDown} + /> + ) : ( + <NewButton + key={`${size}-${variant}-${modifier}`} + csVariant={variant} + csSize={size} + csModifiers={[modifier]} + icon={faChevronDown} + /> + ); + }); return ( - <NewButton - key={`${size}-${variant}-${modifier}`} - csVariant={variant} - csSize={size} - csModifiers={[modifier]} - icon={faChevronDown} - /> + <div + key={`${size}-${variant}`} + style={{ + display: "flex", + flexDirection: "row", + gap: "0.5rem", + }} + > + {isLink ? ( + <NewButton + primitiveType={"link"} + href="https://example.com" + key={`${size}-${variant}-noModifier`} + csVariant={variant} + csSize={size} + icon={faChevronDown} + /> + ) : ( + <NewButton + key={`${size}-${variant}-noModifier`} + csVariant={variant} + csSize={size} + icon={faChevronDown} + /> + )} + + {modifierBlock} + </div> ); }); return ( <div - key={`${size}-${variant}`} + key={`${size}`} style={{ display: "flex", - flexDirection: "row", + flexDirection: "column", gap: "0.5rem", }} > - <NewButton - key={`${size}-${variant}-noModifier`} - csVariant={variant} - csSize={size} - icon={faChevronDown} - /> - {modifierBlock} + {variantBlock} </div> ); }); + return ( <div - key={`${size}`} style={{ display: "flex", flexDirection: "column", gap: "0.5rem", }} > - {variantBlock} + {IconButtons} </div> ); - }); - - const iconButtonOptions = ( - <div - style={{ - display: "flex", - flexDirection: "column", - gap: "0.5rem", - }} - > - {IconButtons} - </div> - ); + } return ( <div @@ -153,8 +208,10 @@ const Template: StoryFn<typeof NewButton> = () => { gap: "0.5rem", }} > - {buttonOptions} - {iconButtonOptions} + {genButtons(false)} + {genIconButtons(false)} + {genButtons(true)} + {genIconButtons(true)} </div> ); }; diff --git a/apps/cyberstorm-storybook/stories/newComponents/CardCommunity.stories.tsx b/apps/cyberstorm-storybook/stories/newComponents/CardCommunity.stories.tsx index b97f526e3..e0bc8e61f 100644 --- a/apps/cyberstorm-storybook/stories/newComponents/CardCommunity.stories.tsx +++ b/apps/cyberstorm-storybook/stories/newComponents/CardCommunity.stories.tsx @@ -14,10 +14,12 @@ const style: React.CSSProperties = { const defaultCommunity = { name: "Risk of Rain 2", identifier: "", + short_description: "", description: "", + wiki_url: "", discord_url: "", datetime_created: "", - background_image_url: "", + hero_image_url: "", cover_image_url: "", icon_url: "", total_download_count: 0, diff --git a/apps/cyberstorm-storybook/stories/newComponents/LinkButton.stories.tsx b/apps/cyberstorm-storybook/stories/newComponents/LinkButton.stories.tsx deleted file mode 100644 index fbaad0454..000000000 --- a/apps/cyberstorm-storybook/stories/newComponents/LinkButton.stories.tsx +++ /dev/null @@ -1,236 +0,0 @@ -import { StoryFn, Meta } from "@storybook/react"; -import { LinkButton, NewIcon } from "@thunderstore/cyberstorm"; -import React from "react"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { faChevronDown } from "@fortawesome/free-solid-svg-icons"; - -const meta = { - title: "LinkButton", - component: LinkButton, -} as Meta<typeof LinkButton>; - -const defaultArgs = {}; - -const Template: StoryFn<typeof LinkButton> = (args) => ( - <div - style={{ - display: "flex", - flexDirection: "row", - gap: "0.5rem", - }} - > - <div - style={{ - width: "12rem", - display: "flex", - flexDirection: "column", - gap: "0.5rem", - }} - > - <LinkButton {...args} primitiveType="link" href="https://example.com"> - default - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </LinkButton> - <LinkButton - tooltipText="tooltip text" - {...args} - primitiveType="link" - href="https://example.com" - > - tooltipDefault - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </LinkButton> - <LinkButton - csVariant="primary" - {...args} - primitiveType="link" - href="https://example.com" - > - primary - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </LinkButton> - <LinkButton - csVariant="secondary" - csModifiers={["ghost"]} - {...args} - primitiveType="link" - href="https://example.com" - > - tertiary - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </LinkButton> - <LinkButton - csVariant="accent" - {...args} - primitiveType="link" - href="https://example.com" - > - accent - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </LinkButton> - <LinkButton - csVariant="success" - {...args} - primitiveType="link" - href="https://example.com" - > - success - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </LinkButton> - <LinkButton - csVariant="warning" - {...args} - primitiveType="link" - href="https://example.com" - > - warning - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </LinkButton> - <LinkButton - csVariant="danger" - {...args} - primitiveType="link" - href="https://example.com" - > - danger - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </LinkButton> - <LinkButton - csVariant="special" - {...args} - primitiveType="link" - href="https://example.com" - > - specialGreen - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </LinkButton> - </div> - <div - style={{ - width: "12rem", - display: "flex", - flexDirection: "column", - gap: "0.5rem", - }} - > - <LinkButton {...args} primitiveType="cyberstormLink" linkId="Communities"> - default - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </LinkButton> - <LinkButton - tooltipText="tooltip text" - {...args} - primitiveType="cyberstormLink" - linkId="Communities" - > - tooltipDefault - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </LinkButton> - <LinkButton - csVariant="primary" - {...args} - primitiveType="cyberstormLink" - linkId="Communities" - > - primary - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </LinkButton> - <LinkButton - csVariant="secondary" - csModifiers={["ghost"]} - {...args} - primitiveType="cyberstormLink" - linkId="Communities" - > - tertiary - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </LinkButton> - <LinkButton - csVariant="accent" - {...args} - primitiveType="cyberstormLink" - linkId="Communities" - > - accent - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </LinkButton> - <LinkButton - csVariant="success" - {...args} - primitiveType="cyberstormLink" - linkId="Communities" - > - success - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </LinkButton> - <LinkButton - csVariant="warning" - {...args} - primitiveType="cyberstormLink" - linkId="Communities" - > - warning - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </LinkButton> - <LinkButton - csVariant="danger" - {...args} - primitiveType="cyberstormLink" - linkId="Communities" - > - danger - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </LinkButton> - <LinkButton - csVariant="special" - {...args} - primitiveType="cyberstormLink" - linkId="Communities" - > - specialGreen - <NewIcon csMode={"inline"} noWrapper> - <FontAwesomeIcon icon={faChevronDown} /> - </NewIcon> - </LinkButton> - </div> - </div> -); - -const DefaultLinkButton = Template.bind({}); -DefaultLinkButton.args = defaultArgs; - -export { meta as default, DefaultLinkButton as LinkButtons }; diff --git a/package.json b/package.json index cd5b9b68d..c24bdebaf 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "eslint-plugin-react": "^7.36.1", "globals": "^15.10.0", "plop": "^4.0.1", - "prettier": "^3.3.3", + "prettier": "3.1.0", "stylelint": "^16.9.0", "stylelint-config-rational-order": "^0.1.2", "stylelint-config-standard": "^36.0.1", diff --git a/packages/cyberstorm-forms/src/components/FormMultiSelectSearch.tsx b/packages/cyberstorm-forms/src/components/FormMultiSelectSearch.tsx index 3750e8b46..3ffc2639b 100644 --- a/packages/cyberstorm-forms/src/components/FormMultiSelectSearch.tsx +++ b/packages/cyberstorm-forms/src/components/FormMultiSelectSearch.tsx @@ -9,7 +9,7 @@ import styles from "./FormTextInput.module.css"; export type FormMultiSelectSearchProps< Schema extends ZodObject<Z>, - Z extends ZodRawShape + Z extends ZodRawShape, > = { // The schema is required to allow TS to infer valid values for the name field schema: Schema; @@ -21,7 +21,7 @@ export type FormMultiSelectSearchProps< }; export function FormMultiSelectSearch< Schema extends ZodObject<Z>, - Z extends ZodRawShape + Z extends ZodRawShape, >({ name, placeholder, diff --git a/packages/cyberstorm-forms/src/components/FormSelect.tsx b/packages/cyberstorm-forms/src/components/FormSelect.tsx index f093dc40e..13174c5dd 100644 --- a/packages/cyberstorm-forms/src/components/FormSelect.tsx +++ b/packages/cyberstorm-forms/src/components/FormSelect.tsx @@ -12,7 +12,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; export type FormSelectProps< Schema extends ZodObject<Z>, - Z extends ZodRawShape + Z extends ZodRawShape, > = { // The schema is required to allow TS to infer valid values for the name field schema: Schema; diff --git a/packages/cyberstorm-forms/src/components/FormSelectSearch.tsx b/packages/cyberstorm-forms/src/components/FormSelectSearch.tsx index 614ca49b8..9056b6b7d 100644 --- a/packages/cyberstorm-forms/src/components/FormSelectSearch.tsx +++ b/packages/cyberstorm-forms/src/components/FormSelectSearch.tsx @@ -5,7 +5,7 @@ import styles from "./FormTextInput.module.css"; export type FormSelectSearchProps< Schema extends ZodObject<Z>, - Z extends ZodRawShape + Z extends ZodRawShape, > = { // The schema is required to allow TS to infer valid values for the name field schema: Schema; @@ -15,7 +15,7 @@ export type FormSelectSearchProps< }; export function FormSelectSearch< Schema extends ZodObject<Z>, - Z extends ZodRawShape + Z extends ZodRawShape, >({ name, placeholder, options }: FormSelectSearchProps<Schema, Z>) { const { field, diff --git a/packages/cyberstorm-forms/src/components/FormSwitch.tsx b/packages/cyberstorm-forms/src/components/FormSwitch.tsx index 2c4dadd7f..69402e0cf 100644 --- a/packages/cyberstorm-forms/src/components/FormSwitch.tsx +++ b/packages/cyberstorm-forms/src/components/FormSwitch.tsx @@ -6,7 +6,7 @@ import { Switch } from "@thunderstore/cyberstorm"; export type FormSwitchProps< Schema extends ZodObject<Z>, - Z extends ZodRawShape + Z extends ZodRawShape, > = { // The schema is required to allow TS to infer valid values for the name field schema: Schema; diff --git a/packages/cyberstorm-forms/src/components/FormTextInput.tsx b/packages/cyberstorm-forms/src/components/FormTextInput.tsx index bf9513957..f1c16120f 100644 --- a/packages/cyberstorm-forms/src/components/FormTextInput.tsx +++ b/packages/cyberstorm-forms/src/components/FormTextInput.tsx @@ -8,7 +8,7 @@ import React from "react"; export type FormTextInputProps< Schema extends ZodObject<Z>, - Z extends ZodRawShape + Z extends ZodRawShape, > = { // The schema is required to allow TS to infer valid values for the name field schema: Schema; @@ -18,7 +18,7 @@ export type FormTextInputProps< }; export function FormTextInput< Schema extends ZodObject<Z>, - Z extends ZodRawShape + Z extends ZodRawShape, >({ name, placeholder, existingValue }: FormTextInputProps<Schema, Z>) { const { field, diff --git a/packages/cyberstorm-forms/src/forms/AddServiceAccountForm.module.css b/packages/cyberstorm-forms/src/forms/AddServiceAccountForm.module.css index bc623cb5b..e52f5739f 100644 --- a/packages/cyberstorm-forms/src/forms/AddServiceAccountForm.module.css +++ b/packages/cyberstorm-forms/src/forms/AddServiceAccountForm.module.css @@ -12,7 +12,7 @@ } .dialogText { - color: var(--color-text--secondary); + color: var(--color-text-secondary); font-weight: var(--font-weight-medium); font-size: var(--font-size-body-xxxxl); line-height: var(--line-height--l); diff --git a/packages/cyberstorm-forms/src/forms/AddTeamMemberForm.module.css b/packages/cyberstorm-forms/src/forms/AddTeamMemberForm.module.css index cfc816cce..b91d89188 100644 --- a/packages/cyberstorm-forms/src/forms/AddTeamMemberForm.module.css +++ b/packages/cyberstorm-forms/src/forms/AddTeamMemberForm.module.css @@ -12,7 +12,7 @@ } .dialogText { - color: var(--color-text--secondary); + color: var(--color-text-secondary); font-weight: var(--font-weight-medium); font-size: var(--font-size-body-xxxxl); line-height: var(--line-height--l); diff --git a/packages/cyberstorm-forms/src/forms/CreateTeamForm.module.css b/packages/cyberstorm-forms/src/forms/CreateTeamForm.module.css index 8c1f64a7c..5cde564a9 100644 --- a/packages/cyberstorm-forms/src/forms/CreateTeamForm.module.css +++ b/packages/cyberstorm-forms/src/forms/CreateTeamForm.module.css @@ -12,7 +12,7 @@ } .dialogText { - color: var(--color-text--secondary); + color: var(--color-text-secondary); font-weight: var(--font-weight-medium); font-size: var(--font-size-body-xxxxl); line-height: var(--line-height--l); diff --git a/packages/cyberstorm-forms/src/forms/DisbandTeamForm.module.css b/packages/cyberstorm-forms/src/forms/DisbandTeamForm.module.css index a584c78a9..bf8d548e7 100644 --- a/packages/cyberstorm-forms/src/forms/DisbandTeamForm.module.css +++ b/packages/cyberstorm-forms/src/forms/DisbandTeamForm.module.css @@ -12,7 +12,7 @@ } .dialogText { - color: var(--color-text--secondary); + color: var(--color-text-secondary); font-weight: var(--font-weight-medium); font-size: var(--font-size-body-xxxxl); line-height: var(--line-height--l); diff --git a/packages/cyberstorm-forms/src/forms/LeaveTeamForm.module.css b/packages/cyberstorm-forms/src/forms/LeaveTeamForm.module.css index 5005218c3..ac0831cd9 100644 --- a/packages/cyberstorm-forms/src/forms/LeaveTeamForm.module.css +++ b/packages/cyberstorm-forms/src/forms/LeaveTeamForm.module.css @@ -12,7 +12,7 @@ } .dialogText { - color: var(--color-text--secondary); + color: var(--color-text-secondary); font-weight: var(--font-weight-medium); font-size: var(--font-size-body-xxxxl); line-height: var(--line-height--l); diff --git a/packages/cyberstorm-forms/src/forms/RemoveServiceAccountForm.module.css b/packages/cyberstorm-forms/src/forms/RemoveServiceAccountForm.module.css index 6f4f81b5c..e0d1c672a 100644 --- a/packages/cyberstorm-forms/src/forms/RemoveServiceAccountForm.module.css +++ b/packages/cyberstorm-forms/src/forms/RemoveServiceAccountForm.module.css @@ -12,7 +12,7 @@ } .dialogText { - color: var(--color-text--secondary); + color: var(--color-text-secondary); font-weight: var(--font-weight-medium); font-size: var(--font-size-body-xxxxl); line-height: var(--line-height--l); diff --git a/packages/cyberstorm-forms/src/forms/RemoveTeamMemberForm.module.css b/packages/cyberstorm-forms/src/forms/RemoveTeamMemberForm.module.css index a584c78a9..bf8d548e7 100644 --- a/packages/cyberstorm-forms/src/forms/RemoveTeamMemberForm.module.css +++ b/packages/cyberstorm-forms/src/forms/RemoveTeamMemberForm.module.css @@ -12,7 +12,7 @@ } .dialogText { - color: var(--color-text--secondary); + color: var(--color-text-secondary); font-weight: var(--font-weight-medium); font-size: var(--font-size-body-xxxxl); line-height: var(--line-height--l); diff --git a/packages/cyberstorm-forms/src/forms/TeamDetailsEdit.module.css b/packages/cyberstorm-forms/src/forms/TeamDetailsEdit.module.css index 71fcb169c..7f1b51b52 100644 --- a/packages/cyberstorm-forms/src/forms/TeamDetailsEdit.module.css +++ b/packages/cyberstorm-forms/src/forms/TeamDetailsEdit.module.css @@ -56,7 +56,7 @@ flex-direction: row-reverse; } -@media (width <= 30rem) { +@media (width <= 48rem) { .donationLink { flex-direction: column; gap: var(--gap-md); diff --git a/packages/cyberstorm-forms/src/forms/UserConnectionsForm.module.css b/packages/cyberstorm-forms/src/forms/UserConnectionsForm.module.css index ffeddf005..e5ff9348a 100644 --- a/packages/cyberstorm-forms/src/forms/UserConnectionsForm.module.css +++ b/packages/cyberstorm-forms/src/forms/UserConnectionsForm.module.css @@ -78,7 +78,7 @@ } .connectedAsDescription { - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); font-weight: var(--font-weight-medium); font-size: var(--font-size-body-lg); line-height: 1; @@ -103,7 +103,7 @@ font-size: 0.875rem; } -@media (width <= 30rem) { +@media (width <= 48rem) { .item { flex-direction: column; gap: var(--gap-xs); diff --git a/packages/cyberstorm-forms/src/forms/UserConnectionsForm.tsx b/packages/cyberstorm-forms/src/forms/UserConnectionsForm.tsx index 37e26a3ff..12649ed4f 100644 --- a/packages/cyberstorm-forms/src/forms/UserConnectionsForm.tsx +++ b/packages/cyberstorm-forms/src/forms/UserConnectionsForm.tsx @@ -89,8 +89,8 @@ export function UserConnectionsForm(props: { p.name === "discord" ? props.connectionLinks.discord : p.name === "github" - ? props.connectionLinks.github - : props.connectionLinks.overwolf + ? props.connectionLinks.github + : props.connectionLinks.overwolf } disconnectFunction={onSubmit} /> @@ -103,7 +103,7 @@ UserConnectionsForm.displayName = "UserConnectionsForm"; interface ConnectionProps { // eslint-disable-next-line prettier/prettier - provider: typeof PROVIDERS[number]; + provider: (typeof PROVIDERS)[number]; connection?: OAuthConnection; connectionLink: string; disconnectFunction: ( @@ -130,8 +130,8 @@ function Connection(props: ConnectionProps) { {provider.name === "discord" ? "Discord" : provider.name === "github" - ? "Github" - : "Overwolf"} + ? "Github" + : "Overwolf"} </div> </div> <div className={styles.rightSection}> diff --git a/packages/cyberstorm-theme/src/components.tsx b/packages/cyberstorm-theme/src/components.tsx index 2fcb7f77c..13910331b 100644 --- a/packages/cyberstorm-theme/src/components.tsx +++ b/packages/cyberstorm-theme/src/components.tsx @@ -75,6 +75,12 @@ export { type TagModifiers, TagModifiersList, } from "./components/Tag/Tag"; +export { + type MetaItemVariants, + MetaItemVariantsList, + type MetaItemSizes, + MetaItemSizesList, +} from "./components/MetaItem/MetaItem"; export { type LinkVariants, LinkVariantsList } from "./components/Link/Link"; export { type ImageVariants, diff --git a/packages/cyberstorm-theme/src/components/BreadCrumbs/BreadCrumbs.css b/packages/cyberstorm-theme/src/components/BreadCrumbs/BreadCrumbs.css index 7f034e585..8598d370d 100644 --- a/packages/cyberstorm-theme/src/components/BreadCrumbs/BreadCrumbs.css +++ b/packages/cyberstorm-theme/src/components/BreadCrumbs/BreadCrumbs.css @@ -24,11 +24,6 @@ ); } - /* MODIFIERS */ - .ts-button:where(.ts-modifier--dimmed) { - filter: brightness(85%); - } - /* TOKENS */ :root { --breadcrumbs__outer-background-color--default: var(--color-surface-6); diff --git a/packages/cyberstorm-theme/src/components/BreadCrumbs/BreadCrumbs.ts b/packages/cyberstorm-theme/src/components/BreadCrumbs/BreadCrumbs.ts index 7436e335b..8ae3c709a 100644 --- a/packages/cyberstorm-theme/src/components/BreadCrumbs/BreadCrumbs.ts +++ b/packages/cyberstorm-theme/src/components/BreadCrumbs/BreadCrumbs.ts @@ -7,7 +7,7 @@ export const BreadCrumbsSizesList = ["medium"] as const; export type BreadCrumbsSizes = "medium"; // Modifiers -export const BreadCrumbsModifiersList = ["dimmed"] as const; +export const BreadCrumbsModifiersList = [] as const; // There is an issue with Typescript (eslint) and prettier disagreeing if // the type should have parentheses // prettier-ignore diff --git a/packages/cyberstorm-theme/src/components/Button/Button.css b/packages/cyberstorm-theme/src/components/Button/Button.css index 2ee850440..3baab35df 100644 --- a/packages/cyberstorm-theme/src/components/Button/Button.css +++ b/packages/cyberstorm-theme/src/components/Button/Button.css @@ -5,31 +5,44 @@ --button-gap: 1rem; --button-border-radius: 0.5rem; --button-font-weight: var(--font-weight-bold); + --button-transition: ease-out var(--animation-duration-sm); } /* SIZES */ .ts-button:where(.ts-size--xsmall) { - --button-height: var(--space-30); - --button-padding: var(--space-12); - --button-font-size: var(--font-size-body-sm); + --button-height: var(--button-xs-height); + --button-padding-block: var(--button-xs-padding-block); + --button-padding-inline: var(--button-xs-padding-inline); + --button-border-radius: var(--button-xs-border-radius); + --button-font-size: var(--button-xs-font-size); + --button-gap: var(--button-xs-gap); } .ts-button:where(.ts-size--small) { - --button-height: var(--space-36); - --button-padding: var(--space-12); - --button-font-size: var(--font-size-body-md); + --button-height: var(--button-sm-height); + --button-padding-block: var(--button-sm-padding-block); + --button-padding-inline: var(--button-sm-padding-inline); + --button-border-radius: var(--button-sm-border-radius); + --button-font-size: var(--button-sm-font-size); + --button-gap: var(--button-sm-gap); } .ts-button:where(.ts-size--medium) { - --button-height: var(--space-44); - --button-padding: var(--space-12) var(--space-16); - --button-font-size: var(--font-size-body-md); + --button-height: var(--button-md-height); + --button-padding-block: var(--button-md-padding-block); + --button-padding-inline: var(--button-md-padding-inline); + --button-border-radius: var(--button-md-border-radius); + --button-font-size: var(--button-md-font-size); + --button-gap: var(--button-md-gap); } .ts-button:where(.ts-size--big) { - --button-height: var(--space-44); - --button-padding: var(--space-12) var(--space-16); - --button-font-size: var(--font-size-body-lg); + --button-height: var(--button-lg-height); + --button-padding-block: var(--button-lg-padding-block); + --button-padding-inline: var(--button-lg-padding-inline); + --button-border-radius: var(--button-lg-border-radius); + --button-font-size: var(--button-lg-font-size); + --button-gap: var(--button-lg-gap); } /* VARIANTS DEFAULT STATE */ @@ -171,11 +184,15 @@ } /* MODIFIERS */ - .ts-button:where(:not(.ts-variant--special)):where(.ts-modifier--ghost):where(:not(:hover, :active)) { + .ts-button:where(:not(.ts-variant--special)):where(.ts-modifier--ghost):where( + :not(:hover, :active) + ) { --button-background-color: transparent; } - .ts-button:where(.ts-variant--special):where(.ts-modifier--ghost):where(:not(:hover, :active)) { + .ts-button:where(.ts-variant--special):where(.ts-modifier--ghost):where( + :not(:hover, :active) + ) { background: transparent; } @@ -184,10 +201,6 @@ pointer-events: none; } - .ts-button:where(.ts-modifier--dimmed) { - filter: brightness(85%); - } - /* TOKENS */ :root { --button-danger-bg-color--active: var(--color-accent-red-2); @@ -277,5 +290,29 @@ --button-accent-text-color--active: var(--color-cyber-green-2); --button-accent-text-color--default: var(--color-cyber-green-2); --button-accent-text-color--hover: var(--color-cyber-green-2); + --button-lg-padding-block: 0rem; + --button-lg-border-radius: var(--radius-md); + --button-lg-font-size: var(--font-size-body-lg); + --button-lg-gap: var(--space-16); + --button-lg-padding-inline: var(--space-16); + --button-lg-height: 2.75rem; + --button-md-padding-block: 0rem; + --button-md-border-radius: var(--radius-md); + --button-md-font-size: var(--font-size-body-md); + --button-md-gap: var(--space-16); + --button-md-padding-inline: var(--space-16); + --button-md-height: 2.75rem; + --button-sm-padding-block: 0rem; + --button-sm-border-radius: var(--radius-md); + --button-sm-gap: var(--space-12); + --button-sm-padding-inline: var(--space-12); + --button-sm-font-size: var(--font-size-body-md); + --button-sm-height: 2.25rem; + --button-xs-padding-block: 0rem; + --button-xs-border-radius: var(--radius-md); + --button-xs-font-size: var(--font-size-body-sm); + --button-xs-gap: var(--space-12); + --button-xs-padding-inline: var(--space-12); + --button-xs-height: 1.875rem; } } diff --git a/packages/cyberstorm-theme/src/components/Button/Button.ts b/packages/cyberstorm-theme/src/components/Button/Button.ts index da0a5ccf7..3e7a8f907 100644 --- a/packages/cyberstorm-theme/src/components/Button/Button.ts +++ b/packages/cyberstorm-theme/src/components/Button/Button.ts @@ -24,7 +24,7 @@ export const ButtonSizesList = ["big", "medium", "small", "xsmall"] as const; export type ButtonSizes = "big" | "medium" | "small" | "xsmall"; // Modifiers -export const ButtonModifiersList = ["disabled", "ghost", "dimmed"] as const; +export const ButtonModifiersList = ["disabled", "ghost"] as const; // There is an issue with Typescript (eslint) and prettier disagreeing if // the type should have parentheses // prettier-ignore diff --git a/packages/cyberstorm-theme/src/components/Button/IconButton.css b/packages/cyberstorm-theme/src/components/Button/IconButton.css index e5f129f99..d31fcfc7e 100644 --- a/packages/cyberstorm-theme/src/components/Button/IconButton.css +++ b/packages/cyberstorm-theme/src/components/Button/IconButton.css @@ -165,11 +165,15 @@ } /* MODIFIERS */ - .ts-iconbutton:where(:not(.ts-variant--special)):where(.ts-modifier--ghost):where(:not(:hover, :active)) { + .ts-iconbutton:where(:not(.ts-variant--special)):where( + .ts-modifier--ghost + ):where(:not(:hover, :active)) { --iconbutton-background-color: transparent; } - .ts-iconbutton:where(.ts-variant--special):where(.ts-modifier--ghost):where(:not(:hover, :active)) { + .ts-iconbutton:where(.ts-variant--special):where(.ts-modifier--ghost):where( + :not(:hover, :active) + ) { background: transparent; } @@ -178,10 +182,6 @@ pointer-events: none; } - .ts-button:where(.ts-modifier--dimmed) { - filter: brightness(85%); - } - /* TOKENS */ :root { --iconbutton-danger-bg-color--active: var(--color-accent-red-2); diff --git a/packages/cyberstorm-theme/src/components/Button/IconButton.ts b/packages/cyberstorm-theme/src/components/Button/IconButton.ts index a701cd8d8..7caaac2a2 100644 --- a/packages/cyberstorm-theme/src/components/Button/IconButton.ts +++ b/packages/cyberstorm-theme/src/components/Button/IconButton.ts @@ -26,7 +26,7 @@ export const IconButtonSizesList = ["medium", "small", "xsmall"] as const; export type IconButtonSizes = "medium" | "small" | "xsmall"; // Modifiers -export const IconButtonModifiersList = ["disabled", "ghost", "dimmed"] as const; +export const IconButtonModifiersList = ["disabled", "ghost"] as const; // There is an issue with Typescript (eslint) and prettier disagreeing if // the type should have parentheses // prettier-ignore diff --git a/packages/cyberstorm-theme/src/components/DropDown/DropDown.css b/packages/cyberstorm-theme/src/components/DropDown/DropDown.css index 24e17d2fe..e29a13102 100644 --- a/packages/cyberstorm-theme/src/components/DropDown/DropDown.css +++ b/packages/cyberstorm-theme/src/components/DropDown/DropDown.css @@ -1,30 +1,85 @@ @layer theme-components { /* DROPDOWN ROOT */ .ts-dropdown { - --dropdown-border: var(--space-px) var(--dropdown-border-color) solid; - --dropdown-border-radius: var(--radius-md); --dropdown-box-shadow: var(--shadow-lg); --dropdown-animation: fade-in var(--animation-duration-md) ease; - --dropdown-padding: var(--space-8) 0; + --dropdown-border: var(--space-px) var(--dropdown-border-color) solid; + } + + .ts-dropdown:where(.ts-size--medium) { + --dropdown-border-radius: var(--dropdown-md-border-radius); + --dropdown-padding: var(--dropdown-md-padding); + + & > *:where(:not(.ts-dropdown__divider)) { + --dropdown__item-gap: var(--dropdown-item-md-gap); + --dropdown__item-padding: var(--dropdown-item-md-padding); + --dropdown__item-font-weight: var(--dropdown-item-md-font-weight); + --dropdown__item-font-size: var(--dropdown-item-md-font-size); + } } .ts-dropdown:where(.ts-variant--primary) { - --dropdown-color: var(--color-surface-5); - --dropdown-background-color: var(--color-surface-2); - --dropdown-border-color: var(--color-surface-6); + --dropdown-background-color: var(--dropdown-bg-color--default); + --dropdown-border-color: var(--dropdown-border-color--default); & > *:where(:not(.ts-dropdown__divider)) { - --dropdown__item-padding: var(--space-12) var(--space-16); - --dropdown__item-color: var(--color-surface-8); - --dropdown__item-background-color: transparent; + --dropdown__item-background-color: var(--dropdown-item-bg-color--default); + --dropdown__item-color: var(--dropdown-item-text-color--default); + --dropdown__item-icon-color: var(--dropdown-item-icon-color--default); } & > *:where(:not(.ts-dropdown__divider))[data-highlighted] { - --dropdown__item-color: var(--color-surface-2); - --dropdown__item-background-color: var(--color-surface-6); + --dropdown__item-background-color: var(--dropdown-item-bg-color--hover); + --dropdown__item-color: var(--dropdown-item-text-color--hover); + --dropdown__item-icon-color: var(--dropdown-item-icon-color--hover); + } + } + + .ts-dropdown__item:where(.ts-modifier--danger) { + --dropdown__item-background-color: var( + --dropdown-item-danger-bg-color--default + ); + --dropdown__item-color: var(--dropdown-item-danger-text-color--default); + --dropdown__item-icon-color: var( + --dropdown-item-danger-icon-color--default + ); + + &:where(:hover) { + --dropdown__item-background-color: var( + --dropdown-item-danger-bg-color--hover + ); + --dropdown__item-color: var(--dropdown-item-danger-text-color--hover); + --dropdown__item-icon-color: var( + --dropdown-item-danger-icon-color--hover + ); + } + } + + .ts-dropdown__item:where(.ts-modifier--disabled) { + --dropdown__item-background-color: var( + --dropdown-item-disabled-bg-color--default + ); + --dropdown__item-color: var(--dropdown-item-disabled-text-color--default); + --dropdown__item-icon-color: var( + --dropdown-item-disabled-icon-color--default + ); + + &:where(:hover) { + --dropdown__item-background-color: var( + --dropdown-item-disabled-bg-color--hover + ); + --dropdown__item-color: var(--dropdown-item-disabled-text-color--hover); + --dropdown__item-icon-color: var( + --dropdown-item-disabled-icon-color--hover + ); } } + .ts-dropdown__divider:where(.ts-variant--primary) { + --dropdown__divider-height: var(--divider-height); + --dropdown__divider-background-color: var(--divider-bg-color); + } + @keyframes fade-in { from { opacity: 0; @@ -35,13 +90,34 @@ } } - /* Missing tokens */ - .ts-dropdown__divider:where(.ts-variant--primary) { - --dropdown__divider-height: var(--space-px); - --dropdown__divider-margin: var(--space-8) 0; - --dropdown__divider-background-color: var( - --color-surface-6, - var(--color-text-primary, red) - ); + :root { + --dropdown-bg-color--default: var(--color-surface-4); + --dropdown-border-color--default: var(--color-surface-a6); + --dropdown-item-bg-color--default: #0000; + --dropdown-item-bg-color--hover: var(--color-surface-a7); + --dropdown-item-icon-color--default: var(--color-text-tertiary); + --dropdown-item-icon-color--hover: var(--color-text-primary); + --dropdown-item-text-color--default: var(--color-text-primary); + --dropdown-item-text-color--hover: var(--color-text-primary); + --dropdown-item-danger-bg-color--default: #0000; + --dropdown-item-danger-bg-color--hover: var(--color-accent-red-6); + --dropdown-item-danger-icon-color--default: var(--color-accent-red-7); + --dropdown-item-danger-icon-color--hover: #fff; + --dropdown-item-danger-text-color--default: var(--color-accent-red-7); + --dropdown-item-danger-text-color--hover: #fff; + --dropdown-item-disabled-bg-color--default: #0000; + --dropdown-item-disabled-bg-color--hover: #0000; + --dropdown-item-disabled-icon-color--default: var(--color-text-tertiary); + --dropdown-item-disabled-icon-color--hover: var(--color-text-tertiary); + --dropdown-item-disabled-text-color--default: var(--color-text-tertiary); + --dropdown-item-disabled-text-color--hover: var(--color-text-tertiary); + --dropdown-md-border-radius: var(--radius-md); + --dropdown-md-padding: var(--space-8) 0; + --dropdown-item-md-gap: var(--gap-md); + --dropdown-item-md-padding: var(--space-12) var(--space-16); + --dropdown-item-md-font-weight: var(--font-weight-regular); + --dropdown-item-md-font-size: var(--font-size-body-md); + --divider-bg-color: var(--color-surface-a6); + --divider-height: 0.063rem; } } diff --git a/packages/cyberstorm-theme/src/components/DropDown/DropDown.ts b/packages/cyberstorm-theme/src/components/DropDown/DropDown.ts index 0dfe20d4c..73f6cbdc1 100644 --- a/packages/cyberstorm-theme/src/components/DropDown/DropDown.ts +++ b/packages/cyberstorm-theme/src/components/DropDown/DropDown.ts @@ -8,7 +8,7 @@ export const DropDownSizesList = ["medium"] as const; export type DropDownSizes = "medium"; // Modifiers -export const DropDownModifiersList = ["disabled", "ghost", "dimmed"] as const; +export const DropDownModifiersList = ["disabled", "ghost"] as const; // There is an issue with Typescript (eslint) and prettier disagreeing if // the type should have parentheses // prettier-ignore @@ -24,11 +24,7 @@ export const DropDownItemSizesList = ["medium"] as const; export type DropDownItemSizes = "medium"; // Modifiers -export const DropDownItemModifiersList = [ - "disabled", - "ghost", - "dimmed", -] as const; +export const DropDownItemModifiersList = ["disabled", "ghost"] as const; // There is an issue with Typescript (eslint) and prettier disagreeing if // the type should have parentheses // prettier-ignore @@ -44,7 +40,7 @@ export const DropDownDividerSizesList = ["medium"] as const; export type DropDownDividerSizes = "medium"; // Modifiers -export const DropDownDividerModifiersList = ["ghost", "dimmed"] as const; +export const DropDownDividerModifiersList = ["ghost"] as const; // There is an issue with Typescript (eslint) and prettier disagreeing if // the type should have parentheses // prettier-ignore diff --git a/packages/cyberstorm-theme/src/components/Heading/Heading.ts b/packages/cyberstorm-theme/src/components/Heading/Heading.ts index d565246f9..7c8d65121 100644 --- a/packages/cyberstorm-theme/src/components/Heading/Heading.ts +++ b/packages/cyberstorm-theme/src/components/Heading/Heading.ts @@ -12,7 +12,7 @@ export const HeadingSizesList = ["1", "2", "3", "4", "5", "6"] as const; export type HeadingSizes = "1" | "2" | "3" | "4" | "5" | "6"; // Modifiers -export const HeadingModifiersList = ["ghost", "dimmed"] as const; +export const HeadingModifiersList = ["ghost"] as const; // There is an issue with Typescript (eslint) and prettier disagreeing if // the type should have parentheses // prettier-ignore diff --git a/packages/cyberstorm-theme/src/components/MetaItem/MetaItem.css b/packages/cyberstorm-theme/src/components/MetaItem/MetaItem.css new file mode 100644 index 000000000..d0d2d3931 --- /dev/null +++ b/packages/cyberstorm-theme/src/components/MetaItem/MetaItem.css @@ -0,0 +1,53 @@ +@layer theme-components { + /* theme base styles */ + .ts-metaitem { + --metaitem-gap: 0.5rem; + --metaitem-font-weight: var(--font-weight-bold); + } + + /* SIZES */ + .ts-metaitem:where(.ts-size--16) { + --metaitem-font-size: var(--meta-item-16-font-size); + --metaitem-icon-width: var(--meta-item-16-icon-width); + --metaitem-icon-height: var(--meta-item-16-icon-height); + } + + .ts-metaitem:where(.ts-size--14) { + --metaitem-font-size: var(--meta-item-14-font-size); + --metaitem-icon-width: var(--meta-item-14-icon-width); + --metaitem-icon-height: var(--meta-item-14-icon-height); + } + + .ts-metaitem:where(.ts-size--12) { + --metaitem-font-size: var(--meta-item-12-font-size); + --metaitem-icon-width: var(--meta-item-12-icon-width); + --metaitem-icon-height: var(--meta-item-12-icon-height); + } + + /* VARIANTS */ + .ts-metaitem:where(.ts-variant--default) { + --metaitem-color: var(--meta-item-icon-color--default); + --metaitem-icon-color: var(--meta-item-text-color--default); + } + + /* TOKENS */ + :root { + --meta-item-icon-color--default: var(--color-text-tertiary); + --meta-item-text-color--default: var(--color-text-tertiary); + + /* 16 */ + --meta-item-16-font-size: var(--font-size-body-lg, 1rem); + --meta-item-16-icon-width: 1rem; + --meta-item-16-icon-height: 1rem; + + /* 14 */ + --meta-item-14-font-size: var(--font-size-body-md, 0.875rem); + --meta-item-14-icon-width: 1rem; + --meta-item-14-icon-height: 1rem; + + /* 12 */ + --meta-item-12-font-size: var(--font-size-body-sm, 0.75rem); + --meta-item-12-icon-width: 0.875rem; + --meta-item-12-icon-height: 0.875rem; + } +} diff --git a/packages/cyberstorm-theme/src/components/MetaItem/MetaItem.ts b/packages/cyberstorm-theme/src/components/MetaItem/MetaItem.ts new file mode 100644 index 000000000..1eee91129 --- /dev/null +++ b/packages/cyberstorm-theme/src/components/MetaItem/MetaItem.ts @@ -0,0 +1,7 @@ +// Variants +export const MetaItemVariantsList = ["default"] as const; +export type MetaItemVariants = "default"; + +// Sizes +export const MetaItemSizesList = ["16", "14", "12"] as const; +export type MetaItemSizes = "16" | "14" | "12"; diff --git a/packages/cyberstorm-theme/src/components/Pagination/Pagination.css b/packages/cyberstorm-theme/src/components/Pagination/Pagination.css new file mode 100644 index 000000000..72cba87d4 --- /dev/null +++ b/packages/cyberstorm-theme/src/components/Pagination/Pagination.css @@ -0,0 +1,56 @@ +@layer theme-components { + .ts-pagination { + --pagination-gap: var(--gap-xs); + } + + /* VARIANTS STATELESS */ + .ts-pagination__item { + --pagination-item-height: var(--space-36); + --pagination-item-padding: var(--space-8) var(--space-12); + --pagination-item-font-weight: var(--font-weight-regular); + --pagination-item-border-radius: var(--radius-md); + --pagination-item-font-size: var(--font-size-body-lg); + --pagination-item-text-color: var(--pagination-item-text-color--default); + --pagination-item-background: var(--pagination-item-bg-color--default); + } + + /* Only apply triggers to buttons */ + button.ts-pagination__item { + &:hover { + --pagination-item-text-color: var(--pagination-item-text-color--hover); + --pagination-item-background: var(--pagination-item-bg-color--hover); + } + + &:active { + --pagination-item-text-color: var(--pagination-item-text-color--active); + --pagination-item-background: var(--pagination-item-bg-color--active); + } + + &.ts-pagination__item--selected { + --pagination-item-text-color: var(--pagination-item-text-color--current); + --pagination-item-background: var(--pagination-item-bg-color--current); + + &:hover { + --pagination-item-text-color: var(--pagination-item-text-color--hover); + --pagination-item-background: var(--pagination-item-bg-color--hover); + } + + &:active { + --pagination-item-text-color: var(--pagination-item-text-color--active); + --pagination-item-background: var(--pagination-item-bg-color--active); + } + } + } + + /* TOKENS */ + :root { + --pagination-item-bg-color--active: var(--color-surface-a6); + --pagination-item-bg-color--current: #623bce; + --pagination-item-bg-color--default: var(--color-surface-a7); + --pagination-item-bg-color--hover: var(--color-surface-a8); + --pagination-item-text-color--active: var(--color-text-primary); + --pagination-item-text-color--current: var(--color-text-primary); + --pagination-item-text-color--default: var(--color-text-secondary); + --pagination-item-text-color--hover: var(--color-text-primary); + } +} diff --git a/packages/cyberstorm-theme/src/components/Select/Select.css b/packages/cyberstorm-theme/src/components/Select/Select.css index 60e4237eb..9b12e5b76 100644 --- a/packages/cyberstorm-theme/src/components/Select/Select.css +++ b/packages/cyberstorm-theme/src/components/Select/Select.css @@ -1,57 +1,85 @@ @layer theme-components { - /* SELECT ROOT */ + /* SELECT */ /* VARIANTS */ .ts-select:where(.ts-variant--default) { - --select-border-color: var(--color-surface-6); - --select-border-radius: var(--radius-md); - --select-border: var(--space-px) var(--select-border-color) solid; - --select-text-color: var(--color-text-primary); - --select-background-color: var(--color-surface-2); + --select-background-color: var(--dropdown-bg-color--default); + --select-border-color: var(--dropdown-border-color--default); --select-box-shadow: var(--shadow-lg); - --select-animation: fade-in var(--animation-duration-lg) ease; + --select-animation: fade-in var(--animation-duration-md) ease; + --select-border: var(--space-px) var(--select-border-color) solid; } /* SIZES */ .ts-select:where(.ts-size--medium) { - --select-gap: var(--gap-xxxs); - --select-padding: var(--space-8) 0; + --select-border-radius: var(--dropdown-md-border-radius); + --select-padding: var(--dropdown-md-padding); } /* SELECT ITEM */ /* VARIANTS */ .ts-select__item:where(.ts-variant--default) { - --select__item-color: var(--color-text-primary); + --select__item-background-color: var(--dropdown-item-bg-color--default); + --select__item-color: var(--dropdown-item-text-color--default); + --icon-color: var(--dropdown-item-icon-color--default); - & > .ts-select__item__icon { - --select__item__icon-color: var(--color-text-tertiary); + &[data-highlighted] { + --select__item-background-color: var(--dropdown-item-bg-color--hover); + --select__item-color: var(--dropdown-item-text-color--hover); + --icon-color: var(--dropdown-item-icon-color--hover); } + } + + .ts-select__item:where(.ts-variant--danger) { + --select__item-background-color: var( + --dropdown-item-danger-bg-color--default + ); + --select__item-color: var(--dropdown-item-danger-text-color--default); + --icon-color: var(--dropdown-item-danger-icon-color--default); &[data-highlighted] { - --select__item-color: var(--color-text-primary); - --select__item-background-color: var(--color-surface-6); + --select__item-background-color: var( + --dropdown-item-danger-bg-color--hover + ); + --select__item-color: var(--dropdown-item-danger-text-color--hover); + --icon-color: var(--dropdown-item-danger-icon-color--hover); } + } - &[data-highlighted] > .ts-select__item__icon { - --select__item__icon-color: var(--color-text-primary); + .ts-select__item:where(.ts-variant--disabled) { + --select__item-background-color: var( + --dropdown-item-disabled-bg-color--default + ); + --select__item-color: var(--dropdown-item-disabled-text-color--default); + --select__item-icon-color: var( + --dropdown-item-disabled-icon-color--default + ); + --icon-color: var(--dropdown-item-disabled-icon-color--default); + + &[data-highlighted] { + --select__item-background-color: var( + --dropdown-item-disabled-bg-color--hover + ); + --select__item-color: var(--dropdown-item-disabled-text-color--hover); + --icon-color: var(--dropdown-item-disabled-icon-color--hover); } } /* SIZES */ .ts-select__item:where(.ts-size--medium) { - --select__item-gap: var(--gap-sm); - --select__item-padding: var(--space-12) var(--space-16); - --select__item-font-weight: var(--font-weight-regular); - --select__item-font-size: var(--font-size-body-md); + --select__item-gap: var(--dropdown-item-md-gap); + --select__item-padding: var(--dropdown-item-md-padding); + --select__item-font-weight: var(--dropdown-item-md-font-weight); + --select__item-font-size: var(--dropdown-item-md-font-size); } /* SELECT TRIGGER */ /* SIZES */ .ts-select__trigger:where(.ts-size--medium) { - --select__trigger-font-weight: var(--font-weight-bold); - --select__trigger-font-size: var(--font-size-body-md); + --select__trigger-font-weight: var(--select-trigger-md-font-weight); + --select__trigger-font-size: var(--select-trigger-md-font-size); } @keyframes fade-in { @@ -65,25 +93,33 @@ } :root { - --select-bg-color--default: var(--color-surface-3); - --select-border-color--default: var(--color-surface-a7); - --select-item-bg-color--default: hsl(0deg 0 0% / 0); - --select-item-bg-color--hover: var(--color-surface-a9); - --select-item-icon-color--default: var(--color-text-tertiary); - --select-item-icon-color--hover: var(--color-text-primary); - --select-item-text-color--default: var(--color-text-primary); - --select-item-text-color--hover: var(--color-text-primary); - --select-item-danger-bg-color--default: hsl(0deg 0 0% / 0); - --select-item-danger-bg-color--hover: var(--color-accent-red-6); - --select-item-danger-icon-color--default: var(--color-accent-red-7); - --select-item-danger-icon-color--hover: hsl(0deg 0 100%); - --select-item-danger-text-color--default: var(--color-accent-red-7); - --select-item-danger-text-color--hover: hsl(0deg 0 100%); - --select-item-disabled-bg-color--default: hsl(0deg 0 0% / 0); - --select-item-disabled-bg-color--hover: hsl(0deg 0 0% / 0); - --select-item-disabled-icon-color--default: var(--color-text-tertiary); - --select-item-disabled-icon-color--hover: var(--color-text-tertiary); - --select-item-disabled-text-color--default: var(--color-text-tertiary); - --select-item-disabled-text-color--hover: var(--color-text-tertiary); + --dropdown-bg-color--default: var(--color-surface-4); + --dropdown-border-color--default: var(--color-surface-a6); + --dropdown-item-bg-color--default: #0000; + --dropdown-item-bg-color--hover: var(--color-surface-a7); + --dropdown-item-icon-color--default: var(--color-text-tertiary); + --dropdown-item-icon-color--hover: var(--color-text-primary); + --dropdown-item-text-color--default: var(--color-text-primary); + --dropdown-item-text-color--hover: var(--color-text-primary); + --dropdown-item-danger-bg-color--default: #0000; + --dropdown-item-danger-bg-color--hover: var(--color-accent-red-6); + --dropdown-item-danger-icon-color--default: var(--color-accent-red-7); + --dropdown-item-danger-icon-color--hover: #fff; + --dropdown-item-danger-text-color--default: var(--color-accent-red-7); + --dropdown-item-danger-text-color--hover: #fff; + --dropdown-item-disabled-bg-color--default: #0000; + --dropdown-item-disabled-bg-color--hover: #0000; + --dropdown-item-disabled-icon-color--default: var(--color-text-tertiary); + --dropdown-item-disabled-icon-color--hover: var(--color-text-tertiary); + --dropdown-item-disabled-text-color--default: var(--color-text-tertiary); + --dropdown-item-disabled-text-color--hover: var(--color-text-tertiary); + --dropdown-md-border-radius: var(--radius-md); + --dropdown-md-padding: var(--space-8) 0; + --dropdown-item-md-gap: var(--gap-md); + --dropdown-item-md-padding: var(--space-12) var(--space-16); + --dropdown-item-md-font-weight: var(--font-weight-regular); + --dropdown-item-md-font-size: var(--font-size-body-md); + --select-trigger-md-font-weight: var(--font-weight-bold); + --select-trigger-md-font-size: var(--font-size-body-md); } } diff --git a/packages/cyberstorm-theme/src/components/Tag/Tag.css b/packages/cyberstorm-theme/src/components/Tag/Tag.css index 397d6788f..a4407e9f1 100644 --- a/packages/cyberstorm-theme/src/components/Tag/Tag.css +++ b/packages/cyberstorm-theme/src/components/Tag/Tag.css @@ -6,20 +6,31 @@ } /* SIZES */ - .ts-tag:where(.ts-size--small) { - --tag-gap: var(--gap-xxs); + .ts-tag:where(.ts-size--medium) { + --tag-gap: var(--tag-md-gap); --tag-padding-block: var(--tag-md-padding-block); --tag-padding-inline: var(--tag-md-padding-inline); - --tag-border-radius: 6px; + --tag-border-radius: var(--tag-md-border-radius); --tag-font-size: var(--tag-md-font-size); + --tag-height: var(--tag-md-height); } - .ts-tag:where(.ts-size--medium) { - --tag-gap: var(--space-8); + .ts-tag:where(.ts-size--small) { + --tag-gap: var(--tag-sm-gap); + --tag-padding-block: var(--tag-sm-padding-block); + --tag-padding-inline: var(--tag-sm-padding-inline); + --tag-border-radius: var(--tag-sm-border-radius); + --tag-font-size: var(--tag-sm-font-size); + --tag-height: var(--tag-sm-height); + } + + .ts-tag:where(.ts-size--xsmall) { + --tag-gap: var(--tag-xs-gap); --tag-padding-block: var(--tag-xs-padding-block); --tag-padding-inline: var(--tag-xs-padding-inline); - --tag-border-radius: var(--radius-md); + --tag-border-radius: var(--tag-xs-border-radius); --tag-font-size: var(--tag-xs-font-size); + --tag-height: var(--tag-xs-height); } /* VARIANTS */ @@ -249,11 +260,23 @@ --tag-light-yellow-bg-color--hover: var(--color-accent-yellow-8); --tag-light-yellow-text-color--default: var(--color-accent-yellow-1); --tag-light-yellow-text-color--hover: var(--color-accent-yellow-1); - --tag-md-padding-block: var(--space-6); + --tag-md-padding-block: var(--space-4); + --tag-md-gap: var(--space-6); + --tag-md-border-radius: var(--radius-md); --tag-md-padding-inline: var(--space-8); - --tag-md-font-size: var(--font-size-body-sm); + --tag-md-font-size: var(--font-size-body-md); + --tag-md-height: 1.875rem; + --tag-sm-padding-block: var(--space-4); + --tag-sm-gap: var(--space-6); + --tag-sm-padding-inline: var(--space-6); + --tag-sm-border-radius: var(--radius-md); + --tag-sm-font-size: var(--font-size-body-sm); + --tag-sm-height: 1.5rem; + --tag-xs-gap: var(--space-4); --tag-xs-padding-block: var(--space-4); --tag-xs-padding-inline: var(--space-6); - --tag-xs-font-size: var(--font-size-body-sm); + --tag-xs-border-radius: var(--radius-md); + --tag-xs-font-size: var(--font-size-body-xs); + --tag-xs-height: var(--space-20); } } diff --git a/packages/cyberstorm-theme/src/components/Tag/Tag.ts b/packages/cyberstorm-theme/src/components/Tag/Tag.ts index e9165e164..831aeeeae 100644 --- a/packages/cyberstorm-theme/src/components/Tag/Tag.ts +++ b/packages/cyberstorm-theme/src/components/Tag/Tag.ts @@ -20,8 +20,8 @@ export type TagVariants = | "purple"; // Sizes -export const TagSizesList = ["medium", "small"] as const; -export type TagSizes = "medium" | "small"; +export const TagSizesList = ["medium", "small", "xsmall"] as const; +export type TagSizes = "medium" | "small" | "xsmall"; // Modifiers export const TagModifiersList = ["dark", "hoverable"] as const; diff --git a/packages/cyberstorm-theme/src/components/TextInput/TextInput.css b/packages/cyberstorm-theme/src/components/TextInput/TextInput.css index 8ae7d44cd..b39c26458 100644 --- a/packages/cyberstorm-theme/src/components/TextInput/TextInput.css +++ b/packages/cyberstorm-theme/src/components/TextInput/TextInput.css @@ -2,13 +2,13 @@ .ts-textinput { --textinput-width: 100%; --textinput-padding: var(--space-8) var(--space-10); - --textinput-border: var(--border-width--2) solid + --textinput-border: var(--border-width--px) solid var(--textinput-border-color); --textinput-border-radius: var(--radius-md); --textinput-transition: ease-out var(--animation-duration-xs); - --textinput-border-color: transparent; - --textinput-text-color: var(--color-text-primary); - --textinput-background-color: var(--color-surface-a5); + --textinput-border-color: var(--input-border-color--default); + --textinput-text-color: var(--input-text-color--default); + --textinput-background-color: var(--input-bg-color--default); } .ts-textinput__wrapper { @@ -19,18 +19,18 @@ } .ts-textinput[value] { - --textinput-text-color: var(--color-text-secondary); + --textinput-text-color: var(--input-text-color--hover); } .ts-textinput:where(.ts-size--default) { - --textinput-height: var(--space-44); + --textinput-height: var(--input-md-height); --textinput-padding: var(--space-10) calc(var(--space-16) + var(--right-padding-bonus, 0px)) var(--space-10) calc(var(--space-16) + var(--left-padding-bonus, 0px)); } .ts-textinput:where(.ts-size--small) { - --textinput-height: var(--space-36); + --textinput-height: var(--input-sm-height); --textinput-padding: var(--space-8) calc(var(--space-16) + var(--right-padding-bonus, 0px)) var(--space-10) calc(var(--space-16) + var(--left-padding-bonus, 0px)); @@ -45,30 +45,32 @@ } .ts-textinput:hover { - --textinput-background-color: var(--color-surface-a6); - --textinput-border-color: var(--color-surface-a10); + --textinput-background-color: var(--input-bg-color--hover); + --textinput-border-color: var(--input-border-color--hover); } .ts-textinput:focus-within { - --textinput-text-color: var(--color-text-primary); - --textinput-background-color: var(--color-black); - --textinput-border-color: var(--color-cyber-green-7); + --textinput-text-color: var(--input-text-color--focus); + --textinput-background-color: var(--input-bg-color--focus); + --textinput-border-color: var(--input-border-color--focus); } - .ts-textinput:has(+ .ts-textinput__clearvaluebutton:hover):not(:focus-within) { - --input-background-color: var(--color-surface-a6); - --border-color: var(--color-surface-a10); + .ts-textinput:has(+ .ts-textinput__clearvaluebutton:hover):not( + :focus-within + ) { + --input-background-color: var(--color-surface-a5); + --border-color: var(--input-border-color--hover); } .ts-textinput::placeholder { - --textinput__placeholder-color: var(--color-text-tertiary); + --textinput__placeholder-color: var(--input-placeholder-color); --textinput__placeholder-opacity: 1; } .ts-textinput__lefticon { --ts-textinput__lefticon-position: absolute; --ts-textinput__lefticon-margin: var(--space-10) var(--space-16); - --ts-textinput__lefticon-color: var(--color-text-tertiary); + --ts-textinput__lefticon-color: var(--input-icon-color--default); --ts-textinput__lefticon-pointer-events: none; } @@ -87,4 +89,22 @@ .ts-textinput__clearvaluebutton:hover { --ts-textinput__clearvaluebutton-opacity: 1; } + + :root { + --input-bg-color--default: var(--color-surface-a3); + --input-bg-color--focus: var(--color-surface-1); + --input-bg-color--hover: var(--color-surface-a5); + --input-border-color--default: var(--color-surface-a8); + --input-border-color--focus: var(--color-cyber-green-7); + --input-border-color--hover: var(--color-surface-a10); + --input-icon-color--default: var(--color-text-tertiary); + --input-placeholder-color: var(--color-text-tertiary); + --input-text-color--default: var(--color-text-secondary); + --input-text-color--focus: var(--color-text-primary); + --input-text-color--hover: var(--color-text-secondary); + --input-md-border-radius: var(--radius-md); + --input-md-height: 2.75rem; + --input-sm-border-radius: var(--radius-md); + --input-sm-height: 2.25rem; + } } diff --git a/packages/cyberstorm-theme/src/components/TextInput/TextInput.ts b/packages/cyberstorm-theme/src/components/TextInput/TextInput.ts index b1573064d..9d9162c30 100644 --- a/packages/cyberstorm-theme/src/components/TextInput/TextInput.ts +++ b/packages/cyberstorm-theme/src/components/TextInput/TextInput.ts @@ -7,7 +7,7 @@ export const TextInputSizesList = ["default", "textarea", "small"] as const; export type TextInputSizes = "default" | "textarea" | "small"; // Modifiers -export const TextInputModifiersList = ["disabled", "ghost", "dimmed"] as const; +export const TextInputModifiersList = ["disabled", "ghost"] as const; // There is an issue with Typescript (eslint) and prettier disagreeing if // the type should have parentheses // prettier-ignore diff --git a/packages/cyberstorm-theme/src/index.tsx b/packages/cyberstorm-theme/src/index.tsx index 1e8a5c3cd..d4b02852a 100644 --- a/packages/cyberstorm-theme/src/index.tsx +++ b/packages/cyberstorm-theme/src/index.tsx @@ -11,6 +11,8 @@ import "./components/Icon/Icon.css"; import "./components/BreadCrumbs/BreadCrumbs.css"; import "./components/Select/Select.css"; import "./components/Tag/Tag.css"; +import "./components/MetaItem/MetaItem.css"; import "./components/Link/Link.css"; import "./components/Image/Image.css"; import "./components/AdContainer/AdContainer.css"; +import "./components/Pagination/Pagination.css"; diff --git a/packages/cyberstorm-theme/src/styles/colors.css b/packages/cyberstorm-theme/src/styles/colors.css index a0b503bb6..1b15fa30b 100644 --- a/packages/cyberstorm-theme/src/styles/colors.css +++ b/packages/cyberstorm-theme/src/styles/colors.css @@ -13,7 +13,8 @@ /* Misc */ --color-crown: var(--color-accent-yellow-5); --animation-timing-1: cubic-bezier(0.16, 1, 0.3, 1); - --shadow-lg: 0 12px 24px 5px hsl(0deg 0 0% / 0.65); + --shadow-lg: 0px 0px 4px 0px rgb(0 0 0 / 0.4), + 0px 6px 8px 0px rgb(0 0 0 / 0.5); --color-text-a--default: var(--color-cyber-green-7); --color-text-a--hover: var(--color-cyber-green-6); diff --git a/packages/cyberstorm-theme/src/styles/fonts/HubotSans.ttf b/packages/cyberstorm-theme/src/styles/fonts/HubotSans.ttf deleted file mode 100644 index 2b74a40d2..000000000 Binary files a/packages/cyberstorm-theme/src/styles/fonts/HubotSans.ttf and /dev/null differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/Inter.ttf b/packages/cyberstorm-theme/src/styles/fonts/Inter.ttf deleted file mode 100644 index 1cb674b74..000000000 Binary files a/packages/cyberstorm-theme/src/styles/fonts/Inter.ttf and /dev/null differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/Sora.ttf b/packages/cyberstorm-theme/src/styles/fonts/Sora.ttf deleted file mode 100644 index f3e34ded1..000000000 Binary files a/packages/cyberstorm-theme/src/styles/fonts/Sora.ttf and /dev/null differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-Black.woff2 b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-Black.woff2 new file mode 100644 index 000000000..a3aaa8fcc Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-Black.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-BlackItalic.woff2 b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-BlackItalic.woff2 new file mode 100644 index 000000000..368f88508 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-BlackItalic.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-Bold.woff2 b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-Bold.woff2 new file mode 100644 index 000000000..b143f6921 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-Bold.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-BoldItalic.woff2 b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-BoldItalic.woff2 new file mode 100644 index 000000000..a0f88fd1e Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-BoldItalic.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-ExtraBold.woff2 b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-ExtraBold.woff2 new file mode 100644 index 000000000..289406b17 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-ExtraBold.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-ExtraBoldItalic.woff2 b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-ExtraBoldItalic.woff2 new file mode 100644 index 000000000..65b402ed2 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-ExtraBoldItalic.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-ExtraLight.woff2 b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-ExtraLight.woff2 new file mode 100644 index 000000000..d9c1ac4f7 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-ExtraLight.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-ExtraLightItalic.woff2 b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-ExtraLightItalic.woff2 new file mode 100644 index 000000000..55e9e35b3 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-ExtraLightItalic.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-Italic.woff2 b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-Italic.woff2 new file mode 100644 index 000000000..16d62e33b Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-Italic.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-Light.woff2 b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-Light.woff2 new file mode 100644 index 000000000..802d23325 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-Light.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-LightItalic.woff2 b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-LightItalic.woff2 new file mode 100644 index 000000000..74d9aaa9c Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-LightItalic.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-Medium.woff2 b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-Medium.woff2 new file mode 100644 index 000000000..444b4a86b Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-Medium.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-MediumItalic.woff2 b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-MediumItalic.woff2 new file mode 100644 index 000000000..9d9262231 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-MediumItalic.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-Regular.woff2 b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-Regular.woff2 new file mode 100644 index 000000000..af3a6d395 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-Regular.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-SemiBold.woff2 b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-SemiBold.woff2 new file mode 100644 index 000000000..cb53b06e5 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-SemiBold.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-SemiBoldItalic.woff2 b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-SemiBoldItalic.woff2 new file mode 100644 index 000000000..013102798 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/HubotSans-SemiBoldItalic.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/hubot-sans.css b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/hubot-sans.css new file mode 100644 index 000000000..1324c6901 --- /dev/null +++ b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/hubot-sans.css @@ -0,0 +1,81 @@ +@layer utils { + @font-face { + font-weight: 400; + font-family: Hubot-Sans; + font-style: normal; + src: url("HubotSans-Regular.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 500; + font-family: Hubot-Sans; + font-style: normal; + src: url("HubotSans-Medium.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 600; + font-family: Hubot-Sans; + font-style: normal; + src: url("HubotSans-SemiBold.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 700; + font-family: Hubot-Sans; + font-style: normal; + src: url("HubotSans-Bold.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 800; + font-family: Hubot-Sans; + font-style: normal; + src: url("HubotSans-ExtraBold.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 400; + font-family: Hubot-Sans; + font-style: italic; + src: url("HubotSans-Italic.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 500; + font-family: Hubot-Sans; + font-style: italic; + src: url("HubotSans-MediumItalic.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 600; + font-family: Hubot-Sans; + font-style: italic; + src: url("HubotSans-SemiBoldItalic.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 700; + font-family: Hubot-Sans; + font-style: italic; + src: url("HubotSans-BoldItalic.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 800; + font-family: Hubot-Sans; + font-style: italic; + src: url("HubotSans-ExtraBoldItalic.woff2") format("woff2"); + font-display: swap; + } +} diff --git a/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/hubot-sansDeferred.css b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/hubot-sansDeferred.css new file mode 100644 index 000000000..169fe20b3 --- /dev/null +++ b/packages/cyberstorm-theme/src/styles/fonts/hubot-sans/hubot-sansDeferred.css @@ -0,0 +1,49 @@ +@layer utils { + @font-face { + font-weight: 200; + font-family: Hubot-Sans; + font-style: normal; + src: url("HubotSans-ExtraLight.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 300; + font-family: Hubot-Sans; + font-style: normal; + src: url("HubotSans-Light.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 900; + font-family: Hubot-Sans; + font-style: normal; + src: url("HubotSans-Black.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 200; + font-family: Hubot-Sans; + font-style: italic; + src: url("HubotSans-ExtraLightItalic.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 300; + font-family: Hubot-Sans; + font-style: italic; + src: url("HubotSans-LightItalic.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 900; + font-family: Hubot-Sans; + font-style: italic; + src: url("HubotSans-BlackItalic.woff2") format("woff2"); + font-display: swap; + } +} diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Black.woff2 b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Black.woff2 new file mode 100644 index 000000000..18b35db75 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Black.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-BlackItalic.woff2 b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-BlackItalic.woff2 new file mode 100644 index 000000000..02c9d8ecc Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-BlackItalic.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Bold.woff2 b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Bold.woff2 new file mode 100644 index 000000000..0f1b15763 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Bold.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-BoldItalic.woff2 b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-BoldItalic.woff2 new file mode 100644 index 000000000..bc50f24c8 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-BoldItalic.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-ExtraBold.woff2 b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-ExtraBold.woff2 new file mode 100644 index 000000000..b1133688a Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-ExtraBold.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-ExtraBoldItalic.woff2 b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-ExtraBoldItalic.woff2 new file mode 100644 index 000000000..a5b76ca8d Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-ExtraBoldItalic.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-ExtraLight.woff2 b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-ExtraLight.woff2 new file mode 100644 index 000000000..1d77ae8d0 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-ExtraLight.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-ExtraLightItalic.woff2 b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-ExtraLightItalic.woff2 new file mode 100644 index 000000000..8c6849209 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-ExtraLightItalic.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Italic.woff2 b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Italic.woff2 new file mode 100644 index 000000000..4c24ce281 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Italic.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Light.woff2 b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Light.woff2 new file mode 100644 index 000000000..dbe61437a Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Light.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-LightItalic.woff2 b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-LightItalic.woff2 new file mode 100644 index 000000000..a40d04215 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-LightItalic.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Medium.woff2 b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Medium.woff2 new file mode 100644 index 000000000..0fd2ee737 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Medium.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-MediumItalic.woff2 b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-MediumItalic.woff2 new file mode 100644 index 000000000..96767155d Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-MediumItalic.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Regular.woff2 b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Regular.woff2 new file mode 100644 index 000000000..b8699af29 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Regular.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-SemiBold.woff2 b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-SemiBold.woff2 new file mode 100644 index 000000000..95c48b184 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-SemiBold.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-SemiBoldItalic.woff2 b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-SemiBoldItalic.woff2 new file mode 100644 index 000000000..ddfe19e83 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-SemiBoldItalic.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Thin.woff2 b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Thin.woff2 new file mode 100644 index 000000000..07909608c Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-Thin.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-ThinItalic.woff2 b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-ThinItalic.woff2 new file mode 100644 index 000000000..a7bf21380 Binary files /dev/null and b/packages/cyberstorm-theme/src/styles/fonts/inter/Inter-ThinItalic.woff2 differ diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/inter.css b/packages/cyberstorm-theme/src/styles/fonts/inter/inter.css new file mode 100644 index 000000000..def8e6fbb --- /dev/null +++ b/packages/cyberstorm-theme/src/styles/fonts/inter/inter.css @@ -0,0 +1,81 @@ +@layer utils { + @font-face { + font-weight: 400; + font-family: Inter; + font-style: normal; + src: url("Inter-Regular.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 500; + font-family: Inter; + font-style: normal; + src: url("Inter-Medium.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 600; + font-family: Inter; + font-style: normal; + src: url("Inter-SemiBold.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 700; + font-family: Inter; + font-style: normal; + src: url("Inter-Bold.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 800; + font-family: Inter; + font-style: normal; + src: url("Inter-ExtraBold.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 400; + font-family: Inter; + font-style: italic; + src: url("Inter-Italic.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 500; + font-family: Inter; + font-style: italic; + src: url("Inter-MediumItalic.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 600; + font-family: Inter; + font-style: italic; + src: url("Inter-SemiBoldItalic.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 700; + font-family: Inter; + font-style: italic; + src: url("Inter-BoldItalic.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 800; + font-family: Inter; + font-style: italic; + src: url("Inter-ExtraBoldItalic.woff2") format("woff2"); + font-display: swap; + } +} diff --git a/packages/cyberstorm-theme/src/styles/fonts/inter/interDeferred.css b/packages/cyberstorm-theme/src/styles/fonts/inter/interDeferred.css new file mode 100644 index 000000000..5da1172d2 --- /dev/null +++ b/packages/cyberstorm-theme/src/styles/fonts/inter/interDeferred.css @@ -0,0 +1,65 @@ +@layer utils { + @font-face { + font-weight: 100; + font-family: Inter; + font-style: normal; + src: url("Inter-Thin.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 200; + font-family: Inter; + font-style: normal; + src: url("Inter-ExtraLight.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 300; + font-family: Inter; + font-style: normal; + src: url("Inter-Light.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 900; + font-family: Inter; + font-style: normal; + src: url("Inter-Black.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 100; + font-family: Inter; + font-style: italic; + src: url("Inter-ThinItalic.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 200; + font-family: Inter; + font-style: italic; + src: url("Inter-ExtraLightItalic.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 300; + font-family: Inter; + font-style: italic; + src: url("Inter-LightItalic.woff2") format("woff2"); + font-display: swap; + } + + @font-face { + font-weight: 900; + font-family: Inter; + font-style: italic; + src: url("Inter-BlackItalic.woff2") format("woff2"); + font-display: swap; + } +} diff --git a/packages/cyberstorm-theme/src/styles/reset.css b/packages/cyberstorm-theme/src/styles/reset.css index 63a74d633..636d8a167 100644 --- a/packages/cyberstorm-theme/src/styles/reset.css +++ b/packages/cyberstorm-theme/src/styles/reset.css @@ -147,7 +147,17 @@ } /* Make it clear that interactive elements are interactive */ - :where(a[href], area, button, input, label[for], select, summary, textarea, [tabindex]:not([tabindex*="-"])) { + :where( + a[href], + area, + button, + input, + label[for], + select, + summary, + textarea, + [tabindex]:not([tabindex*="-"]) + ) { cursor: pointer; touch-action: manipulation; } @@ -166,7 +176,13 @@ } /* Make sure users can't select button text */ - :where(button, button[type], input[type="button"], input[type="submit"], input[type="reset"]), + :where( + button, + button[type], + input[type="button"], + input[type="submit"], + input[type="reset"] + ), :where(input[type="file"])::-webkit-file-upload-button, :where(input[type="file"])::file-selector-button { text-align: center; @@ -176,10 +192,23 @@ } /* Disabled cursor for disabled buttons */ - :where(button, button[type], input[type="button"], input[type="submit"], input[type="reset"])[disabled] { + :where( + button, + button[type], + input[type="button"], + input[type="submit"], + input[type="reset"] + )[disabled] { cursor: not-allowed; } + input[type="search"]::-webkit-search-decoration, + input[type="search"]::-webkit-search-cancel-button, + input[type="search"]::-webkit-search-results-button, + input[type="search"]::-webkit-search-results-decoration { + appearance: none; + } + * > * { scrollbar-width: thin; } diff --git a/packages/cyberstorm-theme/src/styles/typography.css b/packages/cyberstorm-theme/src/styles/typography.css index d546f9c6e..ae3e6f6cf 100644 --- a/packages/cyberstorm-theme/src/styles/typography.css +++ b/packages/cyberstorm-theme/src/styles/typography.css @@ -1,9 +1,14 @@ +@import "./fonts/inter/inter.css"; +@import "./fonts/inter/interDeferred.css"; +@import "./fonts/hubot-sans/hubot-sans.css"; +@import "./fonts/hubot-sans/hubot-sansDeferred.css"; + @layer utils { :root { --line-height-auto: normal; - --line-height-xs: 120%; - --line-height-sm: 140%; - --line-height-md: 160%; + --line-height-xs: 100%; + --line-height-sm: 120%; + --line-height-md: 150%; --line-height-lg: 170%; --font-size-body-xs: 0.625rem; --font-size-body-sm: 0.75rem; @@ -22,8 +27,11 @@ --font-family--hubot: hubot-sans, sans-serif; font-synthesis: none; - font-feature-settings: "liga" 1, "calt" 1; /* workaround for bug in Chrome, dunno if still present or not */ - scrollbar-color: var(--color-surface-8) var(--color-surface-1); + font-feature-settings: + "liga" 1, + "calt" 1; /* workaround for bug in Chrome, dunno if still present or not */ + + scrollbar-color: var(--color-surface-a8) var(--color-surface-a1); --font-body: normal var(--font-size-body-lg) var(--font-family--inter); --font-heading: normal var(--font-size-body-lg) var(--font-family--hubot); @@ -48,22 +56,4 @@ color: var(--color-text-a--hover); text-decoration: underline; } - - @font-face { - font-weight: 100 1000; - font-family: Sora; - src: url("./fonts/Sora.ttf") format("truetype-variations"); - } - - @font-face { - font-weight: 100 1000; - font-family: Inter; - src: url("./fonts/Inter.ttf") format("truetype-variations"); - } - - @font-face { - font-weight: 200 900; - font-family: Hubot-Sans; - src: url("./fonts/HubotSans.ttf") format("truetype-variations"); - } } diff --git a/packages/cyberstorm/package.json b/packages/cyberstorm/package.json index dea593f88..3532d4d9c 100644 --- a/packages/cyberstorm/package.json +++ b/packages/cyberstorm/package.json @@ -20,6 +20,7 @@ "@fortawesome/fontawesome-svg-core": "6.6.0", "@fortawesome/free-brands-svg-icons": "6.6.0", "@fortawesome/free-solid-svg-icons": "6.6.0", + "@fortawesome/pro-solid-svg-icons": "6.6.0", "@fortawesome/react-fontawesome": "^0.2.2", "@radix-ui/react-checkbox": "^1.1.1", "@radix-ui/react-dialog": "^1.1.1", diff --git a/packages/cyberstorm/src/components/Button/Button.module.css b/packages/cyberstorm/src/components/Button/Button.module.css index 1be521d45..d112d1b25 100644 --- a/packages/cyberstorm/src/components/Button/Button.module.css +++ b/packages/cyberstorm/src/components/Button/Button.module.css @@ -60,13 +60,15 @@ --bg-color: var(--old--color-cyber-green-60); --text-color: var(--old--color-cyber-green-10); - box-shadow: inset 0 -3px 0 0 rgb(0 0 0 / 0.35), + box-shadow: + inset 0 -3px 0 0 rgb(0 0 0 / 0.35), inset 0 var(--space-px) 0 0 rgb(255 255 255 / 0.2), inset 0 0 var(--space-16) 0 var(--old--color-accent-green-6); } .button__fancyAccent:hover { - box-shadow: inset 0 -3px 0 0 rgb(0 0 0 / 0.35), + box-shadow: + inset 0 -3px 0 0 rgb(0 0 0 / 0.35), inset 0 var(--space-px) 0 0 rgb(255 255 255 / 0.2), inset 0 0 var(--space-16) 0 var(--old--color-accent-green-3), 0 0 var(--space-10) 0 rgb(79 216 159 / 0.5); @@ -75,7 +77,8 @@ .button__fancyAccent:active { --bg-color: var(--old--color-cyber-green-50); - box-shadow: inset 0 var(--space-2) 0 0 rgb(0 0 0 / 0.25), + box-shadow: + inset 0 var(--space-2) 0 0 rgb(0 0 0 / 0.25), 0 0 var(--space-10) 0 rgb(79 216 159 / 0.5); } @@ -160,13 +163,15 @@ } .button__specialGreen { - background: var(--color-gradient-blue-green--darker) padding-box, + background: + var(--color-gradient-blue-green--darker) padding-box, var(--color-gradient-blue-green) border-box; box-shadow: var(--box-shadow-special-green); } .button__specialPurple { - background: linear-gradient(315deg, #1f0a2e 0%, #102b20 100%) padding-box, + background: + linear-gradient(315deg, #1f0a2e 0%, #102b20 100%) padding-box, linear-gradient(315deg, #9d30e4 0%, #23ffb0 100%) border-box; } @@ -179,7 +184,8 @@ .button__specialPurple:hover { --button-border-color: transparent; - background: linear-gradient(315deg, #0b4162 0%, #205740 100%) padding-box, + background: + linear-gradient(315deg, #0b4162 0%, #205740 100%) padding-box, linear-gradient(315deg, #49b5f7 0%, #73e1b2 100%) border-box; } @@ -196,12 +202,14 @@ } .button__specialGreen::before { - background: var(--color-gradient-blue-green--dark) padding-box, + background: + var(--color-gradient-blue-green--dark) padding-box, var(--color-gradient-blue-green--light) border-box; } .button__specialPurple::before { - background: var(--color-gradient-purple-green--dark) padding-box, + background: + var(--color-gradient-purple-green--dark) padding-box, var(--color-gradient-purple-green--light) border-box; } @@ -220,7 +228,7 @@ .button__transparentDanger { --bg-color: transparent; - --text-color: var(--color-text--accent); + --text-color: var(--color-text-accent); } .button__transparentDanger:hover { @@ -230,7 +238,7 @@ .button__transparentTertiary { --bg-color: transparent; - --text-color: var(--color-text--tertiary); + --text-color: var(--color-text-tertiary); } .button__transparentTertiary:hover { @@ -248,12 +256,12 @@ } .button__transparentAccent { - --text-color: var(--color-text--accent); + --text-color: var(--color-text-accent); --bg-color: transparent; } .button__transparentAccent:hover { - --text-color: var(--color-text--accent); + --text-color: var(--color-text-accent); --bg-color: var(--old--color-surface-7); } diff --git a/packages/cyberstorm/src/components/CollapsibleText/CollapsibleText.module.css b/packages/cyberstorm/src/components/CollapsibleText/CollapsibleText.module.css deleted file mode 100644 index e80689bc5..000000000 --- a/packages/cyberstorm/src/components/CollapsibleText/CollapsibleText.module.css +++ /dev/null @@ -1,31 +0,0 @@ -.root { - display: block; -} - -.text { - overflow: hidden; - color: var(--color-text--secondary); - font-size: var(--font-size-body-xxxxl); - line-height: var(--line-height--l); - white-space: pre-wrap; - text-overflow: ellipsis; -} - -.opened { - white-space: normal; -} - -@media (width <= 30rem) { - .text { - font-size: var(--font-size-body-md); - line-height: var(--line-height--s); - } -} - -.show { - color: var(--color-text--accent); - font-weight: var(--font-weight-bold); - font-size: 0.875rem; - line-height: normal; - background-color: transparent; -} diff --git a/packages/cyberstorm/src/components/CopyButton/CopyButton.module.css b/packages/cyberstorm/src/components/CopyButton/CopyButton.module.css index b9bdef679..4535e42bc 100644 --- a/packages/cyberstorm/src/components/CopyButton/CopyButton.module.css +++ b/packages/cyberstorm/src/components/CopyButton/CopyButton.module.css @@ -1,6 +1,6 @@ .copy { all: unset; - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); } .root:hover .copy { diff --git a/packages/cyberstorm/src/components/Dialog/Dialog.module.css b/packages/cyberstorm/src/components/Dialog/Dialog.module.css index 0c10571ff..984cf2689 100644 --- a/packages/cyberstorm/src/components/Dialog/Dialog.module.css +++ b/packages/cyberstorm/src/components/Dialog/Dialog.module.css @@ -17,7 +17,8 @@ border-radius: var(--radius-md); background-color: var(--color-surface-2); - box-shadow: hsl(206deg 22% 7% / 0.35) 0 10px 38px -10px, + box-shadow: + hsl(206deg 22% 7% / 0.35) 0 10px 38px -10px, hsl(206deg 22% 7% / 0.2) 0 10px 20px -15px; transform: translate(-50%, -50%); animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); diff --git a/packages/cyberstorm/src/components/DropDown/DropDownLink.tsx b/packages/cyberstorm/src/components/DropDown/DropDownLink.tsx index 5dcbc2aa6..840947e53 100644 --- a/packages/cyberstorm/src/components/DropDown/DropDownLink.tsx +++ b/packages/cyberstorm/src/components/DropDown/DropDownLink.tsx @@ -1,8 +1,8 @@ import styles from "./DropDownLink.module.css"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { ReactElement } from "react"; -import { faArrowUpRightFromSquare } from "@fortawesome/free-solid-svg-icons"; import { NewIcon } from "../.."; +import { faArrowUpRight } from "@fortawesome/pro-solid-svg-icons"; export interface DropDownLinkProps { label: string; @@ -28,7 +28,7 @@ export function DropDownLink(props: DropDownLinkProps) { csVariant="secondary" rootClasses={styles.arrowUpRightIcon} > - <FontAwesomeIcon icon={faArrowUpRightFromSquare} /> + <FontAwesomeIcon icon={faArrowUpRight} /> </NewIcon> ) : null} </div> diff --git a/packages/cyberstorm/src/components/ImageWithFallback/ImageWithFallback.tsx b/packages/cyberstorm/src/components/ImageWithFallback/ImageWithFallback.tsx index 02b9fa157..083bb09f3 100644 --- a/packages/cyberstorm/src/components/ImageWithFallback/ImageWithFallback.tsx +++ b/packages/cyberstorm/src/components/ImageWithFallback/ImageWithFallback.tsx @@ -59,4 +59,4 @@ const getIcon = (type: Props["type"] = "community") => ({ community: faGamepad, package: faBan, - }[type]); + })[type]; diff --git a/packages/cyberstorm/src/components/Link/Link.tsx b/packages/cyberstorm/src/components/Link/Link.tsx index d351caf24..5d2d54c70 100644 --- a/packages/cyberstorm/src/components/Link/Link.tsx +++ b/packages/cyberstorm/src/components/Link/Link.tsx @@ -1,9 +1,9 @@ import styles from "./Link.module.css"; import { ReactElement } from "react"; -import { faArrowUpRightFromSquare } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { Icon } from "../Icon/Icon"; import { classnames } from "../../utils/utils"; +import { faArrowUpRight } from "@fortawesome/pro-solid-svg-icons"; export interface LinkProps { label: string; @@ -33,7 +33,7 @@ export function Link(props: LinkProps) { ) : null} {label} <Icon wrapperClasses={styles.rightIcon}> - <FontAwesomeIcon icon={faArrowUpRightFromSquare} /> + <FontAwesomeIcon icon={faArrowUpRight} /> </Icon> </a> ); diff --git a/packages/cyberstorm/src/components/MenuItem/MenuItem.module.css b/packages/cyberstorm/src/components/MenuItem/MenuItem.module.css index 250b29c54..737b4db51 100644 --- a/packages/cyberstorm/src/components/MenuItem/MenuItem.module.css +++ b/packages/cyberstorm/src/components/MenuItem/MenuItem.module.css @@ -10,7 +10,7 @@ cursor: pointer; --text-color: var(--color-text--default); - --icon-color: var(--color-text--accent); + --icon-color: var(--color-text-accent); } .root:hover { diff --git a/packages/cyberstorm/src/components/MetaInfoItem/MetaInfoItem.module.css b/packages/cyberstorm/src/components/MetaInfoItem/MetaInfoItem.module.css index 5c89ae9b7..8f934275d 100644 --- a/packages/cyberstorm/src/components/MetaInfoItem/MetaInfoItem.module.css +++ b/packages/cyberstorm/src/components/MetaInfoItem/MetaInfoItem.module.css @@ -14,5 +14,5 @@ .label { flex-shrink: 0; - color: var(--color-text--accent); + color: var(--color-text-accent); } diff --git a/packages/cyberstorm/src/components/MetaItem/MetaItem.module.css b/packages/cyberstorm/src/components/MetaItem/MetaItem.module.css index c6e7eb69d..38d4f868b 100644 --- a/packages/cyberstorm/src/components/MetaItem/MetaItem.module.css +++ b/packages/cyberstorm/src/components/MetaItem/MetaItem.module.css @@ -34,11 +34,11 @@ } .metaItem__accent { - --text-color: var(--color-text--accent); + --text-color: var(--color-text-accent); } .metaItem__tertiary { - --text-color: var(--color-text--tertiary); + --text-color: var(--color-text-tertiary); } .metaItem__medium { diff --git a/packages/cyberstorm/src/components/MultiSelectSearch/MultiSelectSearch.module.css b/packages/cyberstorm/src/components/MultiSelectSearch/MultiSelectSearch.module.css index f84e19c9d..0c2e57e4e 100644 --- a/packages/cyberstorm/src/components/MultiSelectSearch/MultiSelectSearch.module.css +++ b/packages/cyberstorm/src/components/MultiSelectSearch/MultiSelectSearch.module.css @@ -6,7 +6,7 @@ justify-content: flex-end; width: auto; min-height: 6rem; - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); } .selected { @@ -21,7 +21,7 @@ flex-direction: column; width: auto; height: 2.75rem; - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); } .inputContainer { @@ -60,7 +60,7 @@ } .input::placeholder { - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); } .inputContainer[data-color="red"] { diff --git a/packages/cyberstorm/src/components/NewTabs/Tabs.module.css b/packages/cyberstorm/src/components/NewTabs/Tabs.module.css index f042799a6..4da2f8775 100644 --- a/packages/cyberstorm/src/components/NewTabs/Tabs.module.css +++ b/packages/cyberstorm/src/components/NewTabs/Tabs.module.css @@ -46,7 +46,7 @@ } .button:not(.active, :disabled):hover > .icon { - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); } .label { diff --git a/packages/cyberstorm/src/components/PackageCard/PackageCard.module.css b/packages/cyberstorm/src/components/PackageCard/PackageCard.module.css index d1723b7b8..dfced0bc5 100644 --- a/packages/cyberstorm/src/components/PackageCard/PackageCard.module.css +++ b/packages/cyberstorm/src/components/PackageCard/PackageCard.module.css @@ -12,7 +12,7 @@ .root:focus-within, .root:hover { background-color: #23234d; - box-shadow: 0 12px 24px 5px rgb(0 0 0 / 0.65); + box-shadow: var(--shadow-lg); } .imageWrapper { @@ -87,14 +87,14 @@ .author_prefix { padding-right: var(--space-4); - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); } /* Styles for PackageCard's description */ .description { display: -webkit-box; overflow: hidden; - color: var(--color-text--secondary); + color: var(--color-text-secondary); font: var(--font-body); font-weight: var(--font-weight-medium); font-size: var(--font-size-body-lg); @@ -106,7 +106,7 @@ /* Styles for PackageCard's "Last updated" info */ .lastUpdated { - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); font: var(--font-body); font-weight: var(--font-weight-medium); font-size: var(--font-size-body-md); diff --git a/packages/cyberstorm/src/components/PackageCard/PackageCard.tsx b/packages/cyberstorm/src/components/PackageCard/PackageCard.tsx index 5b4a684fc..5da3790ec 100644 --- a/packages/cyberstorm/src/components/PackageCard/PackageCard.tsx +++ b/packages/cyberstorm/src/components/PackageCard/PackageCard.tsx @@ -129,7 +129,7 @@ function getPackageFlags(packageData: PackageListing) { if (isNew) { flagList.push( <Tag - key="flag_nsfw" + key="flag_new" label="New" colorScheme="green" leftIcon={<FontAwesomeIcon icon={faBomb} />} diff --git a/packages/cyberstorm/src/components/Pagination/Pagination.module.css b/packages/cyberstorm/src/components/Pagination/Pagination.module.css index ece8075e1..a8be6f373 100644 --- a/packages/cyberstorm/src/components/Pagination/Pagination.module.css +++ b/packages/cyberstorm/src/components/Pagination/Pagination.module.css @@ -20,7 +20,7 @@ padding: var(--space-8) var(--space-8); border-radius: var(--radius-md); - color: var(--color-text--secondary); + color: var(--color-text-secondary); font-weight: var(--font-weight-medium); line-height: var(--line-height--18); diff --git a/packages/cyberstorm/src/components/Pagination/Pagination.tsx b/packages/cyberstorm/src/components/Pagination/Pagination.tsx index 595367bca..84b2d195c 100644 --- a/packages/cyberstorm/src/components/Pagination/Pagination.tsx +++ b/packages/cyberstorm/src/components/Pagination/Pagination.tsx @@ -1,13 +1,12 @@ import { faArrowLeft, faArrowRight } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { Dispatch, SetStateAction } from "react"; import { classnames, range } from "../../utils/utils"; import styles from "./Pagination.module.css"; import { PaginationButton } from "./PaginationButton"; export interface PaginationProps { currentPage: number; - onPageChange: Dispatch<SetStateAction<number>>; + onPageChange: (v: number) => void; totalCount: number; pageSize: number; disabled?: boolean; diff --git a/packages/cyberstorm/src/components/Pagination/PaginationButton.module.css b/packages/cyberstorm/src/components/Pagination/PaginationButton.module.css index 6f9c33ad2..3954f0b95 100644 --- a/packages/cyberstorm/src/components/Pagination/PaginationButton.module.css +++ b/packages/cyberstorm/src/components/Pagination/PaginationButton.module.css @@ -10,7 +10,7 @@ padding: var(--space-8) var(--space-8); border-radius: var(--radius-md); - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); background-color: var(--bg-color); --bg-color: var(--color-surface-4); diff --git a/packages/cyberstorm/src/components/SelectSearch/SelectSearch.module.css b/packages/cyberstorm/src/components/SelectSearch/SelectSearch.module.css index f84e19c9d..0c2e57e4e 100644 --- a/packages/cyberstorm/src/components/SelectSearch/SelectSearch.module.css +++ b/packages/cyberstorm/src/components/SelectSearch/SelectSearch.module.css @@ -6,7 +6,7 @@ justify-content: flex-end; width: auto; min-height: 6rem; - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); } .selected { @@ -21,7 +21,7 @@ flex-direction: column; width: auto; height: 2.75rem; - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); } .inputContainer { @@ -60,7 +60,7 @@ } .input::placeholder { - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); } .inputContainer[data-color="red"] { diff --git a/packages/cyberstorm/src/components/SettingItem/SettingItem.module.css b/packages/cyberstorm/src/components/SettingItem/SettingItem.module.css index 2f2e7830c..777eb0243 100644 --- a/packages/cyberstorm/src/components/SettingItem/SettingItem.module.css +++ b/packages/cyberstorm/src/components/SettingItem/SettingItem.module.css @@ -24,7 +24,7 @@ } .leftColumnDescription { - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); font-weight: var(--font-weight-medium); font-size: var(--font-size-body-lg); line-height: var(--line-height--m); diff --git a/packages/cyberstorm/src/components/StalenessIndicator/StalenessIndicator.module.css b/packages/cyberstorm/src/components/StalenessIndicator/StalenessIndicator.module.css index d1a6f93cb..d2372b997 100644 --- a/packages/cyberstorm/src/components/StalenessIndicator/StalenessIndicator.module.css +++ b/packages/cyberstorm/src/components/StalenessIndicator/StalenessIndicator.module.css @@ -1,3 +1,34 @@ .root { opacity: 0.5; } + +.loader { + position: absolute; + z-index: 3; + display: flex; + align-items: flex-start; + width: 100%; + height: 100%; + padding: 5rem 0 10rem; + + > svg { + position: sticky; + top: 40vh; + width: 5rem; + height: 5rem; + animation: rotation 1s linear infinite; + min-inline-size: auto; + + --icon-color: var(--color-cyber-green-7); + } +} + +@keyframes rotation { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +} diff --git a/packages/cyberstorm/src/components/StalenessIndicator/StalenessIndicator.tsx b/packages/cyberstorm/src/components/StalenessIndicator/StalenessIndicator.tsx index 4dc849b79..d9a271407 100644 --- a/packages/cyberstorm/src/components/StalenessIndicator/StalenessIndicator.tsx +++ b/packages/cyberstorm/src/components/StalenessIndicator/StalenessIndicator.tsx @@ -1,6 +1,8 @@ import styles from "./StalenessIndicator.module.css"; import { ReactNode } from "react"; import { classnames } from "../../utils/utils"; +import { NewIcon } from "../.."; +import { ThunderstoreLogo } from "../../svg/svg"; interface Props { children: ReactNode; @@ -17,8 +19,15 @@ interface Props { export function StalenessIndicator(props: Props) { const { children, className, isStale = false } = props; return ( - <div className={classnames(isStale ? styles.root : null, className)}> - {children} + <div style={{ position: "relative" }}> + {isStale ? ( + <NewIcon wrapperClasses={styles.loader}> + <ThunderstoreLogo /> + </NewIcon> + ) : undefined} + <div className={classnames(isStale ? styles.root : null, className)}> + {children} + </div> </div> ); } diff --git a/packages/cyberstorm/src/components/Switch/Switch.module.css b/packages/cyberstorm/src/components/Switch/Switch.module.css index 69c8e9acb..10e699e17 100644 --- a/packages/cyberstorm/src/components/Switch/Switch.module.css +++ b/packages/cyberstorm/src/components/Switch/Switch.module.css @@ -24,7 +24,9 @@ height: 1.25rem; border-radius: 2.813rem; background: #f5f5f6; - box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.65), 0 -1px 0 0 rgb(0 0 0 / 0.05); + box-shadow: + 0 1px 2px 0 rgb(0 0 0 / 0.65), + 0 -1px 0 0 rgb(0 0 0 / 0.05); transition: ease-out var(--animation-duration-sm); } diff --git a/packages/cyberstorm/src/components/Table/Table.module.css b/packages/cyberstorm/src/components/Table/Table.module.css index 6569a156a..c38c89560 100644 --- a/packages/cyberstorm/src/components/Table/Table.module.css +++ b/packages/cyberstorm/src/components/Table/Table.module.css @@ -98,7 +98,7 @@ width: fit-content; margin: 0 var(--space-24) var(--space-16) var(--space-24); border-radius: var(--radius-md); - color: var(--color-text--accent); + color: var(--color-text-accent); font-weight: var(--font-weight-bold); font-size: var(--space-14); line-height: normal; @@ -140,7 +140,7 @@ display: flex; align-items: center; padding: var(--space-16) var(--space-24); - color: var(--color-text--secondary); + color: var(--color-text-secondary); font-weight: var(--font-weight-medium); line-height: var(--line-height--l); } @@ -172,7 +172,7 @@ width: fit-content; margin: 0 var(--space-24) var(--space-8) var(--space-24); border-radius: var(--radius-md); - color: var(--color-text--accent); + color: var(--color-text-accent); font-weight: var(--font-weight-bold); font-size: var(--space-14); line-height: var(--line-height-lg); @@ -210,7 +210,7 @@ display: flex; align-items: center; padding: 0.425rem var(--space-24); - color: var(--color-text--secondary); + color: var(--color-text-secondary); font-weight: var(--font-weight-medium); line-height: var(--line-height--l); } diff --git a/packages/cyberstorm/src/components/Tabs/TabsButton.module.css b/packages/cyberstorm/src/components/Tabs/TabsButton.module.css index 73634082e..76dcb1cdd 100644 --- a/packages/cyberstorm/src/components/Tabs/TabsButton.module.css +++ b/packages/cyberstorm/src/components/Tabs/TabsButton.module.css @@ -32,7 +32,7 @@ } .button__default:hover > .icon { - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); } .button__default:hover { diff --git a/packages/cyberstorm/src/components/Tag/Tag.module.css b/packages/cyberstorm/src/components/Tag/Tag.module.css index c929e50af..d434d8bd2 100644 --- a/packages/cyberstorm/src/components/Tag/Tag.module.css +++ b/packages/cyberstorm/src/components/Tag/Tag.module.css @@ -20,7 +20,7 @@ --text-color: var(--color-text--default); --bg-color: var(--color-surface-5); --border-color: var(--color-surface-9); - --icon-color: var(--color-text--tertiary); + --icon-color: var(--color-text-tertiary); } .label { @@ -60,7 +60,7 @@ .tag__borderless_removable { --border-color: transparent; - --text-color: var(--color-text--secondary); + --text-color: var(--color-text-secondary); text-transform: uppercase; } @@ -107,7 +107,7 @@ .tag__simple { --bg-color: var(--color-surface-4); --border-color: transparent; - --text-color: var(--color-text--tertiary); + --text-color: var(--color-text-tertiary); } .tag__success { diff --git a/packages/cyberstorm/src/components/TextAreaInput/TextAreaInput.module.css b/packages/cyberstorm/src/components/TextAreaInput/TextAreaInput.module.css index 78381bc65..9ce26bfd8 100644 --- a/packages/cyberstorm/src/components/TextAreaInput/TextAreaInput.module.css +++ b/packages/cyberstorm/src/components/TextAreaInput/TextAreaInput.module.css @@ -31,5 +31,5 @@ } .root::placeholder { - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); } diff --git a/packages/cyberstorm/src/components/TextInput/TextInput.module.css b/packages/cyberstorm/src/components/TextInput/TextInput.module.css index 045f65051..4dd5af019 100644 --- a/packages/cyberstorm/src/components/TextInput/TextInput.module.css +++ b/packages/cyberstorm/src/components/TextInput/TextInput.module.css @@ -3,7 +3,7 @@ display: flex; align-items: center; width: auto; - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); } .root > input { @@ -42,7 +42,7 @@ } .input::placeholder { - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); } .input[data-color="red"] { @@ -72,7 +72,7 @@ .leftIcon { position: absolute; margin: var(--space-10) var(--space-16); - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); line-height: normal; pointer-events: none; } @@ -80,7 +80,7 @@ .rightIcon { position: absolute; padding: var(--space-14) var(--space-16); - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); } .clearValueButton { diff --git a/packages/cyberstorm/src/components/ValidationBar/ValidationBar.tsx b/packages/cyberstorm/src/components/ValidationBar/ValidationBar.tsx index 1d8bb3ddf..fe931cfd2 100644 --- a/packages/cyberstorm/src/components/ValidationBar/ValidationBar.tsx +++ b/packages/cyberstorm/src/components/ValidationBar/ValidationBar.tsx @@ -86,10 +86,10 @@ function ValidationElement(props: { return !shouldValidate ? waitingElement : validation.status === "success" - ? successElement - : validation.status === "failure" && validation.message - ? failureElement(validation.message) - : failureElement("Internal error"); + ? successElement + : validation.status === "failure" && validation.message + ? failureElement(validation.message) + : failureElement("Internal error"); } /** diff --git a/packages/cyberstorm/src/components/WrapperCard/WrapperCard.module.css b/packages/cyberstorm/src/components/WrapperCard/WrapperCard.module.css index 7ce7f5073..1a8b706fa 100644 --- a/packages/cyberstorm/src/components/WrapperCard/WrapperCard.module.css +++ b/packages/cyberstorm/src/components/WrapperCard/WrapperCard.module.css @@ -28,5 +28,5 @@ } .icon { - color: var(--color-text--tertiary); + color: var(--color-text-tertiary); } diff --git a/packages/cyberstorm/src/index.ts b/packages/cyberstorm/src/index.ts index cf661385f..fbf708bc0 100644 --- a/packages/cyberstorm/src/index.ts +++ b/packages/cyberstorm/src/index.ts @@ -72,7 +72,6 @@ export { CommunityCardSkeleton } from "./components/CommunityCard/CommunityCardS export { range } from "./utils/utils"; export { SettingItem } from "./components/SettingItem/SettingItem"; export { ImageWithFallback } from "./components/ImageWithFallback/ImageWithFallback"; -export { CollapsibleText } from "./components/CollapsibleText/CollapsibleText"; export { SkeletonBox } from "./components/SkeletonBox/SkeletonBox"; export { isNode, isRecord, isStringArray } from "./utils/type_guards"; @@ -105,8 +104,8 @@ export { Menu } from "./newComponents/Menu/Menu"; export { Modal } from "./newComponents/Modal/Modal"; export { Heading } from "./newComponents/Heading/Heading"; export { CardCommunity } from "./newComponents/Card/CardCommunity/CardCommunity"; +export { CardPackage } from "./newComponents/Card/CardPackage/CardPackage"; export { Link as NewLink } from "./newComponents/Link/Link/Link"; -export { LinkButton } from "./newComponents/Link/LinkButton/LinkButton"; export { Button as NewButton } from "./newComponents/Button/Button"; export { BreadCrumbs as NewBreadCrumbs } from "./newComponents/BreadCrumbs/BreadCrumbs"; export { TextInput as NewTextInput } from "./newComponents/TextInput/TextInput"; @@ -116,6 +115,8 @@ export { } from "./newComponents/Select/Select"; export { Icon as NewIcon } from "./newComponents/Icon/Icon"; export { Tag as NewTag } from "./newComponents/Tag/Tag"; +export { MetaItem as NewMetaItem } from "./newComponents/MetaItem/MetaItem"; +export { Pagination as NewPagination } from "./newComponents/Pagination/Pagination"; export { DropDown as NewDropDown, DropDownItem as NewDropDownItem, diff --git a/packages/cyberstorm/src/newComponents/BreadCrumbs/BreadCrumbs.css b/packages/cyberstorm/src/newComponents/BreadCrumbs/BreadCrumbs.css index f5c511ee6..dfd77a28c 100644 --- a/packages/cyberstorm/src/newComponents/BreadCrumbs/BreadCrumbs.css +++ b/packages/cyberstorm/src/newComponents/BreadCrumbs/BreadCrumbs.css @@ -3,7 +3,7 @@ display: flex; gap: var(--space-4); padding-left: var(--space-16); - font-weight: var(--font-weight-medium); + font-weight: var(--font-weight-regular); font-size: var(--font-size-body-sm); line-height: var(--line-height-auto); } @@ -86,7 +86,6 @@ .ts-breadcrumbs__homelink { display: inline-block; height: 1em; - font-weight: var(--font-weight-regular); font-size: var(--font-size-body-md); } } diff --git a/packages/cyberstorm/src/newComponents/Button/Button.css b/packages/cyberstorm/src/newComponents/Button/Button.css index 9d592929e..e2df4bcaa 100644 --- a/packages/cyberstorm/src/newComponents/Button/Button.css +++ b/packages/cyberstorm/src/newComponents/Button/Button.css @@ -18,10 +18,14 @@ font-weight: var(--button-font-weight); font-size: var(--button-font-size); line-height: var(--button-line-height); + white-space: nowrap; text-align: center; text-decoration: none; background-color: var(--button-background-color); + transition: var(--button-transition); user-select: none; + padding-block: var(--button-padding-block); + padding-inline: var(--button-padding-inline); } } diff --git a/packages/cyberstorm/src/newComponents/Button/Button.tsx b/packages/cyberstorm/src/newComponents/Button/Button.tsx index c388a1361..3ff4d56dd 100644 --- a/packages/cyberstorm/src/newComponents/Button/Button.tsx +++ b/packages/cyberstorm/src/newComponents/Button/Button.tsx @@ -5,6 +5,8 @@ import { classnames, componentClasses } from "../../utils/utils"; import { ActionableButtonProps, Actionable, + ActionableCyberstormLinkProps, + ActionableLinkProps, } from "../../primitiveComponents/Actionable/Actionable"; import { IconProp } from "@fortawesome/fontawesome-svg-core"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; @@ -18,78 +20,97 @@ import { IconButtonSizes, } from "@thunderstore/cyberstorm-theme/src/components"; -interface ButtonProps extends Omit<ActionableButtonProps, "primitiveType"> { +interface IButton { csVariant?: ButtonVariants; csSize?: ButtonSizes; csModifiers?: ButtonModifiers[]; } -interface IconButtonProps - extends Omit<ActionableButtonProps, "primitiveType" | "children"> { +interface IIconButton { csVariant?: IconButtonVariants; csSize?: IconButtonSizes; csModifiers?: IconButtonModifiers[]; icon: IconProp; } -export type ButtonComponentProps = - | ({ icon?: false } & ButtonProps) - | ({ icon: IconProp } & IconButtonProps); - -// TODO: Add style support for disabled -export const Button = React.forwardRef<HTMLButtonElement, ButtonComponentProps>( - (props: ButtonComponentProps, forwardedRef) => { - const { rootClasses, icon, ...forwardedProps } = props; +interface ButtonButton extends IButton, ActionableButtonProps {} +interface ButtonLinkButton extends IButton, ActionableLinkProps {} +interface ButtonCyberstormLinkButton + extends IButton, + ActionableCyberstormLinkProps {} - if (icon) { - const { - csVariant = "primary", - csSize = "medium", - csModifiers, - ...fProps - } = forwardedProps as IconButtonProps; +interface IconButtonButton extends IIconButton, ActionableButtonProps {} +interface IconButtonLinkButton extends IIconButton, ActionableLinkProps {} +interface IconButtonCyberstormLinkButton + extends IIconButton, + ActionableCyberstormLinkProps {} - return ( - <Actionable - primitiveType="button" - {...fProps} - rootClasses={classnames( - "ts-iconbutton", - ...componentClasses(csVariant, csSize, csModifiers), - rootClasses - )} - ref={forwardedRef} - > - <NewIcon csMode="inline" noWrapper rootClasses="ts-iconbutton__icon"> - <FontAwesomeIcon icon={icon} /> - </NewIcon> - </Actionable> - ); - } +export type ButtonComponentProps = + | (Omit<ButtonButton, "primitiveType"> & { + icon?: false; + primitiveType?: "button"; + }) + | (ButtonLinkButton & { icon?: false; primitiveType: "link" }) + | (ButtonCyberstormLinkButton & { + icon?: false; + primitiveType: "cyberstormLink"; + }) + | (Omit<IconButtonButton, "primitiveType"> & { + icon: IconProp; + primitiveType?: "button"; + }) + | (IconButtonLinkButton & { icon: IconProp; primitiveType: "link" }) + | (IconButtonCyberstormLinkButton & { + icon: IconProp; + primitiveType: "cyberstormLink"; + }); - const { - children, - csVariant = "primary", - csSize = "medium", - csModifiers, - ...fProps - } = forwardedProps as ButtonProps; +// TODO: Add style support for disabled +export const Button = React.forwardRef< + HTMLButtonElement | HTMLAnchorElement, + ButtonComponentProps +>((props: ButtonComponentProps, forwardedRef) => { + const { + children, + rootClasses, + csVariant = "primary", + csSize = "medium", + csModifiers, + icon, + ...forwardedProps + } = props; + if (icon) { return ( <Actionable - primitiveType="button" - {...fProps} + {...forwardedProps} rootClasses={classnames( - "ts-button", + "ts-iconbutton", ...componentClasses(csVariant, csSize, csModifiers), rootClasses )} ref={forwardedRef} > - {children} + <NewIcon csMode="inline" noWrapper rootClasses="ts-iconbutton__icon"> + <FontAwesomeIcon icon={icon} /> + </NewIcon> </Actionable> ); } -); + + return ( + <Actionable + {...forwardedProps} + rootClasses={classnames( + "ts-button", + ...componentClasses(csVariant, csSize, csModifiers), + rootClasses + )} + ref={forwardedRef} + > + {children} + </Actionable> + ); +}); Button.displayName = "Button"; diff --git a/packages/cyberstorm/src/newComponents/Button/IconButton.css b/packages/cyberstorm/src/newComponents/Button/IconButton.css index 551ea63e8..1fc059124 100644 --- a/packages/cyberstorm/src/newComponents/Button/IconButton.css +++ b/packages/cyberstorm/src/newComponents/Button/IconButton.css @@ -8,6 +8,8 @@ width: var(--iconbutton-width); height: var(--iconbutton-height); padding: var(--iconbutton-padding); + padding-block: var(--iconbutton-padding-block); + padding-inline: var(--iconbutton-padding-inline); border: var(--iconbutton-border); border-color: var(--iconbutton-border-color); border-radius: var(--iconbutton-border-radius); diff --git a/packages/cyberstorm/src/newComponents/Card/CardCommunity/CardCommunity.css b/packages/cyberstorm/src/newComponents/Card/CardCommunity/CardCommunity.css index dc6e36b95..619b6f9bb 100644 --- a/packages/cyberstorm/src/newComponents/Card/CardCommunity/CardCommunity.css +++ b/packages/cyberstorm/src/newComponents/Card/CardCommunity/CardCommunity.css @@ -8,7 +8,7 @@ font-size: var(--font-size-body-lg); } - .ts-cardcommunity:hover .ts-cardcommunity__imagewrapper { + .ts-cardcommunity__imagewrapper:hover { filter: brightness(1.2); } @@ -47,14 +47,6 @@ margin-top: auto; } - .ts-cardcommunity__metaitem { - display: flex; - gap: var(--gap-xs); - align-items: center; - color: var(--color-text-accent); - font-size: var(--font-size-body-sm); - } - .ts-cardcommunity__tag { position: absolute; right: 0; diff --git a/packages/cyberstorm/src/newComponents/Card/CardCommunity/CardCommunity.tsx b/packages/cyberstorm/src/newComponents/Card/CardCommunity/CardCommunity.tsx index aae462ad7..02c9194dc 100644 --- a/packages/cyberstorm/src/newComponents/Card/CardCommunity/CardCommunity.tsx +++ b/packages/cyberstorm/src/newComponents/Card/CardCommunity/CardCommunity.tsx @@ -8,7 +8,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { Community } from "@thunderstore/dapper/types"; import { numberWithSpaces, formatInteger } from "../../../utils/utils"; -import { NewLink, NewIcon, Image, NewTag } from "../../.."; +import { NewLink, NewIcon, Image, NewTag, NewMetaItem } from "../../.."; import { TooltipWrapper } from "../../../primitiveComponents/utils/utils"; import "./CardCommunity.css"; @@ -54,6 +54,8 @@ export function CardCommunity(props: Props) { src={community.cover_image_url} cardType="community" rootClasses="ts-cardcommunity__imagewrapper" + intrinsicWidth={360} + intrinsicHeight={480} /> </NewLink> <NewLink @@ -70,24 +72,24 @@ export function CardCommunity(props: Props) { community.total_package_count )} Packages`} > - <div className="ts-cardcommunity__metaitem"> + <NewMetaItem csSize="12"> <NewIcon csMode="inline" noWrapper> <FontAwesomeIcon icon={faBoxOpen} /> </NewIcon> {formatInteger(community.total_package_count)} - </div> + </NewMetaItem> </TooltipWrapper> <TooltipWrapper tooltipText={`${numberWithSpaces( community.total_download_count )} Downloads`} > - <div className="ts-cardcommunity__metaitem"> + <NewMetaItem csSize="12"> <NewIcon csMode="inline" noWrapper> <FontAwesomeIcon icon={faDownload} /> </NewIcon> {formatInteger(community.total_download_count)} - </div> + </NewMetaItem> </TooltipWrapper> </div> </div> diff --git a/packages/cyberstorm/src/newComponents/Card/CardPackage/CardPackage.css b/packages/cyberstorm/src/newComponents/Card/CardPackage/CardPackage.css new file mode 100644 index 000000000..11936539c --- /dev/null +++ b/packages/cyberstorm/src/newComponents/Card/CardPackage/CardPackage.css @@ -0,0 +1,170 @@ +@layer components { + .ts-cardpackage { + position: relative; + display: flex; + flex-direction: column; + border-radius: var(--radius-md); + background: var(--color-surface-a4); + transition: ease-out var(--animation-duration-xs); + } + + .ts-cardpackage:has(:focus-visible) { + border-radius: var(--radius-md); + outline: 0.2rem solid var(--color-cyber-green-5); + outline-offset: 0.5rem; + } + + .ts-cardpackage .ts-cardpackage__imagewrapper { + border-bottom-right-radius: 0 !important; + border-bottom-left-radius: 0 !important; + } + + .ts-cardpackage:hover { + background: var(--color-surface-a5); + box-shadow: + 0 0 4px 0 rgb(0 0 0 / 0.4), + 0 6px 8px 0 rgb(0 0 0 / 0.5); + } + + .ts-cardpackage__imagewrapper { + &:hover { + filter: brightness(1.2); + + > div { + transform: scale(1.035); + } + } + } + + .ts-cardpackage:focus-within .ts-cardpackage__imagewrapper { + filter: brightness(1.2); + + > div { + transform: scale(1.035); + } + } + + .ts-cardpackage > .ts-cardpackage__content { + display: flex; + flex-direction: column; + gap: 12px; + align-items: flex-start; + align-self: stretch; + height: 100%; + padding: var(--space-12); + } + + .ts-cardpackage__tag { + position: absolute; + right: 0; + z-index: 1; + display: flex; + flex-flow: row-reverse; + flex-wrap: wrap; + gap: var(--space-8); + margin: var(--space-8); + } + + .ts-cardpackage__info { + display: flex; + flex-direction: column; + gap: var(--gap-xs); + width: 100%; + } + + /* Title */ + .ts-cardpackage__title { + width: 100%; + + overflow: hidden; + color: var(--color-text--default); + font: var(--font-body); + font-weight: var(--font-weight-bold); + font-size: var(--font-size-body-lg); + white-space: nowrap; + text-overflow: ellipsis; + + --link-color: var(--color-text-primary); + } + + .ts-cardpackage__title:focus-visible { + outline: none !important; + } + + /* Author */ + .ts-cardpackage__author { + display: flex; + flex-direction: row; + width: 100%; + font-size: var(--font-size-body-md); + line-height: 1; + text-decoration: none; + } + + .ts-cardpackage__author__link { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + + --link-color: var(--color-text-accent); + } + + .ts-cardpackage__author__link:hover { + --link-color-hover: var(--color-text-a--hover); + + text-decoration: underline; + } + + .ts-cardpackage__author__prefix { + padding-right: var(--space-4); + color: var(--color-text-tertiary); + } + + /* Description */ + .ts-cardpackage__description { + width: 100%; + color: var(--color-text-secondary); + font: var(--font-body); + font-weight: var(--font-weight-regular); + font-size: var(--font-size-body-md); + line-height: var(--line-height-lg); + } + + /* Tags */ + .ts-cardpackage__categoryWrapper { + display: flex; + flex: 1; + flex-wrap: wrap; + gap: 4px; + align-content: flex-end; + align-items: flex-start; + align-self: stretch; + } + + /* Footer */ + .ts-cardpackage__footer { + display: flex; + flex-direction: column; + gap: 12px; + align-items: flex-start; + align-self: stretch; + justify-content: flex-end; + padding-top: 6px; + } + + .ts-cardpackage__footer__metaItemWrapper { + display: flex; + flex-wrap: wrap; + gap: 12px 24px; + align-content: center; + align-items: center; + align-self: stretch; + color: var(--color-text-tertiary); + } + + .ts-cardpackage__footer__updatetext { + color: var(--color-text-tertiary); + font-weight: 400; + font-size: var(--font-size-body-sm, 12px); + } +} diff --git a/packages/cyberstorm/src/newComponents/Card/CardPackage/CardPackage.tsx b/packages/cyberstorm/src/newComponents/Card/CardPackage/CardPackage.tsx new file mode 100644 index 000000000..136da40a1 --- /dev/null +++ b/packages/cyberstorm/src/newComponents/Card/CardPackage/CardPackage.tsx @@ -0,0 +1,200 @@ +import { + faDownload, + faThumbTack, + faWarning, + faThumbsUp, +} from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { PackageListing } from "@thunderstore/dapper/types"; + +import { numberWithSpaces, formatInteger } from "../../../utils/utils"; +import { NewLink, NewIcon, Image, NewTag, NewMetaItem } from "../../.."; +import { TooltipWrapper } from "../../../primitiveComponents/utils/utils"; +import "./CardPackage.css"; +import { faLips, faSparkles } from "@fortawesome/pro-solid-svg-icons"; +import { RelativeTime } from "../../../components/RelativeTime/RelativeTime"; + +interface Props { + packageData: PackageListing; + // TODO: Remove this customization when /p is doned + domain: string; +} + +export function CardPackage(props: Props) { + const { packageData, domain } = props; + const updateTime = Date.parse(packageData.last_updated); + const updateTimeDelta = Math.round((Date.now() - updateTime) / 86400000); + const isNew = updateTimeDelta < 3; + // const currentUrlWithPath = + // window.location.port !== "" + // ? `${window.location.protocol}${window.location.hostname}${window.location.port}/${window.location.pathname}` + // : `${window.location.protocol}${window.location.hostname}${window.location.port}/${window.location.pathname}`; + + return ( + <div className="ts-cardpackage"> + <NewLink + tabIndex={-1} + // TODO: Remove this customization when /p is doned + primitiveType="link" + href={`${domain}/c/${packageData.community_identifier}/p/${packageData.namespace}/${packageData.name}/`} + // primitiveType="cyberstormLink" + // linkId="Package" + // community={packageData.community_identifier} + // namespace={packageData.namespace} + // package={packageData.name} + title={`${packageData.name} by ${packageData.namespace}`} + > + {packageData.is_pinned || + packageData.is_nsfw || + packageData.is_deprecated || + isNew ? ( + <div className="ts-cardpackage__tag"> + {packageData.is_pinned ? ( + <NewTag csModifiers={["dark"]} csVariant="blue"> + <NewIcon noWrapper csMode="inline"> + <FontAwesomeIcon icon={faThumbTack} /> + </NewIcon> + Pinned + </NewTag> + ) : null} + {packageData.is_nsfw ? ( + <NewTag csModifiers={["dark"]} csVariant="pink"> + <NewIcon noWrapper csMode="inline"> + <FontAwesomeIcon icon={faLips} /> + </NewIcon> + NSFW + </NewTag> + ) : null} + {packageData.is_deprecated ? ( + <NewTag csModifiers={["dark"]} csVariant="yellow"> + <NewIcon noWrapper csMode="inline"> + <FontAwesomeIcon icon={faWarning} /> + </NewIcon> + Deprecated + </NewTag> + ) : null} + {isNew ? ( + <NewTag csModifiers={["dark"]} csVariant="green"> + <NewIcon noWrapper csMode="inline"> + <FontAwesomeIcon icon={faSparkles} /> + </NewIcon> + New + </NewTag> + ) : null} + </div> + ) : undefined} + <Image + src={packageData.icon_url} + cardType="package" + rootClasses="ts-cardpackage__imagewrapper" + square + intrinsicWidth={256} + intrinsicHeight={256} + /> + </NewLink> + + <div className="ts-cardpackage__content"> + <div className="ts-cardpackage__info"> + <NewLink + // TODO: Remove this customization when /p is doned + primitiveType="link" + href={`${domain}/c/${packageData.community_identifier}/p/${packageData.namespace}/${packageData.name}/`} + // primitiveType="cyberstormLink" + // linkId="Package" + // community={packageData.community_identifier} + // namespace={packageData.namespace} + // package={packageData.name} + rootClasses="ts-cardpackage__title" + title={packageData.name} + > + {packageData.name} + </NewLink> + + <div className="ts-cardpackage__author"> + <span className="ts-cardpackage__author__prefix">by</span> + <NewLink + primitiveType="cyberstormLink" + linkId="Team" + community={packageData.community_identifier} + team={packageData.namespace} + title={packageData.namespace} + rootClasses="ts-cardpackage__author__link" + > + {packageData.namespace} + </NewLink> + </div> + </div> + + {packageData.description ? ( + <p className="ts-cardpackage__description"> + {packageData.description} + </p> + ) : null} + <div className="ts-cardpackage__categoryWrapper"> + {packageData.categories.length + ? packageData.categories.map((c, index) => ( + <NewTag + csMode="link" + href={`/c/${packageData.community_identifier}/?includedCategories=${c.id}`} + key={`category_${c}_${index}`} + csVariant="primary" + csSize="small" + csModifiers={["dark", "hoverable"]} + > + {c.name} + </NewTag> + )) + : null} + </div> + + <div className="ts-cardpackage__footer"> + <div className="ts-cardpackage__footer__metaItemWrapper"> + <TooltipWrapper + tooltipText={`${numberWithSpaces( + packageData.download_count + )} Downloads`} + > + <NewMetaItem csSize="12"> + <NewIcon csMode="inline" noWrapper> + <FontAwesomeIcon icon={faDownload} /> + </NewIcon> + {formatInteger(packageData.download_count)} + </NewMetaItem> + </TooltipWrapper> + {/* <TooltipWrapper + tooltipText={`Latest version: TODO ADD FIELD TO ENDPOINT`} + > + <div className="ts-cardpackage__footer__metaitem"> + <NewIcon csMode="inline" noWrapper> + <FontAwesomeIcon icon={faCodeBranch} /> + </NewIcon> + TODO + </div> + </TooltipWrapper> */} + <TooltipWrapper + tooltipText={`${numberWithSpaces( + packageData.rating_count + )} Upvotes`} + > + <NewMetaItem csSize="12"> + <NewIcon csMode="inline" noWrapper> + <FontAwesomeIcon icon={faThumbsUp} /> + </NewIcon> + {formatInteger(packageData.rating_count)} + </NewMetaItem> + </TooltipWrapper> + </div> + <span className="ts-cardpackage__footer__updatetext"> + Last updated: + <RelativeTime + time={packageData.last_updated} + suppressHydrationWarning + /> + </span> + </div> + </div> + </div> + ); +} + +CardPackage.displayName = "CardPackage"; diff --git a/packages/cyberstorm/src/newComponents/DropDown/DropDown.css b/packages/cyberstorm/src/newComponents/DropDown/DropDown.css index 29c242331..f889f2523 100644 --- a/packages/cyberstorm/src/newComponents/DropDown/DropDown.css +++ b/packages/cyberstorm/src/newComponents/DropDown/DropDown.css @@ -16,11 +16,16 @@ } .ts-dropdown > *:where(:not(.ts-dropdown__divider)) { + gap: var(--dropdown__item-gap); padding: var(--dropdown__item-padding); overflow: hidden; color: var(--dropdown__item-color); + font-weight: var(--dropdown__item-font-weight); + font-size: var(--dropdown__item-font-size); background-color: var(--dropdown__item-background-color); outline: none; + + --icon-color: var(--dropdown__item-icon-color); } .ts-dropdown > *:where(:not(.ts-dropdown__divider))[data-highlighted] { @@ -29,7 +34,6 @@ .ts-dropdown__divider { height: var(--dropdown__divider-height); - margin: var(--dropdown__divider-margin); background-color: var(--dropdown__divider-background-color); } } diff --git a/packages/cyberstorm/src/newComponents/DropDown/DropDown.tsx b/packages/cyberstorm/src/newComponents/DropDown/DropDown.tsx index 19db4a5d2..a710e9c40 100644 --- a/packages/cyberstorm/src/newComponents/DropDown/DropDown.tsx +++ b/packages/cyberstorm/src/newComponents/DropDown/DropDown.tsx @@ -1,6 +1,5 @@ import "./DropDown.css"; import { ReactNode, ReactElement } from "react"; -// import styles from "./DropDown.module.css"; import { Root, diff --git a/packages/cyberstorm/src/newComponents/Image/Image.css b/packages/cyberstorm/src/newComponents/Image/Image.css index d3e11842f..f7ae84635 100644 --- a/packages/cyberstorm/src/newComponents/Image/Image.css +++ b/packages/cyberstorm/src/newComponents/Image/Image.css @@ -1,5 +1,6 @@ @layer components { .ts-image { + width: inherit; object-fit: cover; aspect-ratio: var(--aspect-ratio); } @@ -24,12 +25,15 @@ justify-content: center; border-radius: var(--radius-md); overflow: hidden; - color: var(--image__wrapper-color); - background-color: var(--image__wrapper-bg-color); transition: var(--animation-duration-sm) ease-out; aspect-ratio: var(--aspect-ratio); } + .ts-image__wrapper--noimage { + color: var(--image__wrapper-color); + background-color: var(--image__wrapper-bg-color); + } + .ts-image__content { display: flex; align-items: center; diff --git a/packages/cyberstorm/src/newComponents/Image/Image.tsx b/packages/cyberstorm/src/newComponents/Image/Image.tsx index 95dbe8250..5a5161629 100644 --- a/packages/cyberstorm/src/newComponents/Image/Image.tsx +++ b/packages/cyberstorm/src/newComponents/Image/Image.tsx @@ -17,6 +17,8 @@ interface ImageProps extends Omit<FrameWindowProps, "primitiveType"> { /** Force 1:1 aspect ratio */ square?: boolean; csVariant?: ImageVariants; + intrinsicWidth?: number; + intrinsicHeight?: number; } // TODO: Needs a storybook story @@ -32,6 +34,8 @@ export const Image = React.forwardRef<HTMLDivElement, ImageProps>( rootClasses, square = false, csVariant = "primary", + intrinsicWidth, + intrinsicHeight, ...forwardedProps } = props; const fProps = forwardedProps as ImageProps; @@ -42,6 +46,7 @@ export const Image = React.forwardRef<HTMLDivElement, ImageProps>( primitiveType="window" rootClasses={classnames( "ts-image__wrapper", + src ? undefined : "ts-image__wrapper--noimage", ...componentClasses(csVariant, undefined, undefined), rootClasses, square ? "ts-image--issquare" : "ts-image--is3by4" diff --git a/packages/cyberstorm/src/newComponents/Link/Link/Link.tsx b/packages/cyberstorm/src/newComponents/Link/Link/Link.tsx index 35584a5ae..f25774d1d 100644 --- a/packages/cyberstorm/src/newComponents/Link/Link/Link.tsx +++ b/packages/cyberstorm/src/newComponents/Link/Link/Link.tsx @@ -25,7 +25,11 @@ export const Link = React.forwardRef< <Actionable {...forwardedProps} rootClasses={classnames( - csVariant === "primary" ? "ts-link ts-variant--primary" : "ts-link", + csVariant === "primary" + ? "ts-link ts-variant--primary" + : csVariant === "cyber" + ? "ts-link ts-variant--cyber" + : "ts-link", rootClasses )} ref={forwardedRef} diff --git a/packages/cyberstorm/src/newComponents/Link/LinkButton/Button.css b/packages/cyberstorm/src/newComponents/Link/LinkButton/Button.css deleted file mode 100644 index ebd9eae46..000000000 --- a/packages/cyberstorm/src/newComponents/Link/LinkButton/Button.css +++ /dev/null @@ -1,26 +0,0 @@ -@layer components { - .ts-button { - display: flex; - flex: none; - flex-direction: row; - gap: var(--button-gap); - align-items: center; - - height: var(--button-height); - - padding: var(--button-padding); - - border: var(--button-border); - border-color: var(--button-border-color); - border-radius: var(--button-border-radius); - color: var(--button-text-color); - - font-weight: var(--button-font-weight); - font-size: var(--button-font-size); - line-height: var(--button-line-height); - - text-align: center; - background-color: var(--button-background-color); - user-select: none; - } -} diff --git a/packages/cyberstorm/src/newComponents/Link/LinkButton/LinkButton.tsx b/packages/cyberstorm/src/newComponents/Link/LinkButton/LinkButton.tsx deleted file mode 100644 index e643d0cb3..000000000 --- a/packages/cyberstorm/src/newComponents/Link/LinkButton/LinkButton.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import { - Actionable, - ActionableCyberstormLinkProps, - ActionableLinkProps, -} from "../../../primitiveComponents/Actionable/Actionable"; -import React from "react"; -import { classnames, componentClasses } from "../../../utils/utils"; -import { - ButtonVariants, - ButtonSizes, - ButtonModifiers, -} from "@thunderstore/cyberstorm-theme/src/components"; - -interface LinkButtonProps extends ActionableLinkProps { - csVariant?: ButtonVariants; - csSize?: ButtonSizes; - csModifiers?: ButtonModifiers[]; -} - -interface CyberstormLinkButtonProps extends ActionableCyberstormLinkProps { - csVariant?: ButtonVariants; - csSize?: ButtonSizes; - csModifiers?: ButtonModifiers[]; -} - -// TODO: Add style support for disabled -export const LinkButton = React.forwardRef< - HTMLAnchorElement, - LinkButtonProps | CyberstormLinkButtonProps ->((props: LinkButtonProps | CyberstormLinkButtonProps, forwardedRef) => { - const { - children, - rootClasses, - csVariant = "primary", - csSize = "meedium", - csModifiers, - ...forwardedProps - } = props; - - return ( - <Actionable - {...forwardedProps} - rootClasses={classnames( - "ts-button", - ...componentClasses(csVariant, csSize, csModifiers), - rootClasses - )} - ref={forwardedRef} - > - {children} - </Actionable> - ); -}); - -LinkButton.displayName = "LinkButton"; diff --git a/packages/cyberstorm/src/newComponents/Menu/Menu.css b/packages/cyberstorm/src/newComponents/Menu/Menu.css index ba25f486e..c9a25e5a5 100644 --- a/packages/cyberstorm/src/newComponents/Menu/Menu.css +++ b/packages/cyberstorm/src/newComponents/Menu/Menu.css @@ -7,7 +7,8 @@ background: transparent; transform: translateX(-100%); - transition: transform var(--animation-duration-sm), + transition: + transform var(--animation-duration-sm), display var(--animation-duration-sm) allow-discrete; &:popover-open { diff --git a/packages/cyberstorm/src/newComponents/Menu/Menu.tsx b/packages/cyberstorm/src/newComponents/Menu/Menu.tsx index 5aba92f7e..1e1fddcc4 100644 --- a/packages/cyberstorm/src/newComponents/Menu/Menu.tsx +++ b/packages/cyberstorm/src/newComponents/Menu/Menu.tsx @@ -50,7 +50,7 @@ export function Menu(props: Props) { popovertargetaction: "close", }} csVariant="secondary" - csModifiers={["ghost", "dimmed"]} + csModifiers={["ghost"]} tooltipText="Close" aria-label="Close" icon={faXmark} diff --git a/packages/cyberstorm/src/newComponents/MetaItem/MetaItem.css b/packages/cyberstorm/src/newComponents/MetaItem/MetaItem.css new file mode 100644 index 000000000..cc881b78c --- /dev/null +++ b/packages/cyberstorm/src/newComponents/MetaItem/MetaItem.css @@ -0,0 +1,17 @@ +@layer components { + .ts-metaitem { + display: inline-flex; + gap: var(--metaitem-gap); + align-items: center; + color: var(--metaitem-color); + font-weight: var(--metaitem-font-weight); + font-size: var(--metaitem-font-size); + + > svg { + width: var(--metaitem-icon-width); + height: var(--metaitem-icon-height); + + --icon-color: var(--metaitem-icon-color); + } + } +} diff --git a/packages/cyberstorm/src/newComponents/MetaItem/MetaItem.tsx b/packages/cyberstorm/src/newComponents/MetaItem/MetaItem.tsx new file mode 100644 index 000000000..8bcf25578 --- /dev/null +++ b/packages/cyberstorm/src/newComponents/MetaItem/MetaItem.tsx @@ -0,0 +1,42 @@ +import "./MetaItem.css"; +import React from "react"; +import { Frame, FrameWindowProps } from "../../primitiveComponents/Frame/Frame"; +import { classnames, componentClasses } from "../../utils/utils"; +import { + MetaItemSizes, + MetaItemVariants, +} from "@thunderstore/cyberstorm-theme/src/components"; + +interface MetaItemProps extends Omit<FrameWindowProps, "primitiveType"> { + csVariant?: MetaItemVariants; + csSize?: MetaItemSizes; +} + +export const MetaItem = React.forwardRef<HTMLDivElement, MetaItemProps>( + (props: MetaItemProps, forwardedRef) => { + const { + children, + csVariant = "default", + csSize = "16", + rootClasses, + ...forwardedProps + } = props; + + return ( + <Frame + {...forwardedProps} + primitiveType={"window"} + rootClasses={classnames( + "ts-metaitem", + ...componentClasses(csVariant, csSize), + rootClasses + )} + ref={forwardedRef} + > + {children} + </Frame> + ); + } +); + +MetaItem.displayName = "MetaItem"; diff --git a/packages/cyberstorm/src/newComponents/Modal/Modal.css b/packages/cyberstorm/src/newComponents/Modal/Modal.css index 8db2b38b1..7501eeb37 100644 --- a/packages/cyberstorm/src/newComponents/Modal/Modal.css +++ b/packages/cyberstorm/src/newComponents/Modal/Modal.css @@ -6,6 +6,7 @@ border: 1px solid var(--color-6); border-radius: var(--frame-modal-border-radius); background: var(--color-2); + box-shadow: var(--shadow-lg); transform: translate(-50%, -50%); } diff --git a/packages/cyberstorm/src/newComponents/Pagination/Pagination.css b/packages/cyberstorm/src/newComponents/Pagination/Pagination.css new file mode 100644 index 000000000..1f2669db4 --- /dev/null +++ b/packages/cyberstorm/src/newComponents/Pagination/Pagination.css @@ -0,0 +1,31 @@ +/* List */ +.ts-pagination { + display: flex; + flex-flow: row wrap; + gap: var(--pagination-gap); + align-items: center; + justify-content: center; + padding-top: 4.5rem; + list-style: none; +} + +.ts-pagination--disabled { + pointer-events: none; +} + +/* Item */ +.ts-pagination__item { + display: inline-flex; + flex-shrink: 0; + gap: var(--gap-xs); + align-items: center; + justify-content: center; + min-width: var(--pagination-item-height); + height: var(--pagination-item-height); + padding: var(--pagination-item-padding); + + border-radius: var(--pagination-item-border-radius); + color: var(--pagination-item-text-color); + font-weight: var(--pagination-item-font-weight); + background: var(--pagination-item-background); +} diff --git a/packages/cyberstorm/src/newComponents/Pagination/Pagination.tsx b/packages/cyberstorm/src/newComponents/Pagination/Pagination.tsx new file mode 100644 index 000000000..b66247969 --- /dev/null +++ b/packages/cyberstorm/src/newComponents/Pagination/Pagination.tsx @@ -0,0 +1,144 @@ +import "./Pagination.css"; +import { faArrowLeft, faArrowRight } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { classnames, range } from "../../utils/utils"; +import React from "react"; +import { Actionable } from "../../primitiveComponents/Actionable/Actionable"; +import { NewIcon } from "../.."; + +export interface PaginationProps { + currentPage: number; + onPageChange: (v: number) => void; + totalCount: number; + pageSize: number; + siblingCount: number; +} + +export const Pagination = React.forwardRef<HTMLElement, PaginationProps>( + (props: PaginationProps, forwardedRef) => { + const { + currentPage, + onPageChange, + totalCount, + pageSize, + siblingCount = 4, + } = props; + + if (totalCount === 0) { + return null; + } + + const totalPageCount = Math.ceil( + totalCount / (pageSize > 0 ? pageSize : 1) + ); + + const buttons = []; + + const leftmostSibling = Math.max(currentPage - siblingCount, 1); + const rightmostSibling = Math.min( + currentPage + siblingCount, + totalPageCount + ); + + // START Add buttons + if (currentPage > 1) { + buttons.push( + <Actionable + key="page-previous" + primitiveType="button" + onClick={() => onPageChange(decreaseCurrentPage(currentPage))} + rootClasses="ts-pagination__item" + > + <NewIcon csMode="inline" noWrapper> + <FontAwesomeIcon icon={faArrowLeft} /> + </NewIcon> + Prev + </Actionable> + ); + } + if (leftmostSibling > 1) { + buttons.push( + <Actionable + key="page-1" + primitiveType="button" + onClick={() => onPageChange(1)} + rootClasses="ts-pagination__item" + > + 1 + </Actionable> + ); + } + range(leftmostSibling, rightmostSibling).forEach((pageNumber) => { + buttons.push( + <Actionable + key={`page-${pageNumber}`} + primitiveType="button" + onClick={() => onPageChange(pageNumber)} + rootClasses={classnames( + "ts-pagination__item", + currentPage === pageNumber + ? "ts-pagination__item--selected" + : undefined + )} + > + {(pageNumber === leftmostSibling && + currentPage !== leftmostSibling && + leftmostSibling > 1) || + (pageNumber === rightmostSibling && + currentPage !== rightmostSibling && + rightmostSibling < totalPageCount) + ? "…" + : pageNumber} + </Actionable> + ); + }); + if (rightmostSibling < totalPageCount) { + buttons.push( + <Actionable + key={`page-${totalPageCount}`} + primitiveType="button" + onClick={() => onPageChange(totalPageCount)} + rootClasses="ts-pagination__item" + > + {totalPageCount} + </Actionable> + ); + } + if (currentPage !== totalPageCount) { + buttons.push( + <Actionable + key="page-next" + primitiveType="button" + onClick={() => + onPageChange(increaseCurrentPage(currentPage, totalPageCount)) + } + rootClasses="ts-pagination__item" + > + Next + <NewIcon csMode="inline" noWrapper> + <FontAwesomeIcon icon={faArrowRight} /> + </NewIcon> + </Actionable> + ); + } + // END Add buttons + + return ( + <nav aria-label="Pagination" ref={forwardedRef} className="ts-pagination"> + {buttons} + </nav> + ); + } +); + +Pagination.displayName = "Pagination"; + +function decreaseCurrentPage(currentPage: number) { + const newPage = currentPage - 1; + return newPage > 0 ? newPage : 1; +} + +function increaseCurrentPage(currentPage: number, totalPageCount: number) { + const newPage = currentPage + 1; + return newPage <= totalPageCount ? newPage : totalPageCount; +} diff --git a/packages/cyberstorm/src/newComponents/Select/Select.css b/packages/cyberstorm/src/newComponents/Select/Select.css index 756cd9a6e..0b9584dba 100644 --- a/packages/cyberstorm/src/newComponents/Select/Select.css +++ b/packages/cyberstorm/src/newComponents/Select/Select.css @@ -33,6 +33,7 @@ } .ts-select__trigger { + width: 100%; font-weight: var(--select__trigger-font-weight); font-size: var(--select__trigger-font-size); @@ -40,10 +41,4 @@ margin-left: auto; } } - - .ts-select__item__icon { - width: 1em; - - --icon-color: var(--select__item__icon-color); - } } diff --git a/packages/cyberstorm/src/newComponents/Select/Select.tsx b/packages/cyberstorm/src/newComponents/Select/Select.tsx index b4d6372f0..8690b9242 100644 --- a/packages/cyberstorm/src/newComponents/Select/Select.tsx +++ b/packages/cyberstorm/src/newComponents/Select/Select.tsx @@ -42,7 +42,6 @@ type _SelectProps<T extends string = string> = { export type SelectProps<T extends string = string> = _SelectProps<T> & Omit<React.HTMLProps<HTMLDivElement>, keyof _SelectProps<T>>; -// TODO: COLOR SYSTEM IMPLEMENTATION IS MISSING IN CSS // TODO: Rework to use regular select preferrably // or atleast ensure a11y stuff works export function Select<T extends string>(props: SelectProps<T>) { @@ -131,7 +130,7 @@ const mapSelectData = ( ...componentClasses(csVariant, csSize, csModifiers) )} > - <NewIcon csMode="inline" noWrapper rootClasses="ts-select__item__icon"> + <NewIcon csMode="inline" noWrapper> {option.leftIcon} </NewIcon> {option.label} diff --git a/packages/cyberstorm/src/newComponents/Tag/Tag.css b/packages/cyberstorm/src/newComponents/Tag/Tag.css index 91068bd50..3eff4a803 100644 --- a/packages/cyberstorm/src/newComponents/Tag/Tag.css +++ b/packages/cyberstorm/src/newComponents/Tag/Tag.css @@ -4,6 +4,7 @@ gap: var(--tag-gap); align-items: center; justify-content: center; + height: var(--tag-height); border-radius: var(--tag-border-radius); color: var(--tag-color); font-weight: var(--tag-font-weight); diff --git a/packages/cyberstorm/src/newComponents/Tag/Tag.tsx b/packages/cyberstorm/src/newComponents/Tag/Tag.tsx index f825ff206..8b7738b9a 100644 --- a/packages/cyberstorm/src/newComponents/Tag/Tag.tsx +++ b/packages/cyberstorm/src/newComponents/Tag/Tag.tsx @@ -7,39 +7,91 @@ import { TagSizes, TagVariants, } from "@thunderstore/cyberstorm-theme/src/components"; +import { + Actionable, + ActionableButtonProps, + ActionableLinkProps, +} from "../../primitiveComponents/Actionable/Actionable"; -interface TagProps extends Omit<FrameWindowProps, "primitiveType"> { +interface TagProps + extends Omit< + FrameWindowProps | ActionableButtonProps | ActionableLinkProps, + "primitiveType" + > { + csMode?: "tag" | "button" | "link"; + href?: string; csVariant?: TagVariants; csSize?: TagSizes; csModifiers?: TagModifiers[]; } -export const Tag = React.forwardRef<HTMLDivElement, TagProps>( - (props: TagProps, forwardedRef) => { - const { - children, - rootClasses, - csVariant = "primary", - csSize = "medium", - csModifiers, - ...forwardedProps - } = props; - const fProps = forwardedProps as FrameWindowProps; +export const Tag = React.forwardRef< + HTMLDivElement | HTMLButtonElement | HTMLAnchorElement, + TagProps +>((props: TagProps, forwardedRef) => { + const { + csMode = "tag", + children, + rootClasses, + csVariant = "primary", + csSize = "medium", + csModifiers, + ...forwardedProps + } = props; + + if (csMode === "button") { + const fProps = forwardedProps as ActionableButtonProps; + const fRef = forwardedRef as React.ForwardedRef<HTMLButtonElement>; return ( - <Frame + <Actionable {...fProps} - primitiveType={"window"} + primitiveType={"button"} rootClasses={classnames( "ts-tag", ...componentClasses(csVariant, csSize, csModifiers), rootClasses )} - ref={forwardedRef} + ref={fRef} > {children} - </Frame> + </Actionable> ); } -); + + if (csMode === "link") { + const fProps = forwardedProps as ActionableLinkProps; + const fRef = forwardedRef as React.ForwardedRef<HTMLAnchorElement>; + return ( + <Actionable + {...fProps} + primitiveType={"link"} + rootClasses={classnames( + "ts-tag", + ...componentClasses(csVariant, csSize, csModifiers), + rootClasses + )} + ref={fRef} + > + {children} + </Actionable> + ); + } + + const fProps = forwardedProps as FrameWindowProps; + return ( + <Frame + {...fProps} + primitiveType={"window"} + rootClasses={classnames( + "ts-tag", + ...componentClasses(csVariant, csSize, csModifiers), + rootClasses + )} + ref={forwardedRef} + > + {children} + </Frame> + ); +}); Tag.displayName = "Tag"; diff --git a/packages/cyberstorm/src/newComponents/TextInput/TextInput.css b/packages/cyberstorm/src/newComponents/TextInput/TextInput.css index 69bca9df1..3eb2d3650 100644 --- a/packages/cyberstorm/src/newComponents/TextInput/TextInput.css +++ b/packages/cyberstorm/src/newComponents/TextInput/TextInput.css @@ -18,6 +18,7 @@ flex-direction: row; align-items: center; width: var(--textinput-width); + height: var(--textinput-height); padding: var(--textinput-padding); border: var(--textinput-border); border-color: var(--textinput-border-color); @@ -40,14 +41,17 @@ .ts-textinput__lefticon { position: var(--ts-textinput__lefticon-position); margin: var(--ts-textinput__lefticon-margin); - color: var(--ts-textinput__lefticon-color); + + --icon-color: var(--ts-textinput__lefticon-color); + pointer-events: none; } .ts-textinput__righticon { position: var(--ts-textinput__righticon-position); padding: var(--ts-textinput__righticon-padding); - color: var(--ts-textinput__righticon-color); + + --icon-color: var(--ts-textinput__righticon-color); } .ts-textinput__clearvaluebutton { diff --git a/packages/cyberstorm/src/newComponents/TextInput/TextInput.tsx b/packages/cyberstorm/src/newComponents/TextInput/TextInput.tsx index dc5b5b105..4a2faec3c 100644 --- a/packages/cyberstorm/src/newComponents/TextInput/TextInput.tsx +++ b/packages/cyberstorm/src/newComponents/TextInput/TextInput.tsx @@ -7,7 +7,7 @@ import { import { classnames, componentClasses } from "../../utils/utils"; import { Frame } from "../../primitiveComponents/Frame/Frame"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { faXmark } from "@fortawesome/free-solid-svg-icons"; +import { faXmarkLarge } from "@fortawesome/pro-solid-svg-icons"; import { Actionable } from "../../primitiveComponents/Actionable/Actionable"; import { NewIcon } from "../.."; import { @@ -92,7 +92,7 @@ export const TextInput = React.forwardRef<HTMLInputElement, TextInputProps>( aria-label="Clear search input" > <NewIcon csMode="inline" noWrapper> - <FontAwesomeIcon icon={faXmark} /> + <FontAwesomeIcon icon={faXmarkLarge} /> </NewIcon> </Actionable> ) : null} diff --git a/packages/cyberstorm/src/primitiveComponents/Actionable/Actionable.tsx b/packages/cyberstorm/src/primitiveComponents/Actionable/Actionable.tsx index 318414587..cd94a920e 100644 --- a/packages/cyberstorm/src/primitiveComponents/Actionable/Actionable.tsx +++ b/packages/cyberstorm/src/primitiveComponents/Actionable/Actionable.tsx @@ -9,7 +9,7 @@ import { PrimitiveComponentDefaultProps, TooltipWrapper } from "../utils/utils"; export interface ActionableButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, PrimitiveComponentDefaultProps { - primitiveType: "button"; + primitiveType?: "button"; } export interface ActionableLinkProps @@ -47,7 +47,7 @@ export const Actionable = React.forwardRef< ...forwardedProps } = props; - if (primitiveType === "button") { + if (primitiveType === "button" || primitiveType === undefined) { const fRef = forwardedRef as React.ForwardedRef<HTMLButtonElement>; const fProps = forwardedProps as ActionableButtonProps; diff --git a/packages/dapper-fake/src/fakers/community.ts b/packages/dapper-fake/src/fakers/community.ts index 10c43bc08..3cf5acc5a 100644 --- a/packages/dapper-fake/src/fakers/community.ts +++ b/packages/dapper-fake/src/fakers/community.ts @@ -15,10 +15,12 @@ export const getFakeCommunity = async (communityId: string) => { return { name: faker.word.words(3), identifier: communityId, + short_description: faker.helpers.maybe(() => faker.word.words(5)) ?? null, description: faker.helpers.maybe(() => faker.word.words(5)) ?? null, + wiki_url: faker.helpers.maybe(() => faker.internet.url()) ?? null, discord_url: faker.helpers.maybe(() => faker.internet.url()) ?? null, datetime_created: faker.date.past().toISOString(), - background_image_url: + hero_image_url: faker.helpers.maybe(() => getFakeImg(1080, 492), { probability: 0.9 }) ?? null, icon_url: diff --git a/packages/dapper-ts/src/methods/communities.ts b/packages/dapper-ts/src/methods/communities.ts index 6e6db410c..45625a7f2 100644 --- a/packages/dapper-ts/src/methods/communities.ts +++ b/packages/dapper-ts/src/methods/communities.ts @@ -11,10 +11,12 @@ import { formatErrorMessage } from "../utils"; const communitySchema = z.object({ name: z.string().nonempty(), identifier: z.string().nonempty(), + short_description: z.string().nullable(), description: z.string().nullable(), + wiki_url: z.string().nullable(), discord_url: z.string().nullable(), datetime_created: z.string().datetime(), - background_image_url: z.string().url().nullable(), + hero_image_url: z.string().url().nullable(), cover_image_url: z.string().url().nullable(), icon_url: z.string().url().nullable(), total_download_count: z.number().int(), diff --git a/packages/dapper-ts/src/methods/packageListings.ts b/packages/dapper-ts/src/methods/packageListings.ts index 397660329..6addbc9e3 100644 --- a/packages/dapper-ts/src/methods/packageListings.ts +++ b/packages/dapper-ts/src/methods/packageListings.ts @@ -41,13 +41,7 @@ export async function getPackageListings( excludedCategories: string[] = [], section = "", nsfw = false, - deprecated = false, - created_recent = "", - updated_recent = "", - created_after = "", - created_before = "", - updated_after = "", - updated_before = "" + deprecated = false ) { const options: PackageListingQueryParams = { ordering, @@ -58,12 +52,6 @@ export async function getPackageListings( section, nsfw, deprecated, - created_recent, - updated_recent, - created_after, - created_before, - updated_after, - updated_before, }; let data; diff --git a/packages/dapper/src/types/community.ts b/packages/dapper/src/types/community.ts index 6dd713dfd..7dfe4ff7f 100644 --- a/packages/dapper/src/types/community.ts +++ b/packages/dapper/src/types/community.ts @@ -3,10 +3,12 @@ import { PackageCategory, PaginatedList } from "./shared"; export interface Community { name: string; identifier: string; + short_description: string | null; description: string | null; + wiki_url: string | null; discord_url: string | null; datetime_created: string; - background_image_url: string | null; + hero_image_url: string | null; cover_image_url: string | null; icon_url: string | null; total_download_count: number; diff --git a/packages/thunderstore-api/src/apiFetch.ts b/packages/thunderstore-api/src/apiFetch.ts index b6f0e0a0a..166bae2de 100644 --- a/packages/thunderstore-api/src/apiFetch.ts +++ b/packages/thunderstore-api/src/apiFetch.ts @@ -5,6 +5,36 @@ const BASE_HEADERS = { "Content-Type": "application/json", }; +const MAX_NB_RETRY = 5; +const RETRY_DELAY_MS = 200; + +async function fetchRetry( + input: RequestInfo | URL, + init?: RequestInit | undefined +) { + let retryLeft = MAX_NB_RETRY; + let latestErr = null; + while (retryLeft > 0) { + try { + return await fetch(input, init); + } catch (err) { + latestErr = err; + await sleep(RETRY_DELAY_MS); + } finally { + retryLeft -= 1; + } + } + if (latestErr !== null) { + throw latestErr; + } else { + throw new Error(`Too many retries`); + } +} + +function sleep(delay: number) { + return new Promise((resolve) => setTimeout(resolve, delay)); +} + export type apiFetchArgs = { config: RequestConfig; path: string; @@ -19,7 +49,7 @@ export async function apiFetch2(args: apiFetchArgs) { : { apiHost: config.apiHost, csrfToken: undefined, sessionId: undefined }; const url = getUrl(usedConfig, path, query); - const response = await fetch(url, { + const response = await fetchRetry(url, { ...(request ?? {}), headers: { ...BASE_HEADERS, diff --git a/packages/thunderstore-api/src/fetch/communityPackageListings.ts b/packages/thunderstore-api/src/fetch/communityPackageListings.ts index 3d665a77b..145b8464f 100644 --- a/packages/thunderstore-api/src/fetch/communityPackageListings.ts +++ b/packages/thunderstore-api/src/fetch/communityPackageListings.ts @@ -19,12 +19,6 @@ export async function fetchCommunityPackageListings( { key: "section", value: options?.section }, { key: "nsfw", value: options?.nsfw, impotent: false }, { key: "deprecated", value: options?.deprecated, impotent: false }, - { key: "created_recent", value: options?.created_recent }, - { key: "updated_recent", value: options?.updated_recent }, - { key: "created_after", value: options?.created_after }, - { key: "created_before", value: options?.created_before }, - { key: "updated_after", value: options?.updated_after }, - { key: "updated_before", value: options?.updated_before }, ]; const query = serializeQueryString(queryParams); diff --git a/packages/thunderstore-api/src/fetch/namespacePackageListings.ts b/packages/thunderstore-api/src/fetch/namespacePackageListings.ts index d8897c1ab..1e388ca03 100644 --- a/packages/thunderstore-api/src/fetch/namespacePackageListings.ts +++ b/packages/thunderstore-api/src/fetch/namespacePackageListings.ts @@ -20,12 +20,6 @@ export async function fetchNamespacePackageListings( { key: "section", value: options?.section }, { key: "nsfw", value: options?.nsfw, impotent: false }, { key: "deprecated", value: options?.deprecated, impotent: false }, - { key: "created_recent", value: options?.created_recent }, - { key: "updated_recent", value: options?.updated_recent }, - { key: "created_after", value: options?.created_after }, - { key: "created_before", value: options?.created_before }, - { key: "updated_after", value: options?.updated_after }, - { key: "updated_before", value: options?.updated_before }, ]; const query = serializeQueryString(queryParams); diff --git a/packages/thunderstore-api/src/fetch/packageDependantsListings.ts b/packages/thunderstore-api/src/fetch/packageDependantsListings.ts index 7636b8ebb..ccfb2bdfb 100644 --- a/packages/thunderstore-api/src/fetch/packageDependantsListings.ts +++ b/packages/thunderstore-api/src/fetch/packageDependantsListings.ts @@ -24,12 +24,6 @@ export async function fetchPackageDependantsListings( { key: "section", value: options?.section }, { key: "nsfw", value: options?.nsfw, impotent: false }, { key: "deprecated", value: options?.deprecated, impotent: false }, - { key: "created_recent", value: options?.created_recent }, - { key: "updated_recent", value: options?.updated_recent }, - { key: "created_after", value: options?.created_after }, - { key: "created_before", value: options?.created_before }, - { key: "updated_after", value: options?.updated_after }, - { key: "updated_before", value: options?.updated_before }, ]; const query = serializeQueryString(queryParams); diff --git a/packages/thunderstore-api/src/types/index.ts b/packages/thunderstore-api/src/types/index.ts index 68fd98466..aa49a599d 100644 --- a/packages/thunderstore-api/src/types/index.ts +++ b/packages/thunderstore-api/src/types/index.ts @@ -23,16 +23,5 @@ export interface PackageListingQueryParams { nsfw: boolean; /** Should deprecated packages be included (by default they're not) */ deprecated: boolean; - // Amount of days that the package must be created on or after - created_recent: string; - // Amount of days that the package must be updated on or after - updated_recent: string; - // Date that the package must be created ON or AFTER - created_after: string; - // Date that the package must be created ON or BEFORE - created_before: string; - // Date when the package has to been last updated ON or AFTER - updated_after: string; - // Date when the package has to been last updated ON or BEFORE - updated_before: string; + // Disabled until the UX for date filtering is resolved } diff --git a/packages/ts-api-react-actions/src/ApiAction.tsx b/packages/ts-api-react-actions/src/ApiAction.tsx index 0d3089888..ca5274226 100644 --- a/packages/ts-api-react-actions/src/ApiAction.tsx +++ b/packages/ts-api-react-actions/src/ApiAction.tsx @@ -8,7 +8,7 @@ export interface ApiActionProps< Schema extends ZodObject<Z>, Meta extends object, Result extends object, - Z extends ZodRawShape + Z extends ZodRawShape, > { schema: Schema; endpoint: ApiEndpoint<z.infer<Schema>, Meta, Result>; @@ -21,7 +21,7 @@ export function ApiAction< Schema extends ZodObject<Z>, Meta extends object, Result extends object, - Z extends ZodRawShape + Z extends ZodRawShape, >(props: ApiActionProps<Schema, Meta, Result, Z>) { const { meta, endpoint, onSubmitSuccess, onSubmitError } = props; const submitHandler = useApiAction({ diff --git a/packages/ts-api-react-actions/src/useApiAction.ts b/packages/ts-api-react-actions/src/useApiAction.ts index b22925e09..f608660e2 100644 --- a/packages/ts-api-react-actions/src/useApiAction.ts +++ b/packages/ts-api-react-actions/src/useApiAction.ts @@ -5,7 +5,7 @@ export type UseApiActionArgs< Schema extends ZodObject<Z>, Meta extends object, Result extends object, - Z extends ZodRawShape + Z extends ZodRawShape, > = { meta: Meta; endpoint: ApiEndpoint<z.infer<Schema>, Meta, Result>; @@ -14,7 +14,7 @@ export function useApiAction< Schema extends ZodObject<Z>, Meta extends object, Result extends object, - Z extends ZodRawShape + Z extends ZodRawShape, >(args: UseApiActionArgs<Schema, Meta, Result, Z>) { const { meta, endpoint } = args; const apiCall = useApiCall(endpoint); diff --git a/packages/ts-api-react-forms/src/ApiForm.tsx b/packages/ts-api-react-forms/src/ApiForm.tsx index fdbadfb25..213ff7a85 100644 --- a/packages/ts-api-react-forms/src/ApiForm.tsx +++ b/packages/ts-api-react-forms/src/ApiForm.tsx @@ -11,7 +11,7 @@ export type ApiFormProps< Schema extends ZodObject<Z>, Meta extends object, Result extends object, - Z extends ZodRawShape + Z extends ZodRawShape, > = { schema: Schema; endpoint: ApiEndpoint<z.infer<Schema>, Meta, Result>; @@ -24,7 +24,7 @@ export function ApiForm< Schema extends ZodObject<Z>, Meta extends object, Result extends object, - Z extends ZodRawShape + Z extends ZodRawShape, >(props: PropsWithChildren<ApiFormProps<Schema, Meta, Result, Z>>) { const { schema, meta, endpoint, onSubmitSuccess, onSubmitError } = props; const { form, submitHandler } = useApiForm({ diff --git a/packages/ts-api-react-forms/src/errors.ts b/packages/ts-api-react-forms/src/errors.ts index 96fb0858b..5b64e8f47 100644 --- a/packages/ts-api-react-forms/src/errors.ts +++ b/packages/ts-api-react-forms/src/errors.ts @@ -14,7 +14,7 @@ export function getErrorFormKey<T extends ZodObject<Z>, Z extends ZodRawShape>( export function handleFormApiErrors< Schema extends ZodObject<Z>, - Z extends ZodRawShape + Z extends ZodRawShape, >( error: Error | ApiError | unknown, schema: Schema, diff --git a/packages/ts-api-react-forms/src/useApiForm.ts b/packages/ts-api-react-forms/src/useApiForm.ts index ee72b0714..d01378e55 100644 --- a/packages/ts-api-react-forms/src/useApiForm.ts +++ b/packages/ts-api-react-forms/src/useApiForm.ts @@ -8,7 +8,7 @@ export type UseApiFormArgs< Schema extends ZodObject<Z>, Meta extends object, Result extends object, - Z extends ZodRawShape + Z extends ZodRawShape, > = { schema: Schema; meta: Meta; @@ -17,7 +17,7 @@ export type UseApiFormArgs< export type UseApiFormReturn< Schema extends ZodObject<Z>, Result extends object, - Z extends ZodRawShape + Z extends ZodRawShape, > = { form: UseFormReturn<z.infer<Schema>>; submitHandler: (data: z.infer<Schema>) => Promise<Result>; @@ -26,7 +26,7 @@ export function useApiForm< Schema extends ZodObject<Z>, Meta extends object, Result extends object, - Z extends ZodRawShape + Z extends ZodRawShape, >( args: UseApiFormArgs<Schema, Meta, Result, Z> ): UseApiFormReturn<Schema, Result, Z> { diff --git a/packages/ts-api-react/src/SessionContext.tsx b/packages/ts-api-react/src/SessionContext.tsx index 80830bfcc..d23ce7b99 100644 --- a/packages/ts-api-react/src/SessionContext.tsx +++ b/packages/ts-api-react/src/SessionContext.tsx @@ -165,7 +165,7 @@ const useValidateSession = ( /** Session id if it's valid, otherwise undefined */ string | undefined, /** Session id if it's valid, otherwise undefined */ - string | undefined + string | undefined, ] => { const [isValid, setIsValid] = useState<boolean>(); const stateSessionId = _session?.sessionId; diff --git a/tools/cyberstorm-playwright/tests/communitie.spec.ts b/tools/cyberstorm-playwright/tests/communities.spec.ts similarity index 100% rename from tools/cyberstorm-playwright/tests/communitie.spec.ts rename to tools/cyberstorm-playwright/tests/communities.spec.ts diff --git a/tools/cyberstorm-playwright/tests/community.spec.ts b/tools/cyberstorm-playwright/tests/community.spec.ts new file mode 100644 index 000000000..a7091eec9 --- /dev/null +++ b/tools/cyberstorm-playwright/tests/community.spec.ts @@ -0,0 +1,10 @@ +// import { test, expect } from "@chromatic-com/playwright"; +import { test } from "@playwright/test"; + +import percySnapshot from "@percy/playwright"; + +test("community page", async ({ page }) => { + await page.goto("http://localhost:3000/c/riskofrain2"); + // await expect(page).toHaveScreenshot({ fullPage: true }); + await percySnapshot(page, "Community"); +}); diff --git a/tools/visual-diff-backend/docker-compose.yml b/tools/visual-diff-backend/docker-compose.yml index 8efe1300d..1b3bb52a2 100644 --- a/tools/visual-diff-backend/docker-compose.yml +++ b/tools/visual-diff-backend/docker-compose.yml @@ -1,7 +1,7 @@ version: "3.8" x-django-service: &django-service - image: ${DJANGO_IMAGE:-thunderstore/thunderstore:release-0.130.0} + image: ${DJANGO_IMAGE:-thunderstore/thunderstore:release-0.136.0} environment: CORS_ALLOWED_ORIGINS: "*" CELERY_BROKER_URL: "pyamqp://django:django@rabbitmq/django" diff --git a/yarn.lock b/yarn.lock index a96cbe9d2..0c8b9ec8c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1684,6 +1684,13 @@ dependencies: "@fortawesome/fontawesome-common-types" "6.6.0" +"@fortawesome/pro-solid-svg-icons@6.6.0": + version "6.6.0" + resolved "https://npm.fontawesome.com/@fortawesome/pro-solid-svg-icons/-/6.6.0/pro-solid-svg-icons-6.6.0.tgz#e4f99d9b674288c3d1ccbec27b37e008bd190ca1" + integrity sha512-IwYuyO+i681arIxOjPUoqRwoHeTqeg6i2s5rY2WbZ1R7PnwavOd1+aPHCJlfU2k8l5LZ+u3hAKlVqu+emQFlZg== + dependencies: + "@fortawesome/fontawesome-common-types" "6.6.0" + "@fortawesome/react-fontawesome@^0.2.2": version "0.2.2" resolved "https://npm.fontawesome.com/@fortawesome/react-fontawesome/-/0.2.2/react-fontawesome-0.2.2.tgz#68b058f9132b46c8599875f6a636dad231af78d4" @@ -12519,16 +12526,16 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" +prettier@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.0.tgz#c6d16474a5f764ea1a4a373c593b779697744d5e" + integrity sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw== + prettier@^2.7.1: version "2.8.8" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== -prettier@^3.3.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105" - integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew== - pretty-error@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-4.0.0.tgz#90a703f46dd7234adb46d0f84823e9d1cb8f10d6"