Skip to content

Commit

Permalink
Merge branch 'master' of github.com:rioukkevin/vscode-git-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
RIOU Kevin committed Jul 16, 2022
2 parents 93da56e + 683c78a commit 9b15533
Show file tree
Hide file tree
Showing 26 changed files with 613 additions and 101 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
}
]
},
"vscodeGitCommit.defaultVariablesValues": {
"scope": "😉"
},
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#e36b61",
"activityBar.activeBorder": "#136c1a",
Expand Down
35 changes: 20 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Changelog

#### **3.0.1** (_02-24-2022_):
#### **3.0.2** (_07-16-2022_)

- ✨feature: ability to define default value for free text inputs
- ✨feature: add repo current branch in variables

#### **3.0.1** (_02-24-2022_)

- 🐞fix: settings migration script fix from V3.0.0

> third release with an UI O_o and a lot of new features (btw: we reached the 5k installs THX U ♥️)
#### **3.0.0** (_02-23-2022_):
#### **3.0.0** (_02-23-2022_)

- ✨feature: use of information or error message as feedback
- ✨feature: update contributes.configuration $schema
Expand All @@ -16,66 +21,66 @@
- ✨feature: add ability to search for files using predefined variable names
- 📄docs (docs): update docs globaly and make a web version

#### **2.1.0** (_05-06-2021_):
#### **2.1.0** (_05-06-2021_)

