Cmdlets
Commitfusion provides a number cmdlets to help with the creation of conventional commits, changelog updates and semver version generator.
New-Commit
New-Commit
takes 11
Parameters, 2
of which are Mandatory type
and Description
.
🥏 Parameter List
- Type
[String]
Parameter values are imported from$moduleroot/libs/CommitFustion.json
at module Import.Note!
♦ - Additional types can be added toCommitFustion.json
file if needed. Schema follows 🧷 Carlos Cuesta Gitmojis Schema @ 🧷 gitmoji.dev with additionaltype
andcfa
added to the object array items.
PARAMETER REQUIRED - Scope
[string]
The Scope of the commit, User specified, placed between brackets after theType
- OPTIONAL - Description
[string]
The Commit Description, User specified, placed after thescope
- PARAMERTER REQUIRED - Notes
[string[]]
Array of text and will ouput under theNOTES:
area inside the body - OPTIONAL - BugFixes
[string[]]
Array of text and will ouput under theBUG FIXES:
area inside the body - OPTIONAL - FeatureNotes
[string[]]
Array of text and will ouput under theFEATURE NOTES:
area inside the body, - OPTIONAL - FeatureAddtions
[string[]]
Array of text and will ouput under theFEATURE ADDTIONS:
area inside the body - OPTIONAL - BreakingChanges
[string[]]
Array of text and will ouput under theBREAKING CHANGES:
area inside the body - OPTIONAL - Footer
[switch]
Display Footer if specified will output GitUser and DateTime OPTIONAL - GitUser
[String]
Use with footer and the generated commit link when usingFormat-FustionMD
cmdlet - OPTIONAL - GitGroup
[string]
Use to generated commit link when using theFormat-FustionMD
cmdlet - OPTIONAL
For Example:
# Minimal Required Parameters Example
New-Commit -Type feat -Description "Added new feature"
# All Parameters Example
New-Commit -Type feat `
-Description "Added new feature" `
-Scope "add" `
-Notes "Note 1","Note 2" `
-BugFixes "BugFixes 1","BugFixes 2" `
-FeatureNotes "FeatureNotes 1","FeatureNotes 2" `
-FeatureAddtions "FeatureAddtions 1","FeatureAddtions 2" `
-BreakingChanges "BreakingChanges 1","BreakingChanges 2" `
-GitUser "GitUser" `
-GitGroup "GitGroup" `
-Footer
Will Ouput
✨ feat(add): Added new feature
🧰 Build: minor
📜 NOTES:
✏ Note 1
✏ Note 2
🌟 FEATURE ADDTIONS:
🍠 FeatureAddtions 1
🍠 FeatureAddtions 2 ..🖊
🐛 BUGFIXES:
🦠 BugFixes 1
🦠 BugFixes 2 ..🖊
🧪 FEATURE UPDATES:
🔨 FeatureNotes 1
🔨 FeatureNotes 2 ..🖊
💢 BREAKING CHANGES:
🧨 BreakingChanges 1
🧨 BreakingChanges 2 ..🖊
👤 @GitUser 📅 9:41PM, Friday 4th August 2023
Format-FusionMD
The function currently takes 0
parameters. It reads the output from New-Commit
and formats it into Markdown format ready for documentation or changelog updates.
For Example:
New-Commit -Type feat `
-Description "Added new feature" `
-Scope "add" `
-Notes "Note 1","Note 2" `
-BugFixes "BugFixes 1","BugFixes 2" `
-FeatureNotes "FeatureNotes 1","FeatureNotes 2" `
-FeatureAddtions "FeatureAddtions 1","FeatureAddtions 2" `
-BreakingChanges "BreakingChanges 1","BreakingChanges 2" `
-GitUser "GitUser" `
-GitGroup "GitGroup" `
-Footer | Format-FusionMD
Will Ouput
## 🎯-✨ feat(add):Added new feature
> [🧰]» <kbd>MINOR</kbd>
📜 NOTES:
✏ Note 1 \
✏ Note 2 ..🖊
🌟 FEATURE ADDTIONS: |
|-|
🍠 FeatureAddtions 1 \
🍠 FeatureAddtions 2 ..🖊
🐛 BUG FIXES: |
|-|
🦠 BugFixes 1 \
🦠 BugFixes 2 ..🖊
🧪 FEATURE UPDATES: |
|-|
🔨 FeatureNotes 1 \
🔨 FeatureNotes 2 ..🖊
💢 BREAKING CHANGES: |
|-|
🧨 BreakingChanges 1 \
🧨 BreakingChanges 2 ..🖊
👤 @GitUser 📅 8:28AM, Monday 14th August 2023
Update-ChangeLog
Update-ChangeLog takes 1
Optional Parameter:
🥏 Parameter List
logfile
: (optional) Specifies the relative path to the changelog file. If not specified, it will look forCHANGELOG.md
in the current directory. If the file is not found, it will create one. The function will attempt to pre-pend the output fromFormat-FusionMD
to the file.
For Example:
New-Commit New-Commit -Type feat `
-Description "Added new feature" `
-Scope "add" `
-Notes "Note 1","Note 2" `
-BugFixes "BugFixes 1","BugFixes 2" `
-FeatureNotes "FeatureNotes 1","FeatureNotes 2" `
-FeatureAddtions "FeatureAddtions 1","FeatureAddtions 2" `
-BreakingChanges "BreakingChanges 1","BreakingChanges 2" `
-GitUser "GitUser" `
-GitGroup "GitGroup" `
-Footer | Format-FusionMD | Update-ChangeLog -logfile "CHANGELOG.md"
Set-Commit
Set-Commit takes 0
Parameters, will simple run git commit -m $commitmessage
and will use the output from New-Commit
as the commit message.
Asummptions:
- You are in a git repository
- You have staged files
Get-GitAutoVersion
This function takes 0
Parameters, it will parse the git log see semver-version-generator for more information on the logic of function.
For Example:
git log with no
semver
tags in the git log
# Object
Get-GitAutoVersion
# just property
Get-GitAutoVersion | Select-Object -Property Version
# or just method
(Get-GitAutoVersion).Version
Will Ouput
# object
Version Parsedlines
------- -----------
0.1.0 3
# string
0.1.0
# string
0.1.0
Get-CiSet
Get-CiSet parses 🧷carloscuesta gitmojis Schema JSON file and return as a PSObject, making it helpful if you wish to utilize custom types in your commit messages. The $moduleroot/libs/Gitmojis.json
file serves as a reference, but you have the flexibility to customize it according to your preferences, as long as the schema remains consistent. Additionally, it’s worth noting that the type
and cfa
additions are the same as those found in the $moduleroot/libs/CommitFusion.json
file.
Get-CiSet | Select-Object -First 10 | FT -Wrap
name description semver code entity emoji
---- ----------- ------ ---- ------ -----
art Improve structure / format of the code. :art: 🎨 🎨
zap Improve performance. patch :zap: ⚡ ⚡️
fire Remove code or files. :fire: 🔥 🔥
bug Fix a bug. patch :bug: 🐛 🐛
ambulance Critical hotfix. patch :ambulance: 🚑 🚑️
sparkles Introduce new features. minor :sparkles: ✨ ✨
memo Add or update documentation. :memo: 📝 📝
rocket Deploy stuff. :rocket: 🚀 🚀
lipstick Add or update the UI and style files. patch :lipstick: &#ff99cc; 💄
tada Begin a project. :tada: 🎉 🎉
Get-CommitTypes
Get-CiSetFusion Takes 4
optional Parameters, it will parse and write to console the types from the $moduleroot/libs/CommitFusion.json
file. The types can be further filtered by the following parameters:
🥏 Parameter List
-NoSemver
: Filters types without semantic versioning.-Major
: Filters types of major version changes.-Minor
: Filters types of minor version changes.-Patch
: Filters types of patch version changes.-Patch
: returnspsobject
If no parameters are specified, it will return all the types.
If you would like to return the PSObject as this function renders the result using Spectre.Console via SimpleSpectreWrapper, you can use the -raw
parameter to return the PSObject instead.
Type description semver cfa emoji
---- ----------- ------ --- -----
changes Introduce breaking changes. major {@{action=}} 💥
feat Introduce new features. minor {@{action=}} ✨
fix Fixed bugs. patch {@{action=}} 🐛
docs Update Documentation. {@{action=}} 📝
style Update style. patch {@{action=}} 💄
perf Improve performance. patch {@{action=}} ⚡️
test Add tests. {@{action=}} ✅
build Build. patch {@{action=}} 📦
ci Continuous integration. {@{action=}} 👷
chore Tooling, Generic commit {@{action=}} 🔧
revert Revert changes. patch {@{action=}} ⏪
bookmark Release / Version tags. {@{action=}} 🔖
wip Work in progress. {@{action=}} 🚧
gitignore Add or update a .gitignore file. {@{action=}} 🙈
flag Add, update, or remove feature flags. {@{action=}} 🚩
improve Improve structure / format of the code. patch {@{action=}} 🎨
hotfix Critical hotfix. patch {@{action=}} 🚑️
deploy Deploy stuff. {@{action=}} 🚀
project Begin a project. {@{action=}} 🎉
security Fix security issues. patch {@{action=}} 🔒️
refactor Refactor code. {@{action=}} ♻️
depadd Add a dependency. patch {@{action=}} ➕
depdell Remove a dependency. patch {@{action=}} ➖
config Add or update configuration files. patch {@{action=}} 🔧
typos Fix typos. patch {@{action=}} ✏️
resources Move or rename resources (e.g.: files, paths, routes). {@{action=}} 🚚
fix-s Simple fix for a non-critical issue. patch {@{action=}} 🩹
deadcode Remove dead code. {@{action=}} ⚰️
Depre Remove deprecate code. {@{action=}} 🗑️
concurrency Add or update code related to multithreading or concurrency. {@{action=}} 🧵
Infra Infrastructure related changes. patch {@{action=}} 🧱
Note! You can modify the $moduleroot/libs/CommitFusion.json
file to add your own types, using the GitMojis. See New-Commit Types for more information.
Get-CiSetFusion -NoSemver -NoRender | Select-Object -First 10 | FT -Wrap
Get-Emoji
Get-Emoji take 2
optional Parameters:
🥏 Parameter List
-Type
: Specify either miscmojis or gitmojis to select the desired type.-Name
(optional): If specified, it will return the emoji with the specified name. If not specified, it will return all the emojis of the specified type.
New-CommitFusion
New-CommitFusion 0
Parameters it will return a new instance of the commit fusion class.
Note! if you want to use the
commitfusion_class.psm1
lib directly see$moduleroot/libs/commitfusion_class.lib
for more information.
Get-CommitFusionModuleInstance
Get-CommitFusionModuleInstance takes 0
Parameters and will return the module instance initiated at module import. See $moduleroot/libs/cmdlets/Get-CommitFusionModuleInstance.psm1
, used by all the cmdlets to interact with the class instance.