pkgroll 2.10.0 → 2.11.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.
Files changed (2) hide show
  1. package/dist/cli.mjs +1 -1
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -19,7 +19,7 @@ var ze=Object.defineProperty;var i=(u,e)=>ze(u,"name",{value:e,configurable:!0})
19
19
  `:"")+(D?this.indentText({text:this.render(D),spaces:t}):"")}
20
20
  `}table({tableData:e,tableOptions:D,tableBreakpoints:t}){return eD(e.map(n=>n.map(r=>this.render(r))),t?nD(t):D)}flagParameter(e){return e===Boolean?"":e===String?"<string>":e===Number?"<number>":Array.isArray(e)?this.flagParameter(e[0]):"<value>"}flagOperator(e){return" "}flagName(e){const{flag:D,flagFormatted:t,aliasesEnabled:n,aliasFormatted:r}=e;let o="";if(r?o+=`${r}, `:n&&(o+=" "),o+=t,"placeholder"in D&&typeof D.placeholder=="string")o+=`${this.flagOperator(e)}${D.placeholder}`;else{const s=this.flagParameter("type"in D?D.type:D);s&&(o+=`${this.flagOperator(e)}${s}`)}return o}flagDefault(e){return JSON.stringify(e)}flagDescription({flag:e}){let D="description"in e?e.description??"":"";if("default"in e){let{default:t}=e;typeof t=="function"&&(t=t()),t&&(D+=` (default: ${this.flagDefault(t)})`)}return D}render(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(D=>this.render(D)).join(`
21
21
  `);if("type"in e&&this[e.type]){const D=this[e.type];if(typeof D=="function")return D.call(this,e.data)}throw new Error(`Invalid node type: ${JSON.stringify(e)}`)}};const oe=i(u=>u.length>0&&!u.includes(" "),"y"),{stringify:T}=JSON,mD=/[|\\{}()[\]^$+*?.]/;function Eu(u){const e=[];let D,t;for(const n of u){if(t)throw new Error(`Invalid parameter: Spread parameter ${T(t)} must be last`);const r=n[0],o=n[n.length-1];let s;if(r==="<"&&o===">"&&(s=!0,D))throw new Error(`Invalid parameter: Required parameter ${T(n)} cannot come after optional parameter ${T(D)}`);if(r==="["&&o==="]"&&(s=!1,D=n),s===void 0)throw new Error(`Invalid parameter: ${T(n)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let a=n.slice(1,-1);const l=a.slice(-3)==="...";l&&(t=n,a=a.slice(0,-3));const C=a.match(mD);if(C)throw new Error(`Invalid parameter: ${T(n)}. Invalid character found ${T(C[0])}`);e.push({name:a,required:s,spread:l})}return e}i(Eu,"w$1");function hu(u,e,D,t){for(let n=0;n<e.length;n+=1){const{name:r,required:o,spread:s}=e[n],a=rD(r);if(a in u)throw new Error(`Invalid parameter: ${T(r)} is used more than once.`);const l=s?D.slice(n):D[n];if(s&&(n=e.length),o&&(!l||s&&l.length===0))return console.error(`Error: Missing required parameter ${T(r)}
22
- `),t(),process.exit(1);u[a]=l}}i(hu,"b");function gD(u){return u===void 0||u!==!1}i(gD,"W$1");function se(u,e,D,t){const n={...e.flags},r=e.version;r&&(n.version={type:Boolean,description:"Show version"});const{help:o}=e,s=gD(o);s&&!("help"in n)&&(n.help={type:Boolean,alias:"h",description:"Show help"});const a=At(n,t,{ignore:e.ignoreArgv}),l=i(()=>{console.log(e.version)},"f");if(r&&a.flags.version===!0)return l(),process.exit(0);const C=new hD,F=s&&o?.render?o.render:d=>C.render(d),c=i(d=>{const m=dD({...e,...d?{help:d}:{},flags:n});console.log(F(m,C))},"p");if(s&&a.flags.help===!0)return c(),process.exit(0);if(e.parameters){let{parameters:d}=e,m=a._;const y=d.indexOf("--"),j=d.slice(y+1),$=Object.create(null);if(y>-1&&j.length>0){d=d.slice(0,y);const p=a._["--"];m=m.slice(0,-p.length||void 0),hu($,Eu(d),m,c),hu($,Eu(j),p,c)}else hu($,Eu(d),m,c);Object.assign(a._,$)}const E={...a,showVersion:l,showHelp:c};return typeof D=="function"&&D(E),{command:u,...E}}i(se,"x$1");function BD(u,e){const D=new Map;for(const t of e){const n=[t.options.name],{alias:r}=t.options;r&&(Array.isArray(r)?n.push(...r):n.push(r));for(const o of n){if(D.has(o))throw new Error(`Duplicate command name found: ${T(o)}`);D.set(o,t)}}return D.get(u)}i(BD,"z$1");function AD(u,e,D=process.argv.slice(2)){if(!u)throw new Error("Options is required");if("name"in u&&(!u.name||!oe(u.name)))throw new Error(`Invalid script name: ${T(u.name)}`);const t=D[0];if(u.commands&&oe(t)){const n=BD(t,u.commands);if(n)return se(n.options.name,{...n.options,parent:u},n.callback,D.slice(1))}return se(void 0,u,e,D)}i(AD,"Z$1");var yD="2.10.0";const mu=i(u=>S.promises.access(u).then(()=>!0,()=>!1),"fsExists"),bD=i(async u=>{const e=h.join(u,"package.json");if(!await mu(e))throw new Error(`package.json not found at: ${e}`);const t=await S.promises.readFile(e,"utf8");try{return JSON.parse(t)}catch(n){throw new Error(`Cannot parse package.json: ${n.message}`)}},"readPackageJson"),wD=/^[/.]/,G=i((u,e)=>(!h.isAbsolute(u)&&!wD.test(u)&&(u=`./${u}`),e&&!u.endsWith("/")&&(u+="/"),u),"normalizePath"),vD=/^[$_\p{ID_Start}][$\u200C\u200D\p{ID_Continue}]*$/u,$D=new Set(["do","if","in","for","int","new","try","var","byte","case","char","else","enum","goto","long","null","this","true","void","with","break","catch","class","const","false","final","float","short","super","throw","while","delete","double","export","import","native","public","return","static","switch","throws","typeof","boolean","default","extends","finally","package","private","abstract","continue","debugger","function","volatile","interface","protected","transient","implements","instanceof","synchronized"]),gu=i(u=>!vD.test(u)||$D.has(u),"propertyNeedsQuotes"),P=i(u=>{if(u.endsWith(".mjs"))return"module";if(u.endsWith(".cjs"))return"commonjs"},"getFileType"),ie=i(u=>u.startsWith("."),"isPath"),Bu=i((u,e,D="exports")=>{if(u){if(typeof u=="string")return ie(u)?[{outputPath:u,type:P(u)||e,from:D}]:[];if(Array.isArray(u))return u.flatMap((t,n)=>{const r=`${D}[${n}]`;return typeof t=="string"?ie(t)?{outputPath:t,type:P(t)||e,from:r}:[]:Bu(t,e,r)});if(typeof u=="object")return Object.entries(u).flatMap(([t,n])=>{if(typeof n=="string"){const o=gu(t)?`["${t}"]`:`.${t}`,s={outputPath:n,from:`${D}${o}`};if(t==="require")return{...s,type:"commonjs"};if(t==="import")return{...s,type:P(n)||e};if(t==="types")return{...s,type:"types"};if(t==="node")return{...s,type:P(n)||e,platform:"node"};if(t==="default")return{...s,type:P(n)||e}}const r=gu(t)?`["${t}"]`:`.${t}`;return Bu(n,e,`${D}${r}`)})}return[]},"parseExportsMap"),M=i((u,e)=>{e.outputPath=G(e.outputPath);const{outputPath:D,type:t,platform:n}=e,r=u[D];if(r){if(r.type!==t)throw new Error(`Conflicting export types "${r.type}" & "${t}" found for ${D}`);if(r.platform!==n)throw new Error(`Conflicting export platforms "${r.platform}" & "${n}" found for ${D}`);Object.assign(r,e)}else u[D]=e},"addExportPath"),xD=i(u=>{const e={},D=u.type??"commonjs";if(u.main){const t=u.main;M(e,{outputPath:t,type:P(t)??D,from:"main"})}if(u.module&&M(e,{outputPath:u.module,type:"module",from:"module"}),u.types&&M(e,{outputPath:u.types,type:"types",from:"types"}),u.bin){const{bin:t}=u;if(typeof t=="string")M(e,{outputPath:t,type:P(t)??D,isExecutable:!0,from:"bin"});else for(const[n,r]of Object.entries(t)){const o=gu(n)?`["${n}"]`:`.${n}`;M(e,{outputPath:r,type:P(r)??D,isExecutable:!0,from:`bin${o}`})}}if(u.exports){const t=Bu(u.exports,D);for(const n of t)M(e,n)}return Object.values(e)},"getExportEntries"),kD=i(u=>{let e=!1;if(u.includes("=")){const[D,t]=u.split("=");u=t,e=D==="bin"||D==="binary"}return{outputPath:G(u),type:P(u),isExecutable:e,from:"cli"}},"parseCliInputFlag"),jD=i(({imports:u},e)=>{const D={};if(u)for(const t in u){if(t.startsWith("#"))continue;const n=u[t];typeof n=="string"&&(D[t]=h.join(e,n))}return D},"getAliases"),{stringify:OD}=JSON,TD=i(async(u,e)=>{for(const D of e){const t=u+D;if(await mu(t))return{extension:D,path:t}}},"tryExtensions"),ae={".d.ts":[".d.ts",".d.mts",".d.cts",".ts",".tsx",".mts",".cts"],".d.mts":[".d.mts",".d.ts",".d.cts",".ts",".tsx",".mts",".cts"],".d.cts":[".d.cts",".d.ts",".d.mts",".ts",".tsx",".mts",".cts"],".js":[".js",".ts",".tsx",".mts",".cts"],".mjs":[".mjs",".js",".cjs",".mts",".cts",".ts",".tsx"],".cjs":[".cjs",".js",".mjs",".mts",".cts",".ts",".tsx"]},SD=Object.keys(ae),PD=i(async(u,e,D)=>{const t=e+u.outputPath.slice(D.length);for(const n of SD)if(u.outputPath.endsWith(n)){const r=await TD(t.slice(0,-n.length),ae[n]);if(r)return{input:r.path,srcExtension:r.extension,distExtension:n}}throw new Error(`Could not find matching source file for export path ${OD(u.outputPath)}`)},"getSourcePath"),_D=["peerDependencies","dependencies","optionalDependencies"],Au="@types/",le=i((u,e,D=!1)=>{const t=[],{devDependencies:n}=u;for(const r of _D){const o=u[r];if(!o)continue;const s=Object.keys(o);for(const a of s)if(!(a in e))if(a.startsWith(Au)){if(D){let l=a.slice(Au.length);l.includes("__")&&(l=`@${l.replace("__","/")}`),t.push(l)}}else{if(n&&D){const l=Au+a.replace("@","").replace("/","__");n[l]&&!(l in o)&&console.warn(`Recommendation: "${l}" is externalized because "${a}" is in "${r}". Place "${l}" in "${r}" as well so users don't have missing types.`)}t.push(a)}}return t.flatMap(r=>[r,new RegExp(`^${r}/`)])},"getExternalDependencies"),ID=i(u=>{const e=Xe(/\.([cm]?[jt]s|[jt]sx)$/);return{name:"esbuild-transform",transform:i(async(D,t)=>{if(!e(t))return null;const n=await Mu(D,{...u,loader:"default",sourcefile:t.replace(/\.[cm]ts/,".ts")});return{code:n.code,map:n.map||null}},"transform")}},"esbuildTransform"),ND=i(u=>{if(u==="es")return"esm";if(u==="cjs"||u==="iife")return u},"getEsbuildFormat"),RD=i(u=>({name:"esbuild-minify",renderChunk:i(async(e,D,t)=>{const n=await Mu(e,{...u,format:ND(t.format),minify:!0,keepNames:!0});return{code:n.code,map:n.map||null}},"renderChunk")}),"esbuildMinify"),yu=i((u,e)=>u[0]-e[0]||u[1]-e[1]||u[2]-e[2],"compareSemver"),ce=i(({target:u})=>{const e=u.some(D=>{if(D=D.trim(),!D.startsWith("node"))return;const t=D.slice(4).split(".").map(Number),n=[t[0],t[1]??0,t[2]??0];return!(yu(n,[12,20,0])>=0&&yu(n,[13,0,0])<0||yu(n,[14,13,1])>=0)});return{name:"externalize-node-builtins",resolveId:i(D=>{const t=D.startsWith("node:");if(e&&t&&(D=D.slice(5)),et.includes(D)||t)return{id:D,external:!0}},"resolveId")}},"externalizeNodeBuiltins"),LD=i(u=>({name:"patch-binary",renderChunk:i((e,D,t)=>{if(!D.isEntry||!D.facadeModuleId)return;const n=t.entryFileNames,r=`./${h.posix.join(t.dir,n(D))}`;if(u.includes(r)){const o=new cu(e);return o.prepend(`#!/usr/bin/env node
22
+ `),t(),process.exit(1);u[a]=l}}i(hu,"b");function gD(u){return u===void 0||u!==!1}i(gD,"W$1");function se(u,e,D,t){const n={...e.flags},r=e.version;r&&(n.version={type:Boolean,description:"Show version"});const{help:o}=e,s=gD(o);s&&!("help"in n)&&(n.help={type:Boolean,alias:"h",description:"Show help"});const a=At(n,t,{ignore:e.ignoreArgv}),l=i(()=>{console.log(e.version)},"f");if(r&&a.flags.version===!0)return l(),process.exit(0);const C=new hD,F=s&&o?.render?o.render:d=>C.render(d),c=i(d=>{const m=dD({...e,...d?{help:d}:{},flags:n});console.log(F(m,C))},"p");if(s&&a.flags.help===!0)return c(),process.exit(0);if(e.parameters){let{parameters:d}=e,m=a._;const y=d.indexOf("--"),j=d.slice(y+1),$=Object.create(null);if(y>-1&&j.length>0){d=d.slice(0,y);const p=a._["--"];m=m.slice(0,-p.length||void 0),hu($,Eu(d),m,c),hu($,Eu(j),p,c)}else hu($,Eu(d),m,c);Object.assign(a._,$)}const E={...a,showVersion:l,showHelp:c};return typeof D=="function"&&D(E),{command:u,...E}}i(se,"x$1");function BD(u,e){const D=new Map;for(const t of e){const n=[t.options.name],{alias:r}=t.options;r&&(Array.isArray(r)?n.push(...r):n.push(r));for(const o of n){if(D.has(o))throw new Error(`Duplicate command name found: ${T(o)}`);D.set(o,t)}}return D.get(u)}i(BD,"z$1");function AD(u,e,D=process.argv.slice(2)){if(!u)throw new Error("Options is required");if("name"in u&&(!u.name||!oe(u.name)))throw new Error(`Invalid script name: ${T(u.name)}`);const t=D[0];if(u.commands&&oe(t)){const n=BD(t,u.commands);if(n)return se(n.options.name,{...n.options,parent:u},n.callback,D.slice(1))}return se(void 0,u,e,D)}i(AD,"Z$1");var yD="2.11.0";const mu=i(u=>S.promises.access(u).then(()=>!0,()=>!1),"fsExists"),bD=i(async u=>{const e=h.join(u,"package.json");if(!await mu(e))throw new Error(`package.json not found at: ${e}`);const t=await S.promises.readFile(e,"utf8");try{return JSON.parse(t)}catch(n){throw new Error(`Cannot parse package.json: ${n.message}`)}},"readPackageJson"),wD=/^[/.]/,G=i((u,e)=>(!h.isAbsolute(u)&&!wD.test(u)&&(u=`./${u}`),e&&!u.endsWith("/")&&(u+="/"),u),"normalizePath"),vD=/^[$_\p{ID_Start}][$\u200C\u200D\p{ID_Continue}]*$/u,$D=new Set(["do","if","in","for","int","new","try","var","byte","case","char","else","enum","goto","long","null","this","true","void","with","break","catch","class","const","false","final","float","short","super","throw","while","delete","double","export","import","native","public","return","static","switch","throws","typeof","boolean","default","extends","finally","package","private","abstract","continue","debugger","function","volatile","interface","protected","transient","implements","instanceof","synchronized"]),gu=i(u=>!vD.test(u)||$D.has(u),"propertyNeedsQuotes"),P=i(u=>{if(u.endsWith(".mjs"))return"module";if(u.endsWith(".cjs"))return"commonjs";if(u.endsWith(".d.ts")||u.endsWith(".d.cts")||u.endsWith(".d.mts"))return"types"},"getFileType"),ie=i(u=>u.startsWith("."),"isPath"),Bu=i((u,e,D="exports")=>{if(u){if(typeof u=="string")return ie(u)?[{outputPath:u,type:P(u)||e,from:D}]:[];if(Array.isArray(u))return u.flatMap((t,n)=>{const r=`${D}[${n}]`;return typeof t=="string"?ie(t)?{outputPath:t,type:P(t)||e,from:r}:[]:Bu(t,e,r)});if(typeof u=="object")return Object.entries(u).flatMap(([t,n])=>{if(typeof n=="string"){const o=gu(t)?`["${t}"]`:`.${t}`,s={outputPath:n,from:`${D}${o}`};if(t==="require")return{...s,type:"commonjs"};if(t==="import")return{...s,type:P(n)||e};if(t==="types")return{...s,type:"types"};if(t==="node")return{...s,type:P(n)||e,platform:"node"};if(t==="default")return{...s,type:P(n)||e}}const r=gu(t)?`["${t}"]`:`.${t}`;return Bu(n,e,`${D}${r}`)})}return[]},"parseExportsMap"),M=i((u,e)=>{e.outputPath=G(e.outputPath);const{outputPath:D,type:t,platform:n}=e,r=u[D];if(r){if(r.type!==t)throw new Error(`Conflicting export types "${r.type}" & "${t}" found for ${D}`);if(r.platform!==n)throw new Error(`Conflicting export platforms "${r.platform}" & "${n}" found for ${D}`);Object.assign(r,e)}else u[D]=e},"addExportPath"),xD=i(u=>{const e={},D=u.type??"commonjs";if(u.main){const t=u.main;M(e,{outputPath:t,type:P(t)??D,from:"main"})}if(u.module&&M(e,{outputPath:u.module,type:"module",from:"module"}),u.types&&M(e,{outputPath:u.types,type:"types",from:"types"}),u.bin){const{bin:t}=u;if(typeof t=="string")M(e,{outputPath:t,type:P(t)??D,isExecutable:!0,from:"bin"});else for(const[n,r]of Object.entries(t)){const o=gu(n)?`["${n}"]`:`.${n}`;M(e,{outputPath:r,type:P(r)??D,isExecutable:!0,from:`bin${o}`})}}if(u.exports){const t=Bu(u.exports,D);for(const n of t)M(e,n)}return Object.values(e)},"getExportEntries"),kD=i(u=>{let e=!1;if(u.includes("=")){const[D,t]=u.split("=");u=t,e=D==="bin"||D==="binary"}return{outputPath:G(u),type:P(u),isExecutable:e,from:"cli"}},"parseCliInputFlag"),jD=i(({imports:u},e)=>{const D={};if(u)for(const t in u){if(t.startsWith("#"))continue;const n=u[t];typeof n=="string"&&(D[t]=h.join(e,n))}return D},"getAliases"),{stringify:OD}=JSON,TD=i(async(u,e)=>{for(const D of e){const t=u+D;if(await mu(t))return{extension:D,path:t}}},"tryExtensions"),ae={".d.ts":[".d.ts",".d.mts",".d.cts",".ts",".tsx",".mts",".cts"],".d.mts":[".d.mts",".d.ts",".d.cts",".ts",".tsx",".mts",".cts"],".d.cts":[".d.cts",".d.ts",".d.mts",".ts",".tsx",".mts",".cts"],".js":[".js",".ts",".tsx",".mts",".cts"],".mjs":[".mjs",".js",".cjs",".mts",".cts",".ts",".tsx"],".cjs":[".cjs",".js",".mjs",".mts",".cts",".ts",".tsx"]},SD=Object.keys(ae),PD=i(async(u,e,D)=>{const t=e+u.outputPath.slice(D.length);for(const n of SD)if(u.outputPath.endsWith(n)){const r=await TD(t.slice(0,-n.length),ae[n]);if(r)return{input:r.path,srcExtension:r.extension,distExtension:n}}throw new Error(`Could not find matching source file for export path ${OD(u.outputPath)}`)},"getSourcePath"),_D=["peerDependencies","dependencies","optionalDependencies"],Au="@types/",le=i((u,e,D=!1)=>{const t=[],{devDependencies:n}=u;for(const r of _D){const o=u[r];if(!o)continue;const s=Object.keys(o);for(const a of s)if(!(a in e))if(a.startsWith(Au)){if(D){let l=a.slice(Au.length);l.includes("__")&&(l=`@${l.replace("__","/")}`),t.push(l)}}else{if(n&&D){const l=Au+a.replace("@","").replace("/","__");n[l]&&!(l in o)&&console.warn(`Recommendation: "${l}" is externalized because "${a}" is in "${r}". Place "${l}" in "${r}" as well so users don't have missing types.`)}t.push(a)}}return t.flatMap(r=>[r,new RegExp(`^${r}/`)])},"getExternalDependencies"),ID=i(u=>{const e=Xe(/\.([cm]?[jt]s|[jt]sx)$/);return{name:"esbuild-transform",transform:i(async(D,t)=>{if(!e(t))return null;const n=await Mu(D,{...u,loader:"default",sourcefile:t.replace(/\.[cm]ts/,".ts")});return{code:n.code,map:n.map||null}},"transform")}},"esbuildTransform"),ND=i(u=>{if(u==="es")return"esm";if(u==="cjs"||u==="iife")return u},"getEsbuildFormat"),RD=i(u=>({name:"esbuild-minify",renderChunk:i(async(e,D,t)=>{const n=await Mu(e,{...u,format:ND(t.format),minify:!0,keepNames:!0});return{code:n.code,map:n.map||null}},"renderChunk")}),"esbuildMinify"),yu=i((u,e)=>u[0]-e[0]||u[1]-e[1]||u[2]-e[2],"compareSemver"),ce=i(({target:u})=>{const e=u.some(D=>{if(D=D.trim(),!D.startsWith("node"))return;const t=D.slice(4).split(".").map(Number),n=[t[0],t[1]??0,t[2]??0];return!(yu(n,[12,20,0])>=0&&yu(n,[13,0,0])<0||yu(n,[14,13,1])>=0)});return{name:"externalize-node-builtins",resolveId:i(D=>{const t=D.startsWith("node:");if(e&&t&&(D=D.slice(5)),et.includes(D)||t)return{id:D,external:!0}},"resolveId")}},"externalizeNodeBuiltins"),LD=i(u=>({name:"patch-binary",renderChunk:i((e,D,t)=>{if(!D.isEntry||!D.facadeModuleId)return;const n=t.entryFileNames,r=`./${h.posix.join(t.dir,n(D))}`;if(u.includes(r)){const o=new cu(e);return o.prepend(`#!/usr/bin/env node
23
23
  `),{code:o.toString(),map:t.sourcemap?o.generateMap({hires:!0}):void 0}}},"renderChunk"),writeBundle:i(async(e,D)=>{const t=e.entryFileNames,n=Object.values(D).map(async r=>{const o=r;if(o.isEntry&&o.facadeModuleId){const s=`./${h.posix.join(e.dir,t(o))}`;await S.promises.chmod(s,493)}});await Promise.all(n)},"writeBundle")}),"patchBinary"),fe=i(()=>{const u=/\.(?:[mc]?js|jsx)$/;return{name:"resolve-typescript-mjs-cjs",resolveId(e,D,t){return u.test(e)&&D?this.resolve(e.replace(/js(x?)$/,"ts$1"),D,t):null}}},"resolveTypescriptMjsCts"),Fe=i(u=>u!==null&&typeof u=="object","A"),W=i((u,e)=>Object.assign(new Error(`[${u}]: ${e}`),{code:u}),"a"),Ce="ERR_INVALID_PACKAGE_CONFIG",bu="ERR_INVALID_PACKAGE_TARGET",MD="ERR_PACKAGE_PATH_NOT_EXPORTED",WD=/^\d+$/,UD=/^(\.{1,2}|node_modules)$/i,VD=/\/|\\/;var pe=(u=>(u.Export="exports",u.Import="imports",u))(pe||{});const wu=i((u,e,D,t,n)=>{if(e==null)return[];if(typeof e=="string"){const[r,...o]=e.split(VD);if(r===".."||o.some(s=>UD.test(s)))throw W(bu,`Invalid "${u}" target "${e}" defined in the package config`);return[n?e.replace(/\*/g,n):e]}if(Array.isArray(e))return e.flatMap(r=>wu(u,r,D,t,n));if(Fe(e)){for(const r of Object.keys(e)){if(WD.test(r))throw W(Ce,"Cannot contain numeric property keys");if(r==="default"||t.includes(r))return wu(u,e[r],D,t,n)}return[]}throw W(bu,`Invalid "${u}" target "${e}"`)},"f"),K="*",zD=i((u,e)=>{const D=u.indexOf(K),t=e.indexOf(K);return D===t?e.length>u.length:t>D},"m");function qD(u,e){if(!e.includes(K)&&u.hasOwnProperty(e))return[e];let D,t;for(const n of Object.keys(u))if(n.includes(K)){const[r,o,s]=n.split(K);if(s===void 0&&e.startsWith(r)&&e.endsWith(o)){const a=e.slice(r.length,-o.length||void 0);a&&(!D||zD(D,n))&&(D=n,t=a)}}return[D,t]}i(qD,"d");const JD=i(u=>Object.keys(u).reduce((e,D)=>{const t=D===""||D[0]!==".";if(e===void 0||e===t)return t;throw W(Ce,'"exports" cannot contain some keys starting with "." and some not')},void 0),"p"),GD=/^\w+:/,KD=i((u,e,D)=>{if(!u)throw new Error('"exports" is required');e=e===""?".":`./${e}`,(typeof u=="string"||Array.isArray(u)||Fe(u)&&JD(u))&&(u={".":u});const[t,n]=qD(u,e),r=wu(pe.Export,u[t],e,D,n);if(r.length===0)throw W(MD,e==="."?'No "exports" main defined':`Package subpath '${e}' is not defined by "exports"`);for(const o of r)if(!o.startsWith("./")&&!GD.test(o))throw W(bu,`Invalid "exports" target "${o}" defined in the package config`);return r},"v");var HD=Object.defineProperty,f=i((u,e)=>HD(u,"name",{value:e,configurable:!0}),"o");function k(u){return u.startsWith("\\\\?\\")?u:u.replace(/\\/g,"/")}i(k,"E"),f(k,"slash");const vu=f(u=>{const e=S[u];return(D,...t)=>{const n=`${u}:${t.join(":")}`;let r=D?.get(n);return r===void 0&&(r=Reflect.apply(e,S,t),D?.set(n,r)),r}},"cacheFs"),O=vu("existsSync"),ZD=vu("readFileSync"),Du=vu("statSync"),de=f((u,e,D)=>{for(;;){const t=h.posix.join(u,e);if(O(D,t))return t;const n=h.dirname(u);if(n===u)return;u=n}},"findUp"),$u=/^\.{1,2}(\/.*)?$/,xu=f(u=>{const e=k(u);return $u.test(e)?e:`./${e}`},"normalizeRelativePath");function Ee(u,e=!1){const D=u.length;let t=0,n="",r=0,o=16,s=0,a=0,l=0,C=0,F=0;function c(p,B){let g=0,b=0;for(;g<p;){let w=u.charCodeAt(t);if(w>=48&&w<=57)b=b*16+w-48;else if(w>=65&&w<=70)b=b*16+w-65+10;else if(w>=97&&w<=102)b=b*16+w-97+10;else break;t++,g++}return g<p&&(b=-1),b}i(c,"_"),f(c,"scanHexDigits");function E(p){t=p,n="",r=0,o=16,F=0}i(E,"d"),f(E,"setPosition");function d(){let p=t;if(u.charCodeAt(t)===48)t++;else for(t++;t<u.length&&R(u.charCodeAt(t));)t++;if(t<u.length&&u.charCodeAt(t)===46)if(t++,t<u.length&&R(u.charCodeAt(t)))for(t++;t<u.length&&R(u.charCodeAt(t));)t++;else return F=3,u.substring(p,t);let B=t;if(t<u.length&&(u.charCodeAt(t)===69||u.charCodeAt(t)===101))if(t++,(t<u.length&&u.charCodeAt(t)===43||u.charCodeAt(t)===45)&&t++,t<u.length&&R(u.charCodeAt(t))){for(t++;t<u.length&&R(u.charCodeAt(t));)t++;B=t}else F=3;return u.substring(p,B)}i(d,"A"),f(d,"scanNumber");function m(){let p="",B=t;for(;;){if(t>=D){p+=u.substring(B,t),F=2;break}const g=u.charCodeAt(t);if(g===34){p+=u.substring(B,t),t++;break}if(g===92){if(p+=u.substring(B,t),t++,t>=D){F=2;break}switch(u.charCodeAt(t++)){case 34:p+='"';break;case 92:p+="\\";break;case 47:p+="/";break;case 98:p+="\b";break;case 102:p+="\f";break;case 110:p+=`
24
24
  `;break;case 114:p+="\r";break;case 116:p+=" ";break;case 117:const b=c(4);b>=0?p+=String.fromCharCode(b):F=4;break;default:F=5}B=t;continue}if(g>=0&&g<=31)if(U(g)){p+=u.substring(B,t),F=2;break}else F=6;t++}return p}i(m,"w"),f(m,"scanString");function y(){if(n="",F=0,r=t,a=s,C=l,t>=D)return r=D,o=17;let p=u.charCodeAt(t);if(nu(p)){do t++,n+=String.fromCharCode(p),p=u.charCodeAt(t);while(nu(p));return o=15}if(U(p))return t++,n+=String.fromCharCode(p),p===13&&u.charCodeAt(t)===10&&(t++,n+=`
25
25
  `),s++,l=t,o=14;switch(p){case 123:return t++,o=1;case 125:return t++,o=2;case 91:return t++,o=3;case 93:return t++,o=4;case 58:return t++,o=6;case 44:return t++,o=5;case 34:return t++,n=m(),o=10;case 47:const B=t-1;if(u.charCodeAt(t+1)===47){for(t+=2;t<D&&!U(u.charCodeAt(t));)t++;return n=u.substring(B,t),o=12}if(u.charCodeAt(t+1)===42){t+=2;const g=D-1;let b=!1;for(;t<g;){const w=u.charCodeAt(t);if(w===42&&u.charCodeAt(t+1)===47){t+=2,b=!0;break}t++,U(w)&&(w===13&&u.charCodeAt(t)===10&&t++,s++,l=t)}return b||(t++,F=1),n=u.substring(B,t),o=13}return n+=String.fromCharCode(p),t++,o=16;case 45:if(n+=String.fromCharCode(p),t++,t===D||!R(u.charCodeAt(t)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return n+=d(),o=11;default:for(;t<D&&j(p);)t++,p=u.charCodeAt(t);if(r!==t){switch(n=u.substring(r,t),n){case"true":return o=8;case"false":return o=9;case"null":return o=7}return o=16}return n+=String.fromCharCode(p),t++,o=16}}i(y,"y"),f(y,"scanNext");function j(p){if(nu(p)||U(p))return!1;switch(p){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}i(j,"I"),f(j,"isUnknownContentCharacter");function $(){let p;do p=y();while(p>=12&&p<=15);return p}return i($,"L"),f($,"scanNextNonTrivia"),{setPosition:E,getPosition:f(()=>t,"getPosition"),scan:e?$:y,getToken:f(()=>o,"getToken"),getTokenValue:f(()=>n,"getTokenValue"),getTokenOffset:f(()=>r,"getTokenOffset"),getTokenLength:f(()=>t-r,"getTokenLength"),getTokenStartLine:f(()=>a,"getTokenStartLine"),getTokenStartCharacter:f(()=>r-C,"getTokenStartCharacter"),getTokenError:f(()=>F,"getTokenError")}}i(Ee,"je"),f(Ee,"createScanner");function nu(u){return u===32||u===9}i(nu,"H"),f(nu,"isWhiteSpace");function U(u){return u===10||u===13}i(U,"N"),f(U,"isLineBreak");function R(u){return u>=48&&u<=57}i(R,"h"),f(R,"isDigit");var he;(function(u){u[u.lineFeed=10]="lineFeed",u[u.carriageReturn=13]="carriageReturn",u[u.space=32]="space",u[u._0=48]="_0",u[u._1=49]="_1",u[u._2=50]="_2",u[u._3=51]="_3",u[u._4=52]="_4",u[u._5=53]="_5",u[u._6=54]="_6",u[u._7=55]="_7",u[u._8=56]="_8",u[u._9=57]="_9",u[u.a=97]="a",u[u.b=98]="b",u[u.c=99]="c",u[u.d=100]="d",u[u.e=101]="e",u[u.f=102]="f",u[u.g=103]="g",u[u.h=104]="h",u[u.i=105]="i",u[u.j=106]="j",u[u.k=107]="k",u[u.l=108]="l",u[u.m=109]="m",u[u.n=110]="n",u[u.o=111]="o",u[u.p=112]="p",u[u.q=113]="q",u[u.r=114]="r",u[u.s=115]="s",u[u.t=116]="t",u[u.u=117]="u",u[u.v=118]="v",u[u.w=119]="w",u[u.x=120]="x",u[u.y=121]="y",u[u.z=122]="z",u[u.A=65]="A",u[u.B=66]="B",u[u.C=67]="C",u[u.D=68]="D",u[u.E=69]="E",u[u.F=70]="F",u[u.G=71]="G",u[u.H=72]="H",u[u.I=73]="I",u[u.J=74]="J",u[u.K=75]="K",u[u.L=76]="L",u[u.M=77]="M",u[u.N=78]="N",u[u.O=79]="O",u[u.P=80]="P",u[u.Q=81]="Q",u[u.R=82]="R",u[u.S=83]="S",u[u.T=84]="T",u[u.U=85]="U",u[u.V=86]="V",u[u.W=87]="W",u[u.X=88]="X",u[u.Y=89]="Y",u[u.Z=90]="Z",u[u.asterisk=42]="asterisk",u[u.backslash=92]="backslash",u[u.closeBrace=125]="closeBrace",u[u.closeBracket=93]="closeBracket",u[u.colon=58]="colon",u[u.comma=44]="comma",u[u.dot=46]="dot",u[u.doubleQuote=34]="doubleQuote",u[u.minus=45]="minus",u[u.openBrace=123]="openBrace",u[u.openBracket=91]="openBracket",u[u.plus=43]="plus",u[u.slash=47]="slash",u[u.formFeed=12]="formFeed",u[u.tab=9]="tab"})(he||(he={})),new Array(20).fill(0).map((u,e)=>" ".repeat(e));const V=200;new Array(V).fill(0).map((u,e)=>`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pkgroll",
3
- "version": "2.10.0",
3
+ "version": "2.11.0",
4
4
  "description": "Zero-config rollup bundler",
5
5
  "keywords": [
6
6
  "zero config",