create-turbo 2.0.9 → 2.0.10-canary.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cli.js +3 -3
- package/package.json +5 -7
package/dist/cli.js
CHANGED
@@ -27,7 +27,7 @@ Please report this to https://github.com/szmarczak/http2-wrapper/`);m(y)}return}
|
|
27
27
|
`).reverse(),u=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split(`
|
28
28
|
`).reverse();for(;u.length!==0&&u[0]===a[0];)a.shift();this.stack=`${this.stack.slice(0,o)}${a.reverse().join(`
|
29
29
|
`)}${u.reverse().join(`
|
30
|
-
`)}`}}};ke.RequestError=Ue;var Nl=class extends Ue{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}};ke.MaxRedirectsError=Nl;var Ml=class extends Ue{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}};ke.HTTPError=Ml;var jl=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}};ke.CacheError=jl;var ql=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}};ke.UploadError=ql;var Ul=class extends Ue{constructor(e,r,n){super(e.message,e,n),this.name="TimeoutError",this.event=e.event,this.timings=r}};ke.TimeoutError=Ul;var Sa=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="ReadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}};ke.ReadError=Sa;var Hl=class extends Ue{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e),this.name="UnsupportedProtocolError",this.code="ERR_UNSUPPORTED_PROTOCOL"}};ke.UnsupportedProtocolError=Hl;var qq=["socket","connect","continue","information","upgrade","timeout"],$l=class extends _R.Duplex{constructor(e,r={},n){super({autoDestroy:!1,highWaterMark:0}),this[Js]=0,this[Qs]=0,this.requestInitialized=!1,this[Il]=new Set,this.redirects=[],this[eo]=!1,this[Ll]=!1,this[xa]=[],this.retryCount=0,this._progressCallbacks=[];let i=()=>this._unlockWrite(),s=()=>this._lockWrite();this.on("pipe",c=>{c.prependListener("data",i),c.on("data",s),c.prependListener("end",i),c.on("end",s)}),this.on("unpipe",c=>{c.off("data",i),c.off("data",s),c.off("end",i),c.off("end",s)}),this.on("pipe",c=>{c instanceof yy.IncomingMessage&&(this.options.headers={...c.headers,...this.options.headers})});let{json:o,body:a,form:u}=r;if((o||a||u)&&this._lockWrite(),ke.kIsNormalizedAlready in r)this.options=r;else try{this.options=this.constructor.normalizeArguments(e,r,n)}catch(c){Y.default.nodeStream(r.body)&&r.body.destroy(),this.destroy(c);return}(async()=>{var c;try{this.options.body instanceof bq.ReadStream&&await Nq(this.options.body);let{url:l}=this.options;if(!l)throw new TypeError("Missing `url` property");if(this.requestUrl=l.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(c=this[nt])===null||c===void 0||c.destroy();return}for(let h of this[xa])h();this[xa].length=0,this.requestInitialized=!0}catch(l){if(l instanceof Ue){this._beforeError(l);return}this.destroyed||this.destroy(l)}})()}static normalizeArguments(e,r,n){var i,s,o,a,u;let c=r;if(Y.default.object(e)&&!Y.default.urlInstance(e))r={...n,...e,...r};else{if(e&&r&&r.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");r={...n,...r},e!==void 0&&(r.url=e),Y.default.urlInstance(r.url)&&(r.url=new Bn.URL(r.url.toString()))}if(r.cache===!1&&(r.cache=void 0),r.dnsCache===!1&&(r.dnsCache=void 0),Y.assert.any([Y.default.string,Y.default.undefined],r.method),Y.assert.any([Y.default.object,Y.default.undefined],r.headers),Y.assert.any([Y.default.string,Y.default.urlInstance,Y.default.undefined],r.prefixUrl),Y.assert.any([Y.default.object,Y.default.undefined],r.cookieJar),Y.assert.any([Y.default.object,Y.default.string,Y.default.undefined],r.searchParams),Y.assert.any([Y.default.object,Y.default.string,Y.default.undefined],r.cache),Y.assert.any([Y.default.object,Y.default.number,Y.default.undefined],r.timeout),Y.assert.any([Y.default.object,Y.default.undefined],r.context),Y.assert.any([Y.default.object,Y.default.undefined],r.hooks),Y.assert.any([Y.default.boolean,Y.default.undefined],r.decompress),Y.assert.any([Y.default.boolean,Y.default.undefined],r.ignoreInvalidCookies),Y.assert.any([Y.default.boolean,Y.default.undefined],r.followRedirect),Y.assert.any([Y.default.number,Y.default.undefined],r.maxRedirects),Y.assert.any([Y.default.boolean,Y.default.undefined],r.throwHttpErrors),Y.assert.any([Y.default.boolean,Y.default.undefined],r.http2),Y.assert.any([Y.default.boolean,Y.default.undefined],r.allowGetBody),Y.assert.any([Y.default.string,Y.default.undefined],r.localAddress),Y.assert.any([SR.isDnsLookupIpVersion,Y.default.undefined],r.dnsLookupIpVersion),Y.assert.any([Y.default.object,Y.default.undefined],r.https),Y.assert.any([Y.default.boolean,Y.default.undefined],r.rejectUnauthorized),r.https&&(Y.assert.any([Y.default.boolean,Y.default.undefined],r.https.rejectUnauthorized),Y.assert.any([Y.default.function_,Y.default.undefined],r.https.checkServerIdentity),Y.assert.any([Y.default.string,Y.default.object,Y.default.array,Y.default.undefined],r.https.certificateAuthority),Y.assert.any([Y.default.string,Y.default.object,Y.default.array,Y.default.undefined],r.https.key),Y.assert.any([Y.default.string,Y.default.object,Y.default.array,Y.default.undefined],r.https.certificate),Y.assert.any([Y.default.string,Y.default.undefined],r.https.passphrase),Y.assert.any([Y.default.string,Y.default.buffer,Y.default.array,Y.default.undefined],r.https.pfx)),Y.assert.any([Y.default.object,Y.default.undefined],r.cacheOptions),Y.default.string(r.method)?r.method=r.method.toUpperCase():r.method="GET",r.headers===(n==null?void 0:n.headers)?r.headers={...r.headers}:r.headers=Aq({...n==null?void 0:n.headers,...r.headers}),"slashes"in r)throw new TypeError("The legacy `url.Url` has been deprecated. Use `URL` instead.");if("auth"in r)throw new TypeError("Parameter `auth` is deprecated. Use `username` / `password` instead.");if("searchParams"in r&&r.searchParams&&r.searchParams!==(n==null?void 0:n.searchParams)){let d;if(Y.default.string(r.searchParams)||r.searchParams instanceof Bn.URLSearchParams)d=new Bn.URLSearchParams(r.searchParams);else{Lq(r.searchParams),d=new Bn.URLSearchParams;for(let m in r.searchParams){let y=r.searchParams[m];y===null?d.append(m,""):y!==void 0&&d.append(m,y)}}(i=n==null?void 0:n.searchParams)===null||i===void 0||i.forEach((m,y)=>{d.has(y)||d.append(y,m)}),r.searchParams=d}if(r.username=(s=r.username)!==null&&s!==void 0?s:"",r.password=(o=r.password)!==null&&o!==void 0?o:"",Y.default.undefined(r.prefixUrl)?r.prefixUrl=(a=n==null?void 0:n.prefixUrl)!==null&&a!==void 0?a:"":(r.prefixUrl=r.prefixUrl.toString(),r.prefixUrl!==""&&!r.prefixUrl.endsWith("/")&&(r.prefixUrl+="/")),Y.default.string(r.url)){if(r.url.startsWith("/"))throw new Error("`input` must not start with a slash when using `prefixUrl`");r.url=xR.default(r.prefixUrl+r.url,r)}else(Y.default.undefined(r.url)&&r.prefixUrl!==""||r.protocol)&&(r.url=xR.default(r.prefixUrl,r));if(r.url){"port"in r&&delete r.port;let{prefixUrl:d}=r;Object.defineProperty(r,"prefixUrl",{set:y=>{let p=r.url;if(!p.href.startsWith(y))throw new Error(`Cannot change \`prefixUrl\` from ${d} to ${y}: ${p.href}`);r.url=new Bn.URL(y+p.href.slice(d.length)),d=y},get:()=>d});let{protocol:m}=r.url;if(m==="unix:"&&(m="http:",r.url=new Bn.URL(`http://unix${r.url.pathname}${r.url.search}`)),r.searchParams&&(r.url.search=r.searchParams.toString()),m!=="http:"&&m!=="https:")throw new Hl(r);r.username===""?r.username=r.url.username:r.url.username=r.username,r.password===""?r.password=r.url.password:r.url.password=r.password}let{cookieJar:l}=r;if(l){let{setCookie:d,getCookieString:m}=l;Y.assert.function_(d),Y.assert.function_(m),d.length===4&&m.length===0&&(d=gR.promisify(d.bind(r.cookieJar)),m=gR.promisify(m.bind(r.cookieJar)),r.cookieJar={setCookie:d,getCookieString:m})}let{cache:h}=r;if(h&&(by.has(h)||by.set(h,new vR((d,m)=>{let y=d[nt](d,m);return Y.default.promise(y)&&(y.once=(p,E)=>{if(p==="error")y.catch(E);else if(p==="abort")(async()=>{try{(await y).once("abort",E)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${p}`);return y}),y},h))),r.cacheOptions={...r.cacheOptions},r.dnsCache===!0)gy||(gy=new wq.default),r.dnsCache=gy;else if(!Y.default.undefined(r.dnsCache)&&!r.dnsCache.lookup)throw new TypeError(`Parameter \`dnsCache\` must be a CacheableLookup instance or a boolean, got ${Y.default(r.dnsCache)}`);Y.default.number(r.timeout)?r.timeout={request:r.timeout}:n&&r.timeout!==n.timeout?r.timeout={...n.timeout,...r.timeout}:r.timeout={...r.timeout},r.context||(r.context={});let f=r.hooks===(n==null?void 0:n.hooks);r.hooks={...r.hooks};for(let d of ke.knownHookEvents)if(d in r.hooks)if(Y.default.array(r.hooks[d]))r.hooks[d]=[...r.hooks[d]];else throw new TypeError(`Parameter \`${d}\` must be an Array, got ${Y.default(r.hooks[d])}`);else r.hooks[d]=[];if(n&&!f)for(let d of ke.knownHookEvents)n.hooks[d].length>0&&(r.hooks[d]=[...n.hooks[d],...r.hooks[d]]);if("family"in r&&Nn.default('"options.family" was never documented, please use "options.dnsLookupIpVersion"'),n!=null&&n.https&&(r.https={...n.https,...r.https}),"rejectUnauthorized"in r&&Nn.default('"options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"'),"checkServerIdentity"in r&&Nn.default('"options.checkServerIdentity" was never documented, please use "options.https.checkServerIdentity"'),"ca"in r&&Nn.default('"options.ca" was never documented, please use "options.https.certificateAuthority"'),"key"in r&&Nn.default('"options.key" was never documented, please use "options.https.key"'),"cert"in r&&Nn.default('"options.cert" was never documented, please use "options.https.certificate"'),"passphrase"in r&&Nn.default('"options.passphrase" was never documented, please use "options.https.passphrase"'),"pfx"in r&&Nn.default('"options.pfx" was never documented, please use "options.https.pfx"'),"followRedirects"in r)throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.");if(r.agent){for(let d in r.agent)if(d!=="http"&&d!=="https"&&d!=="http2")throw new TypeError(`Expected the \`options.agent\` properties to be \`http\`, \`https\` or \`http2\`, got \`${d}\``)}return r.maxRedirects=(u=r.maxRedirects)!==null&&u!==void 0?u:0,ke.setNonEnumerableProperties([n,c],r),Fq.default(r,n)}_lockWrite(){let e=()=>{throw new TypeError("The payload has been already provided")};this.write=e,this.end=e}_unlockWrite(){this.write=super.write,this.end=super.end}async _finalizeBody(){let{options:e}=this,{headers:r}=e,n=!Y.default.undefined(e.form),i=!Y.default.undefined(e.json),s=!Y.default.undefined(e.body),o=n||i||s,a=ke.withoutBody.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=a,o){if(a)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);if([s,n,i].filter(u=>u).length>1)throw new TypeError("The `body`, `json` and `form` options are mutually exclusive");if(s&&!(e.body instanceof _R.Readable)&&!Y.default.string(e.body)&&!Y.default.buffer(e.body)&&!ER.default(e.body))throw new TypeError("The `body` option must be a stream.Readable, string or Buffer");if(n&&!Y.default.object(e.form))throw new TypeError("The `form` option must be an Object");{let u=!Y.default.string(r["content-type"]);s?(ER.default(e.body)&&u&&(r["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`),this[Mn]=e.body):n?(u&&(r["content-type"]="application/x-www-form-urlencoded"),this[Mn]=new Bn.URLSearchParams(e.form).toString()):(u&&(r["content-type"]="application/json"),this[Mn]=e.stringifyJson(e.json));let c=await Dq.default(this[Mn],e.headers);Y.default.undefined(r["content-length"])&&Y.default.undefined(r["transfer-encoding"])&&!a&&!Y.default.undefined(c)&&(r["content-length"]=String(c))}}else a?this._lockWrite():this._unlockWrite();this[Xs]=Number(r["content-length"])||void 0}async _onResponseBase(e){let{options:r}=this,{url:n}=r;this[RR]=e,r.decompress&&(e=xq(e));let i=e.statusCode,s=e;s.statusMessage=s.statusMessage?s.statusMessage:bR.STATUS_CODES[i],s.url=r.url.toString(),s.requestUrl=this.requestUrl,s.redirectUrls=this.redirects,s.request=this,s.isFromCache=e.fromCache||!1,s.ip=this.ip,s.retryCount=this.retryCount,this[DR]=s.isFromCache,this[Zs]=Number(e.headers["content-length"])||void 0,this[Bl]=e,e.once("end",()=>{this[Zs]=this[Js],this.emit("downloadProgress",this.downloadProgress)}),e.once("error",a=>{e.destroy(),this._beforeError(new Sa(a,this))}),e.once("aborted",()=>{this._beforeError(new Sa({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let o=e.headers["set-cookie"];if(Y.default.object(r.cookieJar)&&o){let a=o.map(async u=>r.cookieJar.setCookie(u,n.toString()));r.ignoreInvalidCookies&&(a=a.map(async u=>u.catch(()=>{})));try{await Promise.all(a)}catch(u){this._beforeError(u);return}}if(r.followRedirect&&e.headers.location&&Mq.has(i)){if(e.resume(),this[nt]&&(this[_y](),delete this[nt],this[AR]()),(i===303&&r.method!=="GET"&&r.method!=="HEAD"||!r.methodRewriting)&&(r.method="GET","body"in r&&delete r.body,"json"in r&&delete r.json,"form"in r&&delete r.form,this[Mn]=void 0,delete r.headers["content-length"]),this.redirects.length>=r.maxRedirects){this._beforeError(new Nl(this));return}try{let h=function(f){return f.protocol==="unix:"||f.hostname==="unix"},u=Buffer.from(e.headers.location,"binary").toString(),c=new Bn.URL(u,n),l=c.toString();if(decodeURI(l),!h(n)&&h(c)){this._beforeError(new Ue("Cannot redirect to UNIX socket",{},this));return}c.hostname!==n.hostname||c.port!==n.port?("host"in r.headers&&delete r.headers.host,"cookie"in r.headers&&delete r.headers.cookie,"authorization"in r.headers&&delete r.headers.authorization,(r.username||r.password)&&(r.username="",r.password="")):(c.username=r.username,c.password=r.password),this.redirects.push(l),r.url=c;for(let f of r.hooks.beforeRedirect)await f(r,s);this.emit("redirect",s,r),await this._makeRequest()}catch(u){this._beforeError(u);return}return}if(r.isStream&&r.throwHttpErrors&&!Oq.isResponseOk(s)){this._beforeError(new Ml(s));return}e.on("readable",()=>{this[Ll]&&this._read()}),this.on("resume",()=>{e.resume()}),this.on("pause",()=>{e.pause()}),e.once("end",()=>{this.push(null)}),this.emit("response",e);for(let a of this[Il])if(!a.headersSent){for(let u in e.headers){let c=r.decompress?u!=="content-encoding":!0,l=e.headers[u];c&&a.setHeader(u,l)}a.statusCode=i}}async _onResponse(e){try{await this._onResponseBase(e)}catch(r){this._beforeError(r)}}_onRequest(e){let{options:r}=this,{timeout:n,url:i}=r;Eq.default(e),this[_y]=wR.default(e,n,i);let s=r.cache?"cacheableResponse":"response";e.once(s,u=>{this._onResponse(u)}),e.once("error",u=>{var c;e.destroy(),(c=e.res)===null||c===void 0||c.removeAllListeners("end"),u=u instanceof wR.TimeoutError?new Ul(u,this.timings,this):new Ue(u.message,u,this),this._beforeError(u)}),this[AR]=Cq.default(e,this,qq),this[nt]=e,this.emit("uploadProgress",this.uploadProgress);let o=this[Mn],a=this.redirects.length===0?this:e;Y.default.nodeStream(o)?(o.pipe(a),o.once("error",u=>{this._beforeError(new ql(u,this))})):(this._unlockWrite(),Y.default.undefined(o)?(this._cannotHaveBody||this._noPipe)&&(a.end(),this._lockWrite()):(this._writeRequest(o,void 0,()=>{}),a.end(),this._lockWrite())),this.emit("request",e)}async _createCacheableRequest(e,r){return new Promise((n,i)=>{Object.assign(r,Rq.default(e)),delete r.url;let s,o=by.get(r.cache)(r,async a=>{a._readableState.autoDestroy=!1,s&&(await s).emit("cacheableResponse",a),n(a)});r.url=e,o.once("error",i),o.once("request",async a=>{s=a,n(s)})})}async _makeRequest(){var e,r,n,i,s;let{options:o}=this,{headers:a}=o;for(let E in a)if(Y.default.undefined(a[E]))delete a[E];else if(Y.default.null_(a[E]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${E}\` header`);if(o.decompress&&Y.default.undefined(a["accept-encoding"])&&(a["accept-encoding"]=Iq?"gzip, deflate, br":"gzip, deflate"),o.cookieJar){let E=await o.cookieJar.getCookieString(o.url.toString());Y.default.nonEmptyString(E)&&(o.headers.cookie=E)}for(let E of o.hooks.beforeRequest){let R=await E(o);if(!Y.default.undefined(R)){o.request=()=>R;break}}o.body&&this[Mn]!==o.body&&(this[Mn]=o.body);let{agent:u,request:c,timeout:l,url:h}=o;if(o.dnsCache&&!("lookup"in o)&&(o.lookup=o.dnsCache.lookup),h.hostname==="unix"){let E=/(?<socketPath>.+?):(?<path>.+)/.exec(`${h.pathname}${h.search}`);if(E!=null&&E.groups){let{socketPath:R,path:T}=E.groups;Object.assign(o,{socketPath:R,path:T,host:""})}}let f=h.protocol==="https:",d;o.http2?d=Sq.auto:d=f?vq.request:bR.request;let m=(e=o.request)!==null&&e!==void 0?e:d,y=o.cache?this._createCacheableRequest:m;u&&!o.http2&&(o.agent=u[f?"https":"http"]),o[nt]=m,delete o.request,delete o.timeout;let p=o;if(p.shared=(r=o.cacheOptions)===null||r===void 0?void 0:r.shared,p.cacheHeuristic=(n=o.cacheOptions)===null||n===void 0?void 0:n.cacheHeuristic,p.immutableMinTimeToLive=(i=o.cacheOptions)===null||i===void 0?void 0:i.immutableMinTimeToLive,p.ignoreCargoCult=(s=o.cacheOptions)===null||s===void 0?void 0:s.ignoreCargoCult,o.dnsLookupIpVersion!==void 0)try{p.family=SR.dnsLookupIpVersionToFamily(o.dnsLookupIpVersion)}catch{throw new Error("Invalid `dnsLookupIpVersion` option value")}o.https&&("rejectUnauthorized"in o.https&&(p.rejectUnauthorized=o.https.rejectUnauthorized),o.https.checkServerIdentity&&(p.checkServerIdentity=o.https.checkServerIdentity),o.https.certificateAuthority&&(p.ca=o.https.certificateAuthority),o.https.certificate&&(p.cert=o.https.certificate),o.https.key&&(p.key=o.https.key),o.https.passphrase&&(p.passphrase=o.https.passphrase),o.https.pfx&&(p.pfx=o.https.pfx));try{let E=await y(h,p);Y.default.undefined(E)&&(E=d(h,p)),o.request=c,o.timeout=l,o.agent=u,o.https&&("rejectUnauthorized"in o.https&&delete p.rejectUnauthorized,o.https.checkServerIdentity&&delete p.checkServerIdentity,o.https.certificateAuthority&&delete p.ca,o.https.certificate&&delete p.cert,o.https.key&&delete p.key,o.https.passphrase&&delete p.passphrase,o.https.pfx&&delete p.pfx),Bq(E)?this._onRequest(E):this.writable?(this.once("finish",()=>{this._onResponse(E)}),this._unlockWrite(),this.end(),this._lockWrite()):this._onResponse(E)}catch(E){throw E instanceof vR.CacheError?new jl(E,this):new Ue(E.message,E,this)}}async _error(e){try{for(let r of this.options.hooks.beforeError)e=await r(e)}catch(r){e=new Ue(r.message,r,this)}this.destroy(e)}_beforeError(e){if(this[eo])return;let{options:r}=this,n=this.retryCount+1;this[eo]=!0,e instanceof Ue||(e=new Ue(e.message,e,this));let i=e,{response:s}=i;(async()=>{if(s&&!s.body){s.setEncoding(this._readableState.encoding);try{s.rawBody=await Tq.default(s),s.body=s.rawBody.toString()}catch{}}if(this.listenerCount("retry")!==0){let o;try{let a;s&&"retry-after"in s.headers&&(a=Number(s.headers["retry-after"]),Number.isNaN(a)?(a=Date.parse(s.headers["retry-after"])-Date.now(),a<=0&&(a=1)):a*=1e3),o=await r.retry.calculateDelay({attemptCount:n,retryOptions:r.retry,error:i,retryAfter:a,computedValue:Pq.default({attemptCount:n,retryOptions:r.retry,error:i,retryAfter:a,computedValue:0})})}catch(a){this._error(new Ue(a.message,a,this));return}if(o){let a=async()=>{try{for(let u of this.options.hooks.beforeRetry)await u(this.options,i,n)}catch(u){this._error(new Ue(u.message,e,this));return}this.destroyed||(this.destroy(),this.emit("retry",n,e))};this[kR]=setTimeout(a,o);return}}this._error(i)})()}_read(){this[Ll]=!0;let e=this[Bl];if(e&&!this[eo]){e.readableLength&&(this[Ll]=!1);let r;for(;(r=e.read())!==null;){this[Js]+=r.length,this[CR]=!0;let n=this.downloadProgress;n.percent<1&&this.emit("downloadProgress",n),this.push(r)}}}_write(e,r,n){let i=()=>{this._writeRequest(e,r,n)};this.requestInitialized?i():this[xa].push(i)}_writeRequest(e,r,n){this[nt].destroyed||(this._progressCallbacks.push(()=>{this[Qs]+=Buffer.byteLength(e,r);let i=this.uploadProgress;i.percent<1&&this.emit("uploadProgress",i)}),this[nt].write(e,r,i=>{!i&&this._progressCallbacks.length>0&&this._progressCallbacks.shift()(),n(i)}))}_final(e){let r=()=>{for(;this._progressCallbacks.length!==0;)this._progressCallbacks.shift()();if(!(nt in this)){e();return}if(this[nt].destroyed){e();return}this[nt].end(n=>{n||(this[Xs]=this[Qs],this.emit("uploadProgress",this.uploadProgress),this[nt].emit("upload-complete")),e(n)})};this.requestInitialized?r():this[xa].push(r)}_destroy(e,r){var n;this[eo]=!0,clearTimeout(this[kR]),nt in this&&(this[_y](),!((n=this[Bl])===null||n===void 0)&&n.complete||this[nt].destroy()),e!==null&&!Y.default.undefined(e)&&!(e instanceof Ue)&&(e=new Ue(e.message,e,this)),r(e)}get _isAboutToError(){return this[eo]}get ip(){var e;return(e=this.socket)===null||e===void 0?void 0:e.remoteAddress}get aborted(){var e,r,n;return((r=(e=this[nt])===null||e===void 0?void 0:e.destroyed)!==null&&r!==void 0?r:this.destroyed)&&!(!((n=this[RR])===null||n===void 0)&&n.complete)}get socket(){var e,r;return(r=(e=this[nt])===null||e===void 0?void 0:e.socket)!==null&&r!==void 0?r:void 0}get downloadProgress(){let e;return this[Zs]?e=this[Js]/this[Zs]:this[Zs]===this[Js]?e=1:e=0,{percent:e,transferred:this[Js],total:this[Zs]}}get uploadProgress(){let e;return this[Xs]?e=this[Qs]/this[Xs]:this[Xs]===this[Qs]?e=1:e=0,{percent:e,transferred:this[Qs],total:this[Xs]}}get timings(){var e;return(e=this[nt])===null||e===void 0?void 0:e.timings}get isFromCache(){return this[DR]}pipe(e,r){if(this[CR])throw new Error("Failed to pipe. The response has been emitted already.");return e instanceof yy.ServerResponse&&this[Il].add(e),super.pipe(e,r)}unpipe(e){return e instanceof yy.ServerResponse&&this[Il].delete(e),super.unpipe(e),this}};ke.default=$l});var Da=A(cr=>{"use strict";var Uq=cr&&cr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Hq=cr&&cr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Uq(e,t,r)};Object.defineProperty(cr,"__esModule",{value:!0});cr.CancelError=cr.ParseError=void 0;var TR=Aa(),vy=class extends TR.RequestError{constructor(e,r){let{options:n}=r.request;super(`${e.message} in "${n.url.toString()}"`,e,r.request),this.name="ParseError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_BODY_PARSE_FAILURE":this.code}};cr.ParseError=vy;var Ey=class extends TR.RequestError{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}};cr.CancelError=Ey;Hq(Aa(),cr)});var FR=A(wy=>{"use strict";Object.defineProperty(wy,"__esModule",{value:!0});var OR=Da(),$q=(t,e,r,n)=>{let{rawBody:i}=t;try{if(e==="text")return i.toString(n);if(e==="json")return i.length===0?"":r(i.toString());if(e==="buffer")return i;throw new OR.ParseError({message:`Unknown body type '${e}'`,name:"Error"},t)}catch(s){throw new OR.ParseError(s,t)}};wy.default=$q});var xy=A(jn=>{"use strict";var Gq=jn&&jn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),zq=jn&&jn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Gq(e,t,r)};Object.defineProperty(jn,"__esModule",{value:!0});var Wq=require("events"),Vq=nn(),Yq=TC(),Gl=Da(),PR=FR(),IR=Aa(),Kq=sy(),Zq=fy(),LR=dy(),Jq=["request","response","redirect","uploadProgress","downloadProgress"];function BR(t){let e,r,n=new Wq.EventEmitter,i=new Yq((o,a,u)=>{let c=l=>{let h=new IR.default(void 0,t);h.retryCount=l,h._noPipe=!0,u(()=>h.destroy()),u.shouldReject=!1,u(()=>a(new Gl.CancelError(h))),e=h,h.once("response",async m=>{var y;if(m.retryCount=l,m.request.aborted)return;let p;try{p=await Zq.default(h),m.rawBody=p}catch{return}if(h._isAboutToError)return;let E=((y=m.headers["content-encoding"])!==null&&y!==void 0?y:"").toLowerCase(),R=["gzip","deflate","br"].includes(E),{options:T}=h;if(R&&!T.decompress)m.body=p;else try{m.body=PR.default(m,T.responseType,T.parseJson,T.encoding)}catch(P){if(m.body=p.toString(),LR.isResponseOk(m)){h._beforeError(P);return}}try{for(let[P,F]of T.hooks.afterResponse.entries())m=await F(m,async M=>{let x=IR.default.normalizeArguments(void 0,{...M,retry:{calculateDelay:()=>0},throwHttpErrors:!1,resolveBodyOnly:!1},T);x.hooks.afterResponse=x.hooks.afterResponse.slice(0,P);for(let j of x.hooks.beforeRetry)await j(x);let D=BR(x);return u(()=>{D.catch(()=>{}),D.cancel()}),D})}catch(P){h._beforeError(new Gl.RequestError(P.message,P,h));return}if(r=m,!LR.isResponseOk(m)){h._beforeError(new Gl.HTTPError(m));return}h.destroy(),o(h.options.resolveBodyOnly?m.body:m)});let f=m=>{if(i.isCanceled)return;let{options:y}=h;if(m instanceof Gl.HTTPError&&!y.throwHttpErrors){let{response:p}=m;o(h.options.resolveBodyOnly?p.body:p);return}a(m)};h.once("error",f);let d=h.options.body;h.once("retry",(m,y)=>{var p,E;if(d===((p=y.request)===null||p===void 0?void 0:p.options.body)&&Vq.default.nodeStream((E=y.request)===null||E===void 0?void 0:E.options.body)){f(y);return}c(m)}),Kq.default(h,n,Jq)};c(0)});i.on=(o,a)=>(n.on(o,a),i);let s=o=>{let a=(async()=>{await i;let{options:u}=r.request;return PR.default(r,o,u.parseJson,u.encoding)})();return Object.defineProperties(a,Object.getOwnPropertyDescriptors(i)),a};return i.json=()=>{let{headers:o}=e.options;return!e.writableFinished&&o.accept===void 0&&(o.accept="application/json"),s("json")},i.buffer=()=>s("buffer"),i.text=()=>s("text"),i}jn.default=BR;zq(Da(),jn)});var NR=A(Sy=>{"use strict";Object.defineProperty(Sy,"__esModule",{value:!0});var Xq=Da();function Qq(t,...e){let r=(async()=>{if(t instanceof Xq.RequestError)try{for(let i of e)if(i)for(let s of i)t=await s(t)}catch(i){t=i}throw t})(),n=()=>r;return r.json=n,r.text=n,r.buffer=n,r.on=n,r}Sy.default=Qq});var qR=A(Ay=>{"use strict";Object.defineProperty(Ay,"__esModule",{value:!0});var MR=nn();function jR(t){for(let e of Object.values(t))(MR.default.plainObject(e)||MR.default.array(e))&&jR(e);return Object.freeze(t)}Ay.default=jR});var HR=A(UR=>{"use strict";Object.defineProperty(UR,"__esModule",{value:!0})});var Dy=A(Qt=>{"use strict";var eU=Qt&&Qt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),tU=Qt&&Qt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eU(e,t,r)};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.defaultHandler=void 0;var $R=nn(),Xt=xy(),rU=NR(),Wl=Aa(),nU=qR(),iU={RequestError:Xt.RequestError,CacheError:Xt.CacheError,ReadError:Xt.ReadError,HTTPError:Xt.HTTPError,MaxRedirectsError:Xt.MaxRedirectsError,TimeoutError:Xt.TimeoutError,ParseError:Xt.ParseError,CancelError:Xt.CancelError,UnsupportedProtocolError:Xt.UnsupportedProtocolError,UploadError:Xt.UploadError},sU=async t=>new Promise(e=>{setTimeout(e,t)}),{normalizeArguments:zl}=Wl.default,GR=(...t)=>{let e;for(let r of t)e=zl(void 0,r,e);return e},oU=t=>t.isStream?new Wl.default(void 0,t):Xt.default(t),aU=t=>"defaults"in t&&"options"in t.defaults,uU=["get","post","put","patch","head","delete"];Qt.defaultHandler=(t,e)=>e(t);var zR=(t,e)=>{if(t)for(let r of t)r(e)},WR=t=>{t._rawHandlers=t.handlers,t.handlers=t.handlers.map(n=>(i,s)=>{let o,a=n(i,u=>(o=s(u),o));if(a!==o&&!i.isStream&&o){let u=a,{then:c,catch:l,finally:h}=u;Object.setPrototypeOf(u,Object.getPrototypeOf(o)),Object.defineProperties(u,Object.getOwnPropertyDescriptors(o)),u.then=c,u.catch=l,u.finally=h}return a});let e=(n,i={},s)=>{var o,a;let u=0,c=l=>t.handlers[u++](l,u===t.handlers.length?oU:c);if($R.default.plainObject(n)){let l={...n,...i};Wl.setNonEnumerableProperties([n,i],l),i=l,n=void 0}try{let l;try{zR(t.options.hooks.init,i),zR((o=i.hooks)===null||o===void 0?void 0:o.init,i)}catch(f){l=f}let h=zl(n,i,s!=null?s:t.options);if(h[Wl.kIsNormalizedAlready]=!0,l)throw new Xt.RequestError(l.message,l,h);return c(h)}catch(l){if(i.isStream)throw l;return rU.default(l,t.options.hooks.beforeError,(a=i.hooks)===null||a===void 0?void 0:a.beforeError)}};e.extend=(...n)=>{let i=[t.options],s=[...t._rawHandlers],o;for(let a of n)aU(a)?(i.push(a.defaults.options),s.push(...a.defaults._rawHandlers),o=a.defaults.mutableDefaults):(i.push(a),"handlers"in a&&s.push(...a.handlers),o=a.mutableDefaults);return s=s.filter(a=>a!==Qt.defaultHandler),s.length===0&&s.push(Qt.defaultHandler),WR({options:GR(...i),handlers:s,mutableDefaults:!!o})};let r=async function*(n,i){let s=zl(n,i,t.options);s.resolveBodyOnly=!1;let o=s.pagination;if(!$R.default.object(o))throw new TypeError("`options.pagination` must be implemented");let a=[],{countLimit:u}=o,c=0;for(;c<o.requestLimit;){c!==0&&await sU(o.backoff);let l=await e(void 0,void 0,s),h=await o.transform(l),f=[];for(let m of h)if(o.filter(m,a,f)&&(!o.shouldContinue(m,a,f)||(yield m,o.stackAllItems&&a.push(m),f.push(m),--u<=0)))return;let d=o.paginate(l,a,f);if(d===!1)return;d===l.request.options?s=l.request.options:d!==void 0&&(s=zl(void 0,d,s)),c++}};e.paginate=r,e.paginate.all=async(n,i)=>{let s=[];for await(let o of r(n,i))s.push(o);return s},e.paginate.each=r,e.stream=(n,i)=>e(n,{...i,isStream:!0});for(let n of uU)e[n]=(i,s)=>e(i,{...s,method:n}),e.stream[n]=(i,s)=>e(i,{...s,method:n,isStream:!0});return Object.assign(e,iU),Object.defineProperty(e,"defaults",{value:t.mutableDefaults?t:nU.default(t),writable:t.mutableDefaults,configurable:t.mutableDefaults,enumerable:!0}),e.mergeOptions=GR,e};Qt.default=WR;tU(HR(),Qt)});var Ry=A((sn,Vl)=>{"use strict";var cU=sn&&sn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),VR=sn&&sn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cU(e,t,r)};Object.defineProperty(sn,"__esModule",{value:!0});var lU=require("url"),YR=Dy(),hU={options:{method:"GET",retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue:t})=>t},timeout:{},headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},hooks:{init:[],beforeRequest:[],beforeRedirect:[],beforeRetry:[],beforeError:[],afterResponse:[]},cache:void 0,dnsCache:void 0,decompress:!0,throwHttpErrors:!0,followRedirect:!0,isStream:!1,responseType:"text",resolveBodyOnly:!1,maxRedirects:10,prefixUrl:"",methodRewriting:!0,ignoreInvalidCookies:!1,context:{},http2:!1,allowGetBody:!1,https:void 0,pagination:{transform:t=>t.request.options.responseType==="json"?t.body:JSON.parse(t.body),paginate:t=>{if(!Reflect.has(t.headers,"link"))return!1;let e=t.headers.link.split(","),r;for(let n of e){let i=n.split(";");if(i[1].includes("next")){r=i[0].trimStart().trim(),r=r.slice(1,-1);break}}return r?{url:new lU.URL(r)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:1/0,backoff:0,requestLimit:1e4,stackAllItems:!0},parseJson:t=>JSON.parse(t),stringifyJson:t=>JSON.stringify(t),cacheOptions:{}},handlers:[YR.defaultHandler],mutableDefaults:!1},Cy=YR.default(hU);sn.default=Cy;Vl.exports=Cy;Vl.exports.default=Cy;Vl.exports.__esModule=!0;VR(Dy(),sn);VR(xy(),sn)});var tk=A((wK,ek)=>{function er(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}ek.exports=er;er.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};er.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};er.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1);else return!1;var n=this;return this._timer=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r),this._options.unref&&this._timer.unref(),!0};er.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};er.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};er.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};er.prototype.start=er.prototype.try;er.prototype.errors=function(){return this._errors};er.prototype.attempts=function(){return this._attempts};er.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],s=i.message,o=(t[s]||0)+1;t[s]=o,o>=r&&(e=i,r=o)}return e}});var rk=A(Ei=>{var dU=tk();Ei.operation=function(t){var e=Ei.timeouts(t);return new dU(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};Ei.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(s,o){return s-o}),n};Ei.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};Ei.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var s=r[i],o=t[s];t[s]=function(u){var c=Ei.operation(e),l=Array.prototype.slice.call(arguments,1),h=l.pop();l.push(function(f){c.retry(f)||(f&&(arguments[0]=c.mainError()),h.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,o),t[s].options=e}}});var ik=A((SK,nk)=>{nk.exports=rk()});var ok=A((AK,sk)=>{var pU=ik();function mU(t,e){function r(n,i){var s=e||{},o;"randomize"in s||(s.randomize=!0),o=pU.operation(s);function a(l){i(l||new Error("Aborted"))}function u(l,h){if(l.bail){a(l);return}o.retry(l)?s.onRetry&&s.onRetry(l,h):i(o.mainError())}function c(l){var h;try{h=t(a,l)}catch(f){u(f,l);return}Promise.resolve(h).then(n).catch(function(d){u(d,l)})}o.attempt(c)}return new Promise(r)}sk.exports=mU});var wk=A(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});function m7(t){return t&&t.__esModule?t:{default:t}}var _k=Object.defineProperty,yk=Object.getOwnPropertySymbols,y7=Object.prototype.hasOwnProperty,g7=Object.prototype.propertyIsEnumerable,gk=(t,e,r)=>e in t?_k(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_7=(t,e)=>{for(var r in e||(e={}))y7.call(e,r)&&gk(t,r,e[r]);if(yk)for(var r of yk(e))g7.call(e,r)&&gk(t,r,e[r]);return t},b7=(t,e)=>{for(var r in e)_k(t,r,{get:e[r],enumerable:!0})},v7=(t,e,r)=>new Promise((n,i)=>{var s=u=>{try{a(r.next(u))}catch(c){i(c)}},o=u=>{try{a(r.throw(u))}catch(c){i(c)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,o);a((r=r.apply(t,e)).next())}),bk={};b7(bk,{configDir:()=>Ek,darwinConfig:()=>Gy,getPathForPlatform:()=>Wy,getPlatform:()=>$y,linuxConfig:()=>rh,winConfig:()=>zy});var E7=require("fs/promises"),w7=require("path"),vk=m7(w7);function $y(){return process.platform}function rh(){if(process.env.XDG_CONFIG_HOME!==void 0)return process.env.XDG_CONFIG_HOME;if(process.env.HOME!==void 0)return vk.default.join(process.env.HOME,".config")}function Gy(){if(process.env.HOME!==void 0)return vk.default.join(process.env.HOME,"/Library/Application Support")}function zy(){return process.env.APPDATA}function Wy({platform:t}){switch(t){case"linux":return rh();case"darwin":return Gy();case"win32":return zy();default:return rh()}}function Ek(){return v7(this,arguments,function*(t={}){var e;let r=(e=t.platform)!=null?e:$y(),n=Wy({platform:r});if(n!==void 0){if(t.validate===!1)return n;try{return yield E7.stat.call(void 0,n),n}catch{return}}})}Or.__spreadValues=_7;Or.getPlatform=$y;Or.linuxConfig=rh;Or.darwinConfig=Gy;Or.winConfig=zy;Or.getPathForPlatform=Wy;Or.configDir=Ek;Or.config_dir_exports=bk});var xk=A(Vy=>{"use strict";Object.defineProperty(Vy,"__esModule",{value:!0});var x7=wk();Vy.configDir=x7.configDir});var kk=A((uZ,I7)=>{I7.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var Fk=A(qt=>{"use strict";var Ok=kk(),Ke=process.env;Object.defineProperty(qt,"_vendors",{value:Ok.map(function(t){return t.constant})});qt.name=null;qt.isPR=null;Ok.forEach(function(t){let r=(Array.isArray(t.env)?t.env:[t.env]).every(function(n){return Tk(n)});if(qt[t.constant]=r,!!r)switch(qt.name=t.name,typeof t.pr){case"string":qt.isPR=!!Ke[t.pr];break;case"object":"env"in t.pr?qt.isPR=t.pr.env in Ke&&Ke[t.pr.env]!==t.pr.ne:"any"in t.pr?qt.isPR=t.pr.any.some(function(n){return!!Ke[n]}):qt.isPR=Tk(t.pr);break;default:qt.isPR=null}});qt.isCI=!!(Ke.CI!=="false"&&(Ke.BUILD_ID||Ke.BUILD_NUMBER||Ke.CI||Ke.CI_APP_ID||Ke.CI_BUILD_ID||Ke.CI_BUILD_NUMBER||Ke.CI_NAME||Ke.CONTINUOUS_INTEGRATION||Ke.RUN_ID||qt.name));function Tk(t){return typeof t=="string"?!!Ke[t]:"env"in t?Ke[t.env]&&Ke[t.env].includes(t.includes):"any"in t?t.any.some(function(e){return!!Ke[e]}):Object.keys(t).every(function(e){return Ke[e]===t[e]})}});var nh=A((AZ,U7)=>{U7.exports={name:"create-turbo",version:"2.0.9",description:"Create a new Turborepo",homepage:"https://turbo.build/repo",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turbo",directory:"packages/create-turbo"},bugs:{url:"https://github.com/vercel/turbo/issues"},bin:{"create-turbo":"dist/cli.js"},scripts:{build:"tsup",test:"jest",lint:"eslint src/","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{commander:"^11.0.0","fs-extra":"^11.1.1",inquirer:"^8.0.0",picocolors:"1.0.1","proxy-agent":"^6.2.2",rimraf:"^3.0.2",semver:"^7.3.8","update-check":"^1.5.4"},devDependencies:{"@turbo/eslint-config":"workspace:*","@turbo/telemetry":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/utils":"workspace:*","@turbo/workspaces":"workspace:*","@types/fs-extra":"^9.0.13","@types/inquirer":"^7.3.1","@types/jest":"^27.4.0","@types/node":"^18.17.2","@types/rimraf":"^3.0.2","@types/semver":"^7.3.9",jest:"^27.4.3","ts-jest":"^27.1.1",tsup:"^6.7.0",typescript:"^5.2.2"},files:["dist"]}});var KT=pe(require("http")),ZT=pe(require("https")),wg=require("picocolors"),$a=require("commander");var pO=pe(Tg());function wh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function So(t){return So=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},So(t)}function xh(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Sh(t,e){if(e&&(So(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xh(t)}function Zn(t){return Zn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Zn(t)}function Nr(t,e){return Nr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Nr(t,e)}function Ah(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nr(t,e)}function Dh(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Ch(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Mi(t,e,r){return Ch()?Mi=Reflect.construct.bind():Mi=function(i,s,o){var a=[null];a.push.apply(a,s);var u=Function.bind.apply(i,a),c=new u;return o&&Nr(c,o.prototype),c},Mi.apply(null,arguments)}function Ao(t){var e=typeof Map=="function"?new Map:void 0;return Ao=function(n){if(n===null||!Dh(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return Mi(n,arguments,Zn(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Nr(i,n)},Ao(t)}var Yg=pe(Vg());var mO=pe(require("fs-extra")),gG=function(t){Ah(e,t);function e(r){var n;return wh(this,e),n=Sh(this,Zn(e).call(this,"No package.json could be found upwards from the directory ".concat(r))),n.directory=r,n}return e}(Ao(Error));var yO=pe(require("fs")),gO=pe(require("path"));var P3=pe(require("fs")),I3=pe(require("path"));function l_(t){return typeof t=="undefined"||t===null}function vO(t){return typeof t=="object"&&t!==null}function EO(t){return Array.isArray(t)?t:l_(t)?[]:[t]}function wO(t,e){var r,n,i,s;if(e)for(s=Object.keys(e),r=0,n=s.length;r<n;r+=1)i=s[r],t[i]=e[i];return t}function xO(t,e){var r="",n;for(n=0;n<e;n+=1)r+=t;return r}function SO(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var AO=l_,DO=vO,CO=EO,RO=xO,kO=SO,TO=wO,Ve={isNothing:AO,isObject:DO,toArray:CO,repeat:RO,isNegativeZero:kO,extend:TO};function h_(t,e){var r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
|
30
|
+
`)}`}}};ke.RequestError=Ue;var Nl=class extends Ue{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}};ke.MaxRedirectsError=Nl;var Ml=class extends Ue{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}};ke.HTTPError=Ml;var jl=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}};ke.CacheError=jl;var ql=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}};ke.UploadError=ql;var Ul=class extends Ue{constructor(e,r,n){super(e.message,e,n),this.name="TimeoutError",this.event=e.event,this.timings=r}};ke.TimeoutError=Ul;var Sa=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="ReadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}};ke.ReadError=Sa;var Hl=class extends Ue{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e),this.name="UnsupportedProtocolError",this.code="ERR_UNSUPPORTED_PROTOCOL"}};ke.UnsupportedProtocolError=Hl;var qq=["socket","connect","continue","information","upgrade","timeout"],$l=class extends _R.Duplex{constructor(e,r={},n){super({autoDestroy:!1,highWaterMark:0}),this[Js]=0,this[Qs]=0,this.requestInitialized=!1,this[Il]=new Set,this.redirects=[],this[eo]=!1,this[Ll]=!1,this[xa]=[],this.retryCount=0,this._progressCallbacks=[];let i=()=>this._unlockWrite(),s=()=>this._lockWrite();this.on("pipe",c=>{c.prependListener("data",i),c.on("data",s),c.prependListener("end",i),c.on("end",s)}),this.on("unpipe",c=>{c.off("data",i),c.off("data",s),c.off("end",i),c.off("end",s)}),this.on("pipe",c=>{c instanceof yy.IncomingMessage&&(this.options.headers={...c.headers,...this.options.headers})});let{json:o,body:a,form:u}=r;if((o||a||u)&&this._lockWrite(),ke.kIsNormalizedAlready in r)this.options=r;else try{this.options=this.constructor.normalizeArguments(e,r,n)}catch(c){Y.default.nodeStream(r.body)&&r.body.destroy(),this.destroy(c);return}(async()=>{var c;try{this.options.body instanceof bq.ReadStream&&await Nq(this.options.body);let{url:l}=this.options;if(!l)throw new TypeError("Missing `url` property");if(this.requestUrl=l.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(c=this[nt])===null||c===void 0||c.destroy();return}for(let h of this[xa])h();this[xa].length=0,this.requestInitialized=!0}catch(l){if(l instanceof Ue){this._beforeError(l);return}this.destroyed||this.destroy(l)}})()}static normalizeArguments(e,r,n){var i,s,o,a,u;let c=r;if(Y.default.object(e)&&!Y.default.urlInstance(e))r={...n,...e,...r};else{if(e&&r&&r.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");r={...n,...r},e!==void 0&&(r.url=e),Y.default.urlInstance(r.url)&&(r.url=new Bn.URL(r.url.toString()))}if(r.cache===!1&&(r.cache=void 0),r.dnsCache===!1&&(r.dnsCache=void 0),Y.assert.any([Y.default.string,Y.default.undefined],r.method),Y.assert.any([Y.default.object,Y.default.undefined],r.headers),Y.assert.any([Y.default.string,Y.default.urlInstance,Y.default.undefined],r.prefixUrl),Y.assert.any([Y.default.object,Y.default.undefined],r.cookieJar),Y.assert.any([Y.default.object,Y.default.string,Y.default.undefined],r.searchParams),Y.assert.any([Y.default.object,Y.default.string,Y.default.undefined],r.cache),Y.assert.any([Y.default.object,Y.default.number,Y.default.undefined],r.timeout),Y.assert.any([Y.default.object,Y.default.undefined],r.context),Y.assert.any([Y.default.object,Y.default.undefined],r.hooks),Y.assert.any([Y.default.boolean,Y.default.undefined],r.decompress),Y.assert.any([Y.default.boolean,Y.default.undefined],r.ignoreInvalidCookies),Y.assert.any([Y.default.boolean,Y.default.undefined],r.followRedirect),Y.assert.any([Y.default.number,Y.default.undefined],r.maxRedirects),Y.assert.any([Y.default.boolean,Y.default.undefined],r.throwHttpErrors),Y.assert.any([Y.default.boolean,Y.default.undefined],r.http2),Y.assert.any([Y.default.boolean,Y.default.undefined],r.allowGetBody),Y.assert.any([Y.default.string,Y.default.undefined],r.localAddress),Y.assert.any([SR.isDnsLookupIpVersion,Y.default.undefined],r.dnsLookupIpVersion),Y.assert.any([Y.default.object,Y.default.undefined],r.https),Y.assert.any([Y.default.boolean,Y.default.undefined],r.rejectUnauthorized),r.https&&(Y.assert.any([Y.default.boolean,Y.default.undefined],r.https.rejectUnauthorized),Y.assert.any([Y.default.function_,Y.default.undefined],r.https.checkServerIdentity),Y.assert.any([Y.default.string,Y.default.object,Y.default.array,Y.default.undefined],r.https.certificateAuthority),Y.assert.any([Y.default.string,Y.default.object,Y.default.array,Y.default.undefined],r.https.key),Y.assert.any([Y.default.string,Y.default.object,Y.default.array,Y.default.undefined],r.https.certificate),Y.assert.any([Y.default.string,Y.default.undefined],r.https.passphrase),Y.assert.any([Y.default.string,Y.default.buffer,Y.default.array,Y.default.undefined],r.https.pfx)),Y.assert.any([Y.default.object,Y.default.undefined],r.cacheOptions),Y.default.string(r.method)?r.method=r.method.toUpperCase():r.method="GET",r.headers===(n==null?void 0:n.headers)?r.headers={...r.headers}:r.headers=Aq({...n==null?void 0:n.headers,...r.headers}),"slashes"in r)throw new TypeError("The legacy `url.Url` has been deprecated. Use `URL` instead.");if("auth"in r)throw new TypeError("Parameter `auth` is deprecated. Use `username` / `password` instead.");if("searchParams"in r&&r.searchParams&&r.searchParams!==(n==null?void 0:n.searchParams)){let d;if(Y.default.string(r.searchParams)||r.searchParams instanceof Bn.URLSearchParams)d=new Bn.URLSearchParams(r.searchParams);else{Lq(r.searchParams),d=new Bn.URLSearchParams;for(let m in r.searchParams){let y=r.searchParams[m];y===null?d.append(m,""):y!==void 0&&d.append(m,y)}}(i=n==null?void 0:n.searchParams)===null||i===void 0||i.forEach((m,y)=>{d.has(y)||d.append(y,m)}),r.searchParams=d}if(r.username=(s=r.username)!==null&&s!==void 0?s:"",r.password=(o=r.password)!==null&&o!==void 0?o:"",Y.default.undefined(r.prefixUrl)?r.prefixUrl=(a=n==null?void 0:n.prefixUrl)!==null&&a!==void 0?a:"":(r.prefixUrl=r.prefixUrl.toString(),r.prefixUrl!==""&&!r.prefixUrl.endsWith("/")&&(r.prefixUrl+="/")),Y.default.string(r.url)){if(r.url.startsWith("/"))throw new Error("`input` must not start with a slash when using `prefixUrl`");r.url=xR.default(r.prefixUrl+r.url,r)}else(Y.default.undefined(r.url)&&r.prefixUrl!==""||r.protocol)&&(r.url=xR.default(r.prefixUrl,r));if(r.url){"port"in r&&delete r.port;let{prefixUrl:d}=r;Object.defineProperty(r,"prefixUrl",{set:y=>{let p=r.url;if(!p.href.startsWith(y))throw new Error(`Cannot change \`prefixUrl\` from ${d} to ${y}: ${p.href}`);r.url=new Bn.URL(y+p.href.slice(d.length)),d=y},get:()=>d});let{protocol:m}=r.url;if(m==="unix:"&&(m="http:",r.url=new Bn.URL(`http://unix${r.url.pathname}${r.url.search}`)),r.searchParams&&(r.url.search=r.searchParams.toString()),m!=="http:"&&m!=="https:")throw new Hl(r);r.username===""?r.username=r.url.username:r.url.username=r.username,r.password===""?r.password=r.url.password:r.url.password=r.password}let{cookieJar:l}=r;if(l){let{setCookie:d,getCookieString:m}=l;Y.assert.function_(d),Y.assert.function_(m),d.length===4&&m.length===0&&(d=gR.promisify(d.bind(r.cookieJar)),m=gR.promisify(m.bind(r.cookieJar)),r.cookieJar={setCookie:d,getCookieString:m})}let{cache:h}=r;if(h&&(by.has(h)||by.set(h,new vR((d,m)=>{let y=d[nt](d,m);return Y.default.promise(y)&&(y.once=(p,E)=>{if(p==="error")y.catch(E);else if(p==="abort")(async()=>{try{(await y).once("abort",E)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${p}`);return y}),y},h))),r.cacheOptions={...r.cacheOptions},r.dnsCache===!0)gy||(gy=new wq.default),r.dnsCache=gy;else if(!Y.default.undefined(r.dnsCache)&&!r.dnsCache.lookup)throw new TypeError(`Parameter \`dnsCache\` must be a CacheableLookup instance or a boolean, got ${Y.default(r.dnsCache)}`);Y.default.number(r.timeout)?r.timeout={request:r.timeout}:n&&r.timeout!==n.timeout?r.timeout={...n.timeout,...r.timeout}:r.timeout={...r.timeout},r.context||(r.context={});let f=r.hooks===(n==null?void 0:n.hooks);r.hooks={...r.hooks};for(let d of ke.knownHookEvents)if(d in r.hooks)if(Y.default.array(r.hooks[d]))r.hooks[d]=[...r.hooks[d]];else throw new TypeError(`Parameter \`${d}\` must be an Array, got ${Y.default(r.hooks[d])}`);else r.hooks[d]=[];if(n&&!f)for(let d of ke.knownHookEvents)n.hooks[d].length>0&&(r.hooks[d]=[...n.hooks[d],...r.hooks[d]]);if("family"in r&&Nn.default('"options.family" was never documented, please use "options.dnsLookupIpVersion"'),n!=null&&n.https&&(r.https={...n.https,...r.https}),"rejectUnauthorized"in r&&Nn.default('"options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"'),"checkServerIdentity"in r&&Nn.default('"options.checkServerIdentity" was never documented, please use "options.https.checkServerIdentity"'),"ca"in r&&Nn.default('"options.ca" was never documented, please use "options.https.certificateAuthority"'),"key"in r&&Nn.default('"options.key" was never documented, please use "options.https.key"'),"cert"in r&&Nn.default('"options.cert" was never documented, please use "options.https.certificate"'),"passphrase"in r&&Nn.default('"options.passphrase" was never documented, please use "options.https.passphrase"'),"pfx"in r&&Nn.default('"options.pfx" was never documented, please use "options.https.pfx"'),"followRedirects"in r)throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.");if(r.agent){for(let d in r.agent)if(d!=="http"&&d!=="https"&&d!=="http2")throw new TypeError(`Expected the \`options.agent\` properties to be \`http\`, \`https\` or \`http2\`, got \`${d}\``)}return r.maxRedirects=(u=r.maxRedirects)!==null&&u!==void 0?u:0,ke.setNonEnumerableProperties([n,c],r),Fq.default(r,n)}_lockWrite(){let e=()=>{throw new TypeError("The payload has been already provided")};this.write=e,this.end=e}_unlockWrite(){this.write=super.write,this.end=super.end}async _finalizeBody(){let{options:e}=this,{headers:r}=e,n=!Y.default.undefined(e.form),i=!Y.default.undefined(e.json),s=!Y.default.undefined(e.body),o=n||i||s,a=ke.withoutBody.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=a,o){if(a)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);if([s,n,i].filter(u=>u).length>1)throw new TypeError("The `body`, `json` and `form` options are mutually exclusive");if(s&&!(e.body instanceof _R.Readable)&&!Y.default.string(e.body)&&!Y.default.buffer(e.body)&&!ER.default(e.body))throw new TypeError("The `body` option must be a stream.Readable, string or Buffer");if(n&&!Y.default.object(e.form))throw new TypeError("The `form` option must be an Object");{let u=!Y.default.string(r["content-type"]);s?(ER.default(e.body)&&u&&(r["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`),this[Mn]=e.body):n?(u&&(r["content-type"]="application/x-www-form-urlencoded"),this[Mn]=new Bn.URLSearchParams(e.form).toString()):(u&&(r["content-type"]="application/json"),this[Mn]=e.stringifyJson(e.json));let c=await Dq.default(this[Mn],e.headers);Y.default.undefined(r["content-length"])&&Y.default.undefined(r["transfer-encoding"])&&!a&&!Y.default.undefined(c)&&(r["content-length"]=String(c))}}else a?this._lockWrite():this._unlockWrite();this[Xs]=Number(r["content-length"])||void 0}async _onResponseBase(e){let{options:r}=this,{url:n}=r;this[RR]=e,r.decompress&&(e=xq(e));let i=e.statusCode,s=e;s.statusMessage=s.statusMessage?s.statusMessage:bR.STATUS_CODES[i],s.url=r.url.toString(),s.requestUrl=this.requestUrl,s.redirectUrls=this.redirects,s.request=this,s.isFromCache=e.fromCache||!1,s.ip=this.ip,s.retryCount=this.retryCount,this[DR]=s.isFromCache,this[Zs]=Number(e.headers["content-length"])||void 0,this[Bl]=e,e.once("end",()=>{this[Zs]=this[Js],this.emit("downloadProgress",this.downloadProgress)}),e.once("error",a=>{e.destroy(),this._beforeError(new Sa(a,this))}),e.once("aborted",()=>{this._beforeError(new Sa({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let o=e.headers["set-cookie"];if(Y.default.object(r.cookieJar)&&o){let a=o.map(async u=>r.cookieJar.setCookie(u,n.toString()));r.ignoreInvalidCookies&&(a=a.map(async u=>u.catch(()=>{})));try{await Promise.all(a)}catch(u){this._beforeError(u);return}}if(r.followRedirect&&e.headers.location&&Mq.has(i)){if(e.resume(),this[nt]&&(this[_y](),delete this[nt],this[AR]()),(i===303&&r.method!=="GET"&&r.method!=="HEAD"||!r.methodRewriting)&&(r.method="GET","body"in r&&delete r.body,"json"in r&&delete r.json,"form"in r&&delete r.form,this[Mn]=void 0,delete r.headers["content-length"]),this.redirects.length>=r.maxRedirects){this._beforeError(new Nl(this));return}try{let h=function(f){return f.protocol==="unix:"||f.hostname==="unix"},u=Buffer.from(e.headers.location,"binary").toString(),c=new Bn.URL(u,n),l=c.toString();if(decodeURI(l),!h(n)&&h(c)){this._beforeError(new Ue("Cannot redirect to UNIX socket",{},this));return}c.hostname!==n.hostname||c.port!==n.port?("host"in r.headers&&delete r.headers.host,"cookie"in r.headers&&delete r.headers.cookie,"authorization"in r.headers&&delete r.headers.authorization,(r.username||r.password)&&(r.username="",r.password="")):(c.username=r.username,c.password=r.password),this.redirects.push(l),r.url=c;for(let f of r.hooks.beforeRedirect)await f(r,s);this.emit("redirect",s,r),await this._makeRequest()}catch(u){this._beforeError(u);return}return}if(r.isStream&&r.throwHttpErrors&&!Oq.isResponseOk(s)){this._beforeError(new Ml(s));return}e.on("readable",()=>{this[Ll]&&this._read()}),this.on("resume",()=>{e.resume()}),this.on("pause",()=>{e.pause()}),e.once("end",()=>{this.push(null)}),this.emit("response",e);for(let a of this[Il])if(!a.headersSent){for(let u in e.headers){let c=r.decompress?u!=="content-encoding":!0,l=e.headers[u];c&&a.setHeader(u,l)}a.statusCode=i}}async _onResponse(e){try{await this._onResponseBase(e)}catch(r){this._beforeError(r)}}_onRequest(e){let{options:r}=this,{timeout:n,url:i}=r;Eq.default(e),this[_y]=wR.default(e,n,i);let s=r.cache?"cacheableResponse":"response";e.once(s,u=>{this._onResponse(u)}),e.once("error",u=>{var c;e.destroy(),(c=e.res)===null||c===void 0||c.removeAllListeners("end"),u=u instanceof wR.TimeoutError?new Ul(u,this.timings,this):new Ue(u.message,u,this),this._beforeError(u)}),this[AR]=Cq.default(e,this,qq),this[nt]=e,this.emit("uploadProgress",this.uploadProgress);let o=this[Mn],a=this.redirects.length===0?this:e;Y.default.nodeStream(o)?(o.pipe(a),o.once("error",u=>{this._beforeError(new ql(u,this))})):(this._unlockWrite(),Y.default.undefined(o)?(this._cannotHaveBody||this._noPipe)&&(a.end(),this._lockWrite()):(this._writeRequest(o,void 0,()=>{}),a.end(),this._lockWrite())),this.emit("request",e)}async _createCacheableRequest(e,r){return new Promise((n,i)=>{Object.assign(r,Rq.default(e)),delete r.url;let s,o=by.get(r.cache)(r,async a=>{a._readableState.autoDestroy=!1,s&&(await s).emit("cacheableResponse",a),n(a)});r.url=e,o.once("error",i),o.once("request",async a=>{s=a,n(s)})})}async _makeRequest(){var e,r,n,i,s;let{options:o}=this,{headers:a}=o;for(let E in a)if(Y.default.undefined(a[E]))delete a[E];else if(Y.default.null_(a[E]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${E}\` header`);if(o.decompress&&Y.default.undefined(a["accept-encoding"])&&(a["accept-encoding"]=Iq?"gzip, deflate, br":"gzip, deflate"),o.cookieJar){let E=await o.cookieJar.getCookieString(o.url.toString());Y.default.nonEmptyString(E)&&(o.headers.cookie=E)}for(let E of o.hooks.beforeRequest){let R=await E(o);if(!Y.default.undefined(R)){o.request=()=>R;break}}o.body&&this[Mn]!==o.body&&(this[Mn]=o.body);let{agent:u,request:c,timeout:l,url:h}=o;if(o.dnsCache&&!("lookup"in o)&&(o.lookup=o.dnsCache.lookup),h.hostname==="unix"){let E=/(?<socketPath>.+?):(?<path>.+)/.exec(`${h.pathname}${h.search}`);if(E!=null&&E.groups){let{socketPath:R,path:T}=E.groups;Object.assign(o,{socketPath:R,path:T,host:""})}}let f=h.protocol==="https:",d;o.http2?d=Sq.auto:d=f?vq.request:bR.request;let m=(e=o.request)!==null&&e!==void 0?e:d,y=o.cache?this._createCacheableRequest:m;u&&!o.http2&&(o.agent=u[f?"https":"http"]),o[nt]=m,delete o.request,delete o.timeout;let p=o;if(p.shared=(r=o.cacheOptions)===null||r===void 0?void 0:r.shared,p.cacheHeuristic=(n=o.cacheOptions)===null||n===void 0?void 0:n.cacheHeuristic,p.immutableMinTimeToLive=(i=o.cacheOptions)===null||i===void 0?void 0:i.immutableMinTimeToLive,p.ignoreCargoCult=(s=o.cacheOptions)===null||s===void 0?void 0:s.ignoreCargoCult,o.dnsLookupIpVersion!==void 0)try{p.family=SR.dnsLookupIpVersionToFamily(o.dnsLookupIpVersion)}catch{throw new Error("Invalid `dnsLookupIpVersion` option value")}o.https&&("rejectUnauthorized"in o.https&&(p.rejectUnauthorized=o.https.rejectUnauthorized),o.https.checkServerIdentity&&(p.checkServerIdentity=o.https.checkServerIdentity),o.https.certificateAuthority&&(p.ca=o.https.certificateAuthority),o.https.certificate&&(p.cert=o.https.certificate),o.https.key&&(p.key=o.https.key),o.https.passphrase&&(p.passphrase=o.https.passphrase),o.https.pfx&&(p.pfx=o.https.pfx));try{let E=await y(h,p);Y.default.undefined(E)&&(E=d(h,p)),o.request=c,o.timeout=l,o.agent=u,o.https&&("rejectUnauthorized"in o.https&&delete p.rejectUnauthorized,o.https.checkServerIdentity&&delete p.checkServerIdentity,o.https.certificateAuthority&&delete p.ca,o.https.certificate&&delete p.cert,o.https.key&&delete p.key,o.https.passphrase&&delete p.passphrase,o.https.pfx&&delete p.pfx),Bq(E)?this._onRequest(E):this.writable?(this.once("finish",()=>{this._onResponse(E)}),this._unlockWrite(),this.end(),this._lockWrite()):this._onResponse(E)}catch(E){throw E instanceof vR.CacheError?new jl(E,this):new Ue(E.message,E,this)}}async _error(e){try{for(let r of this.options.hooks.beforeError)e=await r(e)}catch(r){e=new Ue(r.message,r,this)}this.destroy(e)}_beforeError(e){if(this[eo])return;let{options:r}=this,n=this.retryCount+1;this[eo]=!0,e instanceof Ue||(e=new Ue(e.message,e,this));let i=e,{response:s}=i;(async()=>{if(s&&!s.body){s.setEncoding(this._readableState.encoding);try{s.rawBody=await Tq.default(s),s.body=s.rawBody.toString()}catch{}}if(this.listenerCount("retry")!==0){let o;try{let a;s&&"retry-after"in s.headers&&(a=Number(s.headers["retry-after"]),Number.isNaN(a)?(a=Date.parse(s.headers["retry-after"])-Date.now(),a<=0&&(a=1)):a*=1e3),o=await r.retry.calculateDelay({attemptCount:n,retryOptions:r.retry,error:i,retryAfter:a,computedValue:Pq.default({attemptCount:n,retryOptions:r.retry,error:i,retryAfter:a,computedValue:0})})}catch(a){this._error(new Ue(a.message,a,this));return}if(o){let a=async()=>{try{for(let u of this.options.hooks.beforeRetry)await u(this.options,i,n)}catch(u){this._error(new Ue(u.message,e,this));return}this.destroyed||(this.destroy(),this.emit("retry",n,e))};this[kR]=setTimeout(a,o);return}}this._error(i)})()}_read(){this[Ll]=!0;let e=this[Bl];if(e&&!this[eo]){e.readableLength&&(this[Ll]=!1);let r;for(;(r=e.read())!==null;){this[Js]+=r.length,this[CR]=!0;let n=this.downloadProgress;n.percent<1&&this.emit("downloadProgress",n),this.push(r)}}}_write(e,r,n){let i=()=>{this._writeRequest(e,r,n)};this.requestInitialized?i():this[xa].push(i)}_writeRequest(e,r,n){this[nt].destroyed||(this._progressCallbacks.push(()=>{this[Qs]+=Buffer.byteLength(e,r);let i=this.uploadProgress;i.percent<1&&this.emit("uploadProgress",i)}),this[nt].write(e,r,i=>{!i&&this._progressCallbacks.length>0&&this._progressCallbacks.shift()(),n(i)}))}_final(e){let r=()=>{for(;this._progressCallbacks.length!==0;)this._progressCallbacks.shift()();if(!(nt in this)){e();return}if(this[nt].destroyed){e();return}this[nt].end(n=>{n||(this[Xs]=this[Qs],this.emit("uploadProgress",this.uploadProgress),this[nt].emit("upload-complete")),e(n)})};this.requestInitialized?r():this[xa].push(r)}_destroy(e,r){var n;this[eo]=!0,clearTimeout(this[kR]),nt in this&&(this[_y](),!((n=this[Bl])===null||n===void 0)&&n.complete||this[nt].destroy()),e!==null&&!Y.default.undefined(e)&&!(e instanceof Ue)&&(e=new Ue(e.message,e,this)),r(e)}get _isAboutToError(){return this[eo]}get ip(){var e;return(e=this.socket)===null||e===void 0?void 0:e.remoteAddress}get aborted(){var e,r,n;return((r=(e=this[nt])===null||e===void 0?void 0:e.destroyed)!==null&&r!==void 0?r:this.destroyed)&&!(!((n=this[RR])===null||n===void 0)&&n.complete)}get socket(){var e,r;return(r=(e=this[nt])===null||e===void 0?void 0:e.socket)!==null&&r!==void 0?r:void 0}get downloadProgress(){let e;return this[Zs]?e=this[Js]/this[Zs]:this[Zs]===this[Js]?e=1:e=0,{percent:e,transferred:this[Js],total:this[Zs]}}get uploadProgress(){let e;return this[Xs]?e=this[Qs]/this[Xs]:this[Xs]===this[Qs]?e=1:e=0,{percent:e,transferred:this[Qs],total:this[Xs]}}get timings(){var e;return(e=this[nt])===null||e===void 0?void 0:e.timings}get isFromCache(){return this[DR]}pipe(e,r){if(this[CR])throw new Error("Failed to pipe. The response has been emitted already.");return e instanceof yy.ServerResponse&&this[Il].add(e),super.pipe(e,r)}unpipe(e){return e instanceof yy.ServerResponse&&this[Il].delete(e),super.unpipe(e),this}};ke.default=$l});var Da=A(cr=>{"use strict";var Uq=cr&&cr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Hq=cr&&cr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Uq(e,t,r)};Object.defineProperty(cr,"__esModule",{value:!0});cr.CancelError=cr.ParseError=void 0;var TR=Aa(),vy=class extends TR.RequestError{constructor(e,r){let{options:n}=r.request;super(`${e.message} in "${n.url.toString()}"`,e,r.request),this.name="ParseError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_BODY_PARSE_FAILURE":this.code}};cr.ParseError=vy;var Ey=class extends TR.RequestError{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}};cr.CancelError=Ey;Hq(Aa(),cr)});var FR=A(wy=>{"use strict";Object.defineProperty(wy,"__esModule",{value:!0});var OR=Da(),$q=(t,e,r,n)=>{let{rawBody:i}=t;try{if(e==="text")return i.toString(n);if(e==="json")return i.length===0?"":r(i.toString());if(e==="buffer")return i;throw new OR.ParseError({message:`Unknown body type '${e}'`,name:"Error"},t)}catch(s){throw new OR.ParseError(s,t)}};wy.default=$q});var xy=A(jn=>{"use strict";var Gq=jn&&jn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),zq=jn&&jn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Gq(e,t,r)};Object.defineProperty(jn,"__esModule",{value:!0});var Wq=require("events"),Vq=nn(),Yq=TC(),Gl=Da(),PR=FR(),IR=Aa(),Kq=sy(),Zq=fy(),LR=dy(),Jq=["request","response","redirect","uploadProgress","downloadProgress"];function BR(t){let e,r,n=new Wq.EventEmitter,i=new Yq((o,a,u)=>{let c=l=>{let h=new IR.default(void 0,t);h.retryCount=l,h._noPipe=!0,u(()=>h.destroy()),u.shouldReject=!1,u(()=>a(new Gl.CancelError(h))),e=h,h.once("response",async m=>{var y;if(m.retryCount=l,m.request.aborted)return;let p;try{p=await Zq.default(h),m.rawBody=p}catch{return}if(h._isAboutToError)return;let E=((y=m.headers["content-encoding"])!==null&&y!==void 0?y:"").toLowerCase(),R=["gzip","deflate","br"].includes(E),{options:T}=h;if(R&&!T.decompress)m.body=p;else try{m.body=PR.default(m,T.responseType,T.parseJson,T.encoding)}catch(P){if(m.body=p.toString(),LR.isResponseOk(m)){h._beforeError(P);return}}try{for(let[P,F]of T.hooks.afterResponse.entries())m=await F(m,async M=>{let x=IR.default.normalizeArguments(void 0,{...M,retry:{calculateDelay:()=>0},throwHttpErrors:!1,resolveBodyOnly:!1},T);x.hooks.afterResponse=x.hooks.afterResponse.slice(0,P);for(let j of x.hooks.beforeRetry)await j(x);let D=BR(x);return u(()=>{D.catch(()=>{}),D.cancel()}),D})}catch(P){h._beforeError(new Gl.RequestError(P.message,P,h));return}if(r=m,!LR.isResponseOk(m)){h._beforeError(new Gl.HTTPError(m));return}h.destroy(),o(h.options.resolveBodyOnly?m.body:m)});let f=m=>{if(i.isCanceled)return;let{options:y}=h;if(m instanceof Gl.HTTPError&&!y.throwHttpErrors){let{response:p}=m;o(h.options.resolveBodyOnly?p.body:p);return}a(m)};h.once("error",f);let d=h.options.body;h.once("retry",(m,y)=>{var p,E;if(d===((p=y.request)===null||p===void 0?void 0:p.options.body)&&Vq.default.nodeStream((E=y.request)===null||E===void 0?void 0:E.options.body)){f(y);return}c(m)}),Kq.default(h,n,Jq)};c(0)});i.on=(o,a)=>(n.on(o,a),i);let s=o=>{let a=(async()=>{await i;let{options:u}=r.request;return PR.default(r,o,u.parseJson,u.encoding)})();return Object.defineProperties(a,Object.getOwnPropertyDescriptors(i)),a};return i.json=()=>{let{headers:o}=e.options;return!e.writableFinished&&o.accept===void 0&&(o.accept="application/json"),s("json")},i.buffer=()=>s("buffer"),i.text=()=>s("text"),i}jn.default=BR;zq(Da(),jn)});var NR=A(Sy=>{"use strict";Object.defineProperty(Sy,"__esModule",{value:!0});var Xq=Da();function Qq(t,...e){let r=(async()=>{if(t instanceof Xq.RequestError)try{for(let i of e)if(i)for(let s of i)t=await s(t)}catch(i){t=i}throw t})(),n=()=>r;return r.json=n,r.text=n,r.buffer=n,r.on=n,r}Sy.default=Qq});var qR=A(Ay=>{"use strict";Object.defineProperty(Ay,"__esModule",{value:!0});var MR=nn();function jR(t){for(let e of Object.values(t))(MR.default.plainObject(e)||MR.default.array(e))&&jR(e);return Object.freeze(t)}Ay.default=jR});var HR=A(UR=>{"use strict";Object.defineProperty(UR,"__esModule",{value:!0})});var Dy=A(Qt=>{"use strict";var eU=Qt&&Qt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),tU=Qt&&Qt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eU(e,t,r)};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.defaultHandler=void 0;var $R=nn(),Xt=xy(),rU=NR(),Wl=Aa(),nU=qR(),iU={RequestError:Xt.RequestError,CacheError:Xt.CacheError,ReadError:Xt.ReadError,HTTPError:Xt.HTTPError,MaxRedirectsError:Xt.MaxRedirectsError,TimeoutError:Xt.TimeoutError,ParseError:Xt.ParseError,CancelError:Xt.CancelError,UnsupportedProtocolError:Xt.UnsupportedProtocolError,UploadError:Xt.UploadError},sU=async t=>new Promise(e=>{setTimeout(e,t)}),{normalizeArguments:zl}=Wl.default,GR=(...t)=>{let e;for(let r of t)e=zl(void 0,r,e);return e},oU=t=>t.isStream?new Wl.default(void 0,t):Xt.default(t),aU=t=>"defaults"in t&&"options"in t.defaults,uU=["get","post","put","patch","head","delete"];Qt.defaultHandler=(t,e)=>e(t);var zR=(t,e)=>{if(t)for(let r of t)r(e)},WR=t=>{t._rawHandlers=t.handlers,t.handlers=t.handlers.map(n=>(i,s)=>{let o,a=n(i,u=>(o=s(u),o));if(a!==o&&!i.isStream&&o){let u=a,{then:c,catch:l,finally:h}=u;Object.setPrototypeOf(u,Object.getPrototypeOf(o)),Object.defineProperties(u,Object.getOwnPropertyDescriptors(o)),u.then=c,u.catch=l,u.finally=h}return a});let e=(n,i={},s)=>{var o,a;let u=0,c=l=>t.handlers[u++](l,u===t.handlers.length?oU:c);if($R.default.plainObject(n)){let l={...n,...i};Wl.setNonEnumerableProperties([n,i],l),i=l,n=void 0}try{let l;try{zR(t.options.hooks.init,i),zR((o=i.hooks)===null||o===void 0?void 0:o.init,i)}catch(f){l=f}let h=zl(n,i,s!=null?s:t.options);if(h[Wl.kIsNormalizedAlready]=!0,l)throw new Xt.RequestError(l.message,l,h);return c(h)}catch(l){if(i.isStream)throw l;return rU.default(l,t.options.hooks.beforeError,(a=i.hooks)===null||a===void 0?void 0:a.beforeError)}};e.extend=(...n)=>{let i=[t.options],s=[...t._rawHandlers],o;for(let a of n)aU(a)?(i.push(a.defaults.options),s.push(...a.defaults._rawHandlers),o=a.defaults.mutableDefaults):(i.push(a),"handlers"in a&&s.push(...a.handlers),o=a.mutableDefaults);return s=s.filter(a=>a!==Qt.defaultHandler),s.length===0&&s.push(Qt.defaultHandler),WR({options:GR(...i),handlers:s,mutableDefaults:!!o})};let r=async function*(n,i){let s=zl(n,i,t.options);s.resolveBodyOnly=!1;let o=s.pagination;if(!$R.default.object(o))throw new TypeError("`options.pagination` must be implemented");let a=[],{countLimit:u}=o,c=0;for(;c<o.requestLimit;){c!==0&&await sU(o.backoff);let l=await e(void 0,void 0,s),h=await o.transform(l),f=[];for(let m of h)if(o.filter(m,a,f)&&(!o.shouldContinue(m,a,f)||(yield m,o.stackAllItems&&a.push(m),f.push(m),--u<=0)))return;let d=o.paginate(l,a,f);if(d===!1)return;d===l.request.options?s=l.request.options:d!==void 0&&(s=zl(void 0,d,s)),c++}};e.paginate=r,e.paginate.all=async(n,i)=>{let s=[];for await(let o of r(n,i))s.push(o);return s},e.paginate.each=r,e.stream=(n,i)=>e(n,{...i,isStream:!0});for(let n of uU)e[n]=(i,s)=>e(i,{...s,method:n}),e.stream[n]=(i,s)=>e(i,{...s,method:n,isStream:!0});return Object.assign(e,iU),Object.defineProperty(e,"defaults",{value:t.mutableDefaults?t:nU.default(t),writable:t.mutableDefaults,configurable:t.mutableDefaults,enumerable:!0}),e.mergeOptions=GR,e};Qt.default=WR;tU(HR(),Qt)});var Ry=A((sn,Vl)=>{"use strict";var cU=sn&&sn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),VR=sn&&sn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cU(e,t,r)};Object.defineProperty(sn,"__esModule",{value:!0});var lU=require("url"),YR=Dy(),hU={options:{method:"GET",retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue:t})=>t},timeout:{},headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},hooks:{init:[],beforeRequest:[],beforeRedirect:[],beforeRetry:[],beforeError:[],afterResponse:[]},cache:void 0,dnsCache:void 0,decompress:!0,throwHttpErrors:!0,followRedirect:!0,isStream:!1,responseType:"text",resolveBodyOnly:!1,maxRedirects:10,prefixUrl:"",methodRewriting:!0,ignoreInvalidCookies:!1,context:{},http2:!1,allowGetBody:!1,https:void 0,pagination:{transform:t=>t.request.options.responseType==="json"?t.body:JSON.parse(t.body),paginate:t=>{if(!Reflect.has(t.headers,"link"))return!1;let e=t.headers.link.split(","),r;for(let n of e){let i=n.split(";");if(i[1].includes("next")){r=i[0].trimStart().trim(),r=r.slice(1,-1);break}}return r?{url:new lU.URL(r)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:1/0,backoff:0,requestLimit:1e4,stackAllItems:!0},parseJson:t=>JSON.parse(t),stringifyJson:t=>JSON.stringify(t),cacheOptions:{}},handlers:[YR.defaultHandler],mutableDefaults:!1},Cy=YR.default(hU);sn.default=Cy;Vl.exports=Cy;Vl.exports.default=Cy;Vl.exports.__esModule=!0;VR(Dy(),sn);VR(xy(),sn)});var tk=A((wK,ek)=>{function er(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}ek.exports=er;er.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};er.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};er.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1);else return!1;var n=this;return this._timer=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r),this._options.unref&&this._timer.unref(),!0};er.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};er.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};er.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};er.prototype.start=er.prototype.try;er.prototype.errors=function(){return this._errors};er.prototype.attempts=function(){return this._attempts};er.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],s=i.message,o=(t[s]||0)+1;t[s]=o,o>=r&&(e=i,r=o)}return e}});var rk=A(Ei=>{var dU=tk();Ei.operation=function(t){var e=Ei.timeouts(t);return new dU(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};Ei.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(s,o){return s-o}),n};Ei.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};Ei.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var s=r[i],o=t[s];t[s]=function(u){var c=Ei.operation(e),l=Array.prototype.slice.call(arguments,1),h=l.pop();l.push(function(f){c.retry(f)||(f&&(arguments[0]=c.mainError()),h.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,o),t[s].options=e}}});var ik=A((SK,nk)=>{nk.exports=rk()});var ok=A((AK,sk)=>{var pU=ik();function mU(t,e){function r(n,i){var s=e||{},o;"randomize"in s||(s.randomize=!0),o=pU.operation(s);function a(l){i(l||new Error("Aborted"))}function u(l,h){if(l.bail){a(l);return}o.retry(l)?s.onRetry&&s.onRetry(l,h):i(o.mainError())}function c(l){var h;try{h=t(a,l)}catch(f){u(f,l);return}Promise.resolve(h).then(n).catch(function(d){u(d,l)})}o.attempt(c)}return new Promise(r)}sk.exports=mU});var wk=A(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});function m7(t){return t&&t.__esModule?t:{default:t}}var _k=Object.defineProperty,yk=Object.getOwnPropertySymbols,y7=Object.prototype.hasOwnProperty,g7=Object.prototype.propertyIsEnumerable,gk=(t,e,r)=>e in t?_k(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_7=(t,e)=>{for(var r in e||(e={}))y7.call(e,r)&&gk(t,r,e[r]);if(yk)for(var r of yk(e))g7.call(e,r)&&gk(t,r,e[r]);return t},b7=(t,e)=>{for(var r in e)_k(t,r,{get:e[r],enumerable:!0})},v7=(t,e,r)=>new Promise((n,i)=>{var s=u=>{try{a(r.next(u))}catch(c){i(c)}},o=u=>{try{a(r.throw(u))}catch(c){i(c)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,o);a((r=r.apply(t,e)).next())}),bk={};b7(bk,{configDir:()=>Ek,darwinConfig:()=>Gy,getPathForPlatform:()=>Wy,getPlatform:()=>$y,linuxConfig:()=>rh,winConfig:()=>zy});var E7=require("fs/promises"),w7=require("path"),vk=m7(w7);function $y(){return process.platform}function rh(){if(process.env.XDG_CONFIG_HOME!==void 0)return process.env.XDG_CONFIG_HOME;if(process.env.HOME!==void 0)return vk.default.join(process.env.HOME,".config")}function Gy(){if(process.env.HOME!==void 0)return vk.default.join(process.env.HOME,"/Library/Application Support")}function zy(){return process.env.APPDATA}function Wy({platform:t}){switch(t){case"linux":return rh();case"darwin":return Gy();case"win32":return zy();default:return rh()}}function Ek(){return v7(this,arguments,function*(t={}){var e;let r=(e=t.platform)!=null?e:$y(),n=Wy({platform:r});if(n!==void 0){if(t.validate===!1)return n;try{return yield E7.stat.call(void 0,n),n}catch{return}}})}Or.__spreadValues=_7;Or.getPlatform=$y;Or.linuxConfig=rh;Or.darwinConfig=Gy;Or.winConfig=zy;Or.getPathForPlatform=Wy;Or.configDir=Ek;Or.config_dir_exports=bk});var xk=A(Vy=>{"use strict";Object.defineProperty(Vy,"__esModule",{value:!0});var x7=wk();Vy.configDir=x7.configDir});var kk=A((uZ,I7)=>{I7.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var Fk=A(qt=>{"use strict";var Ok=kk(),Ke=process.env;Object.defineProperty(qt,"_vendors",{value:Ok.map(function(t){return t.constant})});qt.name=null;qt.isPR=null;Ok.forEach(function(t){let r=(Array.isArray(t.env)?t.env:[t.env]).every(function(n){return Tk(n)});if(qt[t.constant]=r,!!r)switch(qt.name=t.name,typeof t.pr){case"string":qt.isPR=!!Ke[t.pr];break;case"object":"env"in t.pr?qt.isPR=t.pr.env in Ke&&Ke[t.pr.env]!==t.pr.ne:"any"in t.pr?qt.isPR=t.pr.any.some(function(n){return!!Ke[n]}):qt.isPR=Tk(t.pr);break;default:qt.isPR=null}});qt.isCI=!!(Ke.CI!=="false"&&(Ke.BUILD_ID||Ke.BUILD_NUMBER||Ke.CI||Ke.CI_APP_ID||Ke.CI_BUILD_ID||Ke.CI_BUILD_NUMBER||Ke.CI_NAME||Ke.CONTINUOUS_INTEGRATION||Ke.RUN_ID||qt.name));function Tk(t){return typeof t=="string"?!!Ke[t]:"env"in t?Ke[t.env]&&Ke[t.env].includes(t.includes):"any"in t?t.any.some(function(e){return!!Ke[e]}):Object.keys(t).every(function(e){return Ke[e]===t[e]})}});var nh=A((AZ,U7)=>{U7.exports={name:"create-turbo",version:"2.0.10-canary.0",description:"Create a new Turborepo",homepage:"https://turbo.build/repo",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turbo",directory:"packages/create-turbo"},bugs:{url:"https://github.com/vercel/turbo/issues"},bin:{"create-turbo":"dist/cli.js"},scripts:{build:"tsup",test:"jest",lint:"eslint src/","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{commander:"^11.0.0","fs-extra":"^11.1.1",inquirer:"^8.0.0",picocolors:"1.0.1","proxy-agent":"^6.2.2",semver:"^7.3.8","update-check":"^1.5.4"},devDependencies:{"@turbo/eslint-config":"workspace:*","@turbo/telemetry":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/utils":"workspace:*","@turbo/workspaces":"workspace:*","@types/fs-extra":"^9.0.13","@types/inquirer":"^7.3.1","@types/jest":"^27.4.0","@types/node":"^18.17.2","@types/semver":"^7.3.9",jest:"^27.4.3","ts-jest":"^27.1.1",tsup:"^6.7.0",typescript:"^5.2.2"},files:["dist"]}});var KT=pe(require("http")),ZT=pe(require("https")),wg=require("picocolors"),$a=require("commander");var pO=pe(Tg());function wh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function So(t){return So=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},So(t)}function xh(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Sh(t,e){if(e&&(So(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xh(t)}function Zn(t){return Zn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Zn(t)}function Nr(t,e){return Nr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Nr(t,e)}function Ah(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nr(t,e)}function Dh(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Ch(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Mi(t,e,r){return Ch()?Mi=Reflect.construct.bind():Mi=function(i,s,o){var a=[null];a.push.apply(a,s);var u=Function.bind.apply(i,a),c=new u;return o&&Nr(c,o.prototype),c},Mi.apply(null,arguments)}function Ao(t){var e=typeof Map=="function"?new Map:void 0;return Ao=function(n){if(n===null||!Dh(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return Mi(n,arguments,Zn(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Nr(i,n)},Ao(t)}var Yg=pe(Vg());var mO=pe(require("fs-extra")),gG=function(t){Ah(e,t);function e(r){var n;return wh(this,e),n=Sh(this,Zn(e).call(this,"No package.json could be found upwards from the directory ".concat(r))),n.directory=r,n}return e}(Ao(Error));var yO=pe(require("fs")),gO=pe(require("path"));var P3=pe(require("fs")),I3=pe(require("path"));function l_(t){return typeof t=="undefined"||t===null}function vO(t){return typeof t=="object"&&t!==null}function EO(t){return Array.isArray(t)?t:l_(t)?[]:[t]}function wO(t,e){var r,n,i,s;if(e)for(s=Object.keys(e),r=0,n=s.length;r<n;r+=1)i=s[r],t[i]=e[i];return t}function xO(t,e){var r="",n;for(n=0;n<e;n+=1)r+=t;return r}function SO(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var AO=l_,DO=vO,CO=EO,RO=xO,kO=SO,TO=wO,Ve={isNothing:AO,isObject:DO,toArray:CO,repeat:RO,isNegativeZero:kO,extend:TO};function h_(t,e){var r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
|
31
31
|
|
32
32
|
`+t.mark.snippet),n+" "+r):n}function Co(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=h_(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Co.prototype=Object.create(Error.prototype);Co.prototype.constructor=Co;Co.prototype.toString=function(e){return this.name+": "+h_(this,e)};var mt=Co;function Ih(t,e,r,n,i){var s="",o="",a=Math.floor(i/2)-1;return n-e>a&&(s=" ... ",e=n-a+s.length),r-n>a&&(o=" ...",r=n+a-o.length),{str:s+t.slice(e,r).replace(/\t/g,"\u2192")+o,pos:n-e+s.length}}function Lh(t,e){return Ve.repeat(" ",e-t.length)+t}function OO(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],s,o=-1;s=r.exec(t.buffer);)i.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&o<0&&(o=n.length-2);o<0&&(o=n.length-1);var a="",u,c,l=Math.min(t.line+e.linesAfter,i.length).toString().length,h=e.maxLength-(e.indent+l+3);for(u=1;u<=e.linesBefore&&!(o-u<0);u++)c=Ih(t.buffer,n[o-u],i[o-u],t.position-(n[o]-n[o-u]),h),a=Ve.repeat(" ",e.indent)+Lh((t.line-u+1).toString(),l)+" | "+c.str+`
|
33
33
|
`+a;for(c=Ih(t.buffer,n[o],i[o],t.position,h),a+=Ve.repeat(" ",e.indent)+Lh((t.line+1).toString(),l)+" | "+c.str+`
|
@@ -66,7 +66,7 @@ Please report this to https://github.com/szmarczak/http2-wrapper/`);m(y)}return}
|
|
66
66
|
${e.workspaceData.globs.map(a=>` - "${a}"`).join(`
|
67
67
|
`)}`))),s&&(zn({workspace:{name:"root",paths:e.paths},project:e,to:r,logger:n,options:i}),n.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{zn({workspace:a,project:e,to:r,logger:n,options:i})}))}async function QH(t){let{project:e,logger:r,options:n}=t,i=e.workspaceData.globs.length>0;r.mainStep(Vn({action:"remove",packageManager:Wn.name,project:e}));let s=kt({workspaceRoot:e.paths.root});if(e.paths.workspaceConfig&&i&&(r.subStep('removing "pnpm-workspace.yaml"'),n!=null&&n.dry||(0,bt.rmSync)(e.paths.workspaceConfig,{force:!0})),r.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete s.packageManager,!(n!=null&&n.dry)){(0,bt.writeJSONSync)(e.paths.packageJson,s,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{r.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,bt.rm)(a,{recursive:!0,force:!0})))}catch{throw new He("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function e$(t){let{project:e,logger:r,options:n}=t;r.subStep(`removing ${Li.default.relative(e.paths.root,e.paths.lockfile)}`),n!=null&&n.dry||(0,bt.rmSync)(e.paths.lockfile,{force:!0})}async function t$(t){let{project:e,options:r,logger:n}=t,i=()=>{n.subStep(`converting ${Li.default.relative(e.paths.root,e.paths.lockfile)} to ${Wn.lock}`)},s=async()=>{if(!(r!=null&&r.dry)&&(0,bt.existsSync)(e.paths.lockfile))try{await(0,lT.default)(Wn.name,["import"],{stdio:"ignore",cwd:e.paths.root})}catch{}finally{ln({project:e,options:r})}};switch(e.packageManager){case"pnpm":break;case"bun":i(),await yT({project:e,options:r}),await s(),(0,bt.rmSync)(Li.default.join(e.paths.root,"yarn.lock"),{force:!0});break;case"npm":i(),await s();break;case"yarn":i(),await s();break}}var r$={detect:gT,read:JH,create:XH,remove:QH,clean:e$,convertLock:t$};Q();var bo={name:"npm",lock:"package-lock.json"};async function _T(t){let e=Pa.default.join(t.workspaceRoot,bo.lock),r=ch({workspaceRoot:t.workspaceRoot});return(0,Fr.existsSync)(e)||r===bo.name}async function n$(t){if(!await _T(t))throw new He("Not an npm project",{type:"package_manager-unexpected"});let e=kt(t),{name:r,description:n}=qa(t),i=hg({workspaces:e.workspaces});return{name:r,description:n,packageManager:bo.name,paths:lh({root:t.workspaceRoot,lockFile:bo.lock}),workspaceData:{globs:i,workspaces:hh({workspaceGlobs:i,...t})}}}async function i$(t){let{project:e,options:r,to:n,logger:i}=t,s=e.workspaceData.globs.length>0;i.mainStep(Vn({packageManager:bo.name,action:"create",project:e}));let o=kt({workspaceRoot:e.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${Pa.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${n.name}@${n.version}`,s?(i.rootStep(`adding "workspaces" field to ${Pa.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,r!=null&&r.dry||(0,Fr.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),zn({workspace:{name:"root",paths:e.paths},project:e,to:n,logger:i,options:r}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{zn({workspace:a,project:e,to:n,logger:i,options:r})})):r!=null&&r.dry||(0,Fr.writeJSONSync)(e.paths.packageJson,o,{spaces:2})}async function s$(t){let{project:e,logger:r,options:n}=t,i=e.workspaceData.globs.length>0;r.mainStep(Vn({packageManager:bo.name,action:"remove",project:e}));let s=kt({workspaceRoot:e.paths.root});if(i&&(r.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete s.workspaces),r.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete s.packageManager,!(n!=null&&n.dry)){(0,Fr.writeJSONSync)(e.paths.packageJson,s,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{r.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,Fr.rm)(a,{recursive:!0,force:!0})))}catch{throw new He("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function o$(t){let{project:e,logger:r,options:n}=t;r.subStep(`removing ${Pa.default.relative(e.paths.root,e.paths.lockfile)}`),n!=null&&n.dry||(0,Fr.rmSync)(e.paths.lockfile,{force:!0})}async function a$(t){let{project:e,options:r}=t;switch(e.packageManager){case"pnpm":ln({project:e,options:r});break;case"bun":ln({project:e,options:r});break;case"npm":break;case"yarn":ln({project:e,options:r});break}}var u$={detect:_T,read:n$,create:i$,remove:s$,clean:o$,convertLock:a$};Q();var Bi={name:"yarn",lock:"yarn.lock"};async function bT(t){let e=vo.default.join(t.workspaceRoot,Bi.lock),r=ch({workspaceRoot:t.workspaceRoot});return(0,Pr.existsSync)(e)||r===Bi.name}async function c$(t){if(!await bT(t))throw new He("Not a yarn project",{type:"package_manager-unexpected"});let e=kt(t),{name:r,description:n}=qa(t),i=hg({workspaces:e.workspaces});return{name:r,description:n,packageManager:Bi.name,paths:lh({root:t.workspaceRoot,lockFile:Bi.lock}),workspaceData:{globs:i,workspaces:hh({workspaceGlobs:i,...t})}}}async function l$(t){let{project:e,to:r,logger:n,options:i}=t,s=e.workspaceData.globs.length>0;n.mainStep(Vn({packageManager:Bi.name,action:"create",project:e}));let o=kt({workspaceRoot:e.paths.root});n.rootHeader(),n.rootStep(`adding "packageManager" field to ${vo.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${r.name}@${r.version}`,s?(n.rootStep(`adding "workspaces" field to ${vo.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||(0,Pr.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),zn({workspace:{name:"root",paths:e.paths},project:e,to:r,logger:n,options:i}),n.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{zn({workspace:a,project:e,to:r,logger:n,options:i})})):i!=null&&i.dry||(0,Pr.writeJSONSync)(e.paths.packageJson,o,{spaces:2})}async function h$(t){let{project:e,logger:r,options:n}=t,i=e.workspaceData.globs.length>0;r.mainStep(Vn({packageManager:Bi.name,action:"remove",project:e}));let s=kt({workspaceRoot:e.paths.root});if(i&&(r.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete s.workspaces),r.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete s.packageManager,!(n!=null&&n.dry)){(0,Pr.writeJSONSync)(e.paths.packageJson,s,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{r.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,Pr.rm)(a,{recursive:!0,force:!0})))}catch{throw new He("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function f$(t){let{project:e,logger:r,options:n}=t;r.subStep(`removing ${vo.default.relative(e.paths.root,e.paths.lockfile)}`),n!=null&&n.dry||(0,Pr.rmSync)(e.paths.lockfile,{force:!0})}async function d$(t){let{project:e,options:r,logger:n}=t,i=()=>{n.subStep(`converting ${vo.default.relative(e.paths.root,e.paths.lockfile)} to ${Bi.lock}`)};switch(e.packageManager){case"pnpm":ln({project:e,options:r});break;case"bun":i(),await yT({project:e,options:r});break;case"npm":ln({project:e,options:r});break;case"yarn":break}}var p$={detect:bT,read:c$,create:l$,remove:h$,clean:f$,convertLock:d$};Q();var Eo={name:"bun",lock:"bun.lockb"};async function vT(t){let e=Ia.default.join(t.workspaceRoot,Eo.lock),r=ch({workspaceRoot:t.workspaceRoot});return(0,Ir.existsSync)(e)||r===Eo.name}async function m$(t){if(!await vT(t))throw new He("Not a bun project",{type:"package_manager-unexpected"});let e=kt(t),{name:r,description:n}=qa(t),i=hg({workspaces:e.workspaces});return{name:r,description:n,packageManager:Eo.name,paths:lh({root:t.workspaceRoot,lockFile:Eo.lock}),workspaceData:{globs:i,workspaces:hh({workspaceGlobs:i,...t})}}}async function y$(t){let{project:e,to:r,logger:n,options:i}=t,s=e.workspaceData.globs.length>0;if(!KH({project:e}))throw new He("Unable to convert project to bun - workspace globs unsupported",{type:"bun-workspace_glob_error"});n.mainStep(Vn({packageManager:Eo.name,action:"create",project:e}));let o=kt({workspaceRoot:e.paths.root});n.rootHeader(),n.rootStep(`adding "packageManager" field to ${Ia.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${r.name}@${r.version}`,s?(n.rootStep(`adding "workspaces" field to ${Ia.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||(0,Ir.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),zn({workspace:{name:"root",paths:e.paths},project:e,to:r,logger:n,options:i}),n.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{zn({workspace:a,project:e,to:r,logger:n,options:i})})):i!=null&&i.dry||(0,Ir.writeJSONSync)(e.paths.packageJson,o,{spaces:2})}async function g$(t){let{project:e,logger:r,options:n}=t,i=e.workspaceData.globs.length>0;r.mainStep(Vn({packageManager:Eo.name,action:"remove",project:e}));let s=kt({workspaceRoot:e.paths.root});if(i&&(r.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete s.workspaces),r.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete s.packageManager,!(n!=null&&n.dry)){(0,Ir.writeJSONSync)(e.paths.packageJson,s,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{r.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,Ir.rm)(a,{recursive:!0,force:!0})))}catch{throw new He("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function _$(t){let{project:e,logger:r,options:n}=t;r.subStep(`removing ${Ia.default.relative(e.paths.root,e.paths.lockfile)}`),n!=null&&n.dry||(0,Ir.rmSync)(e.paths.lockfile,{force:!0})}async function b$(t){let{project:e,options:r}=t;switch(e.packageManager){case"pnpm":ln({project:e,options:r});break;case"bun":break;case"npm":ln({project:e,options:r});break;case"yarn":ln({project:e,options:r});break}}var v$={detect:vT,read:m$,create:y$,remove:g$,clean:_$,convertLock:b$},go={pnpm:r$,yarn:p$,npm:u$,bun:v$};Q();async function fh({root:t}){let{exists:e,absolute:r}=YH({directory:t});if(!e)throw new He(`Could not find directory at ${r}. Ensure the directory exists.`,{type:"invalid_directory"});for(let{detect:n,read:i}of Object.values(go))if(await n({workspaceRoot:r}))return i({workspaceRoot:r});throw new He("Could not determine package manager. Add `packageManager` to `package.json` or ensure a lockfile is present.",{type:"package_manager-unable_to_detect"})}Q();var yo=2,fg=class{constructor({interactive:t,dry:e}={}){this.interactive=t!=null?t:!0,this.dry=e!=null?e:!1,this.step=1}logger(...t){this.interactive&&console.log(...t)}indented(t,...e){this.logger(" ".repeat(yo*t),...e)}header(t){this.blankLine(),this.logger((0,it.bold)(t))}installerFrames(){let t=`${" ".repeat(yo)} - ${this.dry?(0,it.yellow)("SKIPPED | "):(0,it.green)("OK | ")}`;return[`${t} `,`${t}> `,`${t}>> `,`${t}>>>`]}gradient(t){return(0,ET.default)("#0099F7","#F11712")(t.toString())}hero(){this.logger((0,it.bold)(this.gradient(`
|
68
68
|
>>> TURBOREPO
|
69
|
-
`)))}info(...t){this.logger(...t)}mainStep(t){this.blankLine(),this.logger(`${this.step}. ${(0,it.underline)(t)}`),this.step+=1}subStep(...t){this.logger(" ".repeat(yo),"-",this.dry?(0,it.yellow)("SKIPPED |"):(0,it.green)("OK |"),...t)}subStepFailure(...t){this.logger(" ".repeat(yo),"-",(0,it.red)("ERROR |"),...t)}rootHeader(){this.blankLine(),this.indented(2,"Root:")}rootStep(...t){this.logger(" ".repeat(yo*3),"-",this.dry?(0,it.yellow)("SKIPPED |"):(0,it.green)("OK |"),...t)}workspaceHeader(){this.blankLine(),this.indented(2,"Workspaces:")}workspaceStep(...t){this.logger(" ".repeat(yo*3),"-",this.dry?(0,it.yellow)("SKIPPED |"):(0,it.green)("OK |"),...t)}blankLine(){this.logger()}error(...t){console.error(...t)}};Q();var jk={npm:[{name:"npm",template:"npm",command:"npm",installArgs:["install"],version:"latest",executable:"npx",semver:"*",default:!0}],pnpm:[{name:"pnpm6",template:"pnpm",command:"pnpm",installArgs:["install"],version:"latest-6",executable:"pnpx",semver:"6.x"},{name:"pnpm",template:"pnpm",command:"pnpm",installArgs:["install","--fix-lockfile"],version:"latest",executable:"pnpm dlx",semver:">=7",default:!0}],yarn:[{name:"yarn",template:"yarn",command:"yarn",installArgs:["install"],version:"1.x",executable:"npx",semver:"<2",default:!0},{name:"berry",template:"berry",command:"yarn",installArgs:["install","--no-immutable"],version:"stable",executable:"yarn dlx",semver:">=2"}],bun:[{name:"bun",template:"bun",command:"bun",installArgs:["install"],version:"latest",executable:"bunx",semver:"^1.0.1",default:!0}]};function dh(t){let{version:e,name:r}=t;return e?jk[r].find(n=>(0,ST.satisfies)(e,n.semver)):jk[r].find(n=>n.default)}async function ph(t){let{to:e,logger:r,options:n}=t,i=r!=null?r:new fg(n),s=dh(e);if(!s)throw new He("Unsupported package manager version.",{type:"package_manager-unsupported_version"});if(i.subStep(`running "${s.command} ${s.installArgs.join(" ")}"`),!(n!=null&&n.dry)){let o;i.interactive&&(o=(0,xT.default)({text:"installing dependencies...",spinner:{frames:i.installerFrames()}}).start());try{await(0,wT.default)(s.command,s.installArgs,{cwd:t.project.paths.root}),o&&o.stop(),i.subStep("dependencies installed")}catch(a){throw i.subStepFailure("failed to install dependencies"),a}}}Q();async function DT({project:t,convertTo:e,logger:r,options:n}){if(r.header(`Converting project from ${t.packageManager} to ${e.name}.`),t.packageManager===e.name)throw new He("You are already using this package manager",{type:"package_manager-already_in_use"});if(!e.version)throw new He(`${e.name} is not installed, or could not be located`,{type:"package_manager-could_not_be_found"});let i=e;await go[t.packageManager].remove({project:t,to:i,logger:r,options:n}),await go[i.name].create({project:t,to:i,logger:r,options:n}),r.mainStep("Installing dependencies"),n!=null&&n.skipInstall?r.subStep((0,AT.yellow)("Skipping install")):(await go[i.name].convertLock({project:t,to:i,logger:r,options:n}),await ph({project:t,to:i,logger:r,options:n})),r.mainStep(`Cleaning up ${t.packageManager} workspaces`),await go[t.packageManager].clean({project:t,logger:r})}Q();async function CT({root:t,to:e,options:r}){let n=new fg({...r,interactive:!1}),[i,s]=await Promise.all([fh({root:t}),aT()]);await DT({project:i,convertTo:{name:e,version:s[e]},logger:n,options:r})}var Yn=require("child_process"),RT=pe(require("path")),kT=require("
|
69
|
+
`)))}info(...t){this.logger(...t)}mainStep(t){this.blankLine(),this.logger(`${this.step}. ${(0,it.underline)(t)}`),this.step+=1}subStep(...t){this.logger(" ".repeat(yo),"-",this.dry?(0,it.yellow)("SKIPPED |"):(0,it.green)("OK |"),...t)}subStepFailure(...t){this.logger(" ".repeat(yo),"-",(0,it.red)("ERROR |"),...t)}rootHeader(){this.blankLine(),this.indented(2,"Root:")}rootStep(...t){this.logger(" ".repeat(yo*3),"-",this.dry?(0,it.yellow)("SKIPPED |"):(0,it.green)("OK |"),...t)}workspaceHeader(){this.blankLine(),this.indented(2,"Workspaces:")}workspaceStep(...t){this.logger(" ".repeat(yo*3),"-",this.dry?(0,it.yellow)("SKIPPED |"):(0,it.green)("OK |"),...t)}blankLine(){this.logger()}error(...t){console.error(...t)}};Q();var jk={npm:[{name:"npm",template:"npm",command:"npm",installArgs:["install"],version:"latest",executable:"npx",semver:"*",default:!0}],pnpm:[{name:"pnpm6",template:"pnpm",command:"pnpm",installArgs:["install"],version:"latest-6",executable:"pnpx",semver:"6.x"},{name:"pnpm",template:"pnpm",command:"pnpm",installArgs:["install","--fix-lockfile"],version:"latest",executable:"pnpm dlx",semver:">=7",default:!0}],yarn:[{name:"yarn",template:"yarn",command:"yarn",installArgs:["install"],version:"1.x",executable:"npx",semver:"<2",default:!0},{name:"berry",template:"berry",command:"yarn",installArgs:["install","--no-immutable"],version:"stable",executable:"yarn dlx",semver:">=2"}],bun:[{name:"bun",template:"bun",command:"bun",installArgs:["install"],version:"latest",executable:"bunx",semver:"^1.0.1",default:!0}]};function dh(t){let{version:e,name:r}=t;return e?jk[r].find(n=>(0,ST.satisfies)(e,n.semver)):jk[r].find(n=>n.default)}async function ph(t){let{to:e,logger:r,options:n}=t,i=r!=null?r:new fg(n),s=dh(e);if(!s)throw new He("Unsupported package manager version.",{type:"package_manager-unsupported_version"});if(i.subStep(`running "${s.command} ${s.installArgs.join(" ")}"`),!(n!=null&&n.dry)){let o;i.interactive&&(o=(0,xT.default)({text:"installing dependencies...",spinner:{frames:i.installerFrames()}}).start());try{await(0,wT.default)(s.command,s.installArgs,{cwd:t.project.paths.root}),o&&o.stop(),i.subStep("dependencies installed")}catch(a){throw i.subStepFailure("failed to install dependencies"),a}}}Q();async function DT({project:t,convertTo:e,logger:r,options:n}){if(r.header(`Converting project from ${t.packageManager} to ${e.name}.`),t.packageManager===e.name)throw new He("You are already using this package manager",{type:"package_manager-already_in_use"});if(!e.version)throw new He(`${e.name} is not installed, or could not be located`,{type:"package_manager-could_not_be_found"});let i=e;await go[t.packageManager].remove({project:t,to:i,logger:r,options:n}),await go[i.name].create({project:t,to:i,logger:r,options:n}),r.mainStep("Installing dependencies"),n!=null&&n.skipInstall?r.subStep((0,AT.yellow)("Skipping install")):(await go[i.name].convertLock({project:t,to:i,logger:r,options:n}),await ph({project:t,to:i,logger:r,options:n})),r.mainStep(`Cleaning up ${t.packageManager} workspaces`),await go[t.packageManager].clean({project:t,logger:r})}Q();async function CT({root:t,to:e,options:r}){let n=new fg({...r,interactive:!1}),[i,s]=await Promise.all([fh({root:t}),aT()]);await DT({project:i,convertTo:{name:e,version:s[e]},logger:n,options:r})}var Yn=require("child_process"),RT=pe(require("path")),kT=require("fs"),TT=`
|
70
70
|
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
71
71
|
|
72
72
|
# dependencies
|
@@ -91,7 +91,7 @@ yarn-error.log*
|
|
91
91
|
|
92
92
|
# vercel
|
93
93
|
.vercel
|
94
|
-
`,E$="git rev-parse --is-inside-work-tree",w$="hg --cwd . root";function x$(){try{return(0,Yn.execSync)(E$,{stdio:"ignore"}),!0}catch{}return!1}function S$(){try{return(0,Yn.execSync)(w$,{stdio:"ignore"}),!0}catch{}return!1}function OT(t,e){let r=!1;try{return x$()||S$()?!1:((0,Yn.execSync)("git init",{stdio:"ignore"}),(0,Yn.execSync)("git add -A",{stdio:"ignore"}),r=!0,(0,Yn.execSync)("git checkout -b main",{stdio:"ignore"}),PT(e),!0)}catch{if(r)try{(0,kT.
|
94
|
+
`,E$="git rev-parse --is-inside-work-tree",w$="hg --cwd . root";function x$(){try{return(0,Yn.execSync)(E$,{stdio:"ignore"}),!0}catch{}return!1}function S$(){try{return(0,Yn.execSync)(w$,{stdio:"ignore"}),!0}catch{}return!1}function OT(t,e){let r=!1;try{return x$()||S$()?!1:((0,Yn.execSync)("git init",{stdio:"ignore"}),(0,Yn.execSync)("git add -A",{stdio:"ignore"}),r=!0,(0,Yn.execSync)("git checkout -b main",{stdio:"ignore"}),PT(e),!0)}catch{if(r)try{(0,kT.rmSync)(RT.default.join(t,".git"),{recursive:!0,force:!0})}catch{}return!1}}function dg(t){try{return PT(t),!0}catch{return!1}}function FT(){try{A$()}catch{}}function A$(){(0,Yn.execSync)("git add -A",{stdio:"ignore"})}function PT(t){(0,Yn.execSync)(`git commit --author="Turbobot <turbobot@vercel.com>" -am "${t}"`,{stdio:"ignore"})}var IT=require("child_process"),pg=pe(require("dns")),LT=pe(require("url"));function D$(){if(process.env.https_proxy)return process.env.https_proxy;try{let t=(0,IT.execSync)("npm config get https-proxy").toString().trim();return t!=="null"?t:void 0}catch{}}function BT(){return new Promise(t=>{pg.default.lookup("registry.yarnpkg.com",e=>{if(!e){t(!0);return}let r=D$();if(!r){t(!1);return}let{hostname:n}=LT.default.parse(r);if(!n){t(!1);return}pg.default.lookup(n,i=>{t(i===null)})})})}var NT={name:"package-manager"};async function MT(t){let{project:e,prompts:r}=t,{root:n,packageManager:i}=r;if(i&&e.packageManager!==i.name)await CT({root:n,to:i.name,options:{skipInstall:!0}});else return{result:"not-applicable",...NT};return{result:"success",...NT}}var mg=pe(require("path")),Kn=require("fs-extra");var C$=new Set(["basic","default"]);function mh(t){return C$.has(t)}var fr=class extends Error{constructor(r,n){var i,s;super(r);this.name="TransformError",this.transform=(i=n==null?void 0:n.transform)!=null?i:"unknown",this.fatal=(s=n==null?void 0:n.fatal)!=null?s:!0,Error.captureStackTrace(this,fr)}};var yh={name:"official-starter"};async function jT(t){var c;let{prompts:e,example:r,opts:n}=t,i=mh(r.name);if(!(!r.repo||r.repo.username==="vercel"&&r.repo.name==="turbo"))return{result:"not-applicable",...yh};let o=mg.default.join(e.root,"package.json"),a=mg.default.join(e.root,"meta.json"),u=(0,Kn.existsSync)(o);try{(0,Kn.rmSync)(a,{force:!0})}catch{}if(u){let l;try{l=(0,Kn.readJsonSync)(o)}catch{throw new fr("Unable to read package.json",{transform:yh.name,fatal:!1})}if(l){if(i&&(l.name=e.projectName),(c=l.devDependencies)!=null&&c.turbo)if(n.turboVersion)l.devDependencies.turbo=n.turboVersion;else{let h=nh().version;l.devDependencies.turbo=`^${h}`}try{(0,Kn.writeJsonSync)(o,l,{spaces:2})}catch{throw new fr("Unable to write package.json",{transform:yh.name,fatal:!1})}}}return{result:"success",...yh}}var qT=pe(require("path")),gg=pe(require("fs-extra"));var yg={name:"git-ignore"};async function UT(t){let{prompts:e}=t,r=qT.default.join(e.root,".gitignore");try{if(!gg.default.existsSync(r))gg.default.writeFileSync(r,TT);else return{result:"not-applicable",...yg}}catch{throw new fr("Unable to write .gitignore",{transform:yg.name,fatal:!1})}return{result:"success",...yg}}var gh=require("fs-extra"),HT={name:"pnpm-eslint"},R$={"eslint.workingDirectories":[{mode:"auto"}]};async function $T(t){let{project:e,prompts:r}=t,{packageManager:n}=r;if((n==null?void 0:n.name)==="pnpm")await(0,gh.mkdir)(`${e.paths.root}/.vscode`,{recursive:!0}),await(0,gh.writeJson)(`${e.paths.root}/.vscode/settings.json`,R$,{spaces:2});else return{result:"not-applicable",...HT};return{result:"success",...HT}}var GT=[jT,UT,MT,$T];var _g=pe(require("inquirer"));async function zT({dir:t}){let e=await _g.default.prompt({type:"input",name:"projectDirectory",message:"Where would you like to create your Turborepo?",when:!t,default:"./my-turborepo",validate:n=>{let{valid:i,error:s}=mc(n);return!i&&s?s:!0},filter:n=>n.trim()}),{projectDirectory:r=t}=e;return mc(r)}async function WT({manager:t,skipTransforms:e}){if(e)return;let r=await Ko(),n=await _g.default.prompt({name:"packageManagerInput",type:"list",message:"Which package manager do you want to use?",when:!t||!r[t],choices:[{pm:"npm",label:"npm"},{pm:"pnpm",label:"pnpm"},{pm:"yarn",label:"yarn"},{pm:"bun",label:"Bun (beta)"}].map(({pm:s,label:o})=>({name:o,value:s,disabled:r[s]?!1:"not installed"}))}),{packageManagerInput:i=t}=n;return{name:i,version:r[i]}}var{turboGradient:VT,turboLoader:T$,info:O$,error:Ha,warn:bg}=fe;function F$(t){var e,r,n,i,s,o;(e=t.telemetry)==null||e.trackOptionPackageManager(t.packageManager),(r=t.telemetry)==null||r.trackOptionSkipInstall(t.skipInstall),(n=t.telemetry)==null||n.trackOptionSkipTransforms(t.skipTransforms),(i=t.telemetry)==null||i.trackOptionExample(t.example),(s=t.telemetry)==null||s.trackOptionTurboVersion(t.turboVersion),(o=t.telemetry)==null||o.trackOptionExamplePath(t.examplePath)}function vg(t,e){if(e==null||e.trackCommandStatus({command:"create",status:"error"}),t instanceof fr)Ha((0,ze.bold)(t.transform),(0,ze.red)(t.message)),t.fatal&&process.exit(1);else if(t instanceof He&&t.type!=="unknown")Ha((0,ze.red)(t.message)),process.exit(1);else if(t instanceof ro)Ha((0,ze.red)("Unable to download template from Github")),Ha((0,ze.red)(t.message)),process.exit(1);else throw t}var YT={build:"Build",dev:"Develop",test:"Test",lint:"Lint"};async function Eg(t,e){var M,x,D;(M=e.telemetry)==null||M.trackCommandStatus({command:"create",status:"start"}),(x=e.telemetry)==null||x.trackArgumentDirectory(!!t),F$(e);let{packageManager:r,skipInstall:n,skipTransforms:i}=e,[s,o]=await Promise.all([BT(),Ko()]);s||(Ha("You appear to be offline. Please check your network connection and try again."),process.exit(1));let{root:a,projectName:u}=await zT({dir:t}),c=Ua.default.relative(process.cwd(),a),l=c==="",h=await WT({manager:r,skipTransforms:i});r&&e.skipTransforms&&bg("--skip-transforms conflicts with <package-manager>. The package manager argument will be ignored.");let{example:f,examplePath:d}=e,m=f&&f!=="default"?f:"basic",y={};try{y=await Ny({appPath:a,example:m,isDefaultExample:mh(m),examplePath:d})}catch(j){vg(j,e.telemetry)}let{hasPackageJson:p,availableScripts:E,repoInfo:R}=y;OT(a,`feat(create-turbo): create ${m}`);let T={};try{T=await fh({root:a})}catch(j){vg(j,e.telemetry)}if(!i)for(let j of GT)try{let W=await j({example:{repo:R,name:m},project:T,prompts:{projectName:u,root:a,packageManager:h},opts:e});W.result==="success"&&(FT(),dg(`feat(create-turbo): apply ${W.name} transform`))}catch(W){vg(W,e.telemetry)}let P=i||!h?{name:T.packageManager,version:o[T.packageManager]}:h;if(O$("Creating a new Turborepo with:"),fe.log(),T.workspaceData.workspaces.length>0){let j=T.workspaceData.workspaces.map(N=>({group:(ee=>ee==="apps"?"Application packages":ee==="packages"?"Library packages":ee)(Ua.default.relative(a,N.paths.root).split(Ua.default.sep)[0]||""),title:Ua.default.relative(a,N.paths.root),description:N.description})).sort((N,K)=>N.title.localeCompare(K.title)),W;j.forEach(({group:N,title:K,description:ee},ie)=>{(ie===0||N!==W)&&fe.log((0,ze.cyan)(N)),fe.log(` - ${(0,ze.bold)(K)}${ee?`: ${ee}`:""}`),W=N})}else fe.log((0,ze.cyan)("apps")),fe.log(` - ${(0,ze.bold)(u)}`);if(fe.log(),p&&!n){if(e.skipTransforms&&!o[T.packageManager])bg(`Unable to install dependencies - "${m}" uses "${T.packageManager}" which could not be found.`),bg(`Try running without "--skip-transforms" to convert "${m}" to a package manager that is available on your system.`),fe.log();else if(P.version){let j=T$("Installing dependencies...").start();await ph({project:T,to:P,options:{interactive:!1}}),dg("feat(create-turbo): install dependencies"),j.stop()}}l?fe.log(`${(0,ze.bold)(VT(">>> Success!"))} Your new Turborepo is ready.`):fe.log(`${(0,ze.bold)(VT(">>> Success!"))} Created your Turborepo at ${(0,ze.green)(c)}`);let F=dh(P);F&&p&&(fe.log(),fe.log((0,ze.bold)("To get started:")),l||fe.log(`- Change to the directory: ${(0,ze.cyan)(`cd ${c}`)}`),fe.log(`- Enable Remote Caching (recommended): ${(0,ze.cyan)(`${F.executable} turbo login`)}`),fe.log(" - Learn more: https://turbo.build/repo/remote-cache"),fe.log(),fe.log("- Run commands with Turborepo:"),E.filter(j=>YT[j]).forEach(j=>{fe.log(` - ${(0,ze.cyan)(`${F.command} run ${j}`)}: ${YT[j]} all apps and packages`)}),fe.log("- Run a command twice to hit cache")),(D=e.telemetry)==null||D.trackCommandStatus({command:"create",status:"end"})}var _h,XT=new JT.ProxyAgent;KT.default.globalAgent=XT;ZT.default.globalAgent=XT;var Sg=new $a.Command;Sg.name((0,wg.bold)(fe.turboGradient("create-turbo"))).description("Create a new Turborepo").usage(`${(0,wg.bold)("<project-directory>")} [options]`).hook("preAction",async(t,e)=>{let{telemetry:r}=await Jy({packageInfo:{name:"create-turbo",version:xg.default.version}});e.addOption(new $a.Option("--telemetry").default(r).hideHelp()),_h=r}).hook("postAction",async()=>{await(_h==null?void 0:_h.close())}).argument("[project-directory]").addOption(new $a.Option("-m, --package-manager <package-manager>","Specify the package manager to use").choices(["npm","yarn","pnpm","bun"])).option("--skip-install","Do not run a package manager install after creating the project",!1).option("--skip-transforms","Do not run any code transformation after creating the project",!1).option("--turbo-version <version>","Use a specific version of turbo (default: latest)").option("-e, --example [name]|[github-url]",`
|
95
95
|
An example to bootstrap the app with. You can use an example name
|
96
96
|
from the official Turborepo repo or a GitHub URL. The URL can use
|
97
97
|
any branch and/or subdirectory
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "create-turbo",
|
3
|
-
"version": "2.0.
|
3
|
+
"version": "2.0.10-canary.0",
|
4
4
|
"description": "Create a new Turborepo",
|
5
5
|
"homepage": "https://turbo.build/repo",
|
6
6
|
"license": "MIT",
|
@@ -21,7 +21,6 @@
|
|
21
21
|
"inquirer": "^8.0.0",
|
22
22
|
"picocolors": "1.0.1",
|
23
23
|
"proxy-agent": "^6.2.2",
|
24
|
-
"rimraf": "^3.0.2",
|
25
24
|
"semver": "^7.3.8",
|
26
25
|
"update-check": "^1.5.4"
|
27
26
|
},
|
@@ -30,18 +29,17 @@
|
|
30
29
|
"@types/inquirer": "^7.3.1",
|
31
30
|
"@types/jest": "^27.4.0",
|
32
31
|
"@types/node": "^18.17.2",
|
33
|
-
"@types/rimraf": "^3.0.2",
|
34
32
|
"@types/semver": "^7.3.9",
|
35
33
|
"jest": "^27.4.3",
|
36
34
|
"ts-jest": "^27.1.1",
|
37
35
|
"tsup": "^6.7.0",
|
38
36
|
"typescript": "^5.2.2",
|
39
|
-
"@turbo/
|
40
|
-
"@turbo/tsconfig": "0.0.0",
|
37
|
+
"@turbo/eslint-config": "0.0.0",
|
41
38
|
"@turbo/test-utils": "0.0.0",
|
39
|
+
"@turbo/tsconfig": "0.0.0",
|
42
40
|
"@turbo/utils": "0.0.0",
|
43
|
-
"@turbo/
|
44
|
-
"@turbo/workspaces": "2.0.
|
41
|
+
"@turbo/telemetry": "0.0.0",
|
42
|
+
"@turbo/workspaces": "2.0.10-canary.0"
|
45
43
|
},
|
46
44
|
"files": [
|
47
45
|
"dist"
|