ccommit 1.0.1 → 1.1.0-enquirer.1

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/index.js CHANGED
@@ -1,16 +1,13 @@
1
- #!/usr/bin/env node
2
- import xe from 'meow';
3
- import Y from 'inquirer';
4
- import W from 'fs';
1
+ #!/usr/bin / env node
2
+ import fe from 'meow';
3
+ import ge from 'enquirer';
4
+ import D from 'fs';
5
5
  import { execa } from 'execa';
6
- import ne from 'fuse.js';
7
- import R from 'chalk';
6
+ import d from 'ansi-colors';
8
7
  import { execSync } from 'child_process';
9
- import fe from 'inquirer/lib/prompts/input.js';
10
- import Te from 'inquirer-autocomplete-prompt';
11
8
  import { join } from 'path';
12
9
 
13
- var y={COMMIT:"commit",HOOK:"hook",LIST:"list"},l={CONVENTIONAL:"conventional",CONVENTIONAL_NO_EMOJI:"conventional-no-emoji",GITMOJI:"gitmoji"},L={CLIENT:"client",HOOK:"hook"},u={EMOJI:"emoji",TYPE:"type"},m=Object.freeze({BREAKING:"breaking",COMMIT:"commit",DRYRUN:"dryrun",EMOJI:"emoji",HELP:"help",HOOK:"hook",LIST:"list",SKIP:"skip",VERSION:"version"}),B={[l.CONVENTIONAL]:"{type}{scope}: {emoji}{title}",[l.CONVENTIONAL_NO_EMOJI]:"{type}{scope}: {title}",[l.GITMOJI]:"{emoji}{scope}{title}"},s={TYPES:{ERROR:"error",INFO:"info",SUCCESS:"success",WARNING:"warning"},MESSAGES:{COMMAND_LINE_WITHOUT_REQUIRED:">> [ccommit] Command line option requires both: --title, --type",COMMIT_FAIL:`
10
+ var j={COMMIT:"commit",HOOK:"hook",LIST:"list"},l={CONVENTIONAL:"conventional",CONVENTIONAL_NO_EMOJI:"conventional-no-emoji",GITMOJI:"gitmoji"},f={CLIENT:"client",HOOK:"hook"},T={EMOJI:"emoji",TYPE:"type"},n=Object.freeze({BREAKING:"breaking",COMMIT:"commit",DRYRUN:"dryrun",EMOJI:"emoji",HELP:"help",HOOK:"hook",LIST:"list",SKIP:"skip",VERSION:"version"}),G={[l.CONVENTIONAL]:"{type}{scope}{breaking}: {emoji}{title}",[l.CONVENTIONAL_NO_EMOJI]:"{type}{scope}{breaking}: {title}",[l.GITMOJI]:"{emoji}{breaking}{scope}{title}"},m={TYPES:{ERROR:"error",INFO:"info",SUCCESS:"success",WARNING:"warning"},MESSAGES:{COMMAND_LINE_WITHOUT_REQUIRED:"\u276F Command line option requires both: --title, --type",COMMIT_FAIL:`
14
11
 
15
12
  Oops! An error occurred. There is likely additional logging output above.
16
13
 
@@ -18,33 +15,44 @@ var y={COMMIT:"commit",HOOK:"hook",LIST:"list"},l={CONVENTIONAL:"conventional",C
18
15
 
19
16
 
20
17
  {REPLACE}
21
- `,GENERATOR_TAKING_OVER:">> [ccommit] Generator will take it from here (CTRL+C to quit)",LENGTH_MAX:"[ccommit] Cannot exceed {REPLACE} characters",LENGTH_MIN:"[ccommit] Must have at least {REPLACE} characters",MODE_CONFLICT:">> [ccommit] Please choose one or the other: --commit, -c | --hook, -u",REPLACE:"{REPLACE}",STAGED_FILES:">> [commit] There are no staged files for git. Did you mean to do a dry-run (-n)?",TYPE_INCORRECT:">> [ccommit] There is no gitmoji/type associated with: {REPLACE}"}},c=Object.freeze({FORMAT:"format",MESSAGE:"message",SCOPE:"scope",TITLE:"title",TYPE:"type"}),g={MIN:3,MAX:12},o={MAJOR:"major",MINOR:"minor",PATCH:"patch",NULL:"null"},a={MIN:3,MIN_SWAG:15,MAX:48,MAX_SWAG:40},K={MAX:15};var X=()=>execa("git",["rev-parse","--absolute-git-dir"]).then(({stdout:e})=>{(W.existsSync(e+"/rebase-merge")||W.existsSync(e+"/rebase-apply"))&&process.exit(0);}),J=4,V=()=>new Promise(e=>{let t=process.argv[J];t&&(t.startsWith("commit")||t.startsWith("merge"))&&process.exit(0),e();}),S=()=>V().then(X);var me={threshold:.4,keys:[{name:"type",weight:.44},{name:"description",weight:.56}]},M=(e,t)=>{let i=new ne(t,me);return e?i.search(e).map(n=>n.item):t};var se=(e,t)=>[m.COMMIT,m.HOOK].includes(e)?{dryrun:t[m.DRYRUN],emoji:t[m.EMOJI],mode:e===m.HOOK?L.HOOK:L.CLIENT,format:t[c.FORMAT]===l.CONVENTIONAL?t[m.EMOJI]?l.CONVENTIONAL:l.CONVENTIONAL_NO_EMOJI:l.GITMOJI,message:t[c.MESSAGE],scope:t[c.SCOPE],skip:t[m.SKIP],title:t[c.TITLE],type:t[c.TYPE]}:null,O=(e,t)=>{let i=e.flags,n=Object.keys(i).map(f=>i[f]&&f).find(f=>t[f]),r=N();!i[m.DRYRUN]&&!r&&(console.log(p(s.TYPES.WARNING,s.MESSAGES.STAGED_FILES)),process.exit(2)),i[m.COMMIT]&&i[m.HOOK]&&(console.log(p(s.TYPES.ERROR,s.MESSAGES.MODE_CONFLICT)),process.exit(2)),(i[c.MESSAGE]||i[c.SCOPE]||i[c.TITLE]||i[c.TYPE])&&(i[m.SKIP]=!0),i[m.SKIP]&&(i[c.TITLE]&&i[c.TYPE]?i[m.SKIP]=!0:(i[m.SKIP]=!1,console.log(p(s.TYPES.WARNING,s.MESSAGES.COMMAND_LINE_WITHOUT_REQUIRED)),i[c.TITLE]=void 0,i[c.TYPE]=void 0));let d=se(n,i);return t[n]?t[n](d):e.showHelp()};var ce=[{code:":wheelchair:",description:"Improve Accessibility",emoji:"\u267F\uFE0F",emojiLength:1,semver:o.PATCH,type:"access"},{code:":chart_with_upwards_trend:",description:"Add or Update Analytics or Track Code",emoji:"\u{1F4C8}",emojiLength:1,semver:o.PATCH,type:"analytics"},{code:":dizzy:",description:"Add or Update Animations and Transitions",emoji:"\u{1F4AB}",emojiLength:1,semver:o.PATCH,type:"animation"},{code:":building_construction:",description:"Make Architectural Changes",emoji:"\u{1F3D7}\uFE0F",emojiLength:0,semver:o.NULL,type:"arch"},{code:":bento:",description:"Add or Update Assets",emoji:"\u{1F371}",emojiLength:1,semver:o.PATCH,type:"assets"},{code:":beers:",description:"Write Code Drunkenly",emoji:"\u{1F37B}",emojiLength:1,semver:o.NULL,type:"beer"},{code:":boom:",description:"Introduce Breaking Changes",emoji:"\u{1F4A5}",emojiLength:1,semver:o.MAJOR,type:"breaking"},{code:":hammer:",description:"Add or Update Development Scripts",emoji:"\u{1F528}",emojiLength:1,semver:o.NULL,type:"build"},{code:":goal_net:",description:"Catch Errors",emoji:"\u{1F945}",emojiLength:1,semver:o.PATCH,type:"catch"},{code:":computer_disk:",description:"Changes That Don\u2019t Modify Src or Test Files",emoji:"\u{1F4BD}\uFE0F",emojiLength:1,semver:o.NULL,type:"chore"},{code:":construction_worker:",description:"Add or Update CI Build System",emoji:"\u{1F477}",emojiLength:1,semver:o.NULL,type:"ci"},{code:":wastebasket:",description:"Deprecate Code That Needs to Be Cleaned Up",emoji:"\u{1F5D1}\uFE0F",emojiLength:0,semver:o.PATCH,type:"clean"},{code:":alien:",description:"Update Code Due to External API Changes",emoji:"\u{1F47D}\uFE0F",emojiLength:1,semver:o.PATCH,type:"compat"},{code:":thread:",description:"Add or Update Code Related to Multithreading or Concurrency",emoji:"\u{1F9F5}",emojiLength:1,semver:o.NULL,type:"concurrency"},{code:":wrench:",description:"Add or Update Configuration Files",emoji:"\u{1F527}",emojiLength:1,semver:o.PATCH,type:"config"},{code:":busts_in_silhouette:",description:"Add or Update Contributor(s)",emoji:"\u{1F465}",emojiLength:1,semver:o.NULL,type:"contrib-add"},{code:":monocle_face:",description:"Data Exploration/inspection",emoji:"\u{1F9D0}",emojiLength:1,semver:o.NULL,type:"data"},{code:":card_file_box:",description:"Perform Database Related Changes",emoji:"\u{1F5C3}\uFE0F",emojiLength:0,semver:o.PATCH,type:"db"},{code:":heavy_plus_sign:",description:"Add a Dependency",emoji:"\u2795",emojiLength:1,semver:o.PATCH,type:"dep-add"},{code:":heavy_minus_sign:",description:"Remove a Dependency",emoji:"\u2796",emojiLength:1,semver:o.PATCH,type:"dep-rm"},{code:":package:",description:"Add or Update Compiled Files or Packages",emoji:"\u{1F4E6}\uFE0F",emojiLength:1,semver:o.PATCH,type:"dep-up"},{code:":rocket:",description:"Deploy Stuff",emoji:"\u{1F680}",emojiLength:1,semver:o.NULL,type:"deploy"},{code:":bulb:",description:"Add or Update Comments in Source Code",emoji:"\u{1F4A1}",emojiLength:1,semver:o.NULL,type:"docs-code"},{code:":memo:",description:"Add or Update Documentation",emoji:"\u{1F4DD}",emojiLength:1,semver:o.NULL,type:"docs"},{code:":arrow_down:",description:"Downgrade Dependencies",emoji:"\u2B07\uFE0F",emojiLength:0,semver:o.PATCH,type:"downgrade"},{code:":technologist:",description:"Improve Developer Experience",emoji:"\u{1F4BB}",emojiLength:1,semver:o.NULL,type:"dx"},{code:":egg:",description:"Add or Update an Easter Egg",emoji:"\u{1F95A}",emojiLength:1,semver:o.PATCH,type:"egg"},{code:":alembic:",description:"Perform Experiments",emoji:"\u2697\uFE0F",emojiLength:0,semver:o.PATCH,type:"experiment"},{code:":sparkles:",description:"Introduce New Features",emoji:"\u2728",emojiLength:1,semver:o.MINOR,type:"feat"},{code:":bug:",description:"Fix a Bug",emoji:"\u{1F41B}",emojiLength:1,semver:o.PATCH,type:"fix"},{code:":green_heart:",description:"Fix CI Build",emoji:"\u{1F49A}",emojiLength:1,semver:o.NULL,type:"fix-ci"},{code:":triangular_flag_on_post:",description:"Add Update or Remove Feature Flags",emoji:"\u{1F6A9}",emojiLength:1,semver:o.PATCH,type:"flags"},{code:":stethoscope:",description:"Add or Update Healthcheck",emoji:"\u{1FA7A}",emojiLength:1,semver:o.NULL,type:"healthcheck"},{code:":ambulance:",description:"Critical Hotfix",emoji:"\u{1F691}\uFE0F",emojiLength:1,semver:o.PATCH,type:"hotfix"},{code:":globe_with_meridians:",description:"Internationalization and Localization",emoji:"\u{1F310}",emojiLength:1,semver:o.PATCH,type:"i18n"},{code:":see_no_evil:",description:"Add or Update a Gitignore File.",emoji:"\u{1F648}",emojiLength:1,semver:o.NULL,type:"ignore"},{code:":bricks:",description:"Infrastructure Related Changes",emoji:"\u{1F9F1}",emojiLength:1,semver:o.NULL,type:"inf"},{code:":tada:",description:"Begin a Project",emoji:"\u{1F389}",emojiLength:1,semver:o.PATCH,type:"init"},{code:":iphone:",description:"Work on Responsive Design",emoji:"\u{1F4F1}",emojiLength:1,semver:o.PATCH,type:"iphone"},{code:":page_facing_up:",description:"Add or Update License",emoji:"\u{1F4C4}",emojiLength:1,semver:o.NULL,type:"license"},{code:":rotating_light:",description:"Fix Compiler / Linter Warnings",emoji:"\u{1F6A8}",emojiLength:1,semver:o.NULL,type:"lint"},{code:":loud_sound:",description:"Add or Update Logs",emoji:"\u{1F50A}",emojiLength:1,semver:o.NULL,type:"log-add"},{code:":mute:",description:"Remove Logs",emoji:"\u{1F507}",emojiLength:1,semver:o.NULL,type:"log-rm"},{code:":necktie:",description:"Add or Update Business Logic",emoji:"\u{1F454}",emojiLength:1,semver:o.PATCH,type:"logic"},{code:":twisted_rightwards_arrows:",description:"Merge Branches",emoji:"\u{1F500}",emojiLength:1,semver:o.NULL,type:"merge"},{code:":clown_face:",description:"Mock Things",emoji:"\u{1F921}",emojiLength:1,semver:o.NULL,type:"mock"},{code:":truck:",description:"Move or Rename Resources (Eg.: Files Paths Routes).",emoji:"\u{1F69A}",emojiLength:1,semver:o.NULL,type:"mv"},{code:":adhesive_bandage:",description:"Simple Fix for a Non-Critical Issue",emoji:"\u{1FA79}",emojiLength:1,semver:o.PATCH,type:"patch"},{code:":zap:",description:"Improve Performance",emoji:"\u26A1\uFE0F",emojiLength:1,semver:o.PATCH,type:"perf"},{code:":poop:",description:"Write Bad Code That Needs to Be Improved",emoji:"\u{1F4A9}",emojiLength:1,semver:o.NULL,type:"poo"},{code:":fire:",description:"Remove Code or Files",emoji:"\u{1F525}",emojiLength:1,semver:o.NULL,type:"prune"},{code:":pushpin:",description:"Pin Dependencies to Specific Versions",emoji:"\u{1F4CC}",emojiLength:1,semver:o.PATCH,type:"pushpin"},{code:":recycle:",description:"Refactor Code",emoji:"\u267B\uFE0F",emojiLength:0,semver:o.NULL,type:"refactor"},{code:":bookmark:",description:"Release / Version Tags",emoji:"\u{1F516}",emojiLength:1,semver:o.NULL,type:"release"},{code:":rewind:",description:"Revert Changes",emoji:"\u23EA\uFE0F",emojiLength:1,semver:o.PATCH,type:"revert"},{code:":coffin:",description:"Remove Dead Code",emoji:"\u26B0\uFE0F",emojiLength:0,semver:o.NULL,type:"rip"},{code:":passport_control:",description:"Work on Code Related to Authorization Roles and Permissions",emoji:"\u{1F6C2}",emojiLength:1,semver:o.PATCH,type:"roles"},{code:":fast_forward:",description:"Create Rollforward Version",emoji:"\u23E9\uFE0F",emojiLength:1,semver:o.NULL,type:"rollforward"},{code:":rocket:",description:"Custom Type for CI/CD to Hook into Run Build Override",emoji:"\u{1F680}\uFE0F",emojiLength:1,semver:o.PATCH,type:"run-build"},{code:":closed_lock_with_key:",description:"Add or Update Secrets",emoji:"\u{1F510}",emojiLength:1,semver:o.NULL,type:"secrets"},{code:":lock:",description:"Fix Security Issues",emoji:"\u{1F512}\uFE0F",emojiLength:1,semver:o.PATCH,type:"security"},{code:":seedling:",description:"Add or Update Seed Files",emoji:"\u{1F331}",emojiLength:1,semver:o.NULL,type:"seed"},{code:":mag:",description:"Improve Seo",emoji:"\u{1F50D}\uFE0F",emojiLength:1,semver:o.PATCH,type:"seo"},{code:":camera_flash:",description:"Add or Update Snapshots",emoji:"\u{1F4F8}",emojiLength:1,semver:o.NULL,type:"snapshot"},{code:":money_with_wings:",description:"Add Sponsorships or Money Related Infrastructure",emoji:"\u{1F4B8}",emojiLength:1,semver:o.NULL,type:"sponsor"},{code:":art:",description:"Improve Structure / Format of the Code",emoji:"\u{1F3A8}",emojiLength:1,semver:o.NULL,type:"style"},{code:":test_tube:",description:"Add a Failing Test",emoji:"\u{1F9EA}",emojiLength:1,semver:o.NULL,type:"test-fail"},{code:":white_check_mark:",description:"Add Update or Pass Tests",emoji:"\u2705",emojiLength:1,semver:o.NULL,type:"test"},{code:":speech_balloon:",description:"Add or Update Text and Literals",emoji:"\u{1F4AC}",emojiLength:1,semver:o.PATCH,type:"texts"},{code:":label:",description:"Add or Update Types",emoji:"\u{1F3F7}\uFE0F",emojiLength:0,semver:o.PATCH,type:"types"},{code:":pencil2:",description:"Fix Typos",emoji:"\u270F\uFE0F",emojiLength:0,semver:o.PATCH,type:"typo"},{code:":lipstick:",description:"Add or Update the UI and Style Files",emoji:"\u{1F484}",emojiLength:1,semver:o.PATCH,type:"ui"},{code:":arrow_up:",description:"Upgrade Dependencies",emoji:"\u2B06\uFE0F",emojiLength:0,semver:o.PATCH,type:"upgrade"},{code:":children_crossing:",description:"Improve User Experience / Usability",emoji:"\u{1F6B8}",emojiLength:1,semver:o.PATCH,type:"ux"},{code:":safety_vest:",description:"Add or update code related to validation",emoji:"\u{1F9BA}",emojiLength:1,semver:o.PATCH,type:"validation"},{code:":construction:",description:"Work in Progress",emoji:"\u{1F6A7}",emojiLength:1,semver:o.NULL,type:"wip"}],h=ce;var T=(e,t,i)=>{var r;let n=h.findIndex(d=>d[t]===e);return (r=h[n])==null?void 0:r[i]};var j=({emoji:e,emojiLength:t})=>t===0?`${e} `:`${e} `,C=e=>e==null?void 0:e.padEnd(K.MAX),v=e=>e.map(({description:t,emoji:i,emojiLength:n,type:r})=>{console.log(`${j({emoji:i,emojiLength:n})} ${C(r)} ${t}`);}),P=(e,t)=>{let i=B[e==null?void 0:e.format],n=t!=null&&t.gitmoji?`${t==null?void 0:t.gitmoji} `:"",r=t!=null&&t.scope?`(${t==null?void 0:t.scope.replace(/ {2}/g,"--").replace(/ /g,"-").toLowerCase().trim()})`:"";return r=r&&(e==null?void 0:e.format)===l.GITMOJI?`${r} `:r,i.replace(/\{emoji\}/g,n).replace(/\{scope\}/g,r).replace(/\{title\}/g,t==null?void 0:t.title).replace(/\{type\}/g,t==null?void 0:t.type)};var p=(e,t,i)=>{let n=i?t.replace(/\{REPLACE\}/g,i):t;return e===s.TYPES.ERROR?R.red(n):e===s.TYPES.INFO?n:e===s.TYPES.WARNING?R.yellow(n):R.green(n)};var pe=3,de=0,q=2,_=e=>{let t=process.argv[pe];if(e.mode===L.CLIENT||!W.existsSync(t))return {message:e.message||null,scope:e.scope||null,title:e.title||x()||null};let i=W.readFileSync(t).toString().split(`
22
- `);return {message:i.length>q?i[q]:null,scope:e.scope,title:i[de]}};var U=e=>e.map(({description:t,emoji:i,emojiLength:n,type:r})=>({emoji:i,emojiLength:n,description:t,type:r}));var H=()=>{let e=process.platform==="win32"?" nul":"/dev/null";return execSync("git rev-parse --show-toplevel 2>"+e).toString().trim()};var x=()=>{let e="",t=execSync("git rev-parse --abbrev-ref HEAD").toString().trim().split("/"),i=t[0],r=(t[1]?t[1]:i).split("-"),d=r[0],f=r[1]?r[1]:d,ie=`${d}-${f}`;return !isNaN(parseFloat(f))&&isFinite(parseFloat(f))&&(e=ie),e};var N=()=>!!execSync("git diff --name-only --staged").toString().trim();var E=e=>{console.dir(" [dryrun] "),console.dir(e);};var b=class extends fe{onKeypress(){this.rl.line.length>this.opt.inputMax&&(this.rl.line=this.rl.line.slice(0,this.opt.inputMax),this.rl.cursor--),this.render();}},G=b;var k=class extends fe{onKeypress(){(this.rl.line===" "||this.rl.line===" ")&&this.opt.default&&(this.rl.line=`${this.opt.default} `,this.rl.cursor=this.rl.line.length),this.opt.default&&(this.opt.default=void 0),this.rl.line.length>this.opt.inputMax&&(this.rl.line=this.rl.line.slice(0,this.opt.inputMax),this.rl.cursor--),this.render();}},F=k;var D=()=>{process.on("SIGINT",()=>{console.warn(">> [ccommit] was interrupted"),process.exit(0);});};var he=e=>{let t=e.length,i=t.toString(),n=s.TYPES.SUCCESS;return t<a.MIN||t>a.MAX?n=s.TYPES.ERROR:(t<a.MIN_SWAG||t>a.MAX_SWAG)&&(n=s.TYPES.WARNING),p(n,s.MESSAGES.REPLACE,i)},ue=e=>{let t=e.length;return t===0?!0:t<g.MIN?p(s.TYPES.ERROR,s.MESSAGES.LENGTH_MIN,g.MIN.toString()):t>g.MAX?p(s.TYPES.ERROR,s.MESSAGES.LENGTH_MAX,g.MAX.toString()):!0},Ee=e=>{let t=e.length;return t<a.MIN?p(s.TYPES.ERROR,s.MESSAGES.LENGTH_MIN,a.MIN.toString()):t>a.MAX?p(s.TYPES.ERROR,s.MESSAGES.LENGTH_MAX,a.MAX.toString()):!0},ye={getCharsLeftText:he,scope:ue,title:Ee},I=ye;var je=U(h);Y.registerPrompt("autocomplete",Te);Y.registerPrompt("inputLimited",G);Y.registerPrompt("inputPrepopulateLimited",F);var Ce=(e,t)=>M(t,je).map(i=>({name:` ${j({emoji:i.emoji,emojiLength:i.emojiLength})} ${C(i.type)} ${i.description}`,value:i.emoji})),Ie=e=>{let{title:t,message:i,scope:n}=_(e);return [{name:"breaking",type:"confirm",message:"Is there a breaking change?:",default:!1},{name:"messageBreaking",type:"input",message:"Please share breaking change information:",filter:r=>`BREAKING CHANGE: ${r.trim()}`,when:r=>r.breaking},{name:"gitmoji",message:"Choose a commit type:",type:"autocomplete",source:Ce,filter:r=>r.trim()},{name:"scope",type:"inputLimited",inputMin:g.MIN,inputMax:g.MAX,message:"Enter the scope (if any)",validate:I.scope,filter:r=>r.trim(),transformer:r=>`(${r.length}/${g.MAX}): ${r}`,...n?{default:n}:{}},{type:"inputPrepopulateLimited",name:"title",inputMax:a.MAX,inputMin:a.MIN,message:"Enter the commit title",validate:I.title,filter:r=>r.trim(),transformer:r=>`(${I.getCharsLeftText(r)}/${a.MAX}): ${r}`,...t?{default:t}:{}},{name:"message",message:"Enter the commit message:",...i?{default:i}:{}}]},Q=Ie;var Se=async(e,t)=>{try{let i=e==null?void 0:e.subject,n=e==null?void 0:e.message,r=e==null?void 0:e.messageBreaking,d=["commit","-m",i];n&&d.push("-m",n),r&&d.push("-m",r),t!=null&&t.dryrun?E(["git",...d]):await execa("git",d,{buffer:!1,stdio:"inherit"});}catch(i){console.error(p(s.TYPES.ERROR,s.MESSAGES.COMMIT_FAIL,i.escapedCommand)),process.exit(1);}},Z=Se;var Ne=join(H(),".git","COMMIT_EDITMSG"),ve=(e,t)=>{try{let i=e==null?void 0:e.subject;e!=null&&e.message&&(i+=`
18
+ `,GENERATOR_TAKING_OVER:"\u276F Generator will take it from here (CTRL+C to quit)",LENGTH_MAX:"[ccommit] Cannot exceed {REPLACE} characters",LENGTH_MIN:"[ccommit] Must have at least {REPLACE} characters",MODE_CONFLICT:"\u276F Please choose one or the other: --commit, -c | --hook, -u",REPLACE:"{REPLACE}",STAGED_FILES:"\u276F There are no staged files for git. Did you mean to do a dry-run (-n)?",TYPE_INCORRECT:"\u276F There is no gitmoji/type associated with: {REPLACE}"}},s=Object.freeze({FORMAT:"format",MESSAGE:"message",SCOPE:"scope",TITLE:"title",TYPE:"type"}),y={MIN:3,MAX:12},o={MAJOR:"major",MINOR:"minor",PATCH:"patch",NULL:"null"},a={MIN:3,MIN_SWAG:15,MAX:48,MAX_SWAG:40},F={MAX:15};var $=()=>execa("git",["rev-parse","--absolute-git-dir"]).then(({stdout:e})=>{(D.existsSync(e+"/rebase-merge")||D.existsSync(e+"/rebase-apply"))&&process.exit(0);}),Y=4,B=()=>new Promise(e=>{let t=process.argv[Y];t&&(t.startsWith("commit")||t.startsWith("merge"))&&process.exit(0),e();}),S=()=>B().then($);var Z=(e,t)=>[n.COMMIT,n.HOOK].includes(e)?{dryrun:t[n.DRYRUN],emoji:t[n.EMOJI],mode:e===n.HOOK?f.HOOK:f.CLIENT,format:t[s.FORMAT]===l.CONVENTIONAL?t[n.EMOJI]?l.CONVENTIONAL:l.CONVENTIONAL_NO_EMOJI:l.GITMOJI,message:t[s.MESSAGE],scope:t[s.SCOPE],skip:t[n.SKIP],title:t[s.TITLE],type:t[s.TYPE]}:null,N=(e,t)=>{let i=e.flags,r=Object.keys(i).map(h=>i[h]&&h).find(h=>t[h]),c=v();!i[n.DRYRUN]&&!c&&(console.log(g(m.TYPES.WARNING,m.MESSAGES.STAGED_FILES)),process.exit(2)),i[n.COMMIT]&&i[n.HOOK]&&(console.log(g(m.TYPES.ERROR,m.MESSAGES.MODE_CONFLICT)),process.exit(2)),(i[s.MESSAGE]||i[s.SCOPE]||i[s.TITLE]||i[s.TYPE])&&(i[n.SKIP]=!0),i[n.SKIP]&&(i[s.TITLE]&&i[s.TYPE]?i[n.SKIP]=!0:(i[n.SKIP]=!1,console.log(g(m.TYPES.ERROR,m.MESSAGES.COMMAND_LINE_WITHOUT_REQUIRED)),i[s.TITLE]=void 0,i[s.TYPE]=void 0));let p=Z(r,i);return t[r]?t[r](p):e.showHelp()};var w=[{code:":wheelchair:",description:"Improve Accessibility",emoji:"\u267F\uFE0F",emojiLength:1,semver:o.PATCH,type:"access"},{code:":chart_with_upwards_trend:",description:"Add or Update Analytics or Track Code",emoji:"\u{1F4C8}",emojiLength:1,semver:o.PATCH,type:"analytics"},{code:":dizzy:",description:"Add or Update Animations and Transitions",emoji:"\u{1F4AB}",emojiLength:1,semver:o.PATCH,type:"animation"},{code:":building_construction:",description:"Make Architectural Changes",emoji:"\u{1F3D7}\uFE0F",emojiLength:0,semver:o.NULL,type:"arch"},{code:":bento:",description:"Add or Update Assets",emoji:"\u{1F371}",emojiLength:1,semver:o.PATCH,type:"assets"},{code:":beers:",description:"Write Code Drunkenly",emoji:"\u{1F37B}",emojiLength:1,semver:o.NULL,type:"beer"},{code:":boom:",description:"Introduce Breaking Changes",emoji:"\u{1F4A5}",emojiLength:1,semver:o.MAJOR,type:"breaking"},{code:":hammer:",description:"Add or Update Development Scripts",emoji:"\u{1F528}",emojiLength:1,semver:o.NULL,type:"build"},{code:":goal_net:",description:"Catch Errors",emoji:"\u{1F945}",emojiLength:1,semver:o.PATCH,type:"catch"},{code:":computer_disk:",description:"Changes That Don\u2019t Modify Src or Test Files",emoji:"\u{1F4BD}\uFE0F",emojiLength:1,semver:o.NULL,type:"chore"},{code:":construction_worker:",description:"Add or Update CI Build System",emoji:"\u{1F477}",emojiLength:1,semver:o.NULL,type:"ci"},{code:":wastebasket:",description:"Deprecate Code That Needs to Be Cleaned Up",emoji:"\u{1F5D1}\uFE0F",emojiLength:0,semver:o.PATCH,type:"clean"},{code:":alien:",description:"Update Code Due to External API Changes",emoji:"\u{1F47D}\uFE0F",emojiLength:1,semver:o.PATCH,type:"compat"},{code:":thread:",description:"Add or Update Code Related to Multithreading or Concurrency",emoji:"\u{1F9F5}",emojiLength:1,semver:o.NULL,type:"concurrency"},{code:":wrench:",description:"Add or Update Configuration Files",emoji:"\u{1F527}",emojiLength:1,semver:o.PATCH,type:"config"},{code:":busts_in_silhouette:",description:"Add or Update Contributor(s)",emoji:"\u{1F465}",emojiLength:1,semver:o.NULL,type:"contrib-add"},{code:":monocle_face:",description:"Data Exploration/inspection",emoji:"\u{1F9D0}",emojiLength:1,semver:o.NULL,type:"data"},{code:":card_file_box:",description:"Perform Database Related Changes",emoji:"\u{1F5C3}\uFE0F",emojiLength:0,semver:o.PATCH,type:"db"},{code:":heavy_plus_sign:",description:"Add a Dependency",emoji:"\u2795",emojiLength:1,semver:o.PATCH,type:"dep-add"},{code:":heavy_minus_sign:",description:"Remove a Dependency",emoji:"\u2796",emojiLength:1,semver:o.PATCH,type:"dep-rm"},{code:":package:",description:"Add or Update Compiled Files or Packages",emoji:"\u{1F4E6}\uFE0F",emojiLength:1,semver:o.PATCH,type:"dep-up"},{code:":rocket:",description:"Deploy Stuff",emoji:"\u{1F680}",emojiLength:1,semver:o.NULL,type:"deploy"},{code:":bulb:",description:"Add or Update Comments in Source Code",emoji:"\u{1F4A1}",emojiLength:1,semver:o.NULL,type:"docs-code"},{code:":memo:",description:"Add or Update Documentation",emoji:"\u{1F4DD}",emojiLength:1,semver:o.NULL,type:"docs"},{code:":arrow_down:",description:"Downgrade Dependencies",emoji:"\u2B07\uFE0F",emojiLength:0,semver:o.PATCH,type:"downgrade"},{code:":technologist:",description:"Improve Developer Experience",emoji:"\u{1F4BB}",emojiLength:1,semver:o.NULL,type:"dx"},{code:":egg:",description:"Add or Update an Easter Egg",emoji:"\u{1F95A}",emojiLength:1,semver:o.PATCH,type:"egg"},{code:":alembic:",description:"Perform Experiments",emoji:"\u2697\uFE0F",emojiLength:0,semver:o.PATCH,type:"experiment"},{code:":sparkles:",description:"Introduce New Features",emoji:"\u2728",emojiLength:1,semver:o.MINOR,type:"feat"},{code:":bug:",description:"Fix a Bug",emoji:"\u{1F41B}",emojiLength:1,semver:o.PATCH,type:"fix"},{code:":green_heart:",description:"Fix CI Build",emoji:"\u{1F49A}",emojiLength:1,semver:o.NULL,type:"fix-ci"},{code:":triangular_flag_on_post:",description:"Add Update or Remove Feature Flags",emoji:"\u{1F6A9}",emojiLength:1,semver:o.PATCH,type:"flags"},{code:":stethoscope:",description:"Add or Update Healthcheck",emoji:"\u{1FA7A}",emojiLength:1,semver:o.NULL,type:"healthcheck"},{code:":ambulance:",description:"Critical Hotfix",emoji:"\u{1F691}\uFE0F",emojiLength:1,semver:o.PATCH,type:"hotfix"},{code:":globe_with_meridians:",description:"Internationalization and Localization",emoji:"\u{1F310}",emojiLength:1,semver:o.PATCH,type:"i18n"},{code:":see_no_evil:",description:"Add or Update a Gitignore File.",emoji:"\u{1F648}",emojiLength:1,semver:o.NULL,type:"ignore"},{code:":bricks:",description:"Infrastructure Related Changes",emoji:"\u{1F9F1}",emojiLength:1,semver:o.NULL,type:"inf"},{code:":tada:",description:"Begin a Project",emoji:"\u{1F389}",emojiLength:1,semver:o.PATCH,type:"init"},{code:":iphone:",description:"Work on Responsive Design",emoji:"\u{1F4F1}",emojiLength:1,semver:o.PATCH,type:"iphone"},{code:":page_facing_up:",description:"Add or Update License",emoji:"\u{1F4C4}",emojiLength:1,semver:o.NULL,type:"license"},{code:":rotating_light:",description:"Fix Compiler / Linter Warnings",emoji:"\u{1F6A8}",emojiLength:1,semver:o.NULL,type:"lint"},{code:":loud_sound:",description:"Add or Update Logs",emoji:"\u{1F50A}",emojiLength:1,semver:o.NULL,type:"log-add"},{code:":mute:",description:"Remove Logs",emoji:"\u{1F507}",emojiLength:1,semver:o.NULL,type:"log-rm"},{code:":necktie:",description:"Add or Update Business Logic",emoji:"\u{1F454}",emojiLength:1,semver:o.PATCH,type:"logic"},{code:":twisted_rightwards_arrows:",description:"Merge Branches",emoji:"\u{1F500}",emojiLength:1,semver:o.NULL,type:"merge"},{code:":clown_face:",description:"Mock Things",emoji:"\u{1F921}",emojiLength:1,semver:o.NULL,type:"mock"},{code:":truck:",description:"Move or Rename Resources (Eg.: Files Paths Routes).",emoji:"\u{1F69A}",emojiLength:1,semver:o.NULL,type:"mv"},{code:":adhesive_bandage:",description:"Simple Fix for a Non-Critical Issue",emoji:"\u{1FA79}",emojiLength:1,semver:o.PATCH,type:"patch"},{code:":zap:",description:"Improve Performance",emoji:"\u26A1\uFE0F",emojiLength:1,semver:o.PATCH,type:"perf"},{code:":poop:",description:"Write Bad Code That Needs to Be Improved",emoji:"\u{1F4A9}",emojiLength:1,semver:o.NULL,type:"poo"},{code:":fire:",description:"Remove Code or Files",emoji:"\u{1F525}",emojiLength:1,semver:o.NULL,type:"prune"},{code:":pushpin:",description:"Pin Dependencies to Specific Versions",emoji:"\u{1F4CC}",emojiLength:1,semver:o.PATCH,type:"pushpin"},{code:":recycle:",description:"Refactor Code",emoji:"\u267B\uFE0F",emojiLength:0,semver:o.NULL,type:"refactor"},{code:":bookmark:",description:"Release / Version Tags",emoji:"\u{1F516}",emojiLength:1,semver:o.NULL,type:"release"},{code:":rewind:",description:"Revert Changes",emoji:"\u23EA\uFE0F",emojiLength:1,semver:o.PATCH,type:"revert"},{code:":coffin:",description:"Remove Dead Code",emoji:"\u26B0\uFE0F",emojiLength:0,semver:o.NULL,type:"rip"},{code:":passport_control:",description:"Work on Code Related to Authorization Roles and Permissions",emoji:"\u{1F6C2}",emojiLength:1,semver:o.PATCH,type:"roles"},{code:":fast_forward:",description:"Create Rollforward Version",emoji:"\u23E9\uFE0F",emojiLength:1,semver:o.NULL,type:"rollforward"},{code:":rocket:",description:"Custom Type for CI/CD to Hook into Run Build Override",emoji:"\u{1F680}\uFE0F",emojiLength:1,semver:o.PATCH,type:"run-build"},{code:":closed_lock_with_key:",description:"Add or Update Secrets",emoji:"\u{1F510}",emojiLength:1,semver:o.NULL,type:"secrets"},{code:":lock:",description:"Fix Security Issues",emoji:"\u{1F512}\uFE0F",emojiLength:1,semver:o.PATCH,type:"security"},{code:":seedling:",description:"Add or Update Seed Files",emoji:"\u{1F331}",emojiLength:1,semver:o.NULL,type:"seed"},{code:":mag:",description:"Improve Seo",emoji:"\u{1F50D}\uFE0F",emojiLength:1,semver:o.PATCH,type:"seo"},{code:":camera_flash:",description:"Add or Update Snapshots",emoji:"\u{1F4F8}",emojiLength:1,semver:o.NULL,type:"snapshot"},{code:":money_with_wings:",description:"Add Sponsorships or Money Related Infrastructure",emoji:"\u{1F4B8}",emojiLength:1,semver:o.NULL,type:"sponsor"},{code:":art:",description:"Improve Structure / Format of the Code",emoji:"\u{1F3A8}",emojiLength:1,semver:o.NULL,type:"style"},{code:":test_tube:",description:"Add a Failing Test",emoji:"\u{1F9EA}",emojiLength:1,semver:o.NULL,type:"test-fail"},{code:":white_check_mark:",description:"Add Update or Pass Tests",emoji:"\u2705",emojiLength:1,semver:o.NULL,type:"test"},{code:":speech_balloon:",description:"Add or Update Text and Literals",emoji:"\u{1F4AC}",emojiLength:1,semver:o.PATCH,type:"texts"},{code:":label:",description:"Add or Update Types",emoji:"\u{1F3F7}\uFE0F",emojiLength:0,semver:o.PATCH,type:"types"},{code:":pencil2:",description:"Fix Typos",emoji:"\u270F\uFE0F",emojiLength:0,semver:o.PATCH,type:"typo"},{code:":lipstick:",description:"Add or Update the UI and Style Files",emoji:"\u{1F484}",emojiLength:1,semver:o.PATCH,type:"ui"},{code:":arrow_up:",description:"Upgrade Dependencies",emoji:"\u2B06\uFE0F",emojiLength:0,semver:o.PATCH,type:"upgrade"},{code:":children_crossing:",description:"Improve User Experience / Usability",emoji:"\u{1F6B8}",emojiLength:1,semver:o.PATCH,type:"ux"},{code:":safety_vest:",description:"Add or update code related to validation",emoji:"\u{1F9BA}",emojiLength:1,semver:o.PATCH,type:"validation"},{code:":construction:",description:"Work in Progress",emoji:"\u{1F6A7}",emojiLength:1,semver:o.NULL,type:"wip"}],L=w;var E=(e,t,i)=>{var c;let r=L.findIndex(p=>p[t]===e);return (c=L[r])==null?void 0:c[i]};var A=({emoji:e,emojiLength:t})=>t===0?`${e} `:`${e} `,O=e=>e==null?void 0:e.padEnd(F.MAX),P=e=>e.map(({description:t,emoji:i,emojiLength:r,type:c})=>{console.log(`${A({emoji:i,emojiLength:r})} ${O(c)} ${t}`);}),R=(e,t)=>{let i=G[e==null?void 0:e.format],r=t!=null&&t.gitmoji?`${t==null?void 0:t.gitmoji} `:"",c=t!=null&&t.scope?`(${t==null?void 0:t.scope.replace(/ {2}/g,"--").replace(/ /g,"-").toLowerCase().trim()})`:"";return c=c&&(e==null?void 0:e.format)===l.GITMOJI?`${c} `:c,i.replace(/\{emoji\}/g,r).replace(/\{scope\}/g,c).replace(/\{breaking\}/g,"").replace(/\{title\}/g,t==null?void 0:t.title).replace(/\{type\}/g,t==null?void 0:t.type)};var g=(e,t,i)=>{let r=i?t.replace(/\{REPLACE\}/g,i):t;return r=`
19
+ ${r}
20
+ `,e===m.TYPES.ERROR?d.magenta.bold(r):e===m.TYPES.INFO?d.blue.bold(r):e===m.TYPES.WARNING?d.yellow.bold(r):d.green.bold(r)},b=(e,t,i)=>{let r=i?t.replace(/\{REPLACE\}/g,i):t;return e===m.TYPES.ERROR?d.red.bold(r):e===m.TYPES.INFO?d.white.bold(r):e===m.TYPES.WARNING?d.yellow.bold(r):d.green.bold(r)};var _=e=>{let t=e.length,i=t.toString(),r=m.TYPES.SUCCESS;return t<a.MIN||t>a.MAX?r=m.TYPES.ERROR:(t<a.MIN_SWAG||t>a.MAX_SWAG)&&(r=m.TYPES.WARNING),b(r,m.MESSAGES.REPLACE,i)};var U=()=>{let e=process.platform==="win32"?" nul":"/dev/null";return execSync("git rev-parse --show-toplevel 2>"+e).toString().trim()};var I=()=>{let e="",t;t=execSync("git rev-parse --abbrev-ref HEAD"),t=t.toString().trim().split("/");let i=t[0],c=(t[1]?t[1]:i).split("-"),p=c[0],h=c[1]?c[1]:p,q=`${p}-${h}`;return !isNaN(parseFloat(h))&&isFinite(parseFloat(h))&&(e=q),e};var v=()=>!!execSync("git diff --name-only --staged").toString().trim();var C=e=>{console.log(d.magenta.bold(`\u276F dry-run mode: ${e}
21
+ `));};var x=()=>{process.on("SIGINT",()=>{console.warn(">> [ccommit] was interrupted"),process.exit(0);});};var re=()=>L.map(({description:e,emoji:t,emojiLength:i,type:r})=>({emoji:t,emojiLength:i,description:e,type:r})),k=(e,t)=>{let r=`Character Count (${_(e)}/${t})`;return `${d.dim.cyan("\u203A")} ${d.dim.bold(r)}`},ne=e=>e.submitted?e.cancelled?d.magenta("\u2716"):d.green("\u2714"):d.cyan("?"),me=[{type:"confirm",name:"breaking",message:"Is there a breaking change?",initial:!1,default:"(y/N)",prefix(){return ne(this.state)},styles:{primary:d.white},format(e){let t=e?"yes":"no";return this.state.submitted?d.green(t):d.dim(t)}},{name:"messageBreaking",type:"input",message:"Please share breaking change info",skip(){return !this.state.answers.breaking},result(e){return e?`BREAKING CHANGE: ${e.trim()}`:""},footer(){return k(this.state.input,a.MAX)},validate(e){let t=(e==null?void 0:e.length)||0;return this.state.answers.breaking?t<15?"Must have at least 15 characters":t>a.MAX?`Cannot exceed ${a.MAX} characters`:!0:!0}},{type:"autocomplete",name:"gitmoji",message:"Please choose a commit type",choices:re().map(({description:e,emoji:t,emojiLength:i,type:r})=>{let c=t;return {name:` ${A({emoji:t,emojiLength:i})} ${O(r)} ${e}`,value:c}}),limit:18,footer(){return `${d.dim.cyan("\u203A")} ${d.dim.bold("scroll up and down to reveal more \u2195")}`},highlight(e){return d.cyanBright(e)}},{name:"scope",type:"input",message:"Please share the scope (if any)",format(){return this.state.submitted?d.green(this.value):this.value},footer(){return k(this.state.input,y.MAX)},validate(e){let t=e.length;return t===0?!0:t<y.MIN?`Must have at least ${y.MIN} characters`:t>y.MAX?`Cannot exceed ${y.MAX} characters`:!0}},{name:"title",type:"input",message:"Please enter the commit title",initial:I()?`${I()} `:"",hint(){return this.state.initial?"\u2026 tab to use initial value":""},footer(){return k(this.state.input,a.MAX)},validate(e){let t=e.length;return t<a.MIN?`Must have at least ${a.MIN} characters`:t>a.MAX?`Cannot exceed ${a.MAX} characters`:!0}},{name:"message",type:"input",message:"Please share a more detailed commit message (if applicable)",multiline:!0,footer(){return `${d.dim.cyan("\u203A")} ${d.dim("Return twice to submit/skip: \u2B91 \u2B91")}`},result(e){return e===`
22
+ `?"":e}}],K=me;var ce=async(e,t)=>{try{let i=e==null?void 0:e.subject,r=e==null?void 0:e.message,c=e==null?void 0:e.messageBreaking,p=["commit","-m",`"${i}"`];r&&p.push("-m",`"${r}"`),c&&p.push("-m",`"${c}"`),t!=null&&t.dryrun?C(["git",...p].join(" ")):await execa("git",p,{buffer:!1,stdio:"inherit"});}catch(i){console.error(g(m.TYPES.ERROR,m.MESSAGES.COMMIT_FAIL,i.escapedCommand)),process.exit(1);}},W=ce;var pe=join(U(),".git","COMMIT_EDITMSG"),le=(e,t)=>{try{let i=e==null?void 0:e.subject;(e==null?void 0:e.message)&&(e==null?void 0:e.message)!==`
23
+ `&&(i+=`
23
24
 
24
- ${e.message}`),e!=null&&e.messageBreaking&&(i+=`
25
+ ${e.message}`),(e==null?void 0:e.messageBreaking)&&(e==null?void 0:e.messageBreaking)!==`
26
+ `&&(i+=`
25
27
 
26
- ${e.messageBreaking}`),t!=null&&t.dryrun?E(i):W.writeFileSync(Ne,i);}catch(i){console.error(i),process.exit(1);}finally{process.exit(0);}},w=ve;var ee=async e=>{let t;if(e.skip)t=e,t.gitmoji=T(t.type,u.TYPE,u.EMOJI),t.gitmoji||(console.log(p(s.TYPES.ERROR,s.MESSAGES.TYPE_INCORRECT,t.type)),process.exit(2));else {let n=Q(e);await Y.prompt(n).then(r=>{r.type=T(r.gitmoji,u.EMOJI,u.TYPE),r.gitmoji||(console.log(p(s.TYPES.ERROR,s.MESSAGES.TYPE_INCORRECT,r.gitmoji)),process.exit(2)),t=r;});}let i=P(e,t);return t.subject=i,e.mode===L.HOOK?w(t,e):Z(t,e)},Re=e=>e.mode===L.HOOK?(D(),S().then(()=>ee(e))):ee(e),te=Re;var A=te;var _e=()=>v(h),oe=_e;var $=oe;var Ue=xe(`
28
+ ${e.messageBreaking}`),t!=null&&t.dryrun?C(i):D.writeFileSync(pe,i);}catch(i){console.error(i),process.exit(1);}finally{process.exit(0);}},J=le;var{prompt:he}=ge,X=async e=>{let t={};return e.skip?(t=e,t.gitmoji=E(t.type,T.TYPE,T.EMOJI),t.gitmoji||(console.log(g(m.TYPES.ERROR,m.MESSAGES.TYPE_INCORRECT,t.type)),process.exit(2))):await he(K).then(i=>(i.type=E(i.gitmoji,T.EMOJI,T.TYPE),i)).then(i=>{t=i;}).catch(console.error),t.subject=t?R(e,t):"",e.mode===f.HOOK?J(t,e):W(t,e)},ue=e=>e.mode===f.HOOK?(x(),S().then(()=>X(e))):X(e),V=ue;var M=V;var Le=()=>P(L),z=Le;var H=z;var ye=fe(`
27
29
  Usage
28
30
  $ ccommit -c
29
31
 
30
32
  Flags
31
- --${m.BREAKING}, -b \u{1F4A5} Breaking Change
32
- --${m.COMMIT}, -c \u{1F4BD} Mode: Client
33
- --${m.DRYRUN}, -n \u{1F3BD} Mode: Dry Run
34
- --${m.EMOJI}, -e \u{1F61C} Emoji (default)
35
- --${m.HOOK}, -u \u{1FA9D} Mode: Hook
36
- --${m.LIST}, -l \u{1F4D6} List all types
37
- --${m.VERSION}, -v \u{1F4E6} Print installed version
33
+ --${n.BREAKING}, -b \u{1F4A5} Breaking Change
34
+ --${n.COMMIT}, -c \u{1F4BD} Mode: Client
35
+ --${n.DRYRUN}, -n \u{1F3BD} Mode: Dry Run
36
+ --${n.EMOJI}, -e \u{1F61C} Emoji (default)
37
+ --${n.HOOK}, -u \u{1FA9D} Mode: Hook
38
+ --${n.LIST}, -l \u{1F4D6} List all types
39
+ --${n.VERSION}, -v \u{1F4E6} Print installed version
38
40
 
39
41
  Options
40
- --${c.FORMAT} \u{1F61C} Commit Format: conventional|gitmoji (default)
41
- --${c.MESSAGE} \u{1F4DD} Commit Message
42
- --${c.SCOPE} \u{1F52C} Commit Scope
43
- --${c.TITLE} \u{1F4D3} Commit Title
44
- --${c.TYPE} \u2728 Commit Type
42
+ --${s.FORMAT} \u{1F61C} Commit Format: conventional|gitmoji (default)
43
+ --${s.MESSAGE} \u{1F4DD} Commit Message
44
+ --${s.SCOPE} \u{1F52C} Commit Scope
45
+ --${s.TITLE} \u{1F4D3} Commit Title
46
+ --${s.TYPE} \u2728 Commit Type
45
47
 
46
48
  Notes
47
49
  - Pass any non-format options the following will be required: --title, --type
48
50
  - If you do not pass any options the Conventional Commit Generator prompt will run
49
51
  - Branch Name detection is enabled to pre-populate Issue Tracker information in prompt
50
- `,{importMeta:import.meta,flags:{[m.BREAKING]:{type:"boolean",alias:"b",default:!1},[m.COMMIT]:{type:"boolean",alias:"c"},[m.DRYRUN]:{type:"boolean",alias:"n"},[m.EMOJI]:{type:"boolean",alias:"e",default:!0},[m.HELP]:{type:"boolean",alias:"h"},[m.HOOK]:{type:"boolean",alias:"u"},[m.LIST]:{type:"boolean",alias:"l"},[m.SKIP]:{type:"boolean",default:!1},[m.VERSION]:{type:"boolean",alias:"v"},[c.FORMAT]:{type:"string",default:l.GITMOJI},[c.MESSAGE]:{type:"string"},[c.SCOPE]:{type:"string"},[c.TITLE]:{type:"string"},[c.TYPE]:{type:"string"}}}),He={[y.COMMIT]:e=>A(e),[y.HOOK]:e=>A(e),[y.LIST]:()=>$()};O(Ue,He);
52
+ `,{importMeta:import.meta,flags:{[n.BREAKING]:{type:"boolean",alias:"b",default:!1},[n.COMMIT]:{type:"boolean",alias:"c"},[n.DRYRUN]:{type:"boolean",alias:"n"},[n.EMOJI]:{type:"boolean",alias:"e",default:!0},[n.HELP]:{type:"boolean",alias:"h"},[n.HOOK]:{type:"boolean",alias:"u"},[n.LIST]:{type:"boolean",alias:"l"},[n.SKIP]:{type:"boolean",default:!1},[n.VERSION]:{type:"boolean",alias:"v"},[s.FORMAT]:{type:"string",default:l.GITMOJI},[s.MESSAGE]:{type:"string"},[s.SCOPE]:{type:"string"},[s.TITLE]:{type:"string"},[s.TYPE]:{type:"string"}}}),Te={[j.COMMIT]:e=>M(e),[j.HOOK]:e=>M(e),[j.LIST]:()=>H()};N(ye,Te);
53
+ /*!
54
+ * For license information please see index.js.LICENSE.txt
55
+ */
56
+ /*!
57
+ * reference: https://github.com/carloscuesta/gitmoji-cli
58
+ */
@@ -0,0 +1,44 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021-2023 Nice Group of People, LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ MIT License
24
+
25
+ Copyright (c) 2016-2022 Carlos Cuesta
26
+
27
+ Permission is hereby granted, free of charge, to any person obtaining a copy
28
+ of this software and associated documentation files (the "Software"), to deal
29
+ in the Software without restriction, including without limitation the rights
30
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
31
+ copies of the Software, and to permit persons to whom the Software is
32
+ furnished to do so, subject to the following conditions:
33
+
34
+ The above copyright notice and this permission notice shall be included in all
35
+ copies or substantial portions of the Software.
36
+
37
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
38
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
39
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
40
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
41
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
42
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
43
+ SOFTWARE.
44
+
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "license": "MIT",
4
- "version": "1.0.1",
4
+ "version": "1.1.0-enquirer.1",
5
5
  "name": "ccommit",
6
6
  "description": "Conventional Commit Generator that interprets commit types from gitmoji and conventional",
7
7
  "author": {
@@ -45,16 +45,13 @@
45
45
  "semantic-release": "semantic-release"
46
46
  },
47
47
  "dependencies": {
48
- "chalk": "5.2.0",
48
+ "ansi-colors": "4.1.3",
49
+ "enquirer": "2.3.6",
49
50
  "execa": "6.1.0",
50
51
  "fuse.js": "6.6.2",
51
- "inquirer": "9.1.4",
52
- "inquirer-autocomplete-prompt": "3.0.0",
53
52
  "meow": "11.0.0"
54
53
  },
55
54
  "devDependencies": {
56
- "@types/inquirer": "9.0.3",
57
- "@types/inquirer-autocomplete-prompt": "3.0.0",
58
55
  "pkg": "5.8.0"
59
56
  },
60
57
  "peerDependencies": {},
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2016-2022 Carlos Cuesta
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.