diffstalker 0.1.4 → 0.1.5

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/App.js CHANGED
@@ -1 +1 @@
1
- import{jsx as i,jsxs as W}from"react/jsx-runtime";import{useState as u,useCallback as c,useMemo as vt,useEffect as M,useRef as _}from"react";import{Box as B,Text as A,useApp as Dt,useInput as Ht}from"ink";import{Header as Ft,getHeaderHeight as Lt}from"./components/Header.js";import{getFileAtIndex as Fe,getTotalFileCount as Mt}from"./components/FileList.js";import{getCommitIndexFromRow as At}from"./components/HistoryView.js";import{Footer as Et}from"./components/Footer.js";import{TopPane as Ot}from"./components/TopPane.js";import{BottomPane as Ut}from"./components/BottomPane.js";import{useWatcher as jt}from"./hooks/useWatcher.js";import{useGit as Nt}from"./hooks/useGit.js";import{useKeymap as Wt}from"./hooks/useKeymap.js";import{useMouse as _t}from"./hooks/useMouse.js";import{useTerminalSize as zt}from"./hooks/useTerminalSize.js";import{useLayout as Gt,SPLIT_RATIO_STEP as Le}from"./hooks/useLayout.js";import{useHistoryState as Kt}from"./hooks/useHistoryState.js";import{useCompareState as Qt}from"./hooks/useCompareState.js";import{getClickedFileIndex as Yt,getClickedTab as qt,getFooterLeftClick as Jt,isButtonAreaClick as Vt,isInPane as oe}from"./utils/mouseCoordinates.js";import{saveConfig as Me}from"./config.js";import{ThemePicker as Xt}from"./components/ThemePicker.js";import{HotkeysModal as Zt}from"./components/HotkeysModal.js";import{BaseBranchPicker as $t}from"./components/BaseBranchPicker.js";export function App({config:p,initialPath:Ae}){const{exit:Ee}=Dt(),{rows:k,columns:r}=zt(),{state:z,setEnabled:Oe}=jt(p.watcherEnabled,p.targetFile,p.debug),R=Ae??z.path??process.cwd(),{status:v,diff:ie,selectedFile:Ue,isLoading:ne,error:re,selectFile:se,stage:g,unstage:y,discard:je,stageAll:Ne,unstageAll:We,commit:_e,refresh:ze,getHeadCommitMessage:Ge,compareDiff:w,compareLoading:Ke,compareError:Qe,refreshCompareDiff:Ye,getCandidateBaseBranches:qe,setCompareBaseBranch:Je,historySelectedCommit:ae,historyCommitDiff:le,selectHistoryCommit:Ve,compareSelectionDiff:Xe,selectCompareCommit:Ze}=Nt(R),m=v?.files??[],s=Mt(m),ce=m.filter(e=>e.staged).length,[l,f]=u("files"),[t,me]=u("diff"),[C,E]=u(0),[D,G]=u(null),[fe,$e]=u(!1),[de,et]=u(p.theme),[H,S]=u(null),[K,he]=u(!1),ue=Lt(R,v?.branch??null,z,r,re,ne),tt=ue-1,{topPaneHeight:Q,bottomPaneHeight:ot,paneBoundaries:pe,splitRatio:Y,adjustSplitRatio:ge,fileListScrollOffset:q,diffScrollOffset:it,historyScrollOffset:O,compareScrollOffset:U,setDiffScrollOffset:x,setHistoryScrollOffset:J,setCompareScrollOffset:nt,scrollDiff:P,scrollFileList:ye,scrollHistory:Ce,scrollCompare:Se}=Gt(k,r,m,C,ie,t,void 0,p.splitRatio,tt),{commits:j,historySelectedIndex:rt,setHistorySelectedIndex:F,historyDiffTotalRows:Te,navigateHistoryUp:be,navigateHistoryDown:we,historyTotalRows:xe}=Kt({repoPath:R,isActive:t==="history",selectHistoryCommit:Ve,historyCommitDiff:le,historySelectedCommit:ae,terminalWidth:r,topPaneHeight:Q,historyScrollOffset:O,setHistoryScrollOffset:J,setDiffScrollOffset:x,status:v}),{includeUncommitted:st,compareListSelection:d,baseBranchCandidates:at,showBaseBranchPicker:V,compareTotalItems:X,compareDiffTotalRows:I,setCompareSelectedIndex:Pe,toggleIncludeUncommitted:lt,openBaseBranchPicker:ct,closeBaseBranchPicker:mt,selectBaseBranch:ft,navigateCompareUp:Ie,navigateCompareDown:Be,markSelectionInitialized:ke,getItemIndexFromRow:Re}=Qt({repoPath:R,isActive:t==="compare",compareDiff:w,refreshCompareDiff:Ye,getCandidateBaseBranches:qe,setCompareBaseBranch:Je,selectCompareCommit:Ze,topPaneHeight:Q,compareScrollOffset:U,setCompareScrollOffset:nt,setDiffScrollOffset:x,status:v}),ve=_(pe);ve.current=pe;const dt=_(p.splitRatio);M(()=>{if(Y!==dt.current){const e=setTimeout(()=>Me({splitRatio:Y}),500);return()=>clearTimeout(e)}},[Y]);const a=vt(()=>Fe(m,C),[m,C]);M(()=>{s>0&&C>=s&&E(Math.max(0,s-1))},[s,C]),M(()=>{se(a)},[a,se]),M(()=>{(t==="diff"||t==="commit")&&x(0)},[C,t,x]);const T=c(e=>{me(e),f({diff:"files",commit:"commit",history:"history",compare:"compare"}[e])},[]),De=_(()=>{}),ht=c(e=>{const{x:h,y:b,type:N,button:ee}=e,{stagingPaneStart:L,fileListEnd:te,diffPaneStart:It,diffPaneEnd:Bt,footerRow:kt}=ve.current;if(N==="click"){if(H!==null){S(null);return}if(b===kt&&ee==="left"){const n=qt(h,r);if(n){T(n);return}const o=Jt(h);if(o==="hotkeys"){S("hotkeys");return}else if(o==="mouse-mode"){De.current();return}else if(o==="auto-tab"){he(Rt=>!Rt);return}}if(oe(b,L+1,te)){if(t==="diff"||t==="commit"){const n=Yt(b,q,m,L,te);if(n>=0&&n<s){E(n),f("files");const o=Fe(m,n);o&&(ee==="right"&&!o.staged&&o.status!=="untracked"?G(o):ee==="left"&&Vt(h)&&(o.staged?y(o):g(o)));return}}else if(t==="history"){const n=b-L-1,o=At(n,j,r,O);if(o>=0&&o<j.length){F(o),f("history"),x(0);return}}else if(t==="compare"&&w){const n=b-L-1+U,o=Re(n);if(o>=0&&o<X){ke(),Pe(o),f("compare");return}}}oe(b,It,Bt)&&f(t)}else if(N==="scroll-up"||N==="scroll-down"){const n=N==="scroll-up"?"up":"down";if(oe(b,L,te))t==="diff"||t==="commit"?ye(n):t==="history"?Ce(n,xe):t==="compare"&&Se(n,X);else{let o;t==="compare"&&d?.type!=="commit"?o=I:t==="history"&&(o=Te),P(n,3,o)}}},[r,q,m,s,t,j,w,X,g,y,P,ye,Ce,Se,O,U,x,F,Pe,ke,Re,d?.type,I,Te,xe,H]),ut=fe||V,{mouseEnabled:pt,toggleMouse:He}=_t(ht,ut);De.current=He;const Z=_(s);M(()=>{if(!K){Z.current=s;return}const e=Z.current;e===0&&s>0?T("diff"):e>0&&s===0&&(F(0),J(0),T("history")),Z.current=s},[s,K,T,F,J]);const gt=c(()=>{if(l==="files")E(e=>Math.max(0,e-1));else if(l==="diff"){const e=t==="compare"&&d?.type!=="commit"?I:void 0;P("up",3,e)}else l==="history"?be():l==="compare"&&Ie()},[l,t,d?.type,I,P,be,Ie]),yt=c(()=>{if(l==="files")E(e=>Math.min(s-1,e+1));else if(l==="diff"){const e=t==="compare"&&d?.type!=="commit"?I:void 0;P("down",3,e)}else l==="history"?we():l==="compare"&&Be()},[l,t,d?.type,I,s,P,we,Be]),Ct=c(()=>{t==="diff"||t==="commit"?f(e=>e==="files"?"diff":"files"):t==="history"?f(e=>e==="history"?"diff":"history"):t==="compare"&&f(e=>e==="compare"?"diff":"compare")},[t]),St=c(async()=>{a&&!a.staged&&await g(a)},[a,g]),Tt=c(async()=>{a?.staged&&await y(a)},[a,y]),bt=c(async()=>{a&&(a.staged?await y(a):await g(a))},[a,g,y]),wt=c(()=>T("commit"),[T]),xt=c(()=>{me("diff"),f("files")},[]),Pt=c(e=>{et(e),S(null),Me({theme:e})},[]);Wt({onStage:St,onUnstage:Tt,onStageAll:Ne,onUnstageAll:We,onCommit:wt,onQuit:Ee,onRefresh:ze,onNavigateUp:gt,onNavigateDown:yt,onTogglePane:Ct,onSwitchTab:T,onSelect:bt,onToggleIncludeUncommitted:lt,onCycleBaseBranch:ct,onOpenThemePicker:()=>S("theme"),onShrinkTopPane:()=>ge(-Le),onGrowTopPane:()=>ge(Le),onOpenHotkeysModal:()=>S("hotkeys"),onToggleMouse:He,onToggleFollow:()=>Oe(e=>!e),onToggleAutoTab:()=>he(e=>!e)},l,fe||H!==null||V),Ht((e,h)=>{D&&(e==="y"||e==="Y"?(je(D),G(null)):(e==="n"||e==="N"||h.escape)&&G(null))},{isActive:!!D});const $=()=>i(A,{dimColor:!0,children:"\u2500".repeat(r)});return W(B,{flexDirection:"column",height:k,width:r,children:[i(B,{height:ue,width:r,children:i(Ft,{repoPath:R,branch:v?.branch??null,isLoading:ne,error:re,debug:p.debug,watcherState:z,width:r})}),i($,{}),i(Ot,{bottomTab:t,currentPane:l,terminalWidth:r,topPaneHeight:Q,files:m,selectedIndex:C,fileListScrollOffset:q,stagedCount:ce,onStage:g,onUnstage:y,commits:j,historySelectedIndex:rt,historyScrollOffset:O,onSelectHistoryCommit:(e,h)=>F(h),compareDiff:w,compareListSelection:d,compareScrollOffset:U,includeUncommitted:st}),i($,{}),i(Ut,{bottomTab:t,currentPane:l,terminalWidth:r,bottomPaneHeight:ot,diffScrollOffset:it,currentTheme:de,diff:ie,selectedFile:Ue,stagedCount:ce,onCommit:_e,onCommitCancel:xt,getHeadCommitMessage:Ge,onCommitInputFocusChange:$e,historySelectedCommit:ae,historyCommitDiff:le,compareDiff:w,compareLoading:Ke,compareError:Qe,compareListSelection:d,compareSelectionDiff:Xe}),i($,{}),D?W(B,{children:[W(A,{color:"yellow",bold:!0,children:["Discard changes to"," "]}),i(A,{color:"cyan",children:D.path}),W(A,{color:"yellow",bold:!0,children:["?"," "]}),i(A,{dimColor:!0,children:"(y/n)"})]}):i(Et,{activeTab:t,mouseEnabled:pt,autoTabEnabled:K}),H==="theme"&&i(B,{position:"absolute",marginTop:0,marginLeft:0,children:i(Xt,{currentTheme:de,onSelect:Pt,onCancel:()=>S(null),width:r,height:k})}),H==="hotkeys"&&i(B,{position:"absolute",marginTop:0,marginLeft:0,children:i(Zt,{onClose:()=>S(null),width:r,height:k})}),V&&i(B,{position:"absolute",marginTop:0,marginLeft:0,children:i($t,{candidates:at,currentBranch:w?.baseBranch??null,onSelect:ft,onCancel:mt,width:r,height:k})})]})}
1
+ import{jsx as i,jsxs as W}from"react/jsx-runtime";import{useState as u,useCallback as c,useMemo as vt,useEffect as M,useRef as _}from"react";import{Box as B,Text as A,useApp as Dt,useInput as Ht}from"ink";import{Header as Ft,getHeaderHeight as Lt}from"./components/Header.js";import{getFileAtIndex as Fe,getTotalFileCount as Mt}from"./components/FileList.js";import{getCommitIndexFromRow as At}from"./components/HistoryView.js";import{Footer as Et}from"./components/Footer.js";import{TopPane as Ot}from"./components/TopPane.js";import{BottomPane as Ut}from"./components/BottomPane.js";import{useWatcher as jt}from"./hooks/useWatcher.js";import{useGit as Nt}from"./hooks/useGit.js";import{useKeymap as Wt}from"./hooks/useKeymap.js";import{useMouse as _t}from"./hooks/useMouse.js";import{useTerminalSize as zt}from"./hooks/useTerminalSize.js";import{useLayout as Gt,SPLIT_RATIO_STEP as Le}from"./hooks/useLayout.js";import{useHistoryState as Kt}from"./hooks/useHistoryState.js";import{useCompareState as Qt}from"./hooks/useCompareState.js";import{getClickedFileIndex as Xt,getClickedTab as Yt,getFooterLeftClick as qt,isButtonAreaClick as Jt,isInPane as oe}from"./utils/mouseCoordinates.js";import{saveConfig as Me}from"./config.js";import{ThemePicker as Vt}from"./components/ThemePicker.js";import{HotkeysModal as Zt}from"./components/HotkeysModal.js";import{BaseBranchPicker as $t}from"./components/BaseBranchPicker.js";export function App({config:p,initialPath:Ae}){const{exit:Ee}=Dt(),{rows:k,columns:r}=zt(),{state:z,setEnabled:Oe}=jt(p.watcherEnabled,p.targetFile,p.debug),R=Ae??z.path??process.cwd(),{status:v,diff:ie,selectedFile:Ue,isLoading:ne,error:re,selectFile:se,stage:g,unstage:y,discard:je,stageAll:Ne,unstageAll:We,commit:_e,refresh:ze,getHeadCommitMessage:Ge,compareDiff:w,compareLoading:Ke,compareError:Qe,refreshCompareDiff:Xe,getCandidateBaseBranches:Ye,setCompareBaseBranch:qe,historySelectedCommit:ae,historyCommitDiff:le,selectHistoryCommit:Je,compareSelectionDiff:Ve,selectCompareCommit:Ze}=Nt(R),m=v?.files??[],s=Mt(m),ce=m.filter(e=>e.staged).length,[l,f]=u("files"),[t,me]=u("diff"),[C,E]=u(0),[D,G]=u(null),[fe,$e]=u(!1),[de,et]=u(p.theme),[H,S]=u(null),[K,he]=u(!1),ue=Lt(R,v?.branch??null,z,r,re,ne),tt=ue-1,{topPaneHeight:Q,bottomPaneHeight:ot,paneBoundaries:pe,splitRatio:X,adjustSplitRatio:ge,fileListScrollOffset:Y,diffScrollOffset:it,historyScrollOffset:O,compareScrollOffset:U,setDiffScrollOffset:x,setHistoryScrollOffset:q,setCompareScrollOffset:nt,scrollDiff:P,scrollFileList:ye,scrollHistory:Ce,scrollCompare:Se}=Gt(k,r,m,C,ie,t,void 0,p.splitRatio,tt),{commits:j,historySelectedIndex:rt,setHistorySelectedIndex:F,historyDiffTotalRows:Te,navigateHistoryUp:be,navigateHistoryDown:we,historyTotalRows:xe}=Kt({repoPath:R,isActive:t==="history",selectHistoryCommit:Je,historyCommitDiff:le,historySelectedCommit:ae,terminalWidth:r,topPaneHeight:Q,historyScrollOffset:O,setHistoryScrollOffset:q,setDiffScrollOffset:x,status:v}),{includeUncommitted:st,compareListSelection:d,baseBranchCandidates:at,showBaseBranchPicker:J,compareTotalItems:V,compareDiffTotalRows:I,setCompareSelectedIndex:Pe,toggleIncludeUncommitted:lt,openBaseBranchPicker:ct,closeBaseBranchPicker:mt,selectBaseBranch:ft,navigateCompareUp:Ie,navigateCompareDown:Be,markSelectionInitialized:ke,getItemIndexFromRow:Re}=Qt({repoPath:R,isActive:t==="compare",compareDiff:w,refreshCompareDiff:Xe,getCandidateBaseBranches:Ye,setCompareBaseBranch:qe,selectCompareCommit:Ze,topPaneHeight:Q,compareScrollOffset:U,setCompareScrollOffset:nt,setDiffScrollOffset:x,status:v}),ve=_(pe);ve.current=pe;const dt=_(p.splitRatio);M(()=>{if(X!==dt.current){const e=setTimeout(()=>Me({splitRatio:X}),500);return()=>clearTimeout(e)}},[X]);const a=vt(()=>Fe(m,C),[m,C]);M(()=>{s>0&&C>=s&&E(Math.max(0,s-1))},[s,C]),M(()=>{se(a)},[a,se]),M(()=>{(t==="diff"||t==="commit")&&x(0)},[C,t,x]);const T=c(e=>{me(e),f({diff:"files",commit:"commit",history:"history",compare:"compare"}[e])},[]),De=_(()=>{}),ht=c(e=>{const{x:h,y:b,type:N,button:ee}=e,{stagingPaneStart:L,fileListEnd:te,diffPaneStart:It,diffPaneEnd:Bt,footerRow:kt}=ve.current;if(N==="click"){if(H!==null){S(null);return}if(b===kt&&ee==="left"){const n=Yt(h,r);if(n){T(n);return}const o=qt(h);if(o==="hotkeys"){S("hotkeys");return}else if(o==="mouse-mode"){De.current();return}else if(o==="auto-tab"){he(Rt=>!Rt);return}}if(oe(b,L+1,te)){if(t==="diff"||t==="commit"){const n=Xt(b,Y,m,L,te);if(n>=0&&n<s){E(n),f("files");const o=Fe(m,n);o&&(ee==="right"&&!o.staged&&o.status!=="untracked"?G(o):ee==="left"&&Jt(h)&&(o.staged?y(o):g(o)));return}}else if(t==="history"){const n=b-L-1,o=At(n,j,r,O);if(o>=0&&o<j.length){F(o),f("history"),x(0);return}}else if(t==="compare"&&w){const n=b-L-1+U,o=Re(n);if(o>=0&&o<V){ke(),Pe(o),f("compare");return}}}oe(b,It,Bt)&&f(t)}else if(N==="scroll-up"||N==="scroll-down"){const n=N==="scroll-up"?"up":"down";if(oe(b,L,te))t==="diff"||t==="commit"?ye(n):t==="history"?Ce(n,xe):t==="compare"&&Se(n,V);else{let o;t==="compare"&&d?.type!=="commit"?o=I:t==="history"&&(o=Te),P(n,3,o)}}},[r,Y,m,s,t,j,w,V,g,y,P,ye,Ce,Se,O,U,x,F,Pe,ke,Re,d?.type,I,Te,xe,H]),ut=fe||J,{mouseEnabled:pt,toggleMouse:He}=_t(ht,ut);De.current=He;const Z=_(s);M(()=>{if(!K){Z.current=s;return}const e=Z.current;e===0&&s>0?T("diff"):e>0&&s===0&&(F(0),q(0),T("history")),Z.current=s},[s,K,T,F,q]);const gt=c(()=>{if(l==="files")E(e=>Math.max(0,e-1));else if(l==="diff"){const e=t==="compare"&&d?.type!=="commit"?I:void 0;P("up",3,e)}else l==="history"?be():l==="compare"&&Ie()},[l,t,d?.type,I,P,be,Ie]),yt=c(()=>{if(l==="files")E(e=>Math.min(s-1,e+1));else if(l==="diff"){const e=t==="compare"&&d?.type!=="commit"?I:void 0;P("down",3,e)}else l==="history"?we():l==="compare"&&Be()},[l,t,d?.type,I,s,P,we,Be]),Ct=c(()=>{t==="diff"||t==="commit"?f(e=>e==="files"?"diff":"files"):t==="history"?f(e=>e==="history"?"diff":"history"):t==="compare"&&f(e=>e==="compare"?"diff":"compare")},[t]),St=c(async()=>{a&&!a.staged&&await g(a)},[a,g]),Tt=c(async()=>{a?.staged&&await y(a)},[a,y]),bt=c(async()=>{a&&(a.staged?await y(a):await g(a))},[a,g,y]),wt=c(()=>T("commit"),[T]),xt=c(()=>{me("diff"),f("files")},[]),Pt=c(e=>{et(e),S(null),Me({theme:e})},[]);Wt({onStage:St,onUnstage:Tt,onStageAll:Ne,onUnstageAll:We,onCommit:wt,onQuit:Ee,onRefresh:ze,onNavigateUp:gt,onNavigateDown:yt,onTogglePane:Ct,onSwitchTab:T,onSelect:bt,onToggleIncludeUncommitted:lt,onCycleBaseBranch:ct,onOpenThemePicker:()=>S("theme"),onShrinkTopPane:()=>ge(-Le),onGrowTopPane:()=>ge(Le),onOpenHotkeysModal:()=>S("hotkeys"),onToggleMouse:He,onToggleFollow:()=>Oe(e=>!e),onToggleAutoTab:()=>he(e=>!e)},l,fe||H!==null||J),Ht((e,h)=>{D&&(e==="y"||e==="Y"?(je(D),G(null)):(e==="n"||e==="N"||h.escape)&&G(null))},{isActive:!!D});const $=()=>i(A,{dimColor:!0,children:"\u2500".repeat(r)});return W(B,{flexDirection:"column",height:k,width:r,overflowX:"hidden",children:[i(B,{height:ue,width:r,children:i(Ft,{repoPath:R,branch:v?.branch??null,isLoading:ne,error:re,debug:p.debug,watcherState:z,width:r})}),i($,{}),i(Ot,{bottomTab:t,currentPane:l,terminalWidth:r,topPaneHeight:Q,files:m,selectedIndex:C,fileListScrollOffset:Y,stagedCount:ce,onStage:g,onUnstage:y,commits:j,historySelectedIndex:rt,historyScrollOffset:O,onSelectHistoryCommit:(e,h)=>F(h),compareDiff:w,compareListSelection:d,compareScrollOffset:U,includeUncommitted:st}),i($,{}),i(Ut,{bottomTab:t,currentPane:l,terminalWidth:r,bottomPaneHeight:ot,diffScrollOffset:it,currentTheme:de,diff:ie,selectedFile:Ue,stagedCount:ce,onCommit:_e,onCommitCancel:xt,getHeadCommitMessage:Ge,onCommitInputFocusChange:$e,historySelectedCommit:ae,historyCommitDiff:le,compareDiff:w,compareLoading:Ke,compareError:Qe,compareListSelection:d,compareSelectionDiff:Ve}),i($,{}),D?W(B,{children:[W(A,{color:"yellow",bold:!0,children:["Discard changes to"," "]}),i(A,{color:"cyan",children:D.path}),W(A,{color:"yellow",bold:!0,children:["?"," "]}),i(A,{dimColor:!0,children:"(y/n)"})]}):i(Et,{activeTab:t,mouseEnabled:pt,autoTabEnabled:K}),H==="theme"&&i(B,{position:"absolute",marginTop:0,marginLeft:0,children:i(Vt,{currentTheme:de,onSelect:Pt,onCancel:()=>S(null),width:r,height:k})}),H==="hotkeys"&&i(B,{position:"absolute",marginTop:0,marginLeft:0,children:i(Zt,{onClose:()=>S(null),width:r,height:k})}),J&&i(B,{position:"absolute",marginTop:0,marginLeft:0,children:i($t,{candidates:at,currentBranch:w?.baseBranch??null,onSelect:ft,onCancel:mt,width:r,height:k})})]})}
@@ -1 +1 @@
1
- import{jsx as r,jsxs as u}from"react/jsx-runtime";import{Box as x,Text as i}from"ink";import{DiffView as C}from"./DiffView.js";import{CommitPanel as O}from"./CommitPanel.js";import{HistoryDiffView as _}from"./HistoryDiffView.js";import{CompareView as A}from"./CompareView.js";import{shortenPath as g}from"../utils/formatPath.js";export function BottomPane({bottomTab:e,currentPane:f,terminalWidth:s,bottomPaneHeight:o,diffScrollOffset:d,currentTheme:t,diff:w,selectedFile:c,stagedCount:j,onCommit:y,onCommitCancel:H,getHeadCommitMessage:v,onCommitInputFocusChange:I,historySelectedCommit:h,historyCommitDiff:M,compareDiff:l,compareLoading:V,compareError:a,compareListSelection:n,compareSelectionDiff:p}){const B=f!=="files"&&f!=="history"&&f!=="compare",D=()=>{if(c&&e==="diff")return r(i,{dimColor:!0,children:g(c.path,s-10)});if(e==="history"&&h)return u(i,{dimColor:!0,children:[h.shortHash," - ",h.message.slice(0,50)]});if(e==="compare"&&n)if(n.type==="commit"){const m=l?.commits[n.index];return u(i,{dimColor:!0,children:[m?.shortHash??""," - ",m?.message.slice(0,40)??""]})}else{const m=l?.files[n.index]?.path??"";return r(i,{dimColor:!0,children:g(m,s-10)})}return null},F=()=>e==="diff"?r(C,{diff:w,filePath:c?.path,maxHeight:o-1,scrollOffset:d,theme:t}):e==="commit"?r(O,{isActive:f==="commit",stagedCount:j,onCommit:y,onCancel:H,getHeadMessage:v,onInputFocusChange:I}):e==="history"?r(_,{commit:h,diff:M,maxHeight:o-1,scrollOffset:d,theme:t}):V?r(i,{dimColor:!0,children:"Loading compare diff..."}):a?r(i,{color:"red",children:a}):n?.type==="commit"&&p?r(C,{diff:p,maxHeight:o-1,scrollOffset:d,theme:t}):l?r(A,{compareDiff:l,isLoading:!1,error:null,scrollOffset:d,maxHeight:o-1,theme:t}):r(i,{dimColor:!0,children:"No compare diff available"});return u(x,{flexDirection:"column",height:o,width:s,overflowY:"hidden",children:[u(x,{width:s,children:[r(i,{bold:!0,color:B?"cyan":void 0,children:e==="commit"?"COMMIT":"DIFF"}),r(x,{flexGrow:1,justifyContent:"flex-end",children:D()})]}),F()]})}
1
+ import{jsx as r,jsxs as m}from"react/jsx-runtime";import{Box as x,Text as o}from"ink";import{DiffView as C}from"./DiffView.js";import{CommitPanel as O}from"./CommitPanel.js";import{HistoryDiffView as _}from"./HistoryDiffView.js";import{CompareView as A}from"./CompareView.js";import{shortenPath as g}from"../utils/formatPath.js";export function BottomPane({bottomTab:e,currentPane:n,terminalWidth:i,bottomPaneHeight:f,diffScrollOffset:d,currentTheme:h,diff:a,selectedFile:c,stagedCount:j,onCommit:y,onCommitCancel:H,getHeadCommitMessage:v,onCommitInputFocusChange:I,historySelectedCommit:t,historyCommitDiff:M,compareDiff:u,compareLoading:V,compareError:p,compareListSelection:s,compareSelectionDiff:w}){const B=n!=="files"&&n!=="history"&&n!=="compare",D=()=>{if(c&&e==="diff")return r(o,{dimColor:!0,children:g(c.path,i-10)});if(e==="history"&&t)return m(o,{dimColor:!0,children:[t.shortHash," - ",t.message.slice(0,50)]});if(e==="compare"&&s)if(s.type==="commit"){const l=u?.commits[s.index];return m(o,{dimColor:!0,children:[l?.shortHash??""," - ",l?.message.slice(0,40)??""]})}else{const l=u?.files[s.index]?.path??"";return r(o,{dimColor:!0,children:g(l,i-10)})}return null},F=()=>e==="diff"?r(C,{diff:a,filePath:c?.path,maxHeight:f-1,scrollOffset:d,theme:h,width:i}):e==="commit"?r(O,{isActive:n==="commit",stagedCount:j,onCommit:y,onCancel:H,getHeadMessage:v,onInputFocusChange:I}):e==="history"?r(_,{commit:t,diff:M,maxHeight:f-1,scrollOffset:d,theme:h,width:i}):V?r(o,{dimColor:!0,children:"Loading compare diff..."}):p?r(o,{color:"red",children:p}):s?.type==="commit"&&w?r(C,{diff:w,maxHeight:f-1,scrollOffset:d,theme:h,width:i}):u?r(A,{compareDiff:u,isLoading:!1,error:null,scrollOffset:d,maxHeight:f-1,theme:h,width:i}):r(o,{dimColor:!0,children:"No compare diff available"});return m(x,{flexDirection:"column",height:f,width:i,overflowX:"hidden",overflowY:"hidden",children:[m(x,{width:i,children:[r(o,{bold:!0,color:B?"cyan":void 0,children:e==="commit"?"COMMIT":"DIFF"}),r(x,{flexGrow:1,justifyContent:"flex-end",children:D()})]}),F()]})}
@@ -1 +1 @@
1
- import{jsx as r,jsxs as s}from"react/jsx-runtime";import{useMemo as a}from"react";import{Box as e,Text as o}from"ink";import{DiffView as c}from"./DiffView.js";import{buildCombinedCompareDiff as h}from"../utils/rowCalculations.js";export{buildCombinedCompareDiff,getCompareDiffTotalRows,getFileScrollOffset}from"../utils/rowCalculations.js";export function CompareView({compareDiff:i,isLoading:d,error:n,scrollOffset:t,maxHeight:f,theme:m="dark"}){const l=a(()=>h(i),[i]);return d?r(e,{paddingX:1,children:r(o,{dimColor:!0,children:"Loading diff..."})}):n?r(e,{paddingX:1,children:r(o,{color:"red",children:n})}):i?i.files.length===0?r(e,{paddingX:1,children:s(o,{dimColor:!0,children:["No changes compared to ",i.baseBranch]})}):r(c,{diff:l,maxHeight:f,scrollOffset:t,theme:m}):r(e,{paddingX:1,children:r(o,{dimColor:!0,children:"No base branch found (no origin/main or origin/master)"})})}
1
+ import{jsx as r,jsxs as a}from"react/jsx-runtime";import{useMemo as h}from"react";import{Box as e,Text as o}from"ink";import{DiffView as c}from"./DiffView.js";import{buildCombinedCompareDiff as u}from"../utils/rowCalculations.js";export{buildCombinedCompareDiff,getCompareDiffTotalRows,getFileScrollOffset}from"../utils/rowCalculations.js";export function CompareView({compareDiff:i,isLoading:d,error:n,scrollOffset:t,maxHeight:f,theme:m="dark",width:l}){const s=h(()=>u(i),[i]);return d?r(e,{paddingX:1,children:r(o,{dimColor:!0,children:"Loading diff..."})}):n?r(e,{paddingX:1,children:r(o,{color:"red",children:n})}):i?i.files.length===0?r(e,{paddingX:1,children:a(o,{dimColor:!0,children:["No changes compared to ",i.baseBranch]})}):r(c,{diff:s,maxHeight:f,scrollOffset:t,theme:m,width:l}):r(e,{paddingX:1,children:r(o,{dimColor:!0,children:"No base branch found (no origin/main or origin/master)"})})}
@@ -1 +1 @@
1
- import{jsx as c,jsxs as h}from"react/jsx-runtime";import{useMemo as k}from"react";import{Box as m,Text as a}from"ink";import{createEmphasize as E,common as B}from"emphasize";import p from"fast-diff";import{getTheme as D}from"../themes.js";import{ScrollableList as M}from"./ScrollableList.js";import{isDisplayableDiffLine as $}from"../utils/diffFilters.js";const A=E(B),H={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",py:"python",rb:"ruby",rs:"rust",go:"go",java:"java",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",php:"php",sh:"bash",bash:"bash",zsh:"bash",json:"json",yaml:"yaml",yml:"yaml",md:"markdown",html:"html",htm:"html",css:"css",scss:"scss",sass:"scss",less:"less",sql:"sql",xml:"xml",toml:"ini",ini:"ini",dockerfile:"dockerfile",makefile:"makefile",lua:"lua",vim:"vim",swift:"swift",kt:"kotlin",kts:"kotlin",scala:"scala",r:"r",pl:"perl",ex:"elixir",exs:"elixir",erl:"erlang",hs:"haskell",clj:"clojure",ml:"ocaml",fs:"fsharp",vue:"xml",svelte:"xml"};function T(t){if(!t)return;const e=t.split("/").pop()?.toLowerCase()??"";if(e==="dockerfile")return"dockerfile";if(e==="makefile"||e==="gnumakefile")return"makefile";const n=e.split(".").pop()?.toLowerCase();return n?H[n]||n:void 0}function W(t,e){if(!e||!t.trim())return t;try{return A.highlight(e,t).value}catch{return t}}function _(t){let e=0;for(const n of t)n.oldLineNum&&n.oldLineNum>e&&(e=n.oldLineNum),n.newLineNum&&n.newLineNum>e&&(e=n.newLineNum);return Math.max(3,String(e).length)}function x(t){return t.type==="addition"||t.type==="deletion"||t.type==="context"&&t.content.startsWith(" ")?t.content.slice(1):t.content}const R=3;function I(t){if(t.length===0)return t;const e=[];for(let n=0;n<t.length;n++){const o=t[n];if(!o.isChange&&o.text.length<R){const i=n>0&&e[e.length-1]?.isChange,r=n<t.length-1&&t[n+1]?.isChange;if(i||r){i&&e.length>0?e[e.length-1].text+=o.text:e.push({text:o.text,isChange:!0});continue}}e.length>0&&e[e.length-1].isChange===o.isChange?e[e.length-1].text+=o.text:e.push({...o})}return e}function z(t,e){const n=p(t,e);let o=[],i=[];for(const[r,s]of n)r===p.EQUAL?(o.push({text:s,isChange:!1}),i.push({text:s,isChange:!1})):r===p.DELETE?o.push({text:s,isChange:!0}):r===p.INSERT&&i.push({text:s,isChange:!0});return o=I(o),i=I(i),{oldSegments:o,newSegments:i}}function G(t,e){if(t.length===0&&e.length===0)return 1;if(t.length===0||e.length===0)return 0;const n=p(t,e);let o=0,i=0;for(const[r,s]of n)r===p.EQUAL&&(o+=s.length),i+=s.length;return i>0?o/i:0}const U=.35;function q(t){const e=new Map;for(let n=0;n<t.length-1;n++){const o=t[n],i=t[n+1];if(o.type==="deletion"&&i.type==="addition"){const r=x(o),s=x(i);if(G(r,s)>=U){const u={deletion:o,addition:i,deletionIndex:n,additionIndex:n+1};e.set(n,u),e.set(n+1,u)}}}return e}function j({segments:t,isAddition:e,theme:n}){const{colors:o}=n,i=e?o.addBg:o.delBg,r=e?o.addHighlight:o.delHighlight;return c(a,{backgroundColor:i,children:t.map((s,u)=>c(a,{color:o.text,backgroundColor:s.isChange?r:i,children:s.text||(u===t.length-1?" ":"")},u))})}function O({line:t,lineNumWidth:e,language:n,wordDiffSegments:o,theme:i}){const{colors:r}=i;if(t.type==="header"){const l=t.content;if(l.startsWith("diff --git")){const d=l.match(/diff --git a\/.+ b\/(.+)$/);if(d)return c(m,{children:h(a,{color:"cyan",bold:!0,children:["\u2500\u2500 ",d[1]," \u2500\u2500"]})})}return c(m,{children:c(a,{dimColor:!0,children:l})})}if(t.type==="hunk"){const l=t.content.match(/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(.*)$/);if(l){const d=parseInt(l[1],10),C=l[2]?parseInt(l[2],10):1,f=parseInt(l[3],10),y=l[4]?parseInt(l[4],10):1,L=l[5].trim(),N=d+C-1,w=f+y-1,S=C===1?`${d}`:`${d}-${N}`,v=y===1?`${f}`:`${f}-${w}`;return h(m,{children:[h(a,{color:"cyan",dimColor:!0,children:["Lines ",S," \u2192 ",v]}),L&&h(a,{color:"gray",children:[" ",L]})]})}return c(a,{color:"cyan",dimColor:!0,children:t.content})}const s=t.type==="addition"?t.newLineNum:t.type==="deletion"?t.oldLineNum:t.oldLineNum??t.newLineNum,u=s!==void 0?String(s).padStart(e," "):" ".repeat(e),g=x(t);if(t.type==="addition")return h(m,{children:[h(a,{backgroundColor:r.addBg,color:r.addLineNum,children:[u," "]}),h(a,{backgroundColor:r.addBg,color:r.addSymbol,bold:!0,children:["+"," "]}),o?c(j,{segments:o,isAddition:!0,theme:i}):c(a,{backgroundColor:r.addBg,color:r.text,children:g||" "})]});if(t.type==="deletion")return h(m,{children:[h(a,{backgroundColor:r.delBg,color:r.delLineNum,children:[u," "]}),h(a,{backgroundColor:r.delBg,color:r.delSymbol,bold:!0,children:["-"," "]}),o?c(j,{segments:o,isAddition:!1,theme:i}):c(a,{backgroundColor:r.delBg,color:r.text,children:g||" "})]});const b=W(g,n);return h(m,{children:[h(a,{color:r.contextLineNum,children:[u," "]}),c(a,{children:b})]})}export function DiffView({diff:t,filePath:e,maxHeight:n=20,scrollOffset:o=0,theme:i="dark"}){const r=k(()=>D(i),[i]),s=k(()=>T(e),[e]),u=k(()=>{if(!t)return new Map;const l=q(t.lines),d=new Map;for(const[C,f]of l)if(C===f.deletionIndex){const y=x(f.deletion),L=x(f.addition),{oldSegments:N,newSegments:w}=z(y,L);d.set(f.deletionIndex,N),d.set(f.additionIndex,w)}return d},[t]),g=k(()=>t?.lines.map((l,d)=>({line:l,originalIndex:d})).filter(({line:l})=>$(l))??[],[t]);if(!t||g.length===0)return c(m,{paddingX:1,children:c(a,{dimColor:!0,children:"No diff to display"})});const b=_(g.map(l=>l.line));return c(m,{flexDirection:"column",paddingX:1,children:c(M,{items:g,maxHeight:n,scrollOffset:o,getKey:l=>`${l.originalIndex}`,renderItem:l=>{const d=u.get(l.originalIndex);return c(O,{line:l.line,lineNumWidth:b,language:s,wordDiffSegments:d,theme:r})}})})}
1
+ import{jsx as a,jsxs as f}from"react/jsx-runtime";import{useMemo as I}from"react";import{Box as p,Text as u}from"ink";import{createEmphasize as R,common as z}from"emphasize";import L from"fast-diff";import{getTheme as G}from"../themes.js";import{ScrollableList as U}from"./ScrollableList.js";import{isDisplayableDiffLine as W}from"../utils/diffFilters.js";const X=R(z);function b(t,e){return e<=0||t.length<=e?t:e<=1?"\u2026":t.slice(0,e-1)+"\u2026"}const q={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",py:"python",rb:"ruby",rs:"rust",go:"go",java:"java",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",php:"php",sh:"bash",bash:"bash",zsh:"bash",json:"json",yaml:"yaml",yml:"yaml",md:"markdown",html:"html",htm:"html",css:"css",scss:"scss",sass:"scss",less:"less",sql:"sql",xml:"xml",toml:"ini",ini:"ini",dockerfile:"dockerfile",makefile:"makefile",lua:"lua",vim:"vim",swift:"swift",kt:"kotlin",kts:"kotlin",scala:"scala",r:"r",pl:"perl",ex:"elixir",exs:"elixir",erl:"erlang",hs:"haskell",clj:"clojure",ml:"ocaml",fs:"fsharp",vue:"xml",svelte:"xml"};function O(t){if(!t)return;const e=t.split("/").pop()?.toLowerCase()??"";if(e==="dockerfile")return"dockerfile";if(e==="makefile"||e==="gnumakefile")return"makefile";const n=e.split(".").pop()?.toLowerCase();return n?q[n]||n:void 0}function P(t,e){if(!e||!t.trim())return t;try{return X.highlight(e,t).value}catch{return t}}function Q(t){let e=0;for(const n of t)n.oldLineNum&&n.oldLineNum>e&&(e=n.oldLineNum),n.newLineNum&&n.newLineNum>e&&(e=n.newLineNum);return Math.max(3,String(e).length)}function N(t){return t.type==="addition"||t.type==="deletion"||t.type==="context"&&t.content.startsWith(" ")?t.content.slice(1):t.content}const F=3;function $(t){if(t.length===0)return t;const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(!r.isChange&&r.text.length<F){const o=n>0&&e[e.length-1]?.isChange,s=n<t.length-1&&t[n+1]?.isChange;if(o||s){o&&e.length>0?e[e.length-1].text+=r.text:e.push({text:r.text,isChange:!0});continue}}e.length>0&&e[e.length-1].isChange===r.isChange?e[e.length-1].text+=r.text:e.push({...r})}return e}function K(t,e){const n=L(t,e);let r=[],o=[];for(const[s,i]of n)s===L.EQUAL?(r.push({text:i,isChange:!1}),o.push({text:i,isChange:!1})):s===L.DELETE?r.push({text:i,isChange:!0}):s===L.INSERT&&o.push({text:i,isChange:!0});return r=$(r),o=$(o),{oldSegments:r,newSegments:o}}function V(t,e){if(t.length===0&&e.length===0)return 1;if(t.length===0||e.length===0)return 0;const n=L(t,e);let r=0,o=0;for(const[s,i]of n)s===L.EQUAL&&(r+=i.length),o+=i.length;return o>0?r/o:0}const Y=.35;function J(t){const e=new Map;for(let n=0;n<t.length-1;n++){const r=t[n],o=t[n+1];if(r.type==="deletion"&&o.type==="addition"){const s=N(r),i=N(o);if(V(s,i)>=Y){const d={deletion:r,addition:o,deletionIndex:n,additionIndex:n+1};e.set(n,d),e.set(n+1,d)}}}return e}function Z(t,e){const n=[];let r=e;for(const o of t){if(r<=0)break;if(o.text.length<=r)n.push(o),r-=o.text.length;else{const s=o.text.slice(0,r-1)+"\u2026";n.push({...o,text:s});break}}return n}function M({segments:t,isAddition:e,theme:n,maxWidth:r}){const{colors:o}=n,s=e?o.addBg:o.delBg,i=e?o.addHighlight:o.delHighlight,d=r?Z(t,r):t;return a(u,{backgroundColor:s,children:d.map((x,g)=>a(u,{color:o.text,backgroundColor:x.isChange?i:s,children:x.text||(g===d.length-1?" ":"")},g))})}function tt({line:t,lineNumWidth:e,language:n,wordDiffSegments:r,theme:o,maxWidth:s}){const{colors:i}=o,d=s?s-2:void 0;if(t.type==="header"){const c=t.content;if(c.startsWith("diff --git")){const m=c.match(/diff --git a\/.+ b\/(.+)$/);if(m){const C=d?d-6:void 0,y=C?b(m[1],C):m[1];return a(p,{children:f(u,{color:"cyan",bold:!0,children:["\u2500\u2500 ",y," \u2500\u2500"]})})}}const k=d?b(c,d):c;return a(p,{children:a(u,{dimColor:!0,children:k})})}if(t.type==="hunk"){const c=t.content.match(/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(.*)$/);if(c){const m=parseInt(c[1],10),C=c[2]?parseInt(c[2],10):1,y=parseInt(c[3],10),v=c[4]?parseInt(c[4],10):1,E=c[5].trim(),T=m+C-1,H=y+v-1,A=C===1?`${m}`:`${m}-${T}`,_=v===1?`${y}`:`${y}-${H}`,B=`Lines ${A} \u2192 ${_}`,S=d?d-B.length-1:void 0,D=E&&S&&S>3?b(E,S):"";return f(p,{children:[a(u,{color:"cyan",dimColor:!0,children:B}),D&&f(u,{color:"gray",children:[" ",D]})]})}const k=d?b(t.content,d):t.content;return a(u,{color:"cyan",dimColor:!0,children:k})}const x=t.type==="addition"?t.newLineNum:t.type==="deletion"?t.oldLineNum:t.oldLineNum??t.newLineNum,g=x!==void 0?String(x).padStart(e," "):" ".repeat(e),w=N(t),l=s?s-e-5:void 0,h=l?b(w,l):w;if(t.type==="addition")return f(p,{children:[f(u,{backgroundColor:i.addBg,color:i.addLineNum,children:[g," "]}),f(u,{backgroundColor:i.addBg,color:i.addSymbol,bold:!0,children:["+"," "]}),r?a(M,{segments:r,isAddition:!0,theme:o,maxWidth:l}):a(u,{backgroundColor:i.addBg,color:i.text,children:h||" "})]});if(t.type==="deletion")return f(p,{children:[f(u,{backgroundColor:i.delBg,color:i.delLineNum,children:[g," "]}),f(u,{backgroundColor:i.delBg,color:i.delSymbol,bold:!0,children:["-"," "]}),r?a(M,{segments:r,isAddition:!1,theme:o,maxWidth:l}):a(u,{backgroundColor:i.delBg,color:i.text,children:h||" "})]});const j=P(h,n);return f(p,{children:[f(u,{color:i.contextLineNum,children:[g," "]}),a(u,{children:j})]})}export function DiffView({diff:t,filePath:e,maxHeight:n=20,scrollOffset:r=0,theme:o="dark",width:s}){const i=I(()=>G(o),[o]),d=I(()=>O(e),[e]),x=I(()=>{if(!t)return new Map;const l=J(t.lines),h=new Map;for(const[j,c]of l)if(j===c.deletionIndex){const k=N(c.deletion),m=N(c.addition),{oldSegments:C,newSegments:y}=K(k,m);h.set(c.deletionIndex,C),h.set(c.additionIndex,y)}return h},[t]),g=I(()=>t?.lines.map((l,h)=>({line:l,originalIndex:h})).filter(({line:l})=>W(l))??[],[t]);if(!t||g.length===0)return a(p,{paddingX:1,children:a(u,{dimColor:!0,children:"No diff to display"})});const w=Q(g.map(l=>l.line));return a(p,{flexDirection:"column",paddingX:1,overflowX:"hidden",children:a(U,{items:g,maxHeight:n,scrollOffset:r,getKey:l=>`${l.originalIndex}`,renderItem:l=>{const h=x.get(l.originalIndex);return a(tt,{line:l.line,lineNumWidth:w,language:d,wordDiffSegments:h,theme:i,maxWidth:s})}})})}
@@ -1 +1 @@
1
- import{jsxs as s,jsx as c}from"react/jsx-runtime";import{Box as y,Text as t}from"ink";import{shortenPath as x}from"../utils/formatPath.js";import{categorizeFiles as C}from"../utils/fileCategories.js";function P(e){switch(e){case"modified":return"M";case"added":return"A";case"deleted":return"D";case"untracked":return"?";case"renamed":return"R";case"copied":return"C";default:return" "}}function b(e){switch(e){case"modified":return"yellow";case"added":return"green";case"deleted":return"red";case"untracked":return"gray";case"renamed":return"blue";case"copied":return"cyan";default:return"white"}}function k(e,i){if(e===void 0&&i===void 0)return null;const o=e??0,d=i??0;if(o===0&&d===0)return null;const a=[];return o>0&&a.push(`+${o}`),d>0&&a.push(`-${d}`),a.join(" ")}function j({file:e,isSelected:i,isFocused:o,maxPathLength:d}){const a=P(e.status),f=b(e.status),g=e.staged?"[-]":"[+]",l=e.staged?"red":"green",u=k(e.insertions,e.deletions),p=u?u.length+1:0,r=d-p,h=x(e.path,r);return s(y,{children:[i&&o?s(t,{color:"cyan",bold:!0,children:["\u25B8"," "]}):c(t,{children:" "}),s(t,{color:l,children:[g," "]}),s(t,{color:f,children:[a," "]}),s(t,{color:i&&o?"cyan":void 0,children:[h,e.originalPath&&s(t,{dimColor:!0,children:[" \u2190 ",x(e.originalPath,30)]})]}),u&&s(t,{children:[c(t,{dimColor:!0,children:" "}),e.insertions!==void 0&&e.insertions>0&&s(t,{color:"green",children:["+",e.insertions]}),e.insertions!==void 0&&e.insertions>0&&e.deletions!==void 0&&e.deletions>0&&c(t,{dimColor:!0,children:" "}),e.deletions!==void 0&&e.deletions>0&&s(t,{color:"red",children:["-",e.deletions]})]})]})}export function FileList({files:e,selectedIndex:i,isFocused:o,scrollOffset:d=0,maxHeight:a,width:f=80}){const g=f-10,{modified:l,untracked:u,staged:p}=C(e);if(e.length===0)return c(y,{flexDirection:"column",children:c(t,{dimColor:!0,children:" No changes"})});const r=[];let h=0;l.length>0&&(r.push({type:"header",content:"Modified:",headerColor:"yellow"}),l.forEach(n=>{r.push({type:"file",file:n,fileIndex:h++})})),u.length>0&&(l.length>0&&r.push({type:"spacer"}),r.push({type:"header",content:"Untracked:",headerColor:"gray"}),u.forEach(n=>{r.push({type:"file",file:n,fileIndex:h++})})),p.length>0&&((l.length>0||u.length>0)&&r.push({type:"spacer"}),r.push({type:"header",content:"Staged:",headerColor:"green"}),p.forEach(n=>{r.push({type:"file",file:n,fileIndex:h++})}));const F=a?r.slice(d,d+a):r.slice(d);return c(y,{flexDirection:"column",children:F.map((n,I)=>{const m=`row-${d+I}`;return n.type==="header"?c(t,{bold:!0,color:n.headerColor,children:n.content},m):n.type==="spacer"?c(t,{children:" "},m):n.type==="file"&&n.file!==void 0&&n.fileIndex!==void 0?c(j,{file:n.file,isSelected:n.fileIndex===i,isFocused:o,maxPathLength:g},m):null})})}export function getFileAtIndex(e,i){const{ordered:o}=C(e);return o[i]??null}export function getTotalFileCount(e){return e.length}
1
+ import{jsx as d,jsxs as l}from"react/jsx-runtime";import{Box as x,Text as t}from"ink";import{shortenPath as C}from"../utils/formatPath.js";import{categorizeFiles as F}from"../utils/fileCategories.js";function P(e){switch(e){case"modified":return"M";case"added":return"A";case"deleted":return"D";case"untracked":return"?";case"renamed":return"R";case"copied":return"C";default:return" "}}function b(e){switch(e){case"modified":return"yellow";case"added":return"green";case"deleted":return"red";case"untracked":return"gray";case"renamed":return"blue";case"copied":return"cyan";default:return"white"}}function k(e,s){if(e===void 0&&s===void 0)return null;const i=e??0,o=s??0;if(i===0&&o===0)return null;const c=[];return i>0&&c.push(`+${i}`),o>0&&c.push(`-${o}`),c.join(" ")}function j({file:e,isSelected:s,isFocused:i,maxPathLength:o}){const c=P(e.status),f=b(e.status),g=e.staged?"[-]":"[+]",h=e.staged?"red":"green",u=k(e.insertions,e.deletions),a=s&&i,r=u?u.length+1:0,p=o-r,m=C(e.path,p);return l(x,{children:[d(t,{color:a?"cyan":void 0,bold:a,children:a?"\u25B8 ":" "}),l(t,{color:h,children:[g," "]}),l(t,{color:f,children:[c," "]}),d(t,{color:a?"cyan":void 0,inverse:a,children:m}),e.originalPath&&l(t,{dimColor:!0,children:[" \u2190 ",C(e.originalPath,30)]}),u&&l(t,{children:[d(t,{dimColor:!0,children:" "}),e.insertions!==void 0&&e.insertions>0&&l(t,{color:"green",children:["+",e.insertions]}),e.insertions!==void 0&&e.insertions>0&&e.deletions!==void 0&&e.deletions>0&&d(t,{dimColor:!0,children:" "}),e.deletions!==void 0&&e.deletions>0&&l(t,{color:"red",children:["-",e.deletions]})]})]})}export function FileList({files:e,selectedIndex:s,isFocused:i,scrollOffset:o=0,maxHeight:c,width:f=80}){const g=f-10,{modified:h,untracked:u,staged:a}=F(e);if(e.length===0)return d(x,{flexDirection:"column",children:d(t,{dimColor:!0,children:" No changes"})});const r=[];let p=0;h.length>0&&(r.push({type:"header",content:"Modified:",headerColor:"yellow"}),h.forEach(n=>{r.push({type:"file",file:n,fileIndex:p++})})),u.length>0&&(h.length>0&&r.push({type:"spacer"}),r.push({type:"header",content:"Untracked:",headerColor:"gray"}),u.forEach(n=>{r.push({type:"file",file:n,fileIndex:p++})})),a.length>0&&((h.length>0||u.length>0)&&r.push({type:"spacer"}),r.push({type:"header",content:"Staged:",headerColor:"green"}),a.forEach(n=>{r.push({type:"file",file:n,fileIndex:p++})}));const m=c?r.slice(o,o+c):r.slice(o);return d(x,{flexDirection:"column",children:m.map((n,I)=>{const y=`row-${o+I}`;return n.type==="header"?d(t,{bold:!0,color:n.headerColor,children:n.content},y):n.type==="spacer"?d(t,{children:" "},y):n.type==="file"&&n.file!==void 0&&n.fileIndex!==void 0?d(j,{file:n.file,isSelected:n.fileIndex===s,isFocused:i,maxPathLength:g},y):null})})}export function getFileAtIndex(e,s){const{ordered:i}=F(e);return i[s]??null}export function getTotalFileCount(e){return e.length}
@@ -1 +1 @@
1
- import{jsx as i,jsxs as y}from"react/jsx-runtime";import{useMemo as w}from"react";import{Box as r,Text as n}from"ink";import{DiffView as x}from"./DiffView.js";import{buildHistoryDiffRows as D}from"../utils/rowCalculations.js";import{isDisplayableDiffLine as R}from"../utils/diffFilters.js";export{buildHistoryDiffRows,getHistoryDiffTotalRows}from"../utils/rowCalculations.js";export function HistoryDiffView({commit:s,diff:t,scrollOffset:l,maxHeight:f,theme:h="dark"}){const c=w(()=>D(s,t),[s,t]),a=w(()=>{for(let e=0;e<c.length;e++)if(c[e].type==="diff-line")return e;return c.length},[c]),d=c.slice(l,l+f);if(!s)return i(r,{paddingX:1,children:i(n,{dimColor:!0,children:"Select a commit to view its diff"})});if(!t||t.lines.length===0)return y(r,{flexDirection:"column",children:[d.map((e,m)=>{const o=`row-${l+m}`;return e.type==="commit-header"?i(r,{children:i(n,{color:"yellow",children:e.content})},o):e.type==="commit-message"?i(r,{children:i(n,{children:e.content})},o):e.type==="spacer"?i(r,{children:i(n,{children:" "})},o):null}),i(r,{children:i(n,{dimColor:!0,children:"No changes in this commit"})})]});const u=t.lines.filter(R);if(l>=a)return i(x,{diff:{raw:t.raw,lines:u},maxHeight:f,scrollOffset:l-a,theme:h});const g=d.filter(e=>e.type!=="diff-line"),p=f-g.length;return y(r,{flexDirection:"column",children:[d.map((e,m)=>{const o=`row-${l+m}`;return e.type==="commit-header"?i(r,{children:i(n,{color:"yellow",children:e.content})},o):e.type==="commit-message"?i(r,{children:i(n,{children:e.content})},o):e.type==="spacer"?i(r,{children:i(n,{children:" "})},o):null}),p>0&&i(x,{diff:{raw:t.raw,lines:u},maxHeight:p,scrollOffset:0,theme:h})]})}
1
+ import{jsx as i,jsxs as w}from"react/jsx-runtime";import{useMemo as x}from"react";import{Box as r,Text as n}from"ink";import{DiffView as g}from"./DiffView.js";import{buildHistoryDiffRows as R}from"../utils/rowCalculations.js";import{isDisplayableDiffLine as b}from"../utils/diffFilters.js";export{buildHistoryDiffRows,getHistoryDiffTotalRows}from"../utils/rowCalculations.js";export function HistoryDiffView({commit:s,diff:t,scrollOffset:l,maxHeight:d,theme:m="dark",width:a}){const c=x(()=>R(s,t),[s,t]),u=x(()=>{for(let e=0;e<c.length;e++)if(c[e].type==="diff-line")return e;return c.length},[c]),f=c.slice(l,l+d);if(!s)return i(r,{paddingX:1,children:i(n,{dimColor:!0,children:"Select a commit to view its diff"})});if(!t||t.lines.length===0)return w(r,{flexDirection:"column",children:[f.map((e,h)=>{const o=`row-${l+h}`;return e.type==="commit-header"?i(r,{children:i(n,{color:"yellow",children:e.content})},o):e.type==="commit-message"?i(r,{children:i(n,{children:e.content})},o):e.type==="spacer"?i(r,{children:i(n,{children:" "})},o):null}),i(r,{children:i(n,{dimColor:!0,children:"No changes in this commit"})})]});const p=t.lines.filter(b);if(l>=u)return i(g,{diff:{raw:t.raw,lines:p},maxHeight:d,scrollOffset:l-u,theme:m,width:a});const D=f.filter(e=>e.type!=="diff-line"),y=d-D.length;return w(r,{flexDirection:"column",overflowX:"hidden",children:[f.map((e,h)=>{const o=`row-${l+h}`;return e.type==="commit-header"?i(r,{children:i(n,{color:"yellow",children:e.content})},o):e.type==="commit-message"?i(r,{children:i(n,{children:e.content})},o):e.type==="spacer"?i(r,{children:i(n,{children:" "})},o):null}),y>0&&i(g,{diff:{raw:t.raw,lines:p},maxHeight:y,scrollOffset:0,theme:m,width:a})]})}
@@ -1 +1 @@
1
- import{jsxs as h,jsx as j}from"react/jsx-runtime";import{Box as M,Text as g}from"ink";export function ScrollableList({items:a,renderItem:u,maxHeight:o,scrollOffset:e,getKey:i,header:t,showIndicators:r=!0}){let n=o;t&&n--;const b=e>0,x=a.length,c=x>e+n;r&&(b&&n--,c&&n--),n=Math.max(1,n);const l=a.slice(e,e+n),p=x>e+n,C=e,d=x-e-l.length;return h(M,{flexDirection:"column",children:[t,r&&b&&h(g,{dimColor:!0,children:["\u2191 ",C," more above"]}),l.map((v,m)=>j(M,{children:u(v,e+m)},`${e}-${m}-${i(v,e+m)}`)),r&&p&&h(g,{dimColor:!0,children:["\u2193 ",d," more below"]})]})}export function getMaxScrollOffset(a,u,o=!1,e=!0){let i=u;return o&&i--,e&&a>i&&(i-=2),i=Math.max(1,i),Math.max(0,a-i)}export function getVisibleItemCount(a,u,o,e=!1,i=!0){let t=u;return e&&t--,i&&(o>0&&t--,a>o+t&&t--),t=Math.max(1,t),Math.min(t,a-o)}
1
+ import{jsxs as m,jsx as j}from"react/jsx-runtime";import{Box as d,Text as M}from"ink";export function ScrollableList({items:n,renderItem:r,maxHeight:a,scrollOffset:e,getKey:i,header:t,showIndicators:u=!0}){let o=a;t&&o--;const l=e>0,h=n.length,g=h>e+o;u&&(l&&o--,g&&o--),o=Math.max(1,o);const b=n.slice(e,e+o),c=h>e+o,p=e,C=h-e-b.length;return m(d,{flexDirection:"column",overflowX:"hidden",children:[t,u&&l&&m(M,{dimColor:!0,children:["\u2191 ",p," more above"]}),b.map((v,x)=>j(d,{overflowX:"hidden",children:r(v,e+x)},`${e}-${x}-${i(v,e+x)}`)),u&&c&&m(M,{dimColor:!0,children:["\u2193 ",C," more below"]})]})}export function getMaxScrollOffset(n,r,a=!1,e=!0){let i=r;return a&&i--,e&&n>i&&(i-=2),i=Math.max(1,i),Math.max(0,n-i)}export function getVisibleItemCount(n,r,a,e=!1,i=!0){let t=r;return e&&t--,i&&(a>0&&t--,n>a+t&&t--),t=Math.max(1,t),Math.min(t,n-a)}
@@ -1 +1 @@
1
- import{jsx as o,jsxs as e,Fragment as s}from"react/jsx-runtime";import{Box as n,Text as i}from"ink";import{FileList as k}from"./FileList.js";import{HistoryView as p}from"./HistoryView.js";import{CompareListView as M}from"./CompareListView.js";import{categorizeFiles as _}from"../utils/fileCategories.js";export function TopPane({bottomTab:d,currentPane:r,terminalWidth:t,topPaneHeight:c,files:m,selectedIndex:f,fileListScrollOffset:x,stagedCount:g,onStage:C,onUnstage:y,commits:h,historySelectedIndex:a,historyScrollOffset:w,onSelectHistoryCommit:A,compareDiff:l,compareListSelection:F,compareScrollOffset:I,includeUncommitted:u}){const{modified:O,untracked:j}=_(m),v=O.length,S=j.length;return e(n,{flexDirection:"column",height:c,width:t,overflowY:"hidden",children:[(d==="diff"||d==="commit")&&e(s,{children:[e(n,{children:[o(i,{bold:!0,color:r==="files"?"cyan":void 0,children:"STAGING AREA"}),e(i,{dimColor:!0,children:[" ","(",v," modified, ",S," untracked, ",g," staged)"]})]}),o(k,{files:m,selectedIndex:f,isFocused:r==="files",scrollOffset:x,maxHeight:c-1,width:t,onStage:C,onUnstage:y})]}),d==="history"&&e(s,{children:[e(n,{children:[o(i,{bold:!0,color:r==="history"?"cyan":void 0,children:"COMMITS"}),e(i,{dimColor:!0,children:[" (",h.length," commits)"]})]}),o(p,{commits:h,selectedIndex:a,scrollOffset:w,maxHeight:c-1,isActive:r==="history",width:t,onSelectCommit:A})]}),d==="compare"&&e(s,{children:[e(n,{children:[o(i,{bold:!0,color:r==="compare"?"cyan":void 0,children:"COMPARE"}),o(i,{dimColor:!0,children:" (vs "}),o(i,{color:"cyan",children:l?.baseBranch??"..."}),e(i,{dimColor:!0,children:[": ",l?.commits.length??0," commits, ",l?.files.length??0," files) (b)"]}),l&&l.uncommittedCount>0&&e(s,{children:[o(i,{dimColor:!0,children:" | "}),e(i,{color:u?"magenta":"yellow",children:["[",u?"x":" ","] uncommitted"]}),o(i,{dimColor:!0,children:" (u)"})]})]}),o(M,{commits:l?.commits??[],files:l?.files??[],selectedItem:F,scrollOffset:I,maxHeight:c-1,isActive:r==="compare",width:t})]})]})}
1
+ import{jsx as o,jsxs as e,Fragment as s}from"react/jsx-runtime";import{Box as n,Text as i}from"ink";import{FileList as k}from"./FileList.js";import{HistoryView as p}from"./HistoryView.js";import{CompareListView as M}from"./CompareListView.js";import{categorizeFiles as _}from"../utils/fileCategories.js";export function TopPane({bottomTab:r,currentPane:d,terminalWidth:t,topPaneHeight:c,files:m,selectedIndex:f,fileListScrollOffset:x,stagedCount:g,onStage:C,onUnstage:w,commits:h,historySelectedIndex:y,historyScrollOffset:a,onSelectHistoryCommit:A,compareDiff:l,compareListSelection:v,compareScrollOffset:F,includeUncommitted:u}){const{modified:I,untracked:O}=_(m),j=I.length,S=O.length;return e(n,{flexDirection:"column",height:c,width:t,overflowX:"hidden",overflowY:"hidden",children:[(r==="diff"||r==="commit")&&e(s,{children:[e(n,{children:[o(i,{bold:!0,color:d==="files"?"cyan":void 0,children:"STAGING AREA"}),e(i,{dimColor:!0,children:[" ","(",j," modified, ",S," untracked, ",g," staged)"]})]}),o(k,{files:m,selectedIndex:f,isFocused:d==="files",scrollOffset:x,maxHeight:c-1,width:t,onStage:C,onUnstage:w})]}),r==="history"&&e(s,{children:[e(n,{children:[o(i,{bold:!0,color:d==="history"?"cyan":void 0,children:"COMMITS"}),e(i,{dimColor:!0,children:[" (",h.length," commits)"]})]}),o(p,{commits:h,selectedIndex:y,scrollOffset:a,maxHeight:c-1,isActive:d==="history",width:t,onSelectCommit:A})]}),r==="compare"&&e(s,{children:[e(n,{children:[o(i,{bold:!0,color:d==="compare"?"cyan":void 0,children:"COMPARE"}),o(i,{dimColor:!0,children:" (vs "}),o(i,{color:"cyan",children:l?.baseBranch??"..."}),e(i,{dimColor:!0,children:[": ",l?.commits.length??0," commits, ",l?.files.length??0," files) (b)"]}),l&&l.uncommittedCount>0&&e(s,{children:[o(i,{dimColor:!0,children:" | "}),e(i,{color:u?"magenta":"yellow",children:["[",u?"x":" ","] uncommitted"]}),o(i,{dimColor:!0,children:" (u)"})]})]}),o(M,{commits:l?.commits??[],files:l?.files??[],selectedItem:v,scrollOffset:F,maxHeight:c-1,isActive:d==="compare",width:t})]})]})}
@@ -1 +1 @@
1
- import{useEffect as d,useState as y,useCallback as C,useRef as x}from"react";import{useStdin as R}from"ink";export function useMouse(p,b=!1){const{stdin:c,setRawMode:h}=R(),[u,w]=y(!0),e=x(p);d(()=>{e.current=p});const M=C(()=>{w(l=>!l)},[]),a=x(u);return d(()=>{a.current=u},[u]),d(()=>{b?(process.stdout.write("\x1B[?1006l"),process.stdout.write("\x1B[?1000l")):(process.stdout.write("\x1B[?1000h"),process.stdout.write("\x1B[?1006h"))},[b]),d(()=>{if(!c||!h)return;const l=g=>{const m=g.toString(),o=m.match(/\x1b\[<(\d+);(\d+);(\d+)([Mm])/);if(o){const t=parseInt(o[1],10),s=parseInt(o[2],10),n=parseInt(o[3],10),r=o[4]==="m";if(t>=64&&t<96){if(a.current){const f=t===64?"scroll-up":"scroll-down";e.current({x:s,y:n,type:f,button:"none"})}}else if(r&&t>=0&&t<3){const f=t===0?"left":t===1?"middle":"right";e.current({x:s,y:n,type:"click",button:f})}return}const i=m.match(/\x1b\[M(.)(.)(.)/);if(i){const t=i[1].charCodeAt(0)-32,s=i[2].charCodeAt(0)-32,n=i[3].charCodeAt(0)-32;if(t>=64){if(a.current){const r=t===64?"scroll-up":"scroll-down";e.current({x:s,y:n,type:r,button:"none"})}}else if(t>=0&&t<3){const r=t===0?"left":t===1?"middle":"right";e.current({x:s,y:n,type:"click",button:r})}}};return c.on("data",l),()=>{c.off("data",l),process.stdout.write("\x1B[?1006l"),process.stdout.write("\x1B[?1000l")}},[c,h]),{mouseEnabled:u,toggleMouse:M}}
1
+ import{useEffect as d,useState as y,useCallback as C,useRef as x}from"react";import{useStdin as R}from"ink";export function useMouse(p,b=!1){const{stdin:u,setRawMode:h}=R(),[e,w]=y(!0),o=x(p);d(()=>{o.current=p});const M=C(()=>{w(l=>!l)},[]),a=x(e);return d(()=>{a.current=e},[e]),d(()=>{!b&&e?(process.stdout.write("\x1B[?1000h"),process.stdout.write("\x1B[?1006h")):(process.stdout.write("\x1B[?1006l"),process.stdout.write("\x1B[?1000l"))},[b,e]),d(()=>{if(!u||!h)return;const l=g=>{const m=g.toString(),s=m.match(/\x1b\[<(\d+);(\d+);(\d+)([Mm])/);if(s){const t=parseInt(s[1],10),n=parseInt(s[2],10),r=parseInt(s[3],10),c=s[4]==="m";if(t>=64&&t<96){if(a.current){const f=t===64?"scroll-up":"scroll-down";o.current({x:n,y:r,type:f,button:"none"})}}else if(c&&t>=0&&t<3){const f=t===0?"left":t===1?"middle":"right";o.current({x:n,y:r,type:"click",button:f})}return}const i=m.match(/\x1b\[M(.)(.)(.)/);if(i){const t=i[1].charCodeAt(0)-32,n=i[2].charCodeAt(0)-32,r=i[3].charCodeAt(0)-32;if(t>=64){if(a.current){const c=t===64?"scroll-up":"scroll-down";o.current({x:n,y:r,type:c,button:"none"})}}else if(t>=0&&t<3){const c=t===0?"left":t===1?"middle":"right";o.current({x:n,y:r,type:"click",button:c})}}};return u.on("data",l),()=>{u.off("data",l),process.stdout.write("\x1B[?1006l"),process.stdout.write("\x1B[?1000l")}},[u,h]),{mouseEnabled:e,toggleMouse:M}}
@@ -1 +1 @@
1
- import{categorizeFiles as d}from"./fileCategories.js";export function calculatePaneBoundaries(t,e,r,u=1){const l=u+2,i=u+1+t,f=i+1,a=i+2,s=a+e-1;return{stagingPaneStart:l,fileListEnd:i,separatorRow:f,diffPaneStart:a,diffPaneEnd:s,footerRow:r}}export function getClickedFileIndex(t,e,r,u,l){if(t<u+1||t>l)return-1;const i=t-4+e,{modified:f,untracked:a,staged:s}=d(r);let n=0,c=0;if(f.length>0){n++;for(let o=0;o<f.length;o++){if(i===n)return c;n++,c++}}if(a.length>0){f.length>0&&n++,n++;for(let o=0;o<a.length;o++){if(i===n)return c;n++,c++}}if(s.length>0){(f.length>0||a.length>0)&&n++,n++;for(let o=0;o<s.length;o++){if(i===n)return c;n++,c++}}return-1}export function getTabBoundaries(t){const e=t-39;return{diffStart:e,diffEnd:e+6,commitStart:e+8,commitEnd:e+16,historyStart:e+18,historyEnd:e+27,compareStart:e+29,compareEnd:e+38}}export function getClickedTab(t,e){const r=getTabBoundaries(e);return t>=r.diffStart&&t<=r.diffEnd?"diff":t>=r.commitStart&&t<=r.commitEnd?"commit":t>=r.historyStart&&t<=r.historyEnd?"history":t>=r.compareStart&&t<=r.compareEnd?"compare":null}export function isButtonAreaClick(t){return t<=6}export function isInPane(t,e,r){return t>=e&&t<=r}export function getFooterLeftClick(t){return t>=1&&t<=9?"hotkeys":t>=13&&t<=20?"mouse-mode":t>=24&&t<=38?"auto-tab":null}
1
+ import{categorizeFiles as d}from"./fileCategories.js";export function calculatePaneBoundaries(t,e,r,a=1){const s=a+2,i=a+1+t,f=i+1,c=i+2,l=c+e-1;return{stagingPaneStart:s,fileListEnd:i,separatorRow:f,diffPaneStart:c,diffPaneEnd:l,footerRow:r}}export function getClickedFileIndex(t,e,r,a,s){if(t<a+1||t>s)return-1;const i=t-(a+1)+e,{modified:f,untracked:c,staged:l}=d(r);let n=0,u=0;if(f.length>0){n++;for(let o=0;o<f.length;o++){if(i===n)return u;n++,u++}}if(c.length>0){f.length>0&&n++,n++;for(let o=0;o<c.length;o++){if(i===n)return u;n++,u++}}if(l.length>0){(f.length>0||c.length>0)&&n++,n++;for(let o=0;o<l.length;o++){if(i===n)return u;n++,u++}}return-1}export function getTabBoundaries(t){const e=t-39;return{diffStart:e,diffEnd:e+6,commitStart:e+8,commitEnd:e+16,historyStart:e+18,historyEnd:e+27,compareStart:e+29,compareEnd:e+38}}export function getClickedTab(t,e){const r=getTabBoundaries(e);return t>=r.diffStart&&t<=r.diffEnd?"diff":t>=r.commitStart&&t<=r.commitEnd?"commit":t>=r.historyStart&&t<=r.historyEnd?"history":t>=r.compareStart&&t<=r.compareEnd?"compare":null}export function isButtonAreaClick(t){return t<=6}export function isInPane(t,e,r){return t>=e&&t<=r}export function getFooterLeftClick(t){return t>=1&&t<=9?"hotkeys":t>=13&&t<=20?"mouse-mode":t>=24&&t<=38?"auto-tab":null}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diffstalker",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Terminal application that displays git diff/status for directories",
5
5
  "author": "yogh-io",
6
6
  "license": "MIT",
@@ -21,7 +21,7 @@
21
21
  "dev": "tsx src/index.tsx",
22
22
  "build": "tsc",
23
23
  "build:prod": "tsc && node scripts/minify.js",
24
- "bundle": "npm run build:prod && ncc build dist/index.js -o dist/bundle -m",
24
+ "bundle": "npm run build:prod && ncc build dist/index.js -o dist/bundle && node scripts/minify.js ../dist/bundle",
25
25
  "start": "node dist/index.js",
26
26
  "start:bundle": "node dist/bundle/index.js",
27
27
  "test": "vitest run",