@junobuild/cli 0.5.2 → 0.5.3

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -625,7 +625,7 @@ Change submitted.
625
625
  \u{1F680} Deploy complete!`),{result:"deployed",files:n}},gZ=async({deploy:{uploadFile:e,...t},proposal:{clearAssets:r,...n}})=>{let i=await bZ(t);if(i.result==="skipped")return{result:"skipped"};let{sourceAbsolutePath:s}=i,a=vZ(i),o=await fZ({deploy:{uploadFile:e,files:a,sourceAbsolutePath:s,collection:ah},proposal:{...n,proposalType:{AssetsUpgrade:{clear_existing_assets:(0,IX.toNullable)(r)}}}});return o.result==="deployed"&&console.log(`
626
626
  \u{1F680} Deploy complete!`),o},bZ=async({assertMemory:e,...t})=>{let{files:r,sourceAbsolutePath:n}=await O8e(t);return r.length===0?(console.log("\u26A0\uFE0F No file changes detected. Upload skipped."),{result:"skipped"}):(await e?.(),{result:"to-deploy",files:r,sourceAbsolutePath:n})},vZ=({files:e,sourceAbsolutePath:t})=>{let r=n=>{let i=n.alternateFile??n.file;return{fullPath:pZ({file:i,sourceAbsolutePath:t}),filePath:i}};return e.map(n=>({file:n,paths:r(n)}))},xZ=async({publish:{assertMemory:e,filePath:t,fullPath:r,...n},proposal:{version:i,...s}})=>{await e?.();let a=await fZ({deploy:{...n,files:[{file:{file:t},paths:{filePath:t,fullPath:r}}],collection:Jk},proposal:{...s,proposalType:{SegmentsDeployment:{satellite_version:(0,DS.toNullable)(i),orbiter:(0,DS.toNullable)(),mission_control_version:(0,DS.toNullable)()}}}});return a.result==="deployed"&&console.log(`
