Skip to content

Commit

Permalink
update: release v1.7.12
Browse files Browse the repository at this point in the history
  • Loading branch information
POPPIN-FUMI committed Sep 8, 2023
1 parent 46eae58 commit 4cb350b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
18 changes: 17 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,22 @@ You are a specialist in adding descriptions to functions for generating TypeDoc.
* const salt = 'MySalt'; // Salt used in the encryption process
* const decrypted = decrypt(encrypted, iv, password, salt);
* console.log(decrypted);
*/`},{input:"get UserChatRoom data from firestore",output:`/**
* @module getUserChatRoom
* Fetches the chat room of a user from the database.
*
* @param db - The Firestore database instance.
* @param userId - The ID of the user.
* @param chatRoomId - The ID of the chat room.
* @returns A promise that resolves to the user's chat room.
* @throws Will throw an error if the chat room cannot be fetched.
*
* @example
* const db = admin.firestore();
* const userId = 'User123';
* const chatRoomId = 'ChatRoom123';
* const userChatRoom = await getUserChatRoom(db, userId, chatRoomId)
* console.log(userChatRoom));
*/`}]}},UH=async(c,g)=>{try{let d=JH();return await fi(d,c,g.ai,g.aiInstance)}catch(d){throw new Error(`skeetPrompt: ${d}`)}},BH=require("fs"),VH={context:`You are a specialist in naming functions based on Prisma schemas. Users will provide you with a brief description of the database change they want to implement, primarily focusing on the model name within the Prisma schema. Your task is to return a function name in camelCase that aptly describes the operation and prominently incorporates the model name. For example, when creating a new table or model named "User", it's common to start the function name with "add" like "addUser". The prefix might vary depending on the specific operation described, but the model name should always be central to your naming convention.If you get multiple model names, you can combine them in the function name. For example, if you get "Post" and "Comment", you can return "addPostAndComment".User model is already defined in the schema.prisma file.Skip the User model and focus on the other models.`,examples:[{input:`model Post {
id Int @id @default(autoincrement())
title String
Expand Down Expand Up @@ -968,7 +984,7 @@ You must use <@skeet-framework/firestore> to retrieve data from Firestore.
catch (error) {
throw new Error(\`findLargest: \${error}\`)
}
}`}]}},sQ=async(c,g,d,p,h,s,a,f)=>{try{let b=uQ(d,p,h,s,a,f);return await fi(b,c,g.ai,g.aiInstance)}catch(b){throw new Error(`skeetNaming: ${b}`)}};dQ.config();var tl,kh=(tl=class{ai;model;maxTokens;temperature;_initOptions;aiInstance;functionConfigPaths=g=>({packageJson:`${tl.FUNCTION_ROOT}/${g}/package.json`,tsconfigJson:`${tl.FUNCTION_ROOT}/${g}/tsconfig.json`});constructor(g={}){this.ai=g.ai||"VertexAI",this.model=g.model||(this.ai==="VertexAI"?"chat-bison@001":"gpt-4"),this.maxTokens=g.maxTokens||1e3,this.temperature=g.temperature||0,this.ai==="VertexAI"?this.aiInstance=new Sd({model:this.model,maxOutputTokens:this.maxTokens}):this.aiInstance=new Od({model:this.model,maxTokens:this.maxTokens,apiKey:process.env.CHAT_GPT_KEY||"",organizationKey:process.env.CHAT_GPT_ORG||""}),this._initOptions=g}get initOptions(){return this._initOptions}async prisma(g){try{return await NH(g,this)}catch(d){this.handleError(d)}}async skeet(g){try{return await IH(g,this)}catch(d){throw new Error(`skeet: ${d}`)}}async uploadFile(g){try{return await xH(g,this.ai,this.aiInstance)}catch(d){this.handleError(d)}}async createFineTuningJob(g,d="gpt-3.5-turbo-0613"){try{return await EH(g,d,this.ai,this.aiInstance)}catch(p){this.handleError(p)}}async showFineTuningJob(g){try{return await MH(g,this.ai,this.aiInstance)}catch(d){this.handleError(d)}}async typedoc(g){try{return await UH(g,this)}catch(d){this.handleError(d)}}async naming(g,d="function"){try{return await zH(g,this,d)}catch(p){this.handleError(p)}}async translates(g,d="ja",p="en"){try{return await $H(g,d,p,this)}catch(h){this.handleError(h)}}async firestore(g){try{return await tQ(g,this)}catch(d){this.handleError(d)}}async function(g,d,p,h,s,a,f){try{return await sQ(g,this,d,p,h,s,a,f)}catch(b){this.handleError(b)}}async method(g,d,p,h,s,a){try{return await nQ(g,this,d,p,h,s,a)}catch(f){this.handleError(f)}}async run(g,d){try{let p=Ia(g.context,g.examples,d,this.ai);return this.ai==="VertexAI"?await this.aiInstance.prompt(p):await this.aiInstance.prompt(p)}catch(p){throw new Error(`run: ${p}`)}}handleError(g){console.error("Error:",g)}},k0(tl,"PRISMA_SCHEMA_PATH","./graphql/prisma/schema.prisma"),k0(tl,"MODEL_PATH","./functions/skeet/src/models"),k0(tl,"FUNCTION_ROOT","./functions"),tl),Cp=kh;});var Ozt={};ake(Ozt,{DEFAULT_FUNCTION_NAME:()=>Hr,FIREBASERC_PATH:()=>O5,GRAPHQL_ENV_BUILD_PATH:()=>YI,GRAPHQL_ENV_PRODUCTION_PATH:()=>ei,GRAPHQL_PATH:()=>ea,GRAPHQL_ROOT:()=>Xo,PRISMA_SCHEMA_PATH:()=>Ps,SKEET_CONFIG_PATH:()=>hp,TRANSLATE_PATH:()=>u$,program:()=>qt});module.exports=nke(Ozt);var o_e=st(sA());var DY=st(CY(),1),{program:Fzt,createCommand:_zt,createArgument:kzt,createOption:Mzt,CommanderError:Rzt,InvalidArgumentError:Nzt,InvalidOptionArgumentError:Bzt,Command:AY,Argument:Izt,Option:Lzt,Help:qzt}=DY.default;var FY="1.7.11";var _Y=(c=0)=>g=>`\x1B[${g+c}m`,kY=(c=0)=>g=>`\x1B[${38+c};5;${g}m`,MY=(c=0)=>(g,d,p)=>`\x1B[${38+c};2;${g};${d};${p}m`,Ao={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Vzt=Object.keys(Ao.modifier),_ke=Object.keys(Ao.color),kke=Object.keys(Ao.bgColor),Gzt=[..._ke,...kke];function Mke(){let c=new Map;for(let[g,d]of Object.entries(Ao)){for(let[p,h]of Object.entries(d))Ao[p]={open:`\x1B[${h[0]}m`,close:`\x1B[${h[1]}m`},d[p]=Ao[p],c.set(h[0],h[1]);Object.defineProperty(Ao,g,{value:d,enumerable:!1})}return Object.defineProperty(Ao,"codes",{value:c,enumerable:!1}),Ao.color.close="\x1B[39m",Ao.bgColor.close="\x1B[49m",Ao.color.ansi=_Y(),Ao.color.ansi256=kY(),Ao.color.ansi16m=MY(),Ao.bgColor.ansi=_Y(10),Ao.bgColor.ansi256=kY(10),Ao.bgColor.ansi16m=MY(10),Object.defineProperties(Ao,{rgbToAnsi256:{value(g,d,p){return g===d&&d===p?g<8?16:g>248?231:Math.round((g-8)/247*24)+232:16+36*Math.round(g/255*5)+6*Math.round(d/255*5)+Math.round(p/255*5)},enumerable:!1},hexToRgb:{value(g){let d=/[a-f\d]{6}|[a-f\d]{3}/i.exec(g.toString(16));if(!d)return[0,0,0];let[p]=d;p.length===3&&(p=[...p].map(s=>s+s).join(""));let h=Number.parseInt(p,16);return[h>>16&255,h>>8&255,h&255]},enumerable:!1},hexToAnsi256:{value:g=>Ao.rgbToAnsi256(...Ao.hexToRgb(g)),enumerable:!1},ansi256ToAnsi:{value(g){if(g<8)return 30+g;if(g<16)return 90+(g-8);let d,p,h;if(g>=232)d=((g-232)*10+8)/255,p=d,h=d;else{g-=16;let f=g%36;d=Math.floor(g/36)/5,p=Math.floor(f/6)/5,h=f%6/5}let s=Math.max(d,p,h)*2;if(s===0)return 30;let a=30+(Math.round(h)<<2|Math.round(p)<<1|Math.round(d));return s===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(g,d,p)=>Ao.ansi256ToAnsi(Ao.rgbToAnsi256(g,d,p)),enumerable:!1},hexToAnsi:{value:g=>Ao.ansi256ToAnsi(Ao.hexToAnsi256(g)),enumerable:!1}}),Ao}var Rke=Mke(),Gn=Rke;var U0=st(require("node:process"),1),NY=st(require("node:os"),1),OA=st(require("node:tty"),1);function mn(c,g=globalThis.Deno?globalThis.Deno.args:U0.default.argv){let d=c.startsWith("-")?"":c.length===1?"-":"--",p=g.indexOf(d+c),h=g.indexOf("--");return p!==-1&&(h===-1||p<h)}var{env:Lo}=U0.default,J0;mn("no-color")||mn("no-colors")||mn("color=false")||mn("color=never")?J0=0:(mn("color")||mn("colors")||mn("color=true")||mn("color=always"))&&(J0=1);function Nke(){if("FORCE_COLOR"in Lo)return Lo.FORCE_COLOR==="true"?1:Lo.FORCE_COLOR==="false"?0:Lo.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Lo.FORCE_COLOR,10),3)}function Bke(c){return c===0?!1:{level:c,hasBasic:!0,has256:c>=2,has16m:c>=3}}function Ike(c,{streamIsTTY:g,sniffFlags:d=!0}={}){let p=Nke();p!==void 0&&(J0=p);let h=d?J0:p;if(h===0)return 0;if(d){if(mn("color=16m")||mn("color=full")||mn("color=truecolor"))return 3;if(mn("color=256"))return 2}if("TF_BUILD"in Lo&&"AGENT_NAME"in Lo)return 1;if(c&&!g&&h===void 0)return 0;let s=h||0;if(Lo.TERM==="dumb")return s;if(U0.default.platform==="win32"){let a=NY.default.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in Lo)return"GITHUB_ACTIONS"in Lo||"GITEA_ACTIONS"in Lo?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in Lo)||Lo.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Lo)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Lo.TEAMCITY_VERSION)?1:0;if(Lo.COLORTERM==="truecolor"||Lo.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in Lo){let a=Number.parseInt((Lo.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Lo.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Lo.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Lo.TERM)||"COLORTERM"in Lo?1:s}function RY(c,g={}){let d=Ike(c,{streamIsTTY:c&&c.isTTY,...g});return Bke(d)}var Lke={stdout:RY({isTTY:OA.default.isatty(1)}),stderr:RY({isTTY:OA.default.isatty(2)})},BY=Lke;function IY(c,g,d){let p=c.indexOf(g);if(p===-1)return c;let h=g.length,s=0,a="";do a+=c.slice(s,p)+g+d,s=p+h,p=c.indexOf(g,s);while(p!==-1);return a+=c.slice(s),a}function LY(c,g,d,p){let h=0,s="";do{let a=c[p-1]==="\r";s+=c.slice(h,a?p-1:p)+g+(a?`\r
}`}]}},sQ=async(c,g,d,p,h,s,a,f)=>{try{let b=uQ(d,p,h,s,a,f);return await fi(b,c,g.ai,g.aiInstance)}catch(b){throw new Error(`skeetNaming: ${b}`)}};dQ.config();var tl,kh=(tl=class{ai;model;maxTokens;temperature;_initOptions;aiInstance;functionConfigPaths=g=>({packageJson:`${tl.FUNCTION_ROOT}/${g}/package.json`,tsconfigJson:`${tl.FUNCTION_ROOT}/${g}/tsconfig.json`});constructor(g={}){this.ai=g.ai||"VertexAI",this.model=g.model||(this.ai==="VertexAI"?"chat-bison@001":"gpt-4"),this.maxTokens=g.maxTokens||1e3,this.temperature=g.temperature||0,this.ai==="VertexAI"?this.aiInstance=new Sd({model:this.model,maxOutputTokens:this.maxTokens}):this.aiInstance=new Od({model:this.model,maxTokens:this.maxTokens,apiKey:process.env.CHAT_GPT_KEY||"",organizationKey:process.env.CHAT_GPT_ORG||""}),this._initOptions=g}get initOptions(){return this._initOptions}async prisma(g){try{return await NH(g,this)}catch(d){this.handleError(d)}}async skeet(g){try{return await IH(g,this)}catch(d){throw new Error(`skeet: ${d}`)}}async uploadFile(g){try{return await xH(g,this.ai,this.aiInstance)}catch(d){this.handleError(d)}}async createFineTuningJob(g,d="gpt-3.5-turbo-0613"){try{return await EH(g,d,this.ai,this.aiInstance)}catch(p){this.handleError(p)}}async showFineTuningJob(g){try{return await MH(g,this.ai,this.aiInstance)}catch(d){this.handleError(d)}}async typedoc(g){try{return await UH(g,this)}catch(d){this.handleError(d)}}async naming(g,d="function"){try{return await zH(g,this,d)}catch(p){this.handleError(p)}}async translates(g,d="ja",p="en"){try{return await $H(g,d,p,this)}catch(h){this.handleError(h)}}async firestore(g){try{return await tQ(g,this)}catch(d){this.handleError(d)}}async function(g,d,p,h,s,a,f){try{return await sQ(g,this,d,p,h,s,a,f)}catch(b){this.handleError(b)}}async method(g,d,p,h,s,a){try{return await nQ(g,this,d,p,h,s,a)}catch(f){this.handleError(f)}}async run(g,d){try{let p=Ia(g.context,g.examples,d,this.ai);return this.ai==="VertexAI"?await this.aiInstance.prompt(p):await this.aiInstance.prompt(p)}catch(p){throw new Error(`run: ${p}`)}}handleError(g){console.error("Error:",g)}},k0(tl,"PRISMA_SCHEMA_PATH","./graphql/prisma/schema.prisma"),k0(tl,"MODEL_PATH","./functions/skeet/src/models"),k0(tl,"FUNCTION_ROOT","./functions"),tl),Cp=kh;});var Ozt={};ake(Ozt,{DEFAULT_FUNCTION_NAME:()=>Hr,FIREBASERC_PATH:()=>O5,GRAPHQL_ENV_BUILD_PATH:()=>YI,GRAPHQL_ENV_PRODUCTION_PATH:()=>ei,GRAPHQL_PATH:()=>ea,GRAPHQL_ROOT:()=>Xo,PRISMA_SCHEMA_PATH:()=>Ps,SKEET_CONFIG_PATH:()=>hp,TRANSLATE_PATH:()=>u$,program:()=>qt});module.exports=nke(Ozt);var o_e=st(sA());var DY=st(CY(),1),{program:Fzt,createCommand:_zt,createArgument:kzt,createOption:Mzt,CommanderError:Rzt,InvalidArgumentError:Nzt,InvalidOptionArgumentError:Bzt,Command:AY,Argument:Izt,Option:Lzt,Help:qzt}=DY.default;var FY="1.7.12";var _Y=(c=0)=>g=>`\x1B[${g+c}m`,kY=(c=0)=>g=>`\x1B[${38+c};5;${g}m`,MY=(c=0)=>(g,d,p)=>`\x1B[${38+c};2;${g};${d};${p}m`,Ao={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Vzt=Object.keys(Ao.modifier),_ke=Object.keys(Ao.color),kke=Object.keys(Ao.bgColor),Gzt=[..._ke,...kke];function Mke(){let c=new Map;for(let[g,d]of Object.entries(Ao)){for(let[p,h]of Object.entries(d))Ao[p]={open:`\x1B[${h[0]}m`,close:`\x1B[${h[1]}m`},d[p]=Ao[p],c.set(h[0],h[1]);Object.defineProperty(Ao,g,{value:d,enumerable:!1})}return Object.defineProperty(Ao,"codes",{value:c,enumerable:!1}),Ao.color.close="\x1B[39m",Ao.bgColor.close="\x1B[49m",Ao.color.ansi=_Y(),Ao.color.ansi256=kY(),Ao.color.ansi16m=MY(),Ao.bgColor.ansi=_Y(10),Ao.bgColor.ansi256=kY(10),Ao.bgColor.ansi16m=MY(10),Object.defineProperties(Ao,{rgbToAnsi256:{value(g,d,p){return g===d&&d===p?g<8?16:g>248?231:Math.round((g-8)/247*24)+232:16+36*Math.round(g/255*5)+6*Math.round(d/255*5)+Math.round(p/255*5)},enumerable:!1},hexToRgb:{value(g){let d=/[a-f\d]{6}|[a-f\d]{3}/i.exec(g.toString(16));if(!d)return[0,0,0];let[p]=d;p.length===3&&(p=[...p].map(s=>s+s).join(""));let h=Number.parseInt(p,16);return[h>>16&255,h>>8&255,h&255]},enumerable:!1},hexToAnsi256:{value:g=>Ao.rgbToAnsi256(...Ao.hexToRgb(g)),enumerable:!1},ansi256ToAnsi:{value(g){if(g<8)return 30+g;if(g<16)return 90+(g-8);let d,p,h;if(g>=232)d=((g-232)*10+8)/255,p=d,h=d;else{g-=16;let f=g%36;d=Math.floor(g/36)/5,p=Math.floor(f/6)/5,h=f%6/5}let s=Math.max(d,p,h)*2;if(s===0)return 30;let a=30+(Math.round(h)<<2|Math.round(p)<<1|Math.round(d));return s===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(g,d,p)=>Ao.ansi256ToAnsi(Ao.rgbToAnsi256(g,d,p)),enumerable:!1},hexToAnsi:{value:g=>Ao.ansi256ToAnsi(Ao.hexToAnsi256(g)),enumerable:!1}}),Ao}var Rke=Mke(),Gn=Rke;var U0=st(require("node:process"),1),NY=st(require("node:os"),1),OA=st(require("node:tty"),1);function mn(c,g=globalThis.Deno?globalThis.Deno.args:U0.default.argv){let d=c.startsWith("-")?"":c.length===1?"-":"--",p=g.indexOf(d+c),h=g.indexOf("--");return p!==-1&&(h===-1||p<h)}var{env:Lo}=U0.default,J0;mn("no-color")||mn("no-colors")||mn("color=false")||mn("color=never")?J0=0:(mn("color")||mn("colors")||mn("color=true")||mn("color=always"))&&(J0=1);function Nke(){if("FORCE_COLOR"in Lo)return Lo.FORCE_COLOR==="true"?1:Lo.FORCE_COLOR==="false"?0:Lo.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Lo.FORCE_COLOR,10),3)}function Bke(c){return c===0?!1:{level:c,hasBasic:!0,has256:c>=2,has16m:c>=3}}function Ike(c,{streamIsTTY:g,sniffFlags:d=!0}={}){let p=Nke();p!==void 0&&(J0=p);let h=d?J0:p;if(h===0)return 0;if(d){if(mn("color=16m")||mn("color=full")||mn("color=truecolor"))return 3;if(mn("color=256"))return 2}if("TF_BUILD"in Lo&&"AGENT_NAME"in Lo)return 1;if(c&&!g&&h===void 0)return 0;let s=h||0;if(Lo.TERM==="dumb")return s;if(U0.default.platform==="win32"){let a=NY.default.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in Lo)return"GITHUB_ACTIONS"in Lo||"GITEA_ACTIONS"in Lo?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in Lo)||Lo.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Lo)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Lo.TEAMCITY_VERSION)?1:0;if(Lo.COLORTERM==="truecolor"||Lo.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in Lo){let a=Number.parseInt((Lo.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Lo.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Lo.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Lo.TERM)||"COLORTERM"in Lo?1:s}function RY(c,g={}){let d=Ike(c,{streamIsTTY:c&&c.isTTY,...g});return Bke(d)}var Lke={stdout:RY({isTTY:OA.default.isatty(1)}),stderr:RY({isTTY:OA.default.isatty(2)})},BY=Lke;function IY(c,g,d){let p=c.indexOf(g);if(p===-1)return c;let h=g.length,s=0,a="";do a+=c.slice(s,p)+g+d,s=p+h,p=c.indexOf(g,s);while(p!==-1);return a+=c.slice(s),a}function LY(c,g,d,p){let h=0,s="";do{let a=c[p-1]==="\r";s+=c.slice(h,a?p-1:p)+g+(a?`\r
`:`
`)+d,h=p+1,p=c.indexOf(`
`,h)}while(p!==-1);return s+=c.slice(h),s}var{stdout:qY,stderr:JY}=BY,SA=Symbol("GENERATOR"),Rc=Symbol("STYLER"),Yf=Symbol("IS_EMPTY"),UY=["ansi","ansi","ansi256","ansi16m"],Nc=Object.create(null),qke=(c,g={})=>{if(g.level&&!(Number.isInteger(g.level)&&g.level>=0&&g.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let d=qY?qY.level:0;c.level=g.level===void 0?d:g.level};var Jke=c=>{let g=(...d)=>d.join(" ");return qke(g,c),Object.setPrototypeOf(g,Wf.prototype),g};function Wf(c){return Jke(c)}Object.setPrototypeOf(Wf.prototype,Function.prototype);for(let[c,g]of Object.entries(Gn))Nc[c]={get(){let d=V0(this,jA(g.open,g.close,this[Rc]),this[Yf]);return Object.defineProperty(this,c,{value:d}),d}};Nc.visible={get(){let c=V0(this,this[Rc],!0);return Object.defineProperty(this,"visible",{value:c}),c}};var PA=(c,g,d,...p)=>c==="rgb"?g==="ansi16m"?Gn[d].ansi16m(...p):g==="ansi256"?Gn[d].ansi256(Gn.rgbToAnsi256(...p)):Gn[d].ansi(Gn.rgbToAnsi(...p)):c==="hex"?PA("rgb",g,d,...Gn.hexToRgb(...p)):Gn[d][c](...p),Uke=["rgb","hex","ansi256"];for(let c of Uke){Nc[c]={get(){let{level:d}=this;return function(...p){let h=jA(PA(c,UY[d],"color",...p),Gn.color.close,this[Rc]);return V0(this,h,this[Yf])}}};let g="bg"+c[0].toUpperCase()+c.slice(1);Nc[g]={get(){let{level:d}=this;return function(...p){let h=jA(PA(c,UY[d],"bgColor",...p),Gn.bgColor.close,this[Rc]);return V0(this,h,this[Yf])}}}}var Vke=Object.defineProperties(()=>{},{...Nc,level:{enumerable:!0,get(){return this[SA].level},set(c){this[SA].level=c}}}),jA=(c,g,d)=>{let p,h;return d===void 0?(p=c,h=g):(p=d.openAll+c,h=g+d.closeAll),{open:c,close:g,openAll:p,closeAll:h,parent:d}},V0=(c,g,d)=>{let p=(...h)=>Gke(p,h.length===1?""+h[0]:h.join(" "));return Object.setPrototypeOf(p,Vke),p[SA]=c,p[Rc]=g,p[Yf]=d,p},Gke=(c,g)=>{if(c.level<=0||!g)return c[Yf]?"":g;let d=c[Rc];if(d===void 0)return g;let{openAll:p,closeAll:h}=d;if(g.includes("\x1B"))for(;d!==void 0;)g=IY(g,d.close,d.open),d=d.parent;let s=g.indexOf(`
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@skeet-framework/cli",
"version": "1.7.11",
"version": "1.7.12",
"description": "Skeet CLI",
"main": "dist/index.js",
"repository": "https://github.com/elsoul/skeet-cli",
Expand Down Expand Up @@ -71,4 +71,4 @@
"tsconfig-paths": "4.2.0",
"typescript": "5.0.4"
}
}
}
2 changes: 1 addition & 1 deletion src/lib/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '1.7.11'
export const VERSION = '1.7.12'

0 comments on commit 4cb350b

Please sign in to comment.