@junobuild/cli-tools 0.2.0-next-2025-06-03.9 → 0.2.0-next-2025-06-04

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.
@@ -25,8 +25,8 @@ Change submitted.
25
25
  `),console.log("\u{1F194} ",Number(r)),console.log("\u23F3 ",Object.keys(c)[0]??c),Jx(u)&&(console.log("\u274C Hash undefined. This is unexpected."),process.exit(1)),console.log("\u{1F512} ",Qx(u)),n?(await Xx({proposal:{proposal_id:r,sha256:u},cdn:e}),console.log(`\u{1F3AF} Change #${r} applied.`),{proposalId:r}):{proposalId:r}};var oh=Et(nh(),1);import{isNullish as $S,nonNullish as Io,notEmptyString as ah}from"@dfinity/utils";import{Blob as YS}from"buffer";import{readFile as GS}from"node:fs/promises";import{basename as WS,relative as HS}from"node:path";var rh=t=>{let e=t>=1e3?"megabyte":"kilobyte";return new Intl.NumberFormat("en",{style:"unit",unit:e}).format(t/(e==="megabyte"?1e6:1e3))};var On=async({files:t,uploadFile:e,sourceAbsolutePath:i,collection:n})=>{await ZS({files:t,sourceAbsolutePath:i,upload:async({file:a,paths:o})=>{await JS({collection:n,...o,file:a,uploadFile:e})}}),VS({files:t})},VS=({files:t})=>{let{count:e,size:i}=t.reduce(({count:n,size:r},{paths:a})=>({count:n+1,size:r+qc(a.filePath)}),{count:0,size:0});console.log(`
26
26
  \u2714 ${e} files uploaded (total: ${rh(i)})`)},ZS=async({files:t,sourceAbsolutePath:e,upload:i})=>{let n=async r=>{for(let a=0;a<r.length;a+=20){let o=r.slice(a,a+20);await new oh.default(o.map(({file:c,paths:u})=>({title:`Uploading ${HS(e,c.file)}`,task:async()=>await i({file:c,paths:u})})),{concurrent:!0}).run()}};await n(t.filter(({file:{alternateFile:r}})=>Io(r))),await n(t.filter(({file:{alternateFile:r}})=>$S(r)))},JS=async({uploadFile:t,file:e,fullPath:i,collection:n,filePath:r,token:a,description:o})=>{await t({filename:WS(r),fullPath:i,data:new YS([await GS(e.file)]),collection:n,headers:[...e.mime===void 0?[]:[["Content-Type",e.mime]]],encoding:e.encoding,...Io(a)&&ah(a)&&{token:a},...Io(o)&&ah(o)&&{description:o}})};var jn=async({deploy:{uploadFile:t,files:e,sourceAbsolutePath:i,collection:n},proposal:{proposalType:r,autoCommit:a,...o}})=>{let s=async u=>{await On({files:e,sourceAbsolutePath:i,collection:n,uploadFile:l=>t({...l,proposalId:u})})},{proposalId:c}=await Dc({...o,autoCommit:a,proposalType:r,executeChanges:s});return a?{result:"deployed",files:e.map(u=>u.file),proposalId:c}:{result:"submitted",files:e.map(u=>u.file),proposalId:c}};var GT=async({config:{predeploy:t}})=>{await Mn(t)},WT=async({config:{postdeploy:t}})=>{await Mn(t)},HT=async({uploadFile:t,...e})=>{let i=await sh(e);if(i.result==="skipped")return{result:"skipped"};let{files:n,sourceAbsolutePath:r}=i,a=ch({files:n,sourceAbsolutePath:r});return await On({files:a,uploadFile:t,sourceAbsolutePath:r,collection:qn}),console.log(`
27
27
  \u{1F680} Deploy complete!`),{result:"deployed",files:n}},VT=async({deploy:{uploadFile:t,...e},proposal:{clearAssets:i,...n}})=>{let r=await sh(e);if(r.result==="skipped")return{result:"skipped"};let{sourceAbsolutePath:a}=r,o=ch(r),s=await jn({deploy:{uploadFile:t,files:o,sourceAbsolutePath:a,collection:qn},proposal:{...n,proposalType:{AssetsUpgrade:{clear_existing_assets:QS(i)}}}});return s.result==="deployed"&&console.log(`
