aronrepo 1.3.5 → 1.3.7
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 +1 -1
- package/dist/bin/index.map +2 -2
- package/package.json +1 -1
package/dist/bin/index
CHANGED
|
@@ -8,7 +8,7 @@ ${r.message}`:g,E=[S,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,l=!1,d=!1,f=!1,m=0,p=0,g=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),h=E=>{l=!0,d=!0,s(E)};i&&(i.aborted&&h(xr(i)),i.addEventListener("abort",()=>{h(xr(i))}));let S=async()=>{if(d)return;let E=await g.next(),P=p;if(p++,E.done){if(f=!0,m===0&&!d){if(!r&&c.length>0){h(new oe(c));return}if(d=!0,u.size===0){o(a);return}let I=[];for(let[j,me]of a.entries())u.get(j)!==br&&I.push(me);o(I)}return}m++,(async()=>{try{let I=await E.value;if(d)return;let j=await t(I,P);j===br&&u.set(P,j),a[P]=j,m--,await S()}catch(I){if(r)h(I);else{c.push(I),m--;try{await S()}catch(j){h(j)}}}})()};(async()=>{for(let E=0;E<n;E++){try{await S()}catch(P){h(P);break}if(f||l)break}})()})}var br=Symbol("skip");async function pt(e,t){return dt(e,n=>n(),t)}var O=y(require("@techor/log")),$=y(Tr());var pe=y(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=y(Pr()),jt=y(require("fs")),hi=y(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:"iife",cjs:"cjs",mjs:"esm",css:"css"},w=q(),{dependencies:fi,peerDependencies:li}=w,At=[];fi&&At.push(...Object.keys(fi));li&&At.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("-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",w.types).option("-o, --outdir <dir>","The output directory for the build operation","dist").option("-e, --external <packages...>","External packages to exclude from the build",At).option("-ee, --extra-external <packages...>","Extra external packages to exclude from the build",[]).option("-kn, --keep-names","Keep JavaScript function/class names",!1).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("--resolve-extensions","The resolution algorithm used by node supports implicit file extensions",[".tsx",".ts",".jsx",".js",".mjs",".cjs",".css",".json"]).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").option("--no-author","OFF: Clean up the previous output directory before the build starts").option("--no-soft-bundle","OFF: Bundle only IIFE and node_modules instead of ESM and CJS source files").action(async function(e,t,n){t.clean&&jt.default.existsSync(t.outdir)&&(jt.default.rmSync(t.outdir,{force:!0,recursive:!0}),console.log(""),O.default.d`Cleaned up the **${t.outdir}** output directory`);let r=[],i=(a,c)=>$.default.changeExt($.default.join(t.srcdir,$.default.relative(t.outdir,a)),c),o=async(a,c)=>{let u=c.format==="css",l=c.outFile?$.default.extname(c.outFile):"",d=[...t.external,...t.extraExternal];t.softBundle,(c.format==="esm"||c.format==="cjs")&&d.push("
|
|
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,l=!1,d=!1,f=!1,m=0,p=0,g=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),h=E=>{l=!0,d=!0,s(E)};i&&(i.aborted&&h(xr(i)),i.addEventListener("abort",()=>{h(xr(i))}));let S=async()=>{if(d)return;let E=await g.next(),P=p;if(p++,E.done){if(f=!0,m===0&&!d){if(!r&&c.length>0){h(new oe(c));return}if(d=!0,u.size===0){o(a);return}let I=[];for(let[j,me]of a.entries())u.get(j)!==br&&I.push(me);o(I)}return}m++,(async()=>{try{let I=await E.value;if(d)return;let j=await t(I,P);j===br&&u.set(P,j),a[P]=j,m--,await S()}catch(I){if(r)h(I);else{c.push(I),m--;try{await S()}catch(j){h(j)}}}})()};(async()=>{for(let E=0;E<n;E++){try{await S()}catch(P){h(P);break}if(f||l)break}})()})}var br=Symbol("skip");async function pt(e,t){return dt(e,n=>n(),t)}var O=y(require("@techor/log")),$=y(Tr());var pe=y(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=y(Pr()),jt=y(require("fs")),hi=y(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:"iife",cjs:"cjs",mjs:"esm",css:"css"},w=q(),{dependencies:fi,peerDependencies:li}=w,At=[];fi&&At.push(...Object.keys(fi));li&&At.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("-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",w.types).option("-o, --outdir <dir>","The output directory for the build operation","dist").option("-e, --external <packages...>","External packages to exclude from the build",At).option("-ee, --extra-external <packages...>","Extra external packages to exclude from the build",[]).option("-kn, --keep-names","Keep JavaScript function/class names",!1).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("--resolve-extensions","The resolution algorithm used by node supports implicit file extensions",[".tsx",".ts",".jsx",".js",".mjs",".cjs",".css",".json"]).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").option("--no-author","OFF: Clean up the previous output directory before the build starts").option("--no-soft-bundle","OFF: Bundle only IIFE and node_modules instead of ESM and CJS source files").action(async function(e,t,n){t.clean&&jt.default.existsSync(t.outdir)&&(jt.default.rmSync(t.outdir,{force:!0,recursive:!0}),console.log(""),O.default.d`Cleaned up the **${t.outdir}** output directory`);let r=[],i=(a,c)=>$.default.changeExt($.default.join(t.srcdir,$.default.relative(t.outdir,a)),c),o=async(a,c)=>{let u=c.format==="css",l=c.outFile?$.default.extname(c.outFile):"",d=[...t.external,...t.extraExternal];t.bundle,t.softBundle,(c.format==="esm"||c.format==="cjs")&&d.push(".*");let f={...t,outExtension:u?{".css":".css"}:{".js":l||{cjs:".cjs",esm:".mjs",iife:".js"}[c.format]},external:d,watch:t.watch?{onRebuild(p,g){}}:!1,logLevel:"silent",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,resolveExtensions:t.resolveExtensions,target:t.target,sourcemap:t.sourcemap};for(let p in f)ui.includes(p)||delete f[p];f.entryPoints=pi.default.sync([...new Set(a)].map(p=>(0,gi.default)(p))).filter(p=>!r.find(g=>g.options.entryPoints.includes(p)&&g.options.format===f.format&&(0,hi.default)(g.options.outExtension,f.outExtension)));let m={options:f,run:async()=>{let{metafile:p}=await(0,mi.build)(f);if(p){console.log(""),m.metafile=p;for(let g in p.outputs){let h=p.outputs[g],S=_e(h.bytes).replace(/ /g,""),E=p.outputs[g].format=c.format;O.default`${O.chalk.dim("\u2502")} $t [${E}] **${g}** ${S} (${Object.keys(h.inputs).length} inputs)`}O.default.tree({entries:f.entryPoints,external:f.external,outdir:f.outdir,format:f.format,platform:f.platform,[Object.keys(f).filter(g=>f[g]===!0).map(g=>O.chalk.green("\u2713 ")+g).join(", ")]:null})}}};f.entryPoints.length&&r.push(m)};if(w.style&&o([i(w.main,".css")],{format:"css"}),w.main&&!w.main.endsWith(".css")&&o([i(w.main,".{js,ts,jsx,tsx}")],{format:"cjs",outFile:w.main}),w.module&&o([i(w.module,".{js,ts,jsx,tsx}")],{format:"esm",outFile:w.module}),w.browser&&o([i(w.browser,".{js,ts,jsx,tsx}")],{format:"iife",platform:"browser",outFile:w.browser}),w.bin)if(typeof w.bin=="string")o([i(w.bin,".{js,ts,jsx,tsx}")],{format:"cjs",platform:"node",outFile:w.bin});else for(let a in w.bin){let c=w.bin[a];o([i(c,".{js,ts,jsx,tsx}")],{format:"cjs",platform:"node",outFile:c})}w.exports&&function a(c,u,l){if(typeof c=="string"){let d=$.default.extname(c);o([i(c,".{js,ts,jsx,tsx}")],{format:l.format||Ta[d],outFile:l.outFile||c,platform:l.platform})}else for(let d in c){let f=c[d],m,p;switch(u){case"node":p="node";break;case"browser":p="browser";break;case"require":m="cjs";break;case"import":m="esm";break}if(d.startsWith("."))a(f,d);else switch(d){case"node":a(f,d,{platform:"node",format:m});break;case"browser":a(f,d,{platform:"browser",format:m});break;case"default":a(f,d,{platform:p,format:m});break;case"require":a(f,d,{platform:p,format:"cjs"});break;case"import":a(f,d,{platform:p,format:"esm"});break}}}(w.exports,""),e.length&&(e.find(c=>c.includes(".css"))?o(e,{format:"css"}):t.format.map(c=>o(e,{format:c}))),t.bundle,t.softBundle&&t.format.map(a=>o([$.default.join(t.srcdir,"**/*.{js,ts,jsx,tsx}")],{format:a,platform:"node"})),r.length||t.format.map(a=>o([$.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"}
|