@rushstack/lockfile-explorer 0.1.8 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.html CHANGED
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Lockfile Explorer</title><link rel="stylesheet" href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-core/11.0.0/css/fabric.min.css"/><script defer="defer" src="initappcontext.js"></script><script defer="defer" src="414.f8e7585f91bc428fbe8e.js"></script><script defer="defer" src="app.f2224556a037be915214.js"></script><link href="app.1d93099dbf4344c15207.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Lockfile Explorer</title><link rel="stylesheet" href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-core/11.0.0/css/fabric.min.css"/><script defer="defer" src="initappcontext.js"></script><script defer="defer" src="714.039cce649b76617abe19.js"></script><script defer="defer" src="app.bd5d10e51ec1391e96d9.js"></script><link href="app.631c08041cc6ac4d8695.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
@@ -0,0 +1,2 @@
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"),require("react-dom"));else if("function"==typeof define&&define.amd)define("@rushstack/rush-themed-ui",["react","react-dom"],t);else{var n="object"==typeof exports?t(require("react"),require("react-dom")):t(e.react,e["react-dom"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,(function(e,t){return function(){"use strict";var n={156:function(t){t.exports=e},111:function(e){e.exports=t}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var a=r[e]={exports:{}};return n[e](a,a.exports,o),a.exports}o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return function(){o.r(a),o.d(a,{Button:function(){return r},Checkbox:function(){return at},Input:function(){return lt},ScrollArea:function(){return de},Tabs:function(){return Ve},Text:function(){return n}});var e=o(156),t=o.n(e);const n=({type:e,bold:n=!1,children:r,className:o,size:a})=>{const l=Object.assign({fontWeight:n?"bold":"normal"},a?{fontSize:a}:{});switch(e){case"h1":return t().createElement("h1",{className:`EEW4moi09VKPLYf_QQjc ${o||""}`,style:l},r);case"h2":return t().createElement("h2",{className:`J7ir6XIWo7jdiI2ntfcg ${o||""}`,style:l},r);case"h3":return t().createElement("h3",{className:`SWvmPuRvIE0SV9q04VZG ${o||""}`,style:l},r);case"h4":return t().createElement("h4",{className:`QHCu9OO40pSJaXahbkYF ${o||""}`,style:l},r);case"h5":return t().createElement("h5",{className:`oK4n_cRPbdF5MN5Ed_h2 ${o||""}`,style:l},r);case"h6":return t().createElement("h6",{className:`odUGt__AQTdr_z7W6Fk7 ${o||""}`,style:l},r);case"p":default:return t().createElement("p",{className:`f_gEnP5sMtd6eYNOiYQQ ${o||""}`,style:l},r);case"span":return t().createElement("span",{className:`aLGFzKvQOPA_BfQw5vqO ${o||""}`,style:l},r)}};const r=({children:e,disabled:r=!1,onClick:o})=>t().createElement("button",{disabled:r,className:"dVadg6u2kwiGWhobva5n",onClick:o},t().createElement(n,{type:"span",size:14},e));function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(this,arguments)}var c=o(111);function i(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function s(...t){return(0,e.useCallback)(i(...t),t)}const u=(0,e.forwardRef)(((t,n)=>{const{children:r,...o}=t,a=e.Children.toArray(r),c=a.find(p);if(c){const t=c.props.children,r=a.map((n=>n===c?e.Children.count(t)>1?e.Children.only(null):(0,e.isValidElement)(t)?t.props.children:null:n));return(0,e.createElement)(d,l({},o,{ref:n}),(0,e.isValidElement)(t)?(0,e.cloneElement)(t,void 0,r):null)}return(0,e.createElement)(d,l({},o,{ref:n}),r)}));u.displayName="Slot";const d=(0,e.forwardRef)(((t,n)=>{const{children:r,...o}=t;return(0,e.isValidElement)(r)?(0,e.cloneElement)(r,{...m(o,r.props),ref:i(n,r.ref)}):e.Children.count(r)>1?e.Children.only(null):null}));d.displayName="SlotClone";const f=({children:t})=>(0,e.createElement)(e.Fragment,null,t);function p(t){return(0,e.isValidElement)(t)&&t.type===f}function m(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{a(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}const h=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=(0,e.forwardRef)(((t,r)=>{const{asChild:o,...a}=t,c=o?u:n;return(0,e.useEffect)((()=>{window[Symbol.for("radix-ui")]=!0}),[]),(0,e.createElement)(c,l({},a,{ref:r}))}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{}),v=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?e.useLayoutEffect:()=>{},b=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=(0,e.useState)(),o=(0,e.useRef)({}),a=(0,e.useRef)(t),l=(0,e.useRef)("none"),i=t?"mounted":"unmounted",[s,u]=function(t,n){return(0,e.useReducer)(((e,t)=>{const r=n[e][t];return null!=r?r:e}),t)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return(0,e.useEffect)((()=>{const e=w(o.current);l.current="mounted"===s?e:"none"}),[s]),v((()=>{const e=o.current,n=a.current;if(n!==t){const r=l.current,o=w(e);t?u("MOUNT"):"none"===o||"none"===(null==e?void 0:e.display)?u("UNMOUNT"):u(n&&r!==o?"ANIMATION_OUT":"UNMOUNT"),a.current=t}}),[t,u]),v((()=>{if(n){const e=e=>{const t=w(o.current).includes(e.animationName);e.target===n&&t&&(0,c.flushSync)((()=>u("ANIMATION_END")))},t=e=>{e.target===n&&(l.current=w(o.current))};return n.addEventListener("animationstart",t),n.addEventListener("animationcancel",e),n.addEventListener("animationend",e),()=>{n.removeEventListener("animationstart",t),n.removeEventListener("animationcancel",e),n.removeEventListener("animationend",e)}}u("ANIMATION_END")}),[n,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:(0,e.useCallback)((e=>{e&&(o.current=getComputedStyle(e)),r(e)}),[])}}(n),a="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),l=s(o.ref,a.ref);return"function"==typeof r||o.isPresent?(0,e.cloneElement)(a,{ref:l}):null};function w(e){return(null==e?void 0:e.animationName)||"none"}function E(t,n=[]){let r=[];const o=()=>{const n=r.map((t=>(0,e.createContext)(t)));return function(r){const o=(null==r?void 0:r[t])||n;return(0,e.useMemo)((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const a=(0,e.createContext)(o),l=r.length;function c(n){const{scope:r,children:o,...c}=n,i=(null==r?void 0:r[t][l])||a,s=(0,e.useMemo)((()=>c),Object.values(c));return(0,e.createElement)(i.Provider,{value:s},o)}return r=[...r,o],c.displayName=n+"Provider",[c,function(r,c){const i=(null==c?void 0:c[t][l])||a,s=(0,e.useContext)(i);if(s)return s;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},g(o,...n)]}function g(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return(0,e.useMemo)((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}function y(t){const n=(0,e.useRef)(t);return(0,e.useEffect)((()=>{n.current=t})),(0,e.useMemo)((()=>(...e)=>{var t;return null===(t=n.current)||void 0===t?void 0:t.call(n,...e)}),[])}b.displayName="Presence";const S=(0,e.createContext)(void 0);function C(t){const n=(0,e.useContext)(S);return t||n||"ltr"}function R(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}const T="ScrollArea",[_,N]=E(T),[x,P]=_(T),A=(0,e.forwardRef)(((t,n)=>{const{__scopeScrollArea:r,type:o="hover",dir:a,scrollHideDelay:c=600,...i}=t,[u,d]=(0,e.useState)(null),[f,p]=(0,e.useState)(null),[m,v]=(0,e.useState)(null),[b,w]=(0,e.useState)(null),[E,g]=(0,e.useState)(null),[y,S]=(0,e.useState)(0),[R,T]=(0,e.useState)(0),[_,N]=(0,e.useState)(!1),[P,A]=(0,e.useState)(!1),I=s(n,(e=>d(e))),L=C(a);return(0,e.createElement)(x,{scope:r,type:o,dir:L,scrollHideDelay:c,scrollArea:u,viewport:f,onViewportChange:p,content:m,onContentChange:v,scrollbarX:b,onScrollbarXChange:w,scrollbarXEnabled:_,onScrollbarXEnabledChange:N,scrollbarY:E,onScrollbarYChange:g,scrollbarYEnabled:P,onScrollbarYEnabledChange:A,onCornerWidthChange:S,onCornerHeightChange:T},(0,e.createElement)(h.div,l({dir:L},i,{ref:I,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":R+"px",...t.style}})))})),I=(0,e.forwardRef)(((t,n)=>{const{__scopeScrollArea:r,children:o,...a}=t,c=P("ScrollAreaViewport",r),i=s(n,(0,e.useRef)(null),c.onViewportChange);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),(0,e.createElement)(h.div,l({"data-radix-scroll-area-viewport":""},a,{ref:i,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...t.style}}),(0,e.createElement)("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"}},o)))})),L="ScrollAreaScrollbar",M=(0,e.forwardRef)(((t,n)=>{const{forceMount:r,...o}=t,a=P(L,t.__scopeScrollArea),{onScrollbarXEnabledChange:c,onScrollbarYEnabledChange:i}=a,s="horizontal"===t.orientation;return(0,e.useEffect)((()=>(s?c(!0):i(!0),()=>{s?c(!1):i(!1)})),[s,c,i]),"hover"===a.type?(0,e.createElement)(D,l({},o,{ref:n,forceMount:r})):"scroll"===a.type?(0,e.createElement)(k,l({},o,{ref:n,forceMount:r})):"auto"===a.type?(0,e.createElement)(O,l({},o,{ref:n,forceMount:r})):"always"===a.type?(0,e.createElement)(F,l({},o,{ref:n})):null})),D=(0,e.forwardRef)(((t,n)=>{const{forceMount:r,...o}=t,a=P(L,t.__scopeScrollArea),[c,i]=(0,e.useState)(!1);return(0,e.useEffect)((()=>{const e=a.scrollArea;let t=0;if(e){const n=()=>{window.clearTimeout(t),i(!0)},r=()=>{t=window.setTimeout((()=>i(!1)),a.scrollHideDelay)};return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",r)}}}),[a.scrollArea,a.scrollHideDelay]),(0,e.createElement)(b,{present:r||c},(0,e.createElement)(O,l({"data-state":c?"visible":"hidden"},o,{ref:n})))})),k=(0,e.forwardRef)(((t,n)=>{const{forceMount:r,...o}=t,a=P(L,t.__scopeScrollArea),c="horizontal"===t.orientation,i=ne((()=>u("SCROLL_END")),100),[s,u]=("hidden",d={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},(0,e.useReducer)(((e,t)=>{const n=d[e][t];return null!=n?n:e}),"hidden"));var d;return(0,e.useEffect)((()=>{if("idle"===s){const e=window.setTimeout((()=>u("HIDE")),a.scrollHideDelay);return()=>window.clearTimeout(e)}}),[s,a.scrollHideDelay,u]),(0,e.useEffect)((()=>{const e=a.viewport,t=c?"scrollLeft":"scrollTop";if(e){let n=e[t];const r=()=>{const r=e[t];n!==r&&(u("SCROLL"),i()),n=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}}),[a.viewport,c,u,i]),(0,e.createElement)(b,{present:r||"hidden"!==s},(0,e.createElement)(F,l({"data-state":"hidden"===s?"hidden":"visible"},o,{ref:n,onPointerEnter:R(t.onPointerEnter,(()=>u("POINTER_ENTER"))),onPointerLeave:R(t.onPointerLeave,(()=>u("POINTER_LEAVE")))})))})),O=(0,e.forwardRef)(((t,n)=>{const r=P(L,t.__scopeScrollArea),{forceMount:o,...a}=t,[c,i]=(0,e.useState)(!1),s="horizontal"===t.orientation,u=ne((()=>{if(r.viewport){const e=r.viewport.offsetWidth<r.viewport.scrollWidth,t=r.viewport.offsetHeight<r.viewport.scrollHeight;i(s?e:t)}}),10);return re(r.viewport,u),re(r.content,u),(0,e.createElement)(b,{present:o||c},(0,e.createElement)(F,l({"data-state":c?"visible":"hidden"},a,{ref:n})))})),F=(0,e.forwardRef)(((t,n)=>{const{orientation:r="vertical",...o}=t,a=P(L,t.__scopeScrollArea),c=(0,e.useRef)(null),i=(0,e.useRef)(0),[s,u]=(0,e.useState)({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=G(s.viewport,s.content),f={...o,sizes:s,onSizesChange:u,hasThumb:Boolean(d>0&&d<1),onThumbChange:e=>c.current=e,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:e=>i.current=e};function p(e,t){return function(e,t,n,r="ltr"){const o=Q(n),a=t||o/2,l=o-a,c=n.scrollbar.paddingStart+a,i=n.scrollbar.size-n.scrollbar.paddingEnd-l,s=n.content-n.viewport;return J([c,i],"ltr"===r?[0,s]:[-1*s,0])(e)}(e,i.current,s,t)}return"horizontal"===r?(0,e.createElement)(z,l({},f,{ref:n,onThumbPositionChange:()=>{if(a.viewport&&c.current){const e=Z(a.viewport.scrollLeft,s,a.dir);c.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollLeft=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollLeft=p(e,a.dir))}})):"vertical"===r?(0,e.createElement)(U,l({},f,{ref:n,onThumbPositionChange:()=>{if(a.viewport&&c.current){const e=Z(a.viewport.scrollTop,s);c.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollTop=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollTop=p(e))}})):null})),z=(0,e.forwardRef)(((t,n)=>{const{sizes:r,onSizesChange:o,...a}=t,c=P(L,t.__scopeScrollArea),[i,u]=(0,e.useState)(),d=(0,e.useRef)(null),f=s(n,d,c.onScrollbarXChange);return(0,e.useEffect)((()=>{d.current&&u(getComputedStyle(d.current))}),[d]),(0,e.createElement)(H,l({"data-orientation":"horizontal"},a,{ref:f,sizes:r,style:{bottom:0,left:"rtl"===c.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===c.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Q(r)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.x),onDragScroll:e=>t.onDragScroll(e.x),onWheelScroll:(e,n)=>{if(c.viewport){const r=c.viewport.scrollLeft+e.deltaX;t.onWheelScroll(r),ee(r,n)&&e.preventDefault()}},onResize:()=>{d.current&&c.viewport&&i&&o({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:q(i.paddingLeft),paddingEnd:q(i.paddingRight)}})}}))})),U=(0,e.forwardRef)(((t,n)=>{const{sizes:r,onSizesChange:o,...a}=t,c=P(L,t.__scopeScrollArea),[i,u]=(0,e.useState)(),d=(0,e.useRef)(null),f=s(n,d,c.onScrollbarYChange);return(0,e.useEffect)((()=>{d.current&&u(getComputedStyle(d.current))}),[d]),(0,e.createElement)(H,l({"data-orientation":"vertical"},a,{ref:f,sizes:r,style:{top:0,right:"ltr"===c.dir?0:void 0,left:"rtl"===c.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Q(r)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.y),onDragScroll:e=>t.onDragScroll(e.y),onWheelScroll:(e,n)=>{if(c.viewport){const r=c.viewport.scrollTop+e.deltaY;t.onWheelScroll(r),ee(r,n)&&e.preventDefault()}},onResize:()=>{d.current&&c.viewport&&i&&o({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:q(i.paddingTop),paddingEnd:q(i.paddingBottom)}})}}))})),[B,W]=_(L),H=(0,e.forwardRef)(((t,n)=>{const{__scopeScrollArea:r,sizes:o,hasThumb:a,onThumbChange:c,onThumbPointerUp:i,onThumbPointerDown:u,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:p,onResize:m,...v}=t,b=P(L,r),[w,E]=(0,e.useState)(null),g=s(n,(e=>E(e))),S=(0,e.useRef)(null),C=(0,e.useRef)(""),T=b.viewport,_=o.content-o.viewport,N=y(p),x=y(d),A=ne(m,10);function I(e){if(S.current){const t=e.clientX-S.current.left,n=e.clientY-S.current.top;f({x:t,y:n})}}return(0,e.useEffect)((()=>{const e=e=>{const t=e.target;(null==w?void 0:w.contains(t))&&N(e,_)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})}),[T,w,_,N]),(0,e.useEffect)(x,[o,x]),re(w,A),re(b.content,A),(0,e.createElement)(B,{scope:r,scrollbar:w,hasThumb:a,onThumbChange:y(c),onThumbPointerUp:y(i),onThumbPositionChange:x,onThumbPointerDown:y(u)},(0,e.createElement)(h.div,l({},v,{ref:g,style:{position:"absolute",...v.style},onPointerDown:R(t.onPointerDown,(e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),S.current=w.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",I(e))})),onPointerMove:R(t.onPointerMove,I),onPointerUp:R(t.onPointerUp,(e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=C.current,S.current=null}))})))})),j="ScrollAreaThumb",Y=(0,e.forwardRef)(((t,n)=>{const{forceMount:r,...o}=t,a=W(j,t.__scopeScrollArea);return(0,e.createElement)(b,{present:r||a.hasThumb},(0,e.createElement)(V,l({ref:n},o)))})),V=(0,e.forwardRef)(((t,n)=>{const{__scopeScrollArea:r,style:o,...a}=t,c=P(j,r),i=W(j,r),{onThumbPositionChange:u}=i,d=s(n,(e=>i.onThumbChange(e))),f=(0,e.useRef)(),p=ne((()=>{f.current&&(f.current(),f.current=void 0)}),100);return(0,e.useEffect)((()=>{const e=c.viewport;if(e){const t=()=>{if(p(),!f.current){const t=te(e,u);f.current=t,u()}};return u(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}}),[c.viewport,p,u]),(0,e.createElement)(h.div,l({"data-state":i.hasThumb?"visible":"hidden"},a,{ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:R(t.onPointerDownCapture,(e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;i.onThumbPointerDown({x:n,y:r})})),onPointerUp:R(t.onPointerUp,i.onThumbPointerUp)}))})),X="ScrollAreaCorner",$=(0,e.forwardRef)(((t,n)=>{const r=P(X,t.__scopeScrollArea),o=Boolean(r.scrollbarX&&r.scrollbarY);return"scroll"!==r.type&&o?(0,e.createElement)(K,l({},t,{ref:n})):null})),K=(0,e.forwardRef)(((t,n)=>{const{__scopeScrollArea:r,...o}=t,a=P(X,r),[c,i]=(0,e.useState)(0),[s,u]=(0,e.useState)(0),d=Boolean(c&&s);return re(a.scrollbarX,(()=>{var e;const t=(null===(e=a.scrollbarX)||void 0===e?void 0:e.offsetHeight)||0;a.onCornerHeightChange(t),u(t)})),re(a.scrollbarY,(()=>{var e;const t=(null===(e=a.scrollbarY)||void 0===e?void 0:e.offsetWidth)||0;a.onCornerWidthChange(t),i(t)})),d?(0,e.createElement)(h.div,l({},o,{ref:n,style:{width:c,height:s,position:"absolute",right:"ltr"===a.dir?0:void 0,left:"rtl"===a.dir?0:void 0,bottom:0,...t.style}})):null}));function q(e){return e?parseInt(e,10):0}function G(e,t){const n=e/t;return isNaN(n)?0:n}function Q(e){const t=G(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Z(e,t,n="ltr"){const r=Q(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,l=t.content-t.viewport,c=a-r,i=function(e,[t,n]){return Math.min(n,Math.max(t,e))}(e,"ltr"===n?[0,l]:[-1*l,0]);return J([0,l],[0,c])(i)}function J(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function ee(e,t){return e>0&&e<t}const te=(e,t=(()=>{}))=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const a={left:e.scrollLeft,top:e.scrollTop},l=n.left!==a.left,c=n.top!==a.top;(l||c)&&t(),n=a,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function ne(t,n){const r=y(t),o=(0,e.useRef)(0);return(0,e.useEffect)((()=>()=>window.clearTimeout(o.current)),[]),(0,e.useCallback)((()=>{window.clearTimeout(o.current),o.current=window.setTimeout(r,n)}),[r,n])}function re(e,t){const n=y(t);v((()=>{let t=0;if(e){const r=new ResizeObserver((()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)}));return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}}),[e,n])}const oe=A,ae=I,le=M,ce=Y,ie=$;var se="ICjBreoW5ZAqZ9txdiH9",ue="SNDfMaHFMf5swwou75WQ";const de=({children:e})=>t().createElement(oe,{className:"gQUln75LgrNAv33iEQhx"},t().createElement(ae,{className:"YABN5ZbWRfbX8Bbj41KF"},e),t().createElement(le,{className:se,orientation:"vertical"},t().createElement(ce,{className:ue})),t().createElement(le,{className:se,orientation:"horizontal"},t().createElement(ce,{className:ue})),t().createElement(ie,{className:"KxOpf0j2WwULFJnM_2Up"})),fe=e["useId".toString()]||(()=>{});let pe=0;function me(t){const[n,r]=e.useState(fe());return v((()=>{t||r((e=>null!=e?e:String(pe++)))}),[t]),t||(n?`radix-${n}`:"")}function he({prop:t,defaultProp:n,onChange:r=(()=>{})}){const[o,a]=function({defaultProp:t,onChange:n}){const r=(0,e.useState)(t),[o]=r,a=(0,e.useRef)(o),l=y(n);return(0,e.useEffect)((()=>{a.current!==o&&(l(o),a.current=o)}),[o,a,l]),r}({defaultProp:n,onChange:r}),l=void 0!==t,c=l?t:o,i=y(r);return[c,(0,e.useCallback)((e=>{if(l){const n="function"==typeof e?e(t):e;n!==t&&i(n)}else a(e)}),[l,t,a,i])]}const ve="rovingFocusGroup.onEntryFocus",be={bubbles:!1,cancelable:!0},we="RovingFocusGroup",[Ee,ge,ye]=function(e){const n=e+"CollectionProvider",[r,o]=E(n),[a,l]=r(n,{collectionRef:{current:null},itemMap:new Map}),c=e+"CollectionSlot",i=e+"CollectionItemSlot",d="data-radix-collection-item";return[{Provider:e=>{const{scope:n,children:r}=e,o=t().useRef(null),l=t().useRef(new Map).current;return t().createElement(a,{scope:n,itemMap:l,collectionRef:o},r)},Slot:t().forwardRef(((e,n)=>{const{scope:r,children:o}=e,a=s(n,l(c,r).collectionRef);return t().createElement(u,{ref:a},o)})),ItemSlot:t().forwardRef(((e,n)=>{const{scope:r,children:o,...a}=e,c=t().useRef(null),f=s(n,c),p=l(i,r);return t().useEffect((()=>(p.itemMap.set(c,{ref:c,...a}),()=>{p.itemMap.delete(c)}))),t().createElement(u,{[d]:"",ref:f},o)}))},function(n){const r=l(e+"CollectionConsumer",n);return t().useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(r.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)))}),[r.collectionRef,r.itemMap])},o]}(we),[Se,Ce]=E(we,[ye]),[Re,Te]=Se(we),_e=(0,e.forwardRef)(((t,n)=>(0,e.createElement)(Ee.Provider,{scope:t.__scopeRovingFocusGroup},(0,e.createElement)(Ee.Slot,{scope:t.__scopeRovingFocusGroup},(0,e.createElement)(Ne,l({},t,{ref:n})))))),Ne=(0,e.forwardRef)(((t,n)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:a=!1,dir:c,currentTabStopId:i,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:f,...p}=t,m=(0,e.useRef)(null),v=s(n,m),b=C(c),[w=null,E]=he({prop:i,defaultProp:u,onChange:d}),[g,S]=(0,e.useState)(!1),T=y(f),_=ge(r),N=(0,e.useRef)(!1),[x,P]=(0,e.useState)(0);return(0,e.useEffect)((()=>{const e=m.current;if(e)return e.addEventListener(ve,T),()=>e.removeEventListener(ve,T)}),[T]),(0,e.createElement)(Re,{scope:r,orientation:o,dir:b,loop:a,currentTabStopId:w,onItemFocus:(0,e.useCallback)((e=>E(e)),[E]),onItemShiftTab:(0,e.useCallback)((()=>S(!0)),[]),onFocusableItemAdd:(0,e.useCallback)((()=>P((e=>e+1))),[]),onFocusableItemRemove:(0,e.useCallback)((()=>P((e=>e-1))),[])},(0,e.createElement)(h.div,l({tabIndex:g||0===x?-1:0,"data-orientation":o},p,{ref:v,style:{outline:"none",...t.style},onMouseDown:R(t.onMouseDown,(()=>{N.current=!0})),onFocus:R(t.onFocus,(e=>{const t=!N.current;if(e.target===e.currentTarget&&t&&!g){const t=new CustomEvent(ve,be);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=_().filter((e=>e.focusable));Ae([e.find((e=>e.active)),e.find((e=>e.id===w)),...e].filter(Boolean).map((e=>e.ref.current)))}}N.current=!1})),onBlur:R(t.onBlur,(()=>S(!1)))})))})),xe=(0,e.forwardRef)(((t,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:a=!1,tabStopId:c,...i}=t,s=me(),u=c||s,d=Te("RovingFocusGroupItem",r),f=d.currentTabStopId===u,p=ge(r),{onFocusableItemAdd:m,onFocusableItemRemove:v}=d;return(0,e.useEffect)((()=>{if(o)return m(),()=>v()}),[o,m,v]),(0,e.createElement)(Ee.ItemSlot,{scope:r,id:u,focusable:o,active:a},(0,e.createElement)(h.span,l({tabIndex:f?0:-1,"data-orientation":d.orientation},i,{ref:n,onMouseDown:R(t.onMouseDown,(e=>{o?d.onItemFocus(u):e.preventDefault()})),onFocus:R(t.onFocus,(()=>d.onItemFocus(u))),onKeyDown:R(t.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:Pe[r]}(e,d.orientation,d.dir);if(void 0!==t){e.preventDefault();let o=p().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const a=o.indexOf(e.currentTarget);o=d.loop?(r=a+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(a+1)}setTimeout((()=>Ae(o)))}var n,r}))})))})),Pe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ae(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}const Ie=_e,Le=xe,Me="Tabs",[De,ke]=E(Me,[Ce]),Oe=Ce(),[Fe,ze]=De(Me);function Ue(e,t){return`${e}-trigger-${t}`}function Be(e,t){return`${e}-content-${t}`}const We=(0,e.forwardRef)(((t,n)=>{const{__scopeTabs:r,value:o,onValueChange:a,defaultValue:c,orientation:i="horizontal",dir:s,activationMode:u="automatic",...d}=t,f=C(s),[p,m]=he({prop:o,onChange:a,defaultProp:c});return(0,e.createElement)(Fe,{scope:r,baseId:me(),value:p,onValueChange:m,orientation:i,dir:f,activationMode:u},(0,e.createElement)(h.div,l({dir:f,"data-orientation":i},d,{ref:n})))})),He=(0,e.forwardRef)(((t,n)=>{const{__scopeTabs:r,loop:o=!0,...a}=t,c=ze("TabsList",r),i=Oe(r);return(0,e.createElement)(Ie,l({asChild:!0},i,{orientation:c.orientation,dir:c.dir,loop:o}),(0,e.createElement)(h.div,l({role:"tablist","aria-orientation":c.orientation},a,{ref:n})))})),je=(0,e.forwardRef)(((t,n)=>{const{__scopeTabs:r,value:o,disabled:a=!1,...c}=t,i=ze("TabsTrigger",r),s=Oe(r),u=Ue(i.baseId,o),d=Be(i.baseId,o),f=o===i.value;return(0,e.createElement)(Le,l({asChild:!0},s,{focusable:!a,active:f}),(0,e.createElement)(h.button,l({type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:u},c,{ref:n,onMouseDown:R(t.onMouseDown,(e=>{a||0!==e.button||!1!==e.ctrlKey?e.preventDefault():i.onValueChange(o)})),onKeyDown:R(t.onKeyDown,(e=>{[" ","Enter"].includes(e.key)&&i.onValueChange(o)})),onFocus:R(t.onFocus,(()=>{const e="manual"!==i.activationMode;f||a||!e||i.onValueChange(o)}))})))})),Ye=(0,e.forwardRef)(((t,n)=>{const{__scopeTabs:r,value:o,forceMount:a,children:c,...i}=t,s=ze("TabsContent",r),u=Ue(s.baseId,o),d=Be(s.baseId,o),f=o===s.value,p=(0,e.useRef)(f);return(0,e.useEffect)((()=>{const e=requestAnimationFrame((()=>p.current=!1));return()=>cancelAnimationFrame(e)}),[]),(0,e.createElement)(b,{present:a||f},(({present:r})=>(0,e.createElement)(h.div,l({"data-state":f?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":u,hidden:!r,id:d,tabIndex:0},i,{ref:n,style:{...t.style,animationDuration:p.current?"0s":void 0}}),r&&c)))}));const Ve=({items:e,def:n,value:r,onChange:o,renderChildren:a})=>{const l=e=>void 0===e.value?e.header:e.value.toString();return t().createElement(We,{className:"YhXMGBOKBRuKAvsx8mwk",defaultValue:n||e[0].header,value:r.toString(),onValueChange:o},t().createElement(He,{className:"t08yVQir831gIp_A2xsP","aria-label":"Manage your account"},e.map((e=>t().createElement(je,{key:e.header,className:"L7_6rMInDO6tBxFRFiuO",value:l(e)},e.header)))),a?a():e.map((e=>e.body?t().createElement(Ye,{className:"kLJtm9LC8LxOdvGhZdw_",value:l(e)},e.body):null)))},Xe="Checkbox",[$e,Ke]=E(Xe),[qe,Ge]=$e(Xe),Qe=(0,e.forwardRef)(((t,n)=>{const{__scopeCheckbox:r,name:o,checked:a,defaultChecked:c,required:i,disabled:u,value:d="on",onCheckedChange:f,...p}=t,[m,v]=(0,e.useState)(null),b=s(n,(e=>v(e))),w=(0,e.useRef)(!1),E=!m||Boolean(m.closest("form")),[g=!1,y]=he({prop:a,defaultProp:c,onChange:f});return(0,e.createElement)(qe,{scope:r,state:g,disabled:u},(0,e.createElement)(h.button,l({type:"button",role:"checkbox","aria-checked":Je(g)?"mixed":g,"aria-required":i,"data-state":et(g),"data-disabled":u?"":void 0,disabled:u,value:d},p,{ref:b,onKeyDown:R(t.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:R(t.onClick,(e=>{y((e=>!!Je(e)||!e)),E&&(w.current=e.isPropagationStopped(),w.current||e.stopPropagation())}))})),E&&(0,e.createElement)(Ze,{control:m,bubbles:!w.current,name:o,value:d,checked:g,required:i,disabled:u,style:{transform:"translateX(-100%)"}}))})),Ze=t=>{const{control:n,checked:r,bubbles:o=!0,...a}=t,c=(0,e.useRef)(null),i=function(t){const n=(0,e.useRef)({value:t,previous:t});return(0,e.useMemo)((()=>(n.current.value!==t&&(n.current.previous=n.current.value,n.current.value=t),n.current.previous)),[t])}(r),s=function(t){const[n,r]=(0,e.useState)(void 0);return v((()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver((e=>{if(!Array.isArray(e))return;if(!e.length)return;const n=e[0];let o,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,a=t.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})}));return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}r(void 0)}),[t]),n}(n);return(0,e.useEffect)((()=>{const e=c.current,t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(i!==r&&n){const t=new Event("click",{bubbles:o});e.indeterminate=Je(r),n.call(e,!Je(r)&&r),e.dispatchEvent(t)}}),[i,r,o]),(0,e.createElement)("input",l({type:"checkbox","aria-hidden":!0,defaultChecked:!Je(r)&&r},a,{tabIndex:-1,ref:c,style:{...t.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Je(e){return"indeterminate"===e}function et(e){return Je(e)?"indeterminate":e?"checked":"unchecked"}const tt=Qe,nt=(0,e.forwardRef)(((t,n)=>{const{__scopeCheckbox:r,forceMount:o,...a}=t,c=Ge("CheckboxIndicator",r);return(0,e.createElement)(b,{present:o||Je(c.state)||!0===c.state},(0,e.createElement)(h.span,l({"data-state":et(c.state),"data-disabled":c.disabled?"":void 0},a,{ref:n,style:{pointerEvents:"none",...t.style}})))}));var rt=["color"],ot=(0,e.forwardRef)((function(t,n){var r=t.color,o=void 0===r?"currentColor":r,a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(t,rt);return(0,e.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:n}),(0,e.createElement)("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}));const at=({label:e,isChecked:n,onChecked:r})=>t().createElement("form",null,t().createElement("div",{style:{display:"flex",alignItems:"center"}},t().createElement(tt,{className:"i8BZVdjUfbst7_tarHzS",defaultChecked:!0,checked:n,onCheckedChange:r,id:e},t().createElement(nt,{className:"l0YazbYK7P8YQSDvX2o0"},t().createElement(ot,null))),t().createElement("label",{className:"w9I3BjE7cnjsfBLB3UyI",htmlFor:e},e)));const lt=({value:e,placeholder:n,onChange:r,type:o="text"})=>t().createElement("input",{type:o,value:e,placeholder:n,onChange:r,className:"FYuNNcaXqlTXB7M6DHBZ"})}(),a}()}));
2
+ //# sourceMappingURL=rush-themed-ui.f8c233a94ae3b52111a138b2ba61ad04.js.map
package/lib/init.js CHANGED
@@ -18,7 +18,7 @@ const init = () => {
18
18
  const rushJsonPath = `${currExploredDir}/rush.json`;
19
19
  const pnpmLockPath = `${currExploredDir}/pnpm-lock.yaml`;
20
20
  if (node_core_library_1.FileSystem.exists(rushJsonPath)) {
21
- console.log('found rush project: ', rushJsonPath);
21
+ console.log('Found a Rush workspace: ', rushJsonPath);
22
22
  // Load the rush projects
23
23
  const rushJson = node_core_library_1.JsonFile.load(rushJsonPath);
24
24
  const projectsByProjectFolder = new Map();
@@ -58,7 +58,7 @@ const init = () => {
58
58
  currExploredDir = currExploredDir.substring(0, currExploredDir.lastIndexOf('/'));
59
59
  }
60
60
  if (!appState) {
61
- throw new Error('Could not find a rush or pnpm project!');
61
+ throw new Error('Could not find a Rush or PNPM workspace!');
62
62
  }
63
63
  return appState;
64
64
  };
package/lib/init.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,uHAAuH;AACvH,6DAA6D;AAE7D,oEAA6F;AAG7F,mCAA2E;AAEpE,MAAM,IAAI,GAAG,GAAc,EAAE;IAClC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC9B,MAAM,2BAA2B,GAAW,qCAAiB,CAAC,QAAQ,CAAC,sBAAsB,CAAC,SAAS,CAAE,CAAC;IAC1G,MAAM,UAAU,GAAW,4BAAQ,CAAC,IAAI,CAAC,GAAG,2BAA2B,eAAe,CAAC,CAAC,OAAO,CAAC;IAEhG,IAAI,QAA+B,CAAC;IACpC,IAAI,eAAe,GAAG,wBAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACrD,OAAO,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACpC,sFAAsF;QAC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G,CAAC,CAAC,CAAC;KAClF;IAED,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;KAC3D;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AA3DW,QAAA,IAAI,QA2Df","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n// This function will read the current directory and try to figure out if it's a rush project or regular pnpm workspace\n// Currently it will throw error if neither can be determined\n\nimport { FileSystem, JsonFile, PackageJsonLookup, Path } from '@rushstack/node-core-library';\nimport type { IRushConfigurationJson } from '@microsoft/rush-lib/lib/api/RushConfiguration';\n\nimport { type IAppState, IRushProjectDetails, ProjectType } from './state';\n\nexport const init = (): IAppState => {\n const currDir = process.cwd();\n const lockfileExplorerProjectRoot: string = PackageJsonLookup.instance.tryGetPackageFolderFor(__dirname)!;\n const appVersion: string = JsonFile.load(`${lockfileExplorerProjectRoot}/package.json`).version;\n\n let appState: IAppState | undefined;\n let currExploredDir = Path.convertToSlashes(currDir);\n while (currExploredDir.includes('/')) {\n // Look for a rush.json [rush project] or pnpm-lock.yaml file [regular pnpm workspace]\n const rushJsonPath: string = `${currExploredDir}/rush.json`;\n const pnpmLockPath: string = `${currExploredDir}/pnpm-lock.yaml`;\n if (FileSystem.exists(rushJsonPath)) {\n console.log('found rush project: ', rushJsonPath);\n // Load the rush projects\n const rushJson: IRushConfigurationJson = JsonFile.load(rushJsonPath);\n const projectsByProjectFolder: Map<string, IRushProjectDetails> = new Map();\n for (const project of rushJson.projects) {\n projectsByProjectFolder.set(project.projectFolder, {\n projectName: project.packageName,\n projectFolder: project.projectFolder\n });\n }\n\n appState = {\n currDir,\n appVersion,\n lockfileExplorerProjectRoot,\n projectType: ProjectType.RUSH_PROJECT,\n pnpmLockfileLocation: `${currExploredDir}/common/config/rush/pnpm-lock.yaml`,\n pnpmfileLocation: `${currExploredDir}/common/config/rush/.pnpmfile.cjs`,\n projectRoot: currExploredDir,\n rush: {\n rushJsonPath,\n projectsByProjectFolder\n }\n };\n break;\n } else if (FileSystem.exists(pnpmLockPath)) {\n appState = {\n currDir,\n appVersion,\n lockfileExplorerProjectRoot,\n projectType: ProjectType.PNPM_WORKSPACE,\n pnpmLockfileLocation: `${currExploredDir}/pnpm-lock.yaml`,\n pnpmfileLocation: `${currExploredDir}/.pnpmfile.cjs`,\n projectRoot: currExploredDir\n };\n\n break;\n }\n\n currExploredDir = currExploredDir.substring(0, currExploredDir.lastIndexOf('/'));\n }\n\n if (!appState) {\n throw new Error('Could not find a rush or pnpm project!');\n }\n\n return appState;\n};\n"]}
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,uHAAuH;AACvH,6DAA6D;AAE7D,oEAA6F;AAG7F,mCAA2E;AAEpE,MAAM,IAAI,GAAG,GAAc,EAAE;IAClC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC9B,MAAM,2BAA2B,GAAW,qCAAiB,CAAC,QAAQ,CAAC,sBAAsB,CAAC,SAAS,CAAE,CAAC;IAC1G,MAAM,UAAU,GAAW,4BAAQ,CAAC,IAAI,CAAC,GAAG,2BAA2B,eAAe,CAAC,CAAC,OAAO,CAAC;IAEhG,IAAI,QAA+B,CAAC;IACpC,IAAI,eAAe,GAAG,wBAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACrD,OAAO,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACpC,sFAAsF;QACtF,MAAM,YAAY,GAAW,GAAG,eAAe,YAAY,CAAC;QAC5D,MAAM,YAAY,GAAW,GAAG,eAAe,iBAAiB,CAAC;QACjE,IAAI,8BAAU,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE;YACnC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,YAAY,CAAC,CAAC;YACtD,yBAAyB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MIT license.\n// See LICENSE in the project root for license information.\n\n// This function will read the current directory and try to figure out if it's a rush project or regular pnpm workspace\n// Currently it will throw error if neither can be determined\n\nimport { FileSystem, JsonFile, PackageJsonLookup, Path } from '@rushstack/node-core-library';\nimport type { IRushConfigurationJson } from '@microsoft/rush-lib/lib/api/RushConfiguration';\n\nimport { type IAppState, IRushProjectDetails, ProjectType } from './state';\n\nexport const init = (): IAppState => {\n const currDir = process.cwd();\n const lockfileExplorerProjectRoot: string = PackageJsonLookup.instance.tryGetPackageFolderFor(__dirname)!;\n const appVersion: string = JsonFile.load(`${lockfileExplorerProjectRoot}/package.json`).version;\n\n let appState: IAppState | undefined;\n let currExploredDir = Path.convertToSlashes(currDir);\n while (currExploredDir.includes('/')) {\n // Look for a rush.json [rush project] or pnpm-lock.yaml file [regular pnpm workspace]\n const rushJsonPath: string = `${currExploredDir}/rush.json`;\n const pnpmLockPath: string = `${currExploredDir}/pnpm-lock.yaml`;\n if (FileSystem.exists(rushJsonPath)) {\n console.log('Found a Rush workspace: ', rushJsonPath);\n // Load the rush projects\n const rushJson: IRushConfigurationJson = JsonFile.load(rushJsonPath);\n const projectsByProjectFolder: Map<string, IRushProjectDetails> = new Map();\n for (const project of rushJson.projects) {\n projectsByProjectFolder.set(project.projectFolder, {\n projectName: project.packageName,\n projectFolder: project.projectFolder\n });\n }\n\n appState = {\n currDir,\n appVersion,\n lockfileExplorerProjectRoot,\n projectType: ProjectType.RUSH_PROJECT,\n pnpmLockfileLocation: `${currExploredDir}/common/config/rush/pnpm-lock.yaml`,\n pnpmfileLocation: `${currExploredDir}/common/config/rush/.pnpmfile.cjs`,\n projectRoot: currExploredDir,\n rush: {\n rushJsonPath,\n projectsByProjectFolder\n }\n };\n break;\n } else if (FileSystem.exists(pnpmLockPath)) {\n appState = {\n currDir,\n appVersion,\n lockfileExplorerProjectRoot,\n projectType: ProjectType.PNPM_WORKSPACE,\n pnpmLockfileLocation: `${currExploredDir}/pnpm-lock.yaml`,\n pnpmfileLocation: `${currExploredDir}/.pnpmfile.cjs`,\n projectRoot: currExploredDir\n };\n\n break;\n }\n\n currExploredDir = currExploredDir.substring(0, currExploredDir.lastIndexOf('/'));\n }\n\n if (!appState) {\n throw new Error('Could not find a Rush or PNPM workspace!');\n }\n\n return appState;\n};\n"]}
package/lib/start.js CHANGED
@@ -18,8 +18,18 @@ const init_1 = require("./init");
18
18
  const PORT = 8091;
19
19
  // Must not have a trailing slash
20
20
  const SERVICE_URL = `http://localhost:${PORT}`;
21
- (0, update_notifier_1.default)({ pkg: package_json_1.default }).notify();
22
21
  const appState = (0, init_1.init)();
22
+ console.log(safe_1.default.bold(`\nRush Lockfile Explorer ${appState.appVersion}`) +
23
+ safe_1.default.cyan(' - https://lfx.rushstack.io/\n'));
24
+ // TODO: Later if we introduce more CLI parameters, switch to a proper CLI parser
25
+ const args = process_1.default.argv.slice(2);
26
+ if (args.length > 0 && args[0] !== '--debug') {
27
+ console.log('Usage: lockfile-explorer [--debug]\n');
28
+ console.log('The "lfx" command is a shorthand alias for "lockfile-explorer".');
29
+ console.log('See the project website for documentation and support.\n');
30
+ process_1.default.exit(1);
31
+ }
32
+ (0, update_notifier_1.default)({ pkg: package_json_1.default }).notify();
23
33
  process_1.default.chdir(appState.lockfileExplorerProjectRoot);
24
34
  const distFolderPath = `${appState.lockfileExplorerProjectRoot}/dist`;
25
35
  const app = (0, express_1.default)();
@@ -89,9 +99,9 @@ app.post('/api/package-json', async (req, res) => {
89
99
  res.send(packageJsonText);
90
100
  });
91
101
  app.get('/api/pnpmfile', async (req, res) => {
92
- let pnpmLockfile;
102
+ let pnpmfile;
93
103
  try {
94
- pnpmLockfile = await node_core_library_1.FileSystem.readFileAsync(appState.pnpmLockfileLocation);
104
+ pnpmfile = await node_core_library_1.FileSystem.readFileAsync(appState.pnpmfileLocation);
95
105
  }
96
106
  catch (e) {
97
107
  if (node_core_library_1.FileSystem.isNotExistError(e)) {
@@ -104,7 +114,7 @@ app.get('/api/pnpmfile', async (req, res) => {
104
114
  throw e;
105
115
  }
106
116
  }
107
- res.send(pnpmLockfile);
117
+ res.send(pnpmfile);
108
118
  });
109
119
  app.post('/api/package-spec', async (req, res) => {
110
120
  const { projectPath } = req.body;
@@ -128,7 +138,7 @@ app.post('/api/package-spec', async (req, res) => {
128
138
  res.send(parsedPackage);
129
139
  });
130
140
  app.listen(PORT, async () => {
131
- console.log(`Rush Lockfile Explorer ${appState.appVersion} running at ${SERVICE_URL}`);
141
+ console.log(`App launched on ${SERVICE_URL}`);
132
142
  if (!process_1.default.argv.includes('--debug')) {
133
143
  try {
134
144
  // Launch the web browser
package/lib/start.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"start.js","sourceRoot":"","sources":["../src/start.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;AAE3D,sDAA8B;AAC9B,sDAA2B;AAC3B,gDAAwB;AACxB,sDAA8B;AAC9B,uDAAiC;AACjC,gDAAwB;AACxB,sEAA6C;AAC7C,oEAAuF;AAEvF,mEAA0C;AAC1C,iCAA8B;AAG9B,MAAM,IAAI,GAAW,IAAI,CAAC;AAC1B,iCAAiC;AACjC,MAAM,WAAW,GAAW,oBAAoB,IAAI,EAAE,CAAC;AAEvD,IAAA,yBAAc,EAAC,EAAE,GAAG,EAAE,sBAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAE9C,MAAM,QAAQ,GAAc,IAAA,WAAI,GAAE,CAAC;AAEnC,iBAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAC;AACpD,MAAM,cAAc,GAAW,GAAG,QAAQ,CAAC,2BAA2B,OAAO,CAAC;AAC9E,MAAM,GAAG,GAAwB,IAAA,iBAAO,GAAE,CAAC;AAC3C,GAAG,CAAC,GAAG,CAAC,iBAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AACxB,GAAG,CAAC,GAAG,CAAC,IAAA,cAAI,GAAE,CAAC,CAAC;AAEhB,oEAAoE;AACpE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,CAAC;SACJ;aAAM;YACL,MAAM,CAAC,CAAC;SACT;KACF;IAED,MAAM,EACJ,KAAK,EAAE,EAAE,WAAW,EAAE,EACvB,GAAG,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IACvC,MAAM,aAAa,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC;IAC/C,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAC1B,CAAC,CACF,CAAC;AAEF,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE;IAC1B,OAAO,CAAC,GAAG,CAAC,0BAA0B,QAAQ,CAAC,UAAU,eAAe,WAAW,EAAE,CAAC,CAAC;IAEvF,IAAI,CAAC,iBAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;QACrC,IAAI;YACF,yBAAyB;YACzB,MAAM,IAAA,cAAI,EAAC,WAAW,CAAC,CAAC;SACzB;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,2BAA2B,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;SAC3D;KACF;AACH,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport express from 'express';\nimport yaml from 'js-yaml';\nimport cors from 'cors';\nimport process from 'process';\nimport colors from 'colors/safe';\nimport open from 'open';\nimport updateNotifier from 'update-notifier';\nimport { FileSystem, type IPackageJson, JsonFile } from '@rushstack/node-core-library';\nimport type { IAppContext } from '@rushstack/lockfile-explorer-web/lib/AppContext';\nimport packageJSON from '../package.json';\nimport { init } from './init';\nimport type { IAppState } from './state';\n\nconst PORT: number = 8091;\n// Must not have a trailing slash\nconst SERVICE_URL: string = `http://localhost:${PORT}`;\n\nupdateNotifier({ pkg: packageJSON }).notify();\n\nconst appState: IAppState = init();\n\nprocess.chdir(appState.lockfileExplorerProjectRoot);\nconst distFolderPath: string = `${appState.lockfileExplorerProjectRoot}/dist`;\nconst app: express.Application = express();\napp.use(express.json());\napp.use(cors());\n\n// Variable used to check if the front-end client is still connected\nlet awaitingFirstConnect: boolean = true;\nlet isClientConnected: boolean = false;\nlet disconnected: boolean = false;\nsetInterval(() => {\n if (!isClientConnected && !awaitingFirstConnect && !disconnected) {\n console.log(colors.red('The client has disconnected!'));\n console.log(`Please open a browser window at http://localhost:${PORT}/app`);\n disconnected = true;\n } else if (!awaitingFirstConnect) {\n isClientConnected = false;\n }\n}, 4000);\n\n// This takes precedence over the `/app` static route, which also has an `initappcontext.js` file.\napp.get('/initappcontext.js', (req: express.Request, res: express.Response) => {\n const appContext: IAppContext = {\n serviceUrl: SERVICE_URL,\n appVersion: appState.appVersion,\n debugMode: process.argv.indexOf('--debug') >= 0\n };\n const sourceCode: string = [\n `console.log('Loaded initappcontext.js');`,\n `appContext = ${JSON.stringify(appContext)}`\n ].join('\\n');\n\n res.type('application/javascript').send(sourceCode);\n});\n\napp.use('/', express.static(distFolderPath));\n\napp.use('/favicon.ico', express.static(distFolderPath, { index: 'favicon.ico' }));\n\napp.get('/api/lockfile', async (req: express.Request, res: express.Response) => {\n const pnpmLockfileText: string = await FileSystem.readFileAsync(appState.pnpmLockfileLocation);\n const doc = yaml.load(pnpmLockfileText);\n res.send(doc);\n});\n\napp.get('/api/health', (req: express.Request, res: express.Response) => {\n awaitingFirstConnect = false;\n isClientConnected = true;\n if (disconnected) {\n disconnected = false;\n console.log(colors.green('The client has reconnected!'));\n }\n res.status(200).send();\n});\n\napp.post(\n '/api/package-json',\n async (req: express.Request<{}, {}, { projectPath: string }, {}>, res: express.Response) => {\n const { projectPath } = req.body;\n const fileLocation = `${appState.projectRoot}/${projectPath}/package.json`;\n let packageJsonText: string;\n try {\n packageJsonText = await FileSystem.readFileAsync(fileLocation);\n } catch (e) {\n if (FileSystem.isNotExistError(e)) {\n return res.status(404).send({\n message: `Could not load package.json file for this package. Have you installed all the dependencies for this workspace?`,\n error: `No package.json in location: ${projectPath}`\n });\n } else {\n throw e;\n }\n }\n\n res.send(packageJsonText);\n }\n);\n\napp.get('/api/pnpmfile', async (req: express.Request, res: express.Response) => {\n let pnpmLockfile: string;\n try {\n pnpmLockfile = await FileSystem.readFileAsync(appState.pnpmLockfileLocation);\n } catch (e) {\n if (FileSystem.isNotExistError(e)) {\n return res.status(404).send({\n message: `Could not load pnpmfile file in this repo.`,\n error: `No .pnpmifile.cjs found.`\n });\n } else {\n throw e;\n }\n }\n\n res.send(pnpmLockfile);\n});\n\napp.post(\n '/api/package-spec',\n async (req: express.Request<{}, {}, { projectPath: string }, {}>, res: express.Response) => {\n const { projectPath } = req.body;\n const fileLocation = `${appState.projectRoot}/${projectPath}/package.json`;\n let packageJson: IPackageJson;\n try {\n packageJson = await JsonFile.loadAsync(fileLocation);\n } catch (e) {\n if (FileSystem.isNotExistError(e)) {\n return res.status(404).send({\n message: `Could not load package.json file in location: ${projectPath}`\n });\n } else {\n throw e;\n }\n }\n\n const {\n hooks: { readPackage }\n } = require(appState.pnpmfileLocation);\n const parsedPackage = readPackage(packageJson);\n res.send(parsedPackage);\n }\n);\n\napp.listen(PORT, async () => {\n console.log(`Rush Lockfile Explorer ${appState.appVersion} running at ${SERVICE_URL}`);\n\n if (!process.argv.includes('--debug')) {\n try {\n // Launch the web browser\n await open(SERVICE_URL);\n } catch (e) {\n console.error('Error launching browser: ' + e.toString());\n }\n }\n});\n"]}
1
+ {"version":3,"file":"start.js","sourceRoot":"","sources":["../src/start.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;AAE3D,sDAA8B;AAC9B,sDAA2B;AAC3B,gDAAwB;AACxB,sDAA8B;AAC9B,uDAAiC;AACjC,gDAAwB;AACxB,sEAA6C;AAC7C,oEAAuF;AAEvF,mEAA0C;AAC1C,iCAA8B;AAG9B,MAAM,IAAI,GAAW,IAAI,CAAC;AAC1B,iCAAiC;AACjC,MAAM,WAAW,GAAW,oBAAoB,IAAI,E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AC;IAC/C,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAC1B,CAAC,CACF,CAAC;AAEF,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE;IAC1B,OAAO,CAAC,GAAG,CAAC,mBAAmB,WAAW,EAAE,CAAC,CAAC;IAE9C,IAAI,CAAC,iBAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;QACrC,IAAI;YACF,yBAAyB;YACzB,MAAM,IAAA,cAAI,EAAC,WAAW,CAAC,CAAC;SACzB;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,2BAA2B,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;SAC3D;KACF;AACH,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport express from 'express';\nimport yaml from 'js-yaml';\nimport cors from 'cors';\nimport process from 'process';\nimport colors from 'colors/safe';\nimport open from 'open';\nimport updateNotifier from 'update-notifier';\nimport { FileSystem, type IPackageJson, JsonFile } from '@rushstack/node-core-library';\nimport type { IAppContext } from '@rushstack/lockfile-explorer-web/lib/AppContext';\nimport packageJSON from '../package.json';\nimport { init } from './init';\nimport type { IAppState } from './state';\n\nconst PORT: number = 8091;\n// Must not have a trailing slash\nconst SERVICE_URL: string = `http://localhost:${PORT}`;\n\nconst appState: IAppState = init();\n\nconsole.log(\n colors.bold(`\\nRush Lockfile Explorer ${appState.appVersion}`) +\n colors.cyan(' - https://lfx.rushstack.io/\\n')\n);\n\n// TODO: Later if we introduce more CLI parameters, switch to a proper CLI parser\nconst args: string[] = process.argv.slice(2);\nif (args.length > 0 && args[0] !== '--debug') {\n console.log('Usage: lockfile-explorer [--debug]\\n');\n console.log('The \"lfx\" command is a shorthand alias for \"lockfile-explorer\".');\n console.log('See the project website for documentation and support.\\n');\n process.exit(1);\n}\n\nupdateNotifier({ pkg: packageJSON }).notify();\n\nprocess.chdir(appState.lockfileExplorerProjectRoot);\nconst distFolderPath: string = `${appState.lockfileExplorerProjectRoot}/dist`;\nconst app: express.Application = express();\napp.use(express.json());\napp.use(cors());\n\n// Variable used to check if the front-end client is still connected\nlet awaitingFirstConnect: boolean = true;\nlet isClientConnected: boolean = false;\nlet disconnected: boolean = false;\nsetInterval(() => {\n if (!isClientConnected && !awaitingFirstConnect && !disconnected) {\n console.log(colors.red('The client has disconnected!'));\n console.log(`Please open a browser window at http://localhost:${PORT}/app`);\n disconnected = true;\n } else if (!awaitingFirstConnect) {\n isClientConnected = false;\n }\n}, 4000);\n\n// This takes precedence over the `/app` static route, which also has an `initappcontext.js` file.\napp.get('/initappcontext.js', (req: express.Request, res: express.Response) => {\n const appContext: IAppContext = {\n serviceUrl: SERVICE_URL,\n appVersion: appState.appVersion,\n debugMode: process.argv.indexOf('--debug') >= 0\n };\n const sourceCode: string = [\n `console.log('Loaded initappcontext.js');`,\n `appContext = ${JSON.stringify(appContext)}`\n ].join('\\n');\n\n res.type('application/javascript').send(sourceCode);\n});\n\napp.use('/', express.static(distFolderPath));\n\napp.use('/favicon.ico', express.static(distFolderPath, { index: 'favicon.ico' }));\n\napp.get('/api/lockfile', async (req: express.Request, res: express.Response) => {\n const pnpmLockfileText: string = await FileSystem.readFileAsync(appState.pnpmLockfileLocation);\n const doc = yaml.load(pnpmLockfileText);\n res.send(doc);\n});\n\napp.get('/api/health', (req: express.Request, res: express.Response) => {\n awaitingFirstConnect = false;\n isClientConnected = true;\n if (disconnected) {\n disconnected = false;\n console.log(colors.green('The client has reconnected!'));\n }\n res.status(200).send();\n});\n\napp.post(\n '/api/package-json',\n async (req: express.Request<{}, {}, { projectPath: string }, {}>, res: express.Response) => {\n const { projectPath } = req.body;\n const fileLocation = `${appState.projectRoot}/${projectPath}/package.json`;\n let packageJsonText: string;\n try {\n packageJsonText = await FileSystem.readFileAsync(fileLocation);\n } catch (e) {\n if (FileSystem.isNotExistError(e)) {\n return res.status(404).send({\n message: `Could not load package.json file for this package. Have you installed all the dependencies for this workspace?`,\n error: `No package.json in location: ${projectPath}`\n });\n } else {\n throw e;\n }\n }\n\n res.send(packageJsonText);\n }\n);\n\napp.get('/api/pnpmfile', async (req: express.Request, res: express.Response) => {\n let pnpmfile: string;\n try {\n pnpmfile = await FileSystem.readFileAsync(appState.pnpmfileLocation);\n } catch (e) {\n if (FileSystem.isNotExistError(e)) {\n return res.status(404).send({\n message: `Could not load pnpmfile file in this repo.`,\n error: `No .pnpmifile.cjs found.`\n });\n } else {\n throw e;\n }\n }\n\n res.send(pnpmfile);\n});\n\napp.post(\n '/api/package-spec',\n async (req: express.Request<{}, {}, { projectPath: string }, {}>, res: express.Response) => {\n const { projectPath } = req.body;\n const fileLocation = `${appState.projectRoot}/${projectPath}/package.json`;\n let packageJson: IPackageJson;\n try {\n packageJson = await JsonFile.loadAsync(fileLocation);\n } catch (e) {\n if (FileSystem.isNotExistError(e)) {\n return res.status(404).send({\n message: `Could not load package.json file in location: ${projectPath}`\n });\n } else {\n throw e;\n }\n }\n\n const {\n hooks: { readPackage }\n } = require(appState.pnpmfileLocation);\n const parsedPackage = readPackage(packageJson);\n res.send(parsedPackage);\n }\n);\n\napp.listen(PORT, async () => {\n console.log(`App launched on ${SERVICE_URL}`);\n\n if (!process.argv.includes('--debug')) {\n try {\n // Launch the web browser\n await open(SERVICE_URL);\n } catch (e) {\n console.error('Error launching browser: ' + e.toString());\n }\n }\n});\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushstack/lockfile-explorer",
3
- "version": "0.1.8",
3
+ "version": "0.2.0",
4
4
  "description": "Rush Lockfile Explorer: The UI for solving version conflicts quickly in a large monorepo",
5
5
  "keywords": [
6
6
  "conflict",
@@ -25,7 +25,8 @@
25
25
  "homepage": "https://lfx.rushstack.io/",
26
26
  "license": "MIT",
27
27
  "bin": {
28
- "lockfile-explorer": "./bin/lockfile-explorer"
28
+ "lockfile-explorer": "./bin/lockfile-explorer",
29
+ "lfx": "./bin/lockfile-explorer"
29
30
  },
30
31
  "devDependencies": {
31
32
  "@microsoft/rush-lib": "5.88.1",