Skip to content

phellams/commitfusion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Phellams Logo

Commitfusion

MIT License Build Status Build Status gitlab issues codefactor

CommitFusion helps you create standardized commit messages that follow the Conventional Commits specification. The module enhances the standard by including additional sections:

πŸ““ Documentaiton https://sgkens.github.io/commitfusion

Module Features

  • Conventional Commits Standard
  • Customizable Commit Messages with a variaty of options:
    • Β» Type (CommitType) eg:feat:
    • Β» Scope (Scope in brackets) eg: ✨feat(scope):
    • Β» Descrption (Default|Custom).
    • Β» Notes (Array of strings)
    • Β» FeatureAdditions (Array of strings)
    • Β» FeatureNotes (Array of strings)
    • Β» BugFixes (Array of strings)
    • Β» GitUser (GitUser Account Name)
    • Β» GitGroup (if your repository sits in /group/repo.git)
    • Β» Footer (Custom footer)
    • Β» SemVer (Semantic Version Switch)
  • Semantic Versioning(Semver) Version Generator
  • Changelog Auto updater with Markdown Auto-format
  • Gitmoji custom schema (miscellaneous functions cmdlets)
  • Unicode Emoticons (miscellaneous cmdlets)
  • Enable/Disable Emoticons using Enable-CommitFusionEmoji and Disable-CommitFusionEmoji
  • Generate Release Notes with Get-ReleaseNotes.

πŸ”»Conventional Commit TemplateπŸ”»

  [e] Type(Scope): Description

  [e] Build: Semver(Major|Minor|Patch)

  NOTES [e]:
    [e] Note 1
    [e] Note 2

  [e] BREAKING CHANGES
    [e] Change 1
    [e] Change 2 

  [e] FEATURE ADDTIONS
    [e] Addtion 1
    [e] Addtion 2...[e]

  [e] FEATURE NOTES
    [e] Feature Note 1
    [e] Feature Note 2

  [e] BUG FIXES
    [e] Fix 1
    [e] Fix 2
    
  [e] GitUser @ [e] DateTime

Installation

Phellams modules are available from PowerShell Gallery and Chocolatey. you can access the raw assets via Gitlab Generic Assets or nuget repository via Gitlab Packages.

β–“β–“β–“β–“β–’β–’β–’β–’β–‘β–‘β–‘ β–“β–“β–“β–“β–’β–’β–’β–’β–‘β–‘β–‘ β–“β–“β–“β–“β–’β–’β–’β–’β–‘β–‘β–‘
πŸ“¦ PSGallery powershellgallery powershellgallery-downloads
πŸ“¦ Chocolatey chocolatey chocolatey-downloads

Additinonal Installation Options:

β–“β–“β–“β–“β–’β–’β–’β–’β–‘β–‘β–‘ β–“β–“β–“β–“β–’β–’β–’β–’β–‘β–‘β–‘ β–“β–“β–“β–“β–’β–’β–’β–’β–‘β–‘β–‘
πŸ’Ό Releases/Tags gitlab-release gitlab tags

πŸ“¦ GitLab Packages

Using nuget: See the packages page for installation instructions.

For instructions on adding nuget sources packages from GitLab see Releases artifacts or via the Packages page.

🧺 Generic Asset

The latest release artifacts can be downloaded from the Generic Assets Artifacts page.

πŸ’Ύ Git Clone

# Clone the repository
git clone https://gitlab.com/phellams/commitfusion.git
cd commitfusion
import-module .\

πŸŸͺ Cmdlets

