aronrepo 1.4.2 → 1.4.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.
package/dist/bin/index CHANGED
@@ -8,7 +8,7 @@ ${r.message}`:y,x=[h,t,e].filter(Boolean).join(`
8
8
  `).filter(i=>{let o=i.match(hr);if(o===null||!o[1])return!0;let s=o[1];return s.includes(".app/Contents/Resources/electron.asar")||s.includes(".app/Contents/Resources/default_app.asar")||s.includes("node_modules/electron/dist/resources/electron.asar")||s.includes("node_modules/electron/dist/resources/default_app.asar")?!1:!Lo.test(s)}).filter(i=>i.trim()!=="").map(i=>(r&&(i=i.replace(r,"$1")),t&&(i=i.replace(hr,(o,s)=>o.replace(s,s.replace(Mo,"~")))),i)).join(`
9
9
  `)}var Do=e=>e.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""),oe=class extends Error{#e;name="AggregateError";constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);t=t.map(r=>r instanceof Error?r:r!==null&&typeof r=="object"?Object.assign(new Error(r.message),r):new Error(r));let n=t.map(r=>typeof r.stack=="string"&&r.stack.length>0?Do(ft(r.stack)):String(r)).join(`
10
10
  `);n=`
11
- `+at(n,4),super(n),this.#e=t}get errors(){return this.#e.slice()}};var lt=class extends Error{constructor(t){super(),this.name="AbortError",this.message=t}},yr=e=>globalThis.DOMException===void 0?new lt(e):new DOMException(e),xr=e=>{let t=e.reason===void 0?yr("This operation was aborted."):e.reason;return t instanceof Error?t:yr(t)};async function dt(e,t,{concurrency:n=Number.POSITIVE_INFINITY,stopOnError:r=!0,signal:i}={}){return new Promise((o,s)=>{if(e[Symbol.iterator]===void 0&&e[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof e})`);if(typeof t!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(n)||n===Number.POSITIVE_INFINITY)&&n>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${n}\` (${typeof n})`);let a=[],c=[],u=new Map,f=!1,l=!1,p=!1,m=0,d=0,y=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),g=x=>{f=!0,l=!0,s(x)};i&&(i.aborted&&g(xr(i)),i.addEventListener("abort",()=>{g(xr(i))}));let h=async()=>{if(l)return;let x=await y.next(),I=d;if(d++,x.done){if(p=!0,m===0&&!l){if(!r&&c.length>0){g(new oe(c));return}if(l=!0,u.size===0){o(a);return}let _=[];for(let[O,me]of a.entries())u.get(O)!==br&&_.push(me);o(_)}return}m++,(async()=>{try{let _=await x.value;if(l)return;let O=await t(_,I);O===br&&u.set(I,O),a[I]=O,m--,await h()}catch(_){if(r)g(_);else{c.push(_),m--;try{await h()}catch(O){g(O)}}}})()};(async()=>{for(let x=0;x<n;x++){try{await h()}catch(I){g(I);break}if(p||f)break}})()})}var br=Symbol("skip");async function pt(e,t){return dt(e,n=>n(),t)}var j=b(require("@techor/log")),G=b(Tr());var pe=b(require("to-line"));var Wo=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],zo=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Ho=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Ko=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],_r=(e,t,n)=>{let r=e;return typeof t=="string"||Array.isArray(t)?r=e.toLocaleString(t,n):(t===!0||n!==void 0)&&(r=e.toLocaleString(void 0,n)),r};function _e(e,t){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t={bits:!1,binary:!1,...t};let n=t.bits?t.binary?Ko:Ho:t.binary?zo:Wo;if(t.signed&&e===0)return` 0 ${n[0]}`;let r=e<0,i=r?"-":t.signed?"+":"";r&&(e=-e);let o;if(t.minimumFractionDigits!==void 0&&(o={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(o={maximumFractionDigits:t.maximumFractionDigits,...o}),e<1){let u=_r(e,t.locale,o);return i+u+" "+n[0]}let s=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),n.length-1);e/=(t.binary?1024:1e3)**s,o||(e=e.toPrecision(3));let a=_r(Number(e),t.locale,o),c=n[s];return i+a+" "+c}var gi=b(Ir()),jt=b(require("fs")),hi=b(ci());var ui=["sourcemap","legalComments","sourceRoot","sourcesContent","format","globalName","target","supported","platform","mangleProps","reserveProps","mangleQuoted","mangleCache","drop","minify","minifyWhitespace","minifyIdentifiers","minifySyntax","charset","treeShaking","ignoreAnnotations","jsx","jsxFactory","jsxFragment","jsxImportSource","jsxDev","jsxSideEffects","define","pure","keepNames","color","logLevel","logLimit","logOverride","bundle","splitting","preserveSymlinks","outfile","metafile","outdir","outbase","external","packages","alias","loader","resolveExtensions","mainFields","conditions","write","allowOverwrite","tsconfig","outExtension","publicPath","entryNames","chunkNames","assetNames","inject","banner","footer","incremental","entryPoints","stdin","plugins","absWorkingDir","nodePaths","watch"];var Ta={js:"cjs",cjs:"cjs",mjs:"esm",css:"css"},v=q(),{dependencies:fi,peerDependencies:li}=v,Ct=[];fi&&Ct.push(...Object.keys(fi));li&&Ct.push(...Object.keys(li));di.program.command("pack [entryPaths...]").option("-f, --format [formats...]","The output format for the generated JavaScript files `iife`, `cjs`, `esm`",["cjs","esm"]).option("-t, --shakeable-format [formats...]","Output tree-shakeable modules by formats",["cjs","esm"]).option("-w, --watch","Rebuild whenever a file changes",!1).option("-s, --sourcemap","Emit a source map",process.env.NODE_ENV==="production").option("-p, --platform <node,browser,neutral>","Platform target","browser").option("-t, --type","Emit typescript declarations",v.types).option("-o, --outdir <dir>","The output directory for the build operation","dist").option("-o, --serve","Serve mode starts a web server that serves your code to your browser on your device",!1).option("-e, --external <packages...>","External packages to exclude from the build",Ct).option("-ee, --extra-external <packages...>","Extra external packages to exclude from the build",[]).option("-kn, --keep-names","Keep JavaScript function/class names",!1).option("--cjs-ext","Specify CommonJS default file extension",".js").option("--iife-ext","Specify CommonJS default file extension",".js").option("--esm-ext","Specify CommonJS default file extension",".mjs").option("--srcdir <dir>","The source directory","src").option("--target","This sets the target environment for the generated JavaScript and/or CSS code.","esnext").option("--mangle-props","Pass a regular expression to esbuild to tell esbuild to automatically rename all properties that match this regular expression","^_").option("--no-bundle","OFF: Inline any imported dependencies into the file itself",!0).option("--no-minify","OFF: Minify the generated code").option("--no-clean","OFF: Clean up the previous output directory before the build starts").action(async function(e,t,n){t.clean&&jt.default.existsSync(t.outdir)&&(jt.default.rmSync(t.outdir,{force:!0,recursive:!0}),console.log(""),j.default.d`Cleaned up the **${t.outdir}** output directory`);let r=[],i=(a,c)=>{let u=G.default.relative(t.outdir,a),f=G.default.join(t.srcdir,u);return G.default.changeExt(f,c)},o=async(a,c)=>{let u=c.format==="css",f=c.ext||c.outFile&&G.default.extname(c.outFile)||void 0,l=[...t.external,...t.extraExternal],p=c.outdir||t.outdir;t.bundle,c.softBundle&&l.push(".*");let m=[],d={...t,outExtension:u?{".css":".css"}:{".js":f||{cjs:t.cjsExt,esm:t.esmExt,iife:t.iifeExt}[c.format]},external:l,logLevel:"info",outdir:p,outbase:t.srcdir,platform:c.platform||t.platform,metafile:!0,format:u?void 0:c.format,keepNames:t.keepNames,mangleProps:t.mangleProps?new RegExp(t.mangleProps):void 0,target:t.target,sourcemap:t.sourcemap,plugins:m};delete d.watch,delete d.serve;for(let g in d)ui.includes(g)||delete d[g];d.entryPoints=pi.default.sync([...new Set(a)].map(g=>(0,gi.default)(g))).filter(g=>!r.find(h=>h.options.entryPoints.includes(g)&&h.options.format===d.format&&(0,hi.default)(h.options.outExtension,d.outExtension)&&h.options.outdir===d.outdir));let y={options:d,run:async()=>{let g=await(0,mi.context)(d),{metafile:h}=await g.rebuild();if(h){console.log(""),y.metafile=h;for(let x in h.outputs){let I=h.outputs[x],_=_e(I.bytes).replace(/ /g,""),O=h.outputs[x].format=c.format;j.default`${j.chalk.dim("\u2502")} $t [${O}] **${x}** ${_} (${Object.keys(I.inputs).length} inputs)`}j.default.tree({entries:d.entryPoints,external:d.external,outdir:d.outdir,format:d.format,platform:d.platform,[Object.keys(d).filter(x=>d[x]===!0).map(x=>j.chalk.green("\u2713 ")+x).join(", ")]:null})}t.watch?await g.watch():await g.dispose(),t.serve&&await g.serve()}};d.entryPoints.length&&r.push(y)};if(t.shakeableFormat.length&&t.shakeableFormat.forEach(a=>o([G.default.join(t.srcdir,"**/*.{js,ts,jsx,tsx}")],{format:a,platform:"node",outdir:G.default.join(t.outdir,a),softBundle:!0})),v.exports&&function a(c,u,f){if(typeof c=="string"){let l=G.default.extname(c);o([i(c,".{js,ts,jsx,tsx}")],{format:f.format||Ta[l],outFile:f.outFile||c,platform:f.platform})}else for(let l in c){let p=c[l],m,d;switch(u){case"node":d="node";break;case"browser":d="browser";break;case"require":m="cjs";break;case"import":m="esm";break}if(l.startsWith("."))a(p,l);else switch(l){case"node":a(p,l,{platform:"node",format:m});break;case"browser":a(p,l,{platform:"browser",format:m});break;case"default":a(p,l,{platform:d,format:m});break;case"require":a(p,l,{platform:d,format:"cjs"});break;case"import":a(p,l,{platform:d,format:"esm"});break}}}(v.exports,""),v.style&&o([i(v.main,".css")],{format:"css"}),v.main&&!v.main.endsWith(".css")&&o([i(v.main,".{js,ts,jsx,tsx}")],{format:"cjs",outFile:v.main}),v.module&&o([i(v.module,".{js,ts,jsx,tsx}")],{format:"esm",outFile:v.module}),v.browser&&o([i(v.browser,".{js,ts,jsx,tsx}")],{format:"iife",platform:"browser",outFile:v.browser}),v.bin)if(typeof v.bin=="string")o([i(v.bin,".{js,ts,jsx,tsx}")],{format:"cjs",platform:"node",outFile:v.bin});else for(let a in v.bin){let c=v.bin[a];o([i(c,".{js,ts,jsx,tsx}")],{format:"cjs",platform:"node",outFile:c})}e.length&&(e.find(c=>c.includes(".css"))?o(e,{format:"css"}):t.format.map(c=>o(e,{format:c}))),r.length||t.format.map(a=>o([G.default.join(t.srcdir,"index.ts")],{format:a}));let s;t.type&&(s={outFile:"declarations",options:{platform:"type",format:"dts"},run:()=>new Promise(a=>{let c=()=>gr(pe.default`
11
+ `+at(n,4),super(n),this.#e=t}get errors(){return this.#e.slice()}};var lt=class extends Error{constructor(t){super(),this.name="AbortError",this.message=t}},yr=e=>globalThis.DOMException===void 0?new lt(e):new DOMException(e),xr=e=>{let t=e.reason===void 0?yr("This operation was aborted."):e.reason;return t instanceof Error?t:yr(t)};async function dt(e,t,{concurrency:n=Number.POSITIVE_INFINITY,stopOnError:r=!0,signal:i}={}){return new Promise((o,s)=>{if(e[Symbol.iterator]===void 0&&e[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof e})`);if(typeof t!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(n)||n===Number.POSITIVE_INFINITY)&&n>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${n}\` (${typeof n})`);let a=[],c=[],u=new Map,f=!1,l=!1,p=!1,m=0,d=0,y=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),g=x=>{f=!0,l=!0,s(x)};i&&(i.aborted&&g(xr(i)),i.addEventListener("abort",()=>{g(xr(i))}));let h=async()=>{if(l)return;let x=await y.next(),I=d;if(d++,x.done){if(p=!0,m===0&&!l){if(!r&&c.length>0){g(new oe(c));return}if(l=!0,u.size===0){o(a);return}let _=[];for(let[O,me]of a.entries())u.get(O)!==br&&_.push(me);o(_)}return}m++,(async()=>{try{let _=await x.value;if(l)return;let O=await t(_,I);O===br&&u.set(I,O),a[I]=O,m--,await h()}catch(_){if(r)g(_);else{c.push(_),m--;try{await h()}catch(O){g(O)}}}})()};(async()=>{for(let x=0;x<n;x++){try{await h()}catch(I){g(I);break}if(p||f)break}})()})}var br=Symbol("skip");async function pt(e,t){return dt(e,n=>n(),t)}var j=b(require("@techor/log")),G=b(Tr());var pe=b(require("to-line"));var Wo=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],zo=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Ho=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Ko=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],_r=(e,t,n)=>{let r=e;return typeof t=="string"||Array.isArray(t)?r=e.toLocaleString(t,n):(t===!0||n!==void 0)&&(r=e.toLocaleString(void 0,n)),r};function _e(e,t){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t={bits:!1,binary:!1,...t};let n=t.bits?t.binary?Ko:Ho:t.binary?zo:Wo;if(t.signed&&e===0)return` 0 ${n[0]}`;let r=e<0,i=r?"-":t.signed?"+":"";r&&(e=-e);let o;if(t.minimumFractionDigits!==void 0&&(o={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(o={maximumFractionDigits:t.maximumFractionDigits,...o}),e<1){let u=_r(e,t.locale,o);return i+u+" "+n[0]}let s=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),n.length-1);e/=(t.binary?1024:1e3)**s,o||(e=e.toPrecision(3));let a=_r(Number(e),t.locale,o),c=n[s];return i+a+" "+c}var gi=b(Ir()),jt=b(require("fs")),hi=b(ci());var ui=["sourcemap","legalComments","sourceRoot","sourcesContent","format","globalName","target","supported","platform","mangleProps","reserveProps","mangleQuoted","mangleCache","drop","minify","minifyWhitespace","minifyIdentifiers","minifySyntax","charset","treeShaking","ignoreAnnotations","jsx","jsxFactory","jsxFragment","jsxImportSource","jsxDev","jsxSideEffects","define","pure","keepNames","color","logLevel","logLimit","logOverride","bundle","splitting","preserveSymlinks","outfile","metafile","outdir","outbase","external","packages","alias","loader","resolveExtensions","mainFields","conditions","write","allowOverwrite","tsconfig","outExtension","publicPath","entryNames","chunkNames","assetNames","inject","banner","footer","incremental","entryPoints","stdin","plugins","absWorkingDir","nodePaths","watch"];var Ta={js:"cjs",cjs:"cjs",mjs:"esm",css:"css"},v=q(),{dependencies:fi,peerDependencies:li}=v,Ct=[];fi&&Ct.push(...Object.keys(fi));li&&Ct.push(...Object.keys(li));di.program.command("pack [entryPaths...]").option("-f, --format [formats...]","The output format for the generated JavaScript files `iife`, `cjs`, `esm`",["cjs","esm"]).option("-t, --shakeable-format [formats...]","Output tree-shakeable modules by formats",["cjs","esm"]).option("-w, --watch","Rebuild whenever a file changes",!1).option("-s, --sourcemap","Emit a source map",process.env.NODE_ENV==="production").option("-p, --platform <node,browser,neutral>","Platform target","browser").option("-t, --type","Emit typescript declarations",v.types).option("-o, --outdir <dir>","The output directory for the build operation","dist").option("-o, --serve","Serve mode starts a web server that serves your code to your browser on your device",!1).option("-e, --external <packages...>","External packages to exclude from the build",Ct).option("-ee, --extra-external <packages...>","Extra external packages to exclude from the build",[]).option("-re, --resolve-extensions [extensions...]","The resolution algorithm used by node supports implicit file extensions",[".tsx",".ts",".jsx",".js",".mjs",".cjs",".css",".json"]).option("-kn, --keep-names","Keep JavaScript function/class names",!1).option("--cjs-ext","Specify CommonJS default file extension",".js").option("--iife-ext","Specify CommonJS default file extension",".js").option("--esm-ext","Specify CommonJS default file extension",".mjs").option("--srcdir <dir>","The source directory","src").option("--target","This sets the target environment for the generated JavaScript and/or CSS code.","esnext").option("--mangle-props","Pass a regular expression to esbuild to tell esbuild to automatically rename all properties that match this regular expression","^_").option("--no-bundle","OFF: Inline any imported dependencies into the file itself",!0).option("--no-minify","OFF: Minify the generated code").option("--no-clean","OFF: Clean up the previous output directory before the build starts").action(async function(e,t,n){t.clean&&jt.default.existsSync(t.outdir)&&(jt.default.rmSync(t.outdir,{force:!0,recursive:!0}),console.log(""),j.default.d`Cleaned up the **${t.outdir}** output directory`);let r=[],i=(a,c)=>{let u=G.default.relative(t.outdir,a),f=G.default.join(t.srcdir,u);return G.default.changeExt(f,c)},o=async(a,c)=>{let u=c.format==="css",f=c.ext||c.outFile&&G.default.extname(c.outFile)||void 0,l=[...t.external,...t.extraExternal],p=c.outdir||t.outdir;t.bundle,c.softBundle&&l.push(".*");let m=[],d={...t,outExtension:u?{".css":".css"}:{".js":f||{cjs:t.cjsExt,esm:t.esmExt,iife:t.iifeExt}[c.format]},external:l,logLevel:"info",outdir:p,outbase:t.srcdir,platform:c.platform||t.platform,metafile:!0,format:u?void 0:c.format,keepNames:t.keepNames,resolveExtensions:t.resolveExtensions,mangleProps:t.mangleProps?new RegExp(t.mangleProps):void 0,target:t.target,sourcemap:t.sourcemap,plugins:m};delete d.watch,delete d.serve;for(let g in d)ui.includes(g)||delete d[g];d.entryPoints=pi.default.sync([...new Set(a)].map(g=>(0,gi.default)(g))).filter(g=>!r.find(h=>h.options.entryPoints.includes(g)&&h.options.format===d.format&&(0,hi.default)(h.options.outExtension,d.outExtension)&&h.options.outdir===d.outdir));let y={options:d,run:async()=>{let g=await(0,mi.context)(d),{metafile:h}=await g.rebuild();if(h){console.log(""),y.metafile=h;for(let x in h.outputs){let I=h.outputs[x],_=_e(I.bytes).replace(/ /g,""),O=h.outputs[x].format=c.format;j.default`${j.chalk.dim("\u2502")} $t [${O}] **${x}** ${_} (${Object.keys(I.inputs).length} inputs)`}j.default.tree({entries:d.entryPoints,external:d.external,outdir:d.outdir,format:d.format,platform:d.platform,[Object.keys(d).filter(x=>d[x]===!0).map(x=>j.chalk.green("\u2713 ")+x).join(", ")]:null})}t.watch?await g.watch():await g.dispose(),t.serve&&await g.serve()}};d.entryPoints.length&&r.push(y)};if(t.shakeableFormat.length&&t.shakeableFormat.forEach(a=>o([G.default.join(t.srcdir,"**/*.{js,ts,jsx,tsx}")],{format:a,platform:"node",outdir:G.default.join(t.outdir,a),softBundle:!0})),v.exports&&function a(c,u,f){if(typeof c=="string"){let l=G.default.extname(c);o([i(c,".{js,ts,jsx,tsx}")],{format:f.format||Ta[l],outFile:f.outFile||c,platform:f.platform})}else for(let l in c){let p=c[l],m,d;switch(u){case"node":d="node";break;case"browser":d="browser";break;case"require":m="cjs";break;case"import":m="esm";break}if(l.startsWith("."))a(p,l);else switch(l){case"node":a(p,l,{platform:"node",format:m});break;case"browser":a(p,l,{platform:"browser",format:m});break;case"default":a(p,l,{platform:d,format:m});break;case"require":a(p,l,{platform:d,format:"cjs"});break;case"import":a(p,l,{platform:d,format:"esm"});break}}}(v.exports,""),v.style&&o([i(v.main,".css")],{format:"css"}),v.main&&!v.main.endsWith(".css")&&o([i(v.main,".{js,ts,jsx,tsx}")],{format:"cjs",outFile:v.main}),v.module&&o([i(v.module,".{js,ts,jsx,tsx}")],{format:"esm",outFile:v.module}),v.browser&&o([i(v.browser,".{js,ts,jsx,tsx}")],{format:"iife",platform:"browser",outFile:v.browser}),v.bin)if(typeof v.bin=="string")o([i(v.bin,".{js,ts,jsx,tsx}")],{format:"cjs",platform:"node",outFile:v.bin});else for(let a in v.bin){let c=v.bin[a];o([i(c,".{js,ts,jsx,tsx}")],{format:"cjs",platform:"node",outFile:c})}e.length&&(e.find(c=>c.includes(".css"))?o(e,{format:"css"}):t.format.map(c=>o(e,{format:c}))),r.length||t.format.map(a=>o([G.default.join(t.srcdir,"index.ts")],{format:a}));let s;t.type&&(s={outFile:"declarations",options:{platform:"type",format:"dts"},run:()=>new Promise(a=>{let c=()=>gr(pe.default`
12
12
  npx tsc --emitDeclarationOnly --preserveWatchOutput --declaration
13
13
  --outDir ${t.outdir}
14
14
  ${t.watch&&"--watch"}