- ✨feature: auto focus scm commit input on finish (cf: issues [#10](https://github.com/rioukkevin/vscode-git-commit/issues/10))
- ✨feature: add abilities to concatenate multiple variables in settings (cf: issues [#11](https://github.com/rioukkevin/vscode-git-commit/issues/11) & [#12](https://github.com/rioukkevin/vscode-git-commit/issues/12))

> second release OH YEAHHH !!!!
#### **2.0.0** (_04-09-2021_):
#### **2.0.0** (_04-09-2021_)

- ✨feature: add ability to use text input or select input for any variables

#### **1.1.5** (_12-18-2020_):
#### **1.1.5** (_12-18-2020_)

- 📄docs (docs): update docs with animated gif

#### **1.1.4** (_11-06-2020_):
#### **1.1.4** (_11-06-2020_)

- ✨feature: Handle multi repo case

#### **1.1.3** (_11-06-2020_):
#### **1.1.3** (_11-06-2020_)

- 🐞fix: Update icon (cf: issues [#4](https://github.com/rioukkevin/vscode-git-commit/issues/4))
- 🐞fix: Handle cancel action when typing variables (cf: issues [#5](https://github.com/rioukkevin/vscode-git-commit/issues/5))
⚙️refactor: Refacto on extension command name

#### **1.1.1** (_10-20-2020_):
#### **1.1.1** (_10-20-2020_)

- 🐞fix: Update icon (cf: issues [#4](https://github.com/rioukkevin/vscode-git-commit/issues/4))

#### **1.1.0** (_10-12-2020_):
#### **1.1.0** (_10-12-2020_)

- ✨feat(workflow): Add abilities to create custom message format using simple brackets in settings, see doc
- ⚙️refactor(global): Refacto on major part of the code
- 🌈style(typescript/prettier): Pass into prettier + update ts rules

#### **1.0.1** (_09-30-2020_):
#### **1.0.1** (_09-30-2020_)

- ✨feature: On demand, add based commitizen prefix for alpha8
- 🔵other: Change default mode to concatenate settings

> First Release, I've done it !!
#### **1.0.0** (_09-21-2020_):
#### **1.0.0** (_09-21-2020_)

- ✨feature: Replace icon with outlined

#### **0.0.4** (_09-15-2020_):
#### **0.0.4** (_09-15-2020_)

- ✨feature: add a mode to concatenate message with existing or replace existing
- 🐞fix: focus on quickPick not on scm input box when triggering extension

#### **0.0.3** (_08-25-2020_):
#### **0.0.3** (_08-25-2020_)

- ✨feature: V0.0.3 add prefix sets

#### **0.0.2** (_08-23-2020_):
#### **0.0.2** (_08-23-2020_)

- ✨feature: Add custom prefix setting
- 🐞fix: Open SCM view when prefix selector is opened, not at the end of process

#### **0.0.1** (_08-18-2020_):
#### **0.0.1** (_08-18-2020_)

- Initial release
45 changes: 27 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,20 @@ For each variables defined in the template above, you can define the content:
- the value startWith 'files' -> An array of files with defined status is displayed as choices
- the value looks like '<<something>>...<<something_else>>' -> a merge of array between the variable 'something' and 'something_else' is created as choices

#### If you write your own Array:
#### If you write your own Array

- The 'detail' property is optionnal
- The 'label' property is used as the content include in template
- (For old users) The 'id' property is now automatically generated and not used anymore by the extension

#### If you want predefined choices:
#### If you want predefined choices

- 'keke' is the prefix I use personnally
- 'angular' is prefix specific to angular repos (HELP: if someone has a full config for angular commits, can you share it with me by creating a PR or Issue ?)
- 'alpha8' is prefix we used in the enterprise where I work
- 'semantic' is an other normalization of prefix but I lost the link associated :/

#### If you want to list files many possibilities are yours:
#### If you want to list files many possibilities are yours

- 'files': All staged and changed files
- 'files.deleted': All deleted staged and changed files
Expand All @@ -129,6 +129,10 @@ For each variables defined in the template above, you can define the content:
- 'files.changed.modified': All modified changed files
- 'files.changed.added': All added changed files

#### If you want to add branch name in commit, you can use this

'branch': Show you a select with the choice between short and long name for current branch

# Contributing to the extension

#### Share configs
Expand All @@ -141,13 +145,18 @@ You just have to create a pull-request 😉 with what you want and a clear descr

# Changelog

#### **3.0.1** (_02-24-2022_):
#### **3.0.2** (_07-16-2022_)

- ✨feature: ability to define default value for free text inputs
- ✨feature: add repo current branch in variables

#### **3.0.1** (_02-24-2022_)

- 🐞fix: settings migration script fix from V3.0.0

> third release with an UI O_o and a lot of new features (btw: we reached the 5k installs THX U ♥️)
#### **3.0.0** (_02-23-2022_):
#### **3.0.0** (_02-23-2022_)

- ✨feature: use of information or error message as feedback
- ✨feature: update contributes.configuration $schema
Expand All @@ -157,66 +166,66 @@ You just have to create a pull-request 😉 with what you want and a clear descr
- ✨feature: add ability to search for files using predefined variable names
- 📄docs (docs): update docs globaly and make a web version

#### **2.1.0** (_05-06-2021_):
#### **2.1.0** (_05-06-2021_)

- ✨feature: auto focus scm commit input on finish (cf: issues [#10](https://github.com/rioukkevin/vscode-git-commit/issues/10))
- ✨feature: add abilities to concatenate multiple variables in settings (cf: issues [#11](https://github.com/rioukkevin/vscode-git-commit/issues/11) & [#12](https://github.com/rioukkevin/vscode-git-commit/issues/12))

> second release OH YEAHHH !!!!
#### **2.0.0** (_04-09-2021_):
#### **2.0.0** (_04-09-2021_)

- ✨feature: add ability to use text input or select input for any variables

#### **1.1.5** (_12-18-2020_):
#### **1.1.5** (_12-18-2020_)

- 📄docs (docs): update docs with animated gif

#### **1.1.4** (_11-06-2020_):
#### **1.1.4** (_11-06-2020_)

- ✨feature: Handle multi repo case

#### **1.1.3** (_11-06-2020_):
#### **1.1.3** (_11-06-2020_)

- 🐞fix: Update icon (cf: issues [#4](https://github.com/rioukkevin/vscode-git-commit/issues/4))
- 🐞fix: Handle cancel action when typing variables (cf: issues [#5](https://github.com/rioukkevin/vscode-git-commit/issues/5))
⚙️refactor: Refacto on extension command name

#### **1.1.1** (_10-20-2020_):
#### **1.1.1** (_10-20-2020_)

- 🐞fix: Update icon (cf: issues [#4](https://github.com/rioukkevin/vscode-git-commit/issues/4))

#### **1.1.0** (_10-12-2020_):
#### **1.1.0** (_10-12-2020_)

- ✨feat(workflow): Add abilities to create custom message format using simple brackets in settings, see doc
- ⚙️refactor(global): Refacto on major part of the code
- 🌈style(typescript/prettier): Pass into prettier + update ts rules

#### **1.0.1** (_09-30-2020_):
#### **1.0.1** (_09-30-2020_)

- ✨feature: On demand, add based commitizen prefix for alpha8
- 🔵other: Change default mode to concatenate settings

> First Release, I've done it !!
#### **1.0.0** (_09-21-2020_):
#### **1.0.0** (_09-21-2020_)

- ✨feature: Replace icon with outlined

#### **0.0.4** (_09-15-2020_):
#### **0.0.4** (_09-15-2020_)

- ✨feature: add a mode to concatenate message with existing or replace existing
- 🐞fix: focus on quickPick not on scm input box when triggering extension

#### **0.0.3** (_08-25-2020_):
#### **0.0.3** (_08-25-2020_)

- ✨feature: V0.0.3 add prefix sets

#### **0.0.2** (_08-23-2020_):
#### **0.0.2** (_08-23-2020_)

- ✨feature: Add custom prefix setting
- 🐞fix: Open SCM view when prefix selector is opened, not at the end of process

#### **0.0.1** (_08-18-2020_):
#### **0.0.1** (_08-18-2020_)

- Initial release
10 changes: 7 additions & 3 deletions SETTINGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,20 @@ For each variables defined in the template above, you can define the content:
- the value startWith 'files' -> An array of files with defined status is displayed as choices
- the value looks like '<<something>>...<<something_else>>' -> a merge of array between the variable 'something' and 'something_else' is created as choices

#### If you write your own Array:
#### If you write your own Array

- The 'detail' property is optionnal
- The 'label' property is used as the content include in template
- (For old users) The 'id' property is now automatically generated and not used anymore by the extension

#### If you want predefined choices:
#### If you want predefined choices

- 'keke' is the prefix I use personnally
- 'angular' is prefix specific to angular repos (HELP: if someone has a full config for angular commits, can you share it with me by creating a PR or Issue ?)
- 'alpha8' is prefix we used in the enterprise where I work
- 'semantic' is an other normalization of prefix but I lost the link associated :/

#### If you want to list files many possibilities are yours:
#### If you want to list files many possibilities are yours

- 'files': All staged and changed files
- 'files.deleted': All deleted staged and changed files
Expand All @@ -88,3 +88,7 @@ For each variables defined in the template above, you can define the content:
- 'files.changed.deleted': All deleted changed files
- 'files.changed.modified': All modified changed files
- 'files.changed.added': All added changed files

#### If you want to add branch name in commit, you can use this

'branch': Show you a select with the choice between short and long name for current branch
25 changes: 19 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-git-commit",
"displayName": "VSCode Git Commit Message",
"description": "Harmonize your git commit message with your colleagues",
"version": "3.0.1",
"version": "3.0.2",
"engines": {
"vscode": "^1.42.0"
},
Expand All @@ -23,13 +23,14 @@
"vscode",
"emoji",
"prefix",
"pull",
"push",
"message",
"template",
"scm",
"github",
"gitlab",
"message",
"wink",
"harmonization",
"customization",
"format",
"groot",
"commitizen",
"custom"
Expand Down Expand Up @@ -104,6 +105,18 @@
}
]
}
},
"vscodeGitCommit.defaultVariablesValues": {
"type": "object",
"markdownDescription": "Define default values for free input text variables",
"additionalProperties": {
"anyOf": [
{
"type": "string",
"minLength": 1
}
]
}
}
}
},
Expand Down Expand Up @@ -146,7 +159,7 @@
"extension:lint": "eslint src --ext ts --fix",
"extension:pack": "vsce package",
"extension:rm": "rm -f ./vscode-git-commit-3.0.0.vsix",
"extension:install": "code --install-extension vscode-git-commit-3.0.1.vsix",
"extension:install": "code --install-extension vscode-git-commit-3.0.2.vsix",
"extension:pretest": "npm run extension:compile && npm run lint",
"extension:local": "yarn extension:rm && yarn extension:build && yarn extension:pack && yarn extension:install"
},
Expand Down
43 changes: 43 additions & 0 deletions sandbox/components/DefaultVariablesValuesInput.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React, { FC, useContext } from 'react';
import { LineElement } from '../typings/Editor';
import { IStoreDefaultVariableValue } from '../typings/Store';
import { Store } from '../utils/store';
import { parseVariableFromTemplate } from '../utils/template';
import DefaultVariableValueInput from './core/DefaultVariableValueInput';

interface IProps {}

const DefaultVariablesValuesInput: FC<IProps> = (props) => {
const {
defaultVariablesValues,
setDefaultVariableValue,
template,
variables,
} = useContext(Store);

const templateVariables =
parseVariableFromTemplate(template as LineElement[]) ?? [];

const availableVariables = [...templateVariables];

const disabledVariables = Object.keys(variables);

return (
<div style={{ width: '100%' }}>
{availableVariables.map((av, i) => (
<DefaultVariableValueInput
key={i}
name={av}
value={defaultVariablesValues[av]}
isDisabled={disabledVariables.includes(av)}
onChange={(value: IStoreDefaultVariableValue) =>
setDefaultVariableValue(av, value)
}
onDelete={() => setDefaultVariableValue(av, undefined)}
/>
))}
</div>
);
};

export default DefaultVariablesValuesInput;
20 changes: 20 additions & 0 deletions sandbox/components/DefaultVariablesValuesRenderer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React, { FC, useContext } from 'react';
import { Store } from '../utils/store';
import Pre from './core/Pre';

interface IProps {}

const DefaultVariablesValuesRenderer: FC<IProps> = (props) => {
const { defaultVariablesValues } = useContext(Store);
return (
<Pre>
{`"vscodeGitCommit.defaultVariablesValues": ${JSON.stringify(
{ ...defaultVariablesValues },
null,
2
)}`}
</Pre>
);
};

export default DefaultVariablesValuesRenderer;
Loading

0 comments on commit 9b15533

Please sign in to comment.