Command --
πŸ”Ή New-Commit Build Commit string base on inputs and return type [string]
πŸ”Ή Set-Commit Applies the commit messages git commit $fusionmessage
πŸ”Ή New-CommitFusion Returns an instance of [CommitFusion] class
πŸ”Ή Get-Emoji Get Emojis filter by name and type
πŸ”Ή Get-EmojiInex Return Emoji index as a[psobject] or table format
πŸ”Ή Get-CiSet Return CiSet from $moduleroot\libs\gitmojis.json
πŸ”Ή Get-CiSetFustion Return CiSetFusion from $moduleroot\libs\CommitFustion.types.json
πŸ”Ή Format-FusionMD Parses the commit string and adds markdown formatting
πŸ”Ή Update-ChangeLog Writes commit message to specified file
πŸ”Ή Get-GitAutoversion Generates semver version return as [psobject]
πŸ”Ή Get-CommitTypes Returns Commit Types -Type (Gitmojis
πŸ”Ή Get-ReleaseNotes Generates Release Notes Base on branch and catagory type
πŸ”Ή Disable-CommitFusionEmojis Sets EmojisEnabled calls var to false
πŸ”Ή Enable-CommitFusionEmojis Sets EmojisEnabled calls var to true

πŸŸͺ Using Commit Fusion.

πŸ”Ή Retrive list of available commit types.

Get-CommitTypes -Patch
Get-CommitTypes -Minor
Get-CommitTypes -Major
Get-CommitTypes -NoSemver

πŸ”Ή Creating a new feat commit.

# Create New Commit minimal params
New-Commit -Type Docs 

# Create Commit with Custom Description
New-Commit -Type Docs -Description "Updated module logic"

# Create Commit with Custom Description and Notes
New-Commit -Type Docs -Description "Updated module logic" -Notes "Updated module logic", "updated readme"

New-Commit All Params

New-Commit -[t|Type]          <String>
           -[s|Scope]         <String> 
           -[d|Description]   <String> 
           -[n|Notes]         <String[]> 
           -[FeatureAddtions] <String[]> 
           -[FeatureNotes]    <String[]> 
           -[b|BugFixes]      <String[]> 
           -[GitUser]         <String> 
           -[GitGroup]        <String> 
           -[Footer]          <Switch> 
           -[AsString]        <Switch>  # Default
           -[AsObject]        <Switch> 

πŸ”Ή Assuming you have staged files, Use Set-Commit -Confirm to Apply the commit message.

# Apply Commit
New-Commit -Type feat -Notes "note 1","note 2" | Set-Commit -Confirm
# Apply Commit format commit message to markdown and write to changelog file 
New-Commit -Type feat -Notes "note 1","note 2" | Format-FusionMD | Update-Changelog -logfile path\to\file | Set-Commit -Confirm

πŸ”Ή Generate Semantic Version Number (Semver) version base on you commit history

# generate SemVer Version returns psobject
Get-GitAutoVersion | select version
# only string
(Get-GitAutoVersion).Version
# in string
$version = "v_$((Get-GitAutoVersion).Version)"

πŸŸͺ Changing default Commit Types

If you would like to change the default types, description, and emotocons: Types .json file are found at $moduleroot/libs/commitfusion.types.json\

πŸ”ΉExample :

{
    "templateName": "default",
    "templateDescription": "commitfusion-ciset",
    "templateVersion": "1.0.0",
    "ciset": [
        {
            "Type": "changes",
            "emoji": "πŸ’₯",
            "description": "Introduce breaking changes.",
            "name": "boom",
            "semver": "major",
            "cfa": [
                {
                    "action": ""
                }
            ]
        },
        ...
    ]
}     

Roadmap

🟑 Task List

  • πŸ’  Add support for importing custom commits types from a specified json file.
  • πŸ’  Implement SimpleSpectreWrapper to parse and format psobject to spectre table.
  • πŸ’  Add support for no-emojis. only ascii.

Contributing

Feel free to contribute! Fork the repo and submit a merge request with your improvements. Or, open an issue with the enhancement tag to discuss your ideas.

  1. Fork the Project from git clone https://gitlab.com/phellams/commitfusion.git
  2. Create your Feature Branch check out the branch dev git switch dev.
    1. git switch -c feature/AmazingFeature
    2. or
    3. git checkout -b feature/AmazingFeature
  3. Commit your Changes git commit -m 'Add some AmazingFeature'
  4. Push to the Branch git push origin feature/AmazingFeature
  5. Open a Merge Request

LICENSE

This project is licensed under the terms of the MIT License

About

CommitFusion is a powershell module that assists the user in generating Conventional Commits, and prepending to changelog

Resources

License

Stars

Watchers

Forks

Packages

No packages published