create-redmix-app 9.0.0-canary.532 → 9.0.0-canary.536
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/create-redmix-app.js +2 -2
- package/package.json +4 -4
- package/templates/js/api/package.json +2 -2
- package/templates/js/package.json +2 -2
- package/templates/js/web/package.json +4 -4
- package/templates/ts/api/package.json +2 -2
- package/templates/ts/package.json +2 -2
- package/templates/ts/web/package.json +4 -4
@@ -579,14 +579,14 @@ Bus `);for(let a=1;a<o.length;a++){let u=ble(o[a]);t.push(u)}}r&&r(t),e(t)}),vle
|
|
579
579
|
`)}rowToString(e,t){return this.rasterize(e).forEach((n,s)=>{let i="";n.forEach((o,a)=>{let{width:u}=e[a],c=this.negatePadding(e[a]),l=o;if(c>kr.stringWidth(o)&&(l+=" ".repeat(c-kr.stringWidth(o))),e[a].align&&e[a].align!=="left"&&this.wrap){let p=PK[e[a].align];l=p(l,c),kr.stringWidth(l)<c&&(l+=" ".repeat((u||0)-kr.stringWidth(l)-1))}let f=e[a].padding||[0,0,0,0];f[Ap]&&(i+=" ".repeat(f[Ap])),i+=oR(e[a],l,"| "),i+=l,i+=oR(e[a],l," |"),f[yp]&&(i+=" ".repeat(f[yp])),s===0&&t.length>0&&(i=this.renderInline(i,t[t.length-1]))}),t.push({text:i.replace(/ +$/,""),span:e.span})}),t}renderInline(e,t){let n=e.match(/^ */),s=n?n[0].length:0,i=t.text,o=kr.stringWidth(i.trimRight());return t.span?this.wrap?s<o?e:(t.hidden=!0,i.trimRight()+" ".repeat(s-o)+e.trimLeft()):(t.hidden=!0,i+e):e}rasterize(e){let t=[],n=this.columnWidths(e),s;return e.forEach((i,o)=>{i.width=n[o],this.wrap?s=kr.wrap(i.text,this.negatePadding(i),{hard:!0}).split(`
|
580
580
|
`):s=i.text.split(`
|
581
581
|
`),i.border&&(s.unshift("."+"-".repeat(this.negatePadding(i)+2)+"."),s.push("'"+"-".repeat(this.negatePadding(i)+2)+"'")),i.padding&&(s.unshift(...new Array(i.padding[IK]||0).fill("")),s.push(...new Array(i.padding[RK]||0).fill(""))),s.forEach((a,u)=>{t[u]||t.push([]);let c=t[u];for(let l=0;l<o;l++)c[l]===void 0&&c.push("");c.push(a)})}),t}negatePadding(e){let t=e.width||0;return e.padding&&(t-=(e.padding[Ap]||0)+(e.padding[yp]||0)),e.border&&(t-=4),t}columnWidths(e){if(!this.wrap)return e.map(o=>o.width||kr.stringWidth(o.text));let t=e.length,n=this.width,s=e.map(o=>{if(o.width)return t--,n-=o.width,o.width}),i=t?Math.floor(n/t):0;return s.map((o,a)=>o===void 0?Math.max(i,bK(e[a])):o)}};function oR(r,e,t){return r.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?t:" ":""}function bK(r){let e=r.padding||[],t=1+(e[Ap]||0)+(e[yp]||0);return r.border?t+4:t}function LK(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function NK(r,e){r=r.trim();let t=kr.stringWidth(r);return t<e?" ".repeat(e-t)+r:r}function MK(r,e){r=r.trim();let t=kr.stringWidth(r);return t>=e?r:" ".repeat(e-t>>1)+r}var kr;function aR(r,e){return kr=e,new O_({width:r?.width||LK(),wrap:r?.wrap})}var uR=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function v_(r){return r.replace(uR,"")}function cR(r,e){let[t,n]=r.match(uR)||["",""];r=v_(r);let s="";for(let i=0;i<r.length;i++)i!==0&&i%e===0&&(s+=`
|
582
|
-
`),s+=r.charAt(i);return t&&n&&(s=`${t}${s}${n}`),s}function D_(r){return aR(r,{stringWidth:e=>[...e].length,stripAnsi:v_,wrap:cR})}import{dirname as lR,resolve as fR}from"path";import{readdirSync as xK,statSync as UK}from"fs";function pR(r,e){let t=fR(".",r),n;for(UK(t).isDirectory()||(t=lR(t));;){if(n=e(t,xK(t)),n)return fR(t,n);if(t=lR(n=t),n===t)break}}import{inspect as $K}from"util";import{readFileSync as WK}from"fs";import{fileURLToPath as YK}from"url";import{basename as XK,dirname as KK,extname as zK,relative as JK,resolve as gR}from"path";import{readFileSync as VK,statSync as BK,writeFile as FK}from"fs";import{format as jK}from"util";import{resolve as GK}from"path";var dR={fs:{readFileSync:VK,writeFile:FK},format:jK,resolve:GK,exists:r=>{try{return BK(r).isFile()}catch{return!1}}};var Pn,C_=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let t=e.shift(),n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]=t,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),Pn.format.apply(Pn.format,[this.cache[this.locale][t]||t].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),t=e.shift(),n=e.shift(),s=e.shift(),i=function(){};typeof e[e.length-1]=="function"&&(i=e.pop()),this.cache[this.locale]||this._readLocaleFile();let o=s===1?t:n;this.cache[this.locale][t]&&(o=this.cache[this.locale][t][s===1?"one":"other"]),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]={one:t,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i();let a=[o];return~o.indexOf("%d")&&a.push(s),Pn.format.apply(Pn.format,a.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.cache[this.locale][t]=e[t])}_taggedLiteral(e,...t){let n="";return e.forEach(function(s,i){let o=t[i+1];n+=s,typeof o<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,t=this.writeQueue[0],n=t.directory,s=t.locale,i=t.cb,o=this._resolveLocaleFile(n,s),a=JSON.stringify(this.cache[s],null,2);Pn.fs.writeFile(o,a,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),i(u)})}_readLocaleFile(){let e={},t=this._resolveLocaleFile(this.directory,this.locale);try{Pn.fs.readFileSync&&(e=JSON.parse(Pn.fs.readFileSync(t,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+t),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let n=Pn.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~t.lastIndexOf("_")){let s=Pn.resolve(e,"./",t.split("_")[0]+".json");this._fileExistsSync(s)&&(n=s)}return n}_fileExistsSync(e){return Pn.exists(e)}};function hR(r,e){Pn=e;let t=new C_(r);return{__:t.__.bind(t),__n:t.__n.bind(t),setLocale:t.setLocale.bind(t),getLocale:t.getLocale.bind(t),updateLocale:t.updateLocale.bind(t),locale:t.locale}}var qK=r=>hR(r,dR),mR=qK;var QK="require is not supported by ESM",ER="loading a directory of commands is not supported yet for ESM",Vc;try{Vc=YK(import.meta.url)}catch{Vc=process.cwd()}var ZK=Vc.substring(0,Vc.lastIndexOf("node_modules")),ez={assert:{notStrictEqual:kK,strictEqual:HK},cliui:D_,findUp:pR,getEnv:r=>process.env[r],inspect:$K,getCallerFile:()=>{throw new Qs(ER)},getProcessArgvBin:eR,mainFilename:ZK||process.cwd(),Parser:Uc,path:{basename:XK,dirname:KK,extname:zK,relative:JK,resolve:gR},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(r,e)=>process.emitWarning(r,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:WK,require:()=>{throw new Qs(QK)},requireDirectory:()=>{throw new Qs(ER)},stringWidth:r=>[...r].length,y18n:mR({directory:gR(Vc,"../../../locales"),updateFiles:!1})};var Wb=Or($b(),1),{applyExtends:uJ,cjsPlatformShim:cJ,Parser:lJ,processArgv:fJ,Yargs:jp}=Wb.default;jp.applyExtends=(r,e,t)=>uJ(r,e,t,cJ);jp.hideBin=fJ.hideBin;jp.Parser=lJ;var Yb=jp;var it=Or(wM(),1);var id="create-redmix-app",sd="9.0.0-canary.
|
582
|
+
`),s+=r.charAt(i);return t&&n&&(s=`${t}${s}${n}`),s}function D_(r){return aR(r,{stringWidth:e=>[...e].length,stripAnsi:v_,wrap:cR})}import{dirname as lR,resolve as fR}from"path";import{readdirSync as xK,statSync as UK}from"fs";function pR(r,e){let t=fR(".",r),n;for(UK(t).isDirectory()||(t=lR(t));;){if(n=e(t,xK(t)),n)return fR(t,n);if(t=lR(n=t),n===t)break}}import{inspect as $K}from"util";import{readFileSync as WK}from"fs";import{fileURLToPath as YK}from"url";import{basename as XK,dirname as KK,extname as zK,relative as JK,resolve as gR}from"path";import{readFileSync as VK,statSync as BK,writeFile as FK}from"fs";import{format as jK}from"util";import{resolve as GK}from"path";var dR={fs:{readFileSync:VK,writeFile:FK},format:jK,resolve:GK,exists:r=>{try{return BK(r).isFile()}catch{return!1}}};var Pn,C_=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let t=e.shift(),n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]=t,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),Pn.format.apply(Pn.format,[this.cache[this.locale][t]||t].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),t=e.shift(),n=e.shift(),s=e.shift(),i=function(){};typeof e[e.length-1]=="function"&&(i=e.pop()),this.cache[this.locale]||this._readLocaleFile();let o=s===1?t:n;this.cache[this.locale][t]&&(o=this.cache[this.locale][t][s===1?"one":"other"]),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]={one:t,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i();let a=[o];return~o.indexOf("%d")&&a.push(s),Pn.format.apply(Pn.format,a.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.cache[this.locale][t]=e[t])}_taggedLiteral(e,...t){let n="";return e.forEach(function(s,i){let o=t[i+1];n+=s,typeof o<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,t=this.writeQueue[0],n=t.directory,s=t.locale,i=t.cb,o=this._resolveLocaleFile(n,s),a=JSON.stringify(this.cache[s],null,2);Pn.fs.writeFile(o,a,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),i(u)})}_readLocaleFile(){let e={},t=this._resolveLocaleFile(this.directory,this.locale);try{Pn.fs.readFileSync&&(e=JSON.parse(Pn.fs.readFileSync(t,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+t),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let n=Pn.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~t.lastIndexOf("_")){let s=Pn.resolve(e,"./",t.split("_")[0]+".json");this._fileExistsSync(s)&&(n=s)}return n}_fileExistsSync(e){return Pn.exists(e)}};function hR(r,e){Pn=e;let t=new C_(r);return{__:t.__.bind(t),__n:t.__n.bind(t),setLocale:t.setLocale.bind(t),getLocale:t.getLocale.bind(t),updateLocale:t.updateLocale.bind(t),locale:t.locale}}var qK=r=>hR(r,dR),mR=qK;var QK="require is not supported by ESM",ER="loading a directory of commands is not supported yet for ESM",Vc;try{Vc=YK(import.meta.url)}catch{Vc=process.cwd()}var ZK=Vc.substring(0,Vc.lastIndexOf("node_modules")),ez={assert:{notStrictEqual:kK,strictEqual:HK},cliui:D_,findUp:pR,getEnv:r=>process.env[r],inspect:$K,getCallerFile:()=>{throw new Qs(ER)},getProcessArgvBin:eR,mainFilename:ZK||process.cwd(),Parser:Uc,path:{basename:XK,dirname:KK,extname:zK,relative:JK,resolve:gR},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(r,e)=>process.emitWarning(r,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:WK,require:()=>{throw new Qs(QK)},requireDirectory:()=>{throw new Qs(ER)},stringWidth:r=>[...r].length,y18n:mR({directory:gR(Vc,"../../../locales"),updateFiles:!1})};var Wb=Or($b(),1),{applyExtends:uJ,cjsPlatformShim:cJ,Parser:lJ,processArgv:fJ,Yargs:jp}=Wb.default;jp.applyExtends=(r,e,t)=>uJ(r,e,t,cJ);jp.hideBin=fJ.hideBin;jp.Parser=lJ;var Yb=jp;var it=Or(wM(),1);var id="create-redmix-app",sd="9.0.0-canary.536+c8037544a";Ae();Ae();var I6=Or(N4(),1),UO=Or(du(),1),Dg=Or(L5(),1),ff=Or(ri(),1),R6=Or(U5(),1),b6=Or(B5(),1),VO=Or(w6(),1);var ur=[];for(let r=0;r<256;++r)ur.push((r+256).toString(16).slice(1));function P6(r,e=0){return(ur[r[e+0]]+ur[r[e+1]]+ur[r[e+2]]+ur[r[e+3]]+"-"+ur[r[e+4]]+ur[r[e+5]]+"-"+ur[r[e+6]]+ur[r[e+7]]+"-"+ur[r[e+8]]+ur[r[e+9]]+"-"+ur[r[e+10]]+ur[r[e+11]]+ur[r[e+12]]+ur[r[e+13]]+ur[r[e+14]]+ur[r[e+15]]).toLowerCase()}import Tfe from"node:crypto";var Og=new Uint8Array(256),Ag=Og.length;function NO(){return Ag>Og.length-16&&(Tfe.randomFillSync(Og),Ag=0),Og.slice(Ag,Ag+=16)}import yfe from"node:crypto";var MO={randomUUID:yfe.randomUUID};function Afe(r,e,t){if(MO.randomUUID&&!e&&!r)return MO.randomUUID();r=r||{};let n=r.random||(r.rng||NO)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){t=t||0;for(let s=0;s<16;++s)e[t+s]=n[s];return e}return P6(n)}var xO=Afe;var vg,BO,FO,jO=xO();async function L6(){cc.setLogger(new Ef,jt.ERROR);let r=JSON.parse(await b6.default.run({System:["OS","Shell"],Binaries:["Node","Yarn","npm"],npmPackages:"@redmix/*",IDEs:["VSCode"]},{json:!0})),e=r.System?.Shell;e?.path?.match("/")?r.System.Shell.name=r.System.Shell.path.split("/").pop():e?.path.match("\\")&&(r.System.Shell.name=r.System.Shell.path.split("\\").pop());let t=await VO.default.cpu(),n=await VO.default.mem(),s;Object.keys(process.env).some(o=>o.startsWith("GITPOD_"))&&(s="gitpod");let i=UO.Resource.default().merge(new UO.Resource({[ff.SemanticResourceAttributes.SERVICE_NAME]:id,[ff.SemanticResourceAttributes.SERVICE_VERSION]:sd,[ff.SemanticResourceAttributes.OS_TYPE]:r.System?.OS?.split(" ")[0],[ff.SemanticResourceAttributes.OS_VERSION]:r.System?.OS?.split(" ")[1],"shell.name":r.System?.Shell?.name,"node.version":r.Binaries?.Node?.version,"yarn.version":r.Binaries?.Yarn?.version,"npm.version":r.Binaries?.npm?.version,"vscode.version":r.IDEs?.VSCode?.version,"cpu.count":t.physicalCores,"memory.gb":Math.round(n.total/1073741824),"env.node_env":process.env.NODE_ENV||null,"ci.redwood":!!process.env.REDWOOD_CI,"ci.isci":R6.default.isCI,"dev.environment":s,uid:jO}));vg=new Dg.NodeTracerProvider({resource:i}),FO=new I6.OTLPTraceExporter({url:process.env.REDWOOD_REDIRECT_TELEMETRY||"https://quark.quantumparticle.io/v1/traces"}),BO=new Dg.BatchSpanProcessor(FO),vg.addSpanProcessor(BO),vg.register(),process.on("SIGTERM",async()=>{await rr()})}async function rr(){try{lc.trace.getActiveSpan()?.end(),await vg?.shutdown(),await BO?.shutdown(),await FO?.shutdown()}catch{}}function Tr(r){lc.trace.getActiveSpan()?.setStatus({code:xi.ERROR,message:r.toString().split(`
|
583
583
|
`)[0]}),lc.trace.getActiveSpan()?.recordException(r)}var M6="Initial commit",{telemetry:vfe}=Uc(Ep(process.argv),{boolean:["telemetry"],default:{telemetry:process.env.REDWOOD_DISABLE_TELEMETRY===void 0||process.env.REDWOOD_DISABLE_TELEMETRY===""}}),He=new it.RedwoodTUI;function Dfe(){let{npm_config_user_agent:r}=process.env;if(r){let e=r.match(/yarn\/(\d+)/);if(e&&e[1])return parseInt(e[1],10)>=2}return!1}async function Cfe(r){let e=new it.ReactiveTUIContent({mode:"text",content:"Checking node and yarn compatibility",spinner:{enabled:!0}});He.startReactive(e);let[t,n]=await wfe(r);if(t){e.update({spinner:{enabled:!1},content:`${it.RedwoodStyling.green("\u2714")} Compatibility checks passed`}),He.stopReactive();return}if(!t){GO.default.lt(n.node.version.version,GO.default.minVersion(n.node.wanted.raw))&&(He.stopReactive(!0),He.displayError("Compatibility checks failed",[" You need to upgrade the version of node you're using.",` You're using ${n.node.version.version} and we currently support node ${n.node.wanted.range}.`,""," Please use tools like nvm or corepack to change to a compatible version.",` See: ${(0,pf.default)("How to - Using nvm","https://redwoodjs.com/docs/how-to/using-nvm",{fallback:()=>"How to - Using nvm https://redwoodjs.com/docs/how-to/using-nvm"})}`,` See: ${(0,pf.default)("Tutorial - Prerequisites","https://redwoodjs.com/docs/tutorial/chapter1/prerequisites",{fallback:()=>"Tutorial - Prerequisites https://redwoodjs.com/docs/tutorial/chapter1/prerequisites"})}`].join(`
|
584
584
|
`)),Tr("Compatibility checks failed"),await rr(),process.exit(1)),He.stopReactive(!0),He.displayWarning("Compatibility checks failed",[" You may want to downgrade the version of node you're using.",` You're using ${n.node.version.version} and we currently support node ${n.node.wanted.range}.`,""," This may make your project incompatible with some deploy targets, especially those using AWS Lambdas.",""," Please use tools like nvm or corepack to change to a compatible version.",` See: ${(0,pf.default)("How to - Use nvm","https://redwoodjs.com/docs/how-to/using-nvm",{fallback:()=>"How to - Use nvm https://redwoodjs.com/docs/how-to/using-nvm"})}`,` See: ${(0,pf.default)("Tutorial - Prerequisites","https://redwoodjs.com/docs/tutorial/chapter1/prerequisites",{fallback:()=>"Tutorial - Prerequisites https://redwoodjs.com/docs/tutorial/chapter1/prerequisites"})}`].join(`
|
585
585
|
`));try{(await He.prompt({type:"select",name:"override-engine-error",message:"How would you like to proceed?",choices:["Override error and continue install","Quit install"],initial:0}))["override-engine-error"]==="Quit install"&&(Tr("User quit after engine check error"),await rr(),process.exit(0))}catch{Tr("User cancelled install at engine check error"),await rr(),process.exit(1)}}}function wfe(r){return new Promise(e=>{let{engines:t}=pi.default.readJSONSync(kn.join(r,"package.json"));(0,N6.default)(t,(n,s)=>e([s.isSatisfied,s.versions]))})}async function Pfe(r,{templateDir:e,overwrite:t}){let n=r,s=new it.ReactiveTUIContent({mode:"text",content:"Creating project files",spinner:{enabled:!0}});return He.startReactive(s),n=await qO(n,{overwrite:t}),pi.default.ensureDirSync(kn.dirname(n)),pi.default.copySync(e,n,{overwrite:t}),pi.default.renameSync(kn.join(n,"gitignore.template"),kn.join(n,".gitignore")),pi.default.ensureDirSync(kn.join(n,".redwood")),pi.default.writeFileSync(kn.join(n,".redwood","telemetry.txt"),jO),s.update({spinner:{enabled:!1},content:`${it.RedwoodStyling.green("\u2714")} Project files created`}),He.stopReactive(),n}async function Ife(r){let e=new it.ReactiveTUIContent({mode:"text",header:"Installing node modules",content:" \u23F1 This could take a while...",spinner:{enabled:!0}});He.startReactive(e);let t=process.cwd();process.chdir(r);let n=(0,Cg.default)("yarn install",{shell:!0,cwd:r});try{await n}catch(s){He.stopReactive(!0),He.displayError("Couldn't install node modules",[`We couldn't install node modules via ${it.RedwoodStyling.info("'yarn install'")}. Please see below for the full error message.`,"",s].join(`
|
586
586
|
`)),Tr(s),await rr(),process.chdir(t),process.exit(1)}process.chdir(t),e.update({header:"",content:`${it.RedwoodStyling.green("\u2714")} Installed node modules`,spinner:{enabled:!1}}),He.stopReactive()}async function Rfe(r){let e=new it.ReactiveTUIContent({mode:"text",content:"Generating types",spinner:{enabled:!0}});He.startReactive(e);let t=(0,Cg.default)("yarn rw-gen",{shell:!0,cwd:r});try{await t}catch(n){He.stopReactive(!0),He.displayError("Couldn't generate types",[`We could not generate types using ${it.RedwoodStyling.info("'yarn rw-gen'")}. Please see below for the full error message.`,"",n].join(`
|
587
587
|
`)),Tr(n),await rr(),process.exit(1)}e.update({content:`${it.RedwoodStyling.green("\u2714")} Generated types`,spinner:{enabled:!1}}),He.stopReactive()}async function bfe(r,e){let t=new it.ReactiveTUIContent({mode:"text",content:"Initializing a git repo",spinner:{enabled:!0}});He.startReactive(t);let n=(0,Cg.default)(`git init && git add . && git commit -m "${e}"`,{shell:!0,cwd:r});try{await n}catch(s){He.stopReactive(!0),He.displayError("Couldn't initialize a git repo",[`We could not initialize a git repo using ${it.RedwoodStyling.info(`git init && git add . && git commit -m "${e}"`)}. Please see below for the full error message.`,"",s].join(`
|
588
588
|
`)),Tr(s),await rr(),process.exit(1)}t.update({content:`${it.RedwoodStyling.green("\u2714")} Initialized a git repo with commit message "${e}"`,spinner:{enabled:!1}}),He.stopReactive()}async function Lfe(r){if(r){let e=r==="."?"the current directory":r;return He.drawText(`${it.RedwoodStyling.green("\u2714")} Creating your Redwood app in ${e} based on command line argument`),r}try{let e=await He.prompt({type:"input",name:"targetDir",message:"Where would you like to create your Redwood app?",initial:"my-redwood-app"});return/^~\w/.test(e.targetDir)&&(He.stopReactive(!0),He.displayError("The `~username` syntax is not supported here","Please use the full path or specify the target directory on the command line."),Tr("Target dir prompt path syntax not supported"),await rr(),process.exit(1)),(0,kO.default)(e.targetDir)}catch{Tr("User cancelled install at target dir prompt"),await rr(),process.exit(1)}}async function Nfe(r){if(r!==null)return He.drawText(`${it.RedwoodStyling.green("\u2714")} Using ${r?"TypeScript":"JavaScript"} based on command line flag`),r;try{return(await He.prompt({type:"Select",name:"language",choices:["TypeScript","JavaScript"],message:"Select your preferred language",initial:"TypeScript"})).language==="TypeScript"}catch{Tr("User cancelled install at language prompt"),await rr(),process.exit(1)}}async function Mfe(r){if(r!==null)return He.drawText(`${it.RedwoodStyling.green("\u2714")} ${r?"Will":"Will not"} initialize a git repo based on command line flag`),r;try{return(await He.prompt({type:"Toggle",name:"git",message:"Do you want to initialize a git repo?",enabled:"Yes",disabled:"no",initial:"Yes"})).git}catch{Tr("User cancelled install at git prompt"),await rr(),process.exit(1)}}async function qO(r,{overwrite:e,suppressWarning:t}){let n=r;if(pi.default.existsSync(n)&&!e&&pi.default.readdirSync(n).length>0){let s=it.RedwoodStyling.info(n);t||(He.stopReactive(!0),He.displayWarning("Project directory already contains files",[`'${s}' already exists and is not empty`].join(`
|
589
|
-
`)));try{let i=await He.prompt({type:"select",name:"projectDirectoryAlreadyExists",message:"How would you like to proceed?",choices:["Quit install",`Overwrite files in '${s}' and continue install`,"Specify a different directory"],initial:0});if(i.projectDirectoryAlreadyExists===`Overwrite files in '${s}' and continue install`)await pi.default.remove(n);else if(i.projectDirectoryAlreadyExists==="Specify a different directory"){let o=await xfe();/^~\w/.test(o)?(He.stopReactive(!0),He.displayError("The `~username` syntax is not supported here","Please use the full path or specify the target directory on the command line."),n=await qO(r,{overwrite:e,suppressWarning:!0})):n=kn.resolve(process.cwd(),(0,kO.default)(o)),n=await qO(n,{overwrite:e})}else i.projectDirectoryAlreadyExists==="Quit install"&&(Tr("User quit after directory already exists error"),await rr(),process.exit(1))}catch{Tr("User cancelled install after directory already exists error"),await rr(),process.exit(1)}}return n}async function xfe(){try{return(await He.prompt({type:"input",name:"targetDirectoryInput",message:"What directory would you like to create the app in?",initial:"my-redwood-app"})).targetDirectoryInput}catch{Tr("User cancelled install at specify a different directory prompt"),await rr(),process.exit(1)}}async function Ufe(r){if(r!==null)return r;try{return(await He.prompt({type:"input",name:"commitMessage",message:"Enter a commit message",initial:M6})).commitMessage}catch{Tr("User cancelled install at commit message prompt"),await rr(),process.exit(1)}}async function Vfe(r){if(r!==null)return He.drawText(`${it.RedwoodStyling.green("\u2714")} ${r?"Will":"Will not"} run yarn install based on command line flag`),r;try{return(await He.prompt({type:"Toggle",name:"yarnInstall",message:"Do you want to run yarn install?",enabled:"Yes",disabled:"no",initial:"Yes"})).yarnInstall}catch{Tr("User cancelled install at yarn install prompt"),await rr(),process.exit(1)}}async function Bfe(){let r=Yb(Ep(process.argv)).scriptName(id).usage("Usage: $0 <project directory>").example("$0 my-redwood-app").version(sd).option("yes",{alias:"y",default:null,type:"boolean",describe:"Skip prompts and use defaults"}).option("overwrite",{default:!1,type:"boolean",describe:"Create even if target directory isn't empty"}).option("typescript",{alias:"ts",default:null,type:"boolean",describe:"Generate a TypeScript project"}).option("git-init",{alias:"git",default:null,type:"boolean",describe:"Initialize a git repository"}).option("commit-message",{alias:"m",default:null,type:"string",describe:"Commit message for the initial commit"}).option("telemetry",{default:!0,type:"boolean",describe:"Enables sending telemetry events for this create command and all Redwood CLI commands https://telemetry.redwoodjs.com"}),e=Dfe();e&&r.option("yarn-install",{default:null,type:"boolean",describe:"Install node modules. Skip via --no-yarn-install."});let t=r.parse();He.drawText([`${it.RedwoodStyling.redwood("-".repeat(66))}`,`${" ".repeat(
|
589
|
+
`)));try{let i=await He.prompt({type:"select",name:"projectDirectoryAlreadyExists",message:"How would you like to proceed?",choices:["Quit install",`Overwrite files in '${s}' and continue install`,"Specify a different directory"],initial:0});if(i.projectDirectoryAlreadyExists===`Overwrite files in '${s}' and continue install`)await pi.default.remove(n);else if(i.projectDirectoryAlreadyExists==="Specify a different directory"){let o=await xfe();/^~\w/.test(o)?(He.stopReactive(!0),He.displayError("The `~username` syntax is not supported here","Please use the full path or specify the target directory on the command line."),n=await qO(r,{overwrite:e,suppressWarning:!0})):n=kn.resolve(process.cwd(),(0,kO.default)(o)),n=await qO(n,{overwrite:e})}else i.projectDirectoryAlreadyExists==="Quit install"&&(Tr("User quit after directory already exists error"),await rr(),process.exit(1))}catch{Tr("User cancelled install after directory already exists error"),await rr(),process.exit(1)}}return n}async function xfe(){try{return(await He.prompt({type:"input",name:"targetDirectoryInput",message:"What directory would you like to create the app in?",initial:"my-redwood-app"})).targetDirectoryInput}catch{Tr("User cancelled install at specify a different directory prompt"),await rr(),process.exit(1)}}async function Ufe(r){if(r!==null)return r;try{return(await He.prompt({type:"input",name:"commitMessage",message:"Enter a commit message",initial:M6})).commitMessage}catch{Tr("User cancelled install at commit message prompt"),await rr(),process.exit(1)}}async function Vfe(r){if(r!==null)return He.drawText(`${it.RedwoodStyling.green("\u2714")} ${r?"Will":"Will not"} run yarn install based on command line flag`),r;try{return(await He.prompt({type:"Toggle",name:"yarnInstall",message:"Do you want to run yarn install?",enabled:"Yes",disabled:"no",initial:"Yes"})).yarnInstall}catch{Tr("User cancelled install at yarn install prompt"),await rr(),process.exit(1)}}async function Bfe(){let r=Yb(Ep(process.argv)).scriptName(id).usage("Usage: $0 <project directory>").example("$0 my-redwood-app").version(sd).option("yes",{alias:"y",default:null,type:"boolean",describe:"Skip prompts and use defaults"}).option("overwrite",{default:!1,type:"boolean",describe:"Create even if target directory isn't empty"}).option("typescript",{alias:"ts",default:null,type:"boolean",describe:"Generate a TypeScript project"}).option("git-init",{alias:"git",default:null,type:"boolean",describe:"Initialize a git repository"}).option("commit-message",{alias:"m",default:null,type:"string",describe:"Commit message for the initial commit"}).option("telemetry",{default:!0,type:"boolean",describe:"Enables sending telemetry events for this create command and all Redwood CLI commands https://telemetry.redwoodjs.com"}),e=Dfe();e&&r.option("yarn-install",{default:null,type:"boolean",describe:"Install node modules. Skip via --no-yarn-install."});let t=r.parse();He.drawText([`${it.RedwoodStyling.redwood("-".repeat(66))}`,`${" ".repeat(18)}\u{1F332}\u26A1\uFE0F ${it.RedwoodStyling.header("Welcome to Redmix!")} \u26A1\uFE0F\u{1F332}`,`${it.RedwoodStyling.redwood("-".repeat(66))}`].join(`
|
590
590
|
`));let n=t._,s=t["yarn-install"]??(e?t.yes:null),i=t.typescript??t.yes,o=t.overwrite,a=t["git-init"]??t.yes,u=t["commit-message"]??(t.yes?M6:null);Yn.getActiveSpan()?.setAttribute("yarn-install",s),Yn.getActiveSpan()?.setAttribute("overwrite",o);let c=String(n).replace(/,/g,"-"),l=Ofe(new URL("../templates",import.meta.url));await Cfe(kn.join(l,"ts")),c=await Lfe(c);let f=await Nfe(i);Yn.getActiveSpan()?.setAttribute("typescript",f);let p=kn.join(l,f?"ts":"js"),d=await Mfe(a);Yn.getActiveSpan()?.setAttribute("git",d);let m;d&&(m=await Ufe(u));let g=!1;e&&(g=await Vfe(s));let h=kn.resolve(process.cwd(),c);if(h=await Pfe(h,{templateDir:p,overwrite:o}),g){let S=Date.now();await Ife(h),Yn.getActiveSpan()?.setAttribute("yarn-install-time",Date.now()-S)}else e&&He.drawText(`${it.RedwoodStyling.info("\u2139")} Skipped yarn install step`);g&&await Rfe(h),d&&await bfe(h,m);let E=h!==process.cwd();He.drawText(["",it.RedwoodStyling.success("Thanks for trying out Redwood!"),"",` \u26A1\uFE0F ${it.RedwoodStyling.redwood("Get up and running fast with this Quick Start guide")}: https://redwoodjs.com/quick-start`,"",`${it.RedwoodStyling.header("Fire it up!")} \u{1F680}`,"",...[E&&`${it.RedwoodStyling.redwood(` > ${it.RedwoodStyling.green(`cd ${kn.relative(process.cwd(),h)}`)}`)}`,!g&&`${it.RedwoodStyling.redwood(` > ${it.RedwoodStyling.green("yarn install")}`)}`,`${it.RedwoodStyling.redwood(` > ${it.RedwoodStyling.green("yarn rw dev")}`)}`].filter(Boolean),""].join(`
|
591
591
|
`))}if(vfe)try{await L6()}catch(r){console.error("Telemetry startup error"),console.error(r)}var Ffe=Yn.getTracer("redwoodjs");await Ffe.startActiveSpan("create-redmix-app",async r=>{await Bfe(),r?.setStatus({code:xi.OK}),r?.end()});try{await rr()}catch(r){console.error("Telemetry shutdown error"),console.error(r)}
|
592
592
|
/*! Bundled license information:
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "create-redmix-app",
|
3
|
-
"version": "9.0.0-canary.
|
3
|
+
"version": "9.0.0-canary.536+c8037544a",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "git+https://github.com/redmix-run/redmix.git",
|
@@ -31,8 +31,8 @@
|
|
31
31
|
"@opentelemetry/resources": "1.22.0",
|
32
32
|
"@opentelemetry/sdk-trace-node": "1.22.0",
|
33
33
|
"@opentelemetry/semantic-conventions": "1.22.0",
|
34
|
-
"@redmix/framework-tools": "9.0.0-canary.
|
35
|
-
"@redmix/tui": "9.0.0-canary.
|
34
|
+
"@redmix/framework-tools": "9.0.0-canary.536",
|
35
|
+
"@redmix/tui": "9.0.0-canary.536",
|
36
36
|
"@types/babel__core": "7.20.5",
|
37
37
|
"chalk": "4.1.2",
|
38
38
|
"check-node-version": "4.2.1",
|
@@ -50,5 +50,5 @@
|
|
50
50
|
"vitest": "2.1.9",
|
51
51
|
"yargs": "17.7.2"
|
52
52
|
},
|
53
|
-
"gitHead": "
|
53
|
+
"gitHead": "c8037544a518f5e6be80d5ef5b09b65d79669ecc"
|
54
54
|
}
|
@@ -7,8 +7,8 @@
|
|
7
7
|
]
|
8
8
|
},
|
9
9
|
"devDependencies": {
|
10
|
-
"@redmix/core": "9.0.0-canary.
|
11
|
-
"@redmix/project-config": "9.0.0-canary.
|
10
|
+
"@redmix/core": "9.0.0-canary.536",
|
11
|
+
"@redmix/project-config": "9.0.0-canary.536"
|
12
12
|
},
|
13
13
|
"eslintConfig": {
|
14
14
|
"extends": "@redmix/eslint-config",
|
@@ -11,14 +11,14 @@
|
|
11
11
|
]
|
12
12
|
},
|
13
13
|
"dependencies": {
|
14
|
-
"@redmix/forms": "9.0.0-canary.
|
15
|
-
"@redmix/router": "9.0.0-canary.
|
16
|
-
"@redmix/web": "9.0.0-canary.
|
14
|
+
"@redmix/forms": "9.0.0-canary.536",
|
15
|
+
"@redmix/router": "9.0.0-canary.536",
|
16
|
+
"@redmix/web": "9.0.0-canary.536",
|
17
17
|
"react": "19.0.0-rc-f2df5694-20240916",
|
18
18
|
"react-dom": "19.0.0-rc-f2df5694-20240916"
|
19
19
|
},
|
20
20
|
"devDependencies": {
|
21
|
-
"@redmix/vite": "9.0.0-canary.
|
21
|
+
"@redmix/vite": "9.0.0-canary.536",
|
22
22
|
"@types/react": "^18.2.55",
|
23
23
|
"@types/react-dom": "^18.2.19"
|
24
24
|
}
|
@@ -7,8 +7,8 @@
|
|
7
7
|
]
|
8
8
|
},
|
9
9
|
"devDependencies": {
|
10
|
-
"@redmix/core": "9.0.0-canary.
|
11
|
-
"@redmix/project-config": "9.0.0-canary.
|
10
|
+
"@redmix/core": "9.0.0-canary.536",
|
11
|
+
"@redmix/project-config": "9.0.0-canary.536"
|
12
12
|
},
|
13
13
|
"eslintConfig": {
|
14
14
|
"extends": "@redmix/eslint-config",
|
@@ -11,14 +11,14 @@
|
|
11
11
|
]
|
12
12
|
},
|
13
13
|
"dependencies": {
|
14
|
-
"@redmix/forms": "9.0.0-canary.
|
15
|
-
"@redmix/router": "9.0.0-canary.
|
16
|
-
"@redmix/web": "9.0.0-canary.
|
14
|
+
"@redmix/forms": "9.0.0-canary.536",
|
15
|
+
"@redmix/router": "9.0.0-canary.536",
|
16
|
+
"@redmix/web": "9.0.0-canary.536",
|
17
17
|
"react": "19.0.0-rc-f2df5694-20240916",
|
18
18
|
"react-dom": "19.0.0-rc-f2df5694-20240916"
|
19
19
|
},
|
20
20
|
"devDependencies": {
|
21
|
-
"@redmix/vite": "9.0.0-canary.
|
21
|
+
"@redmix/vite": "9.0.0-canary.536",
|
22
22
|
"@types/react": "^18.2.55",
|
23
23
|
"@types/react-dom": "^18.2.19"
|
24
24
|
}
|