627
627
  \u{1F4E1} Satellite WASM published to CDN.`),a},Bt=({args:e,options:t})=>e?.find(r=>t.includes(r))!==void 0,Tt=({args:e,option:t})=>{let r=(e??[]).findIndex(n=>n===t);if(r!==-1)return e?.[r+1]},n6=async e=>await new Promise((t,r)=>{((typeof e=="string"?URL.parse(e)?.protocol:e.protocol)==="http:"?H8e:W8e)(e,async n=>{(0,Mk.nonNullish)(n.statusCode)&&(0,Mk.nonNullish)(n.headers.location)&&[301,302].includes(n.statusCode)&&await n6(n.headers.location).then(t,r);let i=[];n.on("data",s=>i.push(s)),n.on("end",()=>{t(Buffer.concat(i))}),n.on("error",r)})}),EZ=async({packageJsonPath:e})=>{let t=await z8e(e,"utf-8"),{dependencies:r,version:n,juno:i,name:s}=JSON.parse(t);return{name:s,version:n,dependencies:r,juno:i}},si=(e,t)=>{((0,MS.isNullish)(e)||e==="")&&((0,MS.nonNullish)(t)&&console.error(t),process.exit(1))};var AN=ae(Ye(),1);var $ce=ae(Qv(),1),qce=ae(Xe(),1);var tj=ae(Ye(),1),Uce=ae(Lc(),1);var Yo=ae(Xe(),1),uP=ae(Ye(),1);var nre=ae(Lc(),1),l2=async(e="Please provide the password for your CLI configuration.")=>{let{encryptionKey:t}=await(0,nre.default)([{type:"password",name:"encryptionKey",message:e}]);return si(t),t};var tx=ae(Xe(),1),Voe=ae(Ye(),1);import{isDeepStrictEqual as $ze}from"node:util";import Ioe from"node:process";import Sh from"node:fs";import Noe from"node:path";import Q1 from"node:crypto";import qze from"node:assert";var dh=e=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")};var D4=new Set(["__proto__","prototype","constructor"]),E9e=new Set("0123456789");function p2(e){let t=[],r="",n="start",i=!1;for(let s of e)switch(s){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");i&&(r+=s),n="property",i=!i;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(i){i=!1,r+=s;break}if(D4.has(r))return[];t.push(r),r="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(i){i=!1,r+=s;break}if(n==="property"){if(D4.has(r))return[];t.push(r),r=""}n="index";break}case"]":{if(n==="index"){t.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!E9e.has(s))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),i&&(i=!1,r+="\\"),r+=s}}switch(i&&(r+="\\"),n){case"property":{if(D4.has(r))return[];t.push(r);break}case"index":throw new Error("Index was not closed");case"start":{t.push("");break}}return t}function O4(e,t){if(typeof t!="number"&&Array.isArray(e)){let r=Number.parseInt(t,10);return Number.isInteger(r)&&e[r]===e[t]}return!1}function ire(e,t){if(O4(e,t))throw new Error("Cannot use string index")}function sre(e,t,r){if(!dh(e)||typeof t!="string")return r===void 0?e:r;let n=p2(t);if(n.length===0)return r;for(let i=0;i<n.length;i++){let s=n[i];if(O4(e,s)?e=i===n.length-1?void 0:null:e=e[s],e==null){if(i!==n.length-1)return r;break}}return e===void 0?r:e}function I4(e,t,r){if(!dh(e)||typeof t!="string")return e;let n=e,i=p2(t);for(let s=0;s<i.length;s++){let a=i[s];ire(e,a),s===i.length-1?e[a]=r:dh(e[a])||(e[a]=typeof i[s+1]=="number"?[]:{}),e=e[a]}return n}function are(e,t){if(!dh(e)||typeof t!="string")return!1;let r=p2(t);for(let n=0;n<r.length;n++){let i=r[n];if(ire(e,i),n===r.length-1)return delete e[i],!0;if(e=e[i],!dh(e))return!1}}function ore(e,t){if(!dh(e)||typeof t!="string")return!1;let r=p2(t);if(r.length===0)return!1;for(let n of r){if(!dh(e)||!(n in e)||O4(e,n))return!1;e=e[n]}return!0}import ci from"node:path";import cre from"node:os";import N4 from"node:process";var Ad=cre.homedir(),F4=cre.tmpdir(),{env:ry}=N4,_9e=e=>{let t=ci.join(Ad,"Library");return{data:ci.join(t,"Application Support",e),config:ci.join(t,"Preferences",e),cache:ci.join(t,"Caches",e),log:ci.join(t,"Logs",e),temp:ci.join(F4,e)}},w9e=e=>{let t=ry.APPDATA||ci.join(Ad,"AppData","Roaming"),r=ry.LOCALAPPDATA||ci.join(Ad,"AppData","Local");return{data:ci.join(r,e,"Data"),config:ci.join(t,e,"Config"),cache:ci.join(r,e,"Cache"),log:ci.join(r,e,"Log"),temp:ci.join(F4,e)}},T9e=e=>{let t=ci.basename(Ad);return{data:ci.join(ry.XDG_DATA_HOME||ci.join(Ad,".local","share"),e),config:ci.join(ry.XDG_CONFIG_HOME||ci.join(Ad,".config"),e),cache:ci.join(ry.XDG_CACHE_HOME||ci.join(Ad,".cache"),e),log:ci.join(ry.XDG_STATE_HOME||ci.join(Ad,".local","state"),e),temp:ci.join(F4,t,e)}};function p1(e,{suffix:t="nodejs"}={}){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return t&&(e+=`-${t}`),N4.platform==="darwin"?_9e(e):N4.platform==="win32"?w9e(e):T9e(e)}import C9e from"node:path";import Hr from"node:fs";import{promisify as js}from"node:util";var Zl=(e,t)=>function(...n){return e.apply(void 0,n).catch(t)},Yu=(e,t)=>function(...n){try{return e.apply(void 0,n)}catch(i){return t(i)}};import ure from"node:process";var lre=ure.getuid?!ure.getuid():!1,pre=1e4,Ba=()=>{};var d1={isChangeErrorOk:e=>{if(!d1.isNodeError(e))return!1;let{code:t}=e;return t==="ENOSYS"||!lre&&(t==="EINVAL"||t==="EPERM")},isNodeError:e=>e instanceof Error,isRetriableError:e=>{if(!d1.isNodeError(e))return!1;let{code:t}=e;return t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM"},onChangeError:e=>{if(!d1.isNodeError(e))throw e;if(!d1.isChangeErrorOk(e))throw e}},Ai=d1;var k4=class{constructor(){this.interval=25,this.intervalId=void 0,this.limit=pre,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(this.intervalId),delete this.intervalId)},this.add=t=>{this.queueWaiting.add(t),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=t=>{this.queueWaiting.delete(t),this.queueActive.delete(t)},this.schedule=()=>new Promise(t=>{let r=()=>this.remove(n),n=()=>t(r);this.add(n)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(let t of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(t),this.queueActive.add(t),t()}}}}},dre=new k4;var Ql=(e,t)=>function(n){return function i(...s){return dre.schedule().then(a=>{let o=u=>(a(),u),c=u=>{if(a(),Date.now()>=n)throw u;if(t(u)){let l=Math.round(100*Math.random());return new Promise(d=>setTimeout(d,l)).then(()=>i.apply(void 0,s))}throw u};return e.apply(void 0,s).then(o,c)})}},ep=(e,t)=>function(n){return function i(...s){try{return e.apply(void 0,s)}catch(a){if(Date.now()>n)throw a;if(t(a))return i.apply(void 0,s);throw a}}};var S9e={attempt:{chmod:Zl(js(Hr.chmod),Ai.onChangeError),chown:Zl(js(Hr.chown),Ai.onChangeError),close:Zl(js(Hr.close),Ba),fsync:Zl(js(Hr.fsync),Ba),mkdir:Zl(js(Hr.mkdir),Ba),realpath:Zl(js(Hr.realpath),Ba),stat:Zl(js(Hr.stat),Ba),unlink:Zl(js(Hr.unlink),Ba),chmodSync:Yu(Hr.chmodSync,Ai.onChangeError),chownSync:Yu(Hr.chownSync,Ai.onChangeError),closeSync:Yu(Hr.closeSync,Ba),existsSync:Yu(Hr.existsSync,Ba),fsyncSync:Yu(Hr.fsync,Ba),mkdirSync:Yu(Hr.mkdirSync,Ba),realpathSync:Yu(Hr.realpathSync,Ba),statSync:Yu(Hr.statSync,Ba),unlinkSync:Yu(Hr.unlinkSync,Ba)},retry:{close:Ql(js(Hr.close),Ai.isRetriableError),fsync:Ql(js(Hr.fsync),Ai.isRetriableError),open:Ql(js(Hr.open),Ai.isRetriableError),readFile:Ql(js(Hr.readFile),Ai.isRetriableError),rename:Ql(js(Hr.rename),Ai.isRetriableError),stat:Ql(js(Hr.stat),Ai.isRetriableError),write:Ql(js(Hr.write),Ai.isRetriableError),writeFile:Ql(js(Hr.writeFile),Ai.isRetriableError),closeSync:ep(Hr.closeSync,Ai.isRetriableError),fsyncSync:ep(Hr.fsyncSync,Ai.isRetriableError),openSync:ep(Hr.openSync,Ai.isRetriableError),readFileSync:ep(Hr.readFileSync,Ai.isRetriableError),renameSync:ep(Hr.renameSync,Ai.isRetriableError),statSync:ep(Hr.statSync,Ai.isRetriableError),writeSync:ep(Hr.writeSync,Ai.isRetriableError),writeFileSync:ep(Hr.writeFileSync,Ai.isRetriableError)}},es=S9e;import fre from"node:os";import R4 from"node:process";var hre="utf8",B4=438,mre=511;var yre={},gre=fre.userInfo().uid,bre=fre.userInfo().gid;var vre=1e3,xre=!!R4.getuid,UKt=R4.getuid?!R4.getuid():!1,j4=128;var Ere=e=>e instanceof Error&&"code"in e;var L4=e=>typeof e=="string",d2=e=>e===void 0;import A9e from"node:path";import ny from"node:process";import _re from"node:process";var wre=_re.platform==="linux",f2=_re.platform==="win32";var M4=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];f2||M4.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");wre&&M4.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED");var Tre=M4;var $4=class{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=t=>{if(!this.exited){this.exited=!0;for(let r of this.callbacks)r();t&&(f2&&t!=="SIGINT"&&t!=="SIGTERM"&&t!=="SIGKILL"?ny.kill(ny.pid,"SIGTERM"):ny.kill(ny.pid,t))}},this.hook=()=>{ny.once("exit",()=>this.exit());for(let t of Tre)try{ny.once(t,()=>this.exit(t))}catch{}},this.register=t=>(this.callbacks.add(t),()=>{this.callbacks.delete(t)}),this.hook()}},Sre=new $4;var P9e=Sre.register,Pre=P9e;var lo={store:{},create:e=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),i=`.tmp-${Date.now().toString().slice(-10)}${t}`;return`${e}${i}`},get:(e,t,r=!0)=>{let n=lo.truncate(t(e));return n in lo.store?lo.get(e,t,r):(lo.store[n]=r,[n,()=>delete lo.store[n]])},purge:e=>{lo.store[e]&&(delete lo.store[e],es.attempt.unlink(e))},purgeSync:e=>{lo.store[e]&&(delete lo.store[e],es.attempt.unlinkSync(e))},purgeSyncAll:()=>{for(let e in lo.store)lo.purgeSync(e)},truncate:e=>{let t=A9e.basename(e);if(t.length<=j4)return e;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!r)return e;let n=t.length-j4;return`${e.slice(0,-t.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};Pre(lo.purgeSyncAll);var f1=lo;function q4(e,t,r=yre){if(L4(r))return q4(e,t,{encoding:r});let n=Date.now()+((r.timeout??vre)||-1),i=null,s=null,a=null;try{let o=es.attempt.realpathSync(e),c=!!o;e=o||e,[s,i]=f1.get(e,r.tmpCreate||f1.create,r.tmpPurge!==!1);let u=xre&&d2(r.chown),l=d2(r.mode);if(c&&(u||l)){let p=es.attempt.statSync(e);p&&(r={...r},u&&(r.chown={uid:p.uid,gid:p.gid}),l&&(r.mode=p.mode))}if(!c){let p=C9e.dirname(e);es.attempt.mkdirSync(p,{mode:mre,recursive:!0})}a=es.retry.openSync(n)(s,"w",r.mode||B4),r.tmpCreated&&r.tmpCreated(s),L4(t)?es.retry.writeSync(n)(a,t,0,r.encoding||hre):d2(t)||es.retry.writeSync(n)(a,t,0,t.length,0),r.fsync!==!1&&(r.fsyncWait!==!1?es.retry.fsyncSync(n)(a):es.attempt.fsync(a)),es.retry.closeSync(n)(a),a=null,r.chown&&(r.chown.uid!==gre||r.chown.gid!==bre)&&es.attempt.chownSync(s,r.chown.uid,r.chown.gid),r.mode&&r.mode!==B4&&es.attempt.chmodSync(s,r.mode);try{es.retry.renameSync(n)(s,e)}catch(p){if(!Ere(p)||p.code!=="ENAMETOOLONG")throw p;es.retry.renameSync(n)(s,f1.truncate(e))}i(),s=null}finally{a&&es.attempt.closeSync(a),s&&f1.purge(s)}}var koe=ae(Ese(),1),Roe=ae(Mse(),1);var CVe=(e,t,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let i=Object.getOwnPropertyDescriptor(e,r),s=Object.getOwnPropertyDescriptor(t,r);!DVe(i,s)&&n||Object.defineProperty(e,r,s)},DVe=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},OVe=(e,t)=>{let r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},IVe=(e,t)=>`/* Wrapped ${e}*/
628
- ${t}`,NVe=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),FVe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),kVe=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,i=IVe.bind(null,n,t.toString());Object.defineProperty(i,"name",FVe);let{writable:s,enumerable:a,configurable:o}=NVe;Object.defineProperty(e,"toString",{value:i,writable:s,enumerable:a,configurable:o})};function W1(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let i of Reflect.ownKeys(t))CVe(e,t,i,r);return OVe(e,t),kVe(e,t,n),e}var RVe=(e,t={})=>{if(typeof e!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);let{wait:r=0,maxWait:n=Number.POSITIVE_INFINITY,before:i=!1,after:s=!0}=t;if(r<0||n<0)throw new RangeError("`wait` and `maxWait` must not be negative.");if(!i&&!s)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let a,o,c,u=function(...l){let p=this,d=()=>{a=void 0,o&&(clearTimeout(o),o=void 0),s&&(c=e.apply(p,l))},f=()=>{o=void 0,a&&(clearTimeout(a),a=void 0),s&&(c=e.apply(p,l))},h=i&&!a;return clearTimeout(a),a=setTimeout(d,r),n>0&&n!==Number.POSITIVE_INFINITY&&!o&&(o=setTimeout(f,n)),h&&(c=e.apply(p,l)),c};return W1(u,e),u.cancel=()=>{a&&(clearTimeout(a),a=void 0),o&&(clearTimeout(o),o=void 0)},u},rB=RVe;var Ph=ae(nl(),1);var Ize=Object.prototype.toString,Nze="[object Uint8Array]",Fze="[object ArrayBuffer]";function Doe(e,t,r){return e?e.constructor===t?!0:Ize.call(e)===r:!1}function Ooe(e){return Doe(e,Uint8Array,Nze)}function kze(e){return Doe(e,ArrayBuffer,Fze)}function Rze(e){return Ooe(e)||kze(e)}function Bze(e){if(!Ooe(e))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function jze(e){if(!Rze(e))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function EB(e,t){if(e.length===0)return new Uint8Array(0);t??=e.reduce((i,s)=>i+s.length,0);let r=new Uint8Array(t),n=0;for(let i of e)Bze(i),r.set(i,n),n+=i.length;return r}var Coe={utf8:new globalThis.TextDecoder("utf8")};function _B(e,t="utf8"){return jze(e),Coe[t]??=new globalThis.TextDecoder(t),Coe[t].decode(e)}function Lze(e){if(typeof e!="string")throw new TypeError(`Expected \`string\`, got \`${typeof e}\``)}var Mze=new globalThis.TextEncoder;function oP(e){return Lze(e),Mze.encode(e)}var YJt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));var Uze=Roe.default.default,Foe="aes-256-cbc",Py=()=>Object.create(null),Vze=e=>e!=null,Hze=(e,t)=>{let r=new Set(["undefined","symbol","function"]),n=typeof t;if(r.has(n))throw new TypeError(`Setting a value of type \`${n}\` for key \`${e}\` is not allowed as it's not supported by JSON`)},cP="__internal__",wB=`${cP}.migrations.version`,Ah=class{path;events;#e;#n;#t;#r={};constructor(t={}){let r={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...t};if(!r.cwd){if(!r.projectName)throw new Error("Please specify the `projectName` option.");r.cwd=p1(r.projectName,{suffix:r.projectSuffix}).config}if(this.#t=r,r.schema??r.ajvOptions??r.rootSchema){if(r.schema&&typeof r.schema!="object")throw new TypeError("The `schema` option must be an object.");let a=new koe.Ajv2020({allErrors:!0,useDefaults:!0,...r.ajvOptions});Uze(a);let o={...r.rootSchema,type:"object",properties:r.schema};this.#e=a.compile(o);for(let[c,u]of Object.entries(r.schema??{}))u?.default&&(this.#r[c]=u.default)}r.defaults&&(this.#r={...this.#r,...r.defaults}),r.serialize&&(this._serialize=r.serialize),r.deserialize&&(this._deserialize=r.deserialize),this.events=new EventTarget,this.#n=r.encryptionKey;let n=r.fileExtension?`.${r.fileExtension}`:"";this.path=Noe.resolve(r.cwd,`${r.configName??"config"}${n}`);let i=this.store,s=Object.assign(Py(),r.defaults,i);if(r.migrations){if(!r.projectVersion)throw new Error("Please specify the `projectVersion` option.");this._migrate(r.migrations,r.projectVersion,r.beforeEachMigration)}this._validate(s);try{qze.deepEqual(i,s)}catch{this.store=s}r.watch&&this._watch()}get(t,r){if(this.#t.accessPropertiesByDotNotation)return this._get(t,r);let{store:n}=this;return t in n?n[t]:r}set(t,r){if(typeof t!="string"&&typeof t!="object")throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof t}`);if(typeof t!="object"&&r===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(t))throw new TypeError(`Please don't use the ${cP} key, as it's used to manage this module internal operations.`);let{store:n}=this,i=(s,a)=>{Hze(s,a),this.#t.accessPropertiesByDotNotation?I4(n,s,a):n[s]=a};if(typeof t=="object"){let s=t;for(let[a,o]of Object.entries(s))i(a,o)}else i(t,r);this.store=n}has(t){return this.#t.accessPropertiesByDotNotation?ore(this.store,t):t in this.store}reset(...t){for(let r of t)Vze(this.#r[r])&&this.set(r,this.#r[r])}delete(t){let{store:r}=this;this.#t.accessPropertiesByDotNotation?are(r,t):delete r[t],this.store=r}clear(){this.store=Py();for(let t of Object.keys(this.#r))this.reset(t)}onDidChange(t,r){if(typeof t!="string")throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof t}`);if(typeof r!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof r}`);return this._handleChange(()=>this.get(t),r)}onDidAnyChange(t){if(typeof t!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);return this._handleChange(()=>this.store,t)}get size(){return Object.keys(this.store).length}get store(){try{let t=Sh.readFileSync(this.path,this.#n?null:"utf8"),r=this._encryptData(t),n=this._deserialize(r);return this._validate(n),Object.assign(Py(),n)}catch(t){if(t?.code==="ENOENT")return this._ensureDirectory(),Py();if(this.#t.clearInvalidConfig&&t.name==="SyntaxError")return Py();throw t}}set store(t){this._ensureDirectory(),this._validate(t),this._write(t),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[t,r]of Object.entries(this.store))yield[t,r]}_encryptData(t){if(!this.#n)return typeof t=="string"?t:_B(t);try{let r=t.slice(0,16),n=Q1.pbkdf2Sync(this.#n,r.toString(),1e4,32,"sha512"),i=Q1.createDecipheriv(Foe,n,r),s=t.slice(17),a=typeof s=="string"?oP(s):s;return _B(EB([i.update(a),i.final()]))}catch{}return t.toString()}_handleChange(t,r){let n=t(),i=()=>{let s=n,a=t();$ze(a,s)||(n=a,r.call(this,a,s))};return this.events.addEventListener("change",i),()=>{this.events.removeEventListener("change",i)}}_deserialize=t=>JSON.parse(t);_serialize=t=>JSON.stringify(t,void 0," ");_validate(t){if(!this.#e||this.#e(t)||!this.#e.errors)return;let n=this.#e.errors.map(({instancePath:i,message:s=""})=>`\`${i.slice(1)}\` ${s}`);throw new Error("Config schema violation: "+n.join("; "))}_ensureDirectory(){Sh.mkdirSync(Noe.dirname(this.path),{recursive:!0})}_write(t){let r=this._serialize(t);if(this.#n){let n=Q1.randomBytes(16),i=Q1.pbkdf2Sync(this.#n,n.toString(),1e4,32,"sha512"),s=Q1.createCipheriv(Foe,i,n);r=EB([n,oP(":"),s.update(oP(r)),s.final()])}if(Ioe.env.SNAP)Sh.writeFileSync(this.path,r,{mode:this.#t.configFileMode});else try{q4(this.path,r,{mode:this.#t.configFileMode})}catch(n){if(n?.code==="EXDEV"){Sh.writeFileSync(this.path,r,{mode:this.#t.configFileMode});return}throw n}}_watch(){this._ensureDirectory(),Sh.existsSync(this.path)||this._write(Py()),Ioe.platform==="win32"?Sh.watch(this.path,{persistent:!1},rB(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100})):Sh.watchFile(this.path,{persistent:!1},rB(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5e3}))}_migrate(t,r,n){let i=this._get(wB,"0.0.0"),s=Object.keys(t).filter(o=>this._shouldPerformMigration(o,i,r)),a={...this.store};for(let o of s)try{n&&n(this,{fromVersion:i,toVersion:o,finalVersion:r,versions:s});let c=t[o];c?.(this),this._set(wB,o),i=o,a={...this.store}}catch(c){throw this.store=a,new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${c}`)}(this._isVersionInRangeFormat(i)||!Ph.default.eq(i,r))&&this._set(wB,r)}_containsReservedKey(t){return typeof t=="object"&&Object.keys(t)[0]===cP?!0:typeof t!="string"?!1:this.#t.accessPropertiesByDotNotation?!!t.startsWith(`${cP}.`):!1}_isVersionInRangeFormat(t){return Ph.default.clean(t)===null}_shouldPerformMigration(t,r,n){return this._isVersionInRangeFormat(t)?r!=="0.0.0"&&Ph.default.satisfies(r,t)?!1:Ph.default.satisfies(n,t):!(Ph.default.lte(t,r)||Ph.default.gt(t,n))}_get(t,r){return sre(this.store,t,r)}_set(t,r){let{store:n}=this;I4(n,t,r),this.store=n}};var Boe=ae(Xe(),1);var joe=()=>{let[e,...t]=process.argv.slice(2),r=Tt({args:t,option:"-m"})??Tt({args:t,option:"--mode"}),i=Tt({args:t,option:"--container-url"})??(r==="development"?"http://127.0.0.1:5987":void 0);return{mode:r??"production",containerUrl:i,console:Wze({args:t,mode:r}),config:zze({mode:r}),ci:!0}},Wze=({args:e,mode:t})=>{let n=Tt({args:e,option:"--console-url"})??(t==="development"?"http://localhost:5866":"https://console.juno.build");return{urls:{root:n,satellite:`${n}/satellite/?s=`,auth:`${n}/cli`}}},zze=({mode:e})=>{let t=(0,Boe.notEmptyString)(e)&&e!=="production"?`juno-${e}`:"juno";return{projectName:t,projectSettingsName:`${t}-cli-settings`}};var Vn=joe(),Loe=Vn.mode==="development";var Kze={encryption:{type:"boolean"}},TB=()=>new Ah({projectName:Vn.config.projectSettingsName,schema:Kze}),Moe=e=>{TB().set("encryption",e)};var PB=ae(Xe(),1);import{existsSync as Jze}from"node:fs";import{resolve as Xze}from"node:path";var Gze={token:{type:"array"},satellites:{type:"array"}},Yze={configName:"config",projectSuffix:"nodejs",fileExtension:"json"},SB={...Yze,projectName:Vn.config.projectName,schema:Gze};var ex=e=>new Ah({...SB,...(0,PB.nonNullish)(e)&&{encryptionKey:e}}),Zze=()=>{let{projectName:e,projectSuffix:t,fileExtension:r,configName:n}=SB,i=p1(e,{suffix:t}).config,s=(0,PB.nonNullish)(r)?`.${r}`:"";return Xze(i,`${n}${s}`)},$oe=()=>Jze(Zze());var AB=()=>{let e=process.env.JUNO_TOKEN;if(e!==void 0)try{let{token:t}=JSON.parse(atob(e));return t}catch{throw new Error("Cannot parse token provided as an environment variable.")}},Qze=()=>AB()!==void 0,Ch=()=>{if(Qze())return!0;let[e,...t]=process.argv.slice(2);return Bt({args:t,options:["--headless"]})},qoe=()=>!Ch();var Uoe=ae(Lc(),1),ts=`
628
+ ${t}`,NVe=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),FVe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),kVe=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,i=IVe.bind(null,n,t.toString());Object.defineProperty(i,"name",FVe);let{writable:s,enumerable:a,configurable:o}=NVe;Object.defineProperty(e,"toString",{value:i,writable:s,enumerable:a,configurable:o})};function W1(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let i of Reflect.ownKeys(t))CVe(e,t,i,r);return OVe(e,t),kVe(e,t,n),e}var RVe=(e,t={})=>{if(typeof e!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);let{wait:r=0,maxWait:n=Number.POSITIVE_INFINITY,before:i=!1,after:s=!0}=t;if(r<0||n<0)throw new RangeError("`wait` and `maxWait` must not be negative.");if(!i&&!s)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let a,o,c,u=function(...l){let p=this,d=()=>{a=void 0,o&&(clearTimeout(o),o=void 0),s&&(c=e.apply(p,l))},f=()=>{o=void 0,a&&(clearTimeout(a),a=void 0),s&&(c=e.apply(p,l))},h=i&&!a;return clearTimeout(a),a=setTimeout(d,r),n>0&&n!==Number.POSITIVE_INFINITY&&!o&&(o=setTimeout(f,n)),h&&(c=e.apply(p,l)),c};return W1(u,e),u.cancel=()=>{a&&(clearTimeout(a),a=void 0),o&&(clearTimeout(o),o=void 0)},u},rB=RVe;var Ph=ae(nl(),1);var Ize=Object.prototype.toString,Nze="[object Uint8Array]",Fze="[object ArrayBuffer]";function Doe(e,t,r){return e?e.constructor===t?!0:Ize.call(e)===r:!1}function Ooe(e){return Doe(e,Uint8Array,Nze)}function kze(e){return Doe(e,ArrayBuffer,Fze)}function Rze(e){return Ooe(e)||kze(e)}function Bze(e){if(!Ooe(e))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function jze(e){if(!Rze(e))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function EB(e,t){if(e.length===0)return new Uint8Array(0);t??=e.reduce((i,s)=>i+s.length,0);let r=new Uint8Array(t),n=0;for(let i of e)Bze(i),r.set(i,n),n+=i.length;return r}var Coe={utf8:new globalThis.TextDecoder("utf8")};function _B(e,t="utf8"){return jze(e),Coe[t]??=new globalThis.TextDecoder(t),Coe[t].decode(e)}function Lze(e){if(typeof e!="string")throw new TypeError(`Expected \`string\`, got \`${typeof e}\``)}var Mze=new globalThis.TextEncoder;function oP(e){return Lze(e),Mze.encode(e)}var YJt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));var Uze=Roe.default.default,Foe="aes-256-cbc",Py=()=>Object.create(null),Vze=e=>e!=null,Hze=(e,t)=>{let r=new Set(["undefined","symbol","function"]),n=typeof t;if(r.has(n))throw new TypeError(`Setting a value of type \`${n}\` for key \`${e}\` is not allowed as it's not supported by JSON`)},cP="__internal__",wB=`${cP}.migrations.version`,Ah=class{path;events;#e;#n;#t;#r={};constructor(t={}){let r={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...t};if(!r.cwd){if(!r.projectName)throw new Error("Please specify the `projectName` option.");r.cwd=p1(r.projectName,{suffix:r.projectSuffix}).config}if(this.#t=r,r.schema??r.ajvOptions??r.rootSchema){if(r.schema&&typeof r.schema!="object")throw new TypeError("The `schema` option must be an object.");let a=new koe.Ajv2020({allErrors:!0,useDefaults:!0,...r.ajvOptions});Uze(a);let o={...r.rootSchema,type:"object",properties:r.schema};this.#e=a.compile(o);for(let[c,u]of Object.entries(r.schema??{}))u?.default&&(this.#r[c]=u.default)}r.defaults&&(this.#r={...this.#r,...r.defaults}),r.serialize&&(this._serialize=r.serialize),r.deserialize&&(this._deserialize=r.deserialize),this.events=new EventTarget,this.#n=r.encryptionKey;let n=r.fileExtension?`.${r.fileExtension}`:"";this.path=Noe.resolve(r.cwd,`${r.configName??"config"}${n}`);let i=this.store,s=Object.assign(Py(),r.defaults,i);if(r.migrations){if(!r.projectVersion)throw new Error("Please specify the `projectVersion` option.");this._migrate(r.migrations,r.projectVersion,r.beforeEachMigration)}this._validate(s);try{qze.deepEqual(i,s)}catch{this.store=s}r.watch&&this._watch()}get(t,r){if(this.#t.accessPropertiesByDotNotation)return this._get(t,r);let{store:n}=this;return t in n?n[t]:r}set(t,r){if(typeof t!="string"&&typeof t!="object")throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof t}`);if(typeof t!="object"&&r===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(t))throw new TypeError(`Please don't use the ${cP} key, as it's used to manage this module internal operations.`);let{store:n}=this,i=(s,a)=>{Hze(s,a),this.#t.accessPropertiesByDotNotation?I4(n,s,a):n[s]=a};if(typeof t=="object"){let s=t;for(let[a,o]of Object.entries(s))i(a,o)}else i(t,r);this.store=n}has(t){return this.#t.accessPropertiesByDotNotation?ore(this.store,t):t in this.store}reset(...t){for(let r of t)Vze(this.#r[r])&&this.set(r,this.#r[r])}delete(t){let{store:r}=this;this.#t.accessPropertiesByDotNotation?are(r,t):delete r[t],this.store=r}clear(){this.store=Py();for(let t of Object.keys(this.#r))this.reset(t)}onDidChange(t,r){if(typeof t!="string")throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof t}`);if(typeof r!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof r}`);return this._handleChange(()=>this.get(t),r)}onDidAnyChange(t){if(typeof t!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);return this._handleChange(()=>this.store,t)}get size(){return Object.keys(this.store).length}get store(){try{let t=Sh.readFileSync(this.path,this.#n?null:"utf8"),r=this._encryptData(t),n=this._deserialize(r);return this._validate(n),Object.assign(Py(),n)}catch(t){if(t?.code==="ENOENT")return this._ensureDirectory(),Py();if(this.#t.clearInvalidConfig&&t.name==="SyntaxError")return Py();throw t}}set store(t){this._ensureDirectory(),this._validate(t),this._write(t),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[t,r]of Object.entries(this.store))yield[t,r]}_encryptData(t){if(!this.#n)return typeof t=="string"?t:_B(t);try{let r=t.slice(0,16),n=Q1.pbkdf2Sync(this.#n,r.toString(),1e4,32,"sha512"),i=Q1.createDecipheriv(Foe,n,r),s=t.slice(17),a=typeof s=="string"?oP(s):s;return _B(EB([i.update(a),i.final()]))}catch{}return t.toString()}_handleChange(t,r){let n=t(),i=()=>{let s=n,a=t();$ze(a,s)||(n=a,r.call(this,a,s))};return this.events.addEventListener("change",i),()=>{this.events.removeEventListener("change",i)}}_deserialize=t=>JSON.parse(t);_serialize=t=>JSON.stringify(t,void 0," ");_validate(t){if(!this.#e||this.#e(t)||!this.#e.errors)return;let n=this.#e.errors.map(({instancePath:i,message:s=""})=>`\`${i.slice(1)}\` ${s}`);throw new Error("Config schema violation: "+n.join("; "))}_ensureDirectory(){Sh.mkdirSync(Noe.dirname(this.path),{recursive:!0})}_write(t){let r=this._serialize(t);if(this.#n){let n=Q1.randomBytes(16),i=Q1.pbkdf2Sync(this.#n,n.toString(),1e4,32,"sha512"),s=Q1.createCipheriv(Foe,i,n);r=EB([n,oP(":"),s.update(oP(r)),s.final()])}if(Ioe.env.SNAP)Sh.writeFileSync(this.path,r,{mode:this.#t.configFileMode});else try{q4(this.path,r,{mode:this.#t.configFileMode})}catch(n){if(n?.code==="EXDEV"){Sh.writeFileSync(this.path,r,{mode:this.#t.configFileMode});return}throw n}}_watch(){this._ensureDirectory(),Sh.existsSync(this.path)||this._write(Py()),Ioe.platform==="win32"?Sh.watch(this.path,{persistent:!1},rB(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100})):Sh.watchFile(this.path,{persistent:!1},rB(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5e3}))}_migrate(t,r,n){let i=this._get(wB,"0.0.0"),s=Object.keys(t).filter(o=>this._shouldPerformMigration(o,i,r)),a={...this.store};for(let o of s)try{n&&n(this,{fromVersion:i,toVersion:o,finalVersion:r,versions:s});let c=t[o];c?.(this),this._set(wB,o),i=o,a={...this.store}}catch(c){throw this.store=a,new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${c}`)}(this._isVersionInRangeFormat(i)||!Ph.default.eq(i,r))&&this._set(wB,r)}_containsReservedKey(t){return typeof t=="object"&&Object.keys(t)[0]===cP?!0:typeof t!="string"?!1:this.#t.accessPropertiesByDotNotation?!!t.startsWith(`${cP}.`):!1}_isVersionInRangeFormat(t){return Ph.default.clean(t)===null}_shouldPerformMigration(t,r,n){return this._isVersionInRangeFormat(t)?r!=="0.0.0"&&Ph.default.satisfies(r,t)?!1:Ph.default.satisfies(n,t):!(Ph.default.lte(t,r)||Ph.default.gt(t,n))}_get(t,r){return sre(this.store,t,r)}_set(t,r){let{store:n}=this;I4(n,t,r),this.store=n}};var Boe=ae(Xe(),1);var joe=()=>{let[e,...t]=process.argv.slice(2),r=Tt({args:t,option:"-m"})??Tt({args:t,option:"--mode"}),i=Tt({args:t,option:"--container-url"})??(r==="development"?"http://127.0.0.1:5987":void 0),s=process.env.CI==="true";return{mode:r??"production",containerUrl:i,console:Wze({args:t,mode:r}),config:zze({mode:r}),ci:s}},Wze=({args:e,mode:t})=>{let n=Tt({args:e,option:"--console-url"})??(t==="development"?"http://localhost:5866":"https://console.juno.build");return{urls:{root:n,satellite:`${n}/satellite/?s=`,auth:`${n}/cli`}}},zze=({mode:e})=>{let t=(0,Boe.notEmptyString)(e)&&e!=="production"?`juno-${e}`:"juno";return{projectName:t,projectSettingsName:`${t}-cli-settings`}};var Vn=joe(),Loe=Vn.mode==="development";var Kze={encryption:{type:"boolean"}},TB=()=>new Ah({projectName:Vn.config.projectSettingsName,schema:Kze}),Moe=e=>{TB().set("encryption",e)};var PB=ae(Xe(),1);import{existsSync as Jze}from"node:fs";import{resolve as Xze}from"node:path";var Gze={token:{type:"array"},satellites:{type:"array"}},Yze={configName:"config",projectSuffix:"nodejs",fileExtension:"json"},SB={...Yze,projectName:Vn.config.projectName,schema:Gze};var ex=e=>new Ah({...SB,...(0,PB.nonNullish)(e)&&{encryptionKey:e}}),Zze=()=>{let{projectName:e,projectSuffix:t,fileExtension:r,configName:n}=SB,i=p1(e,{suffix:t}).config,s=(0,PB.nonNullish)(r)?`.${r}`:"";return Xze(i,`${n}${s}`)},$oe=()=>Jze(Zze());var AB=()=>{let e=process.env.JUNO_TOKEN;if(e!==void 0)try{let{token:t}=JSON.parse(atob(e));return t}catch{throw new Error("Cannot parse token provided as an environment variable.")}},Qze=()=>AB()!==void 0,Ch=()=>{if(Qze())return!0;let[e,...t]=process.argv.slice(2);return Bt({args:t,options:["--headless"]})},qoe=()=>!Ch();var Uoe=ae(Lc(),1),ts=`
629
629
  `,eKe=()=>{process.stdout.write("\x1B[?25h")},tKe=e=>{e.aborted&&(eKe(),process.stdout.write(`
630
630
  `),process.exit(1))},rKe=async e=>{let{answer:t}=await(0,Uoe.default)([{type:"toggle",name:"answer",message:e,initial:!1,active:"yes",inactive:"no",onState:tKe}]);return t},Dh=async e=>await rKe(e),On=async e=>{await Dh(e)||process.exit(1)};var CB=class e{constructor(t){this.config=t;this.#e=t}#e;static async init(){let t=new e(TB());if(Ch()||$oe()&&(0,tx.nonNullish)(t.config.get("encryption")))return t;let n=await Dh("Do you want to encrypt the CLI config file stored on your machine for added security?");return Moe(n),n&&await t.migrateConfig(),t}isEncryptionEnabled(){return this.#e.get("encryption")}async migrateConfig(){try{let t=ex(void 0);if((0,tx.isNullish)(t.store)||t.size===0)return;let r=await l2("Please provide a password to encrypt your CLI configuration file"),n=ex(r);n.store=t.store}catch(t){console.log((0,Voe.yellow)("Your current configuration cannot be encrypted. Maybe it is already encrypted?")),console.log(t)}}},DB=class{#e;getSettingsStore=async()=>((0,tx.isNullish)(this.#e)&&(this.#e=await CB.init()),this.#e)},nKe=new DB,{getSettingsStore:Hoe}=nKe;var Hn,Ua=async()=>{if((0,Yo.nonNullish)(Hn))return;let e=await Hoe(),t=e.isEncryptionEnabled()?await l2():void 0;try{Hn=ex(t)}catch{console.log((0,uP.red)("Your current configuration cannot be read.")),e.isEncryptionEnabled()&&console.log((0,uP.yellow)(`
631
631
  Did you enter an incorrect password? \u{1F914}`)),process.exit(1)}},Woe=async({token:e,satellites:t,orbiters:r,missionControl:n,profile:i})=>{if(!sl(i)){let s=await Hc();await lP({...s!==void 0?s:{},[i]:{token:e,satellites:t,...r!==null&&{orbiters:r},...n!==null&&{missionControl:n}}}),await IB(i);return}await iKe(e),await zoe(t),r!==null&&await Joe(r),n!==null&&await Goe(n),await OB()},OB=async()=>{await Ua(),(0,Yo.assertNonNullish)(Hn),Hn.delete("use")},IB=async e=>{await Ua(),(0,Yo.assertNonNullish)(Hn),Hn.set("use",e)},il=async()=>(await Ua(),Hn?.get("use")),lP=async e=>{await Ua(),(0,Yo.assertNonNullish)(Hn),Hn.set("profiles",e)},Hc=async()=>(await Ua(),Hn?.get("profiles")),sl=e=>e==null||e==="default",iKe=async e=>{await Ua(),(0,Yo.assertNonNullish)(Hn),Hn.set("token",e)},jd=async()=>{await Ua();let e=await il();return sl(e)?Hn?.get("token"):(await Hc())?.[e]?.token},zoe=async e=>{await Ua(),(0,Yo.assertNonNullish)(Hn),Hn.set("satellites",e)},rx=async()=>{await Ua();let e=await il();return sl(e)?((0,Yo.assertNonNullish)(Hn),Hn.get("satellites")):(await Hc())?.[e]?.satellites??[]},Koe=async({satellite:e,profile:t})=>{if(!sl(t)){let n=await Hc(),i=n?.[t];if(i===void 0)throw new Error("The profile must exist.");await lP({...n!==void 0?n:{},[t]:{...i,satellites:[...(i.satellites??[]).filter(({p:s})=>s!==e.p),e]}});return}let r=await rx();await zoe([...(r??[]).filter(({p:n})=>n!==e.p),e])},Goe=async e=>{await Ua(),(0,Yo.assertNonNullish)(Hn),Hn.set("missionControl",e)},Ld=async()=>{await Ua();let e=await il();return sl(e)?Hn?.get("missionControl"):(await Hc())?.[e]?.missionControl},Yoe=async({missionControl:e,profile:t})=>{if(!sl(t)){let r=await Hc(),n=r?.[t];if(n===void 0)throw new Error("The profile must exist.");await lP({...r!==void 0?r:{},[t]:{...n,missionControl:e}});return}await Goe(e)},Joe=async e=>{await Ua(),(0,Yo.assertNonNullish)(Hn),Hn.set("orbiters",e)},po=async()=>{await Ua();let e=await il();return sl(e)?Hn?.get("orbiters"):(await Hc())?.[e]?.orbiters},Xoe=async({orbiter:e,profile:t})=>{if(!sl(t)){let n=await Hc(),i=n?.[t];if(i===void 0)throw new Error("The profile must exist.");await lP({...n!==void 0?n:{},[t]:{...i,orbiters:[...(i.orbiters??[]).filter(({p:s})=>s!==e.p),e]}});return}let r=await po();await Joe([...(r??[]).filter(({p:n})=>n!==e.p),e])},Zoe=async()=>{await Ua(),(0,Yo.assertNonNullish)(Hn),Hn.clear()};var fo=ae(Ye(),1),hP=ae(Lc(),1);var Us=e=>{switch(e){case"orbiter":return"orbiter";case"mission_control":return"mission control";default:return"satellite"}};var dP={};zW(dP,{beep:()=>OKe,clearScreen:()=>PKe,clearTerminal:()=>AKe,cursorBackward:()=>pKe,cursorDown:()=>uKe,cursorForward:()=>lKe,cursorGetPosition:()=>hKe,cursorHide:()=>gKe,cursorLeft:()=>tce,cursorMove:()=>cKe,cursorNextLine:()=>mKe,cursorPrevLine:()=>yKe,cursorRestorePosition:()=>fKe,cursorSavePosition:()=>dKe,cursorShow:()=>bKe,cursorTo:()=>oKe,cursorUp:()=>ece,enterAlternativeScreen:()=>CKe,eraseDown:()=>_Ke,eraseEndLine:()=>xKe,eraseLine:()=>rce,eraseLines:()=>vKe,eraseScreen:()=>NB,eraseStartLine:()=>EKe,eraseUp:()=>wKe,exitAlternativeScreen:()=>DKe,iTerm:()=>FKe,image:()=>NKe,link:()=>IKe,scrollDown:()=>SKe,scrollUp:()=>TKe});import FB from"node:process";var pP=globalThis.window?.document!==void 0,LXt=globalThis.process?.versions?.node!==void 0,MXt=globalThis.process?.versions?.bun!==void 0,$Xt=globalThis.Deno?.version?.deno!==void 0,qXt=globalThis.process?.versions?.electron!==void 0,UXt=globalThis.navigator?.userAgent?.includes("jsdom")===!0,VXt=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,HXt=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,WXt=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,zXt=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,nx=globalThis.navigator?.userAgentData?.platform,KXt=nx==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",GXt=nx==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",YXt=nx==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",JXt=nx==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),XXt=nx==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android";var un="\x1B[",sx="\x1B]",Ay="\x07",ix=";",Qoe=!pP&&FB.env.TERM_PROGRAM==="Apple_Terminal",sKe=!pP&&FB.platform==="win32",aKe=pP?()=>{throw new Error("`process.cwd()` only works in Node.js, not the browser.")}:FB.cwd,oKe=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof t!="number"?un+(e+1)+"G":un+(t+1)+ix+(e+1)+"H"},cKe=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let r="";return e<0?r+=un+-e+"D":e>0&&(r+=un+e+"C"),t<0?r+=un+-t+"A":t>0&&(r+=un+t+"B"),r},ece=(e=1)=>un+e+"A",uKe=(e=1)=>un+e+"B",lKe=(e=1)=>un+e+"C",pKe=(e=1)=>un+e+"D",tce=un+"G",dKe=Qoe?"\x1B7":un+"s",fKe=Qoe?"\x1B8":un+"u",hKe=un+"6n",mKe=un+"E",yKe=un+"F",gKe=un+"?25l",bKe=un+"?25h",vKe=e=>{let t="";for(let r=0;r<e;r++)t+=rce+(r<e-1?ece():"");return e&&(t+=tce),t},xKe=un+"K",EKe=un+"1K",rce=un+"2K",_Ke=un+"J",wKe=un+"1J",NB=un+"2J",TKe=un+"S",SKe=un+"T",PKe="\x1Bc",AKe=sKe?`${NB}${un}0f`:`${NB}${un}3J${un}H`,CKe=un+"?1049h",DKe=un+"?1049l",OKe=Ay,IKe=(e,t)=>[sx,"8",ix,ix,t,Ay,e,sx,"8",ix,ix,Ay].join(""),NKe=(e,t={})=>{let r=`${sx}1337;File=inline=1`;return t.width&&(r+=`;width=${t.width}`),t.height&&(r+=`;height=${t.height}`),t.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0"),r+":"+Buffer.from(e).toString("base64")+Ay},FKe={setCwd:(e=aKe())=>`${sx}50;CurrentDir=${e}${Ay}`,annotation(e,t={}){let r=`${sx}1337;`,n=t.x!==void 0,i=t.y!==void 0;if((n||i)&&!(n&&i&&t.length!==void 0))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replaceAll("|",""),r+=t.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",t.length>0?r+=(n?[e,t.length,t.x,t.y]:[t.length,e]).join("|"):r+=e,r+Ay}};var fP=ae(cce(),1);function Oh(e,t,{target:r="stdout",...n}={}){return fP.default[r]?dP.link(e,t):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,t):`${e} (\u200B${t}\u200B)`}Oh.isSupported=fP.default.stdout;Oh.stderr=(e,t,r={})=>Oh(e,t,{target:"stderr",...r});Oh.stderr.isSupported=fP.default.stderr;var jKe=(e,t)=>t,Ih=e=>Oh(e,e,{fallback:jKe});var uce=async e=>{let t=await qKe();console.log(`Before you finish setting things up, you'll need to add the access key to ${Us(t)} in Juno's console.
@@ -647,7 +647,7 @@ tell application "System Events" to get value of property list item "CFBundleNam
647
647
  ${(0,xn.yellow)("--container-url")} Override a custom container URL. If not provided, defaults to production or the local container in development mode.
648
648
  ${(0,xn.yellow)("--console-url")} Specify a custom URL to access the developer Console.`,jP=`${(0,xn.yellow)("-l, --lang")} Specify the language for building the serverless functions: ${(0,xn.magenta)("rust")}, ${(0,xn.magenta)("typescript")} or ${(0,xn.magenta)("javascript")}.
649
649
  ${(0,xn.yellow)("--cargo-path")} Path to the Rust manifest.
650
- ${(0,xn.yellow)("--source-path")} Optional path to the TypeScript or JavaScript entry file.`,LP=`The option ${(0,xn.yellow)("--keep-staged")} only applies when ${(0,xn.yellow)("--no-apply")} is NOT used (i.e. the change is applied immediately).`;var jt=e=>Bt({args:e,options:["-d","--doc"]})?"doc":"cli";var zn=ae(Ye(),1);var Ax="0.5.2";var XGe=` __ __ __ __ _ ____
650
+ ${(0,xn.yellow)("--source-path")} Optional path to the TypeScript or JavaScript entry file.`,LP=`The option ${(0,xn.yellow)("--keep-staged")} only applies when ${(0,xn.yellow)("--no-apply")} is NOT used (i.e. the change is applied immediately).`;var jt=e=>Bt({args:e,options:["-d","--doc"]})?"doc":"cli";var zn=ae(Ye(),1);var Ax="0.5.3";var XGe=` __ __ __ __ _ ____
651
651
  __) || | || \\| |/ \\
652
652
  \\___/ \\___/ |_|\\__|\\____/`,Rt=`${XGe} CLI ${(0,zn.grey)(`v${Ax}`)}`,Wce=`Juno CLI ${(0,zn.grey)(`v${Ax}`)}`,Cx=`
653
653
  ${Rt}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junobuild/cli",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "The Juno command-line interface",
5
5
  "author": "David Dal Busco (https://daviddalbusco.com)",
6
6
  "license": "MIT",