UNPKG

@sap/generator-fiori

Version:

Create an SAPUI5 application using SAP Fiori elements or a freestyle approach

8 lines (7 loc) 7.1 kB
const __esmImportMetaUrl = require('node:url').pathToFileURL(__filename).href; "use strict";var D=Object.defineProperty;var l=(e,t)=>D(e,"name",{value:t,configurable:!0});var d=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var M=d((ue,x)=>{"use strict";x.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return n!==-1&&(s===-1||n<s)}});var j=d((ae,L)=>{"use strict";var H=require("os"),S=require("tty"),u=M(),{env:i}=process,a;u("no-color")||u("no-colors")||u("color=false")||u("color=never")?a=0:(u("color")||u("colors")||u("color=true")||u("color=always"))&&(a=1);"FORCE_COLOR"in i&&(i.FORCE_COLOR==="true"?a=1:i.FORCE_COLOR==="false"?a=0:a=i.FORCE_COLOR.length===0?1:Math.min(parseInt(i.FORCE_COLOR,10),3));function C(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}l(C,"translateLevel");function b(e,t){if(a===0)return 0;if(u("color=16m")||u("color=full")||u("color=truecolor"))return 3;if(u("color=256"))return 2;if(e&&!t&&a===void 0)return 0;let r=a||0;if(i.TERM==="dumb")return r;if(process.platform==="win32"){let n=H.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in i)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in i)||i.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in i)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0;if(i.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in i){let n=parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||"COLORTERM"in i?1:r}l(b,"supportsColor");function K(e){let t=b(e,e&&e.isTTY);return C(t)}l(K,"getSupportLevel");L.exports={supportsColor:K,stdout:C(b(!0,S.isatty(1))),stderr:C(b(!0,S.isatty(2)))}});var P=d((pe,k)=>{"use strict";var z=l((e,t,r)=>{let n=e.indexOf(t);if(n===-1)return e;let s=t.length,o=0,c="";do c+=e.substr(o,n-o)+t+r,o=n+s,n=e.indexOf(t,o);while(n!==-1);return c+=e.substr(o),c},"stringReplaceAll"),J=l((e,t,r,n)=>{let s=0,o="";do{let c=e[n-1]==="\r";o+=e.substr(s,(c?n-1:n)-s)+t+(c?`\r `:` `)+r,s=n+1,n=e.indexOf(` `,s)}while(n!==-1);return o+=e.substr(s),o},"stringEncaseCRLFWithFirstIndex");k.exports={stringReplaceAll:z,stringEncaseCRLFWithFirstIndex:J}});var q=d((de,$)=>{"use strict";var Q=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,N=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,Z=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,ee=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,te=new Map([["n",` `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function G(e){let t=e[0]==="u",r=e[1]==="{";return t&&!r&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(parseInt(e.slice(2,-1),16)):te.get(e)||e}l(G,"unescape");function re(e,t){let r=[],n=t.trim().split(/\s*,\s*/g),s;for(let o of n){let c=Number(o);if(!Number.isNaN(c))r.push(c);else if(s=o.match(Z))r.push(s[2].replace(ee,(A,p,R)=>p?G(p):R));else throw new Error(`Invalid Chalk template style argument: ${o} (in style '${e}')`)}return r}l(re,"parseArguments");function ne(e){N.lastIndex=0;let t=[],r;for(;(r=N.exec(e))!==null;){let n=r[1];if(r[2]){let s=re(n,r[2]);t.push([n].concat(s))}else t.push([n])}return t}l(ne,"parseStyle");function F(e,t){let r={};for(let s of t)for(let o of s.styles)r[o[0]]=s.inverse?null:o.slice(1);let n=e;for(let[s,o]of Object.entries(r))if(Array.isArray(o)){if(!(s in n))throw new Error(`Unknown Chalk style: ${s}`);n=o.length>0?n[s](...o):n[s]}return n}l(F,"buildStyle");$.exports=(e,t)=>{let r=[],n=[],s=[];if(t.replace(Q,(o,c,A,p,R,W)=>{if(c)s.push(G(c));else if(p){let T=s.join("");s=[],n.push(r.length===0?T:F(e,r)(T)),r.push({inverse:A,styles:ne(p)})}else if(R){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(F(e,r)(s.join(""))),s=[],r.pop()}else s.push(W)}),n.push(s.join("")),r.length>0){let o=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(o)}return n.join("")}});var h=require("../../commonlibs/ansi-styles/index.js"),{stdout:w,stderr:g}=j(),{stringReplaceAll:se,stringEncaseCRLFWithFirstIndex:oe}=P(),{isArray:y}=Array,V=["ansi","ansi","ansi256","ansi16m"],f=Object.create(null),le=l((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=w?w.level:0;e.level=t.level===void 0?r:t.level},"applyOptions"),I=class{static{l(this,"ChalkClass")}constructor(t){return U(t)}},U=l(e=>{let t={};return le(t,e),t.template=(...r)=>X(t.template,...r),Object.setPrototypeOf(t,E.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=I,t.template},"chalkFactory");function E(e){return U(e)}l(E,"Chalk");for(let[e,t]of Object.entries(h))f[e]={get(){let r=O(this,_(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:r}),r}};f.visible={get(){let e=O(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Y=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of Y)f[e]={get(){let{level:t}=this;return function(...r){let n=_(h.color[V[t]][e](...r),h.color.close,this._styler);return O(this,n,this._isEmpty)}}};for(let e of Y){let t="bg"+e[0].toUpperCase()+e.slice(1);f[t]={get(){let{level:r}=this;return function(...n){let s=_(h.bgColor[V[r]][e](...n),h.bgColor.close,this._styler);return O(this,s,this._isEmpty)}}}}var ie=Object.defineProperties(()=>{},{...f,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),_=l((e,t,r)=>{let n,s;return r===void 0?(n=e,s=t):(n=r.openAll+e,s=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:s,parent:r}},"createStyler"),O=l((e,t,r)=>{let n=l((...s)=>y(s[0])&&y(s[0].raw)?B(n,X(n,...s)):B(n,s.length===1?""+s[0]:s.join(" ")),"builder");return Object.setPrototypeOf(n,ie),n._generator=e,n._styler=t,n._isEmpty=r,n},"createBuilder"),B=l((e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let r=e._styler;if(r===void 0)return t;let{openAll:n,closeAll:s}=r;if(t.indexOf("\x1B")!==-1)for(;r!==void 0;)t=se(t,r.close,r.open),r=r.parent;let o=t.indexOf(` `);return o!==-1&&(t=oe(t,s,n,o)),n+t+s},"applyStyle"),v,X=l((e,...t)=>{let[r]=t;if(!y(r)||!y(r.raw))return t.join(" ");let n=t.slice(1),s=[r.raw[0]];for(let o=1;o<r.length;o++)s.push(String(n[o-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[o]));return v===void 0&&(v=q()),v(e,s.join(""))},"chalkTag");Object.defineProperties(E.prototype,f);var m=E();m.supportsColor=w;m.stderr=E({level:g?g.level:0});m.stderr.supportsColor=g;module.exports=m;