@turbo/gen 2.9.11-canary.7 → 2.9.11
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/cli.js +1 -1
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -122,7 +122,7 @@ For faster downloads, install git: https://git-scm.com/downloads`),await sv({url
|
|
|
122
122
|
`;function n(e,i){var a=[],s=``;typeof i==`string`?i={section:i,whitespace:!1}:(i||={},i.whitespace=i.whitespace===!0);var c=i.whitespace?` = `:`=`;return Object.keys(e).forEach(function(n,r,i){var l=e[n];l&&Array.isArray(l)?l.forEach(function(e){s+=o(n+`[]`)+c+o(e)+`
|
|
123
123
|
`}):l&&typeof l==`object`?a.push(n):s+=o(n)+c+o(l)+t}),i.section&&s.length&&(s=`[`+o(i.section)+`]`+t+s),a.forEach(function(a,o,c){var l=r(a).join(`\\.`),u=(i.section?i.section+`.`:``)+l,d=n(e[a],{section:u,whitespace:i.whitespace});s.length&&d.length&&(s+=t),s+=d}),s}function r(e){return e.replace(/\1/g,`LITERAL\\1LITERAL`).replace(/\\\./g,``).split(/\./).map(function(e){return e.replace(/\1/g,`\\.`).replace(/\2LITERAL\\1LITERAL\2/g,``)})}function i(e){var t={},n=t,i=null,a=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=e.split(/[\r\n]+/g);return o.forEach(function(e,r,o){if(!(!e||e.match(/^\s*[;#]/))){var c=e.match(a);if(c){if(c[1]!==void 0){if(i=s(c[1]),i===`__proto__`){n={};return}n=t[i]=t[i]||{};return}var l=s(c[2]);if(l!==`__proto__`){var u=c[3]?s(c[4]):!0;switch(u){case`true`:case`false`:case`null`:u=JSON.parse(u)}if(l.length>2&&l.slice(-2)===`[]`){if(l=l.substring(0,l.length-2),l===`__proto__`)return;n[l]?Array.isArray(n[l])||(n[l]=[n[l]]):n[l]=[]}Array.isArray(n[l])?n[l].push(u):n[l]=u}}}}),Object.keys(t).filter(function(e,n,i){if(!t[e]||typeof t[e]!=`object`||Array.isArray(t[e]))return!1;var a=r(e),o=t,s=a.pop(),c=s.replace(/\\\./g,`.`);return a.forEach(function(e,t,n){e!==`__proto__`&&((!o[e]||typeof o[e]!=`object`)&&(o[e]={}),o=o[e])}),o===t&&c===s?!1:(o[c]=t[e],!0)}).forEach(function(e,n,r){delete t[e]}),t}function a(e){return e.charAt(0)===`"`&&e.slice(-1)===`"`||e.charAt(0)===`'`&&e.slice(-1)===`'`}function o(e){return typeof e!=`string`||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&a(e)||e!==e.trim()?JSON.stringify(e):e.replace(/;/g,`\\;`).replace(/#/g,`\\#`)}function s(e,t){if(e=(e||``).trim(),a(e)){e.charAt(0)===`'`&&(e=e.substr(1,e.length-2));try{e=JSON.parse(e)}catch{}}else{for(var n=!1,r=``,i=0,o=e.length;i<o;i++){var s=e.charAt(i);if(n)`\\;#`.indexOf(s)===-1?r+=`\\`+s:r+=s,n=!1;else if(`;#`.indexOf(s)!==-1)break;else s===`\\`?n=!0:r+=s}return n&&(r+=`\\`),r.trim()}return e}}),Ev=e.__commonJSMin((exports,t)=>{var n=1,r=2;function i(){return``}function a(e,t,n){return e.slice(t,n).replace(/\S/g,` `)}t.exports=function(e,t){t||={};for(var o,s,c=!1,l=!1,u=0,d=``,f=t.whitespace===!1?i:a,p=0;p<e.length;p++){if(o=e[p],s=e[p+1],!l&&o===`"`){var m=e[p-1]===`\\`&&e[p-2]!==`\\`;m||(c=!c)}if(!c){if(!l&&o+s===`//`)d+=e.slice(u,p),u=p,l=n,p++;else if(l===n&&o+s===`\r
|
|
124
124
|
`){p++,l=!1,d+=f(e,u,p),u=p;continue}else if(l===n&&o===`
|
|
125
|
-
`)l=!1,d+=f(e,u,p),u=p;else if(!l&&o+s===`/*`){d+=e.slice(u,p),u=p,l=r,p++;continue}else if(l===r&&o+s===`*/`){p++,l=!1,d+=f(e,u,p+1),u=p+1;continue}}}return d+(l?f(e.substr(u)):e.substr(u))}}),Dv=e.__commonJSMin(exports=>{var t=require(`fs`),n=Tv(),r=require(`path`),i=Ev(),a=exports.parse=function(e){return/^\s*{/.test(e)?JSON.parse(i(e)):n.parse(e)},o=exports.file=function(){var e=[].slice.call(arguments).filter(function(e){return e!=null});for(var n in e)if(typeof e[n]!=`string`)return;var i=r.join.apply(null,e),a;try{return t.readFileSync(i,`utf-8`)}catch{return}},s=exports.json=function(){var e=o.apply(null,arguments);return e?a(e):null},c=exports.env=function(e,t){t||=process.env;var n={},r=e.length;for(var i in t)if(i.toLowerCase().indexOf(e.toLowerCase())===0){for(var a=i.substring(r).split(`__`),o;(o=a.indexOf(``))>-1;)a.splice(o,1);var s=n;a.forEach(function(e,n){!e||typeof s!=`object`||(n===a.length-1&&(s[e]=t[i]),s[e]===void 0&&(s[e]={}),s=s[e])})}return n},l=exports.find=function(){var e=r.join.apply(null,[].slice.call(arguments));function n(e,i){var a=r.join(e,i);try{return t.statSync(a),a}catch{if(r.dirname(e)!==e)return n(r.dirname(e),i)}}return n(process.cwd(),e)}}),Ov=e.__commonJSMin((exports,t)=>{function n(e){return e instanceof Buffer||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof Buffer){var t=Buffer.alloc?Buffer.alloc(e.length):new Buffer(e.length);return e.copy(t),t}else if(e instanceof Date)return new Date(e.getTime());else if(e instanceof RegExp)return new RegExp(e);else throw Error(`Unexpected situation`)}function i(e){var t=[];return e.forEach(function(e,a){typeof e==`object`&&e?Array.isArray(e)?t[a]=i(e):n(e)?t[a]=r(e):t[a]=o({},e):t[a]=e}),t}function a(e,t){return t===`__proto__`?void 0:e[t]}var o=t.exports=function(){if(arguments.length<1||typeof arguments[0]!=`object`)return!1;if(arguments.length<2)return arguments[0];var e=arguments[0],t=Array.prototype.slice.call(arguments,1),s,c,l;return t.forEach(function(t){typeof t!=`object`||!t||Array.isArray(t)||Object.keys(t).forEach(function(l){if(c=a(e,l),s=a(t,l),s!==e)if(typeof s!=`object`||!s){e[l]=s;return}else if(Array.isArray(s)){e[l]=i(s);return}else if(n(s)){e[l]=r(s);return}else if(typeof c!=`object`||!c||Array.isArray(c)){e[l]=o({},s);return}else{e[l]=o(c,s);return}})}),e}}),kv=e.__commonJSMin((exports,t)=>{function n(e,t){var n=e;t.slice(0,-1).forEach(function(e){n=n[e]||{}});var r=t[t.length-1];return r in n}function r(e){return typeof e==`number`||/^0x[0-9a-f]+$/i.test(e)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function i(e,t){return t===`constructor`&&typeof e[t]==`function`||t===`__proto__`}t.exports=function(e,t){t||={};var a={bools:{},strings:{},unknownFn:null};typeof t.unknown==`function`&&(a.unknownFn=t.unknown),typeof t.boolean==`boolean`&&t.boolean?a.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(e){a.bools[e]=!0});var o={};function s(e){return o[e].some(function(e){return a.bools[e]})}Object.keys(t.alias||{}).forEach(function(e){o[e]=[].concat(t.alias[e]),o[e].forEach(function(t){o[t]=[e].concat(o[e].filter(function(e){return t!==e}))})}),[].concat(t.string).filter(Boolean).forEach(function(e){a.strings[e]=!0,o[e]&&[].concat(o[e]).forEach(function(e){a.strings[e]=!0})});var c=t.default||{},l={_:[]};function u(e,t){return a.allBools&&/^--[^=]+$/.test(t)||a.strings[e]||a.bools[e]||o[e]}function d(e,t,n){for(var r=e,o=0;o<t.length-1;o++){var s=t[o];if(i(r,s))return;r[s]===void 0&&(r[s]={}),(r[s]===Object.prototype||r[s]===Number.prototype||r[s]===String.prototype)&&(r[s]={}),r[s]===Array.prototype&&(r[s]=[]),r=r[s]}var c=t[t.length-1];i(r,c)||((r===Object.prototype||r===Number.prototype||r===String.prototype)&&(r={}),r===Array.prototype&&(r=[]),r[c]===void 0||a.bools[c]||typeof r[c]==`boolean`?r[c]=n:Array.isArray(r[c])?r[c].push(n):r[c]=[r[c],n])}function f(e,t,n){if(!(n&&a.unknownFn&&!u(e,n)&&a.unknownFn(n)===!1)){var i=!a.strings[e]&&r(t)?Number(t):t;d(l,e.split(`.`),i),(o[e]||[]).forEach(function(e){d(l,e.split(`.`),i)})}}Object.keys(a.bools).forEach(function(e){f(e,c[e]===void 0?!1:c[e])});var p=[];e.indexOf(`--`)!==-1&&(p=e.slice(e.indexOf(`--`)+1),e=e.slice(0,e.indexOf(`--`)));for(var m=0;m<e.length;m++){var h=e[m],g,_;if(/^--.+=/.test(h)){var v=h.match(/^--([^=]+)=([\s\S]*)$/);g=v[1];var y=v[2];a.bools[g]&&(y=y!==`false`),f(g,y,h)}else if(/^--no-.+/.test(h))g=h.match(/^--no-(.+)/)[1],f(g,!1,h);else if(/^--.+/.test(h))g=h.match(/^--(.+)/)[1],_=e[m+1],_!==void 0&&!/^(-|--)[^-]/.test(_)&&!a.bools[g]&&!a.allBools&&(!o[g]||!s(g))?(f(g,_,h),m+=1):/^(true|false)$/.test(_)?(f(g,_===`true`,h),m+=1):f(g,a.strings[g]?``:!0,h);else if(/^-[^-]+/.test(h)){for(var b=h.slice(1,-1).split(``),x=!1,S=0;S<b.length;S++){if(_=h.slice(S+2),_===`-`){f(b[S],_,h);continue}if(/[A-Za-z]/.test(b[S])&&_[0]===`=`){f(b[S],_.slice(1),h),x=!0;break}if(/[A-Za-z]/.test(b[S])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(_)){f(b[S],_,h),x=!0;break}if(b[S+1]&&b[S+1].match(/\W/)){f(b[S],h.slice(S+2),h),x=!0;break}else f(b[S],a.strings[b[S]]?``:!0,h)}g=h.slice(-1)[0],!x&&g!==`-`&&(e[m+1]&&!/^(-|--)[^-]/.test(e[m+1])&&!a.bools[g]&&(!o[g]||!s(g))?(f(g,e[m+1],h),m+=1):e[m+1]&&/^(true|false)$/.test(e[m+1])?(f(g,e[m+1]===`true`,h),m+=1):f(g,a.strings[g]?``:!0,h))}else if((!a.unknownFn||a.unknownFn(h)!==!1)&&l._.push(a.strings._||!r(h)?h:Number(h)),t.stopEarly){l._.push.apply(l._,e.slice(m+1));break}}return Object.keys(c).forEach(function(e){n(l,e.split(`.`))||(d(l,e.split(`.`),c[e]),(o[e]||[]).forEach(function(t){d(l,t.split(`.`),c[e])}))}),t[`--`]?l[`--`]=p.slice():p.forEach(function(e){l._.push(e)}),l}}),Av=e.__commonJSMin((exports,t)=>{var n=Dv(),r=require(`path`).join,i=Ov(),a=`/etc`,o=process.platform===`win32`,s=o?process.env.USERPROFILE:process.env.HOME;t.exports=function(e,t,c,l){if(typeof e!=`string`)throw Error(`rc(name): name *must* be string`);c||=kv()(process.argv.slice(2)),t=(typeof t==`string`?n.json(t):t)||{},l||=n.parse;var u=n.env(e+`_`),d=[t],f=[];function p(e){if(!(f.indexOf(e)>=0)){var t=n.file(e);t&&(d.push(l(t)),f.push(e))}}return o||[r(a,e,`config`),r(a,e+`rc`)].forEach(p),s&&[r(s,`.config`,e,`config`),r(s,`.config`,e),r(s,`.`+e,`config`),r(s,`.`+e+`rc`)].forEach(p),p(n.find(`.`+e+`rc`)),u.config&&p(u.config),c.config&&p(c.config),i.apply(null,d.concat([u,c,f.length?{configs:f,config:f[f.length-1]}:void 0]))}}),jv=e.__commonJSMin((exports,t)=>{t.exports=function(e){var t=Av()(`npm`,{registry:`https://registry.npmjs.org/`}),n=t[e+`:registry`]||t.registry;return n.slice(-1)===`/`?n:n+`/`}}),Mv=e.__commonJSMin((exports,t)=>{var n=require(`buffer`),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,exports),exports.Buffer=a);function a(e,t,n){return r(e,t,n)}a.prototype=Object.create(r.prototype),i(r,a),a.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return r(e,t,n)},a.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var i=r(e);return t===void 0?i.fill(0):typeof n==`string`?i.fill(t,n):i.fill(t),i},a.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r(e)},a.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return n.SlowBuffer(e)}}),Nv=e.__commonJSMin((exports,t)=>{let n=Mv().Buffer;function r(e){return n.from(e,`base64`).toString(`utf8`)}function i(e){return n.from(e,`utf8`).toString(`base64`)}t.exports={decodeBase64:r,encodeBase64:i}}),Pv=e.__commonJSMin((exports,t)=>{var n=require(`url`),r=Nv(),i=r.decodeBase64,a=r.encodeBase64,o=`:_authToken`,s=`:username`,c=`:_password`;t.exports=function(){var e,t;return arguments.length>=2?(e=arguments[0],t=arguments[1]):typeof arguments[0]==`string`?e=arguments[0]:t=arguments[0],t||={},t.npmrc=t.npmrc||Av()(`npm`,{registry:`https://registry.npmjs.org/`}),e||=t.npmrc.registry,l(e,t)||u(t.npmrc)};function l(e,t){for(var r=n.parse(e,!1,!0),i;i!==`/`&&r.pathname!==i;){i=r.pathname||`/`;var a=`//`+r.host+i.replace(/\/$/,``),o=f(a,t.npmrc);if(o)return o;if(!t.recursive)return/\/$/.test(e)?void 0:l(n.resolve(e,`.`),t);r.pathname=n.resolve(d(i),`..`)||`/`}}function u(e){if(e._auth)return{token:e._auth,type:`Basic`}}function d(e){return e[e.length-1]===`/`?e:e+`/`}function f(e,t){var n=p(t[e+o]||t[e+`/`+o]);if(n)return n;var r=t[e+s]||t[e+`/`+s],i=t[e+c]||t[e+`/`+c],a=m(r,i);if(a)return a}function p(e){if(e){var t=e.replace(/^\$\{?([^}]*)\}?$/,function(e,t){return process.env[t]});return{token:t,type:`Bearer`}}}function m(e,t){if(!(!e||!t)){var n=i(t.replace(/^\$\{?([^}]*)\}?$/,function(e,t){return process.env[t]})),r=a(e+`:`+n);return{token:r,type:`Basic`,password:n,username:e}}}}),Fv=e.__commonJSMin((exports,t)=>{let{URL:n}=require(`url`),{join:r}=require(`path`),i=require(`fs`),{promisify:a}=require(`util`),{tmpdir:o}=require(`os`),s=jv(),c=a(i.writeFile),l=a(i.mkdir),u=a(i.readFile),d=(e,t)=>e.localeCompare(t,`en-US`,{numeric:!0}),f=e=>encodeURIComponent(e).replace(/^%40/,`@`),p=async(e,t)=>{let n=o(),a=r(n,`update-check`);i.existsSync(a)||await l(a);let s=`${e.name}-${t}.json`;return e.scope&&(s=`${e.scope}-${s}`),r(a,s)},m=async(e,t,n)=>{if(i.existsSync(e)){let r=await u(e,`utf8`),{lastUpdate:i,latest:a}=JSON.parse(r),o=i+n;if(o>t)return{shouldCheck:!1,latest:a}}return{shouldCheck:!0,latest:null}},h=async(e,t,n)=>{let r=JSON.stringify({latest:t,lastUpdate:n});await c(e,r,`utf8`)},g=(e,t)=>new Promise((n,r)=>{let i={host:e.hostname,path:e.pathname,port:e.port,headers:{accept:`application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`},timeout:2e3};t&&(i.headers.authorization=`${t.type} ${t.token}`);let{get:a}=e.protocol===`https:`?require(`https`):require(`http`);a(i,e=>{let{statusCode:t}=e;if(t!==200){let n=Error(`Request failed with code ${t}`);n.code=t,r(n),e.resume();return}let i=``;e.setEncoding(`utf8`),e.on(`data`,e=>{i+=e}),e.on(`end`,()=>{try{let e=JSON.parse(i);n(e)}catch(e){r(e)}})}).on(`error`,r).on(`timeout`,r)}),_=async({full:e,scope:t},r)=>{let i=s(t),a=new n(e,i),o=null;try{o=await g(a)}catch(e){if(e.code&&String(e.code).startsWith(4)){let e=Pv(),t=e(i,{recursive:!0});o=await g(a,t)}else throw e}let c=o[`dist-tags`][r];if(!c)throw Error(`Distribution tag ${r} is not available`);return c},v={interval:36e5,distTag:`latest`},y=e=>{let t={full:f(e)};if(e.includes(`/`)){let n=e.split(`/`);t.scope=n[0],t.name=n[1]}else t.scope=null,t.name=e;return t};t.exports=async(e,t)=>{if(typeof e!=`object`)throw Error(`The first parameter should be your package.json file content`);let n=y(e.name),r=Date.now(),{distTag:i,interval:a}=Object.assign({},v,t),o=await p(n,i),s=null,c=!0;({shouldCheck:c,latest:s}=await m(o,r,a)),c&&(s=await _(n,i),await h(o,s,r));let l=d(e.version,s);return l===-1?{latest:s,fromCache:!c}:null}}),Iv=e.__toESM(M()),Lv=e.__toESM(Fv());function Rv(e){let{packageInfo:t,upgradeCommand:n}=e,r=(0,Lv.default)(t).catch(()=>null);return async function(e=0){try{let i=await r;if(i?.latest){pc(),pc(Iv.default.yellow(Iv.default.bold(`A new version of \`${t.name}\` is available!`)));let e=typeof n==`function`?await n():n;e&&pc(`You can update by running: ${Iv.default.cyan(e)}`),pc()}process.exit(e)}catch(t){process.env.DEBUG&&hc(`Update check failed:`,t),process.exit(e)}}}const zv=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,Bv=typeof AbortController==`function`,Vv=Bv?AbortController:class{constructor(){this.signal=new Wv}abort(e=Error(`This operation was aborted`)){this.signal.reason=this.signal.reason||e,this.signal.aborted=!0,this.signal.dispatchEvent({type:`abort`,target:this.signal})}},Hv=typeof AbortSignal==`function`,Uv=typeof Vv.AbortSignal==`function`,Wv=Hv?AbortSignal:Uv?Vv.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type===`abort`&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(t=>t(e),this))}onabort(){}addEventListener(e,t){e===`abort`&&this._listeners.push(t)}removeEventListener(e,t){e===`abort`&&(this._listeners=this._listeners.filter(e=>e!==t))}},Gv=new Set,Kv=(e,t)=>{let n=`LRU_CACHE_OPTION_${e}`;Xv(n)&&Zv(n,`${e} option`,`options.${t}`,ny)},qv=(e,t)=>{let n=`LRU_CACHE_METHOD_${e}`;if(Xv(n)){let{prototype:r}=ny,{get:i}=Object.getOwnPropertyDescriptor(r,e);Zv(n,`${e} method`,`cache.${t}()`,i)}},Jv=(e,t)=>{let n=`LRU_CACHE_PROPERTY_${e}`;if(Xv(n)){let{prototype:r}=ny,{get:i}=Object.getOwnPropertyDescriptor(r,e);Zv(n,`${e} property`,`cache.${t}`,i)}},Yv=(...e)=>{typeof process==`object`&&process&&typeof process.emitWarning==`function`?process.emitWarning(...e):console.error(...e)},Xv=e=>!Gv.has(e),Zv=(e,t,n,r)=>{Gv.add(e);let i=`The ${t} is deprecated. Please use ${n} instead.`;Yv(i,`DeprecationWarning`,e,r)},Qv=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),$v=e=>Qv(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?ey:null:null;var ey=class extends Array{constructor(e){super(e),this.fill(0)}},ty=class{constructor(e){if(e===0)return[];let t=$v(e);this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},ny=class e{constructor(t={}){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:m=0,sizeCalculation:h,fetchMethod:g,fetchContext:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:x,ignoreFetchAbort:S}=t,{length:C,maxAge:w,stale:T}=t instanceof e?{}:t;if(n!==0&&!Qv(n))throw TypeError(`max option must be a nonnegative integer`);let E=n?$v(n):Array;if(!E)throw Error(`invalid max value: `+n);if(this.max=n,this.maxSize=p,this.maxEntrySize=m||this.maxSize,this.sizeCalculation=h||C,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(this.fetchMethod=g||null,this.fetchMethod&&typeof this.fetchMethod!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.fetchContext=_,!this.fetchMethod&&_!==void 0)throw TypeError(`cannot set fetchContext without fetchMethod`);if(this.keyMap=new Map,this.keyList=Array(n).fill(null),this.valList=Array(n).fill(null),this.next=new E(n),this.prev=new E(n),this.head=0,this.tail=0,this.free=new ty(n),this.initialFill=1,this.size=0,typeof l==`function`&&(this.dispose=l),typeof u==`function`?(this.disposeAfter=u,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!x,this.ignoreFetchAbort=!!S,this.maxEntrySize!==0){if(this.maxSize!==0&&!Qv(this.maxSize))throw TypeError(`maxSize must be a positive integer if specified`);if(!Qv(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.initializeSizeTracking()}if(this.allowStale=!!c||!!T,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=Qv(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=r||w||0,this.ttl){if(!Qv(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let t=`LRU_CACHE_UNBOUNDED`;if(Xv(t)){Gv.add(t);let n=`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`;Yv(n,`UnboundedCacheWarning`,t,e)}}T&&Kv(`stale`,`allowStale`),w&&Kv(`maxAge`,`ttl`),C&&Kv(`length`,`sizeCalculation`)}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new ey(this.max),this.starts=new ey(this.max),this.setItemTTL=(e,t,n=zv.now())=>{if(this.starts[e]=t===0?0:n,this.ttls[e]=t,t!==0&&this.ttlAutopurge){let n=setTimeout(()=>{this.isStale(e)&&this.delete(this.keyList[e])},t+1);n.unref&&n.unref()}},this.updateItemAge=e=>{this.starts[e]=this.ttls[e]===0?0:zv.now()},this.statusTTL=(n,r)=>{n&&(n.ttl=this.ttls[r],n.start=this.starts[r],n.now=e||t(),n.remainingTTL=n.now+n.ttl-n.start)};let e=0,t=()=>{let t=zv.now();if(this.ttlResolution>0){e=t;let n=setTimeout(()=>e=0,this.ttlResolution);n.unref&&n.unref()}return t};this.getRemainingTTL=n=>{let r=this.keyMap.get(n);return r===void 0?0:this.ttls[r]===0||this.starts[r]===0?1/0:this.starts[r]+this.ttls[r]-(e||t())},this.isStale=n=>this.ttls[n]!==0&&this.starts[n]!==0&&(e||t())-this.starts[n]>this.ttls[n]}updateItemAge(e){}statusTTL(e,t){}setItemTTL(e,t,n){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new ey(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,t,n,r)=>{if(this.isBackgroundFetch(t))return 0;if(!Qv(n))if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!Qv(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`);return n},this.addItemSize=(e,t,n)=>{if(this.sizes[e]=t,this.maxSize){let t=this.maxSize-this.sizes[e];for(;this.calculatedSize>t;)this.evict(!0)}this.calculatedSize+=this.sizes[e],n&&(n.entrySize=t,n.totalCalculatedSize=this.calculatedSize)}}removeItemSize(e){}addItemSize(e,t){}requireSize(e,t,n,r){if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`)}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.tail;!(!this.isValidIndex(t)||((e||!this.isStale(t))&&(yield t),t===this.head));)t=this.prev[t]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.head;!(!this.isValidIndex(t)||((e||!this.isStale(t))&&(yield t),t===this.tail));)t=this.next[t]}isValidIndex(e){return e!==void 0&&this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*rentries(){for(let e of this.rindexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*keys(){for(let e of this.indexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*rkeys(){for(let e of this.rindexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*values(){for(let e of this.indexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}*rvalues(){for(let e of this.rindexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,t){for(let n of this.indexes()){let r=this.valList[n],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;if(e(i,this.keyList[n],this))return this.get(this.keyList[n],t)}}forEach(e,t=this){for(let n of this.indexes()){let r=this.valList[n],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;e.call(t,i,this.keyList[n],this)}}rforEach(e,t=this){for(let n of this.rindexes()){let r=this.valList[n],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;e.call(t,i,this.keyList[n],this)}}get prune(){return qv(`prune`,`purgeStale`),this.purgeStale}purgeStale(){let e=!1;for(let t of this.rindexes({allowStale:!0}))this.isStale(t)&&(this.delete(this.keyList[t]),e=!0);return e}dump(){let e=[];for(let t of this.indexes({allowStale:!0})){let n=this.keyList[t],r=this.valList[t],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;let a={value:i};if(this.ttls){a.ttl=this.ttls[t];let e=zv.now()-this.starts[t];a.start=Math.floor(Date.now()-e)}this.sizes&&(a.size=this.sizes[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=zv.now()-e}this.set(t,n.value,n)}}dispose(e,t,n){}set(e,t,{ttl:n=this.ttl,start:r,noDisposeOnSet:i=this.noDisposeOnSet,size:a=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:s=this.noUpdateTTL,status:c}={}){if(a=this.requireSize(e,t,a,o),this.maxEntrySize&&a>this.maxEntrySize)return c&&(c.set=`miss`,c.maxEntrySizeExceeded=!0),this.delete(e),this;let l=this.size===0?void 0:this.keyMap.get(e);if(l===void 0)l=this.newIndex(),this.keyList[l]=e,this.valList[l]=t,this.keyMap.set(e,l),this.next[this.tail]=l,this.prev[l]=this.tail,this.tail=l,this.size++,this.addItemSize(l,a,c),c&&(c.set=`add`),s=!1;else{this.moveToTail(l);let n=this.valList[l];if(t!==n){if(this.isBackgroundFetch(n)?n.__abortController.abort(Error(`replaced`)):i||(this.dispose(n,e,`set`),this.disposeAfter&&this.disposed.push([n,e,`set`])),this.removeItemSize(l),this.valList[l]=t,this.addItemSize(l,a,c),c){c.set=`replace`;let e=n&&this.isBackgroundFetch(n)?n.__staleWhileFetching:n;e!==void 0&&(c.oldValue=e)}}else c&&(c.set=`update`)}if(n!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),s||this.setItemTTL(l,n,r),this.statusTTL(c,l),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length===0?this.initialFill++:this.free.pop()}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let t=this.head,n=this.keyList[t],r=this.valList[t];return this.isBackgroundFetch(r)?r.__abortController.abort(Error(`evicted`)):(this.dispose(r,n,`evict`),this.disposeAfter&&this.disposed.push([r,n,`evict`])),this.removeItemSize(t),e&&(this.keyList[t]=null,this.valList[t]=null,this.free.push(t)),this.head=this.next[t],this.keyMap.delete(n),this.size--,t}has(e,{updateAgeOnHas:t=this.updateAgeOnHas,status:n}={}){let r=this.keyMap.get(e);if(r!==void 0)if(this.isStale(r))n&&(n.has=`stale`,this.statusTTL(n,r));else return t&&this.updateItemAge(r),n&&(n.has=`hit`),this.statusTTL(n,r),!0;else n&&(n.has=`miss`);return!1}peek(e,{allowStale:t=this.allowStale}={}){let n=this.keyMap.get(e);if(n!==void 0&&(t||!this.isStale(n))){let e=this.valList[n];return this.isBackgroundFetch(e)?e.__staleWhileFetching:e}}backgroundFetch(e,t,n,r){let i=t===void 0?void 0:this.valList[t];if(this.isBackgroundFetch(i))return i;let a=new Vv;n.signal&&n.signal.addEventListener(`abort`,()=>a.abort(n.signal.reason));let o={signal:a.signal,options:n,context:r},s=(r,i=!1)=>{let{aborted:s}=a.signal,c=n.ignoreFetchAbort&&r!==void 0;return n.status&&(s&&!i?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),s&&!c&&!i?l(a.signal.reason):(this.valList[t]===d&&(r===void 0?d.__staleWhileFetching?this.valList[t]=d.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,o.options))),r)},c=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),l(e)),l=r=>{let{aborted:i}=a.signal,o=i&&n.allowStaleOnFetchAbort,s=o||n.allowStaleOnFetchRejection,c=s||n.noDeleteOnFetchRejection;if(this.valList[t]===d){let n=!c||d.__staleWhileFetching===void 0;n?this.delete(e):o||(this.valList[t]=d.__staleWhileFetching)}if(s)return n.status&&d.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),d.__staleWhileFetching;if(d.__returned===d)throw r},u=(t,r)=>{this.fetchMethod(e,i,o).then(e=>t(e),r),a.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(),n.allowStaleOnFetchAbort&&(t=e=>s(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let d=new Promise(u).then(s,c);return d.__abortController=a,d.__staleWhileFetching=i,d.__returned=null,t===void 0?(this.set(e,d,{...o.options,status:void 0}),t=this.keyMap.get(e)):this.valList[t]=d,d}isBackgroundFetch(e){return e&&typeof e==`object`&&typeof e.then==`function`&&Object.prototype.hasOwnProperty.call(e,`__staleWhileFetching`)&&Object.prototype.hasOwnProperty.call(e,`__returned`)&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:o=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,fetchContext:p=this.fetchContext,forceRefresh:m=!1,status:h,signal:g}={}){if(!this.fetchMethod)return h&&(h.fetch=`get`),this.get(e,{allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r,status:h});let _={allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:i,noDisposeOnSet:a,size:o,sizeCalculation:s,noUpdateTTL:c,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:f,ignoreFetchAbort:d,status:h,signal:g},v=this.keyMap.get(e);if(v===void 0){h&&(h.fetch=`miss`);let t=this.backgroundFetch(e,v,_,p);return t.__returned=t}else{let r=this.valList[v];if(this.isBackgroundFetch(r)){let e=t&&r.__staleWhileFetching!==void 0;return h&&(h.fetch=`inflight`,e&&(h.returnedStale=!0)),e?r.__staleWhileFetching:r.__returned=r}let i=this.isStale(v);if(!m&&!i)return h&&(h.fetch=`hit`),this.moveToTail(v),n&&this.updateItemAge(v),this.statusTTL(h,v),r;let a=this.backgroundFetch(e,v,_,p),o=a.__staleWhileFetching!==void 0,s=o&&t;return h&&(h.fetch=o&&i?`stale`:`refresh`,s&&i&&(h.returnedStale=!0)),s?a.__staleWhileFetching:a.__returned=a}}get(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:i}={}){let a=this.keyMap.get(e);if(a!==void 0){let o=this.valList[a],s=this.isBackgroundFetch(o);return this.statusTTL(i,a),this.isStale(a)?(i&&(i.get=`stale`),s?(i&&(i.returnedStale=t&&o.__staleWhileFetching!==void 0),t?o.__staleWhileFetching:void 0):(r||this.delete(e),i&&(i.returnedStale=t),t?o:void 0)):(i&&(i.get=`hit`),s?o.__staleWhileFetching:(this.moveToTail(a),n&&this.updateItemAge(a),o))}else i&&(i.get=`miss`)}connect(e,t){this.prev[t]=e,this.next[e]=t}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return qv(`del`,`delete`),this.delete}delete(e){let t=!1;if(this.size!==0){let n=this.keyMap.get(e);if(n!==void 0)if(t=!0,this.size===1)this.clear();else{this.removeItemSize(n);let t=this.valList[n];this.isBackgroundFetch(t)?t.__abortController.abort(Error(`deleted`)):(this.dispose(t,e,`delete`),this.disposeAfter&&this.disposed.push([t,e,`delete`])),this.keyMap.delete(e),this.keyList[n]=null,this.valList[n]=null,n===this.tail?this.tail=this.prev[n]:n===this.head?this.head=this.next[n]:(this.next[this.prev[n]]=this.next[n],this.prev[this.next[n]]=this.prev[n]),this.size--,this.free.push(n)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return t}clear(){for(let e of this.rindexes({allowStale:!0})){let t=this.valList[e];if(this.isBackgroundFetch(t))t.__abortController.abort(Error(`deleted`));else{let n=this.keyList[e];this.dispose(t,n,`delete`),this.disposeAfter&&this.disposed.push([t,n,`delete`])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return qv(`reset`,`clear`),this.clear}get length(){return Jv(`length`,`size`),this.size}static get AbortController(){return Vv}static get AbortSignal(){return Wv}},ry=ny,iy={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function ay(e){try{return new URL(e)}catch{return null}}function oy(e){var t=(typeof e==`string`?ay(e):e)||{},n=t.protocol,r=t.host,i=t.port;if(typeof r!=`string`||!r||typeof n!=`string`||(n=n.split(`:`,1)[0],r=r.replace(/:\d*$/,``),i=parseInt(i)||iy[n]||0,!sy(r,i)))return``;var a=cy(n+`_proxy`)||cy(`all_proxy`);return a&&a.indexOf(`://`)===-1&&(a=n+`://`+a),a}function sy(e,t){var n=cy(`no_proxy`).toLowerCase();return n?n===`*`?!1:n.split(/[,\s]/).every(function(n){if(!n)return!0;var r=n.match(/^(.+):(\d+)$/),i=r?r[1]:n,a=r?parseInt(r[2]):0;return a&&a!==t?!0:/^[.*]/.test(i)?(i.charAt(0)===`*`&&(i=i.slice(1)),!e.endsWith(i)):e!==i}):!0}function cy(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||``}var ly=e.__toESM(e.require_src(),1);const uy=(0,ly.default)(`proxy-agent`),dy={http:async()=>(await Promise.resolve().then(function(){return require(`./dist-BKebfWjz.js`)})).HttpProxyAgent,https:async()=>(await Promise.resolve().then(function(){return require(`./dist-Cz6osHpM.js`)})).HttpsProxyAgent,socks:async()=>(await Promise.resolve().then(function(){return require(`./dist-DY7shNXC.js`)})).SocksProxyAgent,pac:async()=>(await Promise.resolve().then(function(){return require(`./dist-SfgYosnQ.js`)})).PacProxyAgent},fy={http:[dy.http,dy.https],https:[dy.http,dy.https],socks:[dy.socks,dy.socks],socks4:[dy.socks,dy.socks],socks4a:[dy.socks,dy.socks],socks5:[dy.socks,dy.socks],socks5h:[dy.socks,dy.socks],"pac+data":[dy.pac,dy.pac],"pac+file":[dy.pac,dy.pac],"pac+ftp":[dy.pac,dy.pac],"pac+http":[dy.pac,dy.pac],"pac+https":[dy.pac,dy.pac]};function py(e){return Object.keys(fy).includes(e)}var my=class extends e.Agent{constructor(e){super(e),this.cache=new ry({max:20,dispose:e=>e.destroy()}),uy(`Creating new ProxyAgent instance: %o`,e),this.connectOpts=e,this.httpAgent=e?.httpAgent||new T.Agent(e),this.httpsAgent=e?.httpsAgent||new w.Agent(e),this.getProxyForUrl=e?.getProxyForUrl||oy}async connect(e,t){let{secureEndpoint:n}=t,r=e.getHeader(`upgrade`)===`websocket`,i=n?r?`wss:`:`https:`:r?`ws:`:`http:`,a=e.getHeader(`host`),o=new C.URL(e.path,`${i}//${a}`).href,s=await this.getProxyForUrl(o,e);if(!s)return uy(`Proxy not enabled for URL: %o`,o),n?this.httpsAgent:this.httpAgent;uy(`Request URL: %o`,o),uy(`Proxy URL: %o`,s);let c=`${i}+${s}`,l=this.cache.get(c);if(l)uy(`Cache hit for proxy URL: %o`,s);else{let e=new C.URL(s),t=e.protocol.replace(`:`,``);if(!py(t))throw Error(`Unsupported protocol for proxy URL: ${s}`);let i=await fy[t][n||r?1:0]();l=new i(s,this.connectOpts),this.cache.set(c,l)}return l}destroy(){for(let e of this.cache.values())e.destroy();super.destroy()}},hy=`@turbo/gen`,gy=`2.9.11-canary.7`,_y=`Extend a Turborepo`,vy=`https://turborepo.dev`,yy={url:`https://github.com/vercel/turborepo/issues`},by=`MIT`,xy={type:`git`,url:`git+https://github.com/vercel/turborepo.git`,directory:`packages/turbo-gen`},Sy=`dist/cli.js`,Cy=[`dist`],wy=`dist/types.d.ts`,Ty={access:`public`},Ey={build:`tsdown`,"build:embed":`node scripts/embed-templates.mjs`,test:`jest`,"check-types":`tsc --noEmit`},Dy={"@inquirer/prompts":`^7.10.1`,esbuild:`^0.25.0`},Oy={"@arethetypeswrong/cli":`0.18.2`,"@jest/globals":`30.3.0`,"@turbo/test-utils":`workspace:*`,"@turbo/tsconfig":`workspace:*`,"@turbo/utils":`workspace:*`,"@turbo/workspaces":`workspace:*`,"@types/fs-extra":`9.0.13`,"@types/node":`18.17.4`,"@types/validate-npm-package-name":`4.0.0`,"brace-expansion":`5.0.5`,commander:`10.0.0`,"fs-extra":`10.1.0`,handlebars:`4.7.9`,jest:`30.3.0`,minimatch:`9.0.7`,"node-plop":`0.32.3`,picocolors:`1.0.1`,"proxy-agent":`8.0.1`,"ts-jest":`29.4.9`,tsdown:`0.12.0`,typescript:`5.5.4`,"update-check":`1.5.4`,"validate-npm-package-name":`5.0.0`},ky={name:hy,version:gy,description:_y,homepage:vy,bugs:yy,license:by,repository:xy,bin:Sy,files:Cy,types:wy,publishConfig:Ty,scripts:Ey,dependencies:Dy,devDependencies:Oy},Ay=e.__commonJSMin((exports,t)=>{function n(e){return e==null}function r(e){return typeof e==`object`&&!!e}function i(e){return Array.isArray(e)?e:n(e)?[]:[e]}function a(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}function o(e,t){var n=``,r;for(r=0;r<t;r+=1)n+=e;return n}function s(e){return e===0&&1/e==-1/0}t.exports.isNothing=n,t.exports.isObject=r,t.exports.toArray=i,t.exports.repeat=o,t.exports.isNegativeZero=s,t.exports.extend=a}),jy=e.__commonJSMin((exports,t)=>{function n(e,t){var n=``,r=e.reason||`(unknown reason)`;return e.mark?(e.mark.name&&(n+=`in "`+e.mark.name+`" `),n+=`(`+(e.mark.line+1)+`:`+(e.mark.column+1)+`)`,!t&&e.mark.snippet&&(n+=`
|
|
125
|
+
`)l=!1,d+=f(e,u,p),u=p;else if(!l&&o+s===`/*`){d+=e.slice(u,p),u=p,l=r,p++;continue}else if(l===r&&o+s===`*/`){p++,l=!1,d+=f(e,u,p+1),u=p+1;continue}}}return d+(l?f(e.substr(u)):e.substr(u))}}),Dv=e.__commonJSMin(exports=>{var t=require(`fs`),n=Tv(),r=require(`path`),i=Ev(),a=exports.parse=function(e){return/^\s*{/.test(e)?JSON.parse(i(e)):n.parse(e)},o=exports.file=function(){var e=[].slice.call(arguments).filter(function(e){return e!=null});for(var n in e)if(typeof e[n]!=`string`)return;var i=r.join.apply(null,e),a;try{return t.readFileSync(i,`utf-8`)}catch{return}},s=exports.json=function(){var e=o.apply(null,arguments);return e?a(e):null},c=exports.env=function(e,t){t||=process.env;var n={},r=e.length;for(var i in t)if(i.toLowerCase().indexOf(e.toLowerCase())===0){for(var a=i.substring(r).split(`__`),o;(o=a.indexOf(``))>-1;)a.splice(o,1);var s=n;a.forEach(function(e,n){!e||typeof s!=`object`||(n===a.length-1&&(s[e]=t[i]),s[e]===void 0&&(s[e]={}),s=s[e])})}return n},l=exports.find=function(){var e=r.join.apply(null,[].slice.call(arguments));function n(e,i){var a=r.join(e,i);try{return t.statSync(a),a}catch{if(r.dirname(e)!==e)return n(r.dirname(e),i)}}return n(process.cwd(),e)}}),Ov=e.__commonJSMin((exports,t)=>{function n(e){return e instanceof Buffer||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof Buffer){var t=Buffer.alloc?Buffer.alloc(e.length):new Buffer(e.length);return e.copy(t),t}else if(e instanceof Date)return new Date(e.getTime());else if(e instanceof RegExp)return new RegExp(e);else throw Error(`Unexpected situation`)}function i(e){var t=[];return e.forEach(function(e,a){typeof e==`object`&&e?Array.isArray(e)?t[a]=i(e):n(e)?t[a]=r(e):t[a]=o({},e):t[a]=e}),t}function a(e,t){return t===`__proto__`?void 0:e[t]}var o=t.exports=function(){if(arguments.length<1||typeof arguments[0]!=`object`)return!1;if(arguments.length<2)return arguments[0];var e=arguments[0],t=Array.prototype.slice.call(arguments,1),s,c,l;return t.forEach(function(t){typeof t!=`object`||!t||Array.isArray(t)||Object.keys(t).forEach(function(l){if(c=a(e,l),s=a(t,l),s!==e)if(typeof s!=`object`||!s){e[l]=s;return}else if(Array.isArray(s)){e[l]=i(s);return}else if(n(s)){e[l]=r(s);return}else if(typeof c!=`object`||!c||Array.isArray(c)){e[l]=o({},s);return}else{e[l]=o(c,s);return}})}),e}}),kv=e.__commonJSMin((exports,t)=>{function n(e,t){var n=e;t.slice(0,-1).forEach(function(e){n=n[e]||{}});var r=t[t.length-1];return r in n}function r(e){return typeof e==`number`||/^0x[0-9a-f]+$/i.test(e)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function i(e,t){return t===`constructor`&&typeof e[t]==`function`||t===`__proto__`}t.exports=function(e,t){t||={};var a={bools:{},strings:{},unknownFn:null};typeof t.unknown==`function`&&(a.unknownFn=t.unknown),typeof t.boolean==`boolean`&&t.boolean?a.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(e){a.bools[e]=!0});var o={};function s(e){return o[e].some(function(e){return a.bools[e]})}Object.keys(t.alias||{}).forEach(function(e){o[e]=[].concat(t.alias[e]),o[e].forEach(function(t){o[t]=[e].concat(o[e].filter(function(e){return t!==e}))})}),[].concat(t.string).filter(Boolean).forEach(function(e){a.strings[e]=!0,o[e]&&[].concat(o[e]).forEach(function(e){a.strings[e]=!0})});var c=t.default||{},l={_:[]};function u(e,t){return a.allBools&&/^--[^=]+$/.test(t)||a.strings[e]||a.bools[e]||o[e]}function d(e,t,n){for(var r=e,o=0;o<t.length-1;o++){var s=t[o];if(i(r,s))return;r[s]===void 0&&(r[s]={}),(r[s]===Object.prototype||r[s]===Number.prototype||r[s]===String.prototype)&&(r[s]={}),r[s]===Array.prototype&&(r[s]=[]),r=r[s]}var c=t[t.length-1];i(r,c)||((r===Object.prototype||r===Number.prototype||r===String.prototype)&&(r={}),r===Array.prototype&&(r=[]),r[c]===void 0||a.bools[c]||typeof r[c]==`boolean`?r[c]=n:Array.isArray(r[c])?r[c].push(n):r[c]=[r[c],n])}function f(e,t,n){if(!(n&&a.unknownFn&&!u(e,n)&&a.unknownFn(n)===!1)){var i=!a.strings[e]&&r(t)?Number(t):t;d(l,e.split(`.`),i),(o[e]||[]).forEach(function(e){d(l,e.split(`.`),i)})}}Object.keys(a.bools).forEach(function(e){f(e,c[e]===void 0?!1:c[e])});var p=[];e.indexOf(`--`)!==-1&&(p=e.slice(e.indexOf(`--`)+1),e=e.slice(0,e.indexOf(`--`)));for(var m=0;m<e.length;m++){var h=e[m],g,_;if(/^--.+=/.test(h)){var v=h.match(/^--([^=]+)=([\s\S]*)$/);g=v[1];var y=v[2];a.bools[g]&&(y=y!==`false`),f(g,y,h)}else if(/^--no-.+/.test(h))g=h.match(/^--no-(.+)/)[1],f(g,!1,h);else if(/^--.+/.test(h))g=h.match(/^--(.+)/)[1],_=e[m+1],_!==void 0&&!/^(-|--)[^-]/.test(_)&&!a.bools[g]&&!a.allBools&&(!o[g]||!s(g))?(f(g,_,h),m+=1):/^(true|false)$/.test(_)?(f(g,_===`true`,h),m+=1):f(g,a.strings[g]?``:!0,h);else if(/^-[^-]+/.test(h)){for(var b=h.slice(1,-1).split(``),x=!1,S=0;S<b.length;S++){if(_=h.slice(S+2),_===`-`){f(b[S],_,h);continue}if(/[A-Za-z]/.test(b[S])&&_[0]===`=`){f(b[S],_.slice(1),h),x=!0;break}if(/[A-Za-z]/.test(b[S])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(_)){f(b[S],_,h),x=!0;break}if(b[S+1]&&b[S+1].match(/\W/)){f(b[S],h.slice(S+2),h),x=!0;break}else f(b[S],a.strings[b[S]]?``:!0,h)}g=h.slice(-1)[0],!x&&g!==`-`&&(e[m+1]&&!/^(-|--)[^-]/.test(e[m+1])&&!a.bools[g]&&(!o[g]||!s(g))?(f(g,e[m+1],h),m+=1):e[m+1]&&/^(true|false)$/.test(e[m+1])?(f(g,e[m+1]===`true`,h),m+=1):f(g,a.strings[g]?``:!0,h))}else if((!a.unknownFn||a.unknownFn(h)!==!1)&&l._.push(a.strings._||!r(h)?h:Number(h)),t.stopEarly){l._.push.apply(l._,e.slice(m+1));break}}return Object.keys(c).forEach(function(e){n(l,e.split(`.`))||(d(l,e.split(`.`),c[e]),(o[e]||[]).forEach(function(t){d(l,t.split(`.`),c[e])}))}),t[`--`]?l[`--`]=p.slice():p.forEach(function(e){l._.push(e)}),l}}),Av=e.__commonJSMin((exports,t)=>{var n=Dv(),r=require(`path`).join,i=Ov(),a=`/etc`,o=process.platform===`win32`,s=o?process.env.USERPROFILE:process.env.HOME;t.exports=function(e,t,c,l){if(typeof e!=`string`)throw Error(`rc(name): name *must* be string`);c||=kv()(process.argv.slice(2)),t=(typeof t==`string`?n.json(t):t)||{},l||=n.parse;var u=n.env(e+`_`),d=[t],f=[];function p(e){if(!(f.indexOf(e)>=0)){var t=n.file(e);t&&(d.push(l(t)),f.push(e))}}return o||[r(a,e,`config`),r(a,e+`rc`)].forEach(p),s&&[r(s,`.config`,e,`config`),r(s,`.config`,e),r(s,`.`+e,`config`),r(s,`.`+e+`rc`)].forEach(p),p(n.find(`.`+e+`rc`)),u.config&&p(u.config),c.config&&p(c.config),i.apply(null,d.concat([u,c,f.length?{configs:f,config:f[f.length-1]}:void 0]))}}),jv=e.__commonJSMin((exports,t)=>{t.exports=function(e){var t=Av()(`npm`,{registry:`https://registry.npmjs.org/`}),n=t[e+`:registry`]||t.registry;return n.slice(-1)===`/`?n:n+`/`}}),Mv=e.__commonJSMin((exports,t)=>{var n=require(`buffer`),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,exports),exports.Buffer=a);function a(e,t,n){return r(e,t,n)}a.prototype=Object.create(r.prototype),i(r,a),a.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return r(e,t,n)},a.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var i=r(e);return t===void 0?i.fill(0):typeof n==`string`?i.fill(t,n):i.fill(t),i},a.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r(e)},a.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return n.SlowBuffer(e)}}),Nv=e.__commonJSMin((exports,t)=>{let n=Mv().Buffer;function r(e){return n.from(e,`base64`).toString(`utf8`)}function i(e){return n.from(e,`utf8`).toString(`base64`)}t.exports={decodeBase64:r,encodeBase64:i}}),Pv=e.__commonJSMin((exports,t)=>{var n=require(`url`),r=Nv(),i=r.decodeBase64,a=r.encodeBase64,o=`:_authToken`,s=`:username`,c=`:_password`;t.exports=function(){var e,t;return arguments.length>=2?(e=arguments[0],t=arguments[1]):typeof arguments[0]==`string`?e=arguments[0]:t=arguments[0],t||={},t.npmrc=t.npmrc||Av()(`npm`,{registry:`https://registry.npmjs.org/`}),e||=t.npmrc.registry,l(e,t)||u(t.npmrc)};function l(e,t){for(var r=n.parse(e,!1,!0),i;i!==`/`&&r.pathname!==i;){i=r.pathname||`/`;var a=`//`+r.host+i.replace(/\/$/,``),o=f(a,t.npmrc);if(o)return o;if(!t.recursive)return/\/$/.test(e)?void 0:l(n.resolve(e,`.`),t);r.pathname=n.resolve(d(i),`..`)||`/`}}function u(e){if(e._auth)return{token:e._auth,type:`Basic`}}function d(e){return e[e.length-1]===`/`?e:e+`/`}function f(e,t){var n=p(t[e+o]||t[e+`/`+o]);if(n)return n;var r=t[e+s]||t[e+`/`+s],i=t[e+c]||t[e+`/`+c],a=m(r,i);if(a)return a}function p(e){if(e){var t=e.replace(/^\$\{?([^}]*)\}?$/,function(e,t){return process.env[t]});return{token:t,type:`Bearer`}}}function m(e,t){if(!(!e||!t)){var n=i(t.replace(/^\$\{?([^}]*)\}?$/,function(e,t){return process.env[t]})),r=a(e+`:`+n);return{token:r,type:`Basic`,password:n,username:e}}}}),Fv=e.__commonJSMin((exports,t)=>{let{URL:n}=require(`url`),{join:r}=require(`path`),i=require(`fs`),{promisify:a}=require(`util`),{tmpdir:o}=require(`os`),s=jv(),c=a(i.writeFile),l=a(i.mkdir),u=a(i.readFile),d=(e,t)=>e.localeCompare(t,`en-US`,{numeric:!0}),f=e=>encodeURIComponent(e).replace(/^%40/,`@`),p=async(e,t)=>{let n=o(),a=r(n,`update-check`);i.existsSync(a)||await l(a);let s=`${e.name}-${t}.json`;return e.scope&&(s=`${e.scope}-${s}`),r(a,s)},m=async(e,t,n)=>{if(i.existsSync(e)){let r=await u(e,`utf8`),{lastUpdate:i,latest:a}=JSON.parse(r),o=i+n;if(o>t)return{shouldCheck:!1,latest:a}}return{shouldCheck:!0,latest:null}},h=async(e,t,n)=>{let r=JSON.stringify({latest:t,lastUpdate:n});await c(e,r,`utf8`)},g=(e,t)=>new Promise((n,r)=>{let i={host:e.hostname,path:e.pathname,port:e.port,headers:{accept:`application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`},timeout:2e3};t&&(i.headers.authorization=`${t.type} ${t.token}`);let{get:a}=e.protocol===`https:`?require(`https`):require(`http`);a(i,e=>{let{statusCode:t}=e;if(t!==200){let n=Error(`Request failed with code ${t}`);n.code=t,r(n),e.resume();return}let i=``;e.setEncoding(`utf8`),e.on(`data`,e=>{i+=e}),e.on(`end`,()=>{try{let e=JSON.parse(i);n(e)}catch(e){r(e)}})}).on(`error`,r).on(`timeout`,r)}),_=async({full:e,scope:t},r)=>{let i=s(t),a=new n(e,i),o=null;try{o=await g(a)}catch(e){if(e.code&&String(e.code).startsWith(4)){let e=Pv(),t=e(i,{recursive:!0});o=await g(a,t)}else throw e}let c=o[`dist-tags`][r];if(!c)throw Error(`Distribution tag ${r} is not available`);return c},v={interval:36e5,distTag:`latest`},y=e=>{let t={full:f(e)};if(e.includes(`/`)){let n=e.split(`/`);t.scope=n[0],t.name=n[1]}else t.scope=null,t.name=e;return t};t.exports=async(e,t)=>{if(typeof e!=`object`)throw Error(`The first parameter should be your package.json file content`);let n=y(e.name),r=Date.now(),{distTag:i,interval:a}=Object.assign({},v,t),o=await p(n,i),s=null,c=!0;({shouldCheck:c,latest:s}=await m(o,r,a)),c&&(s=await _(n,i),await h(o,s,r));let l=d(e.version,s);return l===-1?{latest:s,fromCache:!c}:null}}),Iv=e.__toESM(M()),Lv=e.__toESM(Fv());function Rv(e){let{packageInfo:t,upgradeCommand:n}=e,r=(0,Lv.default)(t).catch(()=>null);return async function(e=0){try{let i=await r;if(i?.latest){pc(),pc(Iv.default.yellow(Iv.default.bold(`A new version of \`${t.name}\` is available!`)));let e=typeof n==`function`?await n():n;e&&pc(`You can update by running: ${Iv.default.cyan(e)}`),pc()}process.exit(e)}catch(t){process.env.DEBUG&&hc(`Update check failed:`,t),process.exit(e)}}}const zv=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,Bv=typeof AbortController==`function`,Vv=Bv?AbortController:class{constructor(){this.signal=new Wv}abort(e=Error(`This operation was aborted`)){this.signal.reason=this.signal.reason||e,this.signal.aborted=!0,this.signal.dispatchEvent({type:`abort`,target:this.signal})}},Hv=typeof AbortSignal==`function`,Uv=typeof Vv.AbortSignal==`function`,Wv=Hv?AbortSignal:Uv?Vv.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type===`abort`&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(t=>t(e),this))}onabort(){}addEventListener(e,t){e===`abort`&&this._listeners.push(t)}removeEventListener(e,t){e===`abort`&&(this._listeners=this._listeners.filter(e=>e!==t))}},Gv=new Set,Kv=(e,t)=>{let n=`LRU_CACHE_OPTION_${e}`;Xv(n)&&Zv(n,`${e} option`,`options.${t}`,ny)},qv=(e,t)=>{let n=`LRU_CACHE_METHOD_${e}`;if(Xv(n)){let{prototype:r}=ny,{get:i}=Object.getOwnPropertyDescriptor(r,e);Zv(n,`${e} method`,`cache.${t}()`,i)}},Jv=(e,t)=>{let n=`LRU_CACHE_PROPERTY_${e}`;if(Xv(n)){let{prototype:r}=ny,{get:i}=Object.getOwnPropertyDescriptor(r,e);Zv(n,`${e} property`,`cache.${t}`,i)}},Yv=(...e)=>{typeof process==`object`&&process&&typeof process.emitWarning==`function`?process.emitWarning(...e):console.error(...e)},Xv=e=>!Gv.has(e),Zv=(e,t,n,r)=>{Gv.add(e);let i=`The ${t} is deprecated. Please use ${n} instead.`;Yv(i,`DeprecationWarning`,e,r)},Qv=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),$v=e=>Qv(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?ey:null:null;var ey=class extends Array{constructor(e){super(e),this.fill(0)}},ty=class{constructor(e){if(e===0)return[];let t=$v(e);this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},ny=class e{constructor(t={}){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:m=0,sizeCalculation:h,fetchMethod:g,fetchContext:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:x,ignoreFetchAbort:S}=t,{length:C,maxAge:w,stale:T}=t instanceof e?{}:t;if(n!==0&&!Qv(n))throw TypeError(`max option must be a nonnegative integer`);let E=n?$v(n):Array;if(!E)throw Error(`invalid max value: `+n);if(this.max=n,this.maxSize=p,this.maxEntrySize=m||this.maxSize,this.sizeCalculation=h||C,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(this.fetchMethod=g||null,this.fetchMethod&&typeof this.fetchMethod!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.fetchContext=_,!this.fetchMethod&&_!==void 0)throw TypeError(`cannot set fetchContext without fetchMethod`);if(this.keyMap=new Map,this.keyList=Array(n).fill(null),this.valList=Array(n).fill(null),this.next=new E(n),this.prev=new E(n),this.head=0,this.tail=0,this.free=new ty(n),this.initialFill=1,this.size=0,typeof l==`function`&&(this.dispose=l),typeof u==`function`?(this.disposeAfter=u,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!x,this.ignoreFetchAbort=!!S,this.maxEntrySize!==0){if(this.maxSize!==0&&!Qv(this.maxSize))throw TypeError(`maxSize must be a positive integer if specified`);if(!Qv(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.initializeSizeTracking()}if(this.allowStale=!!c||!!T,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=Qv(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=r||w||0,this.ttl){if(!Qv(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let t=`LRU_CACHE_UNBOUNDED`;if(Xv(t)){Gv.add(t);let n=`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`;Yv(n,`UnboundedCacheWarning`,t,e)}}T&&Kv(`stale`,`allowStale`),w&&Kv(`maxAge`,`ttl`),C&&Kv(`length`,`sizeCalculation`)}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new ey(this.max),this.starts=new ey(this.max),this.setItemTTL=(e,t,n=zv.now())=>{if(this.starts[e]=t===0?0:n,this.ttls[e]=t,t!==0&&this.ttlAutopurge){let n=setTimeout(()=>{this.isStale(e)&&this.delete(this.keyList[e])},t+1);n.unref&&n.unref()}},this.updateItemAge=e=>{this.starts[e]=this.ttls[e]===0?0:zv.now()},this.statusTTL=(n,r)=>{n&&(n.ttl=this.ttls[r],n.start=this.starts[r],n.now=e||t(),n.remainingTTL=n.now+n.ttl-n.start)};let e=0,t=()=>{let t=zv.now();if(this.ttlResolution>0){e=t;let n=setTimeout(()=>e=0,this.ttlResolution);n.unref&&n.unref()}return t};this.getRemainingTTL=n=>{let r=this.keyMap.get(n);return r===void 0?0:this.ttls[r]===0||this.starts[r]===0?1/0:this.starts[r]+this.ttls[r]-(e||t())},this.isStale=n=>this.ttls[n]!==0&&this.starts[n]!==0&&(e||t())-this.starts[n]>this.ttls[n]}updateItemAge(e){}statusTTL(e,t){}setItemTTL(e,t,n){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new ey(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,t,n,r)=>{if(this.isBackgroundFetch(t))return 0;if(!Qv(n))if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!Qv(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`);return n},this.addItemSize=(e,t,n)=>{if(this.sizes[e]=t,this.maxSize){let t=this.maxSize-this.sizes[e];for(;this.calculatedSize>t;)this.evict(!0)}this.calculatedSize+=this.sizes[e],n&&(n.entrySize=t,n.totalCalculatedSize=this.calculatedSize)}}removeItemSize(e){}addItemSize(e,t){}requireSize(e,t,n,r){if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`)}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.tail;!(!this.isValidIndex(t)||((e||!this.isStale(t))&&(yield t),t===this.head));)t=this.prev[t]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.head;!(!this.isValidIndex(t)||((e||!this.isStale(t))&&(yield t),t===this.tail));)t=this.next[t]}isValidIndex(e){return e!==void 0&&this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*rentries(){for(let e of this.rindexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*keys(){for(let e of this.indexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*rkeys(){for(let e of this.rindexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*values(){for(let e of this.indexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}*rvalues(){for(let e of this.rindexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,t){for(let n of this.indexes()){let r=this.valList[n],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;if(e(i,this.keyList[n],this))return this.get(this.keyList[n],t)}}forEach(e,t=this){for(let n of this.indexes()){let r=this.valList[n],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;e.call(t,i,this.keyList[n],this)}}rforEach(e,t=this){for(let n of this.rindexes()){let r=this.valList[n],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;e.call(t,i,this.keyList[n],this)}}get prune(){return qv(`prune`,`purgeStale`),this.purgeStale}purgeStale(){let e=!1;for(let t of this.rindexes({allowStale:!0}))this.isStale(t)&&(this.delete(this.keyList[t]),e=!0);return e}dump(){let e=[];for(let t of this.indexes({allowStale:!0})){let n=this.keyList[t],r=this.valList[t],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;let a={value:i};if(this.ttls){a.ttl=this.ttls[t];let e=zv.now()-this.starts[t];a.start=Math.floor(Date.now()-e)}this.sizes&&(a.size=this.sizes[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=zv.now()-e}this.set(t,n.value,n)}}dispose(e,t,n){}set(e,t,{ttl:n=this.ttl,start:r,noDisposeOnSet:i=this.noDisposeOnSet,size:a=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:s=this.noUpdateTTL,status:c}={}){if(a=this.requireSize(e,t,a,o),this.maxEntrySize&&a>this.maxEntrySize)return c&&(c.set=`miss`,c.maxEntrySizeExceeded=!0),this.delete(e),this;let l=this.size===0?void 0:this.keyMap.get(e);if(l===void 0)l=this.newIndex(),this.keyList[l]=e,this.valList[l]=t,this.keyMap.set(e,l),this.next[this.tail]=l,this.prev[l]=this.tail,this.tail=l,this.size++,this.addItemSize(l,a,c),c&&(c.set=`add`),s=!1;else{this.moveToTail(l);let n=this.valList[l];if(t!==n){if(this.isBackgroundFetch(n)?n.__abortController.abort(Error(`replaced`)):i||(this.dispose(n,e,`set`),this.disposeAfter&&this.disposed.push([n,e,`set`])),this.removeItemSize(l),this.valList[l]=t,this.addItemSize(l,a,c),c){c.set=`replace`;let e=n&&this.isBackgroundFetch(n)?n.__staleWhileFetching:n;e!==void 0&&(c.oldValue=e)}}else c&&(c.set=`update`)}if(n!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),s||this.setItemTTL(l,n,r),this.statusTTL(c,l),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length===0?this.initialFill++:this.free.pop()}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let t=this.head,n=this.keyList[t],r=this.valList[t];return this.isBackgroundFetch(r)?r.__abortController.abort(Error(`evicted`)):(this.dispose(r,n,`evict`),this.disposeAfter&&this.disposed.push([r,n,`evict`])),this.removeItemSize(t),e&&(this.keyList[t]=null,this.valList[t]=null,this.free.push(t)),this.head=this.next[t],this.keyMap.delete(n),this.size--,t}has(e,{updateAgeOnHas:t=this.updateAgeOnHas,status:n}={}){let r=this.keyMap.get(e);if(r!==void 0)if(this.isStale(r))n&&(n.has=`stale`,this.statusTTL(n,r));else return t&&this.updateItemAge(r),n&&(n.has=`hit`),this.statusTTL(n,r),!0;else n&&(n.has=`miss`);return!1}peek(e,{allowStale:t=this.allowStale}={}){let n=this.keyMap.get(e);if(n!==void 0&&(t||!this.isStale(n))){let e=this.valList[n];return this.isBackgroundFetch(e)?e.__staleWhileFetching:e}}backgroundFetch(e,t,n,r){let i=t===void 0?void 0:this.valList[t];if(this.isBackgroundFetch(i))return i;let a=new Vv;n.signal&&n.signal.addEventListener(`abort`,()=>a.abort(n.signal.reason));let o={signal:a.signal,options:n,context:r},s=(r,i=!1)=>{let{aborted:s}=a.signal,c=n.ignoreFetchAbort&&r!==void 0;return n.status&&(s&&!i?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),s&&!c&&!i?l(a.signal.reason):(this.valList[t]===d&&(r===void 0?d.__staleWhileFetching?this.valList[t]=d.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,o.options))),r)},c=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),l(e)),l=r=>{let{aborted:i}=a.signal,o=i&&n.allowStaleOnFetchAbort,s=o||n.allowStaleOnFetchRejection,c=s||n.noDeleteOnFetchRejection;if(this.valList[t]===d){let n=!c||d.__staleWhileFetching===void 0;n?this.delete(e):o||(this.valList[t]=d.__staleWhileFetching)}if(s)return n.status&&d.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),d.__staleWhileFetching;if(d.__returned===d)throw r},u=(t,r)=>{this.fetchMethod(e,i,o).then(e=>t(e),r),a.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(),n.allowStaleOnFetchAbort&&(t=e=>s(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let d=new Promise(u).then(s,c);return d.__abortController=a,d.__staleWhileFetching=i,d.__returned=null,t===void 0?(this.set(e,d,{...o.options,status:void 0}),t=this.keyMap.get(e)):this.valList[t]=d,d}isBackgroundFetch(e){return e&&typeof e==`object`&&typeof e.then==`function`&&Object.prototype.hasOwnProperty.call(e,`__staleWhileFetching`)&&Object.prototype.hasOwnProperty.call(e,`__returned`)&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:o=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,fetchContext:p=this.fetchContext,forceRefresh:m=!1,status:h,signal:g}={}){if(!this.fetchMethod)return h&&(h.fetch=`get`),this.get(e,{allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r,status:h});let _={allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:i,noDisposeOnSet:a,size:o,sizeCalculation:s,noUpdateTTL:c,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:f,ignoreFetchAbort:d,status:h,signal:g},v=this.keyMap.get(e);if(v===void 0){h&&(h.fetch=`miss`);let t=this.backgroundFetch(e,v,_,p);return t.__returned=t}else{let r=this.valList[v];if(this.isBackgroundFetch(r)){let e=t&&r.__staleWhileFetching!==void 0;return h&&(h.fetch=`inflight`,e&&(h.returnedStale=!0)),e?r.__staleWhileFetching:r.__returned=r}let i=this.isStale(v);if(!m&&!i)return h&&(h.fetch=`hit`),this.moveToTail(v),n&&this.updateItemAge(v),this.statusTTL(h,v),r;let a=this.backgroundFetch(e,v,_,p),o=a.__staleWhileFetching!==void 0,s=o&&t;return h&&(h.fetch=o&&i?`stale`:`refresh`,s&&i&&(h.returnedStale=!0)),s?a.__staleWhileFetching:a.__returned=a}}get(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:i}={}){let a=this.keyMap.get(e);if(a!==void 0){let o=this.valList[a],s=this.isBackgroundFetch(o);return this.statusTTL(i,a),this.isStale(a)?(i&&(i.get=`stale`),s?(i&&(i.returnedStale=t&&o.__staleWhileFetching!==void 0),t?o.__staleWhileFetching:void 0):(r||this.delete(e),i&&(i.returnedStale=t),t?o:void 0)):(i&&(i.get=`hit`),s?o.__staleWhileFetching:(this.moveToTail(a),n&&this.updateItemAge(a),o))}else i&&(i.get=`miss`)}connect(e,t){this.prev[t]=e,this.next[e]=t}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return qv(`del`,`delete`),this.delete}delete(e){let t=!1;if(this.size!==0){let n=this.keyMap.get(e);if(n!==void 0)if(t=!0,this.size===1)this.clear();else{this.removeItemSize(n);let t=this.valList[n];this.isBackgroundFetch(t)?t.__abortController.abort(Error(`deleted`)):(this.dispose(t,e,`delete`),this.disposeAfter&&this.disposed.push([t,e,`delete`])),this.keyMap.delete(e),this.keyList[n]=null,this.valList[n]=null,n===this.tail?this.tail=this.prev[n]:n===this.head?this.head=this.next[n]:(this.next[this.prev[n]]=this.next[n],this.prev[this.next[n]]=this.prev[n]),this.size--,this.free.push(n)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return t}clear(){for(let e of this.rindexes({allowStale:!0})){let t=this.valList[e];if(this.isBackgroundFetch(t))t.__abortController.abort(Error(`deleted`));else{let n=this.keyList[e];this.dispose(t,n,`delete`),this.disposeAfter&&this.disposed.push([t,n,`delete`])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return qv(`reset`,`clear`),this.clear}get length(){return Jv(`length`,`size`),this.size}static get AbortController(){return Vv}static get AbortSignal(){return Wv}},ry=ny,iy={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function ay(e){try{return new URL(e)}catch{return null}}function oy(e){var t=(typeof e==`string`?ay(e):e)||{},n=t.protocol,r=t.host,i=t.port;if(typeof r!=`string`||!r||typeof n!=`string`||(n=n.split(`:`,1)[0],r=r.replace(/:\d*$/,``),i=parseInt(i)||iy[n]||0,!sy(r,i)))return``;var a=cy(n+`_proxy`)||cy(`all_proxy`);return a&&a.indexOf(`://`)===-1&&(a=n+`://`+a),a}function sy(e,t){var n=cy(`no_proxy`).toLowerCase();return n?n===`*`?!1:n.split(/[,\s]/).every(function(n){if(!n)return!0;var r=n.match(/^(.+):(\d+)$/),i=r?r[1]:n,a=r?parseInt(r[2]):0;return a&&a!==t?!0:/^[.*]/.test(i)?(i.charAt(0)===`*`&&(i=i.slice(1)),!e.endsWith(i)):e!==i}):!0}function cy(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||``}var ly=e.__toESM(e.require_src(),1);const uy=(0,ly.default)(`proxy-agent`),dy={http:async()=>(await Promise.resolve().then(function(){return require(`./dist-BKebfWjz.js`)})).HttpProxyAgent,https:async()=>(await Promise.resolve().then(function(){return require(`./dist-Cz6osHpM.js`)})).HttpsProxyAgent,socks:async()=>(await Promise.resolve().then(function(){return require(`./dist-DY7shNXC.js`)})).SocksProxyAgent,pac:async()=>(await Promise.resolve().then(function(){return require(`./dist-SfgYosnQ.js`)})).PacProxyAgent},fy={http:[dy.http,dy.https],https:[dy.http,dy.https],socks:[dy.socks,dy.socks],socks4:[dy.socks,dy.socks],socks4a:[dy.socks,dy.socks],socks5:[dy.socks,dy.socks],socks5h:[dy.socks,dy.socks],"pac+data":[dy.pac,dy.pac],"pac+file":[dy.pac,dy.pac],"pac+ftp":[dy.pac,dy.pac],"pac+http":[dy.pac,dy.pac],"pac+https":[dy.pac,dy.pac]};function py(e){return Object.keys(fy).includes(e)}var my=class extends e.Agent{constructor(e){super(e),this.cache=new ry({max:20,dispose:e=>e.destroy()}),uy(`Creating new ProxyAgent instance: %o`,e),this.connectOpts=e,this.httpAgent=e?.httpAgent||new T.Agent(e),this.httpsAgent=e?.httpsAgent||new w.Agent(e),this.getProxyForUrl=e?.getProxyForUrl||oy}async connect(e,t){let{secureEndpoint:n}=t,r=e.getHeader(`upgrade`)===`websocket`,i=n?r?`wss:`:`https:`:r?`ws:`:`http:`,a=e.getHeader(`host`),o=new C.URL(e.path,`${i}//${a}`).href,s=await this.getProxyForUrl(o,e);if(!s)return uy(`Proxy not enabled for URL: %o`,o),n?this.httpsAgent:this.httpAgent;uy(`Request URL: %o`,o),uy(`Proxy URL: %o`,s);let c=`${i}+${s}`,l=this.cache.get(c);if(l)uy(`Cache hit for proxy URL: %o`,s);else{let e=new C.URL(s),t=e.protocol.replace(`:`,``);if(!py(t))throw Error(`Unsupported protocol for proxy URL: ${s}`);let i=await fy[t][n||r?1:0]();l=new i(s,this.connectOpts),this.cache.set(c,l)}return l}destroy(){for(let e of this.cache.values())e.destroy();super.destroy()}},hy=`@turbo/gen`,gy=`2.9.11`,_y=`Extend a Turborepo`,vy=`https://turborepo.dev`,yy={url:`https://github.com/vercel/turborepo/issues`},by=`MIT`,xy={type:`git`,url:`git+https://github.com/vercel/turborepo.git`,directory:`packages/turbo-gen`},Sy=`dist/cli.js`,Cy=[`dist`],wy=`dist/types.d.ts`,Ty={access:`public`},Ey={build:`tsdown`,"build:embed":`node scripts/embed-templates.mjs`,test:`jest`,"check-types":`tsc --noEmit`},Dy={"@inquirer/prompts":`^7.10.1`,esbuild:`^0.25.0`},Oy={"@arethetypeswrong/cli":`0.18.2`,"@jest/globals":`30.3.0`,"@turbo/test-utils":`workspace:*`,"@turbo/tsconfig":`workspace:*`,"@turbo/utils":`workspace:*`,"@turbo/workspaces":`workspace:*`,"@types/fs-extra":`9.0.13`,"@types/node":`18.17.4`,"@types/validate-npm-package-name":`4.0.0`,"brace-expansion":`5.0.5`,commander:`10.0.0`,"fs-extra":`10.1.0`,handlebars:`4.7.9`,jest:`30.3.0`,minimatch:`9.0.7`,"node-plop":`0.32.3`,picocolors:`1.0.1`,"proxy-agent":`8.0.1`,"ts-jest":`29.4.9`,tsdown:`0.12.0`,typescript:`5.5.4`,"update-check":`1.5.4`,"validate-npm-package-name":`5.0.0`},ky={name:hy,version:gy,description:_y,homepage:vy,bugs:yy,license:by,repository:xy,bin:Sy,files:Cy,types:wy,publishConfig:Ty,scripts:Ey,dependencies:Dy,devDependencies:Oy},Ay=e.__commonJSMin((exports,t)=>{function n(e){return e==null}function r(e){return typeof e==`object`&&!!e}function i(e){return Array.isArray(e)?e:n(e)?[]:[e]}function a(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}function o(e,t){var n=``,r;for(r=0;r<t;r+=1)n+=e;return n}function s(e){return e===0&&1/e==-1/0}t.exports.isNothing=n,t.exports.isObject=r,t.exports.toArray=i,t.exports.repeat=o,t.exports.isNegativeZero=s,t.exports.extend=a}),jy=e.__commonJSMin((exports,t)=>{function n(e,t){var n=``,r=e.reason||`(unknown reason)`;return e.mark?(e.mark.name&&(n+=`in "`+e.mark.name+`" `),n+=`(`+(e.mark.line+1)+`:`+(e.mark.column+1)+`)`,!t&&e.mark.snippet&&(n+=`
|
|
126
126
|
|
|
127
127
|
`+e.mark.snippet),r+` `+n):r}function r(e,t){Error.call(this),this.name=`YAMLException`,this.reason=e,this.mark=t,this.message=n(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack||``}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(e){return this.name+`: `+n(this,e)},t.exports=r}),My=e.__commonJSMin((exports,t)=>{var n=Ay();function r(e,t,n,r,i){var a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}function i(e,t){return n.repeat(` `,t-e.length)+e}function a(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||=79,typeof t.indent!=`number`&&(t.indent=1),typeof t.linesBefore!=`number`&&(t.linesBefore=3),typeof t.linesAfter!=`number`&&(t.linesAfter=2);for(var a=/\r?\n|\r|\0/g,o=[0],s=[],c,l=-1;c=a.exec(e.buffer);)s.push(c.index),o.push(c.index+c[0].length),e.position<=c.index&&l<0&&(l=o.length-2);l<0&&(l=o.length-1);var u=``,d,f,p=Math.min(e.line+t.linesAfter,s.length).toString().length,m=t.maxLength-(t.indent+p+3);for(d=1;d<=t.linesBefore&&!(l-d<0);d++)f=r(e.buffer,o[l-d],s[l-d],e.position-(o[l]-o[l-d]),m),u=n.repeat(` `,t.indent)+i((e.line-d+1).toString(),p)+` | `+f.str+`
|
|
128
128
|
`+u;for(f=r(e.buffer,o[l],s[l],e.position,m),u+=n.repeat(` `,t.indent)+i((e.line+1).toString(),p)+` | `+f.str+`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turbo/gen",
|
|
3
|
-
"version": "2.9.11
|
|
3
|
+
"version": "2.9.11",
|
|
4
4
|
"description": "Extend a Turborepo",
|
|
5
5
|
"homepage": "https://turborepo.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"update-check": "1.5.4",
|
|
46
46
|
"validate-npm-package-name": "5.0.0",
|
|
47
47
|
"@turbo/test-utils": "0.0.0",
|
|
48
|
-
"@turbo/utils": "0.0.0",
|
|
49
48
|
"@turbo/tsconfig": "0.0.0",
|
|
50
|
-
"@turbo/
|
|
49
|
+
"@turbo/utils": "0.0.0",
|
|
50
|
+
"@turbo/workspaces": "2.9.11"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "tsdown",
|