@zuplo/core 6.39.46 → 6.40.0
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/customer.cli.minified.js +1 -1
- package/index.minified.js +1 -1
- package/package.json +4 -4
package/customer.cli.minified.js
CHANGED
|
@@ -672,7 +672,7 @@ export default {
|
|
|
672
672
|
},
|
|
673
673
|
};
|
|
674
674
|
`,XCt=t(async function({systemDirectory:a,logger:s}){return cf.timeFn("Generating Worker shim",async()=>{s.debug("Generating Worker shim");let c=w4r.join(a,que);try{await k4r.writeFile(c,P4r,"utf-8")}catch(f){s.error(f);let d={message:`Error creating file at ${c}`,pluginName:"generate-worker-entry",severity:"error"};return{warnings:[],errors:[d]}}return{warnings:[],errors:[]}})},"generateWorker");import{readFile as N4r,readdir as I4r}from"fs/promises";import ZCt from"path";var Jde="validate-open-api-files",eEt=t(async function({sourceDirectory:a,logger:s}){return cf.timeFn("Building OpenAPI files",async()=>{s.debug("Building OpenAPI files");let c=ZCt.join(a,DS),f=[];try{if(!await sB(a))return new jC({message:"Failed to build project because no open-api file was found on the 'config' folder",pluginName:Jde,severity:"error"});let E=(await I4r(c)).filter(O=>O.endsWith(".oas.json")),A=t(async O=>{let R=ZCt.join(c,O);try{O==="zp.oas.json"&&f.push({message:"Open API files cannot be named 'zp.oas.json' since 'zp' is a reserved prefix. Update the file name to solve this build issue.",pluginName:Jde,severity:"error"});let W=await N4r(R,"utf-8"),$=JSON.parse(W);if($&&$.paths){let K=Object.entries($.paths).filter(Ne=>Ne[0]==="zp"||Ne[0]==="/zp");if(K.length>0){let Ne=K.length===1?"includes one route path":`includes '${K.length}' routes`;f.push({message:`Open API file '${O}' ${Ne} that's named '/zp' which is a reserved route name. Updating the route to something other than '/zp' will solve this build issue.`,pluginName:Jde,severity:"error"})}}}catch(W){s.error(W)}},"validateOpenApiFile");await Promise.all(E.map(A))}catch(d){return s.error(d),f.length>0?{errors:f,warnings:[]}:new jC({message:"Failed while validating the open api files in the project",pluginName:Jde,severity:"warning"})}return{errors:f,warnings:[]}})},"validateOpenAPIFiles");var JU=jp(vRe(),1);import{parse as X4r}from"jsonc-parser";import{readFile as Z4r,writeFile as bEt}from"fs/promises";import e3r from"path";var $U=jp(vRe(),1);var vEt=t(()=>({include:["modules/**/*",".zuplo/**/*","tests/**/*"],exclude:["./node_modules","./dist"],compilerOptions:{module:$U.ModuleKind.ESNext,target:$U.ScriptTarget.ES2022,moduleResolution:$U.ModuleResolutionKind.Bundler,lib:["ESNext","WebWorker","Webworker.Iterable"],preserveConstEnums:!0,useUnknownInCatchVariables:!1,forceConsistentCasingInFileNames:!0,importHelpers:!0,esModuleInterop:!0,strictNullChecks:!0,noEmit:!0}}),"getZuploTsConfigTemplate");var n5="validate-tsconfig",SEt=t(async function({sourceDirectory:a,logger:s,command:c,environmentType:f}){return cf.timeFn("Validate TSConfig",async()=>{s.debug("Validate TSConfig");let d=f==="WORKING_COPY"||c==="dev";try{let v=vEt(),E=e3r.join(a,"tsconfig.json");if(!await du.fileExists(E))return d?(await bEt(E,JSON.stringify(v,null,2)),{warnings:[{message:"This project does not have a tsconfig.json file. The file has been created for you.",severity:"warning",pluginName:n5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}],errors:[]}):{warnings:[],errors:[{message:"This project does not have a tsconfig.json file.",severity:"error",pluginName:n5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}]};let A=await Z4r(E,"utf-8"),O=X4r(A);if(!(O&&typeof O=="object"&&"compilerOptions"in O))return d?(await bEt(E,JSON.stringify(v,null,2)),{warnings:[{message:"This project's tsconfig.json file was invalid. A valid file has been written for you.",severity:"warning",pluginName:n5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}],errors:[]}):{warnings:[],errors:[{message:"This project's tsconfig.json file is invalid. It must have a compilerOptions.",severity:"error",pluginName:n5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}]};let R=JU.default.convertCompilerOptionsFromJson(O.compilerOptions,a);if(R.errors.length>0)return{warnings:[],errors:R.errors.map(yr=>({severity:"error",pluginName:n5,message:yr.messageText.toString(),detail:"You will need to modify your tsconfig.json file to build this project.",helpUrl:"https://zuplo.com/docs/articles/tsconfig",location:yr.file?{line:yr.file.getLineStarts()[0],length:yr.file.getWidth(),file:yr.file.fileName,column:yr.file.getStart(),lineText:"",namespace:"",suggestion:""}:void 0}))};if(!O||typeof O!="object")throw new TypeError("The userConfigRaw is not an object, this should not happen.");if(!("compilerOptions"in O)||O.compilerOptions===null||O.compilerOptions===void 0||typeof O.compilerOptions!="object")throw new TypeError("The userConfigRaw.compilerOptions property is not an object, this should not happen.");let W=t((yr,_r,sr)=>`The compiler option '${yr}' should ${_r===void 0?"not be set":`be set to '${typeof _r=="string"?_r:JSON.stringify(_r)}'`}, it was ${sr===void 0?"not set":`set to '${typeof sr=="string"?sr:JSON.stringify(sr)}'`}`,"getMessage"),$="ESNext",K=JU.ModuleKind.ESNext,Ne=[];R.options.module!==K&&Ne.push(W("module",$,O.compilerOptions.module));let De="ES2022",Se=JU.default.ScriptTarget.ES2022;R.options.target!==Se&&Ne.push(W("target",De,O.compilerOptions.target));let Ct="Bundler",Tt=JU.default.ModuleResolutionKind.Bundler;R.options.moduleResolution!==Tt&&Ne.push(W("moduleResolution",Ct,O.compilerOptions.moduleResolution));let br=["ESNext","WebWorker","Webworker.Iterable"];t(yr=>{let _r=br.map(Ts=>Ts.toLowerCase()),sr=yr.map(Ts=>Ts.toLowerCase());return _r.every(Ts=>sr.includes(Ts))},"includesAllLibs")(O.compilerOptions.lib??[])||Ne.push(W("lib",br,O.compilerOptions.lib)),R.options.baseUrl&&Ne.push(W("baseUrl",void 0,O.compilerOptions.baseUrl));let Lr=[];return Ne.length>0&&Lr.push({message:"This project's tsconfig.json was not set to the recommended settings. Custom settings may cause build issues. For guidance on how to adjust your settings, please visit: https://zuplo.com/docs/articles/tsconfig",severity:"warning",detail:Ne.join(`
|
|
675
|
-
`),pluginName:n5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}),{warnings:Lr,errors:[]}}catch(v){s.error(v);let E={message:`Error validating tsconfig.json : ${v.message}`,severity:"error",pluginName:n5};return{warnings:[],errors:[E]}}})},"validateTSConfig");var zU;try{let a=t3r(XY.resolve(r3r(n3r(import.meta.url)),"../../package.json"),"utf-8");zU=JSON.parse(a).version}catch{zU="0.0.0"}function i3r(a){let{ZUPLO:s,ZUPLO_BUILD_ID:c,ZUPLO_BUILD_CONFIG:f}=process.env;if(s&&c&&f){let d;try{d=JSON.parse(f)}catch{throw new Error("Couuld not parse ZUPLO_BUILD_CONFIG")}return{...a,buildId:c,...d}}return a}t(i3r,"getBuildConfig");async function bRe(a){let s=performance.now(),{buildId:c,sourceDirectory:f,deploymentName:d=XY.basename(f),command:v,minify:E,entitlements:A,environmentType:O,logger:R,output:W,noCompile:$=!1,projectId:K,deploymentUrl:Ne,publicZuploEnvironmentVariables:De
|
|
675
|
+
`),pluginName:n5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}),{warnings:Lr,errors:[]}}catch(v){s.error(v);let E={message:`Error validating tsconfig.json : ${v.message}`,severity:"error",pluginName:n5};return{warnings:[],errors:[E]}}})},"validateTSConfig");var zU;try{let a=t3r(XY.resolve(r3r(n3r(import.meta.url)),"../../package.json"),"utf-8");zU=JSON.parse(a).version}catch{zU="0.0.0"}function i3r(a){let{ZUPLO:s,ZUPLO_BUILD_ID:c,ZUPLO_BUILD_CONFIG:f}=process.env;if(s&&c&&f){let d;try{d=JSON.parse(f)}catch{throw new Error("Couuld not parse ZUPLO_BUILD_CONFIG")}let v={ZUPLO_PROJECT_ID:d.projectId,ZUPLO_ACCOUNT_NAME:d.accountName,ZUPLO_PROJECT_NAME:d.projectName,ZUPLO_ENVIRONMENT_TYPE:d.environmentType};for(let[E,A]of Object.entries(process.env))E.startsWith("ZUPLO_PUBLIC_")&&(v[E]=A??"");return{...a,buildId:c,...d,publicZuploEnvironmentVariables:v}}return a}t(i3r,"getBuildConfig");async function bRe(a){let s=performance.now(),{buildId:c,sourceDirectory:f,deploymentName:d=XY.basename(f),command:v,minify:E,entitlements:A,environmentType:O,logger:R,output:W,noCompile:$=!1,projectId:K,deploymentUrl:Ne,publicZuploEnvironmentVariables:De}=i3r(a),Se=await $de(f),Ct=XY.join(f,Gj),Tt;if("errors"in Se)iRe({output:W.child("api"),buildId:c,runtimeVersion:zU}),Tt={status:"Failed",flags:void 0,compatibilityDate:void 0,runtimeVersion:zU,outputPath:Ct,buildTime:new Date().toISOString(),buildTimeMs:0,buildId:c,warnings:[],errors:Se.errors,metafile:void 0};else{$||iRe({output:W.child("api"),buildId:c,runtimeVersion:zU,compatibilityDate:Se.config.compatibilityDate});let Lr={command:v,minify:E,deploymentName:d,sourceDirectory:f,outputDirectory:Ct,systemDirectory:XY.join(f,gN),cacheDirectory:XY.join(f,"node_modules",gN),buildId:c,logger:R,output:W,config:Se.config,publicZuploEnvironmentVariables:De,projectId:K,entitlements:A,environmentType:O,deploymentUrl:Ne},yr=[];yr.push(WCt),yr.push(GCt),yr.push(QCt),yr.push(YCt),yr.push(SEt),yr.push(eEt),yr.push(XCt),$||yr.push(MCt),yr.push(VCt);let _r=await JCt(yr,Lr),sr=_r.errors.length>0?zF:_r.warnings.length>0?z3e:JF,Ts=_r.data.get("metafile");Tt={status:sr,compatibilityDate:Se.config.compatibilityDate,runtimeVersion:zU,outputPath:Ct,buildTime:new Date().toISOString(),buildTimeMs:0,metafile:Ts,buildId:c,warnings:_r.warnings,errors:_r.errors,flags:Se.config.flags}}Tt.warnings.length>0&&Tt.warnings.forEach(Lr=>{R.warn(Lr)}),Tt.errors.length>0&&Tt.errors.forEach(Lr=>{R.error(Lr)});let{metafile:br,...Cr}=Tt;if(R.debug(Cr,"Compiler completed"),Tt.buildTimeMs=performance.now()-s,$||await Ude(f,W.child("api"),Tt),process.env.ZUPLO_SHOW_PERF){console.log();let Lr=Tt.buildTimeMs<2e3?"green":Tt.buildTimeMs<5e3?"yellow":"red";console.log(__[Lr](`Build time: ${Tt.buildTimeMs.toFixed(0)}ms`)),cf.report()}return cf.clear(),Tt}t(bRe,"build");var Swt=jp(NMe(),1);import{existsSync as R7r}from"fs";import{mkdir as M7r,readFile as j7r}from"fs/promises";import mX from"path";import tFr from"chokidar";import*as $At from"esbuild";import{randomUUID as UAt}from"crypto";import rFr from"events";import T$ from"path";var IMe=class extends rFr{static{t(this,"WatchEmitter")}},C$=class{static{t(this,"BuildWatcher")}esbuildContext;emitter=new IMe;envFilesWatcher;outputDirectory;sourceDirectory;command;logger;publicZuploEnvironmentVariables;projectName;buildId;output;constructor({sourceDirectory:s,command:c,logger:f,publicZuploEnvironmentVariables:d={},buildId:v,output:E}){this.sourceDirectory=s,this.command=c,this.outputDirectory=T$.join(s,Gj),this.logger=f,this.publicZuploEnvironmentVariables=d,this.projectName=T$.basename(s),this.buildId=v,this.output=E,this.envFilesWatcher=tFr.watch([T$.join(s,".env"),T$.join(s,".env.zuplo")])}watchEnvFiles(){this.envFilesWatcher.on("change",()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("add",()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("unlink",()=>{this.emitter.emit("reload",null,null)})}onReload=t(s=>{this.emitter.on("reload",s)},"onReload");async start(){let{sourceDirectory:s}=this;if(this.esbuildContext!==void 0)throw new Error("Watcher cannot be started more than once");let c=await bRe({buildId:this.buildId,output:this.output,sourceDirectory:s,noCompile:!0,command:this.command,publicZuploEnvironmentVariables:this.publicZuploEnvironmentVariables,logger:this.logger,deploymentUrl:void 0}),f=await GY({command:this.command,systemDirectory:T$.join(s,gN),cacheDirectory:T$.join(s,"node_modules",gN),outputDirectory:this.outputDirectory,sourceDirectory:s,logger:this.logger,flags:c.flags}),d=this;f.plugins?.push({name:"on-end",setup(v){v.onEnd(E=>{d.logger.debug("Watcher (build) reloaded");let A=rRe({buildId:UAt(),result:E});A.errors.length>0?d.logger.error(A.errors,"Build errors"):d.logger.debug(`Successfully rebuilt watched project. Build id ${A.buildId}`);let O={...A,compatibilityDate:c.compatibilityDate,flags:c.flags};d.emitter.emit("reload",O,null)})}}),this.esbuildContext=await $At.context(f);try{if((await this.esbuildContext.rebuild()).errors.length>0){let E={status:"Failed",runtimeVersion:"0.0.0",buildTime:"",buildTimeMs:0,buildId:UAt(),warnings:[],errors:[],metafile:void 0};await Ude(s,d.output.child("api"),E),this.logger.error(E.errors,"Build errors")}}catch(v){throw await this.close(),v}await this.esbuildContext.watch()}async close(){try{await this.envFilesWatcher.close(),this.esbuildContext&&(await this.esbuildContext.dispose(),this.logger.debug("ESBuild watcher closed"))}catch(s){this.logger.error(s)}}};var ije=jp(WAt(),1);var gwt=jp(Fkt(),1);import{Buffer as P7r}from"buffer";import N7r from"path";import hwt from"child_process";import whe from"process";function VMe(a){let s=typeof a=="string"?`
|
|
676
676
|
`:10,c=typeof a=="string"?"\r":13;return a[a.length-1]===s&&(a=a.slice(0,-1)),a[a.length-1]===c&&(a=a.slice(0,-1)),a}t(VMe,"stripFinalNewline");import She from"process";import _X from"path";import{fileURLToPath as Lkt}from"url";function bhe(a={}){let{env:s=process.env,platform:c=process.platform}=a;return c!=="win32"?"PATH":Object.keys(s).reverse().find(f=>f.toUpperCase()==="PATH")||"Path"}t(bhe,"pathKey");var qFr=t(({cwd:a=She.cwd(),path:s=She.env[bhe()],preferLocal:c=!0,execPath:f=She.execPath,addExecPath:d=!0}={})=>{let v=a instanceof URL?Lkt(a):a,E=_X.resolve(v),A=[];return c&&VFr(A,E),d&&WFr(A,f,E),[...A,s].join(_X.delimiter)},"npmRunPath"),VFr=t((a,s)=>{let c;for(;c!==s;)a.push(_X.join(s,"node_modules/.bin")),c=s,s=_X.resolve(s,"..")},"applyPreferLocal"),WFr=t((a,s,c)=>{let f=s instanceof URL?Lkt(s):s;a.push(_X.resolve(c,f,".."))},"applyExecPath"),Rkt=t(({env:a=She.env,...s}={})=>{a={...a};let c=bhe({env:a});return s.path=a[c],a[c]=qFr(s),a},"npmRunPathEnv");var HFr=t((a,s,c,f)=>{if(c==="length"||c==="prototype"||c==="arguments"||c==="caller")return;let d=Object.getOwnPropertyDescriptor(a,c),v=Object.getOwnPropertyDescriptor(s,c);!GFr(d,v)&&f||Object.defineProperty(a,c,v)},"copyProperty"),GFr=t(function(a,s){return a===void 0||a.configurable||a.writable===s.writable&&a.enumerable===s.enumerable&&a.configurable===s.configurable&&(a.writable||a.value===s.value)},"canCopyProperty"),QFr=t((a,s)=>{let c=Object.getPrototypeOf(s);c!==Object.getPrototypeOf(a)&&Object.setPrototypeOf(a,c)},"changePrototype"),KFr=t((a,s)=>`/* Wrapped ${a}*/
|
|
677
677
|
${s}`,"wrappedToString"),YFr=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),XFr=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),ZFr=t((a,s,c)=>{let f=c===""?"":`with ${c.trim()}() `,d=KFr.bind(null,f,s.toString());Object.defineProperty(d,"name",XFr),Object.defineProperty(a,"toString",{...YFr,value:d})},"changeToString");function WMe(a,s,{ignoreNonConfigurable:c=!1}={}){let{name:f}=a;for(let d of Reflect.ownKeys(s))HFr(a,s,d,c);return QFr(a,s),ZFr(a,s,f),a}t(WMe,"mimicFunction");var The=new WeakMap,Mkt=t((a,s={})=>{if(typeof a!="function")throw new TypeError("Expected a function");let c,f=0,d=a.displayName||a.name||"<anonymous>",v=t(function(...E){if(The.set(v,++f),f===1)c=a.apply(this,E),a=null;else if(s.throw===!0)throw new Error(`Function \`${d}\` can only be called once`);return c},"onetime");return WMe(v,a),The.set(v,f),v},"onetime");Mkt.callCount=a=>{if(!The.has(a))throw new Error(`The given function \`${a.name}\` is not wrapped by the \`onetime\` package`);return The.get(a)};var jkt=Mkt;import{constants as n7r}from"os";var Bkt=t(function(){let a=HMe-Ukt+1;return Array.from({length:a},e7r)},"getRealtimeSignals"),e7r=t(function(a,s){return{name:`SIGRT${s+1}`,number:Ukt+s,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},"getRealtimeSignal"),Ukt=34,HMe=64;import{constants as t7r}from"os";var $kt=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var GMe=t(function(){let a=Bkt();return[...$kt,...a].map(r7r)},"getSignals"),r7r=t(function({name:a,number:s,description:c,action:f,forced:d=!1,standard:v}){let{signals:{[a]:E}}=t7r,A=E!==void 0;return{name:a,number:A?E:s,description:c,supported:A,action:f,forced:d,standard:v}},"normalizeSignal");var i7r=t(function(){return GMe().reduce(s7r,{})},"getSignalsByName"),s7r=t(function(a,{name:s,number:c,description:f,supported:d,action:v,forced:E,standard:A}){return{...a,[s]:{name:s,number:c,description:f,supported:d,action:v,forced:E,standard:A}}},"getSignalByName"),Jkt=i7r(),a7r=t(function(){let a=GMe(),s=HMe+1,c=Array.from({length:s},(f,d)=>o7r(d,a));return Object.assign({},...c)},"getSignalsByNumber"),o7r=t(function(a,s){let c=c7r(a,s);if(c===void 0)return{};let{name:f,description:d,supported:v,action:E,forced:A,standard:O}=c;return{[a]:{name:f,number:a,description:d,supported:v,action:E,forced:A,standard:O}}},"getSignalByNumber"),c7r=t(function(a,s){let c=s.find(({name:f})=>n7r.signals[f]===a);return c!==void 0?c:s.find(f=>f.number===a)},"findSignalByNumber"),Pin=a7r();var l7r=t(({timedOut:a,timeout:s,errorCode:c,signal:f,signalDescription:d,exitCode:v,isCanceled:E})=>a?`timed out after ${s} milliseconds`:E?"was canceled":c!==void 0?`failed with ${c}`:f!==void 0?`was killed with ${f} (${d})`:v!==void 0?`failed with exit code ${v}`:"failed","getErrorPrefix"),QMe=t(({stdout:a,stderr:s,all:c,error:f,signal:d,exitCode:v,command:E,escapedCommand:A,timedOut:O,isCanceled:R,killed:W,parsed:{options:{timeout:$}}})=>{v=v===null?void 0:v,d=d===null?void 0:d;let K=d===void 0?void 0:Jkt[d].description,Ne=f&&f.code,Se=`Command ${l7r({timedOut:O,timeout:$,errorCode:Ne,signal:d,signalDescription:K,exitCode:v,isCanceled:R})}: ${E}`,Ct=Object.prototype.toString.call(f)==="[object Error]",Tt=Ct?`${Se}
|
|
678
678
|
${f.message}`:Se,br=[Tt,s,a].filter(Boolean).join(`
|
package/index.minified.js
CHANGED
|
@@ -677,7 +677,7 @@ export default {
|
|
|
677
677
|
},
|
|
678
678
|
};
|
|
679
679
|
`,nEt=t(async function({systemDirectory:a,logger:s}){return cf.timeFn("Generating Worker shim",async()=>{s.debug("Generating Worker shim");let c=e3r.join(a,Vue);try{await Z4r.writeFile(c,t3r,"utf-8")}catch(f){s.error(f);let d={message:`Error creating file at ${c}`,pluginName:"generate-worker-entry",severity:"error"};return{warnings:[],errors:[d]}}return{warnings:[],errors:[]}})},"generateWorker");import{readFile as r3r,readdir as n3r}from"fs/promises";import iEt from"path";var zde="validate-open-api-files",sEt=t(async function({sourceDirectory:a,logger:s}){return cf.timeFn("Building OpenAPI files",async()=>{s.debug("Building OpenAPI files");let c=iEt.join(a,zb),f=[];try{if(!await aB(a))return new BC({message:"Failed to build project because no open-api file was found on the 'config' folder",pluginName:zde,severity:"error"});let E=(await n3r(c)).filter(O=>O.endsWith(".oas.json")),A=t(async O=>{let L=iEt.join(c,O);try{O==="zp.oas.json"&&f.push({message:"Open API files cannot be named 'zp.oas.json' since 'zp' is a reserved prefix. Update the file name to solve this build issue.",pluginName:zde,severity:"error"});let W=await r3r(L,"utf-8"),$=JSON.parse(W);if($&&$.paths){let K=Object.entries($.paths).filter(Ne=>Ne[0]==="zp"||Ne[0]==="/zp");if(K.length>0){let Ne=K.length===1?"includes one route path":`includes '${K.length}' routes`;f.push({message:`Open API file '${O}' ${Ne} that's named '/zp' which is a reserved route name. Updating the route to something other than '/zp' will solve this build issue.`,pluginName:zde,severity:"error"})}}}catch(W){s.error(W)}},"validateOpenApiFile");await Promise.all(E.map(A))}catch(d){return s.error(d),f.length>0?{errors:f,warnings:[]}:new BC({message:"Failed while validating the open api files in the project",pluginName:zde,severity:"warning"})}return{errors:f,warnings:[]}})},"validateOpenAPIFiles");var zU=H_(DRe(),1);import{parse as C3r}from"jsonc-parser";import{readFile as E3r,writeFile as xEt}from"fs/promises";import x3r from"path";var JU=H_(DRe(),1);var EEt=t(()=>({include:["modules/**/*",".zuplo/**/*","tests/**/*"],exclude:["./node_modules","./dist"],compilerOptions:{module:JU.ModuleKind.ESNext,target:JU.ScriptTarget.ES2022,moduleResolution:JU.ModuleResolutionKind.Bundler,lib:["ESNext","WebWorker","Webworker.Iterable"],preserveConstEnums:!0,useUnknownInCatchVariables:!1,forceConsistentCasingInFileNames:!0,importHelpers:!0,esModuleInterop:!0,strictNullChecks:!0,noEmit:!0}}),"getZuploTsConfigTemplate");var i5="validate-tsconfig",DEt=t(async function({sourceDirectory:a,logger:s,command:c,environmentType:f}){return cf.timeFn("Validate TSConfig",async()=>{s.debug("Validate TSConfig");let d=f==="WORKING_COPY"||c==="dev";try{let v=EEt(),E=x3r.join(a,"tsconfig.json");if(!await du.fileExists(E))return d?(await xEt(E,JSON.stringify(v,null,2)),{warnings:[{message:"This project does not have a tsconfig.json file. The file has been created for you.",severity:"warning",pluginName:i5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}],errors:[]}):{warnings:[],errors:[{message:"This project does not have a tsconfig.json file.",severity:"error",pluginName:i5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}]};let A=await E3r(E,"utf-8"),O=C3r(A);if(!(O&&typeof O=="object"&&"compilerOptions"in O))return d?(await xEt(E,JSON.stringify(v,null,2)),{warnings:[{message:"This project's tsconfig.json file was invalid. A valid file has been written for you.",severity:"warning",pluginName:i5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}],errors:[]}):{warnings:[],errors:[{message:"This project's tsconfig.json file is invalid. It must have a compilerOptions.",severity:"error",pluginName:i5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}]};let L=zU.default.convertCompilerOptionsFromJson(O.compilerOptions,a);if(L.errors.length>0)return{warnings:[],errors:L.errors.map(yr=>({severity:"error",pluginName:i5,message:yr.messageText.toString(),detail:"You will need to modify your tsconfig.json file to build this project.",helpUrl:"https://zuplo.com/docs/articles/tsconfig",location:yr.file?{line:yr.file.getLineStarts()[0],length:yr.file.getWidth(),file:yr.file.fileName,column:yr.file.getStart(),lineText:"",namespace:"",suggestion:""}:void 0}))};if(!O||typeof O!="object")throw new TypeError("The userConfigRaw is not an object, this should not happen.");if(!("compilerOptions"in O)||O.compilerOptions===null||O.compilerOptions===void 0||typeof O.compilerOptions!="object")throw new TypeError("The userConfigRaw.compilerOptions property is not an object, this should not happen.");let W=t((yr,_r,sr)=>`The compiler option '${yr}' should ${_r===void 0?"not be set":`be set to '${typeof _r=="string"?_r:JSON.stringify(_r)}'`}, it was ${sr===void 0?"not set":`set to '${typeof sr=="string"?sr:JSON.stringify(sr)}'`}`,"getMessage"),$="ESNext",K=zU.ModuleKind.ESNext,Ne=[];L.options.module!==K&&Ne.push(W("module",$,O.compilerOptions.module));let De="ES2022",Se=zU.default.ScriptTarget.ES2022;L.options.target!==Se&&Ne.push(W("target",De,O.compilerOptions.target));let Ct="Bundler",Tt=zU.default.ModuleResolutionKind.Bundler;L.options.moduleResolution!==Tt&&Ne.push(W("moduleResolution",Ct,O.compilerOptions.moduleResolution));let br=["ESNext","WebWorker","Webworker.Iterable"];t(yr=>{let _r=br.map(Ts=>Ts.toLowerCase()),sr=yr.map(Ts=>Ts.toLowerCase());return _r.every(Ts=>sr.includes(Ts))},"includesAllLibs")(O.compilerOptions.lib??[])||Ne.push(W("lib",br,O.compilerOptions.lib)),L.options.baseUrl&&Ne.push(W("baseUrl",void 0,O.compilerOptions.baseUrl));let Lr=[];return Ne.length>0&&Lr.push({message:"This project's tsconfig.json was not set to the recommended settings. Custom settings may cause build issues. For guidance on how to adjust your settings, please visit: https://zuplo.com/docs/articles/tsconfig",severity:"warning",detail:Ne.join(`
|
|
680
|
-
`),pluginName:i5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}),{warnings:Lr,errors:[]}}catch(v){s.error(v);let E={message:`Error validating tsconfig.json : ${v.message}`,severity:"error",pluginName:i5};return{warnings:[],errors:[E]}}})},"validateTSConfig");var qU;try{let a=D3r(XY.resolve(A3r(k3r(import.meta.url)),"../../package.json"),"utf-8");qU=JSON.parse(a).version}catch{qU="0.0.0"}function w3r(a){let{ZUPLO:s,ZUPLO_BUILD_ID:c,ZUPLO_BUILD_CONFIG:f}=process.env;if(s&&c&&f){let d;try{d=JSON.parse(f)}catch{throw new Error("Couuld not parse ZUPLO_BUILD_CONFIG")}return{...a,buildId:c,...d}}return a}t(w3r,"getBuildConfig");async function ARe(a){let s=performance.now(),{buildId:c,sourceDirectory:f,deploymentName:d=XY.basename(f),command:v,minify:E,entitlements:A,environmentType:O,logger:L,output:W,noCompile:$=!1,projectId:K,deploymentUrl:Ne,publicZuploEnvironmentVariables:De
|
|
680
|
+
`),pluginName:i5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}),{warnings:Lr,errors:[]}}catch(v){s.error(v);let E={message:`Error validating tsconfig.json : ${v.message}`,severity:"error",pluginName:i5};return{warnings:[],errors:[E]}}})},"validateTSConfig");var qU;try{let a=D3r(XY.resolve(A3r(k3r(import.meta.url)),"../../package.json"),"utf-8");qU=JSON.parse(a).version}catch{qU="0.0.0"}function w3r(a){let{ZUPLO:s,ZUPLO_BUILD_ID:c,ZUPLO_BUILD_CONFIG:f}=process.env;if(s&&c&&f){let d;try{d=JSON.parse(f)}catch{throw new Error("Couuld not parse ZUPLO_BUILD_CONFIG")}let v={ZUPLO_PROJECT_ID:d.projectId,ZUPLO_ACCOUNT_NAME:d.accountName,ZUPLO_PROJECT_NAME:d.projectName,ZUPLO_ENVIRONMENT_TYPE:d.environmentType};for(let[E,A]of Object.entries(process.env))E.startsWith("ZUPLO_PUBLIC_")&&(v[E]=A??"");return{...a,buildId:c,...d,publicZuploEnvironmentVariables:v}}return a}t(w3r,"getBuildConfig");async function ARe(a){let s=performance.now(),{buildId:c,sourceDirectory:f,deploymentName:d=XY.basename(f),command:v,minify:E,entitlements:A,environmentType:O,logger:L,output:W,noCompile:$=!1,projectId:K,deploymentUrl:Ne,publicZuploEnvironmentVariables:De}=w3r(a),Se=await Jde(f),Ct=XY.join(f,VF),Tt;if("errors"in Se)fRe({output:W.child("api"),buildId:c,runtimeVersion:qU}),Tt={status:"Failed",flags:void 0,compatibilityDate:void 0,runtimeVersion:qU,outputPath:Ct,buildTime:new Date().toISOString(),buildTimeMs:0,buildId:c,warnings:[],errors:Se.errors,metafile:void 0};else{$||fRe({output:W.child("api"),buildId:c,runtimeVersion:qU,compatibilityDate:Se.config.compatibilityDate});let Lr={command:v,minify:E,deploymentName:d,sourceDirectory:f,outputDirectory:Ct,systemDirectory:XY.join(f,vN),cacheDirectory:XY.join(f,"node_modules",vN),buildId:c,logger:L,output:W,config:Se.config,publicZuploEnvironmentVariables:De,projectId:K,entitlements:A,environmentType:O,deploymentUrl:Ne},yr=[];yr.push(YCt),yr.push(ZCt),yr.push(eEt),yr.push(rEt),yr.push(DEt),yr.push(sEt),yr.push(nEt),$||yr.push(JCt),yr.push(KCt);let _r=await HCt(yr,Lr),sr=_r.errors.length>0?qF:_r.warnings.length>0?H3e:zF,Ts=_r.data.get("metafile");Tt={status:sr,compatibilityDate:Se.config.compatibilityDate,runtimeVersion:qU,outputPath:Ct,buildTime:new Date().toISOString(),buildTimeMs:0,metafile:Ts,buildId:c,warnings:_r.warnings,errors:_r.errors,flags:Se.config.flags}}Tt.warnings.length>0&&Tt.warnings.forEach(Lr=>{L.warn(Lr)}),Tt.errors.length>0&&Tt.errors.forEach(Lr=>{L.error(Lr)});let{metafile:br,...Cr}=Tt;if(L.debug(Cr,"Compiler completed"),Tt.buildTimeMs=performance.now()-s,$||await $de(f,W.child("api"),Tt),process.env.ZUPLO_SHOW_PERF){console.log();let Lr=Tt.buildTimeMs<2e3?"green":Tt.buildTimeMs<5e3?"yellow":"red";console.log(__[Lr](`Build time: ${Tt.buildTimeMs.toFixed(0)}ms`)),cf.report()}return cf.clear(),Tt}t(ARe,"build");import P3r from"chokidar";import*as kEt from"esbuild";import{randomUUID as AEt}from"crypto";import N3r from"events";import VU from"path";var kRe=class extends N3r{static{t(this,"WatchEmitter")}},s5=class{static{t(this,"BuildWatcher")}esbuildContext;emitter=new kRe;envFilesWatcher;outputDirectory;sourceDirectory;command;logger;publicZuploEnvironmentVariables;projectName;buildId;output;constructor({sourceDirectory:s,command:c,logger:f,publicZuploEnvironmentVariables:d={},buildId:v,output:E}){this.sourceDirectory=s,this.command=c,this.outputDirectory=VU.join(s,VF),this.logger=f,this.publicZuploEnvironmentVariables=d,this.projectName=VU.basename(s),this.buildId=v,this.output=E,this.envFilesWatcher=P3r.watch([VU.join(s,".env"),VU.join(s,".env.zuplo")])}watchEnvFiles(){this.envFilesWatcher.on("change",()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("add",()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("unlink",()=>{this.emitter.emit("reload",null,null)})}onReload=t(s=>{this.emitter.on("reload",s)},"onReload");async start(){let{sourceDirectory:s}=this;if(this.esbuildContext!==void 0)throw new Error("Watcher cannot be started more than once");let c=await ARe({buildId:this.buildId,output:this.output,sourceDirectory:s,noCompile:!0,command:this.command,publicZuploEnvironmentVariables:this.publicZuploEnvironmentVariables,logger:this.logger,deploymentUrl:void 0}),f=await GY({command:this.command,systemDirectory:VU.join(s,vN),cacheDirectory:VU.join(s,"node_modules",vN),outputDirectory:this.outputDirectory,sourceDirectory:s,logger:this.logger,flags:c.flags}),d=this;f.plugins?.push({name:"on-end",setup(v){v.onEnd(E=>{d.logger.debug("Watcher (build) reloaded");let A=lRe({buildId:AEt(),result:E});A.errors.length>0?d.logger.error(A.errors,"Build errors"):d.logger.debug(`Successfully rebuilt watched project. Build id ${A.buildId}`);let O={...A,compatibilityDate:c.compatibilityDate,flags:c.flags};d.emitter.emit("reload",O,null)})}}),this.esbuildContext=await kEt.context(f);try{if((await this.esbuildContext.rebuild()).errors.length>0){let E={status:"Failed",runtimeVersion:"0.0.0",buildTime:"",buildTimeMs:0,buildId:AEt(),warnings:[],errors:[],metafile:void 0};await $de(s,d.output.child("api"),E),this.logger.error(E.errors,"Build errors")}}catch(v){throw await this.close(),v}await this.esbuildContext.watch()}async close(){try{await this.envFilesWatcher.close(),this.esbuildContext&&(await this.esbuildContext.dispose(),this.logger.debug("ESBuild watcher closed"))}catch(s){this.logger.error(s)}}};var Swt=H_(BMe(),1);import{existsSync as W7r}from"fs";import{mkdir as H7r,readFile as G7r}from"fs/promises";import mX from"path";var cje=H_(W3e(),1);var gwt=H_(Fkt(),1);import{Buffer as U7r}from"buffer";import $7r from"path";import hwt from"child_process";import whe from"process";function QMe(a){let s=typeof a=="string"?`
|
|
681
681
|
`:10,c=typeof a=="string"?"\r":13;return a[a.length-1]===s&&(a=a.slice(0,-1)),a[a.length-1]===c&&(a=a.slice(0,-1)),a}t(QMe,"stripFinalNewline");import She from"process";import _X from"path";import{fileURLToPath as Lkt}from"url";function bhe(a={}){let{env:s=process.env,platform:c=process.platform}=a;return c!=="win32"?"PATH":Object.keys(s).reverse().find(f=>f.toUpperCase()==="PATH")||"Path"}t(bhe,"pathKey");var e7r=t(({cwd:a=She.cwd(),path:s=She.env[bhe()],preferLocal:c=!0,execPath:f=She.execPath,addExecPath:d=!0}={})=>{let v=a instanceof URL?Lkt(a):a,E=_X.resolve(v),A=[];return c&&t7r(A,E),d&&r7r(A,f,E),[...A,s].join(_X.delimiter)},"npmRunPath"),t7r=t((a,s)=>{let c;for(;c!==s;)a.push(_X.join(s,"node_modules/.bin")),c=s,s=_X.resolve(s,"..")},"applyPreferLocal"),r7r=t((a,s,c)=>{let f=s instanceof URL?Lkt(s):s;a.push(_X.resolve(c,f,".."))},"applyExecPath"),Rkt=t(({env:a=She.env,...s}={})=>{a={...a};let c=bhe({env:a});return s.path=a[c],a[c]=e7r(s),a},"npmRunPathEnv");var n7r=t((a,s,c,f)=>{if(c==="length"||c==="prototype"||c==="arguments"||c==="caller")return;let d=Object.getOwnPropertyDescriptor(a,c),v=Object.getOwnPropertyDescriptor(s,c);!i7r(d,v)&&f||Object.defineProperty(a,c,v)},"copyProperty"),i7r=t(function(a,s){return a===void 0||a.configurable||a.writable===s.writable&&a.enumerable===s.enumerable&&a.configurable===s.configurable&&(a.writable||a.value===s.value)},"canCopyProperty"),s7r=t((a,s)=>{let c=Object.getPrototypeOf(s);c!==Object.getPrototypeOf(a)&&Object.setPrototypeOf(a,c)},"changePrototype"),a7r=t((a,s)=>`/* Wrapped ${a}*/
|
|
682
682
|
${s}`,"wrappedToString"),o7r=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),c7r=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),l7r=t((a,s,c)=>{let f=c===""?"":`with ${c.trim()}() `,d=a7r.bind(null,f,s.toString());Object.defineProperty(d,"name",c7r),Object.defineProperty(a,"toString",{...o7r,value:d})},"changeToString");function KMe(a,s,{ignoreNonConfigurable:c=!1}={}){let{name:f}=a;for(let d of Reflect.ownKeys(s))n7r(a,s,d,c);return s7r(a,s),l7r(a,s,f),a}t(KMe,"mimicFunction");var The=new WeakMap,Mkt=t((a,s={})=>{if(typeof a!="function")throw new TypeError("Expected a function");let c,f=0,d=a.displayName||a.name||"<anonymous>",v=t(function(...E){if(The.set(v,++f),f===1)c=a.apply(this,E),a=null;else if(s.throw===!0)throw new Error(`Function \`${d}\` can only be called once`);return c},"onetime");return KMe(v,a),The.set(v,f),v},"onetime");Mkt.callCount=a=>{if(!The.has(a))throw new Error(`The given function \`${a.name}\` is not wrapped by the \`onetime\` package`);return The.get(a)};var jkt=Mkt;import{constants as p7r}from"os";var Bkt=t(function(){let a=YMe-Ukt+1;return Array.from({length:a},u7r)},"getRealtimeSignals"),u7r=t(function(a,s){return{name:`SIGRT${s+1}`,number:Ukt+s,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},"getRealtimeSignal"),Ukt=34,YMe=64;import{constants as f7r}from"os";var $kt=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var XMe=t(function(){let a=Bkt();return[...$kt,...a].map(_7r)},"getSignals"),_7r=t(function({name:a,number:s,description:c,action:f,forced:d=!1,standard:v}){let{signals:{[a]:E}}=f7r,A=E!==void 0;return{name:a,number:A?E:s,description:c,supported:A,action:f,forced:d,standard:v}},"normalizeSignal");var d7r=t(function(){return XMe().reduce(m7r,{})},"getSignalsByName"),m7r=t(function(a,{name:s,number:c,description:f,supported:d,action:v,forced:E,standard:A}){return{...a,[s]:{name:s,number:c,description:f,supported:d,action:v,forced:E,standard:A}}},"getSignalByName"),Jkt=d7r(),h7r=t(function(){let a=XMe(),s=YMe+1,c=Array.from({length:s},(f,d)=>g7r(d,a));return Object.assign({},...c)},"getSignalsByNumber"),g7r=t(function(a,s){let c=y7r(a,s);if(c===void 0)return{};let{name:f,description:d,supported:v,action:E,forced:A,standard:O}=c;return{[a]:{name:f,number:a,description:d,supported:v,action:E,forced:A,standard:O}}},"getSignalByNumber"),y7r=t(function(a,s){let c=s.find(({name:f})=>p7r.signals[f]===a);return c!==void 0?c:s.find(f=>f.number===a)},"findSignalByNumber"),rsn=h7r();var v7r=t(({timedOut:a,timeout:s,errorCode:c,signal:f,signalDescription:d,exitCode:v,isCanceled:E})=>a?`timed out after ${s} milliseconds`:E?"was canceled":c!==void 0?`failed with ${c}`:f!==void 0?`was killed with ${f} (${d})`:v!==void 0?`failed with exit code ${v}`:"failed","getErrorPrefix"),ZMe=t(({stdout:a,stderr:s,all:c,error:f,signal:d,exitCode:v,command:E,escapedCommand:A,timedOut:O,isCanceled:L,killed:W,parsed:{options:{timeout:$}}})=>{v=v===null?void 0:v,d=d===null?void 0:d;let K=d===void 0?void 0:Jkt[d].description,Ne=f&&f.code,Se=`Command ${v7r({timedOut:O,timeout:$,errorCode:Ne,signal:d,signalDescription:K,exitCode:v,isCanceled:L})}: ${E}`,Ct=Object.prototype.toString.call(f)==="[object Error]",Tt=Ct?`${Se}
|
|
683
683
|
${f.message}`:Se,br=[Tt,s,a].filter(Boolean).join(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zuplo/core",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.40.0",
|
|
4
4
|
"repository": "https://github.com/zuplo/zuplo",
|
|
5
5
|
"author": "Zuplo, Inc.",
|
|
6
6
|
"type": "module",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"prettier": "^3.3.3"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@zuplo/graphql": "^6.
|
|
44
|
-
"@zuplo/otel": "^6.
|
|
45
|
-
"@zuplo/runtime": "^6.
|
|
43
|
+
"@zuplo/graphql": "^6.40.0",
|
|
44
|
+
"@zuplo/otel": "^6.40.0",
|
|
45
|
+
"@zuplo/runtime": "^6.40.0"
|
|
46
46
|
}
|
|
47
47
|
}
|