ripplo 0.3.13 → 0.3.14
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.js +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -319,7 +319,7 @@ ${t.join(`
|
|
|
319
319
|
newSlug
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
-
`),Ud=Math.min(10,jb()),_o=Ub(Ud),Ln=new Set;Wb=5e3});import{Box as Hb,Text as $o}from"ink";import{jsx as Bd,jsxs as Vd}from"react/jsx-runtime";function Wd({maxConcurrency:e,queuedRunCount:t,runningRunCount:n}){return Vd(Hb,{paddingX:1,children:[Bd($o,{dimColor:!0,children:"Activity "}),Vd($o,{children:[String(n),"/",String(e)," running"]}),t>0?Bd($o,{dimColor:!0,children:` \xB7 ${String(t)} queued`}):null]})}var Fd=p(()=>{"use strict"});import{Box as Jb,Text as Pn}from"ink";import{jsx as En,jsxs as Xb}from"react/jsx-runtime";function Md({check:e}){let{detail:t,label:n,tone:r}=Cn(e),o=zb[r];return Xb(Jb,{children:[En(Pn,{color:o,children:r==="info"?"\u25CB":"\u25CF"}),En(Pn,{children:" "}),En(Pn,{children:n.padEnd(18," ")}),En(Pn,{color:o,children:t})]})}var zb,qd=p(()=>{"use strict";Lo();zb={error:"red",info:"gray",ok:"green",warn:"yellow"}});import{Box as Gb,Text as Hd}from"ink";import{jsx as Do,jsxs as Kb}from"react/jsx-runtime";function Jd({checks:e}){return Kb(Gb,{borderColor:"gray",borderStyle:"round",flexDirection:"column",marginTop:1,paddingX:1,children:[Do(Hd,{bold:!0,children:"Health"}),e.length===0?Do(Hd,{dimColor:!0,children:"Running first pass..."}):e.map(t=>Do(Md,{check:t},t.type))]})}var zd=p(()=>{"use strict";qd()});import{Box as On,Text as pt}from"ink";import{jsx as ut,jsxs as In}from"react/jsx-runtime";function Xd({appUrl:e,developerUrl:t,projectName:n}){return In(On,{borderColor:"gray",borderStyle:"round",flexDirection:"column",paddingX:1,children:[In(On,{children:[ut(pt,{dimColor:!0,children:"Project "}),ut(pt,{bold:!0,children:n})]}),In(On,{children:[ut(pt,{dimColor:!0,children:"App "}),ut(pt,{color:"cyan",children:e})]}),In(On,{children:[ut(pt,{dimColor:!0,children:"Dashboard "}),ut(pt,{color:"cyan",children:t})]})]})}var Gd=p(()=>{"use strict"});import{Box as Bo,Text as Ee}from"ink";import{jsx as Oe,jsxs as Vo}from"react/jsx-runtime";function Kd({paused:e,scope:t}){let n=t.slice(0,Qb),r=t.length-n.length;return Vo(Bo,{borderColor:"gray",borderStyle:"round",flexDirection:"column",marginTop:1,paddingX:1,children:[Vo(Bo,{children:[Oe(Ee,{bold:!0,children:"Scope"}),Oe(Ee,{dimColor:!0,children:` (${String(t.length)})`}),Oe(Ee,{children:" "}),Oe(Ee,{dimColor:!0,children:"Hooks "}),Oe(Ee,{color:e?"yellow":"green",children:e?"paused":"active"})]}),t.length===0?Oe(Ee,{dimColor:!0,children:"no scope items \u2014 add from the dashboard or `ripplo scope add`"}):n.map(o=>Vo(Bo,{children:[Oe(Ee,{color:"cyan",children:"\u2022 "}),Oe(Ee,{children:o.label})]},o.id)),r>0?Oe(Ee,{dimColor:!0,children:` \u2026 +${String(r)} more`}):null]})}var Qb,Qd=p(()=>{"use strict";Qb=8});import{Box as Yb,Text as Yd}from"ink";import{jsx as Zb,jsxs as Zd}from"react/jsx-runtime";function ec({preconditions:e,workflows:t}){let n=t?.type==="workflows"?t.total:0,r=t?.type==="workflows"?t.invalidNames.length:0,o=e?.type==="preconditions"?e.count:0;return Zd(Yb,{marginTop:1,paddingX:1,children:[Zb(Yd,{dimColor:!0,children:"Workflows "}),Zd(Yd,{children:[String(n)," tests \xB7 ",String(o)," preconditions",r>0?` \xB7 ${String(r)} invalid`:""]})]})}var tc=p(()=>{"use strict"});import X_ from"chalk";import{z as nc}from"zod";async function rc(){let e=new AbortController,t=setTimeout(()=>{e.abort()},3e3);try{let n=await fetch(`https://registry.npmjs.org/${eA}/latest`,{headers:{accept:"application/json"},signal:e.signal});if(!n.ok)return;let r=await n.json();return tA.parse(r).version}catch{return}finally{clearTimeout(t)}}var Wo,eA,tA,oc=p(()=>{"use strict";M();Wo="0.3.13",eA="ripplo",tA=nc.object({version:nc.string()})});import{useEffect as nA,useState as rA}from"react";import{Text as mt}from"ink";import{jsx as xt,jsxs as lA}from"react/jsx-runtime";function ic({connected:e,projectId:t,queuedRunCount:n,ripploServerUrl:r,runningRunCount:o,syncError:i,width:a}){let s=sA(),l=s!=null&&s!==Wo,d=oA({connected:e,syncError:i}),c=iA({queuedRunCount:n,runningRunCount:o}),u=`v${Wo}`,y=l?` \u2192 v${s}`:"",S=`project ${t} \xB7 q to quit`,b=` ripplo ${u}${y} | ${r} ${d}${c}`,k=Math.max(0,a-b.length-S.length-1);return lA(mt,{inverse:!0,children:[xt(mt,{bold:!0,children:" ripplo "}),xt(mt,{dimColor:!0,children:u}),l?xt(mt,{color:"yellow",children:` \u2192 v${s}`}):null,` | ${r} `,xt(mt,{color:aA({connected:e,syncError:i}),children:d}),c," ".repeat(k),xt(mt,{dimColor:!0,children:S})," "]})}function oA({connected:e,syncError:t}){return t!=null?"sync failed":e?"connected":"connecting..."}function iA({queuedRunCount:e,runningRunCount:t}){if(t===0&&e===0)return"";let n=e>0?` (+${String(e)} queued)`:"";return` ${String(t)} running${n}`}function aA({connected:e,syncError:t}){return t!=null?"red":e?"green":"yellow"}function sA(){let[e,t]=rA();return nA(()=>{rc().then(n=>{n!=null&&t(n)})},[]),e}var ac=p(()=>{"use strict";oc()});import{useEffect as dA}from"react";import{Box as Fo,Text as cA,useApp as pA,useInput as uA}from"ink";import{jsx as qe,jsxs as sc}from"react/jsx-runtime";function lc({config:e,cwd:t}){let n=pA(),{height:r,width:o}=ct(),{config:i,devSessionId:a,syncError:s}=bd({config:e,cwd:t}),{connected:l,maxConcurrency:d,queuedRunCount:c,runningRunCount:u}=$d({config:i,cwd:t,devSessionId:a}),{checks:y}=Td({config:i,cwd:t}),{paused:S,projectName:b,scope:k}=Od({devSessionId:a,projectId:e.projectId});vd({cwd:t,projectId:e.projectId}),dA(()=>Ll(t),[t]),uA($=>{$==="q"&&n.exit()});let N=`${i.ripploServerUrl}/projects/${i.projectId}/developer`,R=y.filter($=>mA.has($.type)),O=y.find($=>$.type==="workflows"),F=y.find($=>$.type==="preconditions"),U=b??"\u2026";return sc(Fo,{flexDirection:"column",height:r,width:o,children:[qe(ic,{connected:l,projectId:i.projectId,queuedRunCount:c,ripploServerUrl:i.ripploServerUrl,runningRunCount:u,syncError:s,width:o}),sc(Fo,{flexDirection:"column",flexGrow:1,paddingX:1,paddingY:1,children:[qe(Xd,{appUrl:i.appUrl,developerUrl:N,projectName:U}),qe(Kd,{paused:S,scope:k}),qe(Jd,{checks:R}),qe(ec,{preconditions:F,workflows:O}),qe(Wd,{maxConcurrency:d,queuedRunCount:c,runningRunCount:u}),qe(Fo,{marginTop:1,paddingX:1,children:qe(cA,{dimColor:!0,children:"q quit"})})]})]})}var mA,dc=p(()=>{"use strict";yo();Nn();Ad();Po();Ld();Id();Uo();Fd();zd();Gd();Qd();tc();ac();mA=new Set(["dev-server","preconditions","adapter-enabled","webhook-verification","lockfile","pre-commit-hook","browser"])});import{Text as cc}from"ink";import fA from"ink-spinner";import{jsx as pc,jsxs as gA}from"react/jsx-runtime";function uc({loading:e}){return e?gA(cc,{color:yA,children:[pc(fA,{type:"dots"})," Starting..."]}):pc(cc,{children:""})}var yA,mc=p(()=>{"use strict";yA="#24CFFF"});import{useEffect as hA,useState as Pt}from"react";import{Box as Ze,Text as Mo,useInput as kA}from"ink";import{jsx as He,jsxs as qo}from"react/jsx-runtime";function yc({onDismiss:e}){let{height:t,width:n}=ct(),[r,o]=Pt(0),[i,a]=Pt(!1),[s,l]=Pt(!1),[d,c]=Pt(!1),[u,y]=Pt(!1);kA(()=>{u&&e()}),hA(()=>{let k=80+_n.length*70+80,N=[..._n.map((R,O)=>setTimeout(()=>{o(O+1)},80+O*70)),setTimeout(()=>{a(!0)},k),setTimeout(()=>{l(!0)},k+200),setTimeout(()=>{c(!0)},k+400),setTimeout(()=>{c(!1),y(!0)},k+2e3),setTimeout(()=>{e()},k+2800)];return()=>{N.forEach(R=>{clearTimeout(R)})}},[e]);let S=_n.length+5,b=Math.max(0,Math.floor((t-S)/2));return qo(Ze,{flexDirection:"column",height:t,width:n,children:[He(Ze,{height:b}),qo(Ze,{alignItems:"flex-start",flexDirection:"row",justifyContent:"center",children:[He(Ze,{flexDirection:"column",children:_n.map((k,N)=>He(Mo,{color:fc,children:N<r?k:""},k))}),qo(Ze,{flexDirection:"column",paddingLeft:4,paddingTop:5,children:[He(Mo,{bold:!0,color:fc,children:i?SA:""}),He(Ze,{marginTop:1,children:He(Mo,{color:"gray",dimColor:!0,children:s?"developer CLI":""})}),He(Ze,{marginTop:2,children:He(uc,{loading:d})})]})]})]})}var _n,fc,SA,gc=p(()=>{"use strict";Nn();mc();_n=[" XXXX XXXXXXX "," XX XX X X "," XXX XX XX X X ","XXXXXX XX XX XXXXXXX ","XX XXX XX XX ","XX XXX XX XXXXXXXX "," XX XX XX XX "," XX XX XX XX "," XX XXXXX XX"," XX XX XX XX"," XX XX XXXX "," XXX XX "," XXXXXXXXX XX "," XXX XX "," XXXXXXX "],fc="#24CFFF",SA="ripplo"});import{createAuthClient as bA}from"better-auth/client";import{deviceAuthorizationClient as AA}from"better-auth/client/plugins";function jn({baseURL:e}){return bA({baseURL:e,fetchOptions:{headers:{"User-Agent":"Ripplo CLI"}},plugins:[AA()]})}var Ho=p(()=>{"use strict"});import{exec as wA}from"child_process";async function kc({cwd:e,onDeviceCode:t,url:n}){let r=n??Nt().RIPPLO_SERVER_URL,o=jn({baseURL:r}),i=await o.device.code({client_id:hc});if(i.error!=null)throw new Error(`Failed to request device code: ${i.error.error_description}`);let{device_code:a,user_code:s,verification_uri_complete:l}=i.data;t({userCode:s,verificationUrl:l}),xA(l);let d=await TA({authClient:o,deviceCode:a});return Wr(e,d),d}async function TA({authClient:e,deviceCode:t}){for(;;){await vA(RA);let n=await e.device.token({client_id:hc,device_code:t,grant_type:"urn:ietf:params:oauth:grant-type:device_code"});if(n.data?.access_token!=null)return n.data.access_token;if(n.error==null)continue;if(!CA(n.error.error))throw new Error(`Authorization failed: ${n.error.error_description}`)}}function CA(e){return NA.has(e)}function vA(e){return new Promise(t=>{setTimeout(t,e)})}function LA(){return process.platform==="darwin"?"open":process.platform==="win32"?"start":"xdg-open"}function xA(e){let t=LA();wA(`${t} "${e}"`,()=>{})}var RA,hc,NA,Sc=p(()=>{"use strict";M();Ho();We();RA=5e3,hc="ripplo-cli";NA=new Set(["authorization_pending","slow_down"])});import{useCallback as Un,useEffect as PA,useState as Je}from"react";import{exec as EA}from"child_process";import{promisify as OA}from"util";import q from"fs";import W from"path";function Ac({cwd:e,initialToken:t,serverUrl:n}){let[r,o]=Je(t==null?"login":"validating"),[i,a]=Je(),[s,l]=Je(),[d,c]=Je(t),[u,y]=Je(!1),[S,b]=Je(),[k,N]=Je(),[R,O]=Je([]);PA(()=>{if(t==null)return;jn({baseURL:n}).getSession({fetchOptions:{headers:{Authorization:`Bearer ${t}`}}}).then(j=>{if(j.data==null){o("login");return}return Jo({cwd:e,serverUrl:n,token:t})}).then(j=>{if(j==null){o("select-project");return}a(j),o("complete")}).catch(j=>{l(j instanceof Error?j.message:String(j)),o("login")})},[e,t,n]);let F=Un(()=>{u||(y(!0),l(void 0),kc({cwd:e,onDeviceCode:b,url:n}).then(H=>(c(H),Jo({cwd:e,serverUrl:n,token:H}))).then(H=>{H==null?o("select-project"):(a(H),o("complete"))}).catch(H=>{y(!1),b(void 0),l(H instanceof Error?H.message:String(H))}))},[e,u,n]),U=Un(H=>{let j=i?.token??d??t;if(j==null){l("No authentication token available");return}o("scaffolding"),l(void 0),UA({cwd:e,onStep:N,projectId:H.id}).then(async G=>{O(G);let ze=await Jo({cwd:e,serverUrl:n,token:j});a(ze??IA({projectId:H.id,serverUrl:n,token:j})),o(G.length>0?"scaffolding-warnings":"complete")}).catch(G=>{l(G instanceof Error?G.message:String(G)),o("select-project")})},[i,e,t,n,d]),$=Un(()=>{o("complete")},[]),se=Un(()=>{a(void 0),o("login"),y(!1),b(void 0),l(void 0)},[]);return{config:i,deviceCodeInfo:S,dismissScaffoldWarnings:$,error:s,loginStarted:u,resetToLogin:se,scaffoldingStep:k,scaffoldWarnings:R,selectProject:U,setStage:o,stage:r,startLogin:F,token:d}}function IA({projectId:e,serverUrl:t,token:n}){return{appUrl:"",engineUrl:"",projectId:e,ripploServerUrl:t,token:n,webhookSecret:""}}async function Jo({cwd:e,serverUrl:t,token:n}){let r=await L(e);if(r.ok)return{...r.result.config,ripploServerUrl:t,token:n}}async function UA({cwd:e,onStep:t,projectId:n}){t("Scaffolding project files..."),HA({cwd:e,projectId:n}),t("Updating .gitignore..."),ew(e),t("Marking ripplo.lock as generated..."),VA(e),t("Installing dependencies...");let r=await $A(e),o=[];if(r.ok||o.push({manualCommand:r.cmd,message:`Couldn't auto-install dev dependencies (${r.reason}). Run this manually, then re-run \`npx ripplo\`.`}),r.ok){t("Compiling initial lockfile...");let i=await DA(e);i!=null&&o.push({manualCommand:void 0,message:i})}return t("Setting up browser..."),await Rr(),o}async function $A(e){let t=WA({cwd:e,pm:qA(e)});g.info("Installing dependencies: %s",t);try{return await jA(t,{cwd:e}),{ok:!0}}catch(n){let r=n instanceof Error?n.message.split(`
|
|
322
|
+
`),Ud=Math.min(10,jb()/2),_o=Ub(Ud),Ln=new Set;Wb=5e3});import{Box as Hb,Text as $o}from"ink";import{jsx as Bd,jsxs as Vd}from"react/jsx-runtime";function Wd({maxConcurrency:e,queuedRunCount:t,runningRunCount:n}){return Vd(Hb,{paddingX:1,children:[Bd($o,{dimColor:!0,children:"Activity "}),Vd($o,{children:[String(n),"/",String(e)," running"]}),t>0?Bd($o,{dimColor:!0,children:` \xB7 ${String(t)} queued`}):null]})}var Fd=p(()=>{"use strict"});import{Box as Jb,Text as Pn}from"ink";import{jsx as En,jsxs as Xb}from"react/jsx-runtime";function Md({check:e}){let{detail:t,label:n,tone:r}=Cn(e),o=zb[r];return Xb(Jb,{children:[En(Pn,{color:o,children:r==="info"?"\u25CB":"\u25CF"}),En(Pn,{children:" "}),En(Pn,{children:n.padEnd(18," ")}),En(Pn,{color:o,children:t})]})}var zb,qd=p(()=>{"use strict";Lo();zb={error:"red",info:"gray",ok:"green",warn:"yellow"}});import{Box as Gb,Text as Hd}from"ink";import{jsx as Do,jsxs as Kb}from"react/jsx-runtime";function Jd({checks:e}){return Kb(Gb,{borderColor:"gray",borderStyle:"round",flexDirection:"column",marginTop:1,paddingX:1,children:[Do(Hd,{bold:!0,children:"Health"}),e.length===0?Do(Hd,{dimColor:!0,children:"Running first pass..."}):e.map(t=>Do(Md,{check:t},t.type))]})}var zd=p(()=>{"use strict";qd()});import{Box as On,Text as pt}from"ink";import{jsx as ut,jsxs as In}from"react/jsx-runtime";function Xd({appUrl:e,developerUrl:t,projectName:n}){return In(On,{borderColor:"gray",borderStyle:"round",flexDirection:"column",paddingX:1,children:[In(On,{children:[ut(pt,{dimColor:!0,children:"Project "}),ut(pt,{bold:!0,children:n})]}),In(On,{children:[ut(pt,{dimColor:!0,children:"App "}),ut(pt,{color:"cyan",children:e})]}),In(On,{children:[ut(pt,{dimColor:!0,children:"Dashboard "}),ut(pt,{color:"cyan",children:t})]})]})}var Gd=p(()=>{"use strict"});import{Box as Bo,Text as Ee}from"ink";import{jsx as Oe,jsxs as Vo}from"react/jsx-runtime";function Kd({paused:e,scope:t}){let n=t.slice(0,Qb),r=t.length-n.length;return Vo(Bo,{borderColor:"gray",borderStyle:"round",flexDirection:"column",marginTop:1,paddingX:1,children:[Vo(Bo,{children:[Oe(Ee,{bold:!0,children:"Scope"}),Oe(Ee,{dimColor:!0,children:` (${String(t.length)})`}),Oe(Ee,{children:" "}),Oe(Ee,{dimColor:!0,children:"Hooks "}),Oe(Ee,{color:e?"yellow":"green",children:e?"paused":"active"})]}),t.length===0?Oe(Ee,{dimColor:!0,children:"no scope items \u2014 add from the dashboard or `ripplo scope add`"}):n.map(o=>Vo(Bo,{children:[Oe(Ee,{color:"cyan",children:"\u2022 "}),Oe(Ee,{children:o.label})]},o.id)),r>0?Oe(Ee,{dimColor:!0,children:` \u2026 +${String(r)} more`}):null]})}var Qb,Qd=p(()=>{"use strict";Qb=8});import{Box as Yb,Text as Yd}from"ink";import{jsx as Zb,jsxs as Zd}from"react/jsx-runtime";function ec({preconditions:e,workflows:t}){let n=t?.type==="workflows"?t.total:0,r=t?.type==="workflows"?t.invalidNames.length:0,o=e?.type==="preconditions"?e.count:0;return Zd(Yb,{marginTop:1,paddingX:1,children:[Zb(Yd,{dimColor:!0,children:"Workflows "}),Zd(Yd,{children:[String(n)," tests \xB7 ",String(o)," preconditions",r>0?` \xB7 ${String(r)} invalid`:""]})]})}var tc=p(()=>{"use strict"});import X_ from"chalk";import{z as nc}from"zod";async function rc(){let e=new AbortController,t=setTimeout(()=>{e.abort()},3e3);try{let n=await fetch(`https://registry.npmjs.org/${eA}/latest`,{headers:{accept:"application/json"},signal:e.signal});if(!n.ok)return;let r=await n.json();return tA.parse(r).version}catch{return}finally{clearTimeout(t)}}var Wo,eA,tA,oc=p(()=>{"use strict";M();Wo="0.3.14",eA="ripplo",tA=nc.object({version:nc.string()})});import{useEffect as nA,useState as rA}from"react";import{Text as mt}from"ink";import{jsx as xt,jsxs as lA}from"react/jsx-runtime";function ic({connected:e,projectId:t,queuedRunCount:n,ripploServerUrl:r,runningRunCount:o,syncError:i,width:a}){let s=sA(),l=s!=null&&s!==Wo,d=oA({connected:e,syncError:i}),c=iA({queuedRunCount:n,runningRunCount:o}),u=`v${Wo}`,y=l?` \u2192 v${s}`:"",S=`project ${t} \xB7 q to quit`,b=` ripplo ${u}${y} | ${r} ${d}${c}`,k=Math.max(0,a-b.length-S.length-1);return lA(mt,{inverse:!0,children:[xt(mt,{bold:!0,children:" ripplo "}),xt(mt,{dimColor:!0,children:u}),l?xt(mt,{color:"yellow",children:` \u2192 v${s}`}):null,` | ${r} `,xt(mt,{color:aA({connected:e,syncError:i}),children:d}),c," ".repeat(k),xt(mt,{dimColor:!0,children:S})," "]})}function oA({connected:e,syncError:t}){return t!=null?"sync failed":e?"connected":"connecting..."}function iA({queuedRunCount:e,runningRunCount:t}){if(t===0&&e===0)return"";let n=e>0?` (+${String(e)} queued)`:"";return` ${String(t)} running${n}`}function aA({connected:e,syncError:t}){return t!=null?"red":e?"green":"yellow"}function sA(){let[e,t]=rA();return nA(()=>{rc().then(n=>{n!=null&&t(n)})},[]),e}var ac=p(()=>{"use strict";oc()});import{useEffect as dA}from"react";import{Box as Fo,Text as cA,useApp as pA,useInput as uA}from"ink";import{jsx as qe,jsxs as sc}from"react/jsx-runtime";function lc({config:e,cwd:t}){let n=pA(),{height:r,width:o}=ct(),{config:i,devSessionId:a,syncError:s}=bd({config:e,cwd:t}),{connected:l,maxConcurrency:d,queuedRunCount:c,runningRunCount:u}=$d({config:i,cwd:t,devSessionId:a}),{checks:y}=Td({config:i,cwd:t}),{paused:S,projectName:b,scope:k}=Od({devSessionId:a,projectId:e.projectId});vd({cwd:t,projectId:e.projectId}),dA(()=>Ll(t),[t]),uA($=>{$==="q"&&n.exit()});let N=`${i.ripploServerUrl}/projects/${i.projectId}/developer`,R=y.filter($=>mA.has($.type)),O=y.find($=>$.type==="workflows"),F=y.find($=>$.type==="preconditions"),U=b??"\u2026";return sc(Fo,{flexDirection:"column",height:r,width:o,children:[qe(ic,{connected:l,projectId:i.projectId,queuedRunCount:c,ripploServerUrl:i.ripploServerUrl,runningRunCount:u,syncError:s,width:o}),sc(Fo,{flexDirection:"column",flexGrow:1,paddingX:1,paddingY:1,children:[qe(Xd,{appUrl:i.appUrl,developerUrl:N,projectName:U}),qe(Kd,{paused:S,scope:k}),qe(Jd,{checks:R}),qe(ec,{preconditions:F,workflows:O}),qe(Wd,{maxConcurrency:d,queuedRunCount:c,runningRunCount:u}),qe(Fo,{marginTop:1,paddingX:1,children:qe(cA,{dimColor:!0,children:"q quit"})})]})]})}var mA,dc=p(()=>{"use strict";yo();Nn();Ad();Po();Ld();Id();Uo();Fd();zd();Gd();Qd();tc();ac();mA=new Set(["dev-server","preconditions","adapter-enabled","webhook-verification","lockfile","pre-commit-hook","browser"])});import{Text as cc}from"ink";import fA from"ink-spinner";import{jsx as pc,jsxs as gA}from"react/jsx-runtime";function uc({loading:e}){return e?gA(cc,{color:yA,children:[pc(fA,{type:"dots"})," Starting..."]}):pc(cc,{children:""})}var yA,mc=p(()=>{"use strict";yA="#24CFFF"});import{useEffect as hA,useState as Pt}from"react";import{Box as Ze,Text as Mo,useInput as kA}from"ink";import{jsx as He,jsxs as qo}from"react/jsx-runtime";function yc({onDismiss:e}){let{height:t,width:n}=ct(),[r,o]=Pt(0),[i,a]=Pt(!1),[s,l]=Pt(!1),[d,c]=Pt(!1),[u,y]=Pt(!1);kA(()=>{u&&e()}),hA(()=>{let k=80+_n.length*70+80,N=[..._n.map((R,O)=>setTimeout(()=>{o(O+1)},80+O*70)),setTimeout(()=>{a(!0)},k),setTimeout(()=>{l(!0)},k+200),setTimeout(()=>{c(!0)},k+400),setTimeout(()=>{c(!1),y(!0)},k+2e3),setTimeout(()=>{e()},k+2800)];return()=>{N.forEach(R=>{clearTimeout(R)})}},[e]);let S=_n.length+5,b=Math.max(0,Math.floor((t-S)/2));return qo(Ze,{flexDirection:"column",height:t,width:n,children:[He(Ze,{height:b}),qo(Ze,{alignItems:"flex-start",flexDirection:"row",justifyContent:"center",children:[He(Ze,{flexDirection:"column",children:_n.map((k,N)=>He(Mo,{color:fc,children:N<r?k:""},k))}),qo(Ze,{flexDirection:"column",paddingLeft:4,paddingTop:5,children:[He(Mo,{bold:!0,color:fc,children:i?SA:""}),He(Ze,{marginTop:1,children:He(Mo,{color:"gray",dimColor:!0,children:s?"developer CLI":""})}),He(Ze,{marginTop:2,children:He(uc,{loading:d})})]})]})]})}var _n,fc,SA,gc=p(()=>{"use strict";Nn();mc();_n=[" XXXX XXXXXXX "," XX XX X X "," XXX XX XX X X ","XXXXXX XX XX XXXXXXX ","XX XXX XX XX ","XX XXX XX XXXXXXXX "," XX XX XX XX "," XX XX XX XX "," XX XXXXX XX"," XX XX XX XX"," XX XX XXXX "," XXX XX "," XXXXXXXXX XX "," XXX XX "," XXXXXXX "],fc="#24CFFF",SA="ripplo"});import{createAuthClient as bA}from"better-auth/client";import{deviceAuthorizationClient as AA}from"better-auth/client/plugins";function jn({baseURL:e}){return bA({baseURL:e,fetchOptions:{headers:{"User-Agent":"Ripplo CLI"}},plugins:[AA()]})}var Ho=p(()=>{"use strict"});import{exec as wA}from"child_process";async function kc({cwd:e,onDeviceCode:t,url:n}){let r=n??Nt().RIPPLO_SERVER_URL,o=jn({baseURL:r}),i=await o.device.code({client_id:hc});if(i.error!=null)throw new Error(`Failed to request device code: ${i.error.error_description}`);let{device_code:a,user_code:s,verification_uri_complete:l}=i.data;t({userCode:s,verificationUrl:l}),xA(l);let d=await TA({authClient:o,deviceCode:a});return Wr(e,d),d}async function TA({authClient:e,deviceCode:t}){for(;;){await vA(RA);let n=await e.device.token({client_id:hc,device_code:t,grant_type:"urn:ietf:params:oauth:grant-type:device_code"});if(n.data?.access_token!=null)return n.data.access_token;if(n.error==null)continue;if(!CA(n.error.error))throw new Error(`Authorization failed: ${n.error.error_description}`)}}function CA(e){return NA.has(e)}function vA(e){return new Promise(t=>{setTimeout(t,e)})}function LA(){return process.platform==="darwin"?"open":process.platform==="win32"?"start":"xdg-open"}function xA(e){let t=LA();wA(`${t} "${e}"`,()=>{})}var RA,hc,NA,Sc=p(()=>{"use strict";M();Ho();We();RA=5e3,hc="ripplo-cli";NA=new Set(["authorization_pending","slow_down"])});import{useCallback as Un,useEffect as PA,useState as Je}from"react";import{exec as EA}from"child_process";import{promisify as OA}from"util";import q from"fs";import W from"path";function Ac({cwd:e,initialToken:t,serverUrl:n}){let[r,o]=Je(t==null?"login":"validating"),[i,a]=Je(),[s,l]=Je(),[d,c]=Je(t),[u,y]=Je(!1),[S,b]=Je(),[k,N]=Je(),[R,O]=Je([]);PA(()=>{if(t==null)return;jn({baseURL:n}).getSession({fetchOptions:{headers:{Authorization:`Bearer ${t}`}}}).then(j=>{if(j.data==null){o("login");return}return Jo({cwd:e,serverUrl:n,token:t})}).then(j=>{if(j==null){o("select-project");return}a(j),o("complete")}).catch(j=>{l(j instanceof Error?j.message:String(j)),o("login")})},[e,t,n]);let F=Un(()=>{u||(y(!0),l(void 0),kc({cwd:e,onDeviceCode:b,url:n}).then(H=>(c(H),Jo({cwd:e,serverUrl:n,token:H}))).then(H=>{H==null?o("select-project"):(a(H),o("complete"))}).catch(H=>{y(!1),b(void 0),l(H instanceof Error?H.message:String(H))}))},[e,u,n]),U=Un(H=>{let j=i?.token??d??t;if(j==null){l("No authentication token available");return}o("scaffolding"),l(void 0),UA({cwd:e,onStep:N,projectId:H.id}).then(async G=>{O(G);let ze=await Jo({cwd:e,serverUrl:n,token:j});a(ze??IA({projectId:H.id,serverUrl:n,token:j})),o(G.length>0?"scaffolding-warnings":"complete")}).catch(G=>{l(G instanceof Error?G.message:String(G)),o("select-project")})},[i,e,t,n,d]),$=Un(()=>{o("complete")},[]),se=Un(()=>{a(void 0),o("login"),y(!1),b(void 0),l(void 0)},[]);return{config:i,deviceCodeInfo:S,dismissScaffoldWarnings:$,error:s,loginStarted:u,resetToLogin:se,scaffoldingStep:k,scaffoldWarnings:R,selectProject:U,setStage:o,stage:r,startLogin:F,token:d}}function IA({projectId:e,serverUrl:t,token:n}){return{appUrl:"",engineUrl:"",projectId:e,ripploServerUrl:t,token:n,webhookSecret:""}}async function Jo({cwd:e,serverUrl:t,token:n}){let r=await L(e);if(r.ok)return{...r.result.config,ripploServerUrl:t,token:n}}async function UA({cwd:e,onStep:t,projectId:n}){t("Scaffolding project files..."),HA({cwd:e,projectId:n}),t("Updating .gitignore..."),ew(e),t("Marking ripplo.lock as generated..."),VA(e),t("Installing dependencies...");let r=await $A(e),o=[];if(r.ok||o.push({manualCommand:r.cmd,message:`Couldn't auto-install dev dependencies (${r.reason}). Run this manually, then re-run \`npx ripplo\`.`}),r.ok){t("Compiling initial lockfile...");let i=await DA(e);i!=null&&o.push({manualCommand:void 0,message:i})}return t("Setting up browser..."),await Rr(),o}async function $A(e){let t=WA({cwd:e,pm:qA(e)});g.info("Installing dependencies: %s",t);try{return await jA(t,{cwd:e}),{ok:!0}}catch(n){let r=n instanceof Error?n.message.split(`
|
|
323
323
|
`)[0]??n.message:String(n);return g.warn("Install failed (%s): %s",t,r),{cmd:t,ok:!1,reason:r}}}async function DA(e){try{await BA(e);return}catch(t){let n=t instanceof Error?t.message:String(t);return g.warn("Initial lockfile compile failed: %s",n),`Couldn't compile initial lockfile: ${n}. You can run \`npx ripplo\` again after fixing the DSL.`}}async function BA(e){let t=await L(e);if(!t.ok){g.warn("Initial compile failed, skipping lockfile write: %s",t.error);return}await me({cwd:e,result:t.result})}function VA(e){let t=W.join(e,".gitattributes"),n=q.existsSync(t)?q.readFileSync(t,"utf8"):"";if(n.includes(bc))return;let r=n.length===0||n.endsWith(`
|
|
324
324
|
`)?"":`
|
|
325
325
|
`;q.writeFileSync(t,`${n}${r}${bc}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ripplo",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.14",
|
|
4
4
|
"description": "CLI for Ripplo — AI-powered end-to-end testing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://ripplo.ai",
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
"eslint-plugin-react-compiler": "19.1.0-rc.2",
|
|
59
59
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
60
60
|
"tsup": "^8.5.1",
|
|
61
|
-
"@ripplo/eslint-config": "0.0.0",
|
|
62
61
|
"@ripplo/graphql": "^0.0.0",
|
|
63
|
-
"@ripplo/spec": "^0.0.0",
|
|
64
62
|
"@ripplo/runtime": "^0.0.0",
|
|
65
|
-
"@ripplo/testing": "^0.3.8"
|
|
63
|
+
"@ripplo/testing": "^0.3.8",
|
|
64
|
+
"@ripplo/eslint-config": "0.0.0",
|
|
65
|
+
"@ripplo/spec": "^0.0.0"
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"dev": "tsx watch src/index.ts",
|