@gadgetinc/ggt 1.0.5 → 1.0.6
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/{add-4ME2KTJQ.js → add-JIIVAOWH.js} +2 -2
- package/dist/chunk-APHXRHNI.js +8 -0
- package/dist/{chunk-QEVWPU3D.js.map → chunk-APHXRHNI.js.map} +1 -1
- package/dist/{chunk-GA7AL463.js → chunk-AQRCAWW4.js} +2 -2
- package/dist/{chunk-G3VNV5Z6.js → chunk-BOQUW6DS.js} +3 -3
- package/dist/{chunk-G3VNV5Z6.js.map → chunk-BOQUW6DS.js.map} +3 -3
- package/dist/{chunk-KGSSHEEC.js → chunk-CKSTMUDN.js} +2 -2
- package/dist/{chunk-5DLLJX5F.js → chunk-ERYUXLYS.js} +2 -2
- package/dist/{chunk-IKJVXTZK.js → chunk-GACF5GYF.js} +2 -2
- package/dist/chunk-GBCD37US.js +57 -0
- package/dist/chunk-GBCD37US.js.map +7 -0
- package/dist/chunk-P2XPMNL6.js +183 -0
- package/dist/{chunk-KXK37C5D.js.map → chunk-P2XPMNL6.js.map} +4 -4
- package/dist/{chunk-NJIDVM2C.js → chunk-PSRZ5JH5.js} +2 -2
- package/dist/{chunk-YRP2UZ2I.js → chunk-RJOIQTYZ.js} +3 -3
- package/dist/{chunk-YRP2UZ2I.js.map → chunk-RJOIQTYZ.js.map} +2 -2
- package/dist/chunk-XCHCCJJZ.js +2 -0
- package/dist/deploy-KMGAGIDE.js +30 -0
- package/dist/{deploy-6HOBYPE6.js.map → deploy-KMGAGIDE.js.map} +2 -2
- package/dist/{dev-M3WDGK4D.js → dev-VHJ52BEA.js} +2 -2
- package/dist/{list-725RHWD5.js → list-5E3R22IC.js} +2 -2
- package/dist/login-3DL45WY7.js +2 -0
- package/dist/{logout-UZBACOIX.js → logout-HX6MM4S6.js} +2 -2
- package/dist/main.js +1 -1
- package/dist/{open-GWKGQQG3.js → open-GEEWPSF4.js} +2 -2
- package/dist/{pull-7C5A65KB.js → pull-T2Q4M4UN.js} +2 -2
- package/dist/push-LUW25FYF.js +2 -0
- package/dist/{status-DFKKSRVB.js → status-5VZH3KXH.js} +2 -2
- package/dist/{version-JD42JXWY.js → version-OF4TQ2K6.js} +2 -2
- package/dist/{whoami-I23R6HOG.js → whoami-V3XD27QH.js} +2 -2
- package/package.json +3 -3
- package/dist/chunk-BZY2AIPV.js +0 -57
- package/dist/chunk-BZY2AIPV.js.map +0 -7
- package/dist/chunk-KXK37C5D.js +0 -183
- package/dist/chunk-QEVWPU3D.js +0 -8
- package/dist/chunk-X36GM74C.js +0 -2
- package/dist/deploy-6HOBYPE6.js +0 -30
- package/dist/login-I4RGMDLE.js +0 -2
- package/dist/push-LPUIR4EO.js +0 -2
- /package/dist/{add-4ME2KTJQ.js.map → add-JIIVAOWH.js.map} +0 -0
- /package/dist/{chunk-GA7AL463.js.map → chunk-AQRCAWW4.js.map} +0 -0
- /package/dist/{chunk-KGSSHEEC.js.map → chunk-CKSTMUDN.js.map} +0 -0
- /package/dist/{chunk-5DLLJX5F.js.map → chunk-ERYUXLYS.js.map} +0 -0
- /package/dist/{chunk-IKJVXTZK.js.map → chunk-GACF5GYF.js.map} +0 -0
- /package/dist/{chunk-NJIDVM2C.js.map → chunk-PSRZ5JH5.js.map} +0 -0
- /package/dist/{chunk-X36GM74C.js.map → chunk-XCHCCJJZ.js.map} +0 -0
- /package/dist/{dev-M3WDGK4D.js.map → dev-VHJ52BEA.js.map} +0 -0
- /package/dist/{list-725RHWD5.js.map → list-5E3R22IC.js.map} +0 -0
- /package/dist/{login-I4RGMDLE.js.map → login-3DL45WY7.js.map} +0 -0
- /package/dist/{logout-UZBACOIX.js.map → logout-HX6MM4S6.js.map} +0 -0
- /package/dist/{open-GWKGQQG3.js.map → open-GEEWPSF4.js.map} +0 -0
- /package/dist/{pull-7C5A65KB.js.map → pull-T2Q4M4UN.js.map} +0 -0
- /package/dist/{push-LPUIR4EO.js.map → push-LUW25FYF.js.map} +0 -0
- /package/dist/{status-DFKKSRVB.js.map → status-5VZH3KXH.js.map} +0 -0
- /package/dist/{version-JD42JXWY.js.map → version-OF4TQ2K6.js.map} +0 -0
- /package/dist/{whoami-I23R6HOG.js.map → whoami-V3XD27QH.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{k as ie,l as se,m as ae}from"./chunk-
|
|
1
|
+
import{k as ie,l as se,m as ae}from"./chunk-CKSTMUDN.js";import{i as H,s as G}from"./chunk-AQRCAWW4.js";import{I as w,N as x,T as ne,U as B,V as D,W as f,b as U,c as te,d as P,e as h,g as oe}from"./chunk-GBCD37US.js";import{d as Te,g as a}from"./chunk-5WC5D4WL.js";a();a();import Le from"node:net";import $e from"node:os";var W=class extends Error{constructor(r){super(`${r} is locked`)}},b={old:new Set,young:new Set},Ce=1e3*15;var E,Be=()=>{let e=$e.networkInterfaces(),r=new Set([void 0,"0.0.0.0"]);for(let t of Object.values(e))for(let o of t)r.add(o.address);return r},ce=e=>new Promise((r,t)=>{let o=Le.createServer();o.unref(),o.on("error",t),o.listen(e,()=>{let{port:n}=o.address();o.close(()=>{r(n)})})}),le=async(e,r)=>{if(e.host||e.port===0)return ce(e);for(let t of r)try{await ce({port:e.port,host:t})}catch(o){if(!["EADDRNOTAVAIL","EINVAL"].includes(o.code))throw o}return e.port},We=function*(e){e&&(yield*e),yield 0};async function _(e){let r,t=new Set;if(e&&(e.port&&(r=typeof e.port=="number"?[e.port]:e.port),e.exclude)){let n=e.exclude;if(typeof n[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(let i of n){if(typeof i!="number")throw new TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");if(!Number.isSafeInteger(i))throw new TypeError(`Number ${i} in the exclude option is not a safe integer and can't be used`)}t=new Set(n)}E===void 0&&(E=setTimeout(()=>{E=void 0,b.old=b.young,b.young=new Set},Ce),E.unref&&E.unref());let o=Be();for(let n of We(r))try{if(t.has(n))continue;let i=await le({...e,port:n},o);for(;b.old.has(i)||b.young.has(i);){if(n!==0)throw new W(n);i=await le({...e,port:n},o)}return b.young.add(i),i}catch(i){if(!["EADDRINUSE","EACCES"].includes(i.code)&&!(i instanceof W))throw i}throw new Error("No available ports found")}import re from"node:assert";import Ir from"node:http";a();import I from"node:process";import{Buffer as Xe}from"node:buffer";import he from"node:path";import{fileURLToPath as qe}from"node:url";import Je from"node:child_process";import q,{constants as ge}from"node:fs/promises";a();function g(e,r,t){let o=n=>Object.defineProperty(e,r,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get(){let n=t();return o(n),n},set(n){o(n)}}),e}a();import{promisify as je}from"node:util";import Y from"node:process";import{execFile as ze}from"node:child_process";a();import{promisify as ke}from"node:util";import Ie from"node:process";import{execFile as Re}from"node:child_process";var Ne=ke(Re);async function j(){if(Ie.platform!=="darwin")throw new Error("macOS only");let{stdout:e}=await Ne("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e)?.groups.id??"com.apple.Safari"}a();a();import Fe from"node:process";import{promisify as Oe}from"node:util";import{execFile as Me,execFileSync as qr}from"node:child_process";var Ue=Oe(Me);async function ue(e,{humanReadableOutput:r=!0}={}){if(Fe.platform!=="darwin")throw new Error("macOS only");let t=r?[]:["-ss"],{stdout:o}=await Ue("osascript",["-e",e,t]);return o.trim()}async function z(e){return ue(`tell application "Finder" to set app_path to application file id "${e}" as string
|
|
2
2
|
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}a();import{promisify as De}from"node:util";import{execFile as He}from"node:child_process";var Ge=De(He),_e={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},k=class extends Error{};async function K(e=Ge){let{stdout:r}=await e("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),t=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(r);if(!t)throw new k(`Cannot find Windows browser in stdout: ${JSON.stringify(r)}`);let{id:o}=t.groups,n=_e[o];if(!n)throw new k(`Unknown browser ID: ${o}`);return n}var Ke=je(ze),Ye=e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,r=>r.toUpperCase());async function X(){if(Y.platform==="darwin"){let e=await j();return{name:await z(e),id:e}}if(Y.platform==="linux"){let{stdout:e}=await Ke("xdg-mime",["query","default","x-scheme-handler/http"]),r=e.trim();return{name:Ye(r.replace(/.desktop$/,"").replace("-"," ")),id:r}}if(Y.platform==="win32")return K();throw new Error("Only macOS, Linux, and Windows are supported")}var J=he.dirname(qe(import.meta.url)),de=he.join(J,"xdg-open"),{platform:y,arch:fe}=I,Ve=(()=>{let e="/mnt/",r;return async function(){if(r)return r;let t="/etc/wsl.conf",o=!1;try{await q.access(t,ge.F_OK),o=!0}catch{}if(!o)return e;let n=await q.readFile(t,{encoding:"utf8"}),i=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(n);return i?(r=i.groups.mountPoint.trim(),r=r.endsWith("/")?r:`${r}/`,r):e}})(),pe=async(e,r)=>{let t;for(let o of e)try{return await r(o)}catch(n){t=n}throw t},R=async e=>{if(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e},Array.isArray(e.app))return pe(e.app,u=>R({...e,app:u}));let{name:r,arguments:t=[]}=e.app??{};if(t=[...t],Array.isArray(r))return pe(r,u=>R({...e,app:{name:u,arguments:t}}));if(r==="browser"||r==="browserPrivate"){let u={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","microsoft-edge.desktop":"edge"},l={chrome:"--incognito",firefox:"--private-window",edge:"--inPrivate"},d=await X();if(d.id in u){let m=u[d.id];return r==="browserPrivate"&&t.push(l[m]),R({...e,app:{name:v[m],arguments:t}})}throw new Error(`${d.name} is not supported as a default browser`)}let o,n=[],i={};if(y==="darwin")o="open",e.wait&&n.push("--wait-apps"),e.background&&n.push("--background"),e.newInstance&&n.push("--new"),r&&n.push("-a",r);else if(y==="win32"||P&&!te()&&!r){let u=await Ve();o=P?`${u}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${I.env.SYSTEMROOT||I.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,n.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),P||(i.windowsVerbatimArguments=!0);let l=["Start"];e.wait&&l.push("-Wait"),r?(l.push(`"\`"${r}\`""`),e.target&&t.push(e.target)):e.target&&l.push(`"${e.target}"`),t.length>0&&(t=t.map(d=>`"\`"${d}\`""`),l.push("-ArgumentList",t.join(","))),e.target=Xe.from(l.join(" "),"utf16le").toString("base64")}else{if(r)o=r;else{let u=!J||J==="/",l=!1;try{await q.access(de,ge.X_OK),l=!0}catch{}o=I.versions.electron??(y==="android"||u||!l)?"xdg-open":de}t.length>0&&n.push(...t),e.wait||(i.stdio="ignore",i.detached=!0)}y==="darwin"&&t.length>0&&n.push("--args",...t),e.target&&n.push(e.target);let c=Je.spawn(o,n,i);return e.wait?new Promise((u,l)=>{c.once("error",l),c.once("close",d=>{if(!e.allowNonzeroExitCode&&d>0){l(new Error(`Exited with code ${d}`));return}u(c)})}):(c.unref(),c)},Qe=(e,r)=>{if(typeof e!="string")throw new TypeError("Expected a `target`");return R({...r,target:e})};function me(e){if(typeof e=="string"||Array.isArray(e))return e;let{[fe]:r}=e;if(!r)throw new Error(`${fe} is not supported`);return r}function V({[y]:e},{wsl:r}){if(r&&P)return me(r);if(!e)throw new Error(`${y} is not supported`);return me(e)}var v={};g(v,"chrome",()=>V({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));g(v,"firefox",()=>V({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));g(v,"edge",()=>V({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));g(v,"browser",()=>"browser");g(v,"browserPrivate",()=>"browserPrivate");var we=Qe;a();import Wr from"node:assert";a();import C from"node:process";a();a();var F={};Te(F,{beep:()=>Pr,clearScreen:()=>yr,clearTerminal:()=>vr,cursorBackward:()=>ir,cursorDown:()=>or,cursorForward:()=>nr,cursorGetPosition:()=>cr,cursorHide:()=>dr,cursorLeft:()=>ye,cursorMove:()=>tr,cursorNextLine:()=>lr,cursorPrevLine:()=>ur,cursorRestorePosition:()=>ar,cursorSavePosition:()=>sr,cursorShow:()=>fr,cursorTo:()=>rr,cursorUp:()=>be,enterAlternativeScreen:()=>Sr,eraseDown:()=>gr,eraseEndLine:()=>mr,eraseLine:()=>ve,eraseLines:()=>pr,eraseScreen:()=>Q,eraseStartLine:()=>hr,eraseUp:()=>wr,exitAlternativeScreen:()=>Ar,iTerm:()=>Lr,image:()=>Tr,link:()=>Er,scrollDown:()=>br,scrollUp:()=>xr});a();import Z from"node:process";a();var N=globalThis.window?.document!==void 0,Et=globalThis.process?.versions?.node!==void 0,Tt=globalThis.process?.versions?.bun!==void 0,Lt=globalThis.Deno?.version?.deno!==void 0,$t=globalThis.process?.versions?.electron!==void 0,Ct=globalThis.navigator?.userAgent?.includes("jsdom")===!0,Bt=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,Wt=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,kt=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,It=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,T=globalThis.navigator?.userAgentData?.platform,Rt=T==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",Nt=T==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",Ft=T==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",Ot=T==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),Mt=T==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android";var s="\x1B[",$="\x1B]",S="\x07",L=";",xe=!N&&Z.env.TERM_PROGRAM==="Apple_Terminal",Ze=!N&&Z.platform==="win32",er=N?()=>{throw new Error("`process.cwd()` only works in Node.js, not the browser.")}:Z.cwd,rr=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof r!="number"?s+(e+1)+"G":s+(r+1)+L+(e+1)+"H"},tr=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let t="";return e<0?t+=s+-e+"D":e>0&&(t+=s+e+"C"),r<0?t+=s+-r+"A":r>0&&(t+=s+r+"B"),t},be=(e=1)=>s+e+"A",or=(e=1)=>s+e+"B",nr=(e=1)=>s+e+"C",ir=(e=1)=>s+e+"D",ye=s+"G",sr=xe?"\x1B7":s+"s",ar=xe?"\x1B8":s+"u",cr=s+"6n",lr=s+"E",ur=s+"F",dr=s+"?25l",fr=s+"?25h",pr=e=>{let r="";for(let t=0;t<e;t++)r+=ve+(t<e-1?be():"");return e&&(r+=ye),r},mr=s+"K",hr=s+"1K",ve=s+"2K",gr=s+"J",wr=s+"1J",Q=s+"2J",xr=s+"S",br=s+"T",yr="\x1Bc",vr=Ze?`${Q}${s}0f`:`${Q}${s}3J${s}H`,Sr=s+"?1049h",Ar=s+"?1049l",Pr=S,Er=(e,r)=>[$,"8",L,L,r,S,e,$,"8",L,L,S].join(""),Tr=(e,r={})=>{let t=`${$}1337;File=inline=1`;return r.width&&(t+=`;width=${r.width}`),r.height&&(t+=`;height=${r.height}`),r.preserveAspectRatio===!1&&(t+=";preserveAspectRatio=0"),t+":"+Buffer.from(e).toString("base64")+S},Lr={setCwd:(e=er())=>`${$}50;CurrentDir=${e}${S}`,annotation(e,r={}){let t=`${$}1337;`,o=r.x!==void 0,n=r.y!==void 0;if((o||n)&&!(o&&n&&r.length!==void 0))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replaceAll("|",""),t+=r.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",r.length>0?t+=(o?[e,r.length,r.x,r.y]:[r.length,e]).join("|"):t+=e,t+S}};import $r from"node:assert";import Cr from"node:events";import p from"node:process";import Se from"node:readline";var O=class e extends Cr{static active=!1;value=void 0;firstRender=!0;done=!1;closed=!1;aborted=!1;exited=!1;close;constructor(){super(),$r(!e.active,"only one prompt can be active at a time"),e.active=!0;let r=Se.createInterface({input:p.stdin,escapeCodeTimeout:50});Se.emitKeypressEvents(p.stdin,r),p.stdin.isTTY&&p.stdin.setRawMode(!0);let t=["SelectPrompt"].includes(this.constructor.name),o=(n,i)=>{let c=Br(i,t);c===!1?this._(n,i):c&&typeof this[c]=="function"?this[c](i):this.bell()};this.close=()=>{p.stdin.removeListener("keypress",o),p.stdin.isTTY&&p.stdin.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0,e.active=!1},p.stdin.on("keypress",o)}_(r,t){}onRender(){}fire(){this.emit("state",{value:this.value,aborted:this.aborted,exited:this.exited})}bell(){x.writeStdout(F.beep)}render(){this.onRender(),this.firstRender&&(this.firstRender=!1)}},Br=(e,r)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl)switch(e.name){case"a":return"first";case"c":case"d":return"abort";case"e":return"last";case"g":return"reset"}if(r){if(e.name==="j")return"down";if(e.name==="k")return"up"}switch(e.name){case"return":case"enter":return"submit";case"backspace":return"delete";case"delete":return"deleteForward";case"abort":return"abort";case"escape":return"exit";case"tab":return"next";case"pagedown":return"nextPage";case"pageup":return"prevPage";case"home":return"home";case"end":return"end";case"up":return"up";case"down":return"down";case"right":return"right";case"left":return"left";default:return!1}}},Zt=(e,r,t)=>{t=t||r;let o=Math.min(r-t,e-Math.floor(t/2));o<0&&(o=0);let n=Math.min(o+t,r);return{startIndex:o,endIndex:n}};var Ae=e=>(e=H(e,{ensureEmptyLineAbove:!0,exitWhenNo:!0}),(r,...t)=>{if(ne(r))return Ae({...e,...r});let o=r;oe(o)||(o=B(r,...t));let n=e.whenNotInteractive??(()=>{f(e)(o),f({ensureEmptyLineAbove:!0})`
|
|
3
3
|
Aborting because ggt is not running in an interactive terminal.
|
|
4
4
|
`,C.exit(1)});return x.isInteractive?new Promise(i=>{let c=new ee(o,e);c.on("submit",i),c.on("exit",()=>C.exit(0)),c.on("abort",()=>C.exit(1))}):Promise.resolve(n())}),Pe=Ae({}),ee=class extends O{constructor(t,o){super();this.text=t;this.options=H(o,{exitWhenNo:!0,ensureEmptyLineAbove:!0}),this.options.ensureEmptyLineAbove&&(this.text=`
|
|
@@ -24,4 +24,4 @@ tell application "System Events" to get value of property list item "CFBundleNam
|
|
|
24
24
|
|
|
25
25
|
Once logged in, return to this terminal.
|
|
26
26
|
`}await o}finally{r?.close()}},Ee=Rr;export{O as a,Zt as b,Pe as c,we as d,Io as e,Rr as f,Ee as g,M as h,vo as i};
|
|
27
|
-
//# sourceMappingURL=chunk-
|
|
27
|
+
//# sourceMappingURL=chunk-PSRZ5JH5.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Ji,b as J,d as fr,e as dr,f as re}from"./chunk-
|
|
1
|
+
import{a as Ji,b as J,d as fr,e as dr,f as re}from"./chunk-BOQUW6DS.js";import{a as lr,c as ee}from"./chunk-D2K5XPNJ.js";import{a as cr}from"./chunk-Q5N5L6H3.js";import{a as mr,b as hr,i as gr}from"./chunk-PSRZ5JH5.js";import{b as st,e as pt,f as ft,i as z}from"./chunk-CKSTMUDN.js";import{c as Et,i as lt,o as pr}from"./chunk-AQRCAWW4.js";import{D as ir,E as zi,I as or,K as ar,N as Pt,R as ur,U as T,V as R,W as H,b as Q,e as I,g as xt,h as Ze,l as tr,m as er,t as rr,u as nr,v as sr,z as ct}from"./chunk-GBCD37US.js";import{a as qi,c as te,e as nt,g as O}from"./chunk-5WC5D4WL.js";var wr=te(j=>{"use strict";O();var Qi=j&&j.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(j,"__esModule",{value:!0});var Hi=qi("fs"),Yi=Qi(cr()),it=Yi.default("@kwsites/file-exists");function Ki(t,e,r){it("checking %s",t);try{let n=Hi.statSync(t);return n.isFile()&&e?(it("[OK] path represents a file"),!0):n.isDirectory()&&r?(it("[OK] path represents a directory"),!0):(it("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return it("[FAIL] path is not accessible: %o",n),!1;throw it("[FATAL] %o",n),n}}function Xi(t,e=j.READABLE){return Ki(t,(e&j.FILE)>0,(e&j.FOLDER)>0)}j.exists=Xi;j.FILE=1;j.FOLDER=2;j.READABLE=j.FILE+j.FOLDER});var Tr=te(Rt=>{"use strict";O();function Zi(t){for(var e in t)Rt.hasOwnProperty(e)||(Rt[e]=t[e])}Object.defineProperty(Rt,"__esModule",{value:!0});Zi(wr())});var ue=te(Z=>{"use strict";O();Object.defineProperty(Z,"__esModule",{value:!0});Z.createDeferred=Z.deferred=void 0;function ae(){let t,e,r="pending";return{promise:new Promise((s,i)=>{t=s,e=i}),done(s){r==="pending"&&(r="resolved",t(s))},fail(s){r==="pending"&&(r="rejected",e(s))},get fulfilled(){return r!=="pending"},get status(){return r}}}Z.deferred=ae;Z.createDeferred=ae;Z.default=ae});O();var yr=nt(Ji(),1);var Tc=Object.freeze({Fatal:"Fatal",Error:"Error",Warning:"Warning",Info:"Info"}),ne=({problems:t,showFileTypes:e,...r})=>{let n="";for(let[s,i]of Object.entries(t)){n+=R(""),n+=R`• {cyan ${s}} {redBright ${(0,yr.default)("problem",i.length,!0)}}`;for(let o of i){let[a,...l]=o.message.split(`
|
|
2
2
|
`);n+=T` {red ✖} `,(e??o.type==="SourceFile")&&(n+=T`${Vi(s)} `),n+=T(a);for(let p of l)n+=R(""),n+=T` ${p}`;for(let p of o.labels)n+=T` {dim ${p}}`;n+=R("")}}return R(r)(n)},Sc=t=>{H(ne(t))},Vi=t=>{switch(!0){case rr(t):return Q.yellowBright("JavaScript");case nr(t):return Q.blue("TypeScript");case sr(t):return Q.magenta("Gelly");default:return Q.gray("File")}},xc=t=>{let e={};for(let r of t){let n=r.node?.apiIdentifier??r.node?.name??"Other";e[n]??=[],e[n].push({type:r.node?.type??"Unknown",severity:r.severity,message:r.message,labels:lr(r.nodeLabels?.map(s=>s?.identifier)??[])})}return e},Pc=t=>{let e={};for(let r of t)e[r.path]??=[],e[r.path].push({type:r.type,severity:r.level,message:r.message,labels:[]});return e};O();var vr=class extends ft{isBug=pt.NO;constructor(){super("Yarn not found")}render(){return T`
|
|
3
3
|
Yarn must be installed to sync your application. You can install it by running:
|
|
4
4
|
|
|
@@ -61,7 +61,7 @@ import{a as Ji,b as J,d as fr,e as dr,f as re}from"./chunk-G3VNV5Z6.js";import{a
|
|
|
61
61
|
${e} https://my-app.gadget.app
|
|
62
62
|
${e} https://my-app.gadget.app/edit
|
|
63
63
|
${e} https://my-app--development.gadget.app/edit
|
|
64
|
-
`)};O();import Ke from"node:assert";var Yt=class{ctx;#t;constructor(e){this.ctx=e.child({name:"edit"}),this.#t=new fr(this.ctx,"/edit/api/graphql")}async query({query:e,variables:r,...n}){let s=e.match(/query (\w+)/)?.[1];Ke(s,"query name not found");let i=this.ctx.child({fields:{edit:{query:s}},devFields:{edit:{query:s,variables:ct(r)}}});i.log.info("executing graphql query");let o=await this.#t.execute(i,{operation:e,variables:r,...n,http:{retry:{methods:["POST"]},...n.http}});if(o.errors)throw new J(e,o.errors);if(!o.data)throw new J(e,"Query response did not contain data");return o.data}async mutate({mutation:e,variables:r,...n}){let s=e.match(/mutation (\w+)/)?.[1];Ke(s,"mutation name not found");let i=this.ctx.child({fields:{edit:{mutation:s}},devFields:{edit:{mutation:s,variables:ct(r)}}});i.log.info("executing graphql mutation");let o=await this.#t.execute(i,{operation:e,variables:r,...n});if(o.errors)throw new J(e,o.errors);if(!o.data)throw new J(e,"Mutation response did not contain data");return o.data}subscribe({onData:e,...r}){let n=r.subscription.match(/subscription (\w+)/)?.[1];Ke(n,"subscription name not found");let s=this.ctx.child({fields:{edit:{subscription:n}},devFields:{edit:{subscription:n,variables:ct(r.variables)}}}),i=async a=>{if(a.errors){o(),await r.onError(new J(r.subscription,a.errors));return}if(!a.data){o(),await r.onError(new J(r.subscription,"Subscription response did not contain data"));return}await e(a.data)};s.log.info("subscribing to graphql subscription");let o=this.#t.subscribe(s,{...r,onResponse:i});return{unsubscribe:o,resubscribe:a=>{o(),a!==void 0&&(r.variables=a),s=this.ctx.child({fields:{edit:{subscription:n}},devFields:{edit:{subscription:n,variables:ct(r.variables)}}}),s.log.info("re-subscribing to graphql subscription"),o=this.#t.subscribe(s,{...r,onResponse:i})}}}async dispose(){await this.#t.dispose()}};var pp={"--app":{type:oi,alias:["-a","--application"]},"--env":{type:String,alias:["-e","--environment"]},"--allow-unknown-directory":Boolean,"--allow-different-app":Boolean},ui=class t{constructor(e,r,n,s){this.ctx=e;this.directory=r;this.previousEnvironment=n;this.state=s;this.ctx=e.child({fields:()=>({syncJson:{directory:this.directory.path,branch:this.gitBranch,...this.state}})}),Kt(this.ctx.app,"app must be set on syncJson context"),this.app=this.ctx.app,Kt(this.ctx.env,"env must be set on syncJson context"),this.env=this.ctx.env,this.edit=new Yt(this.ctx)}app;env;gitBranch;edit;_mtime;get filesVersion(){let e=this.state.environments[this.state.environment];return Kt(e,"environment must exist in environments"),BigInt(e.filesVersion)}static async load(e,{directory:r}){e=e.child({name:"sync-json"});let n=await gr(e),s=await re(e);if(s.length===0)throw new z(T`
|
|
64
|
+
`)};O();import Ke from"node:assert";var Yt=class{ctx;#t;constructor(e){this.ctx=e.child({name:"edit"}),this.#t=new fr(this.ctx,"/edit/api/graphql")}async query({query:e,variables:r,...n}){let s=e.match(/query (\w+)/)?.[1];Ke(s,"query name not found");let i=this.ctx.child({fields:{edit:{query:s}},devFields:{edit:{query:s,variables:ct(r)}}});i.log.info("executing graphql query");let o=await this.#t.execute(i,{operation:e,variables:r,...n,http:{retry:{methods:["POST"]},...n.http}});if(o.errors)throw new J(e,o.errors);if(!o.data)throw new J(e,"Query response did not contain data");return o.data}async mutate({mutation:e,variables:r,...n}){let s=e.match(/mutation (\w+)/)?.[1];Ke(s,"mutation name not found");let i=this.ctx.child({fields:{edit:{mutation:s}},devFields:{edit:{mutation:s,variables:ct(r)}}});i.log.info("executing graphql mutation");let o=await this.#t.execute(i,{operation:e,variables:r,...n});if(o.errors)throw new J(e,o.errors);if(!o.data)throw new J(e,"Mutation response did not contain data");return o.data}subscribe({onData:e,...r}){let n=r.subscription.match(/subscription (\w+)/)?.[1];Ke(n,"subscription name not found");let s=this.ctx.child({fields:{edit:{subscription:n}},devFields:{edit:{subscription:n,variables:ct(r.variables)}}}),i=async a=>{if(a.errors){o(),await r.onError(new J(r.subscription,a.errors));return}if(!a.data){o(),await r.onError(new J(r.subscription,"Subscription response did not contain data"));return}await e(a.data)};s.log.info("subscribing to graphql subscription");let o=this.#t.subscribe(s,{...r,onResponse:i});return{unsubscribe:()=>{o()},resubscribe:a=>{o(),a!==void 0&&(r.variables=a),s=this.ctx.child({fields:{edit:{subscription:n}},devFields:{edit:{subscription:n,variables:ct(r.variables)}}}),s.log.info("re-subscribing to graphql subscription"),o=this.#t.subscribe(s,{...r,onResponse:i})}}}async dispose(){await this.#t.dispose()}};var pp={"--app":{type:oi,alias:["-a","--application"]},"--env":{type:String,alias:["-e","--environment"]},"--allow-unknown-directory":Boolean,"--allow-different-app":Boolean},ui=class t{constructor(e,r,n,s){this.ctx=e;this.directory=r;this.previousEnvironment=n;this.state=s;this.ctx=e.child({fields:()=>({syncJson:{directory:this.directory.path,branch:this.gitBranch,...this.state}})}),Kt(this.ctx.app,"app must be set on syncJson context"),this.app=this.ctx.app,Kt(this.ctx.env,"env must be set on syncJson context"),this.env=this.ctx.env,this.edit=new Yt(this.ctx)}app;env;gitBranch;edit;_mtime;get filesVersion(){let e=this.state.environments[this.state.environment];return Kt(e,"environment must exist in environments"),BigInt(e.filesVersion)}static async load(e,{directory:r}){e=e.child({name:"sync-json"});let n=await gr(e),s=await re(e);if(s.length===0)throw new z(T`
|
|
65
65
|
You (${n.email}) don't have have any Gadget applications.
|
|
66
66
|
|
|
67
67
|
Visit https://gadget.new to create one!
|
|
@@ -123,4 +123,4 @@ import{a as Ji,b as J,d as fr,e as dr,f as re}from"./chunk-G3VNV5Z6.js";import{a
|
|
|
123
123
|
• ${o.join(`
|
|
124
124
|
\u2022 `)}
|
|
125
125
|
`)},mc=async(t,{directory:e})=>{try{return await ii(e.path).revparse(["--abbrev-ref","HEAD"])}catch(r){t.log.warn("failed to read git branch",{error:r});return}},hc=I.object({application:I.string(),environment:I.string(),environments:I.record(I.object({filesVersion:I.string()}))}),dc=I.object({app:I.string(),filesVersion:I.string(),mtime:I.number()}),gc=I.union([hc,dc]),yc=gc.transform(t=>"environment"in t?t:{application:t.app,environment:"development",environments:{development:{filesVersion:t.filesVersion}}});export{Tc as a,ne as b,Sc as c,xc as d,Pc as e,vr as f,Ot as g,br as h,_r as i,Wi as j,Dc as k,oe as l,pp as m,ui as n,fp as o};
|
|
126
|
-
//# sourceMappingURL=chunk-
|
|
126
|
+
//# sourceMappingURL=chunk-RJOIQTYZ.js.map
|