nx-react-native-cli 3.0.6 → 3.0.7
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/lib/index.cjs
CHANGED
|
@@ -61,7 +61,7 @@ ${m.description}`:"";return`${[a,v,b].filter(Boolean).join(" ")}
|
|
|
61
61
|
${w}${T}${F}${U2.default.cursorHide}`});var F1=S(require("node:readline"),1),P=S(D1(),1),bl=S(b1(),1),_1=S(za(),1),y1=S(Ft(),1),E1={set:(e,r="",t)=>{let n=e;r.split(".").forEach((i,u,o)=>{i==="__proto__"||i==="constructor"||(u===o.length-1?n[i]=t:i in n||(n[i]={}),n=n[i])})},get:(e,r="",t)=>{let n=u=>String.prototype.split.call(r,u).filter(Boolean).reduce((o,a)=>o!=null?o[a]:o,e),i=n(/[,[\]]+?/)||n(/[,.[\]]+?/);return i===void 0||i===e?t:i}};function ml(e,r,t){if(r in e){let n=e[r];if(typeof n=="function")return(0,P.from)((0,bl.default)(n)(t).then(i=>Object.assign(e,{[r]:i})))}return(0,P.of)(e)}var vl=class extends Error{isTtyError=!0};function FS(e={}){e.skipTTYChecks=e.skipTTYChecks===void 0?!0:e.skipTTYChecks;let r=e.input||process.stdin;if(!e.skipTTYChecks&&!r.isTTY)throw new vl("Prompts can not be meaningfully rendered in non-TTY environments");let t=new _1.default;return t.pipe(e.output||process.stdout),{terminal:!0,...e,input:r,output:t}}function _S(e){return Object.values(e).every(r=>typeof r=="object"&&!Array.isArray(r)&&r!=null)}function yS(e){return e.prototype&&"run"in e.prototype&&typeof e.prototype.run=="function"}var hn=class{prompts;answers={};process=P.EMPTY;onClose;opt;rl;constructor(r,t){this.opt=t,this.prompts=r}run(r,t){this.answers=typeof t=="object"?{...t}:{};let n;Array.isArray(r)?n=(0,P.from)(r):(0,P.isObservable)(r)?n=r:_S(r)?n=(0,P.from)(Object.entries(r).map(([u,o])=>Object.assign({},o,{name:u}))):n=(0,P.from)([r]),this.process=n.pipe((0,P.concatMap)(u=>this.processQuestion(u)));let i=(0,P.lastValueFrom)(this.process.pipe((0,P.reduce)((u,o)=>(E1.set(u,o.name,o.answer),u),this.answers))).then(()=>this.onCompletion(),u=>this.onError(u));return Object.assign(i,{ui:this})}onCompletion(){return this.close(),this.answers}onError(r){return this.close(),Promise.reject(r)}processQuestion(r){return r={...r},(0,P.defer)(()=>(0,P.of)(r).pipe((0,P.concatMap)(this.setDefaultType),(0,P.concatMap)(this.filterIfRunnable),(0,P.concatMap)(n=>ml(n,"message",this.answers)),(0,P.concatMap)(n=>ml(n,"default",this.answers)),(0,P.concatMap)(n=>ml(n,"choices",this.answers)),(0,P.concatMap)(n=>("choices"in n&&(n.choices=n.choices.map(i=>typeof i=="string"?{name:i,value:i}:i)),(0,P.of)(n))),(0,P.concatMap)(n=>this.fetchAnswer(n))))}fetchAnswer(r){let t=this.prompts[r.type];if(t==null)throw new Error(`Prompt for type ${r.type} not found`);return yS(t)?(0,P.defer)(()=>{let n=F1.default.createInterface(FS(this.opt));n.resume();let i=()=>{n.removeListener("SIGINT",this.onForceClose),n.setPrompt(""),n.output.unmute(),n.output.write(y1.default.cursorShow),n.output.end(),n.close()};this.onClose=i,this.rl=n,process.on("exit",this.onForceClose),n.on("SIGINT",this.onForceClose);let u=new t(r,n,this.answers);return(0,P.from)(u.run().then(o=>(i(),this.onClose=void 0,this.rl=void 0,{name:r.name,answer:o})))}):(0,P.defer)(()=>(0,P.from)(t(r,this.opt).then(n=>({name:r.name,answer:n}))))}onForceClose=()=>{this.close(),process.kill(process.pid,"SIGINT"),console.log("")};close=()=>{process.removeListener("exit",this.onForceClose),typeof this.onClose=="function"&&this.onClose()};setDefaultType=r=>(this.prompts[r.type]||(r.type="input"),(0,P.defer)(()=>(0,P.of)(r)));filterIfRunnable=r=>{if(r.askAnswered!==!0&&E1.get(this.answers,r.name)!==void 0)return P.EMPTY;let{when:t}=r;return t===!1?P.EMPTY:typeof t!="function"?(0,P.of)(r):(0,P.defer)(()=>(0,P.from)((0,bl.default)(t)(this.answers).then(n=>{if(n)return r})).pipe((0,P.filter)(n=>n!=null)))}};var g1={input:Ys,select:Ki,list:Ki,number:Js,confirm:Ks,rawlist:rc,expand:Zs,checkbox:is,password:tc,editor:zs};function C1(e){function r(t,n){let i=new hn(r.prompts,e);try{return i.run(t,n)}catch(u){let o=Promise.reject(u);return Object.assign(o,{ui:i})}}return r.prompts={...g1},r.registerPrompt=function(t,n){return r.prompts[t]=n,this},r.restoreDefaultPrompts=function(){r.prompts={...g1}},r}var El=C1();function gS(e,r){El.registerPrompt(e,r)}function CS(){El.restoreDefaultPrompts()}var wS={prompt:El,ui:{Prompt:hn},createPromptModule:C1,registerPrompt:gS,restoreDefaultPrompts:CS,Separator:se},ti=wS;var oi=S(require("node:process"),1);var gl=S(require("node:process"),1);var M1=S(require("node:process"),1),I1=S(S1(),1),R1=S(T1(),1),OS=(0,I1.default)(()=>{(0,R1.default)(()=>{M1.default.stderr.write("\x1B[?25h")},{alwaysLast:!0})}),L1=OS;var fa=!1,En={};En.show=(e=gl.default.stderr)=>{e.isTTY&&(fa=!1,e.write("\x1B[?25h"))};En.hide=(e=gl.default.stderr)=>{e.isTTY&&(L1(),fa=!0,e.write("\x1B[?25l"))};En.toggle=(e,r)=>{e!==void 0&&(fa=e),fa?En.show(r):En.hide(r)};var Cl=En;var ai=S(Fi(),1);var Be=S(require("node:process"),1);function wl(){return Be.default.platform!=="win32"?Be.default.env.TERM!=="linux":!!Be.default.env.CI||!!Be.default.env.WT_SESSION||!!Be.default.env.TERMINUS_SUBLIME||Be.default.env.ConEmuTask==="{cmd::Cmder}"||Be.default.env.TERM_PROGRAM==="Terminus-Sublime"||Be.default.env.TERM_PROGRAM==="vscode"||Be.default.env.TERM==="xterm-256color"||Be.default.env.TERM==="alacritty"||Be.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var SS={info:J.blue("\u2139"),success:J.green("\u2714"),warning:J.yellow("\u26A0"),error:J.red("\u2716")},BS={info:J.blue("i"),success:J.green("\u221A"),warning:J.yellow("\u203C"),error:J.red("\xD7")},qS=wl()?SS:BS,ii=qS;function Al({onlyFirst:e=!1}={}){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(r,e?void 0:"g")}var jS=Al();function ui(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(jS,"")}function N1(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function $1(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function U1(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function PS(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function V1(e,{ambiguousAsWide:r=!1}={}){return PS(e),$1(e)||U1(e)||r&&N1(e)?2:1}var G1=S(H1(),1),kS=new Intl.Segmenter,TS=/^\p{Default_Ignorable_Code_Point}$/u;function Ol(e,r={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:t=!0,countAnsiEscapeCodes:n=!1}=r;if(n||(e=ui(e)),e.length===0)return 0;let i=0,u={ambiguousAsWide:!t};for(let{segment:o}of kS.segment(e)){let a=o.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!TS.test(o)){if((0,G1.default)().test(o)){i+=2;continue}i+=V1(a,u)}}return i}function Sl({stream:e=process.stdout}={}){return!!(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}var Re=S(require("node:process"),1);function Bl(){return Re.default.platform!=="win32"?Re.default.env.TERM!=="linux":!!Re.default.env.WT_SESSION||!!Re.default.env.TERMINUS_SUBLIME||Re.default.env.ConEmuTask==="{cmd::Cmder}"||Re.default.env.TERM_PROGRAM==="Terminus-Sublime"||Re.default.env.TERM_PROGRAM==="vscode"||Re.default.env.TERM==="xterm-256color"||Re.default.env.TERM==="alacritty"||Re.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Le=S(require("node:process"),1),MS=3,ql=class{#i=0;start(){this.#i++,this.#i===1&&this.#t()}stop(){if(this.#i<=0)throw new Error("`stop` called more times than `start`");this.#i--,this.#i===0&&this.#e()}#t(){Le.default.platform==="win32"||!Le.default.stdin.isTTY||(Le.default.stdin.setRawMode(!0),Le.default.stdin.on("data",this.#u),Le.default.stdin.resume())}#e(){Le.default.stdin.isTTY&&(Le.default.stdin.off("data",this.#u),Le.default.stdin.pause(),Le.default.stdin.setRawMode(!1))}#u(r){r[0]===MS&&Le.default.emit("SIGINT")}},IS=new ql,jl=IS;var RS=S(Fi(),1),Pl=class{#i=0;#t=!1;#e=0;#u=0;#r;#o;#n;#x;#d;#c;#l;#f;#D;#a;#s;color;constructor(r){typeof r=="string"&&(r={text:r}),this.#r={color:"cyan",stream:oi.default.stderr,discardStdin:!0,hideCursor:!0,...r},this.color=this.#r.color,this.spinner=this.#r.spinner,this.#d=this.#r.interval,this.#n=this.#r.stream,this.#c=typeof this.#r.isEnabled=="boolean"?this.#r.isEnabled:Sl({stream:this.#n}),this.#l=typeof this.#r.isSilent=="boolean"?this.#r.isSilent:!1,this.text=this.#r.text,this.prefixText=this.#r.prefixText,this.suffixText=this.#r.suffixText,this.indent=this.#r.indent,oi.default.env.NODE_ENV==="test"&&(this._stream=this.#n,this._isEnabled=this.#c,Object.defineProperty(this,"_linesToClear",{get(){return this.#i},set(t){this.#i=t}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#u}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}}))}get indent(){return this.#f}set indent(r=0){if(!(r>=0&&Number.isInteger(r)))throw new Error("The `indent` option must be an integer from 0 and up");this.#f=r,this.#p()}get interval(){return this.#d??this.#o.interval??100}get spinner(){return this.#o}set spinner(r){if(this.#u=0,this.#d=void 0,typeof r=="object"){if(r.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#o=r}else if(!Bl())this.#o=ai.default.line;else if(r===void 0)this.#o=ai.default.dots;else if(r!=="default"&&ai.default[r])this.#o=ai.default[r];else throw new Error(`There is no built-in spinner named '${r}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#D}set text(r=""){this.#D=r,this.#p()}get prefixText(){return this.#a}set prefixText(r=""){this.#a=r,this.#p()}get suffixText(){return this.#s}set suffixText(r=""){this.#s=r,this.#p()}get isSpinning(){return this.#x!==void 0}#h(r=this.#a,t=" "){return typeof r=="string"&&r!==""?r+t:typeof r=="function"?r()+t:""}#m(r=this.#s,t=" "){return typeof r=="string"&&r!==""?t+r:typeof r=="function"?t+r():""}#p(){let r=this.#n.columns??80,t=this.#h(this.#a,"-"),n=this.#m(this.#s,"-"),i=" ".repeat(this.#f)+t+"--"+this.#D+"--"+n;this.#e=0;for(let u of ui(i).split(`
|
|
62
62
|
`))this.#e+=Math.max(1,Math.ceil(Ol(u,{countAnsiEscapeCodes:!0})/r))}get isEnabled(){return this.#c&&!this.#l}set isEnabled(r){if(typeof r!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#c=r}get isSilent(){return this.#l}set isSilent(r){if(typeof r!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#l=r}frame(){let{frames:r}=this.#o,t=r[this.#u];this.color&&(t=J[this.color](t)),this.#u=++this.#u%r.length;let n=typeof this.#a=="string"&&this.#a!==""?this.#a+" ":"",i=typeof this.text=="string"?" "+this.text:"",u=typeof this.#s=="string"&&this.#s!==""?" "+this.#s:"";return n+t+i+u}clear(){if(!this.#c||!this.#n.isTTY)return this;this.#n.cursorTo(0);for(let r=0;r<this.#i;r++)r>0&&this.#n.moveCursor(0,-1),this.#n.clearLine(1);return(this.#f||this.lastIndent!==this.#f)&&this.#n.cursorTo(this.#f),this.lastIndent=this.#f,this.#i=0,this}render(){return this.#l?this:(this.clear(),this.#n.write(this.frame()),this.#i=this.#e,this)}start(r){return r&&(this.text=r),this.#l?this:this.#c?this.isSpinning?this:(this.#r.hideCursor&&Cl.hide(this.#n),this.#r.discardStdin&&oi.default.stdin.isTTY&&(this.#t=!0,jl.start()),this.render(),this.#x=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.#n.write(`- ${this.text}
|
|
63
63
|
`),this)}stop(){return this.#c?(clearInterval(this.#x),this.#x=void 0,this.#u=0,this.clear(),this.#r.hideCursor&&Cl.show(this.#n),this.#r.discardStdin&&oi.default.stdin.isTTY&&this.#t&&(jl.stop(),this.#t=!1),this):this}succeed(r){return this.stopAndPersist({symbol:ii.success,text:r})}fail(r){return this.stopAndPersist({symbol:ii.error,text:r})}warn(r){return this.stopAndPersist({symbol:ii.warning,text:r})}info(r){return this.stopAndPersist({symbol:ii.info,text:r})}stopAndPersist(r={}){if(this.#l)return this;let t=r.prefixText??this.#a,n=this.#h(t," "),i=r.symbol??" ",u=r.text??this.text,o=typeof u=="string"?" "+u:"",a=r.suffixText??this.#s,s=this.#m(a," "),c=n+i+o+s+`
|
|
64
|
-
`;return this.stop(),this.#n.write(c),this}};function ar(e){return new Pl(e)}var da=require("child_process"),Ee=S(require("fs"),1),Rr=S(require("path"),1);var z1={dependencies:{"@gorhom/bottom-sheet":"5.2.8","@hookform/resolvers":"5.0.1","@legendapp/list":"2.0.19","@notifee/react-native":"9.1.8","@react-native-community/datetimepicker":"8.6.0","@react-native-community/hooks":"100.1.0","@react-navigation/bottom-tabs":"7.14.0","@react-navigation/core":"7.4.0","@react-navigation/material-top-tabs":"7.2.13","@react-navigation/native-stack":"7.2.1","@react-navigation/native":"7.0.15","@react-navigation/stack":"7.1.2","@shopify/flash-list":"2.2.2","@shopify/react-native-skia":"2.4.14","@tanstack/query-async-storage-persister":"5.67.3","@tanstack/query-core":"5.67.3","@tanstack/query-sync-storage-persister":"5.67.3","@tanstack/react-query-persist-client":"5.67.3","@tanstack/react-query":"5.67.3",axios:"1.13.2","babel-plugin-module-resolver":"5.0.2",dayjs:"1.11.19","jotai-optics":"0.4.0",jotai:"2.16.1","lodash-es":"4.17.22","patch-package":"8.0.1","react-hook-form":"7.56.4","react-native-bootsplash":"7.0.2","react-native-device-info":"15.0.1","react-native-dotenv":"3.4.11","react-native-gesture-handler":"2.29.1","react-native-get-random-values":"1.11.0","react-native-haptic-feedback":"2.3.3","react-native-keyboard-controller":"1.19.1","react-native-mmkv":"4.
|
|
64
|
+
`;return this.stop(),this.#n.write(c),this}};function ar(e){return new Pl(e)}var da=require("child_process"),Ee=S(require("fs"),1),Rr=S(require("path"),1);var z1={dependencies:{"@gorhom/bottom-sheet":"5.2.8","@hookform/resolvers":"5.0.1","@legendapp/list":"2.0.19","@notifee/react-native":"9.1.8","@react-native-community/datetimepicker":"8.6.0","@react-native-community/hooks":"100.1.0","@react-navigation/bottom-tabs":"7.14.0","@react-navigation/core":"7.4.0","@react-navigation/material-top-tabs":"7.2.13","@react-navigation/native-stack":"7.2.1","@react-navigation/native":"7.0.15","@react-navigation/stack":"7.1.2","@shopify/flash-list":"2.2.2","@shopify/react-native-skia":"2.4.14","@tanstack/query-async-storage-persister":"5.67.3","@tanstack/query-core":"5.67.3","@tanstack/query-sync-storage-persister":"5.67.3","@tanstack/react-query-persist-client":"5.67.3","@tanstack/react-query":"5.67.3",axios:"1.13.2","babel-plugin-module-resolver":"5.0.2",dayjs:"1.11.19","jotai-optics":"0.4.0",jotai:"2.16.1","lodash-es":"4.17.22","patch-package":"8.0.1","react-hook-form":"7.56.4","react-native-bootsplash":"7.0.2","react-native-device-info":"15.0.1","react-native-dotenv":"3.4.11","react-native-gesture-handler":"2.29.1","react-native-get-random-values":"1.11.0","react-native-haptic-feedback":"2.3.3","react-native-keyboard-controller":"1.19.1","react-native-mmkv":"4.2.0","react-native-nitro-modules":"0.35.1","react-native-modal-datetime-picker":"18.0.0","react-native-modal":"14.0.0-rc.1","react-native-pager-view":"6.8.0","react-native-permissions":"5.4.4","react-native-reanimated":"4.3.0-rc.0","react-native-safe-area-context":"5.6.0","react-native-screens":"4.19.0","react-native-simple-toast":"3.3.2","react-native-turbo-image":"1.22.1","react-native-url-polyfill":"2.0.0","react-native-worklets":"0.8.0-rc.0","react-native":"0.83.4",react:"19.2.0",tailwindcss:"3.4.16",twrnc:"4.16.0",uuid:"11.1.0","zod-validation-error":"3.4.0",zod:"3.24.2",zustand:"5.0.5"}};var K1={devDependencies:{"@babel/core":"7.25.2","@babel/eslint-parser":"7.23.10","@babel/preset-env":"7.25.3","@babel/preset-react":"7.27.1","@babel/runtime":"7.25.0","@react-native-community/cli-platform-android":"20.0.0","@react-native-community/cli-platform-ios":"20.0.0","@react-native-community/cli":"20.0.0","@react-native/babel-preset":"0.83.4","@react-native/eslint-config":"0.83.4","@react-native/metro-config":"0.83.4","@react-native/typescript-config":"0.83.4","@swc-node/register":"~1.8.0","@tanstack/eslint-plugin-query":"5.91.2","@testing-library/jest-native":"5.4.3","@testing-library/react-native":"12.5.1","@types/jest":"29.5.13","@types/jwt-encode":"1.0.3","@types/lodash-es":"4.17.12","@types/react-native-vector-icons":"6.4.18","@types/react-test-renderer":"19.1.0","@types/react":"19.2.0","@typescript-eslint/eslint-plugin":"^6.13.2","@typescript-eslint/parser":"^6.21.0","babel-jest":"29.6.3","babel-plugin-module-resolver":"5.0.2","eslint-config-airbnb-typescript":"^17.1.0","eslint-config-prettier":"10.1.8","eslint-import-resolver-typescript":"^3.8.5","eslint-plugin-ft-flow":"2.0.3","eslint-plugin-import":"^2.31.0","eslint-plugin-jest":"27.9.0","eslint-plugin-prettier":"^5.2.3","eslint-plugin-react-hooks":"^4.6.0","eslint-plugin-react-perf":"^3.3.3","eslint-plugin-react":"^7.32.2","eslint-plugin-sonarjs":"0.25.1","eslint-plugin-sort-destructure-keys":"^2.0.0","eslint-plugin-sort-keys-fix":"^1.1.2","eslint-plugin-tailwindcss":"^3.18.0","eslint-plugin-testing-library":"6.2.2",eslint:"8.57.0",husky:"9.1.7","jest-environment-jsdom":"30.1.2",jest:"29.6.3","prettier-plugin-tailwindcss":"^0.6.11",prettier:"3.3.2","react-native-dotenv":"3.4.11","react-native-asset":"2.1.1","react-native-svg-transformer":"1.3.0","react-native-svg":"15.15.1","react-test-renderer":"19.2.0","nx-react-native-rename":"latest",typescript:"5.8.3"}};function xa(){return __dirname}var st=(e,r)=>{(0,da.execSync)(`cd ${e} && ${r}`,{stdio:"inherit"})},_e=(e,r)=>new Promise((t,n)=>{(0,da.exec)(`cd ${e} && ${r}`,{maxBuffer:10*1024*1024},(i,u,o)=>{if(i){n(i);return}t({stdout:u,stderr:o})})}),re=(e,r,t,n)=>{let i=Rr.default.join(xa(),`../templates/${t}/${r}`);!Ee.default.existsSync(i)&&n&&(i=Rr.default.join(xa(),`../templates/${n}/${r}`)),Ee.default.copyFile(i,e,u=>{if(u){console.error(`Error copying file: ${u.message}`);return}})},ye=(e,r,t,n)=>{let i=Rr.default.join(xa(),`../templates/${t}/${r}`);!Ee.default.existsSync(i)&&n&&(i=Rr.default.join(xa(),`../templates/${n}/${r}`)),Ee.default.cpSync(i,e,{recursive:!0},u=>{if(u){console.error(`Error copying file: ${u.message}`);return}})},kl=e=>{Ee.default.rmSync(e,{recursive:!0,force:!0},r=>{if(r){console.error(`Error removing directory: ${r.message}`);return}})},si=e=>{Ee.default.rmSync(e,{recursive:!0,force:!0},r=>{if(r){console.error(`Error removing file: ${r.message}`);return}})},Tl=(e,r)=>{let t=Rr.default.join(e,"package.json"),n=JSON.parse(Ee.default.readFileSync(t,"utf8"));n.devDependencies={...n.devDependencies,...r},Ee.default.writeFileSync(t,JSON.stringify(n,null,2))},Ml=e=>{let r={postinstall:"patch-package",doctor:"cd apps/mobile && npx @react-native-community/cli doctor",android:"bash ./run-android.sh","android:connect":"adb reverse tcp:8081 tcp:8081","check-env:mobile":"bash ./check-env.sh apps/mobile/.env apps/mobile/.env.template",ios:"npx nx run-ios mobile",clean:"bash ./clean-generated-outputs.sh","lint:all":"npx nx run-many -t lint -p mobile --parallel=1 --skip-nx-cache","lint:mobile":"npx nx run mobile:lint --skip-nx-cache",prepare:"husky install","serve:mobile":"npx nx start mobile --skip-nx-cache","serve:all":"npx nx run-many -t serve -p mobile --parallel=1 --skip-nx-cache",xcode:"bash apps/mobile/ios-only.sh 'xed -b ios'","touch-xcode":"bash apps/mobile/ios-only.sh 'touch ios/.xcode.env'","setup-fastlane":"cd apps/mobile && rbenv local && bundle install && bundle update","deploy:mobile":"bash apps/mobile/deploy.sh","ios-certificates":"bash apps/mobile/ios-only.sh 'rbenv local && bundle install && bundle update && bundle exec fastlane ios certificates --env development'","pod-install":"npx nx pod-install mobile","pod-install:force":"npx nx pod-install:force mobile","list:ios-configurations":"bash apps/mobile/ios-only.sh 'cd ios && xcodebuild -list'","list:ios-devices":"bash apps/mobile/ios-only.sh 'xcrun xctrace list devices'","react-native-asset":"cd apps/mobile && npx react-native-asset"},t=Rr.default.join(e,"package.json"),n=JSON.parse(Ee.default.readFileSync(t,"utf8"));n.dependencies={...n.dependencies,...z1.dependencies},n.devDependencies={...n.devDependencies,...K1.devDependencies},n.scripts={...n.scripts,...r},Ee.default.writeFileSync(t,JSON.stringify(n,null,2))},Y1=e=>{let r=Rr.default.join(e,"nx.json");if(!Ee.default.existsSync(r))return;let t=JSON.parse(Ee.default.readFileSync(r,"utf-8"));t.tui={...t.tui||{},enabled:!1},Ee.default.writeFileSync(r,JSON.stringify(t,null,2))};var $S="3.0.7",pe="21.2.2",E={title:J.bold.cyan,subtitle:J.cyan,success:J.bold.green,info:J.bold.blue,warning:J.hex("#FFA500").bold,error:J.bold.red,highlight:J.bold.magenta,command:J.yellow.italic,path:J.green.underline,step:e=>J.bgCyan.black(` STEP ${e} `),emoji:{rocket:"\u{1F680}",check:"\u2705",warning:"\u26A0\uFE0F",star:"\u2B50",sparkles:"\u2728",tools:"\u{1F6E0}\uFE0F",mobile:"\u{1F4F1}",folder:"\u{1F4C1}",code:"\u{1F4BB}"}},X1=()=>{console.log(`
|
|
65
65
|
`),console.log(E.title("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(E.title("\u2551 \u2551")),console.log(E.title("\u2551 ")+E.highlight("NX REACT NATIVE CLI")+E.title(" \u2551")),console.log(E.title("\u2551 ")+E.subtitle("A powerful starter for React Native with NX")+E.title(" \u2551")),console.log(E.title("\u2551 \u2551")),console.log(E.title("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log(`
|
|
66
66
|
`)};gn.name("React Native Starter with NX").description("A starter script to create a new React Native project with NX").version($S);gn.command("create [workspace_name] [bundle_id]").description("create nx workspace with react-native").option("--fresh","Create a fresh project without copying template files").option("--nx-version <version>","Specify Nx version to use",pe).option("--package-manager <pm>","Package manager to use (yarn or npm)","yarn").option("--skip-install","Skip package install after adding dependencies").option("--skip-configs","Skip copying prettier, eslint, and husky configs").action(async(e,r,t)=>{X1();let n=Date.now();e||(e=(await ti.prompt([{type:"input",name:"workspace_name",message:E.info("Enter the workspace name:")}])).workspace_name),r||(r=(await ti.prompt([{type:"input",name:"bundle_id",message:E.info("Enter the bundle ID: ex. org.reactjsnative.example")}])).bundle_id);let i=t.fresh||!1,u=t.nxVersion||pe,o=t.packageManager||"yarn",a=t.skipInstall||!1,s=t.skipConfigs||!1,c=process.cwd(),f=`${c}/${e}`,d=`${f}/apps/mobile`;console.log(`
|
|
67
67
|
${E.step(1)} ${E.emoji.folder} ${E.success(`Creating Nx workspace in ${E.path(`./${e}`)}`)}`);let p=ar({text:"Setting up Nx workspace...",color:"cyan"}).start();(0,J1.execSync)(`cd ${c} && npx create-nx-workspace@${u} --preset apps --workspaceType integrated --name ${e} --package-manager=${o} --interactive false --nxCloud skip`,{stdio:"inherit"}),Y1(f),p.succeed(E.success("Nx workspace created successfully")),console.log(`
|
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ echo "Cleaning generated outputs..."
|
|
|
5
5
|
|
|
6
6
|
root_node_modules_path="node_modules"
|
|
7
7
|
app_rn_name="mobile"
|
|
8
|
+
mobile_node_modules_path="apps/$app_rn_name/node_modules"
|
|
8
9
|
app_rn_android_gradle_path="apps/$app_rn_name/android/.gradle"
|
|
9
10
|
app_rn_android_build_path="apps/$app_rn_name/android/build"
|
|
10
11
|
app_rn_android_cxx_path="apps/$app_rn_name/android/app/.cxx"
|
|
@@ -19,6 +20,9 @@ rm -rf "$root_build_path"
|
|
|
19
20
|
echo "Deleting root $root_node_modules_path..."
|
|
20
21
|
rm -rf "$root_node_modules_path"
|
|
21
22
|
|
|
23
|
+
echo "Deleting $mobile_node_modules_path..."
|
|
24
|
+
rm -rf "$mobile_node_modules_path"
|
|
25
|
+
|
|
22
26
|
echo "Deleting $app_rn_android_build_path..."
|
|
23
27
|
rm -rf "$app_rn_android_build_path"
|
|
24
28
|
|