create-chayns-app 1.2.5 → 1.2.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/dist/index.cjs CHANGED
@@ -70,13 +70,13 @@ ${i.message}`:C,_=[x,e,t].filter(Boolean).join(`
70
70
  ${e}`,m_=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),g_=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),D_=(t,e,r)=>{let i=r===""?"":`with ${r.trim()}() `,s=d_.bind(null,i,e.toString());Object.defineProperty(s,"name",g_);let{writable:n,enumerable:o,configurable:a}=m_;Object.defineProperty(t,"toString",{value:s,writable:n,enumerable:o,configurable:a})};function qn(t,e,{ignoreNonConfigurable:r=!1}={}){let{name:i}=t;for(let s of Reflect.ownKeys(e))h_(t,e,s,r);return p_(t,e),D_(t,e,i),t}var Qr=new WeakMap,df=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let r,i=0,s=t.displayName||t.name||"<anonymous>",n=function(...o){if(Qr.set(n,++i),i===1)r=t.apply(this,o),t=void 0;else if(e.throw===!0)throw new Error(`Function \`${s}\` can only be called once`);return r};return qn(n,t),Qr.set(n,i),n};df.callCount=t=>{if(!Qr.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return Qr.get(t)};var mf=df;var gf=Yt.default.stderr.isTTY?Yt.default.stderr:Yt.default.stdout.isTTY?Yt.default.stdout:void 0,y_=gf?mf(()=>{kr(()=>{gf.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},Df=y_;var Zr=!1,At={};At.show=(t=jn.default.stderr)=>{t.isTTY&&(Zr=!1,t.write("\x1B[?25h"))};At.hide=(t=jn.default.stderr)=>{t.isTTY&&(Df(),Zr=!0,t.write("\x1B[?25l"))};At.toggle=(t,e)=>{t!==void 0&&(Zr=t),Zr?At.show(e):At.hide(e)};var Mn=At;var Zt=q(Hn(),1);var we=q(require("node:process"),1);function Gn(){return we.default.platform!=="win32"?we.default.env.TERM!=="linux":!!we.default.env.CI||!!we.default.env.WT_SESSION||!!we.default.env.TERMINUS_SUBLIME||we.default.env.ConEmuTask==="{cmd::Cmder}"||we.default.env.TERM_PROGRAM==="Terminus-Sublime"||we.default.env.TERM_PROGRAM==="vscode"||we.default.env.TERM==="xterm-256color"||we.default.env.TERM==="alacritty"||we.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var __={info:G.blue("\u2139"),success:G.green("\u2714"),warning:G.yellow("\u26A0"),error:G.red("\u2716")},F_={info:G.blue("i"),success:G.green("\u221A"),warning:G.yellow("\u203C"),error:G.red("\xD7")},b_=Gn()?__:F_,Xt=b_;function Vn({onlyFirst:t=!1}={}){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,t?void 0:"g")}var C_=Vn();function Wn(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(C_,"")}function Un({onlyFirst:t=!1}={}){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,t?void 0:"g")}var w_=Un();function zn(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(w_,"")}function Ff(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function bf(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function Cf(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101631&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129673||t>=129679&&t<=129734||t>=129742&&t<=129756||t>=129759&&t<=129769||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}function A_(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function wf(t,{ambiguousAsWide:e=!1}={}){return A_(t),bf(t)||Cf(t)||e&&Ff(t)?2:1}var xf=q(vf(),1),v_=new Intl.Segmenter,x_=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function Kn(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:i=!1}=e;if(i||(t=zn(t)),t.length===0)return 0;let s=0,n={ambiguousAsWide:!r};for(let{segment:o}of v_.segment(t)){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)&&!x_.test(o)){if((0,xf.default)().test(o)){s+=2;continue}s+=wf(a,n)}}return s}function Yn({stream:t=process.stdout}={}){return!!(t&&t.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}var Xn=q(require("node:process"),1);function Qn(){let{env:t}=Xn.default,{TERM:e,TERM_PROGRAM:r}=t;return Xn.default.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var $e=q(require("node:process"),1),S_=3,Zn=class{#o=0;start(){this.#o++,this.#o===1&&this.#r()}stop(){if(this.#o<=0)throw new Error("`stop` called more times than `start`");this.#o--,this.#o===0&&this.#e()}#r(){$e.default.platform==="win32"||!$e.default.stdin.isTTY||($e.default.stdin.setRawMode(!0),$e.default.stdin.on("data",this.#s),$e.default.stdin.resume())}#e(){$e.default.stdin.isTTY&&($e.default.stdin.off("data",this.#s),$e.default.stdin.pause(),$e.default.stdin.setRawMode(!1))}#s(e){e[0]===S_&&$e.default.emit("SIGINT")}},O_=new Zn,Jn=O_;var R_=q(Hn(),1),eo=class{#o=0;#r=!1;#e=0;#s=-1;#f=0;#t;#n;#i;#p;#m;#l;#c;#h;#g;#a;#u;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#t={color:"cyan",stream:Qt.default.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#t.color,this.spinner=this.#t.spinner,this.#m=this.#t.interval,this.#i=this.#t.stream,this.#l=typeof this.#t.isEnabled=="boolean"?this.#t.isEnabled:Yn({stream:this.#i}),this.#c=typeof this.#t.isSilent=="boolean"?this.#t.isSilent:!1,this.text=this.#t.text,this.prefixText=this.#t.prefixText,this.suffixText=this.#t.suffixText,this.indent=this.#t.indent,Qt.default.env.NODE_ENV==="test"&&(this._stream=this.#i,this._isEnabled=this.#l,Object.defineProperty(this,"_linesToClear",{get(){return this.#o},set(r){this.#o=r}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#s}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}}))}get indent(){return this.#h}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#h=e,this.#d()}get interval(){return this.#m??this.#n.interval??100}get spinner(){return this.#n}set spinner(e){if(this.#s=-1,this.#m=void 0,typeof e=="object"){if(e.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#n=e}else if(!Qn())this.#n=Zt.default.line;else if(e===void 0)this.#n=Zt.default.dots;else if(e!=="default"&&Zt.default[e])this.#n=Zt.default[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#g}set text(e=""){this.#g=e,this.#d()}get prefixText(){return this.#a}set prefixText(e=""){this.#a=e,this.#d()}get suffixText(){return this.#u}set suffixText(e=""){this.#u=e,this.#d()}get isSpinning(){return this.#p!==void 0}#D(e=this.#a,r=" "){return typeof e=="string"&&e!==""?e+r:typeof e=="function"?e()+r:""}#y(e=this.#u,r=" "){return typeof e=="string"&&e!==""?r+e:typeof e=="function"?r+e():""}#d(){let e=this.#i.columns??80,r=this.#D(this.#a,"-"),i=this.#y(this.#u,"-"),s=" ".repeat(this.#h)+r+"--"+this.#g+"--"+i;this.#e=0;for(let n of Wn(s).split(`
71
71
  `))this.#e+=Math.max(1,Math.ceil(Kn(n,{countAnsiEscapeCodes:!0})/e))}get isEnabled(){return this.#l&&!this.#c}set isEnabled(e){if(typeof e!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#l=e}get isSilent(){return this.#c}set isSilent(e){if(typeof e!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#c=e}frame(){let e=Date.now();(this.#s===-1||e-this.#f>=this.interval)&&(this.#s=++this.#s%this.#n.frames.length,this.#f=e);let{frames:r}=this.#n,i=r[this.#s];this.color&&(i=G[this.color](i));let s=typeof this.#a=="string"&&this.#a!==""?this.#a+" ":"",n=typeof this.text=="string"?" "+this.text:"",o=typeof this.#u=="string"&&this.#u!==""?" "+this.#u:"";return s+i+n+o}clear(){if(!this.#l||!this.#i.isTTY)return this;this.#i.cursorTo(0);for(let e=0;e<this.#o;e++)e>0&&this.#i.moveCursor(0,-1),this.#i.clearLine(1);return(this.#h||this.lastIndent!==this.#h)&&this.#i.cursorTo(this.#h),this.lastIndent=this.#h,this.#o=0,this}render(){return this.#c?this:(this.clear(),this.#i.write(this.frame()),this.#o=this.#e,this)}start(e){return e&&(this.text=e),this.#c?this:this.#l?this.isSpinning?this:(this.#t.hideCursor&&Mn.hide(this.#i),this.#t.discardStdin&&Qt.default.stdin.isTTY&&(this.#r=!0,Jn.start()),this.render(),this.#p=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.#i.write(`- ${this.text}
72
72
  `),this)}stop(){return this.#l?(clearInterval(this.#p),this.#p=void 0,this.#s=0,this.clear(),this.#t.hideCursor&&Mn.show(this.#i),this.#t.discardStdin&&Qt.default.stdin.isTTY&&this.#r&&(Jn.stop(),this.#r=!1),this):this}succeed(e){return this.stopAndPersist({symbol:Xt.success,text:e})}fail(e){return this.stopAndPersist({symbol:Xt.error,text:e})}warn(e){return this.stopAndPersist({symbol:Xt.warning,text:e})}info(e){return this.stopAndPersist({symbol:Xt.info,text:e})}stopAndPersist(e={}){if(this.#c)return this;let r=e.prefixText??this.#a,i=this.#D(r," "),s=e.symbol??" ",n=e.text??this.text,a=typeof n=="string"?(s?" ":"")+n:"",u=e.suffixText??this.#u,l=this.#y(u," "),c=i+s+a+l+`
73
- `;return this.stop(),this.#i.write(c),this}};function ct(t){return new eo(t)}var Ee=q(require("fs"),1),Vi=require("fs/promises");var Sf={name:"create-chayns-app",version:"1.2.5",private:!1,description:"Create a new chayns\xAE development project in one command.",keywords:["chayns","react","chayns-toolkit","chayns-components","starter-kit"],bugs:{url:"https://github.com/TobitSoftware/create-chayns-app/issues",email:"leonhard.driesch@tobit.com"},repository:{type:"git",url:"git+https://github.com/TobitSoftware/create-chayns-app.git"},license:"MIT",author:{name:"Leonhard Driesch",email:"leonhard.driesch@tobit.com"},main:"index.js",bin:{"create-chayns-app":"dist/index.cjs"},type:"module",files:["dist","templates"],engines:{node:">=18"},scripts:{build:"node ./scripts/build.js",watch:"node ./scripts/watch.js",format:"prettier . --ignore-path .gitignore --write",prepublishOnly:"npm run build",start:"node src/index.js"},devDependencies:{"@eslint/js":"^9.19.0",chalk:"^5.4.1",commander:"^13.1.0",enquirer:"^2.4.1",esbuild:"^0.24.2",eslint:"^9.19.0",execa:"^8.0.1","fast-glob":"^3.3.3","is-npm":"^6.0.0",ora:"^8.1.1",prettier:"^3.4.2","prettier-plugin-packagejson":"^2.5.8",semver:"^7.7.1","validate-npm-package-name":"^6.0.0"},publishConfig:{access:"public"}};var Jt={page:"A complete page",pagemakerPlugin:"A pagemaker plugin"},er={v4:"v4 (Javascript api)",v5:"v5 (React api (new))"},ei=[{name:"Yes",value:!0},{name:"No",value:!1}];var Ri=q(require("path"),1),$t=require("fs/promises"),Em=q(ym(),1);async function dt({destination:t,templateDir:e,adjustContent:r}){let s=(await(0,Em.default)("**/*",{cwd:e})).map(async n=>{let o=await(0,$t.readFile)(Ri.default.join(e,n),{encoding:"utf-8"});typeof r=="function"&&(o=r(o));let a=n.replace("template-gitignore",".gitignore"),u=Ri.default.join(t,a);await(0,$t.mkdir)(Ri.default.join(u,".."),{recursive:!0}),await(0,$t.writeFile)(u,o)});await Promise.all(s)}function mt(t,e){let r=t;for(let[i,s]of Object.entries(e))r=r.replace(new RegExp(`\\{\\{ ${i} \\}\\}`,"g"),s);return r}var _m={"chayns-components":"latest","prop-types":"latest",react:"18","react-dom":"18"},Fm={"chayns-toolkit":"latest",prettier:"latest","prettier-plugin-packagejson":"latest"},bm=t=>({"@chayns-components/core":"latest","prop-types":"latest",react:String(t),"react-dom":String(t),"chayns-api":"latest"}),Cm={"chayns-toolkit":"latest",prettier:"latest","prettier-plugin-packagejson":"latest"},wm={"react-redux":"latest","@reduxjs/toolkit":"latest"},Am=t=>({typescript:"latest","@types/react":String(t),"@types/react-dom":String(t)}),vm={"@testing-library/jest-dom":"latest","@testing-library/react":"latest","@testing-library/user-event":"latest","@vitejs/plugin-react":"latest","@vitest/coverage-v8":"latest",jsdom:"latest",vitest:"latest"},Ti={"chayns-logger":"latest","tobit-textstrings":"latest"};var yD=require("node:child_process");var ED=q(DD(),1);var iu=async(t,e)=>{let r=e?`${t}@${e}`:t;if(t in Ti)try{let i=await fetch(`https://repo.tobit.ag/repository/npm/${t}`);if(i.ok){let s=await i.json();if(e in s["dist-tags"])return`^${s["dist-tags"][e]}`;let n=ED.default.maxSatisfying(Object.keys(s.versions),e);if(n)return`^${n}`}}catch{}try{let i=await new Promise((o,a)=>{(0,yD.exec)(`npm view ${r} version --json`,(u,l)=>{u?a(u):o(l.trim())})}),s=JSON.parse(i);return`^${Array.isArray(s)?s.pop():s}`}catch{}return console.warn(`
74
- Could not resolve ${G.yellow(r)}`),e||"latest"};var FD=q(require("path"),1),bD=q(require("fs"),1);var Px=(t,e)=>({name:t,version:"1.0.0",private:!0,description:e,keywords:["chayns","chayns-toolkit","react"],scripts:{build:"chayns-toolkit build",dev:"chayns-toolkit dev",start:"chayns-toolkit dev",format:"prettier . --write",lint:"chayns-toolkit lint"},prettier:{proseWrap:"always",singleQuote:!0,tabWidth:4,printWidth:100},eslintConfig:{extends:"@chayns-toolkit"},dependencies:{},devDependencies:{}}),_D=async({name:t,description:e="",devDependencies:r={},dependencies:i={},useTypescript:s,useVitest:n})=>{let o=Px(t,e);for(let[a,u]of Object.entries(r).sort(([l],[c])=>l.localeCompare(c)))o.devDependencies[a]=await iu(a,u);for(let[a,u]of Object.entries(i).sort(([l],[c])=>l.localeCompare(c)))o.dependencies[a]=await iu(a,u);return s&&(o.scripts["check-types"]="tsc"),n&&(o.scripts.test="vitest"),JSON.stringify(o,void 0,4)},su=async({destination:t,projectVersion:e,reactVersion:r,useRedux:i,tobitInternal:s,...n})=>{let{useTypescript:o,useVitest:a}=n,u=ct("Resolving latest versions of required dependencies").start(),l,c=FD.default.join(t,"package.json");if(e===er.v4)l=await _D({...n,dependencies:_m,devDependencies:Fm});else{let h=bm(r),f={...Cm};i&&Object.assign(h,wm),o&&Object.assign(f,Am(r)),a&&Object.assign(f,vm),s&&Object.assign(h,Ti),l=await _D({...n,dependencies:h,devDependencies:f})}u.succeed("Resolved latest versions of required dependencies"),bD.default.writeFileSync(c,l)};function Gi(t){var e=t.match(/[A-Za-z][a-z]*/g)||[];return e.map($x).join(" ")}function $x(t){return t.charAt(0).toUpperCase()+t.substring(1)}var CD=({useTypescript:t,moduleFederation:e,useRedux:r,tobitInternal:i,packageNameUnderscore:s})=>{let n=[],o=0,a=[];e&&t&&a.push("ComponentPropsWithoutRef"),i&&a.push("Suspense"),e&&r&&a.push("useState");let u=a.length?`, { ${a.join(", ")} }`:"";return n.push(`import React${u} from 'react';`),r&&n.push("import { Provider } from 'react-redux';"),n.push(`import { ChaynsProvider${e?", withCompatMode":""} } from 'chayns-api';`),n.push("import { PageProvider } from '@chayns-components/core';"),i&&n.push("import { TextStringProvider } from 'tobit-textstrings';"),n.push("import App from './App';"),r&&n.push(`import ${e?"{ createStore }":"store"} from '../redux-modules';`),i&&e&&n.push("import '../utils/logger';"),n.push(""),i&&(n.push("// TODO: insert your libraryName"),n.push("const libraries = ['<libraryName>'];"),n.push("")),e&&r?(n.push(`const AppWrapper = (${e?"props":""}${e&&t?": ComponentPropsWithoutRef<typeof ChaynsProvider>":""}) => {`),o+=4,n.push(`${" ".repeat(o)}const [store] = useState(createStore);`),n.push(""),n.push(`${" ".repeat(o)}return (`)):n.push(`const AppWrapper = (${e?"props":""}${e&&t?": ComponentPropsWithoutRef<typeof ChaynsProvider>":""}) => (`),o+=4,e&&(n.push(`${" ".repeat(o)}<div className="${s}">`),o+=4,n.push(`${" ".repeat(o)}{/* eslint-disable-next-line react/jsx-props-no-spreading */}`)),n.push(`${" ".repeat(o)}<ChaynsProvider${e?" {...props}":""}>`),o+=4,r&&(n.push(`${" ".repeat(o)}<Provider store={store}>`),o+=4),n.push(`${" ".repeat(o)}<PageProvider>`),o+=4,i&&(n.push(`${" ".repeat(o)}<Suspense>`),o+=4,n.push(`${" ".repeat(o)}<TextStringProvider libraries={libraries}>`),o+=4),n.push(`${" ".repeat(o)}<App />`),i&&(o-=4,n.push(`${" ".repeat(o)}</TextStringProvider>`),o-=4,n.push(`${" ".repeat(o)}</Suspense>`)),o-=4,n.push(`${" ".repeat(o)}</PageProvider>`),r&&(o-=4,n.push(`${" ".repeat(o)}</Provider>`)),o-=4,n.push(`${" ".repeat(o)}</ChaynsProvider>`),e&&(o-=4,n.push(`${" ".repeat(o)}</div>`)),e&&r?(o-=4,n.push(`${" ".repeat(o)});`),n.push("};")):n.push(");"),n.push(""),e?n.push("export default withCompatMode(AppWrapper);"):n.push("export default AppWrapper;"),n.push(""),n.join(`
73
+ `;return this.stop(),this.#i.write(c),this}};function ct(t){return new eo(t)}var Ee=q(require("fs"),1),Vi=require("fs/promises");var Sf={name:"create-chayns-app",version:"1.2.7",private:!1,description:"Create a new chayns\xAE development project in one command.",keywords:["chayns","react","chayns-toolkit","chayns-components","starter-kit"],bugs:{url:"https://github.com/TobitSoftware/create-chayns-app/issues",email:"leonhard.driesch@tobit.com"},repository:{type:"git",url:"git+https://github.com/TobitSoftware/create-chayns-app.git"},license:"MIT",author:{name:"Leonhard Driesch",email:"leonhard.driesch@tobit.com"},main:"index.js",bin:{"create-chayns-app":"dist/index.cjs"},type:"module",files:["dist","templates"],engines:{node:">=18"},scripts:{build:"node ./scripts/build.js",watch:"node ./scripts/watch.js",format:"prettier . --ignore-path .gitignore --write",prepublishOnly:"npm run build",start:"node src/index.js"},devDependencies:{"@eslint/js":"^9.19.0",chalk:"^5.4.1",commander:"^13.1.0",enquirer:"^2.4.1",esbuild:"^0.24.2",eslint:"^9.19.0",execa:"^8.0.1","fast-glob":"^3.3.3","is-npm":"^6.0.0",ora:"^8.1.1",prettier:"^3.4.2","prettier-plugin-packagejson":"^2.5.8",semver:"^7.7.1","validate-npm-package-name":"^6.0.0"},publishConfig:{access:"public"}};var Jt={page:"A complete page",pagemakerPlugin:"A pagemaker plugin"},er={v4:"v4 (Javascript api)",v5:"v5 (React api (new))"},ei=[{name:"Yes",value:!0},{name:"No",value:!1}];var Ri=q(require("path"),1),$t=require("fs/promises"),Em=q(ym(),1);async function dt({destination:t,templateDir:e,adjustContent:r}){let s=(await(0,Em.default)("**/*",{cwd:e})).map(async n=>{let o=await(0,$t.readFile)(Ri.default.join(e,n),{encoding:"utf-8"});typeof r=="function"&&(o=r(o));let a=n.replace("template-gitignore",".gitignore"),u=Ri.default.join(t,a);await(0,$t.mkdir)(Ri.default.join(u,".."),{recursive:!0}),await(0,$t.writeFile)(u,o)});await Promise.all(s)}function mt(t,e){let r=t;for(let[i,s]of Object.entries(e))r=r.replace(new RegExp(`\\{\\{ ${i} \\}\\}`,"g"),s);return r}var _m={"chayns-components":"latest","prop-types":"latest",react:"18","react-dom":"18"},Fm={"chayns-toolkit":"latest",prettier:"latest","prettier-plugin-packagejson":"latest"},bm=t=>({"@chayns-components/core":"latest","prop-types":"latest",react:String(t),"react-dom":String(t),"chayns-api":"latest"}),Cm={"chayns-toolkit":"latest",prettier:"latest","prettier-plugin-packagejson":"latest"},wm={"react-redux":"latest","@reduxjs/toolkit":"latest"},Am=t=>({typescript:"latest","@types/react":String(t),"@types/react-dom":String(t)}),vm={"@testing-library/jest-dom":"latest","@testing-library/react":"latest","@testing-library/user-event":"latest","@vitejs/plugin-react":"latest","@vitest/coverage-v8":"latest",jsdom:"latest",vitest:"latest"},Ti={"chayns-logger":"latest","tobit-textstrings":"latest"};var yD=require("node:child_process");var ED=q(DD(),1);var iu=async(t,e)=>{let r=e?`${t}@${e}`:t;if(t in Ti)try{let i=await fetch(`https://repo.tobit.ag/repository/npm/${t}`);if(i.ok){let s=await i.json();if(e in s["dist-tags"])return`^${s["dist-tags"][e]}`;let n=ED.default.maxSatisfying(Object.keys(s.versions),e);if(n)return`^${n}`}}catch{}try{let i=await new Promise((o,a)=>{(0,yD.exec)(`npm view ${r} version --json`,(u,l)=>{u?a(u):o(l.trim())})}),s=JSON.parse(i);return`^${Array.isArray(s)?s.pop():s}`}catch{}return console.warn(`
74
+ Could not resolve ${G.yellow(r)}`),e||"latest"};var FD=q(require("path"),1),bD=q(require("fs"),1);var Px=(t,e)=>({name:t,version:"1.0.0",private:!0,description:e,keywords:["chayns","chayns-toolkit","react"],scripts:{build:"chayns-toolkit build",dev:"chayns-toolkit dev",start:"chayns-toolkit dev",format:"prettier . --write",lint:"chayns-toolkit lint"},prettier:{proseWrap:"always",singleQuote:!0,tabWidth:4,printWidth:100},dependencies:{},devDependencies:{}}),_D=async({name:t,description:e="",devDependencies:r={},dependencies:i={},useTypescript:s,useVitest:n})=>{let o=Px(t,e);for(let[a,u]of Object.entries(r).sort(([l],[c])=>l.localeCompare(c)))o.devDependencies[a]=await iu(a,u);for(let[a,u]of Object.entries(i).sort(([l],[c])=>l.localeCompare(c)))o.dependencies[a]=await iu(a,u);return s&&(o.scripts["check-types"]="tsc"),n&&(o.scripts.test="vitest"),JSON.stringify(o,void 0,4)},su=async({destination:t,projectVersion:e,reactVersion:r,useRedux:i,tobitInternal:s,...n})=>{let{useTypescript:o,useVitest:a}=n,u=ct("Resolving latest versions of required dependencies").start(),l,c=FD.default.join(t,"package.json");if(e===er.v4)l=await _D({...n,dependencies:_m,devDependencies:Fm});else{let h=bm(r),f={...Cm};i&&Object.assign(h,wm),o&&(Object.assign(f,Am(r)),delete h["prop-types"]),a&&Object.assign(f,vm),s&&Object.assign(h,Ti),l=await _D({...n,dependencies:h,devDependencies:f})}u.succeed("Resolved latest versions of required dependencies"),bD.default.writeFileSync(c,l)};function Gi(t){var e=t.match(/[A-Za-z][a-z]*/g)||[];return e.map($x).join(" ")}function $x(t){return t.charAt(0).toUpperCase()+t.substring(1)}var CD=({useTypescript:t,moduleFederation:e,useRedux:r,tobitInternal:i,packageNameUnderscore:s})=>{let n=[],o=0,a=[];e&&t&&a.push("ComponentPropsWithoutRef"),e&&r&&a.push("useState");let u=a.length?`, { ${a.join(", ")} }`:"";return n.push(`import React${u} from 'react';`),r&&n.push("import { Provider } from 'react-redux';"),n.push(`import { ChaynsProvider${e?", withCompatMode":""} } from 'chayns-api';`),n.push("import { PageProvider } from '@chayns-components/core';"),i&&n.push("import { TextStringProvider } from 'tobit-textstrings';"),n.push("import App from './App';"),r&&n.push(`import ${e?"{ createStore }":"store"} from '../redux-modules';`),i&&e&&n.push("import '../utils/logger';"),n.push(""),i&&(n.push("// TODO: insert your libraryName"),n.push("const libraries = ['<libraryName>'];"),n.push("")),e&&r?(n.push(`const AppWrapper = (${e?"props":""}${e&&t?": ComponentPropsWithoutRef<typeof ChaynsProvider>":""}) => {`),o+=4,n.push(`${" ".repeat(o)}const [store] = useState(createStore);`),n.push(""),n.push(`${" ".repeat(o)}return (`)):n.push(`const AppWrapper = (${e?"props":""}${e&&t?": ComponentPropsWithoutRef<typeof ChaynsProvider>":""}) => (`),o+=4,e&&(n.push(`${" ".repeat(o)}<div className="${s}">`),o+=4),n.push(`${" ".repeat(o)}<ChaynsProvider${e?" {...props}":""}>`),o+=4,r&&(n.push(`${" ".repeat(o)}<Provider store={store}>`),o+=4),n.push(`${" ".repeat(o)}<PageProvider>`),o+=4,i&&(n.push(`${" ".repeat(o)}<TextStringProvider libraries={libraries}>`),o+=4),n.push(`${" ".repeat(o)}<App />`),i&&(o-=4,n.push(`${" ".repeat(o)}</TextStringProvider>`)),o-=4,n.push(`${" ".repeat(o)}</PageProvider>`),r&&(o-=4,n.push(`${" ".repeat(o)}</Provider>`)),o-=4,n.push(`${" ".repeat(o)}</ChaynsProvider>`),e&&(o-=4,n.push(`${" ".repeat(o)}</div>`)),e&&r?(o-=4,n.push(`${" ".repeat(o)});`),n.push("};")):n.push(");"),n.push(""),e?n.push("export default withCompatMode(AppWrapper);"):n.push("export default AppWrapper;"),n.push(""),n.join(`
75
75
  `)};var{prompt:st}=wD.default,Bx=new pf,pr=__dirname;Bx.version(Sf.version).option("-G, --no-git","initialize the project without a git repository").option("-C, --no-initial-commit","don't perform an initial commit").option("-I, --no-install","don't install packages after initialization").option("-M, --module-federation","install to use as module (only internal)").option("-T, --tobit-internal","includes tobit internal packages (chayns-logger and tobit-textstrings)").option("-p, --package-manager <manager>","specify the package manager to use (`npm` or `yarn`). Defaults to the one used to execute the command.").action(Ix).parse(process.argv);async function Ix({git:t,initialCommit:e,install:r,packageManager:i,moduleFederation:s,tobitInternal:n}){let o,a;if(n)try{(await fetch("https://repo.tobit.ag",{method:"HEAD",signal:AbortSignal.timeout(3e3)})).ok||(n=!1)}catch{n=!1}s||({projectVersion:o}=await st({type:"select",name:"projectVersion",message:"What api version do you want to use?",choices:Object.values(er)}),{projectType:a}=await st({type:"select",name:"projectType",message:"What type of project do you want to create?",choices:Object.values(Jt)}));let u=!1,l;for(;!u;){let{packageName:D}=await st([{type:"input",name:"packageName",message:"What should the name of your project be?",initial:"my-awesome-project"}]),{validForNewPackages:C,errors:F=[],warnings:x=[]}=(0,AD.default)(D);if(C)u=!0,l=D;else{console.log(`
76
76
  ${G.hex("#31D1DF")(`\`${D}\``)} is unfortunately not a valid project name, because:`);for(let _ of[...F,...x])console.log(G.hex("#94A3B8")(` - ${_}`));console.log("")}}let{summary:c}=await st({type:"input",message:"How would you summarize this project in a few words?",name:"summary"});function h(D){return mt(D,{"package-name":l,"readable-package-name":Gi(l),description:c,"install-command":d==="yarn"?"yarn":"npm install","run-command":d==="yarn"?"yarn":"npm run","package-name-underscore":l.replace("-","_"),"logger-import":n?`import './utils/logger';
77
77
  `:""})}let f=V.default.resolve(l),d=i||(uc?"yarn":"npm");if(o===er.v4){switch(console.log(`
78
78
  ${G.bold.magentaBright("Awesome!")} Please wait a quick second while we bootstrap your project...
79
- `),a){case Jt.page:await dt({destination:f,templateDir:V.default.join(` ${pr} `.trim(),"../templates/page"),adjustContent:D=>mt(h(D),{"tapp-style":""})});break;case Jt.pagemakerPlugin:await dt({destination:f,projectName:l,templateDir:V.default.join(` ${pr} `.trim(),"../templates/page"),adjustContent:D=>mt(h(D),{"tapp-style":' style="padding: 0 0 16px !important"'})});break}await su({name:l,description:c,destination:f,projectVersion:o})}else{let{reactVersion:D}=await st({type:"select",name:"reactVersion",message:"Which react version do you want to use?",choices:[{name:"v18",value:18},{name:"v19",value:19}],result(g){return this.map(g)[g]}}),{useRedux:C}=await st({type:"select",name:"useRedux",message:"Do you want to add redux-toolkit?",choices:ei,result(g){return this.map(g)[g]}}),{useTypescript:F}=await st({type:"select",name:"useTypescript",message:"Do you want to add typescript?",choices:ei,result(g){return this.map(g)[g]}}),{useVitest:x}=await st({type:"select",name:"useVitest",message:"Do you want to add vitest?",choices:ei,result(g){return this.map(g)[g]}}),_=g=>V.default.join(` ${pr} `.trim(),g),T=async(g,H,U)=>{let _e=await(0,Vi.readFile)(g,{encoding:"utf-8"});U&&(_e=mt(_e,{"package-name":l,"readable-package-name":Gi(l),description:c,"install-command":d==="yarn"?"yarn":"npm install","run-command":d==="yarn"?"yarn":"npm run"})),await(0,Vi.writeFile)(H,_e)},S=g=>mt(h(g),{"tapp-style":a===Jt.pagemakerPlugin?' style="padding: 0 0 16px !important"':""}),O=F?"ts":"js";if(C){let g=`../templates/api-v5/shared/${O}/src`;if(await dt({destination:f+"/src",projectName:l,templateDir:V.default.join(` ${pr} `.trim(),g)}),await T(_("../templates/api-v5/shared/ts/.eslintrc"),V.default.join(f,".eslintrc")),n){let H=`../templates/api-v5/internal/${O}/src`;await dt({destination:f+"/src",projectName:l,templateDir:V.default.join(` ${pr} `.trim(),H)})}}if(await dt({destination:f,projectName:l,templateDir:_(`../templates/api-v5/page${F?"-ts":""}${s?"-module":""}${C?"-redux":""}`),adjustContent:S}),await su({name:l,description:c,destination:f,projectVersion:o,reactVersion:D,useRedux:C,useTypescript:F,useVitest:x,tobitInternal:n}),await T(_("../templates/shared/README.md"),V.default.join(f,"README.md"),!0),await T(_("../templates/shared/template-gitignore"),V.default.join(f,".gitignore"),!0),await T(_("../templates/api-v5/shared/.env"),V.default.join(f,".env")),await T(_("../templates/api-v5/shared/.env.development.local"),V.default.join(f,".env.development.local")),Ee.default.existsSync(V.default.join(f,"/src/constants"))||Ee.default.mkdirSync(V.default.join(f,"/src/constants")),await T(_(`../templates/api-v5/shared/${O}/src/constants/serverUrls.${O}`),V.default.join(f,`/src/constants/serverUrls.${O}`)),F&&(await T(_("../templates/api-v5/shared/ts/tsconfig.json"),V.default.join(f,"tsconfig.json")),Ee.default.existsSync(V.default.join(f,"/src/types"))||Ee.default.mkdirSync(V.default.join(f,"/src/types")),await T(_("../templates/api-v5/shared/ts/src/types/global.d.ts"),V.default.join(f,"/src/types/global.d.ts")),await T(_("../templates/api-v5/shared/ts/src/types/environment.d.ts"),V.default.join(f,"/src/types/environment.d.ts"))),x&&(Ee.default.existsSync(V.default.join(f,"/tests"))||Ee.default.mkdirSync(V.default.join(f,"/tests")),await T(_("../templates/shared/tests/setup.js"),V.default.join(f,"/tests/setup.js")),await T(_("../templates/shared/vitest.config.mjs"),V.default.join(f,`/vitest.config.m${O}`))),n){Ee.default.existsSync(V.default.join(f,"/src/utils"))||Ee.default.mkdirSync(V.default.join(f,"/src/utils")),await T(_(`../templates/api-v5/internal/${O}/src/utils/logger.${O}`),V.default.join(f,`/src/utils/logger.${O}`));let g=V.default.join(f,`/src/components/AppWrapper.${O}x`);Ee.default.writeFileSync(g,CD({useRedux:C,useTypescript:F,moduleFederation:s,tobitInternal:n,packageNameUnderscore:l.replace("-","_")}));let H=V.default.join(f,".npmrc");Ee.default.writeFileSync(H,`registry=https://repo.tobit.ag/repository/npm/
79
+ `),a){case Jt.page:await dt({destination:f,templateDir:V.default.join(` ${pr} `.trim(),"../templates/page"),adjustContent:D=>mt(h(D),{"tapp-style":""})});break;case Jt.pagemakerPlugin:await dt({destination:f,projectName:l,templateDir:V.default.join(` ${pr} `.trim(),"../templates/page"),adjustContent:D=>mt(h(D),{"tapp-style":' style="padding: 0 0 16px !important"'})});break}await su({name:l,description:c,destination:f,projectVersion:o})}else{let{reactVersion:D}=await st({type:"select",name:"reactVersion",message:"Which react version do you want to use?",choices:[{name:"v18",value:18},{name:"v19",value:19}],result(g){return this.map(g)[g]}}),{useRedux:C}=await st({type:"select",name:"useRedux",message:"Do you want to add redux-toolkit?",choices:ei,result(g){return this.map(g)[g]}}),{useTypescript:F}=await st({type:"select",name:"useTypescript",message:"Do you want to add typescript?",choices:ei,result(g){return this.map(g)[g]}}),{useVitest:x}=await st({type:"select",name:"useVitest",message:"Do you want to add vitest?",choices:ei,result(g){return this.map(g)[g]}}),_=g=>V.default.join(` ${pr} `.trim(),g),T=async(g,H,U)=>{let _e=await(0,Vi.readFile)(g,{encoding:"utf-8"});U&&(_e=mt(_e,{"package-name":l,"readable-package-name":Gi(l),description:c,"install-command":d==="yarn"?"yarn":"npm install","run-command":d==="yarn"?"yarn":"npm run"})),await(0,Vi.writeFile)(H,_e)},S=g=>mt(h(g),{"tapp-style":a===Jt.pagemakerPlugin?' style="padding: 0 0 16px !important"':""}),O=F?"ts":"js";if(C){let g=`../templates/api-v5/shared/${O}/src`;if(await dt({destination:f+"/src",projectName:l,templateDir:V.default.join(` ${pr} `.trim(),g)}),n){let H=`../templates/api-v5/internal/${O}/src`;await dt({destination:f+"/src",projectName:l,templateDir:V.default.join(` ${pr} `.trim(),H)})}}if(await dt({destination:f,projectName:l,templateDir:_(`../templates/api-v5/page${F?"-ts":""}${s?"-module":""}${C?"-redux":""}`),adjustContent:S}),await su({name:l,description:c,destination:f,projectVersion:o,reactVersion:D,useRedux:C,useTypescript:F,useVitest:x,tobitInternal:n}),await T(_("../templates/shared/README.md"),V.default.join(f,"README.md"),!0),await T(_("../templates/shared/template-gitignore"),V.default.join(f,".gitignore"),!0),await T(_("../templates/api-v5/shared/.env"),V.default.join(f,".env")),await T(_("../templates/api-v5/shared/.env.development.local"),V.default.join(f,".env.development.local")),await T(_("../templates/shared/eslint.config.mjs"),V.default.join(f,"eslint.config.mjs")),Ee.default.existsSync(V.default.join(f,"/src/constants"))||Ee.default.mkdirSync(V.default.join(f,"/src/constants")),await T(_(`../templates/api-v5/shared/${O}/src/constants/serverUrls.${O}`),V.default.join(f,`/src/constants/serverUrls.${O}`)),F&&(await T(_("../templates/api-v5/shared/ts/tsconfig.json"),V.default.join(f,"tsconfig.json")),Ee.default.existsSync(V.default.join(f,"/src/types"))||Ee.default.mkdirSync(V.default.join(f,"/src/types")),await T(_("../templates/api-v5/shared/ts/src/types/global.d.ts"),V.default.join(f,"/src/types/global.d.ts")),await T(_("../templates/api-v5/shared/ts/src/types/environment.d.ts"),V.default.join(f,"/src/types/environment.d.ts"))),x&&(Ee.default.existsSync(V.default.join(f,"/tests"))||Ee.default.mkdirSync(V.default.join(f,"/tests")),await T(_("../templates/shared/tests/setup.js"),V.default.join(f,"/tests/setup.js")),await T(_("../templates/shared/vitest.config.mjs"),V.default.join(f,`/vitest.config.m${O}`))),n){Ee.default.existsSync(V.default.join(f,"/src/utils"))||Ee.default.mkdirSync(V.default.join(f,"/src/utils")),await T(_(`../templates/api-v5/internal/${O}/src/utils/logger.${O}`),V.default.join(f,`/src/utils/logger.${O}`));let g=V.default.join(f,`/src/components/AppWrapper.${O}x`);Ee.default.writeFileSync(g,CD({useRedux:C,useTypescript:F,moduleFederation:s,tobitInternal:n,packageNameUnderscore:l.replace("-","_")}));let H=V.default.join(f,".npmrc");Ee.default.writeFileSync(H,`registry=https://repo.tobit.ag/repository/npm/
80
80
  `)}let R=_(`../templates/api-v5/shared/toolkit.config${s?"-module":""}.js`),N=V.default.join(f,"toolkit.config.js"),W=Ee.default.readFileSync(R,"utf-8");n&&(W=W.replace(/(\s+)(port:.*)/,"$1$2$1cert: '//fs1/SSL/tobitag.crt',$1key: '//fs1/SSL/tobitag.key',")),Ee.default.writeFileSync(N,W)}if(t){let D=ct("Initializing Git repository").start();try{await zr("git init",{cwd:f}),D.succeed("Initialized a Git repository")}catch(C){throw D.fail(`Failed to initialize a Git repository. You can do this yourself by running ${G.cyanBright("git init")}.`),C}}if(r){let D=ct(`Installing packages using ${G.blueBright(d)}`).start();try{await zr(`${d} install`,{cwd:f}),D.succeed(`Installed packages with ${G.blueBright(d)}`)}catch{D.fail(`Failed to install packages with ${G.blueBright(d)}. You can do this yourself by running ${G.cyanBright(`${d} install`)}.`)}}if(t&&e){let D=ct("Performing an initial commit").start();try{await zr("git add .",{cwd:f}),await Ur("git",["commit","-m",":tada: Initial commit"],{cwd:f}),D.succeed("Perfomed an initial commit")}catch(C){console.error(C),D.fail("Failed to perform an initial commit.")}}console.log(`
81
81
  ${G.bold.greenBright("Congrats!")} Your new project is ready to go!`);let m=d==="yarn"?"yarn dev":"npm run dev";n?(console.log(`Open the created ${G.yellowBright(`./${l}/`)} folder in your favorite editor.`),console.log(`Initialize ${G.yellowBright("tobit-textstrings")} by calling ${G.cyanBright("npx tobit-textstrings init")}.`),console.log(`Search for ${G.greenBright("TODO:")} and follow the instructions.`),console.log(`Start ${G.cyanBright("`"+m+"`")}.
82
82
  `)):console.log(`Open the created ${G.yellowBright(`./${l}/`)} folder in your favorite editor and start ${G.cyanBright("`"+m+"`")}.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-chayns-app",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "private": false,
5
5
  "description": "Create a new chayns® development project in one command.",
6
6
  "keywords": [
@@ -5,7 +5,6 @@ import App from './App';
5
5
 
6
6
  const AppWrapper = (props) => (
7
7
  <div className="{{ package-name-underscore }}">
8
- {/* eslint-disable-next-line react/jsx-props-no-spreading */}
9
8
  <ChaynsProvider {...props}>
10
9
  <PageProvider>
11
10
  <App />
@@ -7,7 +7,6 @@ import store from '../redux-modules';
7
7
 
8
8
  const AppWrapper = (props) => (
9
9
  <div className="{{ package-name-underscore }}">
10
- {/* eslint-disable-next-line react/jsx-props-no-spreading */}
11
10
  <ChaynsProvider {...props}>
12
11
  <Provider store={store}>
13
12
  <PageProvider>
@@ -5,7 +5,6 @@ import App from './App';
5
5
 
6
6
  const AppWrapper = (props: ComponentPropsWithoutRef<typeof ChaynsProvider>) => (
7
7
  <div className="{{ package-name-underscore }}">
8
- {/* eslint-disable-next-line react/jsx-props-no-spreading */}
9
8
  <ChaynsProvider {...props}>
10
9
  <PageProvider>
11
10
  <App />
@@ -7,7 +7,6 @@ import store from '../redux-modules';
7
7
 
8
8
  const AppWrapper = (props: ComponentPropsWithoutRef<typeof ChaynsProvider>) => (
9
9
  <div className="{{ package-name-underscore }}">
10
- {/* eslint-disable-next-line react/jsx-props-no-spreading */}
11
10
  <ChaynsProvider {...props}>
12
11
  <Provider store={store}>
13
12
  <PageProvider>
@@ -0,0 +1,3 @@
1
+ import config from '@chayns-toolkit/eslint-config';
2
+
3
+ export default config;