28
- \u{1F680} Deploy complete!`),s},sh=async({assertMemory:t,...e})=>{let{files:i,sourceAbsolutePath:n}=await Ic(e);return i.length===0?(console.log("\u26A0\uFE0F No file changes detected. Upload skipped."),{result:"skipped"}):(await t?.(),{result:"to-deploy",files:i,sourceAbsolutePath:n})},ch=({files:t,sourceAbsolutePath:e})=>{let i=n=>{let r=n.alternateFile??n.file;return{fullPath:Mi({file:r,sourceAbsolutePath:e}),filePath:r}};return t.map(n=>({file:n,paths:i(n)}))};import{toNullable as Do}from"@dfinity/utils";var KT=async({deploy:{assertMemory:t,filePath:e,fullPath:i,...n},proposal:{version:r,...a}})=>{await t?.();let s=await jn({deploy:{...n,files:[{file:{file:e},paths:{filePath:e,fullPath:i}}],collection:Qo},proposal:{...a,proposalType:{SegmentsDeployment:{satellite_version:Do(r),orbiter:Do(),mission_control_version:Do()}}}});return s.result==="deployed"&&console.log(`
29
- \u{1F4E1} Satellite WASM deployed to CDN.`),s};var t6=({args:t,options:e})=>t?.find(i=>e.includes(i))!==void 0,i6=({args:t,option:e})=>{let i=(t??[]).findIndex(n=>n===e);if(i!==-1)return t?.[i+1]};import{nonNullish as ph}from"@dfinity/utils";import{get as XS}from"https";var KS=async t=>await new Promise((e,i)=>{XS(t,async n=>{ph(n.statusCode)&&ph(n.headers.location)&&[301,302].includes(n.statusCode)&&await KS(n.headers.location).then(e,i);let r=[];n.on("data",a=>r.push(a)),n.on("end",()=>{e(Buffer.concat(r))}),n.on("error",i)})});import{readFile as e3}from"node:fs/promises";var c6=async({packageJsonPath:t})=>{let e=await e3(t,"utf-8"),{dependencies:i,version:n,juno:r,name:a}=JSON.parse(e);return{name:a,version:n,dependencies:i,juno:r}};import{isNullish as t3,nonNullish as i3}from"@dfinity/utils";var l6=(t,e)=>{(t3(t)||t==="")&&(i3(e)&&console.error(e),process.exit(1))};export{Qo as COLLECTION_CDN,qn as COLLECTION_DAPP,Zo as DEPLOY_DEFAULT_ENCODING,yi as DEPLOY_DEFAULT_GZIP,Vo as DEPLOY_DEFAULT_IGNORE,Ho as DEPLOY_DEFAULT_SOURCE,Jo as IGNORE_OS_FILES,Cn as UPLOAD_BATCH_SIZE,l6 as assertAnswerCtrlC,a3 as buildEsm,HT as deploy,KT as deploySatelliteWasmWithProposal,VT as deployWithProposal,KS as downloadFromURL,is as execute,jj as fileExists,qc as fileSizeInBytes,tr as files,rh as formatBytes,yj as gunzipFile,Ix as gzipFile,Tc as gzipFiles,t6 as hasArgs,wj as isGzip,i6 as nextArg,WT as postDeploy,GT as preDeploy,c6 as readPackageJson,x3 as spawn};
28
+ \u{1F680} Deploy complete!`),s},sh=async({assertMemory:t,...e})=>{let{files:i,sourceAbsolutePath:n}=await Ic(e);return i.length===0?(console.log("\u26A0\uFE0F No file changes detected. Upload skipped."),{result:"skipped"}):(await t?.(),{result:"to-deploy",files:i,sourceAbsolutePath:n})},ch=({files:t,sourceAbsolutePath:e})=>{let i=n=>{let r=n.alternateFile??n.file;return{fullPath:Mi({file:r,sourceAbsolutePath:e}),filePath:r}};return t.map(n=>({file:n,paths:i(n)}))};import{toNullable as Do}from"@dfinity/utils";var KT=async({publish:{assertMemory:t,filePath:e,fullPath:i,...n},proposal:{version:r,...a}})=>{await t?.();let s=await jn({deploy:{...n,files:[{file:{file:e},paths:{filePath:e,fullPath:i}}],collection:Qo},proposal:{...a,proposalType:{SegmentsDeployment:{satellite_version:Do(r),orbiter:Do(),mission_control_version:Do()}}}});return s.result==="deployed"&&console.log(`
29
+ \u{1F4E1} Satellite WASM published to CDN.`),s};var t6=({args:t,options:e})=>t?.find(i=>e.includes(i))!==void 0,i6=({args:t,option:e})=>{let i=(t??[]).findIndex(n=>n===e);if(i!==-1)return t?.[i+1]};import{nonNullish as ph}from"@dfinity/utils";import{get as XS}from"https";var KS=async t=>await new Promise((e,i)=>{XS(t,async n=>{ph(n.statusCode)&&ph(n.headers.location)&&[301,302].includes(n.statusCode)&&await KS(n.headers.location).then(e,i);let r=[];n.on("data",a=>r.push(a)),n.on("end",()=>{e(Buffer.concat(r))}),n.on("error",i)})});import{readFile as e3}from"node:fs/promises";var c6=async({packageJsonPath:t})=>{let e=await e3(t,"utf-8"),{dependencies:i,version:n,juno:r,name:a}=JSON.parse(e);return{name:a,version:n,dependencies:i,juno:r}};import{isNullish as t3,nonNullish as i3}from"@dfinity/utils";var l6=(t,e)=>{(t3(t)||t==="")&&(i3(e)&&console.error(e),process.exit(1))};export{Qo as COLLECTION_CDN,qn as COLLECTION_DAPP,Zo as DEPLOY_DEFAULT_ENCODING,yi as DEPLOY_DEFAULT_GZIP,Vo as DEPLOY_DEFAULT_IGNORE,Ho as DEPLOY_DEFAULT_SOURCE,Jo as IGNORE_OS_FILES,Cn as UPLOAD_BATCH_SIZE,l6 as assertAnswerCtrlC,a3 as buildEsm,HT as deploy,VT as deployWithProposal,KS as downloadFromURL,is as execute,jj as fileExists,qc as fileSizeInBytes,tr as files,rh as formatBytes,yj as gunzipFile,Ix as gzipFile,Tc as gzipFiles,t6 as hasArgs,wj as isGzip,i6 as nextArg,WT as postDeploy,GT as preDeploy,KT as publishSatelliteWasmWithProposal,c6 as readPackageJson,x3 as spawn};
30
30
  /*! Bundled license information:
31
31
 
32
32
  ieee754/index.js: