eazy-git 0.2.0 → 0.2.2
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.js +11 -12
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -52,17 +52,16 @@ ${o.default.gray(S)} ${e}
|
|
|
52
52
|
`);return i!==-1&&(D=lD(D,s,r,i)),r+D+s};Object.defineProperties(G.prototype,_);var Re=G(),Tt=G({level:FD?FD.level:0});var V=Re;import{execSync as gD}from"child_process";function T(e){if(Q(e))return uu("\u274C Operation cancelled. Exiting..."),process.exit(0)}var Se=async()=>{let e=await M({message:"\u{1F333} Select the branch type:",options:[{value:"fix",label:"\u{1F41E} Fix"},{value:"improvement",label:"\u2728 Improvement"},{value:"feature",label:"\u{1F680} Feature"},{value:"refactor",label:"\u{1F528} Refactor"}]});return T(e),e},hD=Se;var Me=e=>/^[A-Z]{3}-\d{4}$/.test(e),ED=Me;var Ie=async()=>{let e=await Qu({message:"\u{1F3AB} Enter the JIRA ticket code:",placeholder:"DPW-0000",initialValue:"",validate(D){if(D.length===0)return"\u26A0\uFE0F JIRA code is required!";if(!ED(D))return"\u274C JIRA code must have the format DPW-0000"}});return T(e),e},mD=Ie;var _e=async()=>{let e=await hD(),D=await mD();return`${e}/${D}`},pD=_e;var je=async()=>{let e=await pD(),D=eD();try{D.start("\u{1F331} Creating original branch..."),gD(`git checkout -b ${e} origin/master`,{stdio:"inherit"}),gD(`git push origin ${e}`,{stdio:"inherit"}),D.stop(`\u2705 Branch "${e}" created and pushed to remote successfully!`),f.success(`\u{1F389} Branch "${e}" created successfully!`)}catch(t){D.stop(),f.error(`\u274C Error: ${t.message}`)}},dD=je;import{execSync as j}from"child_process";var Ne=async()=>{let e=await M({message:"\u{1F30D} \xBFA qu\xE9 rama deseas hacer merge?",options:[{value:"develop",label:"\u{1F9EA} develop (DEV)"},{value:"release",label:"\u{1F6A2} release (UAT)"}],required:!0,initialValue:"develop"});return T(e),e},BD=Ne;import{execSync as Pe}from"child_process";var Le=()=>Pe("git rev-parse --abbrev-ref HEAD").toString().trim(),fD=Le;var Ge=async()=>{try{let e=await BD(),D=fD(),t=`${D}-${e}`;if(j(`git checkout -b ${t} origin/${e}`,{stdio:"inherit"}),f.success("\u{1F33F} Temporal branch created successfully"),j(`git merge origin/${D}`,{stdio:"inherit"}),f.success("\u{1F500} Temporal branch merged successfully"),j("git status --porcelain",{encoding:"utf-8"}).includes("UU")){f.warn("\u26A0\uFE0F Conflicts detected. Please resolve them manually!");return}j(`git push origin ${t}`,{stdio:"inherit"}),f.info("\u{1F680} Branch pushed to remote repository");let s=await Xu({message:"Do you want to remove the temporal branch?"});T(s),s&&(j(`git checkout ${D}`,{stdio:"inherit"}),j(`git branch -D ${t}`,{stdio:"inherit"}),f.info("\u{1F5D1}\uFE0F Temporal branch deleted successfully"))}catch(e){console.error("\u274C Error creating the temporal branch:",e)}},bD=Ge;import{readFileSync as Ve}from"fs";import{fileURLToPath as We}from"url";import{dirname as Ye,resolve as Ue}from"path";var Ke=()=>{let e=We(import.meta.url),D=Ye(e);return JSON.parse(Ve(Ue(D,"../package.json"),"utf8"))?.version},$D=Ke;var vD=process.argv.slice(2);(vD.includes("-v")||vD.includes("--version"))&&(console.log("eazy-git version:",$D()),process.exit(0));uD(V.hex("#57d7c4")(`
|
|
53
53
|
Welcome to
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
|
57
|
-
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
'--------------------------------------------------------------------------------------'
|
|
55
|
+
.-------------------------------------------------------------------------------.
|
|
56
|
+
| \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588|
|
|
57
|
+
|\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588 \u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588\u2591\u2588\u2591\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588\u2591\u2588\u2591\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2588|
|
|
58
|
+
| \u2591\u2588\u2588\u2588 \u2588 \u2591 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2591 \u2588\u2588\u2588\u2591 \u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588 \u2588\u2588\u2588 \u2591\u2591\u2591 \u2591\u2588\u2588\u2588\u2591 \u2591\u2588\u2588\u2588 \u2591 |
|
|
59
|
+
| \u2591\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 |
|
|
60
|
+
| \u2591\u2588\u2588\u2588\u2591\u2591\u2588 \u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 |
|
|
61
|
+
| \u2591\u2588\u2588\u2588 \u2591 \u2588\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2588 \u2588 \u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 |
|
|
62
|
+
| \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 |
|
|
63
|
+
|\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 |
|
|
64
|
+
'-------------------------------------------------------------------------------'
|
|
65
|
+
|
|
67
66
|
${V.hex("#9ca3af")("your trusted CLI for GIT branch management")}
|
|
68
67
|
`));var AD=await M({message:V.hex("#199288")("What would you like to do?"),options:[{value:"CRO",label:"\u{1F331} Create Original Branch"},{value:"CRT",label:"\u{1F33F} Create Temporal Branch"}],required:!0,initialValue:"CRO"});AD==="CRO"?await dD():AD==="CRT"?await bD():(uu("\u274C The operation was cancelled. Exiting..."),process.exit(0));DD(V.hex("#06D6A0")("Operation completed!"));
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eazy-git",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Jaime Torres",
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"description": "
|
|
8
|
+
"description": "CLI tool that simplifies branch management in Git. It automates common workflows and maintains a consistent branch structure.",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/jaime00/eazy-git.git"
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"build": "node build.js"
|
|
15
15
|
},
|
|
16
16
|
"bin": {
|
|
17
|
-
"eg": "dist/index.js",
|
|
18
17
|
"eazy-git": "dist/index.js",
|
|
18
|
+
"eg": "dist/index.js",
|
|
19
19
|
"asd": "dist/index.js",
|
|
20
20
|
"pull": "dist/git.js",
|
|
21
21
|
"push": "dist/git.js",
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"cli",
|
|
36
36
|
"git",
|
|
37
37
|
"eazy-git",
|
|
38
|
+
"eazygit",
|
|
38
39
|
"git-branch",
|
|
39
40
|
"branch",
|
|
40
41
|
"automation"
|
|
41
42
|
],
|
|
42
43
|
"dependencies": {
|
|
43
44
|
"@clack/prompts": "^0.10.1",
|
|
44
|
-
"chalk": "^5.4.1"
|
|
45
|
-
"picocolors": "^1.0.0"
|
|
45
|
+
"chalk": "^5.4.1"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
48
|
"node": ">=14.0.0"
|