create-turbo 1.9.0 → 1.9.2-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 -5
package/dist/cli.js
CHANGED
@@ -73,11 +73,11 @@ GFS4: `),console.error(d)}),r[o]||(f=global[o]||[],p(r,f),r.close=function(d){fu
|
|
73
73
|
`:`
|
74
74
|
`.charCodeAt(),i=typeof r=="string"?"\r":"\r".charCodeAt();return r[r.length-1]===n&&(r=r.slice(0,r.length-1)),r[r.length-1]===i&&(r=r.slice(0,r.length-1)),r}}),Ox=W((e,t)=>{"use strict";G();var r=ue("path"),n=wd(),i=u=>{u={cwd:process.cwd(),path:process.env[n()],execPath:process.execPath,...u};let s,o=r.resolve(u.cwd),a=[];for(;s!==o;)a.push(r.join(o,"node_modules/.bin")),s=o,o=r.resolve(o,"..");let c=r.resolve(u.cwd,u.execPath,"..");return a.push(c),a.concat(u.path).join(r.delimiter)};t.exports=i,t.exports.default=i,t.exports.env=u=>{u={env:process.env,...u};let s={...u.env},o=n({env:s});return u.path=s[o],s[o]=t.exports(u),s}}),Tx=W((e,t)=>{"use strict";G();var r=(n,i)=>{for(let u of Reflect.ownKeys(i))Object.defineProperty(n,u,Object.getOwnPropertyDescriptor(i,u));return n};t.exports=r,t.exports.default=r}),Px=W((e,t)=>{"use strict";G();var r=Tx(),n=new WeakMap,i=(u,s={})=>{if(typeof u!="function")throw new TypeError("Expected a function");let o,a=0,c=u.displayName||u.name||"<anonymous>",p=function(...l){if(n.set(p,++a),a===1)o=u.apply(this,l),u=null;else if(s.throw===!0)throw new Error(`Function \`${c}\` can only be called once`);return o};return r(p,u),n.set(p,a),p};t.exports=i,t.exports.default=i,t.exports.callCount=u=>{if(!n.has(u))throw new Error(`The given function \`${u.name}\` is not wrapped by the \`onetime\` package`);return n.get(u)}}),Lx=W(e=>{"use strict";G(),Object.defineProperty(e,"__esModule",{value:!0}),e.SIGNALS=void 0;var t=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];e.SIGNALS=t}),Cd=W(e=>{"use strict";G(),Object.defineProperty(e,"__esModule",{value:!0}),e.SIGRTMAX=e.getRealtimeSignals=void 0;var t=function(){let u=i-n+1;return Array.from({length:u},r)};e.getRealtimeSignals=t;var r=function(u,s){return{name:`SIGRT${s+1}`,number:n+s,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},n=34,i=64;e.SIGRTMAX=i}),Ix=W(e=>{"use strict";G(),Object.defineProperty(e,"__esModule",{value:!0}),e.getSignals=void 0;var t=ue("os"),r=Lx(),n=Cd(),i=function(){let s=(0,n.getRealtimeSignals)();return[...r.SIGNALS,...s].map(u)};e.getSignals=i;var u=function({name:s,number:o,description:a,action:c,forced:p=!1,standard:l}){let{signals:{[s]:f}}=t.constants,h=f!==void 0;return{name:s,number:h?f:o,description:a,supported:h,action:c,forced:p,standard:l}}}),Nx=W(e=>{"use strict";G(),Object.defineProperty(e,"__esModule",{value:!0}),e.signalsByNumber=e.signalsByName=void 0;var t=ue("os"),r=Ix(),n=Cd(),i=function(){return(0,r.getSignals)().reduce(u,{})},u=function(l,{name:f,number:h,description:m,supported:v,action:_,forced:E,standard:d}){return{...l,[f]:{name:f,number:h,description:m,supported:v,action:_,forced:E,standard:d}}},s=i();e.signalsByName=s;var o=function(){let l=(0,r.getSignals)(),f=n.SIGRTMAX+1,h=Array.from({length:f},(m,v)=>a(v,l));return Object.assign({},...h)},a=function(l,f){let h=c(l,f);if(h===void 0)return{};let{name:m,description:v,supported:_,action:E,forced:d,standard:y}=h;return{[l]:{name:m,number:l,description:v,supported:_,action:E,forced:d,standard:y}}},c=function(l,f){let h=f.find(({name:m})=>t.constants.signals[m]===l);return h!==void 0?h:f.find(m=>m.number===l)},p=o();e.signalsByNumber=p}),Bx=W((e,t)=>{"use strict";G();var{signalsByName:r}=Nx(),n=({timedOut:u,timeout:s,errorCode:o,signal:a,signalDescription:c,exitCode:p,isCanceled:l})=>u?`timed out after ${s} milliseconds`:l?"was canceled":o!==void 0?`failed with ${o}`:a!==void 0?`was killed with ${a} (${c})`:p!==void 0?`failed with exit code ${p}`:"failed",i=({stdout:u,stderr:s,all:o,error:a,signal:c,exitCode:p,command:l,escapedCommand:f,timedOut:h,isCanceled:m,killed:v,parsed:{options:{timeout:_}}})=>{p=p===null?void 0:p,c=c===null?void 0:c;let E=c===void 0?void 0:r[c].description,d=a&&a.code,y=`Command ${n({timedOut:h,timeout:_,errorCode:d,signal:c,signalDescription:E,exitCode:p,isCanceled:m})}: ${l}`,D=Object.prototype.toString.call(a)==="[object Error]",g=D?`${y}
|
75
75
|
${a.message}`:y,A=[g,s,u].filter(Boolean).join(`
|
76
|
-
`);return D?(a.originalMessage=a.message,a.message=A):a=new Error(A),a.shortMessage=g,a.command=l,a.escapedCommand=f,a.exitCode=p,a.signal=c,a.signalDescription=E,a.stdout=u,a.stderr=s,o!==void 0&&(a.all=o),"bufferedData"in a&&delete a.bufferedData,a.failed=!0,a.timedOut=Boolean(h),a.isCanceled=m,a.killed=v&&!h,a};t.exports=i}),Mx=W((e,t)=>{"use strict";G();var r=["stdin","stdout","stderr"],n=u=>r.some(s=>u[s]!==void 0),i=u=>{if(!u)return;let{stdio:s}=u;if(s===void 0)return r.map(a=>u[a]);if(n(u))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${r.map(a=>`\`${a}\``).join(", ")}`);if(typeof s=="string")return s;if(!Array.isArray(s))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof s}\``);let o=Math.max(s.length,r.length);return Array.from({length:o},(a,c)=>s[c])};t.exports=i,t.exports.node=u=>{let s=i(u);return s==="ipc"?"ipc":s===void 0||typeof s=="string"?[s,s,s,"ipc"]:s.includes("ipc")?s:[...s,"ipc"]}}),jx=W((e,t)=>{G(),t.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&t.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&t.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}),$x=W((e,t)=>{G();var r=global.process,n=function(d){return d&&typeof d=="object"&&typeof d.removeListener=="function"&&typeof d.emit=="function"&&typeof d.reallyExit=="function"&&typeof d.listeners=="function"&&typeof d.kill=="function"&&typeof d.pid=="number"&&typeof d.on=="function"};n(r)?(i=ue("assert"),u=jx(),s=/^win/i.test(r.platform),o=ue("events"),typeof o!="function"&&(o=o.EventEmitter),r.__signal_exit_emitter__?a=r.__signal_exit_emitter__:(a=r.__signal_exit_emitter__=new o,a.count=0,a.emitted={}),a.infinite||(a.setMaxListeners(1/0),a.infinite=!0),t.exports=function(d,y){if(!n(global.process))return function(){};i.equal(typeof d,"function","a callback must be provided for exit handler"),f===!1&&h();var D="exit";y&&y.alwaysLast&&(D="afterexit");var g=function(){a.removeListener(D,d),a.listeners("exit").length===0&&a.listeners("afterexit").length===0&&c()};return a.on(D,d),g},c=function(){!f||!n(global.process)||(f=!1,u.forEach(function(d){try{r.removeListener(d,l[d])}catch{}}),r.emit=_,r.reallyExit=m,a.count-=1)},t.exports.unload=c,p=function(d,y,D){a.emitted[d]||(a.emitted[d]=!0,a.emit(d,y,D))},l={},u.forEach(function(d){l[d]=function(){if(n(global.process)){var y=r.listeners(d);y.length===a.count&&(c(),p("exit",null,d),p("afterexit",null,d),s&&d==="SIGHUP"&&(d="SIGINT"),r.kill(r.pid,d))}}}),t.exports.signals=function(){return u},f=!1,h=function(){f||!n(global.process)||(f=!0,a.count+=1,u=u.filter(function(d){try{return r.on(d,l[d]),!0}catch{return!1}}),r.emit=E,r.reallyExit=v)},t.exports.load=h,m=r.reallyExit,v=function(d){!n(global.process)||(r.exitCode=d||0,p("exit",r.exitCode,null),p("afterexit",r.exitCode,null),m.call(r,r.exitCode))},_=r.emit,E=function(d,y){if(d==="exit"&&n(global.process)){y!==void 0&&(r.exitCode=y);var D=_.apply(this,arguments);return p("exit",r.exitCode,null),p("afterexit",r.exitCode,null),D}else return _.apply(this,arguments)}):t.exports=function(){return function(){}};var i,u,s,o,a,c,p,l,f,h,m,v,_,E}),Hx=W((e,t)=>{"use strict";G();var r=ue("os"),n=$x(),i=1e3*5,u=(v,_="SIGTERM",E={})=>{let d=v(_);return s(v,_,E,d),d},s=(v,_,E,d)=>{if(!o(_,E,d))return;let y=c(E),D=setTimeout(()=>{v("SIGKILL")},y);D.unref&&D.unref()},o=(v,{forceKillAfterTimeout:_},E)=>a(v)&&_!==!1&&E,a=v=>v===r.constants.signals.SIGTERM||typeof v=="string"&&v.toUpperCase()==="SIGTERM",c=({forceKillAfterTimeout:v=!0})=>{if(v===!0)return i;if(!Number.isFinite(v)||v<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${v}\` (${typeof v})`);return v},p=(v,_)=>{v.kill()&&(_.isCanceled=!0)},l=(v,_,E)=>{v.kill(_),E(Object.assign(new Error("Timed out"),{timedOut:!0,signal:_}))},f=(v,{timeout:_,killSignal:E="SIGTERM"},d)=>{if(_===0||_===void 0)return d;let y,D=new Promise((A,b)=>{y=setTimeout(()=>{l(v,E,b)},_)}),g=d.finally(()=>{clearTimeout(y)});return Promise.race([D,g])},h=({timeout:v})=>{if(v!==void 0&&(!Number.isFinite(v)||v<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${v}\` (${typeof v})`)},m=async(v,{cleanup:_,detached:E},d)=>{if(!_||E)return d;let y=n(()=>{v.kill()});return d.finally(()=>{y()})};t.exports={spawnedKill:u,spawnedCancel:p,setupTimeout:f,validateTimeout:h,setExitHandler:m}}),Gx=W((e,t)=>{"use strict";G();var r=n=>n!==null&&typeof n=="object"&&typeof n.pipe=="function";r.writable=n=>r(n)&&n.writable!==!1&&typeof n._write=="function"&&typeof n._writableState=="object",r.readable=n=>r(n)&&n.readable!==!1&&typeof n._read=="function"&&typeof n._readableState=="object",r.duplex=n=>r.writable(n)&&r.readable(n),r.transform=n=>r.duplex(n)&&typeof n._transform=="function",t.exports=r}),qx=W((e,t)=>{"use strict";G();var{PassThrough:r}=ue("stream");t.exports=n=>{n={...n};let{array:i}=n,{encoding:u}=n,s=u==="buffer",o=!1;i?o=!(u||s):u=u||"utf8",s&&(u=null);let a=new r({objectMode:o});u&&a.setEncoding(u);let c=0,p=[];return a.on("data",l=>{p.push(l),o?c=p.length:c+=l.length}),a.getBufferedValue=()=>i?p:s?Buffer.concat(p,c):p.join(""),a.getBufferedLength=()=>c,a}}),Ux=W((e,t)=>{"use strict";G();var{constants:r}=ue("buffer"),n=ue("stream"),{promisify:i}=ue("util"),u=qx(),s=i(n.pipeline),o=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function a(c,p){if(!c)throw new Error("Expected a stream");p={maxBuffer:1/0,...p};let{maxBuffer:l}=p,f=u(p);return await new Promise((h,m)=>{let v=_=>{_&&f.getBufferedLength()<=r.MAX_LENGTH&&(_.bufferedData=f.getBufferedValue()),m(_)};(async()=>{try{await s(c,f),h()}catch(_){v(_)}})(),f.on("data",()=>{f.getBufferedLength()>l&&v(new o)})}),f.getBufferedValue()}t.exports=a,t.exports.buffer=(c,p)=>a(c,{...p,encoding:"buffer"}),t.exports.array=(c,p)=>a(c,{...p,array:!0}),t.exports.MaxBufferError=o}),Wx=W((e,t)=>{"use strict";G();var{PassThrough:r}=ue("stream");t.exports=function(){var n=[],i=new r({objectMode:!0});return i.setMaxListeners(0),i.add=u,i.isEmpty=s,i.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(u),i;function u(a){return Array.isArray(a)?(a.forEach(u),this):(n.push(a),a.once("end",o.bind(null,a)),a.once("error",i.emit.bind(i,"error")),a.pipe(i,{end:!1}),this)}function s(){return n.length==0}function o(a){n=n.filter(function(c){return c!==a}),!n.length&&i.readable&&i.end()}}}),Yx=W((e,t)=>{"use strict";G();var r=Gx(),n=Ux(),i=Wx(),u=(l,f)=>{f===void 0||l.stdin===void 0||(r(f)?f.pipe(l.stdin):l.stdin.end(f))},s=(l,{all:f})=>{if(!f||!l.stdout&&!l.stderr)return;let h=i();return l.stdout&&h.add(l.stdout),l.stderr&&h.add(l.stderr),h},o=async(l,f)=>{if(l){l.destroy();try{return await f}catch(h){return h.bufferedData}}},a=(l,{encoding:f,buffer:h,maxBuffer:m})=>{if(!(!l||!h))return f?n(l,{encoding:f,maxBuffer:m}):n.buffer(l,{maxBuffer:m})},c=async({stdout:l,stderr:f,all:h},{encoding:m,buffer:v,maxBuffer:_},E)=>{let d=a(l,{encoding:m,buffer:v,maxBuffer:_}),y=a(f,{encoding:m,buffer:v,maxBuffer:_}),D=a(h,{encoding:m,buffer:v,maxBuffer:_*2});try{return await Promise.all([E,d,y,D])}catch(g){return Promise.all([{error:g,signal:g.signal,timedOut:g.timedOut},o(l,d),o(f,y),o(h,D)])}},p=({input:l})=>{if(r(l))throw new TypeError("The `input` option cannot be a stream in sync mode")};t.exports={handleInput:u,makeAllStream:s,getSpawnedResult:c,validateInputSync:p}}),Kx=W((e,t)=>{"use strict";G();var r=(async()=>{})().constructor.prototype,n=["then","catch","finally"].map(s=>[s,Reflect.getOwnPropertyDescriptor(r,s)]),i=(s,o)=>{for(let[a,c]of n){let p=typeof o=="function"?(...l)=>Reflect.apply(c.value,o(),l):c.value.bind(o);Reflect.defineProperty(s,a,{...c,value:p})}return s},u=s=>new Promise((o,a)=>{s.on("exit",(c,p)=>{o({exitCode:c,signal:p})}),s.on("error",c=>{a(c)}),s.stdin&&s.stdin.on("error",c=>{a(c)})});t.exports={mergePromise:i,getSpawnedPromise:u}}),Vx=W((e,t)=>{"use strict";G();var r=(p,l=[])=>Array.isArray(l)?[p,...l]:[p],n=/^[\w.-]+$/,i=/"/g,u=p=>typeof p!="string"||n.test(p)?p:`"${p.replace(i,'\\"')}"`,s=(p,l)=>r(p,l).join(" "),o=(p,l)=>r(p,l).map(f=>u(f)).join(" "),a=/ +/g,c=p=>{let l=[];for(let f of p.trim().split(a)){let h=l[l.length-1];h&&h.endsWith("\\")?l[l.length-1]=`${h.slice(0,-1)} ${f}`:l.push(f)}return l};t.exports={joinCommand:s,getEscapedCommand:o,parseCommand:c}}),Qx=W((e,t)=>{"use strict";G();var r=ue("path"),n=ue("child_process"),i=Fx(),u=Rx(),s=Ox(),o=Px(),a=Bx(),c=Mx(),{spawnedKill:p,spawnedCancel:l,setupTimeout:f,validateTimeout:h,setExitHandler:m}=Hx(),{handleInput:v,getSpawnedResult:_,makeAllStream:E,validateInputSync:d}=Yx(),{mergePromise:y,getSpawnedPromise:D}=Kx(),{joinCommand:g,parseCommand:A,getEscapedCommand:b}=Vx(),k=1e3*1e3*100,x=({env:P,extendEnv:C,preferLocal:S,localDir:R,execPath:L})=>{let M=C?{...process.env,...P}:P;return S?s.env({env:M,cwd:R,execPath:L}):M},F=(P,C,S={})=>{let R=i._parse(P,C,S);return P=R.command,C=R.args,S=R.options,S={maxBuffer:k,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:S.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...S},S.env=x(S),S.stdio=c(S),process.platform==="win32"&&r.basename(P,".exe")==="cmd"&&C.unshift("/q"),{file:P,args:C,options:S,parsed:R}},w=(P,C,S)=>typeof C!="string"&&!Buffer.isBuffer(C)?S===void 0?void 0:"":P.stripFinalNewline?u(C):C,O=(P,C,S)=>{let R=F(P,C,S),L=g(P,C),M=b(P,C);h(R.options);let B;try{B=n.spawn(R.file,R.args,R.options)}catch(pe){let ne=new n.ChildProcess,T=Promise.reject(a({error:pe,stdout:"",stderr:"",all:"",command:L,escapedCommand:M,parsed:R,timedOut:!1,isCanceled:!1,killed:!1}));return y(ne,T)}let Q=D(B),Z=f(B,R.options,Q),oe=m(B,R.options,Z),N={isCanceled:!1};B.kill=p.bind(null,B.kill.bind(B)),B.cancel=l.bind(null,B,N);let le=o(async()=>{let[{error:pe,exitCode:ne,signal:T,timedOut:I},$,Y,K]=await _(B,R.options,oe),z=w(R.options,$),J=w(R.options,Y),ee=w(R.options,K);if(pe||ne!==0||T!==null){let ie=a({error:pe,exitCode:ne,signal:T,stdout:z,stderr:J,all:ee,command:L,escapedCommand:M,parsed:R,timedOut:I,isCanceled:N.isCanceled,killed:B.killed});if(!R.options.reject)return ie;throw ie}return{command:L,escapedCommand:M,exitCode:0,stdout:z,stderr:J,all:ee,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return v(B,R.options.input),B.all=E(B,R.options),y(B,le)};t.exports=O,t.exports.sync=(P,C,S)=>{let R=F(P,C,S),L=g(P,C),M=b(P,C);d(R.options);let B;try{B=n.spawnSync(R.file,R.args,R.options)}catch(oe){throw a({error:oe,stdout:"",stderr:"",all:"",command:L,escapedCommand:M,parsed:R,timedOut:!1,isCanceled:!1,killed:!1})}let Q=w(R.options,B.stdout,B.error),Z=w(R.options,B.stderr,B.error);if(B.error||B.status!==0||B.signal!==null){let oe=a({stdout:Q,stderr:Z,error:B.error,signal:B.signal,exitCode:B.status,command:L,escapedCommand:M,parsed:R,timedOut:B.error&&B.error.code==="ETIMEDOUT",isCanceled:!1,killed:B.signal!==null});if(!R.options.reject)return oe;throw oe}return{command:L,escapedCommand:M,exitCode:0,stdout:Q,stderr:Z,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}},t.exports.command=(P,C)=>{let[S,...R]=A(P);return O(S,R,C)},t.exports.commandSync=(P,C)=>{let[S,...R]=A(P);return O.sync(S,R,C)},t.exports.node=(P,C,S={})=>{C&&!Array.isArray(C)&&typeof C=="object"&&(S=C,C=[]);let R=c.node(S),L=process.execArgv.filter(Q=>!Q.startsWith("--inspect")),{nodePath:M=process.execPath,nodeOptions:B=L}=S;return O(M,[...B,P,...Array.isArray(C)?C:[]],{...S,stdin:void 0,stdout:void 0,stderr:void 0,stdio:R,shell:!1})}});G();var Xx=an(Qx());async function oa(e){let t={cwd:yx.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"}};try{let r=await(0,Xx.default)(e,["--version"],t);return{available:!0,version:r.stdout.trim()}}catch{return{available:!1}}}async function Jx(){let[e,t,r]=await Promise.all([oa("yarnpkg"),oa("npm"),oa("pnpm")]);return{yarn:e,pnpm:t,npm:r}}G();var qe=class extends Error{constructor(e,t){var r;super(e),this.name="ConvertError",this.type=(r=t==null?void 0:t.type)!=null?r:"unknown",Error.captureStackTrace(this,qe)}},mt=Ce(require("fs-extra")),sn=Ce(require("path")),Zx=Ce(require("execa")),zx=Ce(require("fs-extra")),eD=Ce(require("chalk")),tD=Ce(require("path")),fi=Ce(require("fs-extra")),nr=Ce(require("path")),rD=Ce(ap()),nD=Ce(Af()),iD=/^(?!_)(.+)@(.+)$/;function st({workspaceRoot:e}){let t=nr.default.join(e,"package.json");try{return fi.default.readJsonSync(t,"utf8")}catch(r){if(r&&typeof r=="object"&&"code"in r){if(r.code==="ENOENT")throw new qe(`no "package.json" found at ${e}`,{type:"package_json-missing"});if(r.code==="EJSONPARSE")throw new qe(`failed to parse "package.json" at ${e}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${e}`)}}function wa({workspaceRoot:e}){let{packageManager:t}=st({workspaceRoot:e});if(t)try{let r=t.match(iD);if(r){let[n,i]=r;return i}}catch{}}function Si({workspaceRoot:e}){let t=st({workspaceRoot:e}),r=nr.default.basename(e),{name:n=r,description:i}=t;return{name:n,description:i}}function Mf({workspaceRoot:e}){let t=nr.default.join(e,"pnpm-workspace.yaml");if(fi.default.existsSync(t))try{let r=nD.default.load(fi.default.readFileSync(t,"utf8"));if(r instanceof Object&&"packages"in r&&Array.isArray(r.packages))return r.packages}catch{throw new qe(`failed to parse ${t}`,{type:"pnpm-workspace_parse_error"})}return[]}function Ca({root:e,lockFile:t,workspaceConfig:r}){let n=u=>nr.default.join(e,u),i={root:e,lockfile:n(t),packageJson:n("package.json"),nodeModules:n("node_modules")};return r&&(i.workspaceConfig=n(r)),i}function ka({workspaceRoot:e,workspaceGlobs:t}){return t?t.flatMap(r=>{let n=`${r}/package.json`;return rD.default.sync(n,{onlyFiles:!0,absolute:!0,cwd:e})}).map(r=>{let n=nr.default.dirname(r),{name:i,description:u}=Si({workspaceRoot:n});return{name:i,description:u,paths:{root:n,packageJson:r,nodeModules:nr.default.join(n,"node_modules")}}}):[]}function oD({directory:e}){let t=nr.default.resolve(process.cwd(),e);return{exists:fi.default.existsSync(t),absolute:t}}function Lr({packageManager:e,action:t,project:r}){let n=r.workspaceData.globs.length>0;return`${t==="remove"?"Removing":"Adding"} ${e} ${n?"workspaces":""} ${t==="remove"?"from":"to"} ${r.name}`}function sD({dependencyList:e,project:t,to:r}){let n=[];return t.workspaceData.workspaces.forEach(i=>{let{name:u}=i;if(e[u]){let s=e[u],o=s.startsWith("workspace:")?s.slice(10):s;e[u]=r.name==="pnpm"?`workspace:${o}`:o,n.push(u)}}),{dependencyList:e,updated:n}}function Tr({project:e,workspace:t,to:r,logger:n,options:i}){if(["yarn","npm"].includes(r.name)&&["yarn","npm"].includes(e.packageManager))return;let u=st({workspaceRoot:t.paths.root}),s={dependencies:[],devDependencies:[],peerDependencies:[],optionalDependencies:[]},o=["dependencies","devDependencies","peerDependencies","optionalDependencies"];o.forEach(l=>{let f=u[l];if(f){let{updated:h,dependencyList:m}=sD({dependencyList:f,project:e,to:r});u[l]=m,s[l]=h}});let a=l=>{let f=s[l].length;if(f>0)return`${eD.default.green(f.toString())} ${l}`},c=o.map(a).filter(Boolean),p=`./${tD.default.relative(e.paths.root,t.paths.packageJson)}`;if(c.length>=1){let l="updating";c.forEach((f,h)=>{c.length===1?l+=` ${f} in ${p}`:h===c.length-1?l+=`and ${f} in ${p}`:l+=` ${f}, `}),n.workspaceStep(l)}else n.workspaceStep(`no workspace dependencies found in ${p}`);i!=null&&i.dry||zx.default.writeJSONSync(t.paths.packageJson,u,{spaces:2})}async function kd(e){let t=sn.default.join(e.workspaceRoot,"pnpm-lock.yaml"),r=sn.default.join(e.workspaceRoot,"pnpm-workspace.yaml"),n=wa({workspaceRoot:e.workspaceRoot});return mt.default.existsSync(t)||mt.default.existsSync(r)||n==="pnpm"}async function aD(e){if(!await kd(e))throw new qe("Not a pnpm project",{type:"package_manager-unexpected"});let{name:t,description:r}=Si(e);return{name:t,description:r,packageManager:"pnpm",paths:Ca({root:e.workspaceRoot,lockFile:"pnpm-lock.yaml",workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:Mf(e),workspaces:ka({workspaceGlobs:Mf(e),...e})}}}async function uD(e){let{project:t,to:r,logger:n,options:i}=e,u=t.workspaceData.globs.length>0;n.mainStep(Lr({action:"create",packageManager:"pnpm",project:t}));let s=st({workspaceRoot:t.paths.root});n.rootHeader(),s.packageManager=`${r.name}@${r.version}`,n.rootStep(`adding "packageManager" field to ${t.name} root "package.json"`),i!=null&&i.dry||(mt.default.writeJSONSync(t.paths.packageJson,s,{spaces:2}),u&&(n.rootStep('adding "pnpm-workspace.yaml"'),mt.default.writeFileSync(sn.default.join(t.paths.root,"pnpm-workspace.yaml"),`packages:
|
76
|
+
`);return D?(a.originalMessage=a.message,a.message=A):a=new Error(A),a.shortMessage=g,a.command=l,a.escapedCommand=f,a.exitCode=p,a.signal=c,a.signalDescription=E,a.stdout=u,a.stderr=s,o!==void 0&&(a.all=o),"bufferedData"in a&&delete a.bufferedData,a.failed=!0,a.timedOut=Boolean(h),a.isCanceled=m,a.killed=v&&!h,a};t.exports=i}),Mx=W((e,t)=>{"use strict";G();var r=["stdin","stdout","stderr"],n=u=>r.some(s=>u[s]!==void 0),i=u=>{if(!u)return;let{stdio:s}=u;if(s===void 0)return r.map(a=>u[a]);if(n(u))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${r.map(a=>`\`${a}\``).join(", ")}`);if(typeof s=="string")return s;if(!Array.isArray(s))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof s}\``);let o=Math.max(s.length,r.length);return Array.from({length:o},(a,c)=>s[c])};t.exports=i,t.exports.node=u=>{let s=i(u);return s==="ipc"?"ipc":s===void 0||typeof s=="string"?[s,s,s,"ipc"]:s.includes("ipc")?s:[...s,"ipc"]}}),jx=W((e,t)=>{G(),t.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&t.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&t.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}),$x=W((e,t)=>{G();var r=global.process,n=function(d){return d&&typeof d=="object"&&typeof d.removeListener=="function"&&typeof d.emit=="function"&&typeof d.reallyExit=="function"&&typeof d.listeners=="function"&&typeof d.kill=="function"&&typeof d.pid=="number"&&typeof d.on=="function"};n(r)?(i=ue("assert"),u=jx(),s=/^win/i.test(r.platform),o=ue("events"),typeof o!="function"&&(o=o.EventEmitter),r.__signal_exit_emitter__?a=r.__signal_exit_emitter__:(a=r.__signal_exit_emitter__=new o,a.count=0,a.emitted={}),a.infinite||(a.setMaxListeners(1/0),a.infinite=!0),t.exports=function(d,y){if(!n(global.process))return function(){};i.equal(typeof d,"function","a callback must be provided for exit handler"),f===!1&&h();var D="exit";y&&y.alwaysLast&&(D="afterexit");var g=function(){a.removeListener(D,d),a.listeners("exit").length===0&&a.listeners("afterexit").length===0&&c()};return a.on(D,d),g},c=function(){!f||!n(global.process)||(f=!1,u.forEach(function(d){try{r.removeListener(d,l[d])}catch{}}),r.emit=_,r.reallyExit=m,a.count-=1)},t.exports.unload=c,p=function(d,y,D){a.emitted[d]||(a.emitted[d]=!0,a.emit(d,y,D))},l={},u.forEach(function(d){l[d]=function(){if(n(global.process)){var y=r.listeners(d);y.length===a.count&&(c(),p("exit",null,d),p("afterexit",null,d),s&&d==="SIGHUP"&&(d="SIGINT"),r.kill(r.pid,d))}}}),t.exports.signals=function(){return u},f=!1,h=function(){f||!n(global.process)||(f=!0,a.count+=1,u=u.filter(function(d){try{return r.on(d,l[d]),!0}catch{return!1}}),r.emit=E,r.reallyExit=v)},t.exports.load=h,m=r.reallyExit,v=function(d){!n(global.process)||(r.exitCode=d||0,p("exit",r.exitCode,null),p("afterexit",r.exitCode,null),m.call(r,r.exitCode))},_=r.emit,E=function(d,y){if(d==="exit"&&n(global.process)){y!==void 0&&(r.exitCode=y);var D=_.apply(this,arguments);return p("exit",r.exitCode,null),p("afterexit",r.exitCode,null),D}else return _.apply(this,arguments)}):t.exports=function(){return function(){}};var i,u,s,o,a,c,p,l,f,h,m,v,_,E}),Hx=W((e,t)=>{"use strict";G();var r=ue("os"),n=$x(),i=1e3*5,u=(v,_="SIGTERM",E={})=>{let d=v(_);return s(v,_,E,d),d},s=(v,_,E,d)=>{if(!o(_,E,d))return;let y=c(E),D=setTimeout(()=>{v("SIGKILL")},y);D.unref&&D.unref()},o=(v,{forceKillAfterTimeout:_},E)=>a(v)&&_!==!1&&E,a=v=>v===r.constants.signals.SIGTERM||typeof v=="string"&&v.toUpperCase()==="SIGTERM",c=({forceKillAfterTimeout:v=!0})=>{if(v===!0)return i;if(!Number.isFinite(v)||v<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${v}\` (${typeof v})`);return v},p=(v,_)=>{v.kill()&&(_.isCanceled=!0)},l=(v,_,E)=>{v.kill(_),E(Object.assign(new Error("Timed out"),{timedOut:!0,signal:_}))},f=(v,{timeout:_,killSignal:E="SIGTERM"},d)=>{if(_===0||_===void 0)return d;let y,D=new Promise((A,b)=>{y=setTimeout(()=>{l(v,E,b)},_)}),g=d.finally(()=>{clearTimeout(y)});return Promise.race([D,g])},h=({timeout:v})=>{if(v!==void 0&&(!Number.isFinite(v)||v<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${v}\` (${typeof v})`)},m=async(v,{cleanup:_,detached:E},d)=>{if(!_||E)return d;let y=n(()=>{v.kill()});return d.finally(()=>{y()})};t.exports={spawnedKill:u,spawnedCancel:p,setupTimeout:f,validateTimeout:h,setExitHandler:m}}),Gx=W((e,t)=>{"use strict";G();var r=n=>n!==null&&typeof n=="object"&&typeof n.pipe=="function";r.writable=n=>r(n)&&n.writable!==!1&&typeof n._write=="function"&&typeof n._writableState=="object",r.readable=n=>r(n)&&n.readable!==!1&&typeof n._read=="function"&&typeof n._readableState=="object",r.duplex=n=>r.writable(n)&&r.readable(n),r.transform=n=>r.duplex(n)&&typeof n._transform=="function",t.exports=r}),qx=W((e,t)=>{"use strict";G();var{PassThrough:r}=ue("stream");t.exports=n=>{n={...n};let{array:i}=n,{encoding:u}=n,s=u==="buffer",o=!1;i?o=!(u||s):u=u||"utf8",s&&(u=null);let a=new r({objectMode:o});u&&a.setEncoding(u);let c=0,p=[];return a.on("data",l=>{p.push(l),o?c=p.length:c+=l.length}),a.getBufferedValue=()=>i?p:s?Buffer.concat(p,c):p.join(""),a.getBufferedLength=()=>c,a}}),Ux=W((e,t)=>{"use strict";G();var{constants:r}=ue("buffer"),n=ue("stream"),{promisify:i}=ue("util"),u=qx(),s=i(n.pipeline),o=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function a(c,p){if(!c)throw new Error("Expected a stream");p={maxBuffer:1/0,...p};let{maxBuffer:l}=p,f=u(p);return await new Promise((h,m)=>{let v=_=>{_&&f.getBufferedLength()<=r.MAX_LENGTH&&(_.bufferedData=f.getBufferedValue()),m(_)};(async()=>{try{await s(c,f),h()}catch(_){v(_)}})(),f.on("data",()=>{f.getBufferedLength()>l&&v(new o)})}),f.getBufferedValue()}t.exports=a,t.exports.buffer=(c,p)=>a(c,{...p,encoding:"buffer"}),t.exports.array=(c,p)=>a(c,{...p,array:!0}),t.exports.MaxBufferError=o}),Wx=W((e,t)=>{"use strict";G();var{PassThrough:r}=ue("stream");t.exports=function(){var n=[],i=new r({objectMode:!0});return i.setMaxListeners(0),i.add=u,i.isEmpty=s,i.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(u),i;function u(a){return Array.isArray(a)?(a.forEach(u),this):(n.push(a),a.once("end",o.bind(null,a)),a.once("error",i.emit.bind(i,"error")),a.pipe(i,{end:!1}),this)}function s(){return n.length==0}function o(a){n=n.filter(function(c){return c!==a}),!n.length&&i.readable&&i.end()}}}),Yx=W((e,t)=>{"use strict";G();var r=Gx(),n=Ux(),i=Wx(),u=(l,f)=>{f===void 0||l.stdin===void 0||(r(f)?f.pipe(l.stdin):l.stdin.end(f))},s=(l,{all:f})=>{if(!f||!l.stdout&&!l.stderr)return;let h=i();return l.stdout&&h.add(l.stdout),l.stderr&&h.add(l.stderr),h},o=async(l,f)=>{if(l){l.destroy();try{return await f}catch(h){return h.bufferedData}}},a=(l,{encoding:f,buffer:h,maxBuffer:m})=>{if(!(!l||!h))return f?n(l,{encoding:f,maxBuffer:m}):n.buffer(l,{maxBuffer:m})},c=async({stdout:l,stderr:f,all:h},{encoding:m,buffer:v,maxBuffer:_},E)=>{let d=a(l,{encoding:m,buffer:v,maxBuffer:_}),y=a(f,{encoding:m,buffer:v,maxBuffer:_}),D=a(h,{encoding:m,buffer:v,maxBuffer:_*2});try{return await Promise.all([E,d,y,D])}catch(g){return Promise.all([{error:g,signal:g.signal,timedOut:g.timedOut},o(l,d),o(f,y),o(h,D)])}},p=({input:l})=>{if(r(l))throw new TypeError("The `input` option cannot be a stream in sync mode")};t.exports={handleInput:u,makeAllStream:s,getSpawnedResult:c,validateInputSync:p}}),Kx=W((e,t)=>{"use strict";G();var r=(async()=>{})().constructor.prototype,n=["then","catch","finally"].map(s=>[s,Reflect.getOwnPropertyDescriptor(r,s)]),i=(s,o)=>{for(let[a,c]of n){let p=typeof o=="function"?(...l)=>Reflect.apply(c.value,o(),l):c.value.bind(o);Reflect.defineProperty(s,a,{...c,value:p})}return s},u=s=>new Promise((o,a)=>{s.on("exit",(c,p)=>{o({exitCode:c,signal:p})}),s.on("error",c=>{a(c)}),s.stdin&&s.stdin.on("error",c=>{a(c)})});t.exports={mergePromise:i,getSpawnedPromise:u}}),Vx=W((e,t)=>{"use strict";G();var r=(p,l=[])=>Array.isArray(l)?[p,...l]:[p],n=/^[\w.-]+$/,i=/"/g,u=p=>typeof p!="string"||n.test(p)?p:`"${p.replace(i,'\\"')}"`,s=(p,l)=>r(p,l).join(" "),o=(p,l)=>r(p,l).map(f=>u(f)).join(" "),a=/ +/g,c=p=>{let l=[];for(let f of p.trim().split(a)){let h=l[l.length-1];h&&h.endsWith("\\")?l[l.length-1]=`${h.slice(0,-1)} ${f}`:l.push(f)}return l};t.exports={joinCommand:s,getEscapedCommand:o,parseCommand:c}}),Qx=W((e,t)=>{"use strict";G();var r=ue("path"),n=ue("child_process"),i=Fx(),u=Rx(),s=Ox(),o=Px(),a=Bx(),c=Mx(),{spawnedKill:p,spawnedCancel:l,setupTimeout:f,validateTimeout:h,setExitHandler:m}=Hx(),{handleInput:v,getSpawnedResult:_,makeAllStream:E,validateInputSync:d}=Yx(),{mergePromise:y,getSpawnedPromise:D}=Kx(),{joinCommand:g,parseCommand:A,getEscapedCommand:b}=Vx(),k=1e3*1e3*100,x=({env:P,extendEnv:C,preferLocal:S,localDir:R,execPath:L})=>{let M=C?{...process.env,...P}:P;return S?s.env({env:M,cwd:R,execPath:L}):M},F=(P,C,S={})=>{let R=i._parse(P,C,S);return P=R.command,C=R.args,S=R.options,S={maxBuffer:k,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:S.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...S},S.env=x(S),S.stdio=c(S),process.platform==="win32"&&r.basename(P,".exe")==="cmd"&&C.unshift("/q"),{file:P,args:C,options:S,parsed:R}},w=(P,C,S)=>typeof C!="string"&&!Buffer.isBuffer(C)?S===void 0?void 0:"":P.stripFinalNewline?u(C):C,O=(P,C,S)=>{let R=F(P,C,S),L=g(P,C),M=b(P,C);h(R.options);let B;try{B=n.spawn(R.file,R.args,R.options)}catch(pe){let ne=new n.ChildProcess,T=Promise.reject(a({error:pe,stdout:"",stderr:"",all:"",command:L,escapedCommand:M,parsed:R,timedOut:!1,isCanceled:!1,killed:!1}));return y(ne,T)}let Q=D(B),Z=f(B,R.options,Q),oe=m(B,R.options,Z),N={isCanceled:!1};B.kill=p.bind(null,B.kill.bind(B)),B.cancel=l.bind(null,B,N);let le=o(async()=>{let[{error:pe,exitCode:ne,signal:T,timedOut:I},$,Y,K]=await _(B,R.options,oe),z=w(R.options,$),J=w(R.options,Y),ee=w(R.options,K);if(pe||ne!==0||T!==null){let ie=a({error:pe,exitCode:ne,signal:T,stdout:z,stderr:J,all:ee,command:L,escapedCommand:M,parsed:R,timedOut:I,isCanceled:N.isCanceled,killed:B.killed});if(!R.options.reject)return ie;throw ie}return{command:L,escapedCommand:M,exitCode:0,stdout:z,stderr:J,all:ee,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return v(B,R.options.input),B.all=E(B,R.options),y(B,le)};t.exports=O,t.exports.sync=(P,C,S)=>{let R=F(P,C,S),L=g(P,C),M=b(P,C);d(R.options);let B;try{B=n.spawnSync(R.file,R.args,R.options)}catch(oe){throw a({error:oe,stdout:"",stderr:"",all:"",command:L,escapedCommand:M,parsed:R,timedOut:!1,isCanceled:!1,killed:!1})}let Q=w(R.options,B.stdout,B.error),Z=w(R.options,B.stderr,B.error);if(B.error||B.status!==0||B.signal!==null){let oe=a({stdout:Q,stderr:Z,error:B.error,signal:B.signal,exitCode:B.status,command:L,escapedCommand:M,parsed:R,timedOut:B.error&&B.error.code==="ETIMEDOUT",isCanceled:!1,killed:B.signal!==null});if(!R.options.reject)return oe;throw oe}return{command:L,escapedCommand:M,exitCode:0,stdout:Q,stderr:Z,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}},t.exports.command=(P,C)=>{let[S,...R]=A(P);return O(S,R,C)},t.exports.commandSync=(P,C)=>{let[S,...R]=A(P);return O.sync(S,R,C)},t.exports.node=(P,C,S={})=>{C&&!Array.isArray(C)&&typeof C=="object"&&(S=C,C=[]);let R=c.node(S),L=process.execArgv.filter(Q=>!Q.startsWith("--inspect")),{nodePath:M=process.execPath,nodeOptions:B=L}=S;return O(M,[...B,P,...Array.isArray(C)?C:[]],{...S,stdin:void 0,stdout:void 0,stderr:void 0,stdio:R,shell:!1})}});G();var Xx=an(Qx());async function oa(e){let t={cwd:yx.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"}},r=!1;try{let n=process.env.npm_config_user_agent;n&&n.startsWith(e)&&(r=!0);let i=await(0,Xx.default)(e,["--version"],t);return{available:!0,version:i.stdout.trim()}}catch{return{available:r}}}async function Jx(){let[e,t,r]=await Promise.all([oa("yarnpkg"),oa("npm"),oa("pnpm")]);return{yarn:e,pnpm:t,npm:r}}G();var qe=class extends Error{constructor(e,t){var r;super(e),this.name="ConvertError",this.type=(r=t==null?void 0:t.type)!=null?r:"unknown",Error.captureStackTrace(this,qe)}},mt=Ce(require("fs-extra")),sn=Ce(require("path")),Zx=Ce(require("execa")),zx=Ce(require("fs-extra")),eD=Ce(require("chalk")),tD=Ce(require("path")),fi=Ce(require("fs-extra")),nr=Ce(require("path")),rD=Ce(ap()),nD=Ce(Af()),iD=/^(?!_)(.+)@(.+)$/;function st({workspaceRoot:e}){let t=nr.default.join(e,"package.json");try{return fi.default.readJsonSync(t,"utf8")}catch(r){if(r&&typeof r=="object"&&"code"in r){if(r.code==="ENOENT")throw new qe(`no "package.json" found at ${e}`,{type:"package_json-missing"});if(r.code==="EJSONPARSE")throw new qe(`failed to parse "package.json" at ${e}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${e}`)}}function wa({workspaceRoot:e}){let{packageManager:t}=st({workspaceRoot:e});if(t)try{let r=t.match(iD);if(r){let[n,i]=r;return i}}catch{}}function Si({workspaceRoot:e}){let t=st({workspaceRoot:e}),r=nr.default.basename(e),{name:n=r,description:i}=t;return{name:n,description:i}}function Mf({workspaceRoot:e}){let t=nr.default.join(e,"pnpm-workspace.yaml");if(fi.default.existsSync(t))try{let r=nD.default.load(fi.default.readFileSync(t,"utf8"));if(r instanceof Object&&"packages"in r&&Array.isArray(r.packages))return r.packages}catch{throw new qe(`failed to parse ${t}`,{type:"pnpm-workspace_parse_error"})}return[]}function Ca({root:e,lockFile:t,workspaceConfig:r}){let n=u=>nr.default.join(e,u),i={root:e,lockfile:n(t),packageJson:n("package.json"),nodeModules:n("node_modules")};return r&&(i.workspaceConfig=n(r)),i}function ka({workspaceRoot:e,workspaceGlobs:t}){return t?t.flatMap(r=>{let n=`${r}/package.json`;return rD.default.sync(n,{onlyFiles:!0,absolute:!0,cwd:e})}).map(r=>{let n=nr.default.dirname(r),{name:i,description:u}=Si({workspaceRoot:n});return{name:i,description:u,paths:{root:n,packageJson:r,nodeModules:nr.default.join(n,"node_modules")}}}):[]}function oD({directory:e}){let t=nr.default.resolve(process.cwd(),e);return{exists:fi.default.existsSync(t),absolute:t}}function Lr({packageManager:e,action:t,project:r}){let n=r.workspaceData.globs.length>0;return`${t==="remove"?"Removing":"Adding"} ${e} ${n?"workspaces":""} ${t==="remove"?"from":"to"} ${r.name}`}function sD({dependencyList:e,project:t,to:r}){let n=[];return t.workspaceData.workspaces.forEach(i=>{let{name:u}=i;if(e[u]){let s=e[u],o=s.startsWith("workspace:")?s.slice(10):s;e[u]=r.name==="pnpm"?`workspace:${o}`:o,n.push(u)}}),{dependencyList:e,updated:n}}function Tr({project:e,workspace:t,to:r,logger:n,options:i}){if(["yarn","npm"].includes(r.name)&&["yarn","npm"].includes(e.packageManager))return;let u=st({workspaceRoot:t.paths.root}),s={dependencies:[],devDependencies:[],peerDependencies:[],optionalDependencies:[]},o=["dependencies","devDependencies","peerDependencies","optionalDependencies"];o.forEach(l=>{let f=u[l];if(f){let{updated:h,dependencyList:m}=sD({dependencyList:f,project:e,to:r});u[l]=m,s[l]=h}});let a=l=>{let f=s[l].length;if(f>0)return`${eD.default.green(f.toString())} ${l}`},c=o.map(a).filter(Boolean),p=`./${tD.default.relative(e.paths.root,t.paths.packageJson)}`;if(c.length>=1){let l="updating";c.forEach((f,h)=>{c.length===1?l+=` ${f} in ${p}`:h===c.length-1?l+=`and ${f} in ${p}`:l+=` ${f}, `}),n.workspaceStep(l)}else n.workspaceStep(`no workspace dependencies found in ${p}`);i!=null&&i.dry||zx.default.writeJSONSync(t.paths.packageJson,u,{spaces:2})}async function kd(e){let t=sn.default.join(e.workspaceRoot,"pnpm-lock.yaml"),r=sn.default.join(e.workspaceRoot,"pnpm-workspace.yaml"),n=wa({workspaceRoot:e.workspaceRoot});return mt.default.existsSync(t)||mt.default.existsSync(r)||n==="pnpm"}async function aD(e){if(!await kd(e))throw new qe("Not a pnpm project",{type:"package_manager-unexpected"});let{name:t,description:r}=Si(e);return{name:t,description:r,packageManager:"pnpm",paths:Ca({root:e.workspaceRoot,lockFile:"pnpm-lock.yaml",workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:Mf(e),workspaces:ka({workspaceGlobs:Mf(e),...e})}}}async function uD(e){let{project:t,to:r,logger:n,options:i}=e,u=t.workspaceData.globs.length>0;n.mainStep(Lr({action:"create",packageManager:"pnpm",project:t}));let s=st({workspaceRoot:t.paths.root});n.rootHeader(),s.packageManager=`${r.name}@${r.version}`,n.rootStep(`adding "packageManager" field to ${t.name} root "package.json"`),i!=null&&i.dry||(mt.default.writeJSONSync(t.paths.packageJson,s,{spaces:2}),u&&(n.rootStep('adding "pnpm-workspace.yaml"'),mt.default.writeFileSync(sn.default.join(t.paths.root,"pnpm-workspace.yaml"),`packages:
|
77
77
|
${t.workspaceData.globs.map(o=>` - "${o}"`).join(`
|
78
78
|
`)}`))),u&&(Tr({workspace:{name:"root",paths:t.paths},project:t,to:r,logger:n,options:i}),n.workspaceHeader(),t.workspaceData.workspaces.forEach(o=>Tr({workspace:o,project:t,to:r,logger:n,options:i})))}async function cD(e){let{project:t,logger:r,options:n}=e,i=t.workspaceData.globs.length>0;r.mainStep(Lr({action:"remove",packageManager:"pnpm",project:t}));let u=st({workspaceRoot:t.paths.root});if(t.paths.workspaceConfig&&i&&(r.subStep('removing "pnpm-workspace.yaml"'),n!=null&&n.dry||mt.default.rmSync(t.paths.workspaceConfig,{force:!0})),r.subStep(`removing "packageManager" field in ${t.name} root "package.json"`),delete u.packageManager,!(n!=null&&n.dry)){mt.default.writeJSONSync(t.paths.packageJson,u,{spaces:2});let s=[t.paths.nodeModules,...t.workspaceData.workspaces.map(o=>o.paths.nodeModules)];try{r.subStep('removing "node_modules"'),await Promise.all(s.map(o=>mt.default.rm(o,{recursive:!0,force:!0})))}catch{throw new qe("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function lD(e){let{project:t,logger:r,options:n}=e;r.subStep(`removing ${sn.default.relative(t.paths.root,t.paths.lockfile)}`),n!=null&&n.dry||mt.default.rmSync(t.paths.lockfile,{force:!0})}async function pD(e){let{project:t,logger:r,options:n}=e;if(t.packageManager!=="pnpm"&&(r.subStep(`converting ${sn.default.relative(t.paths.root,t.paths.lockfile)} to pnpm-lock.yaml`),!(n!=null&&n.dry)&&mt.default.existsSync(t.paths.lockfile)))try{await(0,Zx.default)("pnpm",["import"],{stdio:"ignore",cwd:t.paths.root})}finally{mt.default.rmSync(t.paths.lockfile,{force:!0})}}var fD={detect:kd,read:aD,create:uD,remove:cD,clean:lD,convertLock:pD},dD=fD,ir=Ce(require("fs-extra")),di=Ce(require("path"));async function Fd(e){let t=di.default.join(e.workspaceRoot,"package-lock.json"),r=wa({workspaceRoot:e.workspaceRoot});return ir.default.existsSync(t)||r==="npm"}async function hD(e){if(!await Fd(e))throw new qe("Not an npm project",{type:"package_manager-unexpected"});let t=st(e),{name:r,description:n}=Si(e);return{name:r,description:n,packageManager:"npm",paths:Ca({root:e.workspaceRoot,lockFile:"package-lock.json"}),workspaceData:{globs:t.workspaces||[],workspaces:ka({workspaceGlobs:t.workspaces,...e})}}}async function mD(e){let{project:t,options:r,to:n,logger:i}=e,u=t.workspaceData.globs.length>0;i.mainStep(Lr({packageManager:"npm",action:"create",project:t}));let s=st({workspaceRoot:t.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${di.default.relative(t.paths.root,t.paths.packageJson)}`),s.packageManager=`${n.name}@${n.version}`,u?(i.rootStep(`adding "workspaces" field to ${di.default.relative(t.paths.root,t.paths.packageJson)}`),s.workspaces=t.workspaceData.globs,r!=null&&r.dry||ir.default.writeJSONSync(t.paths.packageJson,s,{spaces:2}),Tr({workspace:{name:"root",paths:t.paths},project:t,to:n,logger:i,options:r}),i.workspaceHeader(),t.workspaceData.workspaces.forEach(o=>Tr({workspace:o,project:t,to:n,logger:i,options:r}))):r!=null&&r.dry||ir.default.writeJSONSync(t.paths.packageJson,s,{spaces:2})}async function gD(e){let{project:t,logger:r,options:n}=e,i=t.workspaceData.globs.length>0;r.mainStep(Lr({packageManager:"npm",action:"remove",project:t}));let u=st({workspaceRoot:t.paths.root});if(i&&(r.subStep(`removing "workspaces" field in ${t.name} root "package.json"`),delete u.workspaces),r.subStep(`removing "packageManager" field in ${t.name} root "package.json"`),delete u.packageManager,!(n!=null&&n.dry)){ir.default.writeJSONSync(t.paths.packageJson,u,{spaces:2});let s=[t.paths.nodeModules,...t.workspaceData.workspaces.map(o=>o.paths.nodeModules)];try{r.subStep('removing "node_modules"'),await Promise.all(s.map(o=>ir.default.rm(o,{recursive:!0,force:!0})))}catch{throw new qe("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function yD(e){let{project:t,logger:r,options:n}=e;r.subStep(`removing ${di.default.relative(t.paths.root,t.paths.lockfile)}`),n!=null&&n.dry||ir.default.rmSync(t.paths.lockfile,{force:!0})}async function vD(e){let{project:t,options:r}=e;t.packageManager!=="npm"&&(r!=null&&r.dry||ir.default.rmSync(t.paths.lockfile,{force:!0}))}var _D={detect:Fd,read:hD,create:mD,remove:gD,clean:yD,convertLock:vD},ED=_D,or=Ce(require("fs-extra")),hi=Ce(require("path"));async function Rd(e){let t=hi.default.join(e.workspaceRoot,"yarn.lock"),r=wa({workspaceRoot:e.workspaceRoot});return or.default.existsSync(t)||r==="yarn"}async function SD(e){if(!await Rd(e))throw new qe("Not a yarn project",{type:"package_manager-unexpected"});let t=st(e),{name:r,description:n}=Si(e);return{name:r,description:n,packageManager:"yarn",paths:Ca({root:e.workspaceRoot,lockFile:"yarn.lock"}),workspaceData:{globs:t.workspaces||[],workspaces:ka({workspaceGlobs:t.workspaces,...e})}}}async function AD(e){let{project:t,to:r,logger:n,options:i}=e,u=t.workspaceData.globs.length>0;n.mainStep(Lr({packageManager:"yarn",action:"create",project:t}));let s=st({workspaceRoot:t.paths.root});n.rootHeader(),n.rootStep(`adding "packageManager" field to ${hi.default.relative(t.paths.root,t.paths.packageJson)}`),s.packageManager=`${r.name}@${r.version}`,u?(n.rootStep(`adding "workspaces" field to ${hi.default.relative(t.paths.root,t.paths.packageJson)}`),s.workspaces=t.workspaceData.globs,i!=null&&i.dry||or.default.writeJSONSync(t.paths.packageJson,s,{spaces:2}),Tr({workspace:{name:"root",paths:t.paths},project:t,to:r,logger:n,options:i}),n.workspaceHeader(),t.workspaceData.workspaces.forEach(o=>Tr({workspace:o,project:t,to:r,logger:n,options:i}))):i!=null&&i.dry||or.default.writeJSONSync(t.paths.packageJson,s,{spaces:2})}async function bD(e){let{project:t,logger:r,options:n}=e,i=t.workspaceData.globs.length>0;r.mainStep(Lr({packageManager:"yarn",action:"remove",project:t}));let u=st({workspaceRoot:t.paths.root});if(i&&(r.subStep(`removing "workspaces" field in ${t.name} root "package.json"`),delete u.workspaces),r.subStep(`removing "packageManager" field in ${t.name} root "package.json"`),delete u.packageManager,!(n!=null&&n.dry)){or.default.writeJSONSync(t.paths.packageJson,u,{spaces:2});let s=[t.paths.nodeModules,...t.workspaceData.workspaces.map(o=>o.paths.nodeModules)];try{r.subStep('removing "node_modules"'),await Promise.all(s.map(o=>or.default.rm(o,{recursive:!0,force:!0})))}catch{throw new qe("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function xD(e){let{project:t,logger:r,options:n}=e;r.subStep(`removing ${hi.default.relative(t.paths.root,t.paths.lockfile)}`),n!=null&&n.dry||or.default.rmSync(t.paths.lockfile,{force:!0})}async function DD(e){let{project:t,options:r}=e;t.packageManager!=="yarn"&&(r!=null&&r.dry||or.default.rmSync(t.paths.lockfile,{force:!0}))}var wD={detect:Rd,read:SD,create:AD,remove:bD,clean:xD,convertLock:DD},CD=wD,kD={pnpm:dD,yarn:CD,npm:ED},Rr=kD;async function Od({root:e}){let{exists:t,absolute:r}=oD({directory:e});if(!t)throw new qe(`Could not find directory at ${r}. Ensure the directory exists.`,{type:"invalid_directory"});for(let{detect:n,read:i}of Object.values(Rr))if(await n({workspaceRoot:r}))return i({workspaceRoot:r});throw new qe("Could not determine package manager. Add `packageManager` to `package.json` or ensure a lockfile is present.",{type:"package_manager-unable_to_detect"})}var FD=Ce(require("chalk")),RD=Ce(require("execa")),OD=Ce(require("ora")),TD=require("semver"),nt=Ce(require("chalk")),PD=Ce(require("gradient-string")),wr=2,Td=class{constructor({interactive:e,dry:t}={}){this.interactive=e!=null?e:!0,this.dry=t!=null?t:!1,this.step=1}logger(...e){this.interactive&&console.log(...e)}indented(e,...t){this.logger(" ".repeat(wr*e),...t)}header(e){this.blankLine(),this.logger(nt.default.bold(e))}installerFrames(){let e=`${" ".repeat(wr)} - ${this.dry?nt.default.yellow("SKIPPED | "):nt.default.green("OK | ")}`;return[`${e} `,`${e}> `,`${e}>> `,`${e}>>>`]}gradient(e){return(0,PD.default)("#0099F7","#F11712")(e.toString())}hero(){this.logger(nt.default.bold(this.gradient(`
|
79
79
|
>>> TURBOREPO
|
80
|
-
`)))}info(...e){this.logger(...e)}mainStep(e){this.blankLine(),this.logger(`${this.step}. ${nt.default.underline(e)}`),this.step+=1}subStep(...e){this.logger(" ".repeat(wr),"-",this.dry?nt.default.yellow("SKIPPED |"):nt.default.green("OK |"),...e)}subStepFailure(...e){this.logger(" ".repeat(wr),"-",nt.default.red("ERROR |"),...e)}rootHeader(){this.blankLine(),this.indented(2,"Root:")}rootStep(...e){this.logger(" ".repeat(wr*3),"-",this.dry?nt.default.yellow("SKIPPED |"):nt.default.green("OK |"),...e)}workspaceHeader(){this.blankLine(),this.indented(2,"Workspaces:")}workspaceStep(...e){this.logger(" ".repeat(wr*3),"-",this.dry?nt.default.yellow("SKIPPED |"):nt.default.green("OK |"),...e)}blankLine(){this.logger()}error(...e){console.error(...e)}},jf={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"],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"}]};function Pd(e){let{version:t,name:r}=e;return t?jf[r].find(n=>(0,TD.satisfies)(t,n.semver)):jf[r].find(n=>n.default)}async function Ld(e){let{to:t,logger:r,options:n}=e,i=r!=null?r:new Td(n),u=Pd(t);if(!u)throw new qe("Unsupported package manager version.",{type:"package_manager-unsupported_version"});if(i.subStep(`running "${u.command} ${u.installArgs}"`),!(n!=null&&n.dry)){let s;i!=null&&i.interactive&&(s=(0,OD.default)({text:"installing dependencies...",spinner:{frames:i.installerFrames()}}).start());try{await(0,RD.default)(u.command,u.installArgs,{cwd:e.project.paths.root}),s&&s.stop(),i.subStep("dependencies installed")}catch(o){throw i.subStepFailure("failed to install dependencies"),o}}}async function LD({project:e,to:t,logger:r,options:n}){if(r.header(`Converting project from ${e.packageManager} to ${t.name}.`),e.packageManager==t.name)throw new qe("You are already using this package manager",{type:"package_manager-already_in_use"});await Rr[e.packageManager].remove({project:e,to:t,logger:r,options:n}),await Rr[t.name].create({project:e,to:t,logger:r,options:n}),r.mainStep("Installing dependencies"),n!=null&&n.skipInstall?r.subStep(FD.default.yellow("Skipping install")):(await Rr[t.name].convertLock({project:e,logger:r,options:n}),await Ld({project:e,to:t,logger:r,options:n})),r.mainStep(`Cleaning up ${e.packageManager} workspaces`),await Rr[e.packageManager].clean({project:e,logger:r})}async function ID({root:e,to:t,options:r}){let n=new Td({...r,interactive:!1}),[i,u]=await Promise.all([Od({root:e}),Jx()]);await LD({project:i,to:{name:t,version:u[t].version},logger:n,options:r})}});j();var $i=Se(require("chalk")),y0=require("commander");j();var mu=Se(require("chalk")),gu=Se(require("update-check"));var ur={name:"create-turbo",version:"1.9.0",description:"Create a new Turborepo",homepage:"https://turbo.build/repo",license:"MPL-2.0",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/**/*.ts","check-types":"tsc --noEmit"},dependencies:{"async-retry":"^1.3.3",chalk:"2.4.2",commander:"^10.0.0","cross-spawn":"^7.0.3",execa:"5.1.1","fs-extra":"^10.1.0",got:"^11.8.5","gradient-string":"^2.0.0",inquirer:"^8.0.0",ora:"4.1.1",rimraf:"^3.0.2",semver:"^7.3.8",tar:"6.1.13","update-check":"^1.5.4"},devDependencies:{"@turbo/workspaces":"workspace:*","@types/async-retry":"^1.4.5","@types/cross-spawn":"^6.0.2","@types/fs-extra":"^9.0.13","@types/gradient-string":"^1.1.2","@types/inquirer":"^7.3.1","@types/jest":"^27.4.0","@types/node":"^16.11.12","@types/rimraf":"^3.0.2","@types/semver":"^7.3.9","@types/tar":"^6.1.4",eslint:"^7.23.0",jest:"^27.4.3","strip-ansi":"^6.0.1","ts-jest":"^27.1.1",tsconfig:"workspace:*",tsup:"^5.10.3","turbo-utils":"workspace:*","turbo-test-utils":"workspace:*",typescript:"^4.5.5"},files:["dist"]};var C0=(0,gu.default)(ur).catch(()=>null);async function vn(){try{let e=await C0;e!=null&&e.latest&&(console.log(),console.log(mu.default.yellow.bold("A new version of `create-turbo` is available!")),console.log()),process.exit()}catch{}}j();var En=Se(require("chalk")),yu=Se(require("ora")),vu=Se(require("gradient-string")),_u="#0099F7",Eu="#F11712",k0="#FFFF00",cr=(0,vu.default)(_u,Eu),_n=En.default.hex(_u),F0=En.default.hex(Eu),R0=En.default.hex(k0),Sn=e=>(0,yu.default)({text:e,spinner:{frames:[" ",_n("> "),_n(">> "),_n(">>>")]}}),Hi=(...e)=>{console.log(_n.bold(">>>"),...e)},Pe=(...e)=>{console.error(F0.bold(">>>"),...e)},An=(...e)=>{console.error(R0.bold(">>>"),...e)};j();j();var yn=Se(require("path")),Ue=Se(require("chalk")),qt=Se(Fa());j();j();j();j();j();var ND=Object.create,Nd=Object.defineProperty,BD=Object.getOwnPropertyDescriptor,MD=Object.getOwnPropertyNames,jD=Object.getPrototypeOf,$D=Object.prototype.hasOwnProperty,ae=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),HD=(e,t)=>()=>(e&&(t=e(e=0)),t),U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),GD=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of MD(t))!$D.call(e,i)&&i!==r&&Nd(e,i,{get:()=>t[i],enumerable:!(n=BD(t,i))||n.enumerable});return e},jt=(e,t,r)=>(r=e!=null?ND(jD(e)):{},GD(t||!e||!e.__esModule?Nd(r,"default",{value:e,enumerable:!0}):r,e)),H=HD(()=>{});H();var UD=U((e,t)=>{H();function r(n){return t.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},t.exports.__esModule=!0,t.exports.default=t.exports,r(n)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),WD=U((e,t)=>{H();var r=UD().default;function n(){"use strict";t.exports=n=function(){return i},t.exports.__esModule=!0,t.exports.default=t.exports;var i={},u=Object.prototype,s=u.hasOwnProperty,o=typeof Symbol=="function"?Symbol:{},a=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",p=o.toStringTag||"@@toStringTag";function l(C,S,R){return Object.defineProperty(C,S,{value:R,enumerable:!0,configurable:!0,writable:!0}),C[S]}try{l({},"")}catch{l=function(C,S,R){return C[S]=R}}function f(C,S,R,L){var M=S&&S.prototype instanceof v?S:v,B=Object.create(M.prototype),Q=new w(L||[]);return B._invoke=function(Z,oe,N){var le="suspendedStart";return function(pe,ne){if(le==="executing")throw new Error("Generator is already running");if(le==="completed"){if(pe==="throw")throw ne;return P()}for(N.method=pe,N.arg=ne;;){var T=N.delegate;if(T){var I=k(T,N);if(I){if(I===m)continue;return I}}if(N.method==="next")N.sent=N._sent=N.arg;else if(N.method==="throw"){if(le==="suspendedStart")throw le="completed",N.arg;N.dispatchException(N.arg)}else N.method==="return"&&N.abrupt("return",N.arg);le="executing";var $=h(Z,oe,N);if($.type==="normal"){if(le=N.done?"completed":"suspendedYield",$.arg===m)continue;return{value:$.arg,done:N.done}}$.type==="throw"&&(le="completed",N.method="throw",N.arg=$.arg)}}}(C,R,Q),B}function h(C,S,R){try{return{type:"normal",arg:C.call(S,R)}}catch(L){return{type:"throw",arg:L}}}i.wrap=f;var m={};function v(){}function _(){}function E(){}var d={};l(d,a,function(){return this});var y=Object.getPrototypeOf,D=y&&y(y(O([])));D&&D!==u&&s.call(D,a)&&(d=D);var g=E.prototype=v.prototype=Object.create(d);function A(C){["next","throw","return"].forEach(function(S){l(C,S,function(R){return this._invoke(S,R)})})}function b(C,S){function R(M,B,Q,Z){var oe=h(C[M],C,B);if(oe.type!=="throw"){var N=oe.arg,le=N.value;return le&&r(le)=="object"&&s.call(le,"__await")?S.resolve(le.__await).then(function(pe){R("next",pe,Q,Z)},function(pe){R("throw",pe,Q,Z)}):S.resolve(le).then(function(pe){N.value=pe,Q(N)},function(pe){return R("throw",pe,Q,Z)})}Z(oe.arg)}var L;this._invoke=function(M,B){function Q(){return new S(function(Z,oe){R(M,B,Z,oe)})}return L=L?L.then(Q,Q):Q()}}function k(C,S){var R=C.iterator[S.method];if(R===void 0){if(S.delegate=null,S.method==="throw"){if(C.iterator.return&&(S.method="return",S.arg=void 0,k(C,S),S.method==="throw"))return m;S.method="throw",S.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var L=h(R,C.iterator,S.arg);if(L.type==="throw")return S.method="throw",S.arg=L.arg,S.delegate=null,m;var M=L.arg;return M?M.done?(S[C.resultName]=M.value,S.next=C.nextLoc,S.method!=="return"&&(S.method="next",S.arg=void 0),S.delegate=null,m):M:(S.method="throw",S.arg=new TypeError("iterator result is not an object"),S.delegate=null,m)}function x(C){var S={tryLoc:C[0]};1 in C&&(S.catchLoc=C[1]),2 in C&&(S.finallyLoc=C[2],S.afterLoc=C[3]),this.tryEntries.push(S)}function F(C){var S=C.completion||{};S.type="normal",delete S.arg,C.completion=S}function w(C){this.tryEntries=[{tryLoc:"root"}],C.forEach(x,this),this.reset(!0)}function O(C){if(C){var S=C[a];if(S)return S.call(C);if(typeof C.next=="function")return C;if(!isNaN(C.length)){var R=-1,L=function M(){for(;++R<C.length;)if(s.call(C,R))return M.value=C[R],M.done=!1,M;return M.value=void 0,M.done=!0,M};return L.next=L}}return{next:P}}function P(){return{value:void 0,done:!0}}return _.prototype=E,l(g,"constructor",E),l(E,"constructor",_),_.displayName=l(E,p,"GeneratorFunction"),i.isGeneratorFunction=function(C){var S=typeof C=="function"&&C.constructor;return!!S&&(S===_||(S.displayName||S.name)==="GeneratorFunction")},i.mark=function(C){return Object.setPrototypeOf?Object.setPrototypeOf(C,E):(C.__proto__=E,l(C,p,"GeneratorFunction")),C.prototype=Object.create(g),C},i.awrap=function(C){return{__await:C}},A(b.prototype),l(b.prototype,c,function(){return this}),i.AsyncIterator=b,i.async=function(C,S,R,L,M){M===void 0&&(M=Promise);var B=new b(f(C,S,R,L),M);return i.isGeneratorFunction(S)?B:B.next().then(function(Q){return Q.done?Q.value:B.next()})},A(g),l(g,p,"Generator"),l(g,a,function(){return this}),l(g,"toString",function(){return"[object Generator]"}),i.keys=function(C){var S=[];for(var R in C)S.push(R);return S.reverse(),function L(){for(;S.length;){var M=S.pop();if(M in C)return L.value=M,L.done=!1,L}return L.done=!0,L}},i.values=O,w.prototype={constructor:w,reset:function(C){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(F),!C)for(var S in this)S.charAt(0)==="t"&&s.call(this,S)&&!isNaN(+S.slice(1))&&(this[S]=void 0)},stop:function(){this.done=!0;var C=this.tryEntries[0].completion;if(C.type==="throw")throw C.arg;return this.rval},dispatchException:function(C){if(this.done)throw C;var S=this;function R(oe,N){return B.type="throw",B.arg=C,S.next=oe,N&&(S.method="next",S.arg=void 0),!!N}for(var L=this.tryEntries.length-1;L>=0;--L){var M=this.tryEntries[L],B=M.completion;if(M.tryLoc==="root")return R("end");if(M.tryLoc<=this.prev){var Q=s.call(M,"catchLoc"),Z=s.call(M,"finallyLoc");if(Q&&Z){if(this.prev<M.catchLoc)return R(M.catchLoc,!0);if(this.prev<M.finallyLoc)return R(M.finallyLoc)}else if(Q){if(this.prev<M.catchLoc)return R(M.catchLoc,!0)}else{if(!Z)throw new Error("try statement without catch or finally");if(this.prev<M.finallyLoc)return R(M.finallyLoc)}}}},abrupt:function(C,S){for(var R=this.tryEntries.length-1;R>=0;--R){var L=this.tryEntries[R];if(L.tryLoc<=this.prev&&s.call(L,"finallyLoc")&&this.prev<L.finallyLoc){var M=L;break}}M&&(C==="break"||C==="continue")&&M.tryLoc<=S&&S<=M.finallyLoc&&(M=null);var B=M?M.completion:{};return B.type=C,B.arg=S,M?(this.method="next",this.next=M.finallyLoc,m):this.complete(B)},complete:function(C,S){if(C.type==="throw")throw C.arg;return C.type==="break"||C.type==="continue"?this.next=C.arg:C.type==="return"?(this.rval=this.arg=C.arg,this.method="return",this.next="end"):C.type==="normal"&&S&&(this.next=S),m},finish:function(C){for(var S=this.tryEntries.length-1;S>=0;--S){var R=this.tryEntries[S];if(R.finallyLoc===C)return this.complete(R.completion,R.afterLoc),F(R),m}},catch:function(C){for(var S=this.tryEntries.length-1;S>=0;--S){var R=this.tryEntries[S];if(R.tryLoc===C){var L=R.completion;if(L.type==="throw"){var M=L.arg;F(R)}return M}}throw new Error("illegal catch attempt")},delegateYield:function(C,S,R){return this.delegate={iterator:O(C),resultName:S,nextLoc:R},this.method==="next"&&(this.arg=void 0),m}},i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}),YD=U((e,t)=>{H();var r=WD()();t.exports=r;try{regeneratorRuntime=r}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),KD=U((e,t)=>{"use strict";H();var r=(n,...i)=>new Promise(u=>{u(n(...i))});t.exports=r,t.exports.default=r}),VD=U((e,t)=>{"use strict";H();var r=KD(),n=i=>{if(!((Number.isInteger(i)||i===1/0)&&i>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let u=[],s=0,o=()=>{s--,u.length>0&&u.shift()()},a=(l,f,...h)=>{s++;let m=r(l,...h);f(m),m.then(o,o)},c=(l,f,...h)=>{s<i?a(l,f,...h):u.push(a.bind(null,l,f,...h))},p=(l,...f)=>new Promise(h=>c(l,h,...f));return Object.defineProperties(p,{activeCount:{get:()=>s},pendingCount:{get:()=>u.length},clearQueue:{value:()=>{u.length=0}}}),p};t.exports=n,t.exports.default=n}),QD=U((e,t)=>{"use strict";H();var r=VD(),n=class extends Error{constructor(o){super(),this.value=o}},i=async(o,a)=>a(await o),u=async o=>{let a=await Promise.all(o);if(a[1]===!0)throw new n(a[0]);return!1},s=async(o,a,c)=>{c={concurrency:1/0,preserveOrder:!0,...c};let p=r(c.concurrency),l=[...o].map(h=>[h,p(i,h,a)]),f=r(c.preserveOrder?1:1/0);try{await Promise.all(l.map(h=>f(u,h)))}catch(h){if(h instanceof n)return h.value;throw h}};t.exports=s,t.exports.default=s}),XD=U((e,t)=>{"use strict";H();var r=ae("path"),n=ae("fs"),{promisify:i}=ae("util"),u=QD(),s=i(n.stat),o=i(n.lstat),a={directory:"isDirectory",file:"isFile"};function c({type:l}){if(!(l in a))throw new Error(`Invalid type specified: ${l}`)}var p=(l,f)=>l===void 0||f[a[l]]();t.exports=async(l,f)=>{f={cwd:process.cwd(),type:"file",allowSymlinks:!0,...f},c(f);let h=f.allowSymlinks?s:o;return u(l,async m=>{try{let v=await h(r.resolve(f.cwd,m));return p(f.type,v)}catch{return!1}},f)},t.exports.sync=(l,f)=>{f={cwd:process.cwd(),allowSymlinks:!0,type:"file",...f},c(f);let h=f.allowSymlinks?n.statSync:n.lstatSync;for(let m of l)try{let v=h(r.resolve(f.cwd,m));if(p(f.type,v))return m}catch{}}}),JD=U((e,t)=>{"use strict";H();var r=ae("fs"),{promisify:n}=ae("util"),i=n(r.access);t.exports=async u=>{try{return await i(u),!0}catch{return!1}},t.exports.sync=u=>{try{return r.accessSync(u),!0}catch{return!1}}}),ZD=U((e,t)=>{"use strict";H();var r=ae("path"),n=XD(),i=JD(),u=Symbol("findUp.stop");t.exports=async(s,o={})=>{let a=r.resolve(o.cwd||""),{root:c}=r.parse(a),p=[].concat(s),l=async f=>{if(typeof s!="function")return n(p,f);let h=await s(f.cwd);return typeof h=="string"?n([h],f):h};for(;;){let f=await l({...o,cwd:a});if(f===u)return;if(f)return r.resolve(a,f);if(a===c)return;a=r.dirname(a)}},t.exports.sync=(s,o={})=>{let a=r.resolve(o.cwd||""),{root:c}=r.parse(a),p=[].concat(s),l=f=>{if(typeof s!="function")return n.sync(p,f);let h=s(f.cwd);return typeof h=="string"?n.sync([h],f):h};for(;;){let f=l({...o,cwd:a});if(f===u)return;if(f)return r.resolve(a,f);if(a===c)return;a=r.dirname(a)}},t.exports.exists=i,t.exports.sync.exists=i.sync,t.exports.stop=u}),et=U(e=>{"use strict";H(),e.fromCallback=function(t){return Object.defineProperty(function(){if(typeof arguments[arguments.length-1]=="function")t.apply(this,arguments);else return new Promise((r,n)=>{arguments[arguments.length]=(i,u)=>{if(i)return n(i);r(u)},arguments.length++,t.apply(this,arguments)})},"name",{value:t.name})},e.fromPromise=function(t){return Object.defineProperty(function(){let r=arguments[arguments.length-1];if(typeof r!="function")return t.apply(this,arguments);t.apply(this,arguments).then(n=>r(null,n),r)},"name",{value:t.name})}}),zD=U((e,t)=>{H();var r=ae("constants"),n=process.cwd,i=null,u=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return i||(i=n.call(process)),i};try{process.cwd()}catch{}typeof process.chdir=="function"&&(s=process.chdir,process.chdir=function(a){i=null,s.call(process,a)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,s));var s;t.exports=o;function o(a){r.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&c(a),a.lutimes||p(a),a.chown=h(a.chown),a.fchown=h(a.fchown),a.lchown=h(a.lchown),a.chmod=l(a.chmod),a.fchmod=l(a.fchmod),a.lchmod=l(a.lchmod),a.chownSync=m(a.chownSync),a.fchownSync=m(a.fchownSync),a.lchownSync=m(a.lchownSync),a.chmodSync=f(a.chmodSync),a.fchmodSync=f(a.fchmodSync),a.lchmodSync=f(a.lchmodSync),a.stat=v(a.stat),a.fstat=v(a.fstat),a.lstat=v(a.lstat),a.statSync=_(a.statSync),a.fstatSync=_(a.fstatSync),a.lstatSync=_(a.lstatSync),a.chmod&&!a.lchmod&&(a.lchmod=function(d,y,D){D&&process.nextTick(D)},a.lchmodSync=function(){}),a.chown&&!a.lchown&&(a.lchown=function(d,y,D,g){g&&process.nextTick(g)},a.lchownSync=function(){}),u==="win32"&&(a.rename=typeof a.rename!="function"?a.rename:function(d){function y(D,g,A){var b=Date.now(),k=0;d(D,g,function x(F){if(F&&(F.code==="EACCES"||F.code==="EPERM")&&Date.now()-b<6e4){setTimeout(function(){a.stat(g,function(w,O){w&&w.code==="ENOENT"?d(D,g,x):A(F)})},k),k<100&&(k+=10);return}A&&A(F)})}return Object.setPrototypeOf&&Object.setPrototypeOf(y,d),y}(a.rename)),a.read=typeof a.read!="function"?a.read:function(d){function y(D,g,A,b,k,x){var F;if(x&&typeof x=="function"){var w=0;F=function(O,P,C){if(O&&O.code==="EAGAIN"&&w<10)return w++,d.call(a,D,g,A,b,k,F);x.apply(this,arguments)}}return d.call(a,D,g,A,b,k,F)}return Object.setPrototypeOf&&Object.setPrototypeOf(y,d),y}(a.read),a.readSync=typeof a.readSync!="function"?a.readSync:function(d){return function(y,D,g,A,b){for(var k=0;;)try{return d.call(a,y,D,g,A,b)}catch(x){if(x.code==="EAGAIN"&&k<10){k++;continue}throw x}}}(a.readSync);function c(d){d.lchmod=function(y,D,g){d.open(y,r.O_WRONLY|r.O_SYMLINK,D,function(A,b){if(A){g&&g(A);return}d.fchmod(b,D,function(k){d.close(b,function(x){g&&g(k||x)})})})},d.lchmodSync=function(y,D){var g=d.openSync(y,r.O_WRONLY|r.O_SYMLINK,D),A=!0,b;try{b=d.fchmodSync(g,D),A=!1}finally{if(A)try{d.closeSync(g)}catch{}else d.closeSync(g)}return b}}function p(d){r.hasOwnProperty("O_SYMLINK")&&d.futimes?(d.lutimes=function(y,D,g,A){d.open(y,r.O_SYMLINK,function(b,k){if(b){A&&A(b);return}d.futimes(k,D,g,function(x){d.close(k,function(F){A&&A(x||F)})})})},d.lutimesSync=function(y,D,g){var A=d.openSync(y,r.O_SYMLINK),b,k=!0;try{b=d.futimesSync(A,D,g),k=!1}finally{if(k)try{d.closeSync(A)}catch{}else d.closeSync(A)}return b}):d.futimes&&(d.lutimes=function(y,D,g,A){A&&process.nextTick(A)},d.lutimesSync=function(){})}function l(d){return d&&function(y,D,g){return d.call(a,y,D,function(A){E(A)&&(A=null),g&&g.apply(this,arguments)})}}function f(d){return d&&function(y,D){try{return d.call(a,y,D)}catch(g){if(!E(g))throw g}}}function h(d){return d&&function(y,D,g,A){return d.call(a,y,D,g,function(b){E(b)&&(b=null),A&&A.apply(this,arguments)})}}function m(d){return d&&function(y,D,g){try{return d.call(a,y,D,g)}catch(A){if(!E(A))throw A}}}function v(d){return d&&function(y,D,g){typeof D=="function"&&(g=D,D=null);function A(b,k){k&&(k.uid<0&&(k.uid+=4294967296),k.gid<0&&(k.gid+=4294967296)),g&&g.apply(this,arguments)}return D?d.call(a,y,D,A):d.call(a,y,A)}}function _(d){return d&&function(y,D){var g=D?d.call(a,y,D):d.call(a,y);return g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),g}}function E(d){if(!d||d.code==="ENOSYS")return!0;var y=!process.getuid||process.getuid()!==0;return!!(y&&(d.code==="EINVAL"||d.code==="EPERM"))}}}),ew=U((e,t)=>{H();var r=ae("stream").Stream;t.exports=n;function n(i){return{ReadStream:u,WriteStream:s};function u(o,a){if(!(this instanceof u))return new u(o,a);r.call(this);var c=this;this.path=o,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,a=a||{};for(var p=Object.keys(a),l=0,f=p.length;l<f;l++){var h=p[l];this[h]=a[h]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){c._read()});return}i.open(this.path,this.flags,this.mode,function(m,v){if(m){c.emit("error",m),c.readable=!1;return}c.fd=v,c.emit("open",v),c._read()})}function s(o,a){if(!(this instanceof s))return new s(o,a);r.call(this),this.path=o,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,a=a||{};for(var c=Object.keys(a),p=0,l=c.length;p<l;p++){var f=c[p];this[f]=a[f]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=i.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}}),tw=U((e,t)=>{"use strict";H(),t.exports=n;var r=Object.getPrototypeOf||function(i){return i.__proto__};function n(i){if(i===null||typeof i!="object")return i;if(i instanceof Object)var u={__proto__:r(i)};else var u=Object.create(null);return Object.getOwnPropertyNames(i).forEach(function(s){Object.defineProperty(u,s,Object.getOwnPropertyDescriptor(i,s))}),u}}),Oe=U((e,t)=>{H();var r=ae("fs"),n=zD(),i=ew(),u=tw(),s=ae("util"),o,a;typeof Symbol=="function"&&typeof Symbol.for=="function"?(o=Symbol.for("graceful-fs.queue"),a=Symbol.for("graceful-fs.previous")):(o="___graceful-fs.queue",a="___graceful-fs.previous");function c(){}function p(d,y){Object.defineProperty(d,o,{get:function(){return y}})}var l=c;s.debuglog?l=s.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(l=function(){var d=s.format.apply(s,arguments);d="GFS4: "+d.split(/\n/).join(`
|
80
|
+
`)))}info(...e){this.logger(...e)}mainStep(e){this.blankLine(),this.logger(`${this.step}. ${nt.default.underline(e)}`),this.step+=1}subStep(...e){this.logger(" ".repeat(wr),"-",this.dry?nt.default.yellow("SKIPPED |"):nt.default.green("OK |"),...e)}subStepFailure(...e){this.logger(" ".repeat(wr),"-",nt.default.red("ERROR |"),...e)}rootHeader(){this.blankLine(),this.indented(2,"Root:")}rootStep(...e){this.logger(" ".repeat(wr*3),"-",this.dry?nt.default.yellow("SKIPPED |"):nt.default.green("OK |"),...e)}workspaceHeader(){this.blankLine(),this.indented(2,"Workspaces:")}workspaceStep(...e){this.logger(" ".repeat(wr*3),"-",this.dry?nt.default.yellow("SKIPPED |"):nt.default.green("OK |"),...e)}blankLine(){this.logger()}error(...e){console.error(...e)}},jf={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"],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"}]};function Pd(e){let{version:t,name:r}=e;return t?jf[r].find(n=>(0,TD.satisfies)(t,n.semver)):jf[r].find(n=>n.default)}async function Ld(e){let{to:t,logger:r,options:n}=e,i=r!=null?r:new Td(n),u=Pd(t);if(!u)throw new qe("Unsupported package manager version.",{type:"package_manager-unsupported_version"});if(i.subStep(`running "${u.command} ${u.installArgs}"`),!(n!=null&&n.dry)){let s;i!=null&&i.interactive&&(s=(0,OD.default)({text:"installing dependencies...",spinner:{frames:i.installerFrames()}}).start());try{await(0,RD.default)(u.command,u.installArgs,{cwd:e.project.paths.root}),s&&s.stop(),i.subStep("dependencies installed")}catch(o){throw i.subStepFailure("failed to install dependencies"),o}}}async function LD({project:e,to:t,logger:r,options:n}){if(r.header(`Converting project from ${e.packageManager} to ${t.name}.`),e.packageManager==t.name)throw new qe("You are already using this package manager",{type:"package_manager-already_in_use"});await Rr[e.packageManager].remove({project:e,to:t,logger:r,options:n}),await Rr[t.name].create({project:e,to:t,logger:r,options:n}),r.mainStep("Installing dependencies"),n!=null&&n.skipInstall?r.subStep(FD.default.yellow("Skipping install")):(await Rr[t.name].convertLock({project:e,logger:r,options:n}),await Ld({project:e,to:t,logger:r,options:n})),r.mainStep(`Cleaning up ${e.packageManager} workspaces`),await Rr[e.packageManager].clean({project:e,logger:r})}async function ID({root:e,to:t,options:r}){let n=new Td({...r,interactive:!1}),[i,u]=await Promise.all([Od({root:e}),Jx()]);await LD({project:i,to:{name:t,version:u[t].version},logger:n,options:r})}});j();var $i=Se(require("chalk")),y0=require("commander");j();var mu=Se(require("chalk")),gu=Se(require("update-check"));var ur={name:"create-turbo",version:"1.9.2-canary.0",description:"Create a new Turborepo",homepage:"https://turbo.build/repo",license:"MPL-2.0",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/**/*.ts","check-types":"tsc --noEmit"},dependencies:{"async-retry":"^1.3.3",chalk:"2.4.2",commander:"^10.0.0","cross-spawn":"^7.0.3",execa:"5.1.1","fs-extra":"^10.1.0",got:"^11.8.5","gradient-string":"^2.0.0",inquirer:"^8.0.0",ora:"4.1.1",rimraf:"^3.0.2",semver:"^7.3.8",tar:"6.1.13","update-check":"^1.5.4"},devDependencies:{"@turbo/workspaces":"workspace:*","@types/async-retry":"^1.4.5","@types/cross-spawn":"^6.0.2","@types/fs-extra":"^9.0.13","@types/gradient-string":"^1.1.2","@types/inquirer":"^7.3.1","@types/jest":"^27.4.0","@types/node":"^16.11.12","@types/rimraf":"^3.0.2","@types/semver":"^7.3.9","@types/tar":"^6.1.4",eslint:"^7.23.0",jest:"^27.4.3","strip-ansi":"^6.0.1","ts-jest":"^27.1.1","@turbo/tsconfig":"workspace:*",tsup:"^5.10.3","@turbo/utils":"workspace:*","@turbo/test-utils":"workspace:*",typescript:"^4.5.5"},files:["dist"]};var C0=(0,gu.default)(ur).catch(()=>null);async function vn(){try{let e=await C0;e!=null&&e.latest&&(console.log(),console.log(mu.default.yellow.bold("A new version of `create-turbo` is available!")),console.log()),process.exit()}catch{}}j();var En=Se(require("chalk")),yu=Se(require("ora")),vu=Se(require("gradient-string")),_u="#0099F7",Eu="#F11712",k0="#FFFF00",cr=(0,vu.default)(_u,Eu),_n=En.default.hex(_u),F0=En.default.hex(Eu),R0=En.default.hex(k0),Sn=e=>(0,yu.default)({text:e,spinner:{frames:[" ",_n("> "),_n(">> "),_n(">>>")]}}),Hi=(...e)=>{console.log(_n.bold(">>>"),...e)},Pe=(...e)=>{console.error(F0.bold(">>>"),...e)},An=(...e)=>{console.error(R0.bold(">>>"),...e)};j();j();var yn=Se(require("path")),Ue=Se(require("chalk")),qt=Se(Fa());j();j();j();j();j();var ND=Object.create,Nd=Object.defineProperty,BD=Object.getOwnPropertyDescriptor,MD=Object.getOwnPropertyNames,jD=Object.getPrototypeOf,$D=Object.prototype.hasOwnProperty,ae=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),HD=(e,t)=>()=>(e&&(t=e(e=0)),t),U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),GD=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of MD(t))!$D.call(e,i)&&i!==r&&Nd(e,i,{get:()=>t[i],enumerable:!(n=BD(t,i))||n.enumerable});return e},jt=(e,t,r)=>(r=e!=null?ND(jD(e)):{},GD(t||!e||!e.__esModule?Nd(r,"default",{value:e,enumerable:!0}):r,e)),H=HD(()=>{});H();var UD=U((e,t)=>{H();function r(n){return t.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},t.exports.__esModule=!0,t.exports.default=t.exports,r(n)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),WD=U((e,t)=>{H();var r=UD().default;function n(){"use strict";t.exports=n=function(){return i},t.exports.__esModule=!0,t.exports.default=t.exports;var i={},u=Object.prototype,s=u.hasOwnProperty,o=typeof Symbol=="function"?Symbol:{},a=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",p=o.toStringTag||"@@toStringTag";function l(C,S,R){return Object.defineProperty(C,S,{value:R,enumerable:!0,configurable:!0,writable:!0}),C[S]}try{l({},"")}catch{l=function(C,S,R){return C[S]=R}}function f(C,S,R,L){var M=S&&S.prototype instanceof v?S:v,B=Object.create(M.prototype),Q=new w(L||[]);return B._invoke=function(Z,oe,N){var le="suspendedStart";return function(pe,ne){if(le==="executing")throw new Error("Generator is already running");if(le==="completed"){if(pe==="throw")throw ne;return P()}for(N.method=pe,N.arg=ne;;){var T=N.delegate;if(T){var I=k(T,N);if(I){if(I===m)continue;return I}}if(N.method==="next")N.sent=N._sent=N.arg;else if(N.method==="throw"){if(le==="suspendedStart")throw le="completed",N.arg;N.dispatchException(N.arg)}else N.method==="return"&&N.abrupt("return",N.arg);le="executing";var $=h(Z,oe,N);if($.type==="normal"){if(le=N.done?"completed":"suspendedYield",$.arg===m)continue;return{value:$.arg,done:N.done}}$.type==="throw"&&(le="completed",N.method="throw",N.arg=$.arg)}}}(C,R,Q),B}function h(C,S,R){try{return{type:"normal",arg:C.call(S,R)}}catch(L){return{type:"throw",arg:L}}}i.wrap=f;var m={};function v(){}function _(){}function E(){}var d={};l(d,a,function(){return this});var y=Object.getPrototypeOf,D=y&&y(y(O([])));D&&D!==u&&s.call(D,a)&&(d=D);var g=E.prototype=v.prototype=Object.create(d);function A(C){["next","throw","return"].forEach(function(S){l(C,S,function(R){return this._invoke(S,R)})})}function b(C,S){function R(M,B,Q,Z){var oe=h(C[M],C,B);if(oe.type!=="throw"){var N=oe.arg,le=N.value;return le&&r(le)=="object"&&s.call(le,"__await")?S.resolve(le.__await).then(function(pe){R("next",pe,Q,Z)},function(pe){R("throw",pe,Q,Z)}):S.resolve(le).then(function(pe){N.value=pe,Q(N)},function(pe){return R("throw",pe,Q,Z)})}Z(oe.arg)}var L;this._invoke=function(M,B){function Q(){return new S(function(Z,oe){R(M,B,Z,oe)})}return L=L?L.then(Q,Q):Q()}}function k(C,S){var R=C.iterator[S.method];if(R===void 0){if(S.delegate=null,S.method==="throw"){if(C.iterator.return&&(S.method="return",S.arg=void 0,k(C,S),S.method==="throw"))return m;S.method="throw",S.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var L=h(R,C.iterator,S.arg);if(L.type==="throw")return S.method="throw",S.arg=L.arg,S.delegate=null,m;var M=L.arg;return M?M.done?(S[C.resultName]=M.value,S.next=C.nextLoc,S.method!=="return"&&(S.method="next",S.arg=void 0),S.delegate=null,m):M:(S.method="throw",S.arg=new TypeError("iterator result is not an object"),S.delegate=null,m)}function x(C){var S={tryLoc:C[0]};1 in C&&(S.catchLoc=C[1]),2 in C&&(S.finallyLoc=C[2],S.afterLoc=C[3]),this.tryEntries.push(S)}function F(C){var S=C.completion||{};S.type="normal",delete S.arg,C.completion=S}function w(C){this.tryEntries=[{tryLoc:"root"}],C.forEach(x,this),this.reset(!0)}function O(C){if(C){var S=C[a];if(S)return S.call(C);if(typeof C.next=="function")return C;if(!isNaN(C.length)){var R=-1,L=function M(){for(;++R<C.length;)if(s.call(C,R))return M.value=C[R],M.done=!1,M;return M.value=void 0,M.done=!0,M};return L.next=L}}return{next:P}}function P(){return{value:void 0,done:!0}}return _.prototype=E,l(g,"constructor",E),l(E,"constructor",_),_.displayName=l(E,p,"GeneratorFunction"),i.isGeneratorFunction=function(C){var S=typeof C=="function"&&C.constructor;return!!S&&(S===_||(S.displayName||S.name)==="GeneratorFunction")},i.mark=function(C){return Object.setPrototypeOf?Object.setPrototypeOf(C,E):(C.__proto__=E,l(C,p,"GeneratorFunction")),C.prototype=Object.create(g),C},i.awrap=function(C){return{__await:C}},A(b.prototype),l(b.prototype,c,function(){return this}),i.AsyncIterator=b,i.async=function(C,S,R,L,M){M===void 0&&(M=Promise);var B=new b(f(C,S,R,L),M);return i.isGeneratorFunction(S)?B:B.next().then(function(Q){return Q.done?Q.value:B.next()})},A(g),l(g,p,"Generator"),l(g,a,function(){return this}),l(g,"toString",function(){return"[object Generator]"}),i.keys=function(C){var S=[];for(var R in C)S.push(R);return S.reverse(),function L(){for(;S.length;){var M=S.pop();if(M in C)return L.value=M,L.done=!1,L}return L.done=!0,L}},i.values=O,w.prototype={constructor:w,reset:function(C){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(F),!C)for(var S in this)S.charAt(0)==="t"&&s.call(this,S)&&!isNaN(+S.slice(1))&&(this[S]=void 0)},stop:function(){this.done=!0;var C=this.tryEntries[0].completion;if(C.type==="throw")throw C.arg;return this.rval},dispatchException:function(C){if(this.done)throw C;var S=this;function R(oe,N){return B.type="throw",B.arg=C,S.next=oe,N&&(S.method="next",S.arg=void 0),!!N}for(var L=this.tryEntries.length-1;L>=0;--L){var M=this.tryEntries[L],B=M.completion;if(M.tryLoc==="root")return R("end");if(M.tryLoc<=this.prev){var Q=s.call(M,"catchLoc"),Z=s.call(M,"finallyLoc");if(Q&&Z){if(this.prev<M.catchLoc)return R(M.catchLoc,!0);if(this.prev<M.finallyLoc)return R(M.finallyLoc)}else if(Q){if(this.prev<M.catchLoc)return R(M.catchLoc,!0)}else{if(!Z)throw new Error("try statement without catch or finally");if(this.prev<M.finallyLoc)return R(M.finallyLoc)}}}},abrupt:function(C,S){for(var R=this.tryEntries.length-1;R>=0;--R){var L=this.tryEntries[R];if(L.tryLoc<=this.prev&&s.call(L,"finallyLoc")&&this.prev<L.finallyLoc){var M=L;break}}M&&(C==="break"||C==="continue")&&M.tryLoc<=S&&S<=M.finallyLoc&&(M=null);var B=M?M.completion:{};return B.type=C,B.arg=S,M?(this.method="next",this.next=M.finallyLoc,m):this.complete(B)},complete:function(C,S){if(C.type==="throw")throw C.arg;return C.type==="break"||C.type==="continue"?this.next=C.arg:C.type==="return"?(this.rval=this.arg=C.arg,this.method="return",this.next="end"):C.type==="normal"&&S&&(this.next=S),m},finish:function(C){for(var S=this.tryEntries.length-1;S>=0;--S){var R=this.tryEntries[S];if(R.finallyLoc===C)return this.complete(R.completion,R.afterLoc),F(R),m}},catch:function(C){for(var S=this.tryEntries.length-1;S>=0;--S){var R=this.tryEntries[S];if(R.tryLoc===C){var L=R.completion;if(L.type==="throw"){var M=L.arg;F(R)}return M}}throw new Error("illegal catch attempt")},delegateYield:function(C,S,R){return this.delegate={iterator:O(C),resultName:S,nextLoc:R},this.method==="next"&&(this.arg=void 0),m}},i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}),YD=U((e,t)=>{H();var r=WD()();t.exports=r;try{regeneratorRuntime=r}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),KD=U((e,t)=>{"use strict";H();var r=(n,...i)=>new Promise(u=>{u(n(...i))});t.exports=r,t.exports.default=r}),VD=U((e,t)=>{"use strict";H();var r=KD(),n=i=>{if(!((Number.isInteger(i)||i===1/0)&&i>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let u=[],s=0,o=()=>{s--,u.length>0&&u.shift()()},a=(l,f,...h)=>{s++;let m=r(l,...h);f(m),m.then(o,o)},c=(l,f,...h)=>{s<i?a(l,f,...h):u.push(a.bind(null,l,f,...h))},p=(l,...f)=>new Promise(h=>c(l,h,...f));return Object.defineProperties(p,{activeCount:{get:()=>s},pendingCount:{get:()=>u.length},clearQueue:{value:()=>{u.length=0}}}),p};t.exports=n,t.exports.default=n}),QD=U((e,t)=>{"use strict";H();var r=VD(),n=class extends Error{constructor(o){super(),this.value=o}},i=async(o,a)=>a(await o),u=async o=>{let a=await Promise.all(o);if(a[1]===!0)throw new n(a[0]);return!1},s=async(o,a,c)=>{c={concurrency:1/0,preserveOrder:!0,...c};let p=r(c.concurrency),l=[...o].map(h=>[h,p(i,h,a)]),f=r(c.preserveOrder?1:1/0);try{await Promise.all(l.map(h=>f(u,h)))}catch(h){if(h instanceof n)return h.value;throw h}};t.exports=s,t.exports.default=s}),XD=U((e,t)=>{"use strict";H();var r=ae("path"),n=ae("fs"),{promisify:i}=ae("util"),u=QD(),s=i(n.stat),o=i(n.lstat),a={directory:"isDirectory",file:"isFile"};function c({type:l}){if(!(l in a))throw new Error(`Invalid type specified: ${l}`)}var p=(l,f)=>l===void 0||f[a[l]]();t.exports=async(l,f)=>{f={cwd:process.cwd(),type:"file",allowSymlinks:!0,...f},c(f);let h=f.allowSymlinks?s:o;return u(l,async m=>{try{let v=await h(r.resolve(f.cwd,m));return p(f.type,v)}catch{return!1}},f)},t.exports.sync=(l,f)=>{f={cwd:process.cwd(),allowSymlinks:!0,type:"file",...f},c(f);let h=f.allowSymlinks?n.statSync:n.lstatSync;for(let m of l)try{let v=h(r.resolve(f.cwd,m));if(p(f.type,v))return m}catch{}}}),JD=U((e,t)=>{"use strict";H();var r=ae("fs"),{promisify:n}=ae("util"),i=n(r.access);t.exports=async u=>{try{return await i(u),!0}catch{return!1}},t.exports.sync=u=>{try{return r.accessSync(u),!0}catch{return!1}}}),ZD=U((e,t)=>{"use strict";H();var r=ae("path"),n=XD(),i=JD(),u=Symbol("findUp.stop");t.exports=async(s,o={})=>{let a=r.resolve(o.cwd||""),{root:c}=r.parse(a),p=[].concat(s),l=async f=>{if(typeof s!="function")return n(p,f);let h=await s(f.cwd);return typeof h=="string"?n([h],f):h};for(;;){let f=await l({...o,cwd:a});if(f===u)return;if(f)return r.resolve(a,f);if(a===c)return;a=r.dirname(a)}},t.exports.sync=(s,o={})=>{let a=r.resolve(o.cwd||""),{root:c}=r.parse(a),p=[].concat(s),l=f=>{if(typeof s!="function")return n.sync(p,f);let h=s(f.cwd);return typeof h=="string"?n.sync([h],f):h};for(;;){let f=l({...o,cwd:a});if(f===u)return;if(f)return r.resolve(a,f);if(a===c)return;a=r.dirname(a)}},t.exports.exists=i,t.exports.sync.exists=i.sync,t.exports.stop=u}),et=U(e=>{"use strict";H(),e.fromCallback=function(t){return Object.defineProperty(function(){if(typeof arguments[arguments.length-1]=="function")t.apply(this,arguments);else return new Promise((r,n)=>{arguments[arguments.length]=(i,u)=>{if(i)return n(i);r(u)},arguments.length++,t.apply(this,arguments)})},"name",{value:t.name})},e.fromPromise=function(t){return Object.defineProperty(function(){let r=arguments[arguments.length-1];if(typeof r!="function")return t.apply(this,arguments);t.apply(this,arguments).then(n=>r(null,n),r)},"name",{value:t.name})}}),zD=U((e,t)=>{H();var r=ae("constants"),n=process.cwd,i=null,u=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return i||(i=n.call(process)),i};try{process.cwd()}catch{}typeof process.chdir=="function"&&(s=process.chdir,process.chdir=function(a){i=null,s.call(process,a)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,s));var s;t.exports=o;function o(a){r.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&c(a),a.lutimes||p(a),a.chown=h(a.chown),a.fchown=h(a.fchown),a.lchown=h(a.lchown),a.chmod=l(a.chmod),a.fchmod=l(a.fchmod),a.lchmod=l(a.lchmod),a.chownSync=m(a.chownSync),a.fchownSync=m(a.fchownSync),a.lchownSync=m(a.lchownSync),a.chmodSync=f(a.chmodSync),a.fchmodSync=f(a.fchmodSync),a.lchmodSync=f(a.lchmodSync),a.stat=v(a.stat),a.fstat=v(a.fstat),a.lstat=v(a.lstat),a.statSync=_(a.statSync),a.fstatSync=_(a.fstatSync),a.lstatSync=_(a.lstatSync),a.chmod&&!a.lchmod&&(a.lchmod=function(d,y,D){D&&process.nextTick(D)},a.lchmodSync=function(){}),a.chown&&!a.lchown&&(a.lchown=function(d,y,D,g){g&&process.nextTick(g)},a.lchownSync=function(){}),u==="win32"&&(a.rename=typeof a.rename!="function"?a.rename:function(d){function y(D,g,A){var b=Date.now(),k=0;d(D,g,function x(F){if(F&&(F.code==="EACCES"||F.code==="EPERM")&&Date.now()-b<6e4){setTimeout(function(){a.stat(g,function(w,O){w&&w.code==="ENOENT"?d(D,g,x):A(F)})},k),k<100&&(k+=10);return}A&&A(F)})}return Object.setPrototypeOf&&Object.setPrototypeOf(y,d),y}(a.rename)),a.read=typeof a.read!="function"?a.read:function(d){function y(D,g,A,b,k,x){var F;if(x&&typeof x=="function"){var w=0;F=function(O,P,C){if(O&&O.code==="EAGAIN"&&w<10)return w++,d.call(a,D,g,A,b,k,F);x.apply(this,arguments)}}return d.call(a,D,g,A,b,k,F)}return Object.setPrototypeOf&&Object.setPrototypeOf(y,d),y}(a.read),a.readSync=typeof a.readSync!="function"?a.readSync:function(d){return function(y,D,g,A,b){for(var k=0;;)try{return d.call(a,y,D,g,A,b)}catch(x){if(x.code==="EAGAIN"&&k<10){k++;continue}throw x}}}(a.readSync);function c(d){d.lchmod=function(y,D,g){d.open(y,r.O_WRONLY|r.O_SYMLINK,D,function(A,b){if(A){g&&g(A);return}d.fchmod(b,D,function(k){d.close(b,function(x){g&&g(k||x)})})})},d.lchmodSync=function(y,D){var g=d.openSync(y,r.O_WRONLY|r.O_SYMLINK,D),A=!0,b;try{b=d.fchmodSync(g,D),A=!1}finally{if(A)try{d.closeSync(g)}catch{}else d.closeSync(g)}return b}}function p(d){r.hasOwnProperty("O_SYMLINK")&&d.futimes?(d.lutimes=function(y,D,g,A){d.open(y,r.O_SYMLINK,function(b,k){if(b){A&&A(b);return}d.futimes(k,D,g,function(x){d.close(k,function(F){A&&A(x||F)})})})},d.lutimesSync=function(y,D,g){var A=d.openSync(y,r.O_SYMLINK),b,k=!0;try{b=d.futimesSync(A,D,g),k=!1}finally{if(k)try{d.closeSync(A)}catch{}else d.closeSync(A)}return b}):d.futimes&&(d.lutimes=function(y,D,g,A){A&&process.nextTick(A)},d.lutimesSync=function(){})}function l(d){return d&&function(y,D,g){return d.call(a,y,D,function(A){E(A)&&(A=null),g&&g.apply(this,arguments)})}}function f(d){return d&&function(y,D){try{return d.call(a,y,D)}catch(g){if(!E(g))throw g}}}function h(d){return d&&function(y,D,g,A){return d.call(a,y,D,g,function(b){E(b)&&(b=null),A&&A.apply(this,arguments)})}}function m(d){return d&&function(y,D,g){try{return d.call(a,y,D,g)}catch(A){if(!E(A))throw A}}}function v(d){return d&&function(y,D,g){typeof D=="function"&&(g=D,D=null);function A(b,k){k&&(k.uid<0&&(k.uid+=4294967296),k.gid<0&&(k.gid+=4294967296)),g&&g.apply(this,arguments)}return D?d.call(a,y,D,A):d.call(a,y,A)}}function _(d){return d&&function(y,D){var g=D?d.call(a,y,D):d.call(a,y);return g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),g}}function E(d){if(!d||d.code==="ENOSYS")return!0;var y=!process.getuid||process.getuid()!==0;return!!(y&&(d.code==="EINVAL"||d.code==="EPERM"))}}}),ew=U((e,t)=>{H();var r=ae("stream").Stream;t.exports=n;function n(i){return{ReadStream:u,WriteStream:s};function u(o,a){if(!(this instanceof u))return new u(o,a);r.call(this);var c=this;this.path=o,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,a=a||{};for(var p=Object.keys(a),l=0,f=p.length;l<f;l++){var h=p[l];this[h]=a[h]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){c._read()});return}i.open(this.path,this.flags,this.mode,function(m,v){if(m){c.emit("error",m),c.readable=!1;return}c.fd=v,c.emit("open",v),c._read()})}function s(o,a){if(!(this instanceof s))return new s(o,a);r.call(this),this.path=o,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,a=a||{};for(var c=Object.keys(a),p=0,l=c.length;p<l;p++){var f=c[p];this[f]=a[f]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=i.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}}),tw=U((e,t)=>{"use strict";H(),t.exports=n;var r=Object.getPrototypeOf||function(i){return i.__proto__};function n(i){if(i===null||typeof i!="object")return i;if(i instanceof Object)var u={__proto__:r(i)};else var u=Object.create(null);return Object.getOwnPropertyNames(i).forEach(function(s){Object.defineProperty(u,s,Object.getOwnPropertyDescriptor(i,s))}),u}}),Oe=U((e,t)=>{H();var r=ae("fs"),n=zD(),i=ew(),u=tw(),s=ae("util"),o,a;typeof Symbol=="function"&&typeof Symbol.for=="function"?(o=Symbol.for("graceful-fs.queue"),a=Symbol.for("graceful-fs.previous")):(o="___graceful-fs.queue",a="___graceful-fs.previous");function c(){}function p(d,y){Object.defineProperty(d,o,{get:function(){return y}})}var l=c;s.debuglog?l=s.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(l=function(){var d=s.format.apply(s,arguments);d="GFS4: "+d.split(/\n/).join(`
|
81
81
|
GFS4: `),console.error(d)}),r[o]||(f=global[o]||[],p(r,f),r.close=function(d){function y(D,g){return d.call(r,D,function(A){A||_(),typeof g=="function"&&g.apply(this,arguments)})}return Object.defineProperty(y,a,{value:d}),y}(r.close),r.closeSync=function(d){function y(D){d.apply(r,arguments),_()}return Object.defineProperty(y,a,{value:d}),y}(r.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){l(r[o]),ae("assert").equal(r[o].length,0)}));var f;global[o]||p(global,r[o]),t.exports=h(u(r)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!r.__patched&&(t.exports=h(r),r.__patched=!0);function h(d){n(d),d.gracefulify=h,d.createReadStream=N,d.createWriteStream=le;var y=d.readFile;d.readFile=D;function D(T,I,$){return typeof I=="function"&&($=I,I=null),Y(T,I,$);function Y(K,z,J,ee){return y(K,z,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?m([Y,[K,z,J],ie,ee||Date.now(),Date.now()]):typeof J=="function"&&J.apply(this,arguments)})}}var g=d.writeFile;d.writeFile=A;function A(T,I,$,Y){return typeof $=="function"&&(Y=$,$=null),K(T,I,$,Y);function K(z,J,ee,ie,ge){return g(z,J,ee,function(se){se&&(se.code==="EMFILE"||se.code==="ENFILE")?m([K,[z,J,ee,ie],se,ge||Date.now(),Date.now()]):typeof ie=="function"&&ie.apply(this,arguments)})}}var b=d.appendFile;b&&(d.appendFile=k);function k(T,I,$,Y){return typeof $=="function"&&(Y=$,$=null),K(T,I,$,Y);function K(z,J,ee,ie,ge){return b(z,J,ee,function(se){se&&(se.code==="EMFILE"||se.code==="ENFILE")?m([K,[z,J,ee,ie],se,ge||Date.now(),Date.now()]):typeof ie=="function"&&ie.apply(this,arguments)})}}var x=d.copyFile;x&&(d.copyFile=F);function F(T,I,$,Y){return typeof $=="function"&&(Y=$,$=0),K(T,I,$,Y);function K(z,J,ee,ie,ge){return x(z,J,ee,function(se){se&&(se.code==="EMFILE"||se.code==="ENFILE")?m([K,[z,J,ee,ie],se,ge||Date.now(),Date.now()]):typeof ie=="function"&&ie.apply(this,arguments)})}}var w=d.readdir;d.readdir=P;var O=/^v[0-5]\./;function P(T,I,$){typeof I=="function"&&($=I,I=null);var Y=O.test(process.version)?function(z,J,ee,ie){return w(z,K(z,J,ee,ie))}:function(z,J,ee,ie){return w(z,J,K(z,J,ee,ie))};return Y(T,I,$);function K(z,J,ee,ie){return function(ge,se){ge&&(ge.code==="EMFILE"||ge.code==="ENFILE")?m([Y,[z,J,ee],ge,ie||Date.now(),Date.now()]):(se&&se.sort&&se.sort(),typeof ee=="function"&&ee.call(this,ge,se))}}}if(process.version.substr(0,4)==="v0.8"){var C=i(d);B=C.ReadStream,Z=C.WriteStream}var S=d.ReadStream;S&&(B.prototype=Object.create(S.prototype),B.prototype.open=Q);var R=d.WriteStream;R&&(Z.prototype=Object.create(R.prototype),Z.prototype.open=oe),Object.defineProperty(d,"ReadStream",{get:function(){return B},set:function(T){B=T},enumerable:!0,configurable:!0}),Object.defineProperty(d,"WriteStream",{get:function(){return Z},set:function(T){Z=T},enumerable:!0,configurable:!0});var L=B;Object.defineProperty(d,"FileReadStream",{get:function(){return L},set:function(T){L=T},enumerable:!0,configurable:!0});var M=Z;Object.defineProperty(d,"FileWriteStream",{get:function(){return M},set:function(T){M=T},enumerable:!0,configurable:!0});function B(T,I){return this instanceof B?(S.apply(this,arguments),this):B.apply(Object.create(B.prototype),arguments)}function Q(){var T=this;ne(T.path,T.flags,T.mode,function(I,$){I?(T.autoClose&&T.destroy(),T.emit("error",I)):(T.fd=$,T.emit("open",$),T.read())})}function Z(T,I){return this instanceof Z?(R.apply(this,arguments),this):Z.apply(Object.create(Z.prototype),arguments)}function oe(){var T=this;ne(T.path,T.flags,T.mode,function(I,$){I?(T.destroy(),T.emit("error",I)):(T.fd=$,T.emit("open",$))})}function N(T,I){return new d.ReadStream(T,I)}function le(T,I){return new d.WriteStream(T,I)}var pe=d.open;d.open=ne;function ne(T,I,$,Y){return typeof $=="function"&&(Y=$,$=null),K(T,I,$,Y);function K(z,J,ee,ie,ge){return pe(z,J,ee,function(se,re){se&&(se.code==="EMFILE"||se.code==="ENFILE")?m([K,[z,J,ee,ie],se,ge||Date.now(),Date.now()]):typeof ie=="function"&&ie.apply(this,arguments)})}}return d}function m(d){l("ENQUEUE",d[0].name,d[1]),r[o].push(d),E()}var v;function _(){for(var d=Date.now(),y=0;y<r[o].length;++y)r[o][y].length>2&&(r[o][y][3]=d,r[o][y][4]=d);E()}function E(){if(clearTimeout(v),v=void 0,r[o].length!==0){var d=r[o].shift(),y=d[0],D=d[1],g=d[2],A=d[3],b=d[4];if(A===void 0)l("RETRY",y.name,D),y.apply(null,D);else if(Date.now()-A>=6e4){l("TIMEOUT",y.name,D);var k=D.pop();typeof k=="function"&&k.call(null,g)}else{var x=Date.now()-b,F=Math.max(b-A,1),w=Math.min(F*1.2,100);x>=w?(l("RETRY",y.name,D),y.apply(null,D.concat([A]))):r[o].push(d)}v===void 0&&(v=setTimeout(E,0))}}}),Bd=U(e=>{"use strict";H();var t=et().fromCallback,r=Oe(),n=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(i=>typeof r[i]=="function");Object.keys(r).forEach(i=>{i!=="promises"&&(e[i]=r[i])}),n.forEach(i=>{e[i]=t(r[i])}),e.exists=function(i,u){return typeof u=="function"?r.exists(i,u):new Promise(s=>r.exists(i,s))},e.read=function(i,u,s,o,a,c){return typeof c=="function"?r.read(i,u,s,o,a,c):new Promise((p,l)=>{r.read(i,u,s,o,a,(f,h,m)=>{if(f)return l(f);p({bytesRead:h,buffer:m})})})},e.write=function(i,u,...s){return typeof s[s.length-1]=="function"?r.write(i,u,...s):new Promise((o,a)=>{r.write(i,u,...s,(c,p,l)=>{if(c)return a(c);o({bytesWritten:p,buffer:l})})})},typeof r.realpath.native=="function"&&(e.realpath.native=t(r.realpath.native))}),Md=U((e,t)=>{"use strict";H();var r=ae("path");function n(s){return s=r.normalize(r.resolve(s)).split(r.sep),s.length>0?s[0]:null}var i=/[<>:"|?*]/;function u(s){let o=n(s);return s=s.replace(o,""),i.test(s)}t.exports={getRootPath:n,invalidWin32Path:u}}),rw=U((e,t)=>{"use strict";H();var r=Oe(),n=ae("path"),i=Md().invalidWin32Path,u=parseInt("0777",8);function s(o,a,c,p){if(typeof a=="function"?(c=a,a={}):(!a||typeof a!="object")&&(a={mode:a}),process.platform==="win32"&&i(o)){let h=new Error(o+" contains invalid WIN32 path characters.");return h.code="EINVAL",c(h)}let l=a.mode,f=a.fs||r;l===void 0&&(l=u&~process.umask()),p||(p=null),c=c||function(){},o=n.resolve(o),f.mkdir(o,l,h=>{if(!h)return p=p||o,c(null,p);switch(h.code){case"ENOENT":if(n.dirname(o)===o)return c(h);s(n.dirname(o),a,(m,v)=>{m?c(m,v):s(o,a,c,v)});break;default:f.stat(o,(m,v)=>{m||!v.isDirectory()?c(h,p):c(null,p)});break}})}t.exports=s}),nw=U((e,t)=>{"use strict";H();var r=Oe(),n=ae("path"),i=Md().invalidWin32Path,u=parseInt("0777",8);function s(o,a,c){(!a||typeof a!="object")&&(a={mode:a});let p=a.mode,l=a.fs||r;if(process.platform==="win32"&&i(o)){let f=new Error(o+" contains invalid WIN32 path characters.");throw f.code="EINVAL",f}p===void 0&&(p=u&~process.umask()),c||(c=null),o=n.resolve(o);try{l.mkdirSync(o,p),c=c||o}catch(f){if(f.code==="ENOENT"){if(n.dirname(o)===o)throw f;c=s(n.dirname(o),a,c),s(o,a,c)}else{let h;try{h=l.statSync(o)}catch{throw f}if(!h.isDirectory())throw f}}return c}t.exports=s}),ot=U((e,t)=>{"use strict";H();var r=et().fromCallback,n=r(rw()),i=nw();t.exports={mkdirs:n,mkdirsSync:i,mkdirp:n,mkdirpSync:i,ensureDir:n,ensureDirSync:i}}),jd=U((e,t)=>{"use strict";H();var r=Oe(),n=ae("os"),i=ae("path");function u(){let p=i.join("millis-test-sync"+Date.now().toString()+Math.random().toString().slice(2));p=i.join(n.tmpdir(),p);let l=new Date(1435410243862);r.writeFileSync(p,"https://github.com/jprichardson/node-fs-extra/pull/141");let f=r.openSync(p,"r+");return r.futimesSync(f,l,l),r.closeSync(f),r.statSync(p).mtime>1435410243e3}function s(p){let l=i.join("millis-test"+Date.now().toString()+Math.random().toString().slice(2));l=i.join(n.tmpdir(),l);let f=new Date(1435410243862);r.writeFile(l,"https://github.com/jprichardson/node-fs-extra/pull/141",h=>{if(h)return p(h);r.open(l,"r+",(m,v)=>{if(m)return p(m);r.futimes(v,f,f,_=>{if(_)return p(_);r.close(v,E=>{if(E)return p(E);r.stat(l,(d,y)=>{if(d)return p(d);p(null,y.mtime>1435410243e3)})})})})})}function o(p){if(typeof p=="number")return Math.floor(p/1e3)*1e3;if(p instanceof Date)return new Date(Math.floor(p.getTime()/1e3)*1e3);throw new Error("fs-extra: timeRemoveMillis() unknown parameter type")}function a(p,l,f,h){r.open(p,"r+",(m,v)=>{if(m)return h(m);r.futimes(v,l,f,_=>{r.close(v,E=>{h&&h(_||E)})})})}function c(p,l,f){let h=r.openSync(p,"r+");return r.futimesSync(h,l,f),r.closeSync(h)}t.exports={hasMillisRes:s,hasMillisResSync:u,timeRemoveMillis:o,utimesMillis:a,utimesMillisSync:c}}),xi=U((e,t)=>{"use strict";H();var r=Oe(),n=ae("path"),i=10,u=5,s=0,o=process.versions.node.split("."),a=Number.parseInt(o[0],10),c=Number.parseInt(o[1],10),p=Number.parseInt(o[2],10);function l(){return a>i||a===i&&(c>u||c===u&&p>=s)}function f(D,g,A){l()?r.stat(D,{bigint:!0},(b,k)=>{if(b)return A(b);r.stat(g,{bigint:!0},(x,F)=>x?x.code==="ENOENT"?A(null,{srcStat:k,destStat:null}):A(x):A(null,{srcStat:k,destStat:F}))}):r.stat(D,(b,k)=>{if(b)return A(b);r.stat(g,(x,F)=>x?x.code==="ENOENT"?A(null,{srcStat:k,destStat:null}):A(x):A(null,{srcStat:k,destStat:F}))})}function h(D,g){let A,b;l()?A=r.statSync(D,{bigint:!0}):A=r.statSync(D);try{l()?b=r.statSync(g,{bigint:!0}):b=r.statSync(g)}catch(k){if(k.code==="ENOENT")return{srcStat:A,destStat:null};throw k}return{srcStat:A,destStat:b}}function m(D,g,A,b){f(D,g,(k,x)=>{if(k)return b(k);let{srcStat:F,destStat:w}=x;return w&&w.ino&&w.dev&&w.ino===F.ino&&w.dev===F.dev?b(new Error("Source and destination must not be the same.")):F.isDirectory()&&d(D,g)?b(new Error(y(D,g,A))):b(null,{srcStat:F,destStat:w})})}function v(D,g,A){let{srcStat:b,destStat:k}=h(D,g);if(k&&k.ino&&k.dev&&k.ino===b.ino&&k.dev===b.dev)throw new Error("Source and destination must not be the same.");if(b.isDirectory()&&d(D,g))throw new Error(y(D,g,A));return{srcStat:b,destStat:k}}function _(D,g,A,b,k){let x=n.resolve(n.dirname(D)),F=n.resolve(n.dirname(A));if(F===x||F===n.parse(F).root)return k();l()?r.stat(F,{bigint:!0},(w,O)=>w?w.code==="ENOENT"?k():k(w):O.ino&&O.dev&&O.ino===g.ino&&O.dev===g.dev?k(new Error(y(D,A,b))):_(D,g,F,b,k)):r.stat(F,(w,O)=>w?w.code==="ENOENT"?k():k(w):O.ino&&O.dev&&O.ino===g.ino&&O.dev===g.dev?k(new Error(y(D,A,b))):_(D,g,F,b,k))}function E(D,g,A,b){let k=n.resolve(n.dirname(D)),x=n.resolve(n.dirname(A));if(x===k||x===n.parse(x).root)return;let F;try{l()?F=r.statSync(x,{bigint:!0}):F=r.statSync(x)}catch(w){if(w.code==="ENOENT")return;throw w}if(F.ino&&F.dev&&F.ino===g.ino&&F.dev===g.dev)throw new Error(y(D,A,b));return E(D,g,x,b)}function d(D,g){let A=n.resolve(D).split(n.sep).filter(k=>k),b=n.resolve(g).split(n.sep).filter(k=>k);return A.reduce((k,x,F)=>k&&b[F]===x,!0)}function y(D,g,A){return`Cannot ${A} '${D}' to a subdirectory of itself, '${g}'.`}t.exports={checkPaths:m,checkPathsSync:v,checkParentPaths:_,checkParentPathsSync:E,isSrcSubdir:d}}),iw=U((e,t)=>{"use strict";H(),t.exports=function(r){if(typeof Buffer.allocUnsafe=="function")try{return Buffer.allocUnsafe(r)}catch{return new Buffer(r)}return new Buffer(r)}}),ow=U((e,t)=>{"use strict";H();var r=Oe(),n=ae("path"),i=ot().mkdirsSync,u=jd().utimesMillisSync,s=xi();function o(g,A,b){typeof b=="function"&&(b={filter:b}),b=b||{},b.clobber="clobber"in b?!!b.clobber:!0,b.overwrite="overwrite"in b?!!b.overwrite:b.clobber,b.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
|
82
82
|
|
83
83
|
see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:k,destStat:x}=s.checkPathsSync(g,A,"copy");return s.checkParentPathsSync(g,k,A,"copy"),a(x,g,A,b)}function a(g,A,b,k){if(k.filter&&!k.filter(A,b))return;let x=n.dirname(b);return r.existsSync(x)||i(x),c(g,A,b,k)}function c(g,A,b,k){if(!(k.filter&&!k.filter(A,b)))return p(g,A,b,k)}function p(g,A,b,k){let x=(k.dereference?r.statSync:r.lstatSync)(A);if(x.isDirectory())return v(x,g,A,b,k);if(x.isFile()||x.isCharacterDevice()||x.isBlockDevice())return l(x,g,A,b,k);if(x.isSymbolicLink())return y(g,A,b,k)}function l(g,A,b,k,x){return A?f(g,b,k,x):h(g,b,k,x)}function f(g,A,b,k){if(k.overwrite)return r.unlinkSync(b),h(g,A,b,k);if(k.errorOnExist)throw new Error(`'${b}' already exists`)}function h(g,A,b,k){return typeof r.copyFileSync=="function"?(r.copyFileSync(A,b),r.chmodSync(b,g.mode),k.preserveTimestamps?u(b,g.atime,g.mtime):void 0):m(g,A,b,k)}function m(g,A,b,k){let x=iw()(65536),F=r.openSync(A,"r"),w=r.openSync(b,"w",g.mode),O=0;for(;O<g.size;){let P=r.readSync(F,x,0,65536,O);r.writeSync(w,x,0,P),O+=P}k.preserveTimestamps&&r.futimesSync(w,g.atime,g.mtime),r.closeSync(F),r.closeSync(w)}function v(g,A,b,k,x){if(!A)return _(g,b,k,x);if(A&&!A.isDirectory())throw new Error(`Cannot overwrite non-directory '${k}' with directory '${b}'.`);return E(b,k,x)}function _(g,A,b,k){return r.mkdirSync(b),E(A,b,k),r.chmodSync(b,g.mode)}function E(g,A,b){r.readdirSync(g).forEach(k=>d(k,g,A,b))}function d(g,A,b,k){let x=n.join(A,g),F=n.join(b,g),{destStat:w}=s.checkPathsSync(x,F,"copy");return c(w,x,F,k)}function y(g,A,b,k){let x=r.readlinkSync(A);if(k.dereference&&(x=n.resolve(process.cwd(),x)),g){let F;try{F=r.readlinkSync(b)}catch(w){if(w.code==="EINVAL"||w.code==="UNKNOWN")return r.symlinkSync(x,b);throw w}if(k.dereference&&(F=n.resolve(process.cwd(),F)),s.isSrcSubdir(x,F))throw new Error(`Cannot copy '${x}' to a subdirectory of itself, '${F}'.`);if(r.statSync(b).isDirectory()&&s.isSrcSubdir(F,x))throw new Error(`Cannot overwrite '${F}' with '${x}'.`);return D(x,b)}else return r.symlinkSync(x,b)}function D(g,A){return r.unlinkSync(A),r.symlinkSync(g,A)}t.exports=o}),$d=U((e,t)=>{"use strict";H(),t.exports={copySync:ow()}}),Dt=U((e,t)=>{"use strict";H();var r=et().fromPromise,n=Bd();function i(u){return n.access(u).then(()=>!0).catch(()=>!1)}t.exports={pathExists:r(i),pathExistsSync:n.existsSync}}),sw=U((e,t)=>{"use strict";H();var r=Oe(),n=ae("path"),i=ot().mkdirs,u=Dt().pathExists,s=jd().utimesMillis,o=xi();function a(x,F,w,O){typeof w=="function"&&!O?(O=w,w={}):typeof w=="function"&&(w={filter:w}),O=O||function(){},w=w||{},w.clobber="clobber"in w?!!w.clobber:!0,w.overwrite="overwrite"in w?!!w.overwrite:w.clobber,w.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
|
@@ -119,7 +119,7 @@ GFS4: `),console.error(d)}),r[o]||(f=global[o]||[],p(r,f),r.close=function(d){fu
|
|
119
119
|
`:`
|
120
120
|
`.charCodeAt(),i=typeof r=="string"?"\r":"\r".charCodeAt();return r[r.length-1]===n&&(r=r.slice(0,r.length-1)),r[r.length-1]===i&&(r=r.slice(0,r.length-1)),r}}),mR=U((e,t)=>{"use strict";H();var r=ae("path"),n=Ih(),i=u=>{u={cwd:process.cwd(),path:process.env[n()],execPath:process.execPath,...u};let s,o=r.resolve(u.cwd),a=[];for(;s!==o;)a.push(r.join(o,"node_modules/.bin")),s=o,o=r.resolve(o,"..");let c=r.resolve(u.cwd,u.execPath,"..");return a.push(c),a.concat(u.path).join(r.delimiter)};t.exports=i,t.exports.default=i,t.exports.env=u=>{u={env:process.env,...u};let s={...u.env},o=n({env:s});return u.path=s[o],s[o]=t.exports(u),s}}),gR=U((e,t)=>{"use strict";H();var r=(n,i)=>{for(let u of Reflect.ownKeys(i))Object.defineProperty(n,u,Object.getOwnPropertyDescriptor(i,u));return n};t.exports=r,t.exports.default=r}),yR=U((e,t)=>{"use strict";H();var r=gR(),n=new WeakMap,i=(u,s={})=>{if(typeof u!="function")throw new TypeError("Expected a function");let o,a=0,c=u.displayName||u.name||"<anonymous>",p=function(...l){if(n.set(p,++a),a===1)o=u.apply(this,l),u=null;else if(s.throw===!0)throw new Error(`Function \`${c}\` can only be called once`);return o};return r(p,u),n.set(p,a),p};t.exports=i,t.exports.default=i,t.exports.callCount=u=>{if(!n.has(u))throw new Error(`The given function \`${u.name}\` is not wrapped by the \`onetime\` package`);return n.get(u)}}),vR=U(e=>{"use strict";H(),Object.defineProperty(e,"__esModule",{value:!0}),e.SIGNALS=void 0;var t=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];e.SIGNALS=t}),Nh=U(e=>{"use strict";H(),Object.defineProperty(e,"__esModule",{value:!0}),e.SIGRTMAX=e.getRealtimeSignals=void 0;var t=function(){let u=i-n+1;return Array.from({length:u},r)};e.getRealtimeSignals=t;var r=function(u,s){return{name:`SIGRT${s+1}`,number:n+s,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},n=34,i=64;e.SIGRTMAX=i}),_R=U(e=>{"use strict";H(),Object.defineProperty(e,"__esModule",{value:!0}),e.getSignals=void 0;var t=ae("os"),r=vR(),n=Nh(),i=function(){let s=(0,n.getRealtimeSignals)();return[...r.SIGNALS,...s].map(u)};e.getSignals=i;var u=function({name:s,number:o,description:a,action:c,forced:p=!1,standard:l}){let{signals:{[s]:f}}=t.constants,h=f!==void 0;return{name:s,number:h?f:o,description:a,supported:h,action:c,forced:p,standard:l}}}),ER=U(e=>{"use strict";H(),Object.defineProperty(e,"__esModule",{value:!0}),e.signalsByNumber=e.signalsByName=void 0;var t=ae("os"),r=_R(),n=Nh(),i=function(){return(0,r.getSignals)().reduce(u,{})},u=function(l,{name:f,number:h,description:m,supported:v,action:_,forced:E,standard:d}){return{...l,[f]:{name:f,number:h,description:m,supported:v,action:_,forced:E,standard:d}}},s=i();e.signalsByName=s;var o=function(){let l=(0,r.getSignals)(),f=n.SIGRTMAX+1,h=Array.from({length:f},(m,v)=>a(v,l));return Object.assign({},...h)},a=function(l,f){let h=c(l,f);if(h===void 0)return{};let{name:m,description:v,supported:_,action:E,forced:d,standard:y}=h;return{[l]:{name:m,number:l,description:v,supported:_,action:E,forced:d,standard:y}}},c=function(l,f){let h=f.find(({name:m})=>t.constants.signals[m]===l);return h!==void 0?h:f.find(m=>m.number===l)},p=o();e.signalsByNumber=p}),SR=U((e,t)=>{"use strict";H();var{signalsByName:r}=ER(),n=({timedOut:u,timeout:s,errorCode:o,signal:a,signalDescription:c,exitCode:p,isCanceled:l})=>u?`timed out after ${s} milliseconds`:l?"was canceled":o!==void 0?`failed with ${o}`:a!==void 0?`was killed with ${a} (${c})`:p!==void 0?`failed with exit code ${p}`:"failed",i=({stdout:u,stderr:s,all:o,error:a,signal:c,exitCode:p,command:l,escapedCommand:f,timedOut:h,isCanceled:m,killed:v,parsed:{options:{timeout:_}}})=>{p=p===null?void 0:p,c=c===null?void 0:c;let E=c===void 0?void 0:r[c].description,d=a&&a.code,y=`Command ${n({timedOut:h,timeout:_,errorCode:d,signal:c,signalDescription:E,exitCode:p,isCanceled:m})}: ${l}`,D=Object.prototype.toString.call(a)==="[object Error]",g=D?`${y}
|
121
121
|
${a.message}`:y,A=[g,s,u].filter(Boolean).join(`
|
122
|
-
`);return D?(a.originalMessage=a.message,a.message=A):a=new Error(A),a.shortMessage=g,a.command=l,a.escapedCommand=f,a.exitCode=p,a.signal=c,a.signalDescription=E,a.stdout=u,a.stderr=s,o!==void 0&&(a.all=o),"bufferedData"in a&&delete a.bufferedData,a.failed=!0,a.timedOut=Boolean(h),a.isCanceled=m,a.killed=v&&!h,a};t.exports=i}),AR=U((e,t)=>{"use strict";H();var r=["stdin","stdout","stderr"],n=u=>r.some(s=>u[s]!==void 0),i=u=>{if(!u)return;let{stdio:s}=u;if(s===void 0)return r.map(a=>u[a]);if(n(u))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${r.map(a=>`\`${a}\``).join(", ")}`);if(typeof s=="string")return s;if(!Array.isArray(s))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof s}\``);let o=Math.max(s.length,r.length);return Array.from({length:o},(a,c)=>s[c])};t.exports=i,t.exports.node=u=>{let s=i(u);return s==="ipc"?"ipc":s===void 0||typeof s=="string"?[s,s,s,"ipc"]:s.includes("ipc")?s:[...s,"ipc"]}}),bR=U((e,t)=>{H(),t.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&t.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&t.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}),xR=U((e,t)=>{H();var r=global.process,n=function(d){return d&&typeof d=="object"&&typeof d.removeListener=="function"&&typeof d.emit=="function"&&typeof d.reallyExit=="function"&&typeof d.listeners=="function"&&typeof d.kill=="function"&&typeof d.pid=="number"&&typeof d.on=="function"};n(r)?(i=ae("assert"),u=bR(),s=/^win/i.test(r.platform),o=ae("events"),typeof o!="function"&&(o=o.EventEmitter),r.__signal_exit_emitter__?a=r.__signal_exit_emitter__:(a=r.__signal_exit_emitter__=new o,a.count=0,a.emitted={}),a.infinite||(a.setMaxListeners(1/0),a.infinite=!0),t.exports=function(d,y){if(!n(global.process))return function(){};i.equal(typeof d,"function","a callback must be provided for exit handler"),f===!1&&h();var D="exit";y&&y.alwaysLast&&(D="afterexit");var g=function(){a.removeListener(D,d),a.listeners("exit").length===0&&a.listeners("afterexit").length===0&&c()};return a.on(D,d),g},c=function(){!f||!n(global.process)||(f=!1,u.forEach(function(d){try{r.removeListener(d,l[d])}catch{}}),r.emit=_,r.reallyExit=m,a.count-=1)},t.exports.unload=c,p=function(d,y,D){a.emitted[d]||(a.emitted[d]=!0,a.emit(d,y,D))},l={},u.forEach(function(d){l[d]=function(){if(n(global.process)){var y=r.listeners(d);y.length===a.count&&(c(),p("exit",null,d),p("afterexit",null,d),s&&d==="SIGHUP"&&(d="SIGINT"),r.kill(r.pid,d))}}}),t.exports.signals=function(){return u},f=!1,h=function(){f||!n(global.process)||(f=!0,a.count+=1,u=u.filter(function(d){try{return r.on(d,l[d]),!0}catch{return!1}}),r.emit=E,r.reallyExit=v)},t.exports.load=h,m=r.reallyExit,v=function(d){!n(global.process)||(r.exitCode=d||0,p("exit",r.exitCode,null),p("afterexit",r.exitCode,null),m.call(r,r.exitCode))},_=r.emit,E=function(d,y){if(d==="exit"&&n(global.process)){y!==void 0&&(r.exitCode=y);var D=_.apply(this,arguments);return p("exit",r.exitCode,null),p("afterexit",r.exitCode,null),D}else return _.apply(this,arguments)}):t.exports=function(){return function(){}};var i,u,s,o,a,c,p,l,f,h,m,v,_,E}),DR=U((e,t)=>{"use strict";H();var r=ae("os"),n=xR(),i=1e3*5,u=(v,_="SIGTERM",E={})=>{let d=v(_);return s(v,_,E,d),d},s=(v,_,E,d)=>{if(!o(_,E,d))return;let y=c(E),D=setTimeout(()=>{v("SIGKILL")},y);D.unref&&D.unref()},o=(v,{forceKillAfterTimeout:_},E)=>a(v)&&_!==!1&&E,a=v=>v===r.constants.signals.SIGTERM||typeof v=="string"&&v.toUpperCase()==="SIGTERM",c=({forceKillAfterTimeout:v=!0})=>{if(v===!0)return i;if(!Number.isFinite(v)||v<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${v}\` (${typeof v})`);return v},p=(v,_)=>{v.kill()&&(_.isCanceled=!0)},l=(v,_,E)=>{v.kill(_),E(Object.assign(new Error("Timed out"),{timedOut:!0,signal:_}))},f=(v,{timeout:_,killSignal:E="SIGTERM"},d)=>{if(_===0||_===void 0)return d;let y,D=new Promise((A,b)=>{y=setTimeout(()=>{l(v,E,b)},_)}),g=d.finally(()=>{clearTimeout(y)});return Promise.race([D,g])},h=({timeout:v})=>{if(v!==void 0&&(!Number.isFinite(v)||v<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${v}\` (${typeof v})`)},m=async(v,{cleanup:_,detached:E},d)=>{if(!_||E)return d;let y=n(()=>{v.kill()});return d.finally(()=>{y()})};t.exports={spawnedKill:u,spawnedCancel:p,setupTimeout:f,validateTimeout:h,setExitHandler:m}}),wR=U((e,t)=>{"use strict";H();var r=n=>n!==null&&typeof n=="object"&&typeof n.pipe=="function";r.writable=n=>r(n)&&n.writable!==!1&&typeof n._write=="function"&&typeof n._writableState=="object",r.readable=n=>r(n)&&n.readable!==!1&&typeof n._read=="function"&&typeof n._readableState=="object",r.duplex=n=>r.writable(n)&&r.readable(n),r.transform=n=>r.duplex(n)&&typeof n._transform=="function",t.exports=r}),CR=U((e,t)=>{"use strict";H();var{PassThrough:r}=ae("stream");t.exports=n=>{n={...n};let{array:i}=n,{encoding:u}=n,s=u==="buffer",o=!1;i?o=!(u||s):u=u||"utf8",s&&(u=null);let a=new r({objectMode:o});u&&a.setEncoding(u);let c=0,p=[];return a.on("data",l=>{p.push(l),o?c=p.length:c+=l.length}),a.getBufferedValue=()=>i?p:s?Buffer.concat(p,c):p.join(""),a.getBufferedLength=()=>c,a}}),kR=U((e,t)=>{"use strict";H();var{constants:r}=ae("buffer"),n=ae("stream"),{promisify:i}=ae("util"),u=CR(),s=i(n.pipeline),o=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function a(c,p){if(!c)throw new Error("Expected a stream");p={maxBuffer:1/0,...p};let{maxBuffer:l}=p,f=u(p);return await new Promise((h,m)=>{let v=_=>{_&&f.getBufferedLength()<=r.MAX_LENGTH&&(_.bufferedData=f.getBufferedValue()),m(_)};(async()=>{try{await s(c,f),h()}catch(_){v(_)}})(),f.on("data",()=>{f.getBufferedLength()>l&&v(new o)})}),f.getBufferedValue()}t.exports=a,t.exports.buffer=(c,p)=>a(c,{...p,encoding:"buffer"}),t.exports.array=(c,p)=>a(c,{...p,array:!0}),t.exports.MaxBufferError=o}),FR=U((e,t)=>{"use strict";H();var{PassThrough:r}=ae("stream");t.exports=function(){var n=[],i=new r({objectMode:!0});return i.setMaxListeners(0),i.add=u,i.isEmpty=s,i.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(u),i;function u(a){return Array.isArray(a)?(a.forEach(u),this):(n.push(a),a.once("end",o.bind(null,a)),a.once("error",i.emit.bind(i,"error")),a.pipe(i,{end:!1}),this)}function s(){return n.length==0}function o(a){n=n.filter(function(c){return c!==a}),!n.length&&i.readable&&i.end()}}}),RR=U((e,t)=>{"use strict";H();var r=wR(),n=kR(),i=FR(),u=(l,f)=>{f===void 0||l.stdin===void 0||(r(f)?f.pipe(l.stdin):l.stdin.end(f))},s=(l,{all:f})=>{if(!f||!l.stdout&&!l.stderr)return;let h=i();return l.stdout&&h.add(l.stdout),l.stderr&&h.add(l.stderr),h},o=async(l,f)=>{if(l){l.destroy();try{return await f}catch(h){return h.bufferedData}}},a=(l,{encoding:f,buffer:h,maxBuffer:m})=>{if(!(!l||!h))return f?n(l,{encoding:f,maxBuffer:m}):n.buffer(l,{maxBuffer:m})},c=async({stdout:l,stderr:f,all:h},{encoding:m,buffer:v,maxBuffer:_},E)=>{let d=a(l,{encoding:m,buffer:v,maxBuffer:_}),y=a(f,{encoding:m,buffer:v,maxBuffer:_}),D=a(h,{encoding:m,buffer:v,maxBuffer:_*2});try{return await Promise.all([E,d,y,D])}catch(g){return Promise.all([{error:g,signal:g.signal,timedOut:g.timedOut},o(l,d),o(f,y),o(h,D)])}},p=({input:l})=>{if(r(l))throw new TypeError("The `input` option cannot be a stream in sync mode")};t.exports={handleInput:u,makeAllStream:s,getSpawnedResult:c,validateInputSync:p}}),OR=U((e,t)=>{"use strict";H();var r=(async()=>{})().constructor.prototype,n=["then","catch","finally"].map(s=>[s,Reflect.getOwnPropertyDescriptor(r,s)]),i=(s,o)=>{for(let[a,c]of n){let p=typeof o=="function"?(...l)=>Reflect.apply(c.value,o(),l):c.value.bind(o);Reflect.defineProperty(s,a,{...c,value:p})}return s},u=s=>new Promise((o,a)=>{s.on("exit",(c,p)=>{o({exitCode:c,signal:p})}),s.on("error",c=>{a(c)}),s.stdin&&s.stdin.on("error",c=>{a(c)})});t.exports={mergePromise:i,getSpawnedPromise:u}}),TR=U((e,t)=>{"use strict";H();var r=(p,l=[])=>Array.isArray(l)?[p,...l]:[p],n=/^[\w.-]+$/,i=/"/g,u=p=>typeof p!="string"||n.test(p)?p:`"${p.replace(i,'\\"')}"`,s=(p,l)=>r(p,l).join(" "),o=(p,l)=>r(p,l).map(f=>u(f)).join(" "),a=/ +/g,c=p=>{let l=[];for(let f of p.trim().split(a)){let h=l[l.length-1];h&&h.endsWith("\\")?l[l.length-1]=`${h.slice(0,-1)} ${f}`:l.push(f)}return l};t.exports={joinCommand:s,getEscapedCommand:o,parseCommand:c}}),PR=U((e,t)=>{"use strict";H();var r=ae("path"),n=ae("child_process"),i=dR(),u=hR(),s=mR(),o=yR(),a=SR(),c=AR(),{spawnedKill:p,spawnedCancel:l,setupTimeout:f,validateTimeout:h,setExitHandler:m}=DR(),{handleInput:v,getSpawnedResult:_,makeAllStream:E,validateInputSync:d}=RR(),{mergePromise:y,getSpawnedPromise:D}=OR(),{joinCommand:g,parseCommand:A,getEscapedCommand:b}=TR(),k=1e3*1e3*100,x=({env:P,extendEnv:C,preferLocal:S,localDir:R,execPath:L})=>{let M=C?{...process.env,...P}:P;return S?s.env({env:M,cwd:R,execPath:L}):M},F=(P,C,S={})=>{let R=i._parse(P,C,S);return P=R.command,C=R.args,S=R.options,S={maxBuffer:k,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:S.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...S},S.env=x(S),S.stdio=c(S),process.platform==="win32"&&r.basename(P,".exe")==="cmd"&&C.unshift("/q"),{file:P,args:C,options:S,parsed:R}},w=(P,C,S)=>typeof C!="string"&&!Buffer.isBuffer(C)?S===void 0?void 0:"":P.stripFinalNewline?u(C):C,O=(P,C,S)=>{let R=F(P,C,S),L=g(P,C),M=b(P,C);h(R.options);let B;try{B=n.spawn(R.file,R.args,R.options)}catch(pe){let ne=new n.ChildProcess,T=Promise.reject(a({error:pe,stdout:"",stderr:"",all:"",command:L,escapedCommand:M,parsed:R,timedOut:!1,isCanceled:!1,killed:!1}));return y(ne,T)}let Q=D(B),Z=f(B,R.options,Q),oe=m(B,R.options,Z),N={isCanceled:!1};B.kill=p.bind(null,B.kill.bind(B)),B.cancel=l.bind(null,B,N);let le=o(async()=>{let[{error:pe,exitCode:ne,signal:T,timedOut:I},$,Y,K]=await _(B,R.options,oe),z=w(R.options,$),J=w(R.options,Y),ee=w(R.options,K);if(pe||ne!==0||T!==null){let ie=a({error:pe,exitCode:ne,signal:T,stdout:z,stderr:J,all:ee,command:L,escapedCommand:M,parsed:R,timedOut:I,isCanceled:N.isCanceled,killed:B.killed});if(!R.options.reject)return ie;throw ie}return{command:L,escapedCommand:M,exitCode:0,stdout:z,stderr:J,all:ee,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return v(B,R.options.input),B.all=E(B,R.options),y(B,le)};t.exports=O,t.exports.sync=(P,C,S)=>{let R=F(P,C,S),L=g(P,C),M=b(P,C);d(R.options);let B;try{B=n.spawnSync(R.file,R.args,R.options)}catch(oe){throw a({error:oe,stdout:"",stderr:"",all:"",command:L,escapedCommand:M,parsed:R,timedOut:!1,isCanceled:!1,killed:!1})}let Q=w(R.options,B.stdout,B.error),Z=w(R.options,B.stderr,B.error);if(B.error||B.status!==0||B.signal!==null){let oe=a({stdout:Q,stderr:Z,error:B.error,signal:B.signal,exitCode:B.status,command:L,escapedCommand:M,parsed:R,timedOut:B.error&&B.error.code==="ETIMEDOUT",isCanceled:!1,killed:B.signal!==null});if(!R.options.reject)return oe;throw oe}return{command:L,escapedCommand:M,exitCode:0,stdout:Q,stderr:Z,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}},t.exports.command=(P,C)=>{let[S,...R]=A(P);return O(S,R,C)},t.exports.commandSync=(P,C)=>{let[S,...R]=A(P);return O.sync(S,R,C)},t.exports.node=(P,C,S={})=>{C&&!Array.isArray(C)&&typeof C=="object"&&(S=C,C=[]);let R=c.node(S),L=process.execArgv.filter(Q=>!Q.startsWith("--inspect")),{nodePath:M=process.execPath,nodeOptions:B=L}=S;return O(M,[...B,P,...Array.isArray(C)?C:[]],{...S,stdin:void 0,stdout:void 0,stderr:void 0,stdio:R,shell:!1})}});H();var LR=jt(PR());async function za(e){let t={cwd:Bh.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"}};try{let r=await(0,LR.default)(e,["--version"],t);return{available:!0,version:r.stdout.trim()}}catch{return{available:!1}}}async function hn(){let[e,t,r]=await Promise.all([za("yarnpkg"),za("npm"),za("pnpm")]);return{yarn:e,pnpm:t,npm:r}}H();j();var eu=Se(require("path")),tu=Se(require("fs-extra")),ru=Se(require("chalk"));j();var Mh=Se(require("fs-extra")),IR=[".DS_Store",".git",".gitattributes",".gitignore",".gitlab-ci.yml",".hg",".hgcheck",".hgignore",".idea",".npmignore",".travis.yml","LICENSE","Thumbs.db","docs","mkdocs.yml","npm-debug.log","yarn-debug.log","yarn-error.log","yarnrc.yml",".yarn"];function Li(e){let t=Mh.default.readdirSync(e).filter(r=>!IR.includes(r)).filter(r=>!/\.iml$/.test(r));return{isEmpty:t.length===0,conflicts:t}}var nu=Se(require("inquirer"));function jh(e){let t=eu.default.resolve(e),r=eu.default.basename(t),n=tu.default.existsSync(t),i=tu.default.lstatSync(t,{throwIfNoEntry:!1});if(i&&!i.isDirectory())return{valid:!1,root:t,projectName:r,error:`${ru.default.dim(r)} is not a directory - please try a different location`};if(n){let{isEmpty:u,conflicts:s}=Li(t);if(!u)return{valid:!1,root:t,projectName:r,error:`${ru.default.dim(r)} has ${s.length} conflicting ${s.length===1?"file":"files"} - please try a different location`}}return{valid:!0,root:t,projectName:r}}async function $h({directory:e}){let t=await nu.default.prompt({type:"input",name:"projectDirectory",message:"Where would you like to create your turborepo?",when:!e,default:"./my-turborepo",validate:n=>{let{valid:i,error:u}=jh(n);return!i&&u?u:!0},filter:n=>n.trim()}),{projectDirectory:r=e}=t;return jh(r)}async function Hh({packageManager:e,skipTransforms:t}){if(t)return;let r=await hn(),n=await nu.default.prompt({name:"packageManagerInput",type:"list",message:"Which package manager do you want to use?",when:!e||!Object.keys(r).includes(e),choices:["npm","pnpm","yarn"].map(u=>{var s;return{name:u,value:u,disabled:(s=r==null?void 0:r[u])!=null&&s.available?!1:"not installed"}})}),{packageManagerInput:i=e}=n;return{name:i,version:r[i].version}}j();var su=Se(require("async-retry")),Ct=Se(require("chalk")),Mi=Se(require("fs-extra")),$r=Se(require("path"));j();var Ii=Se(require("got")),ou=Se(require("tar")),Gh=require("stream"),qh=require("util"),Uh=require("path"),Wh=require("os"),mn=require("fs"),BR=(0,qh.promisify)(Gh.Stream.pipeline);async function iu(e){try{return(await Ii.default.head(e)).statusCode===200}catch{return!1}}async function Yh(e,t){let[,r,n,i,u,...s]=e.pathname.split("/"),o=t?t.replace(/^\//,""):s.join("/");if(i===void 0||i===""&&u===void 0)try{let c=await(0,Ii.default)(`https://api.github.com/repos/${r}/${n}`),p=JSON.parse(c.body);return{username:r,name:n,branch:p.default_branch,filePath:o}}catch{return}let a=t?`${u}/${s.join("/")}`.replace(new RegExp(`/${o}|/$`),""):u;if(r&&n&&a&&i==="tree")return{username:r,name:n,branch:a,filePath:o}}function Kh({username:e,name:t,branch:r,filePath:n}){let i=`https://api.github.com/repos/${e}/${t}/contents`,u=`${n?`/${n}`:""}/package.json`;return iu(i+u+`?ref=${r}`)}function Vh(e){try{let t=new URL(e);return iu(t.href)}catch{return iu(`https://api.github.com/repos/vercel/turbo/contents/examples/${encodeURIComponent(e)}`)}}async function Qh(e,t){let r=(0,Uh.join)((0,Wh.tmpdir)(),`${t}.temp-${Date.now()}`);return await BR(Ii.default.stream(e),(0,mn.createWriteStream)(r)),r}async function Xh(e,{username:t,name:r,branch:n,filePath:i}){let u=await Qh(`https://codeload.github.com/${t}/${r}/tar.gz/${n}`,"turbo-ct-example");await ou.default.x({file:u,cwd:e,strip:i?i.split("/").length+1:1,filter:s=>s.startsWith(`${r}-${n.replace(/\//g,"-")}${i?`/${i}/`:"/"}`)}),await mn.promises.unlink(u)}async function Jh(e,t){let r=await Qh("https://codeload.github.com/vercel/turbo/tar.gz/main","turbo-ct-example");await ou.default.x({file:r,cwd:e,strip:2+t.split("/").length,filter:n=>n.includes(`turbo-main/examples/${t}/`)}),await mn.promises.unlink(r)}j();var Ni=Se(require("fs-extra"));async function Zh(e){try{return await Ni.default.access(e,(Ni.default.constants||Ni.default).W_OK),!0}catch{return!1}}j();var MR=new Set(["basic","default"]);function Bi(e){return MR.has(e)}var au=class extends Error{};async function zh({appPath:e,example:t,examplePath:r}){let n,i,u=Bi(t);try{i=new URL(t)}catch(E){E.code!=="ERR_INVALID_URL"&&(Pe(E),process.exit(1))}i?(i.origin!=="https://github.com"&&(Pe(`Invalid URL: ${Ct.default.red(`"${t}"`)}. Only GitHub repositories are supported. Please use a GitHub URL and try again.`),process.exit(1)),n=await Yh(i,r),n||(Pe(`Unable to fetch repository information from: ${Ct.default.red(`"${t}"`)}. Please fix the URL and try again.`),process.exit(1)),await Kh(n)||(Pe(`Could not locate the repository for ${Ct.default.red(`"${t}"`)}. Please check that the repository exists and try again.`),process.exit(1))):await Vh(t)||(Pe(`Could not locate an example named ${Ct.default.red(`"${t}"`)}. It could be due to the following:
|
122
|
+
`);return D?(a.originalMessage=a.message,a.message=A):a=new Error(A),a.shortMessage=g,a.command=l,a.escapedCommand=f,a.exitCode=p,a.signal=c,a.signalDescription=E,a.stdout=u,a.stderr=s,o!==void 0&&(a.all=o),"bufferedData"in a&&delete a.bufferedData,a.failed=!0,a.timedOut=Boolean(h),a.isCanceled=m,a.killed=v&&!h,a};t.exports=i}),AR=U((e,t)=>{"use strict";H();var r=["stdin","stdout","stderr"],n=u=>r.some(s=>u[s]!==void 0),i=u=>{if(!u)return;let{stdio:s}=u;if(s===void 0)return r.map(a=>u[a]);if(n(u))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${r.map(a=>`\`${a}\``).join(", ")}`);if(typeof s=="string")return s;if(!Array.isArray(s))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof s}\``);let o=Math.max(s.length,r.length);return Array.from({length:o},(a,c)=>s[c])};t.exports=i,t.exports.node=u=>{let s=i(u);return s==="ipc"?"ipc":s===void 0||typeof s=="string"?[s,s,s,"ipc"]:s.includes("ipc")?s:[...s,"ipc"]}}),bR=U((e,t)=>{H(),t.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&t.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&t.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}),xR=U((e,t)=>{H();var r=global.process,n=function(d){return d&&typeof d=="object"&&typeof d.removeListener=="function"&&typeof d.emit=="function"&&typeof d.reallyExit=="function"&&typeof d.listeners=="function"&&typeof d.kill=="function"&&typeof d.pid=="number"&&typeof d.on=="function"};n(r)?(i=ae("assert"),u=bR(),s=/^win/i.test(r.platform),o=ae("events"),typeof o!="function"&&(o=o.EventEmitter),r.__signal_exit_emitter__?a=r.__signal_exit_emitter__:(a=r.__signal_exit_emitter__=new o,a.count=0,a.emitted={}),a.infinite||(a.setMaxListeners(1/0),a.infinite=!0),t.exports=function(d,y){if(!n(global.process))return function(){};i.equal(typeof d,"function","a callback must be provided for exit handler"),f===!1&&h();var D="exit";y&&y.alwaysLast&&(D="afterexit");var g=function(){a.removeListener(D,d),a.listeners("exit").length===0&&a.listeners("afterexit").length===0&&c()};return a.on(D,d),g},c=function(){!f||!n(global.process)||(f=!1,u.forEach(function(d){try{r.removeListener(d,l[d])}catch{}}),r.emit=_,r.reallyExit=m,a.count-=1)},t.exports.unload=c,p=function(d,y,D){a.emitted[d]||(a.emitted[d]=!0,a.emit(d,y,D))},l={},u.forEach(function(d){l[d]=function(){if(n(global.process)){var y=r.listeners(d);y.length===a.count&&(c(),p("exit",null,d),p("afterexit",null,d),s&&d==="SIGHUP"&&(d="SIGINT"),r.kill(r.pid,d))}}}),t.exports.signals=function(){return u},f=!1,h=function(){f||!n(global.process)||(f=!0,a.count+=1,u=u.filter(function(d){try{return r.on(d,l[d]),!0}catch{return!1}}),r.emit=E,r.reallyExit=v)},t.exports.load=h,m=r.reallyExit,v=function(d){!n(global.process)||(r.exitCode=d||0,p("exit",r.exitCode,null),p("afterexit",r.exitCode,null),m.call(r,r.exitCode))},_=r.emit,E=function(d,y){if(d==="exit"&&n(global.process)){y!==void 0&&(r.exitCode=y);var D=_.apply(this,arguments);return p("exit",r.exitCode,null),p("afterexit",r.exitCode,null),D}else return _.apply(this,arguments)}):t.exports=function(){return function(){}};var i,u,s,o,a,c,p,l,f,h,m,v,_,E}),DR=U((e,t)=>{"use strict";H();var r=ae("os"),n=xR(),i=1e3*5,u=(v,_="SIGTERM",E={})=>{let d=v(_);return s(v,_,E,d),d},s=(v,_,E,d)=>{if(!o(_,E,d))return;let y=c(E),D=setTimeout(()=>{v("SIGKILL")},y);D.unref&&D.unref()},o=(v,{forceKillAfterTimeout:_},E)=>a(v)&&_!==!1&&E,a=v=>v===r.constants.signals.SIGTERM||typeof v=="string"&&v.toUpperCase()==="SIGTERM",c=({forceKillAfterTimeout:v=!0})=>{if(v===!0)return i;if(!Number.isFinite(v)||v<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${v}\` (${typeof v})`);return v},p=(v,_)=>{v.kill()&&(_.isCanceled=!0)},l=(v,_,E)=>{v.kill(_),E(Object.assign(new Error("Timed out"),{timedOut:!0,signal:_}))},f=(v,{timeout:_,killSignal:E="SIGTERM"},d)=>{if(_===0||_===void 0)return d;let y,D=new Promise((A,b)=>{y=setTimeout(()=>{l(v,E,b)},_)}),g=d.finally(()=>{clearTimeout(y)});return Promise.race([D,g])},h=({timeout:v})=>{if(v!==void 0&&(!Number.isFinite(v)||v<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${v}\` (${typeof v})`)},m=async(v,{cleanup:_,detached:E},d)=>{if(!_||E)return d;let y=n(()=>{v.kill()});return d.finally(()=>{y()})};t.exports={spawnedKill:u,spawnedCancel:p,setupTimeout:f,validateTimeout:h,setExitHandler:m}}),wR=U((e,t)=>{"use strict";H();var r=n=>n!==null&&typeof n=="object"&&typeof n.pipe=="function";r.writable=n=>r(n)&&n.writable!==!1&&typeof n._write=="function"&&typeof n._writableState=="object",r.readable=n=>r(n)&&n.readable!==!1&&typeof n._read=="function"&&typeof n._readableState=="object",r.duplex=n=>r.writable(n)&&r.readable(n),r.transform=n=>r.duplex(n)&&typeof n._transform=="function",t.exports=r}),CR=U((e,t)=>{"use strict";H();var{PassThrough:r}=ae("stream");t.exports=n=>{n={...n};let{array:i}=n,{encoding:u}=n,s=u==="buffer",o=!1;i?o=!(u||s):u=u||"utf8",s&&(u=null);let a=new r({objectMode:o});u&&a.setEncoding(u);let c=0,p=[];return a.on("data",l=>{p.push(l),o?c=p.length:c+=l.length}),a.getBufferedValue=()=>i?p:s?Buffer.concat(p,c):p.join(""),a.getBufferedLength=()=>c,a}}),kR=U((e,t)=>{"use strict";H();var{constants:r}=ae("buffer"),n=ae("stream"),{promisify:i}=ae("util"),u=CR(),s=i(n.pipeline),o=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function a(c,p){if(!c)throw new Error("Expected a stream");p={maxBuffer:1/0,...p};let{maxBuffer:l}=p,f=u(p);return await new Promise((h,m)=>{let v=_=>{_&&f.getBufferedLength()<=r.MAX_LENGTH&&(_.bufferedData=f.getBufferedValue()),m(_)};(async()=>{try{await s(c,f),h()}catch(_){v(_)}})(),f.on("data",()=>{f.getBufferedLength()>l&&v(new o)})}),f.getBufferedValue()}t.exports=a,t.exports.buffer=(c,p)=>a(c,{...p,encoding:"buffer"}),t.exports.array=(c,p)=>a(c,{...p,array:!0}),t.exports.MaxBufferError=o}),FR=U((e,t)=>{"use strict";H();var{PassThrough:r}=ae("stream");t.exports=function(){var n=[],i=new r({objectMode:!0});return i.setMaxListeners(0),i.add=u,i.isEmpty=s,i.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(u),i;function u(a){return Array.isArray(a)?(a.forEach(u),this):(n.push(a),a.once("end",o.bind(null,a)),a.once("error",i.emit.bind(i,"error")),a.pipe(i,{end:!1}),this)}function s(){return n.length==0}function o(a){n=n.filter(function(c){return c!==a}),!n.length&&i.readable&&i.end()}}}),RR=U((e,t)=>{"use strict";H();var r=wR(),n=kR(),i=FR(),u=(l,f)=>{f===void 0||l.stdin===void 0||(r(f)?f.pipe(l.stdin):l.stdin.end(f))},s=(l,{all:f})=>{if(!f||!l.stdout&&!l.stderr)return;let h=i();return l.stdout&&h.add(l.stdout),l.stderr&&h.add(l.stderr),h},o=async(l,f)=>{if(l){l.destroy();try{return await f}catch(h){return h.bufferedData}}},a=(l,{encoding:f,buffer:h,maxBuffer:m})=>{if(!(!l||!h))return f?n(l,{encoding:f,maxBuffer:m}):n.buffer(l,{maxBuffer:m})},c=async({stdout:l,stderr:f,all:h},{encoding:m,buffer:v,maxBuffer:_},E)=>{let d=a(l,{encoding:m,buffer:v,maxBuffer:_}),y=a(f,{encoding:m,buffer:v,maxBuffer:_}),D=a(h,{encoding:m,buffer:v,maxBuffer:_*2});try{return await Promise.all([E,d,y,D])}catch(g){return Promise.all([{error:g,signal:g.signal,timedOut:g.timedOut},o(l,d),o(f,y),o(h,D)])}},p=({input:l})=>{if(r(l))throw new TypeError("The `input` option cannot be a stream in sync mode")};t.exports={handleInput:u,makeAllStream:s,getSpawnedResult:c,validateInputSync:p}}),OR=U((e,t)=>{"use strict";H();var r=(async()=>{})().constructor.prototype,n=["then","catch","finally"].map(s=>[s,Reflect.getOwnPropertyDescriptor(r,s)]),i=(s,o)=>{for(let[a,c]of n){let p=typeof o=="function"?(...l)=>Reflect.apply(c.value,o(),l):c.value.bind(o);Reflect.defineProperty(s,a,{...c,value:p})}return s},u=s=>new Promise((o,a)=>{s.on("exit",(c,p)=>{o({exitCode:c,signal:p})}),s.on("error",c=>{a(c)}),s.stdin&&s.stdin.on("error",c=>{a(c)})});t.exports={mergePromise:i,getSpawnedPromise:u}}),TR=U((e,t)=>{"use strict";H();var r=(p,l=[])=>Array.isArray(l)?[p,...l]:[p],n=/^[\w.-]+$/,i=/"/g,u=p=>typeof p!="string"||n.test(p)?p:`"${p.replace(i,'\\"')}"`,s=(p,l)=>r(p,l).join(" "),o=(p,l)=>r(p,l).map(f=>u(f)).join(" "),a=/ +/g,c=p=>{let l=[];for(let f of p.trim().split(a)){let h=l[l.length-1];h&&h.endsWith("\\")?l[l.length-1]=`${h.slice(0,-1)} ${f}`:l.push(f)}return l};t.exports={joinCommand:s,getEscapedCommand:o,parseCommand:c}}),PR=U((e,t)=>{"use strict";H();var r=ae("path"),n=ae("child_process"),i=dR(),u=hR(),s=mR(),o=yR(),a=SR(),c=AR(),{spawnedKill:p,spawnedCancel:l,setupTimeout:f,validateTimeout:h,setExitHandler:m}=DR(),{handleInput:v,getSpawnedResult:_,makeAllStream:E,validateInputSync:d}=RR(),{mergePromise:y,getSpawnedPromise:D}=OR(),{joinCommand:g,parseCommand:A,getEscapedCommand:b}=TR(),k=1e3*1e3*100,x=({env:P,extendEnv:C,preferLocal:S,localDir:R,execPath:L})=>{let M=C?{...process.env,...P}:P;return S?s.env({env:M,cwd:R,execPath:L}):M},F=(P,C,S={})=>{let R=i._parse(P,C,S);return P=R.command,C=R.args,S=R.options,S={maxBuffer:k,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:S.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...S},S.env=x(S),S.stdio=c(S),process.platform==="win32"&&r.basename(P,".exe")==="cmd"&&C.unshift("/q"),{file:P,args:C,options:S,parsed:R}},w=(P,C,S)=>typeof C!="string"&&!Buffer.isBuffer(C)?S===void 0?void 0:"":P.stripFinalNewline?u(C):C,O=(P,C,S)=>{let R=F(P,C,S),L=g(P,C),M=b(P,C);h(R.options);let B;try{B=n.spawn(R.file,R.args,R.options)}catch(pe){let ne=new n.ChildProcess,T=Promise.reject(a({error:pe,stdout:"",stderr:"",all:"",command:L,escapedCommand:M,parsed:R,timedOut:!1,isCanceled:!1,killed:!1}));return y(ne,T)}let Q=D(B),Z=f(B,R.options,Q),oe=m(B,R.options,Z),N={isCanceled:!1};B.kill=p.bind(null,B.kill.bind(B)),B.cancel=l.bind(null,B,N);let le=o(async()=>{let[{error:pe,exitCode:ne,signal:T,timedOut:I},$,Y,K]=await _(B,R.options,oe),z=w(R.options,$),J=w(R.options,Y),ee=w(R.options,K);if(pe||ne!==0||T!==null){let ie=a({error:pe,exitCode:ne,signal:T,stdout:z,stderr:J,all:ee,command:L,escapedCommand:M,parsed:R,timedOut:I,isCanceled:N.isCanceled,killed:B.killed});if(!R.options.reject)return ie;throw ie}return{command:L,escapedCommand:M,exitCode:0,stdout:z,stderr:J,all:ee,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return v(B,R.options.input),B.all=E(B,R.options),y(B,le)};t.exports=O,t.exports.sync=(P,C,S)=>{let R=F(P,C,S),L=g(P,C),M=b(P,C);d(R.options);let B;try{B=n.spawnSync(R.file,R.args,R.options)}catch(oe){throw a({error:oe,stdout:"",stderr:"",all:"",command:L,escapedCommand:M,parsed:R,timedOut:!1,isCanceled:!1,killed:!1})}let Q=w(R.options,B.stdout,B.error),Z=w(R.options,B.stderr,B.error);if(B.error||B.status!==0||B.signal!==null){let oe=a({stdout:Q,stderr:Z,error:B.error,signal:B.signal,exitCode:B.status,command:L,escapedCommand:M,parsed:R,timedOut:B.error&&B.error.code==="ETIMEDOUT",isCanceled:!1,killed:B.signal!==null});if(!R.options.reject)return oe;throw oe}return{command:L,escapedCommand:M,exitCode:0,stdout:Q,stderr:Z,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}},t.exports.command=(P,C)=>{let[S,...R]=A(P);return O(S,R,C)},t.exports.commandSync=(P,C)=>{let[S,...R]=A(P);return O.sync(S,R,C)},t.exports.node=(P,C,S={})=>{C&&!Array.isArray(C)&&typeof C=="object"&&(S=C,C=[]);let R=c.node(S),L=process.execArgv.filter(Q=>!Q.startsWith("--inspect")),{nodePath:M=process.execPath,nodeOptions:B=L}=S;return O(M,[...B,P,...Array.isArray(C)?C:[]],{...S,stdin:void 0,stdout:void 0,stderr:void 0,stdio:R,shell:!1})}});H();var LR=jt(PR());async function za(e){let t={cwd:Bh.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"}},r=!1;try{let n=process.env.npm_config_user_agent;n&&n.startsWith(e)&&(r=!0);let i=await(0,LR.default)(e,["--version"],t);return{available:!0,version:i.stdout.trim()}}catch{return{available:r}}}async function hn(){let[e,t,r]=await Promise.all([za("yarnpkg"),za("npm"),za("pnpm")]);return{yarn:e,pnpm:t,npm:r}}H();j();var eu=Se(require("path")),tu=Se(require("fs-extra")),ru=Se(require("chalk"));j();var Mh=Se(require("fs-extra")),IR=[".DS_Store",".git",".gitattributes",".gitignore",".gitlab-ci.yml",".hg",".hgcheck",".hgignore",".idea",".npmignore",".travis.yml","LICENSE","Thumbs.db","docs","mkdocs.yml","npm-debug.log","yarn-debug.log","yarn-error.log","yarnrc.yml",".yarn"];function Li(e){let t=Mh.default.readdirSync(e).filter(r=>!IR.includes(r)).filter(r=>!/\.iml$/.test(r));return{isEmpty:t.length===0,conflicts:t}}var nu=Se(require("inquirer"));function jh(e){let t=eu.default.resolve(e),r=eu.default.basename(t),n=tu.default.existsSync(t),i=tu.default.lstatSync(t,{throwIfNoEntry:!1});if(i&&!i.isDirectory())return{valid:!1,root:t,projectName:r,error:`${ru.default.dim(r)} is not a directory - please try a different location`};if(n){let{isEmpty:u,conflicts:s}=Li(t);if(!u)return{valid:!1,root:t,projectName:r,error:`${ru.default.dim(r)} has ${s.length} conflicting ${s.length===1?"file":"files"} - please try a different location`}}return{valid:!0,root:t,projectName:r}}async function $h({directory:e}){let t=await nu.default.prompt({type:"input",name:"projectDirectory",message:"Where would you like to create your turborepo?",when:!e,default:"./my-turborepo",validate:n=>{let{valid:i,error:u}=jh(n);return!i&&u?u:!0},filter:n=>n.trim()}),{projectDirectory:r=e}=t;return jh(r)}async function Hh({packageManager:e,skipTransforms:t}){if(t)return;let r=await hn(),n=await nu.default.prompt({name:"packageManagerInput",type:"list",message:"Which package manager do you want to use?",when:!e||!Object.keys(r).includes(e),choices:["npm","pnpm","yarn"].map(u=>{var s;return{name:u,value:u,disabled:u!=="npm"||((s=r==null?void 0:r[u])==null?void 0:s.available)?!1:"not installed"}})}),{packageManagerInput:i=e}=n;return{name:i,version:r[i].version}}j();var su=Se(require("async-retry")),Ct=Se(require("chalk")),Mi=Se(require("fs-extra")),$r=Se(require("path"));j();var Ii=Se(require("got")),ou=Se(require("tar")),Gh=require("stream"),qh=require("util"),Uh=require("path"),Wh=require("os"),mn=require("fs"),BR=(0,qh.promisify)(Gh.Stream.pipeline);async function iu(e){try{return(await Ii.default.head(e)).statusCode===200}catch{return!1}}async function Yh(e,t){let[,r,n,i,u,...s]=e.pathname.split("/"),o=t?t.replace(/^\//,""):s.join("/");if(i===void 0||i===""&&u===void 0)try{let c=await(0,Ii.default)(`https://api.github.com/repos/${r}/${n}`),p=JSON.parse(c.body);return{username:r,name:n,branch:p.default_branch,filePath:o}}catch{return}let a=t?`${u}/${s.join("/")}`.replace(new RegExp(`/${o}|/$`),""):u;if(r&&n&&a&&i==="tree")return{username:r,name:n,branch:a,filePath:o}}function Kh({username:e,name:t,branch:r,filePath:n}){let i=`https://api.github.com/repos/${e}/${t}/contents`,u=`${n?`/${n}`:""}/package.json`;return iu(i+u+`?ref=${r}`)}function Vh(e){try{let t=new URL(e);return iu(t.href)}catch{return iu(`https://api.github.com/repos/vercel/turbo/contents/examples/${encodeURIComponent(e)}`)}}async function Qh(e,t){let r=(0,Uh.join)((0,Wh.tmpdir)(),`${t}.temp-${Date.now()}`);return await BR(Ii.default.stream(e),(0,mn.createWriteStream)(r)),r}async function Xh(e,{username:t,name:r,branch:n,filePath:i}){let u=await Qh(`https://codeload.github.com/${t}/${r}/tar.gz/${n}`,"turbo-ct-example");await ou.default.x({file:u,cwd:e,strip:i?i.split("/").length+1:1,filter:s=>s.startsWith(`${r}-${n.replace(/\//g,"-")}${i?`/${i}/`:"/"}`)}),await mn.promises.unlink(u)}async function Jh(e,t){let r=await Qh("https://codeload.github.com/vercel/turbo/tar.gz/main","turbo-ct-example");await ou.default.x({file:r,cwd:e,strip:2+t.split("/").length,filter:n=>n.includes(`turbo-main/examples/${t}/`)}),await mn.promises.unlink(r)}j();var Ni=Se(require("fs-extra"));async function Zh(e){try{return await Ni.default.access(e,(Ni.default.constants||Ni.default).W_OK),!0}catch{return!1}}j();var MR=new Set(["basic","default"]);function Bi(e){return MR.has(e)}var au=class extends Error{};async function zh({appPath:e,example:t,examplePath:r}){let n,i,u=Bi(t);try{i=new URL(t)}catch(E){E.code!=="ERR_INVALID_URL"&&(Pe(E),process.exit(1))}i?(i.origin!=="https://github.com"&&(Pe(`Invalid URL: ${Ct.default.red(`"${t}"`)}. Only GitHub repositories are supported. Please use a GitHub URL and try again.`),process.exit(1)),n=await Yh(i,r),n||(Pe(`Unable to fetch repository information from: ${Ct.default.red(`"${t}"`)}. Please fix the URL and try again.`),process.exit(1)),await Kh(n)||(Pe(`Could not locate the repository for ${Ct.default.red(`"${t}"`)}. Please check that the repository exists and try again.`),process.exit(1))):await Vh(t)||(Pe(`Could not locate an example named ${Ct.default.red(`"${t}"`)}. It could be due to the following:
|
123
123
|
`,`1. Your spelling of example ${Ct.default.red(`"${t}"`)} might be incorrect.
|
124
124
|
`,"2. You might not be connected to the internet or you are behind a proxy."),process.exit(1));let s=$r.default.resolve(e);await Zh($r.default.dirname(s))||(Pe("The application path is not writable, please check folder permissions and try again."),Pe("It is likely you do not have write permissions for this folder."),process.exit(1));let o=$r.default.basename(s);try{await Mi.default.mkdir(s,{recursive:!0})}catch(E){Pe("Unable to create project directory"),console.error(E),process.exit(1)}let{isEmpty:a,conflicts:c}=Li(s);a||(Pe(`${Ct.default.dim(s)} has ${c.length} conflicting ${c.length===1?"file":"files"} - please try a different location`),process.exit(1));let p=process.cwd();process.chdir(s);let l=Sn("Downloading files...");try{n?(console.log(`
|
125
125
|
Downloading files from repo ${Ct.default.cyan(t)}. This might take a moment.`),console.log(),l.start(),await(0,su.default)(()=>Xh(s,n),{retries:3})):(console.log(`
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "create-turbo",
|
3
|
-
"version": "1.9.0",
|
3
|
+
"version": "1.9.2-canary.0",
|
4
4
|
"description": "Create a new Turborepo",
|
5
5
|
"homepage": "https://turbo.build/repo",
|
6
6
|
"license": "MPL-2.0",
|
@@ -32,7 +32,7 @@
|
|
32
32
|
"update-check": "^1.5.4"
|
33
33
|
},
|
34
34
|
"devDependencies": {
|
35
|
-
"@turbo/workspaces": "1.9.0",
|
35
|
+
"@turbo/workspaces": "1.9.2-canary.0",
|
36
36
|
"@types/async-retry": "^1.4.5",
|
37
37
|
"@types/cross-spawn": "^6.0.2",
|
38
38
|
"@types/fs-extra": "^9.0.13",
|
@@ -47,10 +47,10 @@
|
|
47
47
|
"jest": "^27.4.3",
|
48
48
|
"strip-ansi": "^6.0.1",
|
49
49
|
"ts-jest": "^27.1.1",
|
50
|
-
"tsconfig": "0.0.0",
|
50
|
+
"@turbo/tsconfig": "0.0.0",
|
51
51
|
"tsup": "^5.10.3",
|
52
|
-
"turbo
|
53
|
-
"turbo
|
52
|
+
"@turbo/utils": "0.0.0",
|
53
|
+
"@turbo/test-utils": "0.0.0",
|
54
54
|
"typescript": "^4.5.5"
|
55
55
|
},
|
56
56
|
"files": [
|