Simple Commit Handler!
What you get:
- π Beautiful Commits
- π Standardized commit messages
- π― Simplified commit process
About package:
- π Install & Use
- βοΈ Easy in Configuring
- π§ High Customizable (Prompts, Formatters)
- π¦ Support Monorepo
- π TSDocs (Internal documentation)
- β»οΈ Minified & Compressed
- β Support JS/TS & CJS/ESM
NPM
npm install -D commitsmile
PNPM
pnpm add -D commitsmile
Yarn
yarn add -D commitsmile
πHello! Glad to see you! There is order task to setup:
Command | Description |
---|---|
pnpm i -D commitsmile |
Install it at repo |
pnpm commitsmile init |
Init and configure (Optional) |
pnpm commitsmile |
Use! :D |
Command | Description |
---|---|
(default) | Commit Handler (CLI APP) |
init | Init config file (CLI APP) |
To get more information about commands, use --help
To find config we use c12
and our system.
In Default execute app is looking for files names match
/commitsmile.*\.(js|ts|mjs|cjs|mts|json|jsonc|json5|yaml|yml|toml)/iu
- Name: commitsmile (letters can be uppercase or lowercase or mixed)
- pre ext (optional)
- Ext:
js|ts|mjs|cjs|mts|json|jsonc|json5|yaml|yml|toml
examples:
commitsmile.discord.ts
coMMitSmile.json
Supports to:
β Supports too |
---|
.config/ |
.rc |
With commitsmile
property.
Package export defaultConfig
which can be configured and deep merge your config!
import { defaultConfig } from "commitsmile";
export default defaultConfig({
/* There config for defaultConfig */
}).deepMerge({
/* There your config which will be merged with default config*/
});
More info in internal Documentation (Code)
There you can make your own formatters.
Stage name | description |
---|---|
format |
Format formatted stages output (Final format of commit) |
type |
Format of type |
scopes |
Format of scopes |
isBreaking |
Format of isBreaking |
title |
Format of title |
Part of Config responsible for Commit Stages.
Stage name | type of prompt | Special properties |
---|---|---|
type |
multiselect | |
scopes |
multiselect | workspaces - Show found workspaces in monorepo |
isBreaking |
confirm | |
title |
text | |
description |
select | always - Always select that in select menu |
Every Step is Optional and can be skipped. To do it just use value false
or undefined
/ void 0
Commands which will be executed at the end (In key order).
example:
{
gitAdd: "git add .",
commit: (results) => `git commit -m '${results.format()}' ${results.commitDescription ? `-m "${results.commitDescription}"` : ''}`,
gitPush:"git push"
}
Every shorthand it's provided by our parser.
At | Description | From | To |
---|---|---|---|
Config.prompts.stage |
If value is just a string | type:"What type of changes" |
type:{message:"What type of changes"} |
Config.prompts.stage.options |
If option is just a string | ["Option 1"] |
[{value:"Option 1"}] and continue below logic |
Config.prompts.stage.options |
If option has a value but not a label | [{value:"Option 1"}] |
[{value:"Option 1", label:"Option 1"}] |
Config.prompts.stage.options |
If option has a label but not a value | [{label:"Option 1"}] |
[{value:"Option 1", label:"Option 1"}] |
Yes, you can do this,this way:
If you want to remove them totally in CLI view commit
{
emoji: false;
}
If you want to remove them in CLI view but stay in commit
{
emoji: {
label: false;
}
}
If you want to remove them in commit but stay in CLI view
{
emoji: {
value: false;
}
}