eazy-git 0.2.11 → 0.2.12
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/README.md +4 -1
- package/dist/git.js +11 -11
- package/dist/index.js +130 -130
- package/dist/install.js +19 -19
- package/dist/run.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -67,6 +67,7 @@ This opens an interactive menu with the following options:
|
|
|
67
67
|
| `runrun` | Clean development server restart (removes `.next` folder and runs `npm run dev`) |
|
|
68
68
|
| `i` | Install project dependencies using configured auth token |
|
|
69
69
|
| `eg config` | Open configuration menu (language, default branch, AI provider) |
|
|
70
|
+
| `eg upgrade` | Upgrade eazy-git to the latest version from npm |
|
|
70
71
|
| `-v`, `--version` | Display installed package version |
|
|
71
72
|
|
|
72
73
|
---
|
|
@@ -104,7 +105,8 @@ eazy-git/
|
|
|
104
105
|
├── src/
|
|
105
106
|
│ ├── actions/
|
|
106
107
|
│ │ ├── config/
|
|
107
|
-
│ │ │
|
|
108
|
+
│ │ │ ├── configure.js
|
|
109
|
+
│ │ │ └── upgrade.js
|
|
108
110
|
│ │ ├── git/
|
|
109
111
|
│ │ │ ├── addChangesToBranch.js
|
|
110
112
|
│ │ │ ├── checkout.js
|
|
@@ -159,6 +161,7 @@ eazy-git/
|
|
|
159
161
|
├── git.js
|
|
160
162
|
├── index.js
|
|
161
163
|
├── install.js
|
|
164
|
+
├── jsconfig.json
|
|
162
165
|
├── run.js
|
|
163
166
|
├── package.json
|
|
164
167
|
└── README.md
|
package/dist/git.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var ze=Object.create;var ae=Object.defineProperty;var Ke=Object.getOwnPropertyDescriptor;var Je=Object.getOwnPropertyNames;var Ye=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty;var Xe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ze=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Je(t))!Qe.call(e,o)&&o!==s&&ae(e,o,{get:()=>t[o],enumerable:!(i=Ke(t,o))||i.enumerable});return e};var ue=(e,t,s)=>(s=e!=null?ze(Ye(e)):{},Ze(t||!e||!e.__esModule?ae(s,"default",{value:e,enumerable:!0}):s,e));var Y=Xe((es,
|
|
3
|
-
`),v=!1;for(let
|
|
2
|
+
var ze=Object.create;var ae=Object.defineProperty;var Ke=Object.getOwnPropertyDescriptor;var Je=Object.getOwnPropertyNames;var Ye=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty;var Xe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ze=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Je(t))!Qe.call(e,o)&&o!==s&&ae(e,o,{get:()=>t[o],enumerable:!(i=Ke(t,o))||i.enumerable});return e};var ue=(e,t,s)=>(s=e!=null?ze(Ye(e)):{},Ze(t||!e||!e.__esModule?ae(s,"default",{value:e,enumerable:!0}):s,e));var Y=Xe((es,Ce)=>{"use strict";var K="\x1B",g=`${K}[`,mt="\x07",J={to(e,t){return t?`${g}${t+1};${e+1}H`:`${g}${e+1}G`},move(e,t){let s="";return e<0?s+=`${g}${-e}D`:e>0&&(s+=`${g}${e}C`),t<0?s+=`${g}${-t}A`:t>0&&(s+=`${g}${t}B`),s},up:(e=1)=>`${g}${e}A`,down:(e=1)=>`${g}${e}B`,forward:(e=1)=>`${g}${e}C`,backward:(e=1)=>`${g}${e}D`,nextLine:(e=1)=>`${g}E`.repeat(e),prevLine:(e=1)=>`${g}F`.repeat(e),left:`${g}G`,hide:`${g}?25l`,show:`${g}?25h`,save:`${K}7`,restore:`${K}8`},pt={up:(e=1)=>`${g}S`.repeat(e),down:(e=1)=>`${g}T`.repeat(e)},gt={screen:`${g}2J`,up:(e=1)=>`${g}1J`.repeat(e),down:(e=1)=>`${g}J`.repeat(e),line:`${g}2K`,lineEnd:`${g}K`,lineStart:`${g}1K`,lines(e){let t="";for(let s=0;s<e;s++)t+=this.line+(s<e-1?J.up():"");return e&&(t+=J.left),t}};Ce.exports={cursor:J,scroll:pt,erase:gt,beep:mt}});import{stdout as Se,stdin as ft}from"node:process";import $t from"node:readline";var ce=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let s=0;for(e.lastIndex=0;e.test(t);)s+=1;return t.length-s}})(),le=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,he=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||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>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141;var et=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,tt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,de=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,st=/\t{1,1000}/y,me=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,it=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,rt=/\p{M}+/gu,nt={limit:1/0,ellipsis:""},pe=(e,t={},s={})=>{let i=t.limit??1/0,o=t.ellipsis??"",c=t?.ellipsisWidth??(o?pe(o,nt,s).width:0),u=0,r=s.controlWidth??0,h=s.tabWidth??8,f=s.emojiWidth??2,v=2,m=s.regularWidth??1,p=s.wideWidth??v,b=[[it,m],[et,u],[tt,r],[st,h],[me,f],[de,p]],y=0,$=0,F=e.length,M=0,T=!1,L=F,D=Math.max(0,i-c),k=0,V=0,R=0,C=0;e:for(;;){if(V>k||$>=F&&$>y){let A=e.slice(k,V)||e.slice(y,$);M=0;for(let O of A.replaceAll(rt,"")){let S=O.codePointAt(0)||0;if(le(S)?C=v:he(S)?C=p:C=m,R+C>D&&(L=Math.min(L,Math.max(k,y)+M)),R+C>i){T=!0;break e}M+=O.length,R+=C}k=V=0}if($>=F)break e;for(let A=0,O=b.length;A<O;A++){let[S,oe]=b[A];if(S.lastIndex=$,S.test(e)){if(M=S===de?ce(e.slice($,S.lastIndex)):S===me?1:S.lastIndex-$,C=M*oe,R+C>D&&(L=Math.min(L,$+Math.floor((D-R)/oe))),R+C>i){T=!0;break e}R+=C,k=y,V=$,$=y=S.lastIndex;continue e}}$+=1}return{width:T?D:R,index:T?L:F,truncated:T,ellipsed:T&&i>=c}},ge=pe;var ot={limit:1/0,ellipsis:"",ellipsisWidth:0},at=(e,t={})=>ge(e,ot,t).width,E=at;var N="\x1B",be="\x9B",ut=39,H="\x07",we="[",ct="]",Ie="m",z=`${ct}8;;`,fe=new RegExp(`(?:\\${we}(?<code>\\d+)m|\\${z}(?<uri>.*)${H})`,"y"),$e=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},ye=e=>`${N}${we}${e}${Ie}`,ve=e=>`${N}${z}${e}${H}`,q=(e,t,s)=>{let i=t[Symbol.iterator](),o=!1,c=!1,u=e.at(-1),r=u===void 0?0:E(u),h=i.next(),f=i.next(),v=0;for(;!h.done;){let m=h.value,p=E(m);r+p<=s?e[e.length-1]+=m:(e.push(m),r=0),(m===N||m===be)&&(o=!0,c=t.startsWith(z,v+1)),o?c?m===H&&(o=!1,c=!1):m===Ie&&(o=!1):(r+=p,r===s&&!f.done&&(e.push(""),r=0)),h=f,f=i.next(),v+=m.length}u=e.at(-1),!r&&u!==void 0&&u.length&&e.length>1&&(e[e.length-2]+=e.pop())},lt=e=>{let t=e.split(" "),s=t.length;for(;s&&!E(t[s-1]);)s--;return s===t.length?e:t.slice(0,s).join(" ")+t.slice(s).join("")},ht=(e,t,s={})=>{if(s.trim!==!1&&e.trim()==="")return"";let i="",o,c,u=e.split(" "),r=[""],h=0;for(let m=0;m<u.length;m++){let p=u[m];if(s.trim!==!1){let y=r.at(-1)??"",$=y.trimStart();y.length!==$.length&&(r[r.length-1]=$,h=E($))}m!==0&&(h>=t&&(s.wordWrap===!1||s.trim===!1)&&(r.push(""),h=0),(h||s.trim===!1)&&(r[r.length-1]+=" ",h++));let b=E(p);if(s.hard&&b>t){let y=t-h,$=1+Math.floor((b-y-1)/t);Math.floor((b-1)/t)<$&&r.push(""),q(r,p,t),h=E(r.at(-1)??"");continue}if(h+b>t&&h&&b){if(s.wordWrap===!1&&h<t){q(r,p,t),h=E(r.at(-1)??"");continue}r.push(""),h=0}if(h+b>t&&s.wordWrap===!1){q(r,p,t),h=E(r.at(-1)??"");continue}r[r.length-1]+=p,h+=b}s.trim!==!1&&(r=r.map(m=>lt(m)));let f=r.join(`
|
|
3
|
+
`),v=!1;for(let m=0;m<f.length;m++){let p=f[m];if(i+=p,v)v=!1;else if(v=p>="\uD800"&&p<="\uDBFF",v)continue;if(p===N||p===be){fe.lastIndex=m+1;let y=fe.exec(f)?.groups;if(y?.code!==void 0){let $=Number.parseFloat(y.code);o=$===ut?void 0:$}else y?.uri!==void 0&&(c=y.uri.length===0?void 0:y.uri)}if(f[m+1]===`
|
|
4
4
|
`){c&&(i+=ve(""));let b=o?$e(o):void 0;o&&b&&(i+=ye(b))}else p===`
|
|
5
|
-
`&&(o&&$e(o)&&(i+=ye(o)),c&&(i+=ve(c)))}return i},
|
|
5
|
+
`&&(o&&$e(o)&&(i+=ye(o)),c&&(i+=ve(c)))}return i},dt=/\r?\n/;function P(e,t,s){return String(e).normalize().split(dt).map(i=>ht(i,t,s)).join(`
|
|
6
6
|
`)}var w=ue(Y(),1);var yt=["up","down","left","right","space","enter","cancel"],vt=["January","February","March","April","May","June","July","August","September","October","November","December"],x={actions:new Set(yt),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...vt],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(e,t)=>`There are only ${e} days in ${t}`,afterMin:e=>`Date must be on or after ${e.toISOString().slice(0,10)}`,beforeMax:e=>`Date must be on or before ${e.toISOString().slice(0,10)}`}}};function Ee(e,t){if(typeof e=="string")return x.aliases.get(e)===t;for(let s of e)if(s!==void 0&&Ee(s,t))return!0;return!1}function bt(e,t){if(e===t)return;let s=e.split(`
|
|
7
7
|
`),i=t.split(`
|
|
8
|
-
`),o=Math.max(s.length,i.length),c=[];for(let u=0;u<o;u++)s[u]!==i[u]&&c.push(u);return{lines:c,numLinesBefore:s.length,numLinesAfter:i.length,numLines:o}}var rs=globalThis.process.platform.startsWith("win"),Q=Symbol("clack:cancel");function G(e){return e===Q}function U(e,t){let s=e;s.isTTY&&s.setRawMode(t)}var _e=e=>"columns"in e&&typeof e.columns=="number"?e.columns:80,xe=e=>"rows"in e&&typeof e.rows=="number"?e.rows:20;function Re(e,t,s,i=s,o=s,c){let u=_e(e??
|
|
8
|
+
`),o=Math.max(s.length,i.length),c=[];for(let u=0;u<o;u++)s[u]!==i[u]&&c.push(u);return{lines:c,numLinesBefore:s.length,numLinesAfter:i.length,numLines:o}}var rs=globalThis.process.platform.startsWith("win"),Q=Symbol("clack:cancel");function G(e){return e===Q}function U(e,t){let s=e;s.isTTY&&s.setRawMode(t)}var _e=e=>"columns"in e&&typeof e.columns=="number"?e.columns:80,xe=e=>"rows"in e&&typeof e.rows=="number"?e.rows:20;function Re(e,t,s,i=s,o=s,c){let u=_e(e??Se);return P(t,u-s.length,{hard:!0,trim:!1}).split(`
|
|
9
9
|
`).map((r,h,f)=>{let v=c?c(r,h):r;return h===0?`${i}${v}`:h===f.length-1?`${o}${v}`:`${s}${v}`}).join(`
|
|
10
|
-
`)}var wt=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(e,t=!0){let{input:s=ft,output:i=
|
|
10
|
+
`)}var wt=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(e,t=!0){let{input:s=ft,output:i=Se,render:o,signal:c,...u}=e;this.opts=u,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=o.bind(this),this._track=t,this._abortSignal=c,this.input=s,this.output=i}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let s=this._subscribers.get(e)??[];s.push(t),this._subscribers.set(e,s)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let s=this._subscribers.get(e)??[],i=[];for(let o of s)o.cb(...t),o.once&&i.push(()=>s.splice(s.indexOf(o),1));for(let o of i)o()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(Q);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=$t.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),U(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(w.cursor.show),this.output.off("resize",this.render),U(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(w.cursor.show),this.output.off("resize",this.render),U(this.input,!1),e(Q)})})}_isActionKey(e,t){return e===" "}_shouldSubmit(e,t){return!0}_setValue(e){this.value=e,this.emit("value",this.value)}_setUserInput(e,t){this.userInput=e??"",this.emit("userInput",this.userInput),t&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(e,t){if(this._track&&t.name!=="return"&&(t.name&&this._isActionKey(e,t)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),t?.name&&(!this._track&&x.aliases.has(t.name)&&this.emit("cursor",x.aliases.get(t.name)),x.actions.has(t.name)&&this.emit("cursor",t.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),this.emit("key",e?.toLowerCase(),t),t?.name==="return"&&this._shouldSubmit(e,t)){if(this.opts.validate){let s=this.opts.validate(this.value);s&&(this.error=s instanceof Error?s.message:s,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}Ee([e,t?.name,t?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
11
11
|
`),U(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=P(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
|
|
12
12
|
`).length-1;this.output.write(w.cursor.move(-999,e*-1))}render(){let e=P(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(w.cursor.hide);else{let t=bt(this._prevFrame,e),s=xe(this.output);if(this.restoreCursor(),t){let i=Math.max(0,t.numLinesAfter-s),o=Math.max(0,t.numLinesBefore-s),c=t.lines.find(u=>u>=i);if(c===void 0){this._prevFrame=e;return}if(t.lines.length===1){this.output.write(w.cursor.move(0,c-o)),this.output.write(w.erase.lines(1));let u=e.split(`
|
|
13
13
|
`);this.output.write(u[c]),this._prevFrame=e,this.output.write(w.cursor.move(0,u.length-c-1));return}else if(t.lines.length>1){if(i<o)c=i;else{let r=c-o;r>0&&this.output.write(w.cursor.move(0,r))}this.output.write(w.erase.down());let u=e.split(`
|
|
14
14
|
`).slice(c);this.output.write(u.join(`
|
|
15
|
-
`)),this._prevFrame=e;return}}this.output.write(w.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};var B=class extends wt{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",s=>{this.output.write(w.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};import{styleText as l,stripVTControlCharacters as bs}from"node:util";import I from"node:process";var Me=ue(Y(),1);function It(){return I.platform!=="win32"?I.env.TERM!=="linux":!!I.env.CI||!!I.env.WT_SESSION||!!I.env.TERMINUS_SUBLIME||I.env.ConEmuTask==="{cmd::Cmder}"||I.env.TERM_PROGRAM==="Terminus-Sublime"||I.env.TERM_PROGRAM==="vscode"||I.env.TERM==="xterm-256color"||I.env.TERM==="alacritty"||I.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var
|
|
15
|
+
`)),this._prevFrame=e;return}}this.output.write(w.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};var B=class extends wt{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",s=>{this.output.write(w.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};import{styleText as l,stripVTControlCharacters as bs}from"node:util";import I from"node:process";var Me=ue(Y(),1);function It(){return I.platform!=="win32"?I.env.TERM!=="linux":!!I.env.CI||!!I.env.WT_SESSION||!!I.env.TERMINUS_SUBLIME||I.env.ConEmuTask==="{cmd::Cmder}"||I.env.TERM_PROGRAM==="Terminus-Sublime"||I.env.TERM_PROGRAM==="vscode"||I.env.TERM==="xterm-256color"||I.env.TERM==="alacritty"||I.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Ct=It();var d=(e,t)=>Ct?e:t,St=d("\u25C6","*"),Et=d("\u25A0","x"),_t=d("\u25B2","x"),Le=d("\u25C7","o"),Ss=d("\u250C","T"),_=d("\u2502","|"),ke=d("\u2514","\u2014"),Es=d("\u2510","T"),_s=d("\u2518","\u2014"),Te=d("\u25CF",">"),Fe=d("\u25CB"," "),xs=d("\u25FB","[\u2022]"),Rs=d("\u25FC","[+]"),Ts=d("\u25FB","[ ]"),Fs=d("\u25AA","\u2022"),Ms=d("\u2500","-"),Ls=d("\u256E","+"),ks=d("\u251C","+"),As=d("\u256F","+"),Ps=d("\u2570","+"),Ds=d("\u256D","+"),xt=d("\u25CF","\u2022"),Rt=d("\u25C6","*"),Tt=d("\u25B2","!"),Ft=d("\u25A0","x"),Mt=e=>{switch(e){case"initial":case"active":return l("cyan",St);case"cancel":return l("red",Et);case"error":return l("yellow",_t);case"submit":return l("green",Le)}};var Ae=e=>{let t=e.active??"Yes",s=e.inactive??"No";return new B({active:t,inactive:s,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let i=e.withGuide??x.withGuide,o=`${Mt(this.state)} `,c=i?`${l("gray",_)} `:"",u=Re(e.output,e.message,c,o),r=`${i?`${l("gray",_)}
|
|
16
16
|
`:""}${u}
|
|
17
17
|
`,h=this.value?t:s;switch(this.state){case"submit":{let f=i?`${l("gray",_)} `:"";return`${r}${f}${l("dim",h)}`}case"cancel":{let f=i?`${l("gray",_)} `:"";return`${r}${f}${l(["strikethrough","dim"],h)}${i?`
|
|
18
|
-
${l("gray",_)}`:""}`}default:{let f=i?`${l("cyan",_)} `:"",v=i?l("cyan",
|
|
18
|
+
${l("gray",_)}`:""}`}default:{let f=i?`${l("cyan",_)} `:"",v=i?l("cyan",ke):"";return`${r}${f}${this.value?`${l("green",Te)} ${t}`:`${l("dim",Fe)} ${l("dim",t)}`}${e.vertical?i?`
|
|
19
19
|
${l("cyan",_)} `:`
|
|
20
20
|
`:` ${l("dim","/")} `}${this.value?`${l("dim",Fe)} ${l("dim",s)}`:`${l("green",Te)} ${s}`}
|
|
21
21
|
${v}
|
|
22
|
-
`}}}}).prompt()};var n={message:(e=[],{symbol:t=l("gray",_),secondarySymbol:s=l("gray",_),output:i=process.stdout,spacing:o=1,withGuide:c}={})=>{let u=[],r=c??x.withGuide,h=r?s:"",f=r?`${t} `:"",v=r?`${s} `:"";for(let p=0;p<o;p++)u.push(h);let
|
|
23
|
-
`);if(
|
|
22
|
+
`}}}}).prompt()};var n={message:(e=[],{symbol:t=l("gray",_),secondarySymbol:s=l("gray",_),output:i=process.stdout,spacing:o=1,withGuide:c}={})=>{let u=[],r=c??x.withGuide,h=r?s:"",f=r?`${t} `:"",v=r?`${s} `:"";for(let p=0;p<o;p++)u.push(h);let m=Array.isArray(e)?e:e.split(`
|
|
23
|
+
`);if(m.length>0){let[p,...b]=m;p.length>0?u.push(`${f}${p}`):u.push(r?t:"");for(let y of b)y.length>0?u.push(`${v}${y}`):u.push(r?s:"")}i.write(`${u.join(`
|
|
24
24
|
`)}
|
|
25
|
-
`)},info:(e,t)=>{n.message(e,{...t,symbol:l("blue",xt)})},success:(e,t)=>{n.message(e,{...t,symbol:l("green",Rt)})},step:(e,t)=>{n.message(e,{...t,symbol:l("green",Le)})},warn:(e,t)=>{n.message(e,{...t,symbol:l("yellow",Tt)})},warning:(e,t)=>{n.warn(e,t)},error:(e,t)=>{n.message(e,{...t,symbol:l("red",Ft)})}},Pe=(e="",t)=>{let s=t?.output??process.stdout,i=t?.withGuide??x.withGuide?`${l("gray",
|
|
25
|
+
`)},info:(e,t)=>{n.message(e,{...t,symbol:l("blue",xt)})},success:(e,t)=>{n.message(e,{...t,symbol:l("green",Rt)})},step:(e,t)=>{n.message(e,{...t,symbol:l("green",Le)})},warn:(e,t)=>{n.message(e,{...t,symbol:l("yellow",Tt)})},warning:(e,t)=>{n.warn(e,t)},error:(e,t)=>{n.message(e,{...t,symbol:l("red",Ft)})}},Pe=(e="",t)=>{let s=t?.output??process.stdout,i=t?.withGuide??x.withGuide?`${l("gray",ke)} `:"";s.write(`${i}${l("red",e)}
|
|
26
26
|
|
|
27
|
-
`)};var Os={light:m("\u2500","-"),heavy:m("\u2501","="),block:m("\u2588","#")};var Vs=`${l("gray",_)} `;import{spawnSync as We}from"child_process";import{existsSync as Lt,readFileSync as At,writeFileSync as Gs,mkdirSync as Ws}from"fs";import kt from"os";import Ve from"path";var Pt=Ve.join(kt.homedir(),".eazy-git"),De=Ve.join(Pt,"config.json"),Oe={language:"es",defaultBaseBranch:"release",aiProvider:"claude"};function Ne(){try{if(Lt(De)){let e=At(De,"utf-8");return{...Oe,...JSON.parse(e)}}}catch{}return{...Oe}}var Ue={welcome:"Bienvenido a",subtitle:"tu CLI de confianza para gestionar ramas en GIT",operationCompleted:"Operacion completada!",operationCancelled:"Operacion cancelada. Saliendo...",unknownCommand:"Comando desconocido",errorExecuting:"Error al ejecutar el comando",version:"eazy-git version",whatToDo:"Que deseas hacer?",addChanges:"Agregar cambios a una rama",createOriginal:"Crear rama original",createTemporal:"Crear rama temporal",notGitRepo:"Este directorio no es un repositorio git",gitNotInstalled:"git no esta instalado en el sistema",currentBranch:"Branch actual",filesChanged:"Archivos con cambios",noChangesPending:"No hay cambios pendientes. Deseas continuar de todas formas?",updatingRefs:"Actualizando referencias remotas...",refsUpdated:"Referencias actualizadas",fetchFailed:"No se pudo hacer fetch (continuando...)",baseBranch:"Desde que branch base quieres crear la rama?",baseBranchRequired:"El branch base es requerido",ticketId:"Cual es el identificador del ticket? (ej: DPW-0000)",ticketRequired:"El ticket es requerido",changeType:"Que tipo de cambio es?",branchExistsLocal:e=>`La rama "${e}" ya existe localmente. Que deseas hacer?`,switchToIt:"Cambiarme a ella y continuar",cancel:"Cancelar",cancelledOp:"Operacion cancelada.",creatingBranch:(e,t)=>`Creando rama ${e} desde origin/${t}...`,branchCreated:e=>`Rama ${e} creada`,errorCreatingBranch:e=>`Error al crear la rama: ${e}`,noFilesToStage:"No hay archivos para stagear.",selectFiles:"Cuales archivos quieres incluir en el commit?",selectAllFiles:"Seleccionar todos los archivos",stagedFiles:"Archivos en stage",stagedCorrect:"Los archivos en stage son correctos?",aiProvider:"Con que IA quieres generar la sugerencia de commit?",generatingCommit:e=>`Generando sugerencia de commit con ${e}...`,aiSuggestionFailed:e=>`No se pudo obtener sugerencia de ${e}. Escribe el mensaje manualmente.`,writeCommitMsg:"Escribe el mensaje de commit:",commitMsgRequired:"El mensaje es requerido",suggestionOf:e=>`Sugerencia de ${e}`,useThisCommit:"Este mensaje de commit te parece bien?",yesUseIt:"Si, usar este",modify:"Modificar",commitSuccess:"Commit realizado correctamente",hookBlocked:"El pre-commit hook bloqueo el commit. Que deseas hacer?",retryHook:"Ya lo corregi, agrega los cambios y vuelve a intentarlo",skipHook:"Saltar el hook (--no-verify)",commitNoHooks:"Commit realizado (sin hooks)",pushToRemote:"Deseas subir la rama al repositorio remoto?",pushSuccess:"Push realizado",pushForceQuestion:"La rama ya existe en el remoto con historial diferente. Deseas forzar el push? (git push -f)",pushForceSuccess:"Push forzado realizado",pushForceError:e=>`Error en el push forzado: ${e}`,pushError:e=>`Error en el push: ${e}`,summaryTitle:"Resumen",summaryBranch:"Rama",summaryFrom:"Desde",summaryCommit:"Commit",summaryFiles:e=>`${e} archivos commiteados`,summaryPush:"Push",summaryPR:"Crear PR",statusModified:"modificado",statusAdded:"agregado",statusDeleted:"eliminado",statusRenamed:"renombrado",statusUntracked:"sin rastrear",commitTypes:{fix:"fix \u2014 correccion de bug",feat:"feat \u2014 nueva funcionalidad",refactor:"refactor \u2014 mejora sin cambio funcional",chore:"chore \u2014 mantenimiento, dependencias",docs:"docs \u2014 documentacion",test:"test \u2014 pruebas",ci:"ci \u2014 integracion continua",perf:"perf \u2014 rendimiento",style:"style \u2014 formato, sin cambio de logica"},selectBranchType:"Selecciona el tipo de rama:",branchFix:"Fix",branchImprovement:"Mejora",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creando rama original...",branchCreatedAndPushed:e=>`Rama "${e}" creada y pusheada correctamente!`,branchCreatedSuccess:e=>`Rama "${e}" creada correctamente!`,mergeBranchQuestion:"A que rama deseas hacer merge?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Rama temporal creada correctamente",temporalBranchMerged:"Rama temporal mergeada correctamente",conflictsDetected:"Conflictos detectados. Resolvelos manualmente!",branchPushedToRemote:"Rama pusheada al repositorio remoto",removeTemporalBranch:"Deseas eliminar la rama temporal?",temporalBranchDeleted:"Rama temporal eliminada correctamente",errorCreatingTemporal:"Error creando la rama temporal",enterJiraCode:"Ingresa el codigo del ticket JIRA:",jiraRequired:"El codigo JIRA es requerido!",jiraInvalidFormat:"El codigo JIRA debe tener el formato DPW-0000",fetchingRemote:"Obteniendo cambios remotos...",pullingChanges:"Aplicando cambios en tu rama...",pullError:e=>`Error: ${e}`,pushingChanges:"Subiendo cambios al remoto...",pushedSuccess:"Cambios subidos correctamente!",pushedForceSuccess:"Cambios subidos (forzado) correctamente!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Proporciona un mensaje de commit",stagingChanges:"Stageando cambios...",creatingCommit:"Creando commit...",commitCreated:"Commit creado correctamente!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Cambiando a la rama anterior...",switchedTo:e=>`Cambiado a rama ${e} correctamente!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Obteniendo ultimos cambios...",mergingWith:e=>`Mergeando con ${e}...`,pushingMerged:"Subiendo cambios mergeados...",mergeCompleted:"Merge completado correctamente!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Eliminando ultimo commit...",removeLastConfirm:"Esto eliminara el ultimo commit (los cambios se mantienen en staging). Continuar?",lastCommitRemoved:"Ultimo commit eliminado correctamente!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Configurando tu entorno",configSaved:"Configuracion guardada",missingConfigValues:"Faltan valores de configuracion requeridos.",errorWritingConfig:"Error escribiendo archivo de configuracion:",currentConfig:"Configuracion actual",useThisConfig:"Deseas usar esta configuracion?",installingDeps:"Instalando dependencias...",depsInstalled:"Todas las dependencias fueron instaladas",authFailed:"Autenticacion fallida",unexpectedError:"Ocurrio un error inesperado",enterEndpoint:"Ingresa la URL del endpoint:",urlRequired:"La URL es requerida!",urlMustBeHttp:"La URL debe usar protocolo HTTP/HTTPS",urlMustHaveHost:"La URL debe incluir un hostname",urlInvalid:"Ingresa una URL valida",enterApiKey:"Ingresa tu apikey:",apiKeyRequired:"El API key es requerido!",enterRegistryName:"Ingresa el nombre del registro NPM (sin caracteres especiales):",registryNameRequired:"El nombre del registro es requerido!",registryNameLettersOnly:"El nombre del registro debe contener solo letras",enterRegistryURL:"Ingresa la URL del registro NPM (sin http/https):",registryURLRequired:"La URL del registro es requerida!",registryURLStartWithName:"La URL debe empezar con un nombre, evita caracteres especiales",registryURLNoProtocol:"La URL no debe incluir protocolo 'http/https' y debe empezar con una letra",registryURLNoSlash:"La URL no debe empezar con '/' y debe empezar con una letra o numero",registryURLNoWWW:"La URL no debe empezar con 'www' y debe empezar con una letra o numero",languageSelect:"Selecciona el idioma de la interfaz:",languageChanged:e=>`Idioma cambiado a: ${e}`,configMenu:"Que deseas configurar?",configLanguage:"Cambiar idioma",configDefaultBranch:"Rama base por defecto",configAIProvider:"Proveedor de IA por defecto",configView:"Ver configuracion actual",defaultBranchSet:e=>`Rama base por defecto: ${e}`,aiProviderSet:e=>`Proveedor de IA por defecto: ${e}`,goBack:"Volver"};var Be={welcome:"Welcome to",subtitle:"your trusted CLI for GIT branch management",operationCompleted:"Operation completed!",operationCancelled:"Operation cancelled. Exiting...",unknownCommand:"Unknown command",errorExecuting:"Error executing command",version:"eazy-git version",whatToDo:"What would you like to do?",addChanges:"Add Changes to Branch",createOriginal:"Create Original Branch",createTemporal:"Create Temporal Branch",notGitRepo:"This directory is not a git repository",gitNotInstalled:"git is not installed on the system",currentBranch:"Current branch",filesChanged:"Files with changes",noChangesPending:"No pending changes. Do you want to continue anyway?",updatingRefs:"Updating remote references...",refsUpdated:"References updated",fetchFailed:"Could not fetch (continuing...)",baseBranch:"From which base branch do you want to create the branch?",baseBranchRequired:"Base branch is required",ticketId:"What is the ticket identifier? (e.g.: DPW-0000)",ticketRequired:"Ticket is required",changeType:"What type of change is this?",branchExistsLocal:e=>`Branch "${e}" already exists locally. What would you like to do?`,switchToIt:"Switch to it and continue",cancel:"Cancel",cancelledOp:"Operation cancelled.",creatingBranch:(e,t)=>`Creating branch ${e} from origin/${t}...`,branchCreated:e=>`Branch ${e} created`,errorCreatingBranch:e=>`Error creating branch: ${e}`,noFilesToStage:"No files to stage.",selectFiles:"Which files do you want to include in the commit?",selectAllFiles:"Select all files",stagedFiles:"Staged files",stagedCorrect:"Are the staged files correct?",aiProvider:"Which AI do you want to use for the commit suggestion?",generatingCommit:e=>`Generating commit suggestion with ${e}...`,aiSuggestionFailed:e=>`Could not get suggestion from ${e}. Write the message manually.`,writeCommitMsg:"Write the commit message:",commitMsgRequired:"Message is required",suggestionOf:e=>`${e} suggestion`,useThisCommit:"Does this commit message look good?",yesUseIt:"Yes, use it",modify:"Modify",commitSuccess:"Commit created successfully",hookBlocked:"The pre-commit hook blocked the commit. What would you like to do?",retryHook:"I fixed it, re-stage and retry",skipHook:"Skip the hook (--no-verify)",commitNoHooks:"Commit created (without hooks)",pushToRemote:"Do you want to push the branch to the remote repository?",pushSuccess:"Push completed",pushForceQuestion:"The branch already exists on remote with different history. Force push? (git push -f)",pushForceSuccess:"Force push completed",pushForceError:e=>`Error in force push: ${e}`,pushError:e=>`Error in push: ${e}`,summaryTitle:"Summary",summaryBranch:"Branch",summaryFrom:"From",summaryCommit:"Commit",summaryFiles:e=>`${e} files committed`,summaryPush:"Push",summaryPR:"Create PR",statusModified:"modified",statusAdded:"added",statusDeleted:"deleted",statusRenamed:"renamed",statusUntracked:"untracked",commitTypes:{fix:"fix - bug fix",feat:"feat - new feature",refactor:"refactor - improvement without functional change",chore:"chore - maintenance, dependencies",docs:"docs - documentation",test:"test - testing",ci:"ci - continuous integration",perf:"perf - performance",style:"style - formatting, no logic change"},selectBranchType:"Select the branch type:",branchFix:"Fix",branchImprovement:"Improvement",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creating original branch...",branchCreatedAndPushed:e=>`Branch "${e}" created and pushed successfully!`,branchCreatedSuccess:e=>`Branch "${e}" created successfully!`,mergeBranchQuestion:"Which branch do you want to merge into?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Temporal branch created successfully",temporalBranchMerged:"Temporal branch merged successfully",conflictsDetected:"Conflicts detected. Please resolve them manually!",branchPushedToRemote:"Branch pushed to remote repository",removeTemporalBranch:"Do you want to remove the temporal branch?",temporalBranchDeleted:"Temporal branch deleted successfully",errorCreatingTemporal:"Error creating the temporal branch",enterJiraCode:"Enter the JIRA ticket code:",jiraRequired:"JIRA code is required!",jiraInvalidFormat:"JIRA code must have the format DPW-0000",fetchingRemote:"Fetching remote changes...",pullingChanges:"Pulling changes into your branch...",pullError:e=>`Error: ${e}`,pushingChanges:"Pushing changes to remote...",pushedSuccess:"Changes pushed successfully!",pushedForceSuccess:"Changes pushed (force) successfully!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Please provide a commit message",stagingChanges:"Staging changes...",creatingCommit:"Creating commit...",commitCreated:"Commit created successfully!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Switching to previous branch...",switchedTo:e=>`Successfully switched to ${e} branch!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Fetching latest changes...",mergingWith:e=>`Merging with ${e}...`,pushingMerged:"Pushing merged changes...",mergeCompleted:"Merge completed successfully!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Removing last commit...",removeLastConfirm:"This will remove the last commit (changes will remain in staging). Continue?",lastCommitRemoved:"Last commit removed successfully!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Setting up your configuration",configSaved:"Configuration saved",missingConfigValues:"Missing required configuration values.",errorWritingConfig:"Error writing configuration file:",currentConfig:"Current configuration",useThisConfig:"Would you like to use this configuration?",installingDeps:"Installing dependencies...",depsInstalled:"All dependencies were installed",authFailed:"Authentication failed",unexpectedError:"An unexpected error occurred",enterEndpoint:"Enter your endpoint URL:",urlRequired:"URL is required!",urlMustBeHttp:"URL must use HTTP/HTTPS protocol",urlMustHaveHost:"URL must include a hostname",urlInvalid:"Please enter a valid URL",enterApiKey:"Enter your apikey:",apiKeyRequired:"API key is required!",enterRegistryName:"Enter your NPM registry name (without special characters):",registryNameRequired:"Registry name is required!",registryNameLettersOnly:"Registry name must contain only letters",enterRegistryURL:"Enter your NPM registry URL (without http/https):",registryURLRequired:"Registry URL is required!",registryURLStartWithName:"URL must start with a name only, avoid special characters",registryURLNoProtocol:"URL must not include 'http/https' protocol and must start with a letter",registryURLNoSlash:"URL must not start with '/' and must begin with a letter or number",registryURLNoWWW:"URL must not start with 'www' and must begin with a letter or number",languageSelect:"Select the interface language:",languageChanged:e=>`Language changed to: ${e}`,configMenu:"What would you like to configure?",configLanguage:"Change language",configDefaultBranch:"Default base branch",configAIProvider:"Default AI provider",configView:"View current configuration",defaultBranchSet:e=>`Default base branch: ${e}`,aiProviderSet:e=>`Default AI provider: ${e}`,goBack:"Go back"};var Ge={es:Ue,en:Be};function a(e,...t){let i=Ne().language||"es",c=(Ge[i]||Ge.es)[e];return typeof c=="function"?c(...t):c||e}function X(){if(n.step(a("fetchingRemote")),We("git",["fetch"],{stdio:"inherit"}).status!==0){n.error(a("pullError","fetch failed"));return}n.step(a("pullingChanges")),We("git",["pull","origin","HEAD"],{stdio:"inherit"}).status!==0&&n.error(a("pullError","pull failed"))}import{spawnSync as Dt}from"child_process";function Z(e){let t=e.includes("-f")||e.includes("--force")||e.includes("-force");n.step(a("pushingChanges")),Dt("git",t?["push","-f","origin","HEAD"]:["push","origin","HEAD"],{stdio:"inherit"}).status===0?n.success(t?a("pushedForceSuccess"):a("pushedSuccess")):n.error(a("pushQuickError","push failed"))}import{spawnSync as Ot}from"child_process";function ee(e){if(G(e))return Pe(a("operationCancelled")),process.exit(0)}async function te(){let e=await ke({message:a("removeLastConfirm")});if(ee(e),!e)return;n.step(a("removingLastCommit")),Ot("git",["reset","--soft","HEAD~1"],{stdio:"inherit"}).status===0?n.success(a("lastCommitRemoved")):n.error(a("removeLastError","reset failed"))}import{spawnSync as se}from"child_process";function ie(e){let t=e[0]??"develop";if(n.step(a("fetchingLatest")),se("git",["fetch"],{stdio:"inherit"}),n.step(a("mergingWith",t)),se("git",["merge",`origin/${t}`],{stdio:"inherit"}).status!==0){n.error(a("mergeError","merge failed"));return}n.step(a("pushingMerged")),se("git",["push","origin","HEAD"],{stdio:"inherit"}).status===0?n.success(a("mergeCompleted")):n.error(a("mergeError","push failed"))}import{spawnSync as je}from"child_process";function re(e){let t=e[0];t||(n.error(a("provideCommitMsg")),process.exit(1)),n.step(a("stagingChanges")),je("git",["add","."],{stdio:"inherit"}),n.step(a("creatingCommit")),je("git",["commit","-m",t],{stdio:"inherit"}).status===0?n.success(a("commitCreated")):n.error(a("commitError","commit failed"))}import{spawnSync as Vt}from"child_process";function ne(){Vt("git",["log"],{stdio:"inherit"}).status!==0&&(n.error(a("logError","git log failed")),process.exit(1))}import{spawnSync as Nt}from"child_process";function W(e){let t=e[0]||"-",s=t==="-";s&&n.step(a("switchingPrevBranch")),Nt("git",["checkout",t],{stdio:"inherit"}).status===0?n.success(a("switchedTo",s?"previous":t)):(n.error(a("checkoutError","checkout failed")),process.exit(1))}import{existsSync as Ut}from"fs";import{join as Bt}from"path";import{execSync as Gt}from"child_process";var Wt=()=>{try{Gt("git --version",{stdio:"ignore"})}catch{n.error(a("gitNotInstalled")),process.exit(1)}let e=Bt(process.cwd(),".git");Ut(e)||(n.error(a("notGitRepo")),process.exit(1))},qe=Wt;qe();var He=process.argv[1].split("/").pop(),j=process.argv.slice(2),jt={pull:X,push:()=>Z(j),removelast:te,mergewith:()=>ie(j),commit:()=>re(j),checkout:()=>W(j),back:()=>W("-"),log:ne};async function qt(){try{let e=jt[He];e||(n.error(`${a("unknownCommand")}: ${He}`),process.exit(1)),await e(),process.exit(0)}catch(e){n.error(`${a("errorExecuting")}: ${e.message}`),process.exit(1)}}qt();
|
|
27
|
+
`)};var Vs={light:d("\u2500","-"),heavy:d("\u2501","="),block:d("\u2588","#")};var Os=`${l("gray",_)} `;import{spawnSync as We}from"child_process";import{existsSync as Lt,readFileSync as kt,writeFileSync as Gs,mkdirSync as Ws}from"fs";import At from"os";import Oe from"path";var Pt=Oe.join(At.homedir(),".eazy-git"),De=Oe.join(Pt,"config.json"),Ve={language:"es",defaultBaseBranch:"release",aiProvider:"claude"};function Ne(){try{if(Lt(De)){let e=kt(De,"utf-8");return{...Ve,...JSON.parse(e)}}}catch{}return{...Ve}}var Ue={welcome:"Bienvenido a",subtitle:"tu CLI de confianza para gestionar ramas en GIT",operationCompleted:"Operacion completada!",operationCancelled:"Operacion cancelada. Saliendo...",unknownCommand:"Comando desconocido",errorExecuting:"Error al ejecutar el comando",version:"eazy-git version",whatToDo:"Que deseas hacer?",addChanges:"Agregar cambios a una rama",createOriginal:"Crear rama original",createTemporal:"Crear rama temporal",notGitRepo:"Este directorio no es un repositorio git",gitNotInstalled:"git no esta instalado en el sistema",currentBranch:"Branch actual",filesChanged:"Archivos con cambios",noChangesPending:"No hay cambios pendientes. Deseas continuar de todas formas?",updatingRefs:"Actualizando referencias remotas...",refsUpdated:"Referencias actualizadas",fetchFailed:"No se pudo hacer fetch (continuando...)",baseBranch:"Desde que branch base quieres crear la rama?",baseBranchRequired:"El branch base es requerido",ticketId:"Cual es el identificador del ticket? (ej: DPW-0000)",ticketRequired:"El ticket es requerido",changeType:"Que tipo de cambio es?",branchExistsLocal:e=>`La rama "${e}" ya existe localmente. Que deseas hacer?`,switchToIt:"Cambiarme a ella y continuar",cancel:"Cancelar",cancelledOp:"Operacion cancelada.",creatingBranch:(e,t)=>`Creando rama ${e} desde origin/${t}...`,branchCreated:e=>`Rama ${e} creada`,errorCreatingBranch:e=>`Error al crear la rama: ${e}`,noFilesToStage:"No hay archivos para stagear.",selectFiles:"Cuales archivos quieres incluir en el commit?",selectAllFiles:"Seleccionar todos los archivos",stagedFiles:"Archivos en stage",stagedCorrect:"Los archivos en stage son correctos?",aiProvider:"Con que IA quieres generar la sugerencia de commit?",generatingCommit:e=>`Generando sugerencia de commit con ${e}...`,aiSuggestionFailed:e=>`No se pudo obtener sugerencia de ${e}. Escribe el mensaje manualmente.`,writeCommitMsg:"Escribe el mensaje de commit:",commitMsgRequired:"El mensaje es requerido",suggestionOf:e=>`Sugerencia de ${e}`,useThisCommit:"Este mensaje de commit te parece bien?",yesUseIt:"Si, usar este",modify:"Modificar",commitSuccess:"Commit realizado correctamente",hookBlocked:"El pre-commit hook bloqueo el commit. Que deseas hacer?",retryHook:"Ya lo corregi, agrega los cambios y vuelve a intentarlo",skipHook:"Saltar el hook (--no-verify)",commitNoHooks:"Commit realizado (sin hooks)",pushToRemote:"Deseas subir la rama al repositorio remoto?",pushSuccess:"Push realizado",pushForceQuestion:"La rama ya existe en el remoto con historial diferente. Deseas forzar el push? (git push -f)",pushForceSuccess:"Push forzado realizado",pushForceError:e=>`Error en el push forzado: ${e}`,pushError:e=>`Error en el push: ${e}`,summaryTitle:"Resumen",summaryBranch:"Rama",summaryFrom:"Desde",summaryCommit:"Commit",summaryFiles:e=>`${e} archivos commiteados`,summaryPush:"Push",summaryPR:"Crear PR",statusModified:"modificado",statusAdded:"agregado",statusDeleted:"eliminado",statusRenamed:"renombrado",statusUntracked:"sin rastrear",commitTypes:{fix:"fix \u2014 correccion de bug",feat:"feat \u2014 nueva funcionalidad",refactor:"refactor \u2014 mejora sin cambio funcional",chore:"chore \u2014 mantenimiento, dependencias",docs:"docs \u2014 documentacion",test:"test \u2014 pruebas",ci:"ci \u2014 integracion continua",perf:"perf \u2014 rendimiento",style:"style \u2014 formato, sin cambio de logica"},selectBranchType:"Selecciona el tipo de rama:",branchFix:"Fix",branchImprovement:"Mejora",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creando rama original...",branchCreatedAndPushed:e=>`Rama "${e}" creada y pusheada correctamente!`,branchCreatedSuccess:e=>`Rama "${e}" creada correctamente!`,mergeBranchQuestion:"A que rama deseas hacer merge?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Rama temporal creada correctamente",temporalBranchMerged:"Rama temporal mergeada correctamente",conflictsDetected:"Conflictos detectados. Resolvelos manualmente!",branchPushedToRemote:"Rama pusheada al repositorio remoto",removeTemporalBranch:"Deseas eliminar la rama temporal?",temporalBranchDeleted:"Rama temporal eliminada correctamente",errorCreatingTemporal:"Error creando la rama temporal",enterJiraCode:"Ingresa el codigo del ticket JIRA:",jiraRequired:"El codigo JIRA es requerido!",jiraInvalidFormat:"El codigo JIRA debe tener el formato DPW-0000",fetchingRemote:"Obteniendo cambios remotos...",pullingChanges:"Aplicando cambios en tu rama...",pullError:e=>`Error: ${e}`,pushingChanges:"Subiendo cambios al remoto...",pushedSuccess:"Cambios subidos correctamente!",pushedForceSuccess:"Cambios subidos (forzado) correctamente!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Proporciona un mensaje de commit",stagingChanges:"Stageando cambios...",creatingCommit:"Creando commit...",commitCreated:"Commit creado correctamente!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Cambiando a la rama anterior...",switchedTo:e=>`Cambiado a rama ${e} correctamente!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Obteniendo ultimos cambios...",mergingWith:e=>`Mergeando con ${e}...`,pushingMerged:"Subiendo cambios mergeados...",mergeCompleted:"Merge completado correctamente!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Eliminando ultimo commit...",removeLastConfirm:"Esto eliminara el ultimo commit (los cambios se mantienen en staging). Continuar?",lastCommitRemoved:"Ultimo commit eliminado correctamente!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Configurando tu entorno",configSaved:"Configuracion guardada",missingConfigValues:"Faltan valores de configuracion requeridos.",errorWritingConfig:"Error escribiendo archivo de configuracion:",currentConfig:"Configuracion actual",useThisConfig:"Deseas usar esta configuracion?",installingDeps:"Instalando dependencias...",depsInstalled:"Todas las dependencias fueron instaladas",authFailed:"Autenticacion fallida",unexpectedError:"Ocurrio un error inesperado",enterEndpoint:"Ingresa la URL del endpoint:",urlRequired:"La URL es requerida!",urlMustBeHttp:"La URL debe usar protocolo HTTP/HTTPS",urlMustHaveHost:"La URL debe incluir un hostname",urlInvalid:"Ingresa una URL valida",enterApiKey:"Ingresa tu apikey:",apiKeyRequired:"El API key es requerido!",enterRegistryName:"Ingresa el nombre del registro NPM (sin caracteres especiales):",registryNameRequired:"El nombre del registro es requerido!",registryNameLettersOnly:"El nombre del registro debe contener solo letras",enterRegistryURL:"Ingresa la URL del registro NPM (sin http/https):",registryURLRequired:"La URL del registro es requerida!",registryURLStartWithName:"La URL debe empezar con un nombre, evita caracteres especiales",registryURLNoProtocol:"La URL no debe incluir protocolo 'http/https' y debe empezar con una letra",registryURLNoSlash:"La URL no debe empezar con '/' y debe empezar con una letra o numero",registryURLNoWWW:"La URL no debe empezar con 'www' y debe empezar con una letra o numero",currentVersionLabel:"Version actual",checkingUpdates:"Buscando actualizaciones...",upgradeCheckFailed:"No se pudo verificar la ultima version",alreadyLatest:e=>`Ya tienes la ultima version (${e})`,upgrading:e=>`Actualizando a v${e}...`,upgradeError:"Error al actualizar eazy-git",upgradeSuccess:e=>`eazy-git actualizado a v${e}!`,languageSelect:"Selecciona el idioma de la interfaz:",languageChanged:e=>`Idioma cambiado a: ${e}`,configMenu:"Que deseas configurar?",configLanguage:"Cambiar idioma",configDefaultBranch:"Rama base por defecto",configAIProvider:"Proveedor de IA por defecto",configView:"Ver configuracion actual",defaultBranchSet:e=>`Rama base por defecto: ${e}`,aiProviderSet:e=>`Proveedor de IA por defecto: ${e}`,goBack:"Volver"};var Be={welcome:"Welcome to",subtitle:"your trusted CLI for GIT branch management",operationCompleted:"Operation completed!",operationCancelled:"Operation cancelled. Exiting...",unknownCommand:"Unknown command",errorExecuting:"Error executing command",version:"eazy-git version",whatToDo:"What would you like to do?",addChanges:"Add Changes to Branch",createOriginal:"Create Original Branch",createTemporal:"Create Temporal Branch",notGitRepo:"This directory is not a git repository",gitNotInstalled:"git is not installed on the system",currentBranch:"Current branch",filesChanged:"Files with changes",noChangesPending:"No pending changes. Do you want to continue anyway?",updatingRefs:"Updating remote references...",refsUpdated:"References updated",fetchFailed:"Could not fetch (continuing...)",baseBranch:"From which base branch do you want to create the branch?",baseBranchRequired:"Base branch is required",ticketId:"What is the ticket identifier? (e.g.: DPW-0000)",ticketRequired:"Ticket is required",changeType:"What type of change is this?",branchExistsLocal:e=>`Branch "${e}" already exists locally. What would you like to do?`,switchToIt:"Switch to it and continue",cancel:"Cancel",cancelledOp:"Operation cancelled.",creatingBranch:(e,t)=>`Creating branch ${e} from origin/${t}...`,branchCreated:e=>`Branch ${e} created`,errorCreatingBranch:e=>`Error creating branch: ${e}`,noFilesToStage:"No files to stage.",selectFiles:"Which files do you want to include in the commit?",selectAllFiles:"Select all files",stagedFiles:"Staged files",stagedCorrect:"Are the staged files correct?",aiProvider:"Which AI do you want to use for the commit suggestion?",generatingCommit:e=>`Generating commit suggestion with ${e}...`,aiSuggestionFailed:e=>`Could not get suggestion from ${e}. Write the message manually.`,writeCommitMsg:"Write the commit message:",commitMsgRequired:"Message is required",suggestionOf:e=>`${e} suggestion`,useThisCommit:"Does this commit message look good?",yesUseIt:"Yes, use it",modify:"Modify",commitSuccess:"Commit created successfully",hookBlocked:"The pre-commit hook blocked the commit. What would you like to do?",retryHook:"I fixed it, re-stage and retry",skipHook:"Skip the hook (--no-verify)",commitNoHooks:"Commit created (without hooks)",pushToRemote:"Do you want to push the branch to the remote repository?",pushSuccess:"Push completed",pushForceQuestion:"The branch already exists on remote with different history. Force push? (git push -f)",pushForceSuccess:"Force push completed",pushForceError:e=>`Error in force push: ${e}`,pushError:e=>`Error in push: ${e}`,summaryTitle:"Summary",summaryBranch:"Branch",summaryFrom:"From",summaryCommit:"Commit",summaryFiles:e=>`${e} files committed`,summaryPush:"Push",summaryPR:"Create PR",statusModified:"modified",statusAdded:"added",statusDeleted:"deleted",statusRenamed:"renamed",statusUntracked:"untracked",commitTypes:{fix:"fix - bug fix",feat:"feat - new feature",refactor:"refactor - improvement without functional change",chore:"chore - maintenance, dependencies",docs:"docs - documentation",test:"test - testing",ci:"ci - continuous integration",perf:"perf - performance",style:"style - formatting, no logic change"},selectBranchType:"Select the branch type:",branchFix:"Fix",branchImprovement:"Improvement",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creating original branch...",branchCreatedAndPushed:e=>`Branch "${e}" created and pushed successfully!`,branchCreatedSuccess:e=>`Branch "${e}" created successfully!`,mergeBranchQuestion:"Which branch do you want to merge into?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Temporal branch created successfully",temporalBranchMerged:"Temporal branch merged successfully",conflictsDetected:"Conflicts detected. Please resolve them manually!",branchPushedToRemote:"Branch pushed to remote repository",removeTemporalBranch:"Do you want to remove the temporal branch?",temporalBranchDeleted:"Temporal branch deleted successfully",errorCreatingTemporal:"Error creating the temporal branch",enterJiraCode:"Enter the JIRA ticket code:",jiraRequired:"JIRA code is required!",jiraInvalidFormat:"JIRA code must have the format DPW-0000",fetchingRemote:"Fetching remote changes...",pullingChanges:"Pulling changes into your branch...",pullError:e=>`Error: ${e}`,pushingChanges:"Pushing changes to remote...",pushedSuccess:"Changes pushed successfully!",pushedForceSuccess:"Changes pushed (force) successfully!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Please provide a commit message",stagingChanges:"Staging changes...",creatingCommit:"Creating commit...",commitCreated:"Commit created successfully!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Switching to previous branch...",switchedTo:e=>`Successfully switched to ${e} branch!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Fetching latest changes...",mergingWith:e=>`Merging with ${e}...`,pushingMerged:"Pushing merged changes...",mergeCompleted:"Merge completed successfully!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Removing last commit...",removeLastConfirm:"This will remove the last commit (changes will remain in staging). Continue?",lastCommitRemoved:"Last commit removed successfully!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Setting up your configuration",configSaved:"Configuration saved",missingConfigValues:"Missing required configuration values.",errorWritingConfig:"Error writing configuration file:",currentConfig:"Current configuration",useThisConfig:"Would you like to use this configuration?",installingDeps:"Installing dependencies...",depsInstalled:"All dependencies were installed",authFailed:"Authentication failed",unexpectedError:"An unexpected error occurred",enterEndpoint:"Enter your endpoint URL:",urlRequired:"URL is required!",urlMustBeHttp:"URL must use HTTP/HTTPS protocol",urlMustHaveHost:"URL must include a hostname",urlInvalid:"Please enter a valid URL",enterApiKey:"Enter your apikey:",apiKeyRequired:"API key is required!",enterRegistryName:"Enter your NPM registry name (without special characters):",registryNameRequired:"Registry name is required!",registryNameLettersOnly:"Registry name must contain only letters",enterRegistryURL:"Enter your NPM registry URL (without http/https):",registryURLRequired:"Registry URL is required!",registryURLStartWithName:"URL must start with a name only, avoid special characters",registryURLNoProtocol:"URL must not include 'http/https' protocol and must start with a letter",registryURLNoSlash:"URL must not start with '/' and must begin with a letter or number",registryURLNoWWW:"URL must not start with 'www' and must begin with a letter or number",currentVersionLabel:"Current version",checkingUpdates:"Checking for updates...",upgradeCheckFailed:"Could not check the latest version",alreadyLatest:e=>`Already on the latest version (${e})`,upgrading:e=>`Upgrading to v${e}...`,upgradeError:"Error upgrading eazy-git",upgradeSuccess:e=>`eazy-git upgraded to v${e}!`,languageSelect:"Select the interface language:",languageChanged:e=>`Language changed to: ${e}`,configMenu:"What would you like to configure?",configLanguage:"Change language",configDefaultBranch:"Default base branch",configAIProvider:"Default AI provider",configView:"View current configuration",defaultBranchSet:e=>`Default base branch: ${e}`,aiProviderSet:e=>`Default AI provider: ${e}`,goBack:"Go back"};var Ge={es:Ue,en:Be};function a(e,...t){let i=Ne().language||"es",c=(Ge[i]||Ge.es)[e];return typeof c=="function"?c(...t):c||e}function X(){if(n.step(a("fetchingRemote")),We("git",["fetch"],{stdio:"inherit"}).status!==0){n.error(a("pullError","fetch failed"));return}n.step(a("pullingChanges")),We("git",["pull","origin","HEAD"],{stdio:"inherit"}).status!==0&&n.error(a("pullError","pull failed"))}import{spawnSync as Dt}from"child_process";function Z(e){let t=e.includes("-f")||e.includes("--force")||e.includes("-force");n.step(a("pushingChanges")),Dt("git",t?["push","-f","origin","HEAD"]:["push","origin","HEAD"],{stdio:"inherit"}).status===0?n.success(t?a("pushedForceSuccess"):a("pushedSuccess")):n.error(a("pushQuickError","push failed"))}import{spawnSync as Vt}from"child_process";function ee(e){if(G(e))return Pe(a("operationCancelled")),process.exit(0)}async function te(){let e=await Ae({message:a("removeLastConfirm")});if(ee(e),!e)return;n.step(a("removingLastCommit")),Vt("git",["reset","--soft","HEAD~1"],{stdio:"inherit"}).status===0?n.success(a("lastCommitRemoved")):n.error(a("removeLastError","reset failed"))}import{spawnSync as se}from"child_process";function ie(e){let t=e[0]??"develop";if(n.step(a("fetchingLatest")),se("git",["fetch"],{stdio:"inherit"}),n.step(a("mergingWith",t)),se("git",["merge",`origin/${t}`],{stdio:"inherit"}).status!==0){n.error(a("mergeError","merge failed"));return}n.step(a("pushingMerged")),se("git",["push","origin","HEAD"],{stdio:"inherit"}).status===0?n.success(a("mergeCompleted")):n.error(a("mergeError","push failed"))}import{spawnSync as je}from"child_process";function re(e){let t=e[0];t||(n.error(a("provideCommitMsg")),process.exit(1)),n.step(a("stagingChanges")),je("git",["add","."],{stdio:"inherit"}),n.step(a("creatingCommit")),je("git",["commit","-m",t],{stdio:"inherit"}).status===0?n.success(a("commitCreated")):n.error(a("commitError","commit failed"))}import{spawnSync as Ot}from"child_process";function ne(){Ot("git",["log"],{stdio:"inherit"}).status!==0&&(n.error(a("logError","git log failed")),process.exit(1))}import{spawnSync as Nt}from"child_process";function W(e){let t=e[0]||"-",s=t==="-";s&&n.step(a("switchingPrevBranch")),Nt("git",["checkout",t],{stdio:"inherit"}).status===0?n.success(a("switchedTo",s?"previous":t)):(n.error(a("checkoutError","checkout failed")),process.exit(1))}import{existsSync as Ut}from"fs";import{join as Bt}from"path";import{execSync as Gt}from"child_process";var Wt=()=>{try{Gt("git --version",{stdio:"ignore"})}catch{n.error(a("gitNotInstalled")),process.exit(1)}let e=Bt(process.cwd(),".git");Ut(e)||(n.error(a("notGitRepo")),process.exit(1))},qe=Wt;qe();var He=process.argv[1].split("/").pop(),j=process.argv.slice(2),jt={pull:X,push:()=>Z(j),removelast:te,mergewith:()=>ie(j),commit:()=>re(j),checkout:()=>W(j),back:()=>W("-"),log:ne};async function qt(){try{let e=jt[He];e||(n.error(`${a("unknownCommand")}: ${He}`),process.exit(1)),await e(),process.exit(0)}catch(e){n.error(`${a("errorExecuting")}: ${e.message}`),process.exit(1)}}qt();
|