Repository: RedJue/git-commit-plugin
Branch: master
Commit: 6c2fd134bf7f
Files: 29
Total size: 71.0 KB
Directory structure:
gitextract_m1t7dyiy/
├── .all-contributorsrc
├── .eslintrc.json
├── .gitignore
├── .vscode/
│ ├── extensions.json
│ ├── launch.json
│ ├── settings.json
│ └── tasks.json
├── .vscodeignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── package.json
├── package.nls.ja.json
├── package.nls.json
├── package.nls.zh-cn.json
├── package.nls.zh-hk.json
├── package.nls.zh-tw.json
├── src/
│ ├── config/
│ │ ├── commit-detail.ts
│ │ ├── commit-input.ts
│ │ ├── commit-type.ts
│ │ ├── default-temp.ts
│ │ └── template-type.ts
│ ├── extension.ts
│ ├── test/
│ │ ├── runTest.ts
│ │ └── suite/
│ │ ├── extension.test.ts
│ │ └── index.ts
│ └── types/
│ └── git.d.ts
├── tsconfig.json
└── vsc-extension-quickstart.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .all-contributorsrc
================================================
{
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"commitType": "docs",
"commitConvention": "angular",
"contributors": [
{
"login": "MaLuns",
"name": "白云苍狗",
"avatar_url": "https://avatars.githubusercontent.com/u/31614024?v=4",
"profile": "https://www.imalun.com",
"contributions": [
"code"
]
},
{
"login": "Tiddler-7",
"name": "冷空气",
"avatar_url": "https://avatars.githubusercontent.com/u/73354813?v=4",
"profile": "https://github.com/Tiddler-7",
"contributions": [
"doc"
]
},
{
"login": "imlinhanchao",
"name": "Hancel Lin",
"avatar_url": "https://avatars.githubusercontent.com/u/1502581?v=4",
"profile": "http://my.hancel.org",
"contributions": [
"code"
]
},
{
"login": "Torlinone",
"name": "Keriy",
"avatar_url": "https://avatars.githubusercontent.com/u/26668466?v=4",
"profile": "https://github.com/Torlinone",
"contributions": [
"code"
]
},
{
"login": "ArthurMynl",
"name": "Arthur Meyniel",
"avatar_url": "https://avatars.githubusercontent.com/u/61516506?v=4",
"profile": "http://www.linkedin.com/in/arthurmeyniel",
"contributions": [
"code"
]
},
{
"login": "haryoiro",
"name": "haryoiro",
"avatar_url": "https://avatars.githubusercontent.com/u/55312590?v=4",
"profile": "https://github.com/haryoiro",
"contributions": [
"doc"
]
},
{
"login": "DrBlackBird",
"name": "Tom",
"avatar_url": "https://avatars.githubusercontent.com/u/10115809?v=4",
"profile": "https://github.com/DrBlackBird",
"contributions": [
"doc"
]
},
{
"login": "webwuyou",
"name": "风过无痕",
"avatar_url": "https://avatars.githubusercontent.com/u/15182683?v=4",
"profile": "http://www.webwuyou.com",
"contributions": [
"code"
]
},
{
"login": "whwnow",
"name": "whwnow",
"avatar_url": "https://avatars.githubusercontent.com/u/1713701?v=4",
"profile": "https://github.com/whwnow",
"contributions": [
"code"
]
},
{
"login": "MichaelCurrin",
"name": "Michael Currin",
"avatar_url": "https://avatars.githubusercontent.com/u/18750745?v=4",
"profile": "https://github.com/MichaelCurrin",
"contributions": [
"doc"
]
},
{
"login": "odinsam",
"name": "odinsam",
"avatar_url": "https://avatars.githubusercontent.com/u/68220289?v=4",
"profile": "https://www.odinsam.com/",
"contributions": [
"code"
]
},
{
"login": "tys1128",
"name": "tys1128",
"avatar_url": "https://avatars.githubusercontent.com/u/24326849?v=4",
"profile": "https://github.com/tys1128",
"contributions": [
"doc"
]
},
{
"login": "mlzzen",
"name": "mlzzen",
"avatar_url": "https://avatars.githubusercontent.com/u/11664505?v=4",
"profile": "http://mlzzen.vercel.app",
"contributions": [
"code"
]
},
{
"login": "yeze322",
"name": "zeye",
"avatar_url": "https://avatars.githubusercontent.com/u/8528761?v=4",
"profile": "https://github.com/yeze322",
"contributions": [
"code"
]
},
{
"login": "moeyua",
"name": "Moeyua",
"avatar_url": "https://avatars.githubusercontent.com/u/45156493?v=4",
"profile": "https://blog.moeyua.com",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
"skipCi": true,
"repoType": "github",
"repoHost": "https://github.com",
"projectName": "git-commit-plugin",
"projectOwner": "RedJue"
}
================================================
FILE: .eslintrc.json
================================================
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/class-name-casing": "warn",
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off",
"quotes": ["warn", "single"],
"indent": ["warn", 4]
}
}
================================================
FILE: .gitignore
================================================
out
node_modules
.vscode-test/
package-lock.json
.vsix
.DS_Store
git-commit-plugin-*.vsix
================================================
FILE: .vscode/extensions.json
================================================
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint"
]
}
================================================
FILE: .vscode/launch.json
================================================
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
================================================
FILE: .vscode/settings.json
================================================
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off",
"cSpell.words": ["commit", "costom", "type"],
"i18n-ally.localesPaths": [
"D:/GIT/git-commit-plugin/src/locale",
"D:/GIT/git-commit-plugin"
],
"i18n-ally.keystyle": "flat"
}
================================================
FILE: .vscode/tasks.json
================================================
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
================================================
FILE: .vscodeignore
================================================
.vscode/**
.vscode-test/**
out/test/**
src/**
.gitignore
vsc-extension-quickstart.md
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts
================================================
FILE: CHANGELOG.md
================================================
# CHANGELOG
## [1.5.0]
- ✨ Feat: [adding \<br\> allows line breaks to be displayed](https://github.com/RedJue/git-commit-plugin/commit/afd6e136f145f0366c15a2cc5faa9befd6a379e7)
## [1.4.0]
- ✨ Feat: [added option to copy commit message](https://github.com/RedJue/git-commit-plugin/issues/116)
## [1.3.0]
- ✨ Feat: [允许将当前 commit message 作为 subject 默认内容](https://github.com/RedJue/git-commit-plugin/pull/100)
THX @[moeyua](https://github.com/moeyua)
## [1.2.1]
- 🐞Fix: [after restarting the extension host, the plugin cannot be activated normally](https://github.com/RedJue/git-commit-plugin/issues/93)
THX @[MaLuns](https://github.com/MaLuns)
## [1.2.0]
- ✨ Feat: [zh-tw&zh-hk support](https://github.com/RedJue/git-commit-plugin/pull/90)
THX @[Tiddler-7](https://github.com/Tiddler-7)
## [1.1.2]
- 🐞Fix: [can't open with vscode v1.74.0](https://github.com/RedJue/git-commit-plugin/issues/79)
- 🐞Fix: [更新 vscode 1.74.0(最新版)后无法使用](https://github.com/RedJue/git-commit-plugin/issues/81)
THX @[simida0852](https://github.com/simida0852)
THX @[Torlinone](https://github.com/Torlinone)
- 🐞Fix: [<Subject> : no more than 20 words](https://github.com/RedJue/git-commit-plugin/issues/72)
THX @[ArthurMynl](https://github.com/ArthurMynl)
## [1.1.0]
- ✨ Feat: [Added localization support for ja-jp](https://github.com/RedJue/git-commit-plugin/commit/d85c54eeb233c68afeeddd1493455884a6f4800b)
THX @[haryoiro](https://github.com/haryoiro)
## [1.0.9]
- ✨ Feat: [Added localization](https://github.com/RedJue/git-commit-plugin/pull/60)
THX @[spotnick](https://github.com/spotnick)
## [1.0.8]
- 🐞Fix: [【Bug】无法添加多个自定义提交类型(commit type](https://github.com/RedJue/git-commit-plugin/issues/54)
## [1.0.7]
- ✨Feat: [default type editable](https://github.com/RedJue/git-commit-plugin/commit/a7c43bc080b4ebfe12114e8b34923b03ed7cf8b6)
- 📃Docs: [improve readability](https://github.com/RedJue/git-commit-plugin/commit/285afbf0e30c77c2d5068f37cdd2f42b86209b7b)
THX @[MichaelCurrin](https://github.com/MichaelCurrin)
- 🐞Fix: [修复未填写 scope 时输出空括号对问题](https://github.com/RedJue/git-commit-plugin/pull/52/commits/60ee9446aeef8253db95c807bec22197b7fe6b58)
THX @[whwnow](https://github.com/whwnow)
## [1.0.6]
- 🐞Fix: [fix commit type crash](https://github.com/RedJue/git-commit-plugin/commit/1ddb2bc248233a689ff64a4416955b57a70538f8)
## [1.0.5]
- ✨Feat: [add custom templates](https://github.com/RedJue/git-commit-plugin/commit/5225dfbbe33859e16246b29f81c3e926d559043d)
THX @[odinsam](https://github.com/odinsam)
## [1.0.4]
- 🌈Style: [change icons](https://github.com/RedJue/git-commit-plugin/commit/611ecfb6c2cbf14436141056cc87da4530117c66)
- 🐞Fix: issue [#36](https://github.com/RedJue/git-commit-plugin/issues/36)
## [1.0.3]
- 🐞Fix: [fix icon color fade](https://github.com/RedJue/git-commit-plugin/commit/977713698c21bdb11b1c2154d154b16343a2b570)
## [1.0.2]
- 🐞Fix: [fix type formatting](https://github.com/RedJue/git-commit-plugin/commit/418279d0c6372068c0923b8aeb7c44b546318d89)
## [1.0.1]
- 🐞Fix: issue [#33](https://github.com/RedJue/git-commit-plugin/issues/33)
- 🐞Fix: issue [#29](https://github.com/RedJue/git-commit-plugin/issues/29)
## [1.0.0]
- 🐞Fix: issue [#17](https://github.com/RedJue/git-commit-plugin/issues/17)
- 🐞Fix: issue [#21](https://github.com/RedJue/git-commit-plugin/issues/21)
- 🐞Fix: issue [#23](https://github.com/RedJue/git-commit-plugin/issues/23)
- 🐞Fix: issue [#19](https://github.com/RedJue/git-commit-plugin/issues/19)
## [0.0.5]
- 🐞Fix: issue [#13](https://github.com/RedJue/git-commit-plugin/issues/13)
- 🐞Fix: issue [#14](https://github.com/RedJue/git-commit-plugin/issues/14)
- 🐞Fix: issue [#15](https://github.com/RedJue/git-commit-plugin/issues/15)
## [0.0.4]
- ✨Feat: [Show Emoji](https://github.com/RedJue/git-commit-plugin/commit/426e3afad2c4568f946efda922412913d73e2836#diff-1750a4dcc9a0a9b1773d275e96c46a1e)
- ✨Feat: [Custom Commit Type](https://github.com/RedJue/git-commit-plugin/commit/7344a1f5f65a7cf0f03a32701d53d1510777fb0a#diff-1750a4dcc9a0a9b1773d275e96c46a1e)
- ✨Feat: [Max Subject Words](https://github.com/RedJue/git-commit-plugin/commit/7344a1f5f65a7cf0f03a32701d53d1510777fb0a#diff-1750a4dcc9a0a9b1773d275e96c46a1e)
- 🐞Fix: issue [#2](https://github.com/RedJue/git-commit-plugin/issues/2)
- 🐞Fix: issue [#8](https://github.com/RedJue/git-commit-plugin/issues/8)
## [0.0.3]
- Add README.md
- Fix bug
## [0.0.2]
- Fix bug
## [0.0.1]
- Initial release
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2018 RedJue
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# Git Commit Plugin For VS Code
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
> Automatically generate git commit messages








## Requirements
- VS Code `1.42.0` or higher.
- VS Code's built-in Git plugin
## Format
This extension follows the [Angular Team Commit Specification](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines), as follows:
```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```
See info on the fields below.
### Type
Must be one of the following:
Type | Description
--- | ---
**feat** | A new feature
**fix** | A bug fix
**docs** | Documentation only changes
**style**: | Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
**refactor** | A code change that neither fixes a bug nor adds a feature
**perf** | A code change that improves performance
**test** | Adding missing or correcting existing tests
**chore** | Changes to the build process or auxiliary tools and libraries such as documentation generation
### Scope
The scope could be anything specifying place of the commit change. For example `$location`, `$browser`, `$compile`, `$rootScope`, `ngHref`, `ngClick`, `ngView`, etc...
You can use `*` when the change affects more than a single scope.
### Subject
The subject contains succinct description of the change:
- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize first letter
- no dot (`.`) at the end
### Body
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.
### Footer
The footer should contain any information about **Breaking Changes** and is also the place to [reference GitHub issues that this commit closes](https://help.github.com/articles/closing-issues-via-commit-messages/).
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
A detailed explanation can be found in this [document](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#).
## Quick Start
1. Install the plugin
1. Use the command shortcut `showGitCommit` to open the command window or Click the icon on the git plugin navigation bar

1. Enter the commit information, which automatically generates a commit message that conforms to the specification

## Locale Support
The plugin will automatically switch the language description based on the `vscode` language environment.
**Support Language**
- en-US as default
- zh-CN
- zh-HK
- zh-TW
- ja-JP
## Settings Options
- `GitCommitPlugin.ShowEmoji`: whether to show emoji, default `true`.
```json
{
"GitCommitPlugin.ShowEmoji": true
}
```
- `GitCommitPlugin.CustomCommitType`: customize the commit type, default `null`.
```json5
{
"GitCommitPlugin.CustomCommitType": [
"customTypeName"
]
}
```
or
```json5
[
{
// If there are duplicate keys, rewrite the config,otherwise add As a new configuration addition
"key": "customTypeKey",
"label": "customTypeName",
"detail": "customTypeDetail",
"icon":"customIcon"
}
]
```
- `GitCommitPlugin.MaxSubjectCharacters`: customize the maximum number of words on the subject, default `20`.
```json
{
"GitCommitPlugin.MaxSubjectCharacters": 20
}
```
- `GitCommitPlugin.FillSubjectWithCurrent`: whether to fill the subject with the current commit message, default `false`.
```json
{
"GitCommitPlugin.FillSubjectWithCurrent": false
}
```
- `GitCommitPlugin.Template`: customize the git commit template.
```json5
{
"GitCommitPlugin.Templates": [
{
"templateName": "Angular",
"templateContent": "<icon><space><type>(<scope>):<space><subject><enter><body><enter><footer>"
},
{
"templateName": "git-cz",
"templateContent": "<type>(<scope>):<space><icon><space><subject><enter><body><enter><footer>",
// Set as default commit template
"default":true
}
]
}
```
## License
Released under [MIT](/LICENSE) by [@RedJue](https://github.com/RedJue).
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.imalun.com"><img src="https://avatars.githubusercontent.com/u/31614024?v=4?s=100" width="100px;" alt="白云苍狗"/><br /><sub><b>白云苍狗</b></sub></a><br /><a href="https://github.com/RedJue/git-commit-plugin/commits?author=MaLuns" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Tiddler-7"><img src="https://avatars.githubusercontent.com/u/73354813?v=4?s=100" width="100px;" alt="冷空气"/><br /><sub><b>冷空气</b></sub></a><br /><a href="https://github.com/RedJue/git-commit-plugin/commits?author=Tiddler-7" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://my.hancel.org"><img src="https://avatars.githubusercontent.com/u/1502581?v=4?s=100" width="100px;" alt="Hancel Lin"/><br /><sub><b>Hancel Lin</b></sub></a><br /><a href="https://github.com/RedJue/git-commit-plugin/commits?author=imlinhanchao" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Torlinone"><img src="https://avatars.githubusercontent.com/u/26668466?v=4?s=100" width="100px;" alt="Keriy"/><br /><sub><b>Keriy</b></sub></a><br /><a href="https://github.com/RedJue/git-commit-plugin/commits?author=Torlinone" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://www.linkedin.com/in/arthurmeyniel"><img src="https://avatars.githubusercontent.com/u/61516506?v=4?s=100" width="100px;" alt="Arthur Meyniel"/><br /><sub><b>Arthur Meyniel</b></sub></a><br /><a href="https://github.com/RedJue/git-commit-plugin/commits?author=ArthurMynl" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/haryoiro"><img src="https://avatars.githubusercontent.com/u/55312590?v=4?s=100" width="100px;" alt="haryoiro"/><br /><sub><b>haryoiro</b></sub></a><br /><a href="https://github.com/RedJue/git-commit-plugin/commits?author=haryoiro" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/DrBlackBird"><img src="https://avatars.githubusercontent.com/u/10115809?v=4?s=100" width="100px;" alt="Tom"/><br /><sub><b>Tom</b></sub></a><br /><a href="https://github.com/RedJue/git-commit-plugin/commits?author=DrBlackBird" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="http://www.webwuyou.com"><img src="https://avatars.githubusercontent.com/u/15182683?v=4?s=100" width="100px;" alt="风过无痕"/><br /><sub><b>风过无痕</b></sub></a><br /><a href="https://github.com/RedJue/git-commit-plugin/commits?author=webwuyou" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/whwnow"><img src="https://avatars.githubusercontent.com/u/1713701?v=4?s=100" width="100px;" alt="whwnow"/><br /><sub><b>whwnow</b></sub></a><br /><a href="https://github.com/RedJue/git-commit-plugin/commits?author=whwnow" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/MichaelCurrin"><img src="https://avatars.githubusercontent.com/u/18750745?v=4?s=100" width="100px;" alt="Michael Currin"/><br /><sub><b>Michael Currin</b></sub></a><br /><a href="https://github.com/RedJue/git-commit-plugin/commits?author=MichaelCurrin" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.odinsam.com/"><img src="https://avatars.githubusercontent.com/u/68220289?v=4?s=100" width="100px;" alt="odinsam"/><br /><sub><b>odinsam</b></sub></a><br /><a href="https://github.com/RedJue/git-commit-plugin/commits?author=odinsam" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tys1128"><img src="https://avatars.githubusercontent.com/u/24326849?v=4?s=100" width="100px;" alt="tys1128"/><br /><sub><b>tys1128</b></sub></a><br /><a href="https://github.com/RedJue/git-commit-plugin/commits?author=tys1128" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://mlzzen.vercel.app"><img src="https://avatars.githubusercontent.com/u/11664505?v=4?s=100" width="100px;" alt="mlzzen"/><br /><sub><b>mlzzen</b></sub></a><br /><a href="https://github.com/RedJue/git-commit-plugin/commits?author=mlzzen" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/yeze322"><img src="https://avatars.githubusercontent.com/u/8528761?v=4?s=100" width="100px;" alt="zeye"/><br /><sub><b>zeye</b></sub></a><br /><a href="https://github.com/RedJue/git-commit-plugin/commits?author=yeze322" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://blog.moeyua.com"><img src="https://avatars.githubusercontent.com/u/45156493?v=4?s=100" width="100px;" alt="Moeyua"/><br /><sub><b>Moeyua</b></sub></a><br /><a href="https://github.com/RedJue/git-commit-plugin/commits?author=moeyua" title="Code">💻</a></td>
</tr>
</tbody>
</table>
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
================================================
FILE: package.json
================================================
{
"name": "git-commit-plugin",
"displayName": "git-commit-plugin",
"description": "Automatically generate git commit",
"version": "1.5.0",
"engines": {
"vscode": "^1.42.0"
},
"publisher": "redjue",
"license": "MIT",
"homepage": "https://github.com/RedJue/git-commit-plugin/blob/master/README.md",
"bugs": {
"url": "https://github.com/RedJue/git-commit-plugin/issues"
},
"icon": "assets/logo.png",
"repository": {
"type": "git",
"url": "https://github.com/RedJue/git-commit-plugin"
},
"keywords": [
"git",
"commit",
"vscode"
],
"categories": [
"Other"
],
"activationEvents": [
"onCommand:extension.showGitCommit"
],
"main": "./out/extension.js",
"contributes": {
"commands": [
{
"command": "extension.showGitCommit",
"title": "%extension.showGitCommit.title%",
"placeholer": "%extension.showGitCommit.placeholder%",
"icon": "$(octoface)"
}
],
"configuration": {
"type": "object",
"title": "Git Commit Plugin",
"properties": {
"GitCommitPlugin.ShowEmoji": {
"type": "boolean",
"default": true,
"markdownDescription": "%extension.configuration.GitCommitPlugin.ShowEmoji.markdownDescription%"
},
"GitCommitPlugin.CustomCommitType": {
"type": "array",
"default": [],
"items": {
"type": [
"object",
"string"
]
},
"markdownDescription": "%extension.configuration.GitCommitPlugin.CustomCommitType.markdownDescription%",
"scope": "resource"
},
"GitCommitPlugin.MaxSubjectCharacters": {
"type": "number",
"default": 20,
"markdownDescription": "%extension.configuration.GitCommitPlugin.GitCommitPlugin.MaxSubjectCharacters%"
},
"GitCommitPlugin.FillSubjectWithCurrent": {
"type": "boolean",
"default": false,
"markdownDescription": "%extension.configuration.GitCommitPlugin.GitCommitPlugin.FillSubjectWithCurrent%"
},
"GitCommitPlugin.Templates": {
"type": "array",
"default": [],
"markdownDescription": "%extension.configuration.GitCommitPlugin.GitCommitPlugin.Templates%",
"items": [
{
"templateName": "Angular",
"templateContent": "<icon><space><type>(<scope>):<space><subject><enter><body><enter><footer>"
},
{
"templateName": "git-cz",
"templateContent": "<type>(<scope>):<space><icon><space><subject><enter><body><enter><footer>"
}
]
}
}
},
"menus": {
"scm/title": [
{
"when": "scmProvider == git",
"command": "extension.showGitCommit",
"group": "navigation"
}
]
}
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"lint": "eslint src --ext ts --fix",
"watch": "tsc -watch -p ./",
"build": "vsce package",
"pretest": "npm run compile && npm run lint",
"test": "node ./out/test/runTest.js"
},
"devDependencies": {
"@types/glob": "^7.1.1",
"@types/mocha": "^7.0.1",
"@types/node": "^12.11.7",
"@types/vscode": "^1.42.0",
"@typescript-eslint/eslint-plugin": "^2.18.0",
"@typescript-eslint/parser": "^2.18.0",
"eslint": "^6.8.0",
"glob": "^7.1.6",
"mocha": "^7.0.1",
"typescript": "^3.7.5",
"vscode-test": "^1.3.0"
},
"dependencies": {
"vsce": "^1.95.0",
"vscode-nls-i18n": "^0.2.4"
}
}
================================================
FILE: package.nls.ja.json
================================================
{
"extension.showGitCommit.title": "show git commit template",
"extension.showGitCommit.placeholder": "コミットタイプの検索",
"extension.showGitCommit.description.placeholder": "コミット詳細の検索",
"extension.showGitCommit.selectTemplate.placeholder": "使用するコミットテンプレートを選択",
"extension.configuration.GitCommitPlugin.ShowEmoji.markdownDescription": "絵文字アイコンを表示するかどうか制御します。",
"extension.configuration.GitCommitPlugin.CustomCommitType.markdownDescription": "独自の`Git Commit Type`を構成します。",
"extension.configuration.GitCommitPlugin.GitCommitPlugin.MaxSubjectCharacters": "有効な **Subject** の文字数を制御します。デフォルト値 `20`",
"extension.configuration.GitCommitPlugin.GitCommitPlugin.FillSubjectWithCurrent": "現在のコミットメッセージを **Subject** に自動的に入力するかどうかを制御します。デフォルト値 `false`",
"extension.configuration.GitCommitPlugin.GitCommitPlugin.Templates": "コミットテンプレートを構成します。Angularコミットテンプレートを参照。",
"extension.commitInputType.detail": "コミットメッセージを入力",
"extension.commitDetailType.scope.description": "範囲",
"extension.commitDetailType.scope.detail": "このコミットで影響を受けるパッケージなどを指定",
"extension.commitDetailType.subject.description": "概要",
"extension.commitDetailType.subject.detail": "コミットの概要を記述 (最大文字数: {0})",
"extension.commitDetailType.body.description": "詳細",
"extension.commitDetailType.body.detail": "提出の詳細、<br> を追加すると改行表示ができます",
"extension.commitDetailType.footer.description": "備考",
"extension.commitDetailType.footer.detail": "コミットログの内容に関連したIssueのリンクなどを記述",
"extension.commitDetailType.complete.detail": "コミットの編集を反映して終了",
"extension.commitDetailType.template.detail": "どのコミットテンプレートを使用するか選択",
"extension.commitDetailType.message.copy": "投稿情報をコピーする",
"extension.commitDetailType.message.copy.tip": "コミットメッセージがクリップボードにコピーされました!",
"extension.commitDetailType.back.detail": "コミットタイプ選択ページへ戻る",
"extension.commitType.init.detail": "プロジェクト初期化",
"extension.commitType.feat.detail": "新規機能追加",
"extension.commitType.fix.detail": "バグ修正",
"extension.commitType.docs.detail": "ドキュメントのみの変更",
"extension.commitType.style.detail": "フォーマットの変更(コードの動作に影響しないスペース、フォーマット、セミコロンなど)",
"extension.commitType.refactor.detail": "リファクタリングのための変更(新規機能やバグ修正を含まない)",
"extension.commitType.perf.detail": "パフォーマンス改善のための変更",
"extension.commitType.test.detail": "不足テストの追加や既存テストの修正",
"extension.commitType.build.detail": "ビルドシステムや外部依存に関する変更(スコープ例: gulp, broccoli, npm)",
"extension.commitType.ci.detail": "CI用の設定やスクリプトに関する設定(スコープ例: Travis, Circle, k8s, Docker)",
"extension.commitType.chore.detail": "その他の変更(ソースやテストの変更を含まない)",
"extension.commitType.revert.detail": "以前のコミットへ戻す"
}
================================================
FILE: package.nls.json
================================================
{
"extension.showGitCommit.title": "show git commit template",
"extension.showGitCommit.placeholder": "Search Git Commit Type",
"extension.showGitCommit.description.placeholder": "Search Commit Description",
"extension.showGitCommit.selectTemplate.placeholder": "Select the template to submit for use",
"extension.configuration.GitCommitPlugin.ShowEmoji.markdownDescription": "Show or not show `Emoji` icons",
"extension.configuration.GitCommitPlugin.CustomCommitType.markdownDescription": "Add custom `Git Commit Type`",
"extension.configuration.GitCommitPlugin.GitCommitPlugin.MaxSubjectCharacters": "Set the valid length of **Subject**, default `20` characters",
"extension.configuration.GitCommitPlugin.GitCommitPlugin.FillSubjectWithCurrent": "Set whether to fill in the current commit message of **Subject**, default `false`",
"extension.configuration.GitCommitPlugin.GitCommitPlugin.Templates": "Commit template, you can refer to Angular template settings",
"extension.commitInputType.detail": "Input Commit Message",
"extension.commitDetailType.scope.description": "Scope of Modification",
"extension.commitDetailType.scope.detail": "What modules are included in this revision",
"extension.commitDetailType.subject.description": "Overview",
"extension.commitDetailType.subject.detail": "Commit Overview No more than {0} characters",
"extension.commitDetailType.body.description": "Details",
"extension.commitDetailType.body.detail": "Submission details: adding <br> allows line breaks to be displayed.",
"extension.commitDetailType.footer.description": "Remarks",
"extension.commitDetailType.footer.detail": "Usually a link to fix a bug",
"extension.commitDetailType.complete.detail": "Finish writing the commit",
"extension.commitDetailType.template.detail": "Select the template to submit for use",
"extension.commitDetailType.message.copy": "Copy the commit message",
"extension.commitDetailType.message.copy.tip": "The commit message has been copied to the clipboard!",
"extension.commitDetailType.back.detail": "Return to the commit type selection page",
"extension.commitType.init.detail": "Project initialization",
"extension.commitType.feat.detail": "Adding new features",
"extension.commitType.fix.detail": "Fixing bugs",
"extension.commitType.docs.detail": "Modify documentation only",
"extension.commitType.style.detail": "Only the spaces, formatting indentation, commas, etc. were changed, not the code logic",
"extension.commitType.refactor.detail": "Code refactoring, no new features added or bugs fixed",
"extension.commitType.perf.detail": "Optimization-related, such as improving performance, experience",
"extension.commitType.test.detail": "Adding test cases",
"extension.commitType.build.detail": "Dependency-related content",
"extension.commitType.ci.detail": "CI configuration related e.g. changes to k8s, docker configuration files",
"extension.commitType.chore.detail": "Changed the build process, or added dependencies, tools, etc.",
"extension.commitType.revert.detail": "Rollback to the previous version"
}
================================================
FILE: package.nls.zh-cn.json
================================================
{
"extension.showGitCommit.title": "show git commit template",
"extension.showGitCommit.placeholder": "搜索提交类型",
"extension.showGitCommit.description.placeholder": "搜索提交描述",
"extension.showGitCommit.selectTemplate.placeholder": "选择提交使用的模板",
"extension.configuration.GitCommitPlugin.ShowEmoji.markdownDescription": "是否展现 `Emoji` 图标",
"extension.configuration.GitCommitPlugin.CustomCommitType.markdownDescription": "自定义添加 `Git Commit Type`",
"extension.configuration.GitCommitPlugin.GitCommitPlugin.MaxSubjectCharacters": "设置 **Subject** 的有效长度,默认 `20` 字符",
"extension.configuration.GitCommitPlugin.GitCommitPlugin.FillSubjectWithCurrent": "设置 **Subject** 是否填充当前 Commit Message,默认 `false`",
"extension.configuration.GitCommitPlugin.GitCommitPlugin.Templates": "提交模板设置,可以参考 Angular 模板设置",
"extension.commitInputType.detail": "请输入提交信息",
"extension.commitDetailType.scope.description": "修改范围",
"extension.commitDetailType.scope.detail": "本次修改包含哪些模块",
"extension.commitDetailType.subject.description": "概述",
"extension.commitDetailType.subject.detail": "提交概述,不超过{0}字符",
"extension.commitDetailType.body.description": "详情",
"extension.commitDetailType.body.detail": "提交详情,加 <br> 可换行显示",
"extension.commitDetailType.footer.description": "备注",
"extension.commitDetailType.footer.detail": "通常是修复 bug 的链接",
"extension.commitDetailType.complete.detail": "完成提交的编写",
"extension.commitDetailType.template.detail": "选择提交使用的模板",
"extension.commitDetailType.message.copy": "拷贝提交信息",
"extension.commitDetailType.message.copy.tip": "提交信息已复制到剪贴板!",
"extension.commitDetailType.back.detail": "返回提交类型选择页",
"extension.commitType.init.detail": "项目初始化",
"extension.commitType.feat.detail": "添加新特性",
"extension.commitType.fix.detail": "修复bug",
"extension.commitType.docs.detail": "仅仅修改文档",
"extension.commitType.style.detail": "仅仅修改了空格、格式缩进、逗号等等,不改变代码逻辑",
"extension.commitType.refactor.detail": "代码重构,没有加新功能或者修复bug",
"extension.commitType.perf.detail": "优化相关,比如提升性能、体验",
"extension.commitType.test.detail": "增加测试用例",
"extension.commitType.build.detail": "依赖相关的内容",
"extension.commitType.ci.detail": "ci配置相关 例如对 k8s,docker的配置文件的修改",
"extension.commitType.chore.detail": "改变构建流程、或者增加依赖库、工具等",
"extension.commitType.revert.detail": "回滚到上一个版本"
}
================================================
FILE: package.nls.zh-hk.json
================================================
{
"extension.showGitCommit.title": "show git commit template",
"extension.showGitCommit.placeholder": "搜索提交類型",
"extension.showGitCommit.description.placeholder": "搜索提交描述",
"extension.showGitCommit.selectTemplate.placeholder": "選擇提交使用的模板",
"extension.configuration.GitCommitPlugin.ShowEmoji.markdownDescription": "是否展現 `Emoji` 圖標",
"extension.configuration.GitCommitPlugin.CustomCommitType.markdownDescription": "自定義增添 `Git Commit Type`",
"extension.configuration.GitCommitPlugin.GitCommitPlugin.MaxSubjectCharacters": "設定 **Subject** 的有效長度,默認 `20` 字符",
"extension.configuration.GitCommitPlugin.GitCommitPlugin.FillSubjectWithCurrent": "是否填充 **Subject** 的當前 Commit Message,默認 `false`",
"extension.configuration.GitCommitPlugin.GitCommitPlugin.Templates": "提交模板設定,可以參考 Angular 模板設定",
"extension.commitInputType.detail": "請輸入提交信息",
"extension.commitDetailType.scope.description": "修改範圍",
"extension.commitDetailType.scope.detail": "本次修改包含哪些模塊",
"extension.commitDetailType.subject.description": "概述",
"extension.commitDetailType.subject.detail": "提交概述,不超過{0}字符",
"extension.commitDetailType.body.description": "詳情",
"extension.commitDetailType.body.detail": "提交詳情,加入 <br> 可換行顯示",
"extension.commitDetailType.footer.description": "备注備註",
"extension.commitDetailType.footer.detail": "通常是修復 bug 的鏈接",
"extension.commitDetailType.complete.detail": "完成提交的編寫",
"extension.commitDetailType.template.detail": "選擇提交使用的模板",
"extension.commitDetailType.message.copy": "拷貝提交信息",
"extension.commitDetailType.message.copy.tip": "提交信息已複製到剪貼板!",
"extension.commitDetailType.back.detail": "返回提交類型選擇頁",
"extension.commitType.init.detail": "項目初始化",
"extension.commitType.feat.detail": "添加新特性",
"extension.commitType.fix.detail": "修復bug",
"extension.commitType.docs.detail": "僅僅修改文檔",
"extension.commitType.style.detail": "僅僅修改了空格、格式縮進、逗號等等,不改變代碼邏輯",
"extension.commitType.refactor.detail": "代碼重構,沒有加新功能或者修復bug",
"extension.commitType.perf.detail": "優化相關,比如提升性能、體驗",
"extension.commitType.test.detail": "增添測試用例",
"extension.commitType.build.detail": "依賴相關的內容",
"extension.commitType.ci.detail": "ci配置相關 例如對 k8s,docker的配置文件的修改",
"extension.commitType.chore.detail": "改變構建流程、或者增加依賴庫、工具等",
"extension.commitType.revert.detail": "回滾到上一個版本"
}
================================================
FILE: package.nls.zh-tw.json
================================================
{
"extension.showGitCommit.title": "show git commit template",
"extension.showGitCommit.placeholder": "搜索提交類型",
"extension.showGitCommit.description.placeholder": "搜索提交描述",
"extension.showGitCommit.selectTemplate.placeholder": "選擇提交使用的模板",
"extension.configuration.GitCommitPlugin.ShowEmoji.markdownDescription": "是否展現 `Emoji` 圖標",
"extension.configuration.GitCommitPlugin.CustomCommitType.markdownDescription": "自定義增添 `Git Commit Type`",
"extension.configuration.GitCommitPlugin.GitCommitPlugin.MaxSubjectCharacters": "設定 **Subject** 的有效長度,默認 `20` 字符",
"extension.configuration.GitCommitPlugin.GitCommitPlugin.FillSubjectWithCurrent": "是否填充 **Subject** 的當前 Commit Message,默認 `false`",
"extension.configuration.GitCommitPlugin.GitCommitPlugin.Templates": "提交模板設定,可以參考 Angular 模板設定",
"extension.commitInputType.detail": "請輸入提交信息",
"extension.commitDetailType.scope.description": "修改範圍",
"extension.commitDetailType.scope.detail": "本次修改包含哪些模塊",
"extension.commitDetailType.subject.description": "概述",
"extension.commitDetailType.subject.detail": "提交概述,不超過{0}字符",
"extension.commitDetailType.body.description": "詳情",
"extension.commitDetailType.body.detail": "提交詳情,加入 <br> 可換行顯示",
"extension.commitDetailType.footer.description": "备注備註",
"extension.commitDetailType.footer.detail": "通常是修復 bug 的鏈接",
"extension.commitDetailType.complete.detail": "完成提交的編寫",
"extension.commitDetailType.template.detail": "選擇提交使用的模板",
"extension.commitDetailType.message.copy": "複製提交資訊",
"extension.commitDetailType.message.copy.tip": "提交資訊已複製到剪貼簿!",
"extension.commitDetailType.back.detail": "返回提交類型選擇頁",
"extension.commitType.init.detail": "項目初始化",
"extension.commitType.feat.detail": "添加新特性",
"extension.commitType.fix.detail": "修復bug",
"extension.commitType.docs.detail": "僅僅修改文檔",
"extension.commitType.style.detail": "僅僅修改了空格、格式縮進、逗號等等,不改變代碼邏輯",
"extension.commitType.refactor.detail": "代碼重構,沒有加新功能或者修復bug",
"extension.commitType.perf.detail": "優化相關,比如提升性能、體驗",
"extension.commitType.test.detail": "增添測試用例",
"extension.commitType.build.detail": "依賴相關的內容",
"extension.commitType.ci.detail": "ci配置相關 例如對 k8s,docker的配置文件的修改",
"extension.commitType.chore.detail": "改變構建流程、或者增加依賴庫、工具等",
"extension.commitType.revert.detail": "回滾到上一個版本"
}
================================================
FILE: src/config/commit-detail.ts
================================================
import { QuickPickItem, QuickPickOptions, workspace } from 'vscode';
import { localize } from 'vscode-nls-i18n';
/**
* @description git commit detail 提交信息的详情
*/
export interface CommitDetailType extends QuickPickItem {
key?: string | number;
isEdit?: boolean;
}
//最大的 subject 限制字数 Max subject characters
export const MaxSubjectCharacters =
workspace.getConfiguration('GitCommitPlugin').get<number>('MaxSubjectCharacters') || 20;
export const FillSubjectWithCurrent = workspace.getConfiguration('GitCommitPlugin').get<boolean>('FillSubjectWithCurrent') || false;
export function GetCommitDetailType() {
const CommitDetailType: Array<CommitDetailType> = [
{
label: '<Scope>',
key: 'scope',
description: localize('extension.commitDetailType.scope.description'),
detail: localize('extension.commitDetailType.scope.detail'),
isEdit: false,
},
{
label: '<Subject>',
key: 'subject',
description: localize('extension.commitDetailType.subject.description'),
detail: localize(
'extension.commitDetailType.subject.detail',
MaxSubjectCharacters.toString(),
),
isEdit: false,
},
{
label: '<Body>',
key: 'body',
description: localize('extension.commitDetailType.body.description'),
detail: localize('extension.commitDetailType.body.detail'),
isEdit: false,
},
{
label: '<Footer>',
key: 'footer',
description: localize('extension.commitDetailType.footer.description'),
detail: localize('extension.commitDetailType.footer.detail'),
isEdit: false,
},
{
label: 'Complete',
key: 'complete',
detail: localize('extension.commitDetailType.complete.detail'),
},
{
label: 'Select template for commit',
key: 'template',
detail: localize('extension.commitDetailType.template.detail'),
},
{
label: 'Copy',
key: 'copy',
detail: localize('extension.commitDetailType.message.copy'),
},
{
label: 'Back',
key: 'back',
detail: localize('extension.commitDetailType.back.detail'),
},
];
return CommitDetailType;
}
export const CommitDetailQuickPickOptions: QuickPickOptions = {
matchOnDescription: true,
matchOnDetail: true,
ignoreFocusOut: true,
};
================================================
FILE: src/config/commit-input.ts
================================================
import { InputBoxOptions } from 'vscode';
import { localize } from 'vscode-nls-i18n';
/**
* @description git commit input 输入提交信息的配置对象
*/
export interface CommitInputType extends InputBoxOptions {}
export default function GetCommitInputType() {
const CommitInputType: CommitInputType = {
placeHolder: localize('extension.commitInputType.detail'),
ignoreFocusOut: true,
prompt: '',
value: '',
};
return CommitInputType;
}
================================================
FILE: src/config/commit-type.ts
================================================
import { workspace, QuickPickItem } from 'vscode';
import { localize } from 'vscode-nls-i18n';
/**
* @description git commit 提交类型
*/
export interface CommitType extends QuickPickItem {
icon?: string;
key?: string;
}
//是否展现 Emoji图标 show Emoji or not
const isShowEmoji = workspace
.getConfiguration('GitCommitPlugin')
.get<boolean>('ShowEmoji');
//新增的自定义commit type add custom Commit Type
const CustomCommitType = workspace
.getConfiguration('GitCommitPlugin')
.get<boolean>('CustomCommitType');
export default function GetCommitTypes() {
let CommitType: Array<CommitType> = [
{
label: 'init',
key: 'init',
detail: localize('extension.commitType.init.detail'),
icon: '🎉',
},
{
label: 'feat',
key: 'feat',
detail: localize('extension.commitType.feat.detail'),
icon: '✨',
},
{
label: 'fix',
key: 'fix',
detail: localize('extension.commitType.fix.detail'),
icon: '🐞',
},
{
label: 'docs',
key: 'docs',
detail: localize('extension.commitType.docs.detail'),
icon: '📃',
},
{
label: 'style',
key: 'style',
detail: localize('extension.commitType.style.detail'),
icon: '🌈',
},
{
label: 'refactor',
key: 'refactor',
detail: localize('extension.commitType.refactor.detail'),
icon: '🦄',
},
{
label: 'perf',
key: 'perf',
detail: localize('extension.commitType.perf.detail'),
icon: '🎈',
},
{
label: 'test',
key: 'test',
detail: localize('extension.commitType.test.detail'),
icon: '🧪',
},
{
label: 'build',
key: 'build',
detail: localize('extension.commitType.build.detail'),
icon: '🔧',
},
{
label: 'ci',
key: 'ci',
detail: localize('extension.commitType.ci.detail'),
icon: '🐎',
},
{
label: 'chore',
key: 'chore',
detail: localize('extension.commitType.chore.detail'),
icon: '🐳',
},
{
label: 'revert',
key: 'revert',
detail: localize('extension.commitType.revert.detail'),
icon: '↩',
},
];
if (Array.isArray(CustomCommitType)) {
CustomCommitType.forEach(item => {
let label = '',
icon = '',
detail = '';
if (typeof item === 'string') {
label = detail = item;
}
const resultType = {
label,
icon,
detail,
};
if (Object.prototype.toString.call(item) === '[object Object]') {
if (Reflect.has(item, 'label')) {
resultType.label = item.label;
} else {
Reflect.deleteProperty(resultType, 'label');
}
if (Reflect.has(item, 'detail')) {
resultType.detail = item.detail;
} else {
Reflect.deleteProperty(resultType, 'detail');
}
if (Reflect.has(item, 'icon')) {
resultType.icon = item.icon;
} else {
Reflect.deleteProperty(resultType, 'icon');
}
}
const target = CommitType.find(
type =>
typeof item.key === 'string' &&
item.key.length > 0 &&
type.key === item.key,
);
if (target !== undefined) {
Object.assign(target, resultType);
} else {
CommitType.unshift(resultType);
}
});
}
if (!isShowEmoji) {
CommitType.forEach(commitType => {
commitType.icon = '';
});
}
if (isShowEmoji) {
CommitType.forEach(item => {
// If there is an icon display
if (typeof item.icon === 'string' && item.icon.length > 0) {
item.label = `${item.icon} ${item.label}`;
}
});
}
return CommitType;
}
================================================
FILE: src/config/default-temp.ts
================================================
export const Angular = {
'templateName': 'Angular',
'templateContent': '<icon><space><type>(<scope>):<space><subject><enter><body><enter><footer>'
};
export const GitCz = {
'templateName': 'git-cz',
'templateContent': '<type>(<scope>):<space><icon><space><subject><enter><body><enter><footer>'
};
================================================
FILE: src/config/template-type.ts
================================================
import { workspace, QuickPickItem } from 'vscode';
import * as defaultTemp from './default-temp';
/**
* @description git commit template 类型
*/
export interface CommitTemplateType extends QuickPickItem {
label: string;
detail: string;
templateName: string;
templateContent: string;
/** default template */
default?:boolean;
}
let CommitTemplate: Array<CommitTemplateType> = new Array<CommitTemplateType>();
const configTemplate = workspace.getConfiguration('GitCommitPlugin').get<Array<CommitTemplateType>>('Templates');
if (Array.isArray(configTemplate)) {
CommitTemplate = configTemplate.map((item, index) => {
return {
label: item.templateName,
detail: item.templateContent,
templateName: item.templateName,
templateContent:item.templateContent,
default:item.default || false
};
});
}
const def:Array<CommitTemplateType> = Object.values(defaultTemp).map((item)=>({
label: item.templateName,
detail: item.templateContent,
templateName: item.templateName,
templateContent:item.templateContent,
}));
CommitTemplate = CommitTemplate.concat(def);
export default CommitTemplate;
================================================
FILE: src/extension.ts
================================================
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import * as vscode from 'vscode';
import { GitExtension } from './types/git';
import GetCommitTypes, { CommitType } from './config/commit-type';
import {
GetCommitDetailType,
CommitDetailQuickPickOptions,
MaxSubjectCharacters,
CommitDetailType,
FillSubjectWithCurrent,
} from './config/commit-detail';
import GetCommitInputType, { CommitInputType } from './config/commit-input';
import CommitTemplate from './config/template-type';
import { Angular } from './config/default-temp';
export interface GitMessage {
[index: string]: string;
templateName: string;
templateContent: string;
icon: string;
type: string;
scope: string;
subject: string;
body: string;
footer: string;
}
import { localize, init } from 'vscode-nls-i18n';
// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
export async function activate(context: vscode.ExtensionContext) {
init(context.extensionPath);
const CommitType: Array<CommitType> = GetCommitTypes();
const CommitDetailType: Array<CommitDetailType> = GetCommitDetailType();
const CommitInputType: CommitInputType = GetCommitInputType();
//获取是否在git扩展内 Gets whether it is in the git extension
function getGitExtension() {
return vscode.extensions.getExtension<GitExtension>('vscode.git')?.activate();
}
//Commit message config
const message_config: GitMessage = {
templateName: '',
templateContent: '',
icon: '',
type: '',
scope: '',
subject: '',
body: '',
footer: '',
};
//清除填写信息 Clear message
function clearMessage() {
Object.keys(message_config).forEach(key => (message_config[key] = ''));
CommitDetailType.map(item => {
item.isEdit = false;
return item;
});
}
//组合信息 Portfolio information
function messageCombine(config: GitMessage) {
let result = config.templateContent || Angular.templateContent;
result = config.icon
? result.replace(/<icon>/g, config.icon)
: result.replace(/<icon>/g, '');
result =
config.type !== ''
? result.replace(/<type>/g, config.type)
: result.replace(/<type>/g, '');
result =
config.scope !== ''
? result.replace(/<scope>/g, config.scope)
: result.replace(/\(?<scope>\)?/g, '');
result =
config.subject !== ''
? result.replace(/<subject>/g, config.subject)
: result.replace(/<subject>/g, '');
result =
config.body !== ''
? result.replace(/<body>/g, config.body)
: result.replace(/<body>/g, '');
result =
config.footer !== ''
? result.replace(/<footer>/g, config.footer)
: result.replace(/<footer>/g, '');
result = result.replace(/<enter>/g, '\n\n');
result = result.replace(/<space>/g, ' ');
result = result.replace(/<br>/g, '\n');
return result.trim();
}
const gitExtension = await getGitExtension();
if (!gitExtension?.enabled) {
vscode.window.showErrorMessage(
'Git extensions are not currently enabled, please try again after enabled!',
);
return false;
}
//获取当前的 git仓库实例 Get git repo instance
let repo: any = gitExtension.getAPI(1).repositories[0];
//输入提交详情 Input message detail
const inputMessageDetail = (_key: string | number) => {
const _detailType = CommitDetailType.find(item => item.key === _key);
CommitInputType.prompt = `${_detailType?.description} 👉 ${_detailType?.detail}`;
CommitInputType.value = message_config[_key] || '';
if (_key === 'subject' && FillSubjectWithCurrent) {
CommitInputType.value = message_config[_key] || '';
}
vscode.window.showInputBox(CommitInputType).then(value => {
const _value = value || '';
message_config[_key] = _value;
_detailType && (_detailType.isEdit = true);
if (_key === 'subject') {
const input_value_length = value ? value.length : 0;
if (input_value_length > MaxSubjectCharacters) {
vscode.window.showErrorMessage(
`The commit overview is no more than ${MaxSubjectCharacters} characters but the current input is ${input_value_length} characters`,
...['ok'],
);
inputMessageDetail(_key);
return false;
}
}
recursiveInputMessage(startMessageInput);
});
};
//是否存在模板 If has template
const existTemplate = () => {
return Array.isArray(CommitTemplate) && CommitTemplate.length > 0;
};
//拷贝提交信息 Copy commit message
const copyMessage = () => {
vscode.env.clipboard.writeText(messageCombine(message_config));
vscode.window.showInformationMessage(
localize('extension.commitDetailType.message.copy.tip'),
...['ok'],
);
clearMessage();
};
//完成输入 Complete input message
const completeInputMessage = (select?: boolean) => {
vscode.commands.executeCommand('workbench.view.scm');
if (existTemplate() && !select) {
const defaultTemp = CommitTemplate.find(item => item.default);
if (defaultTemp !== undefined) {
message_config.templateName = defaultTemp.templateName;
message_config.templateContent = defaultTemp.templateContent;
}
}
repo.inputBox.value = messageCombine(message_config);
};
// 递归输入信息 Recursive input message
const recursiveInputMessage = (startMessageInput?: () => void) => {
CommitDetailQuickPickOptions.placeHolder = localize(
'extension.showGitCommit.description.placeholder',
);
const _CommitDetailType: Array<CommitDetailType> = JSON.parse(
JSON.stringify(CommitDetailType),
);
_CommitDetailType.map((item: any) => {
if (item.isEdit) {
item.description = `${item.description} 👍 >> ${message_config[item.key || '']
}`;
}
return item;
});
vscode.window
.showQuickPick(_CommitDetailType, CommitDetailQuickPickOptions)
.then(select => {
const label = (select && select.label) || '';
if (label !== '') {
const _key = select?.key || 'body';
if (_key === 'complete') {
completeInputMessage();
clearMessage();
return false;
}
if (_key === 'back') {
startMessageInput && startMessageInput();
clearMessage();
return false;
}
if (_key === 'template') {
SelectTemplate();
return false;
}
if (_key === 'copy') {
copyMessage();
return false;
}
inputMessageDetail(_key);
} else {
clearMessage();
}
});
};
//开始输入 Start input
const startMessageInput = () => {
CommitDetailQuickPickOptions.placeHolder = localize(
'extension.showGitCommit.placeholder',
);
vscode.window
.showQuickPick(CommitType, CommitDetailQuickPickOptions)
.then(select => {
let label = (select && select.label) || '';
const icon = (select && select.icon) || '';
if (typeof icon === 'string' && icon.length > 0) {
label = label.split(' ')[1];
}
message_config.type = label;
message_config.icon = icon;
if (label !== '') {
recursiveInputMessage(startMessageInput);
}
});
};
//选择commit 提交的模板
const SelectTemplate = () => {
CommitDetailQuickPickOptions.placeHolder = localize(
'extension.showGitCommit.selectTemplate.placeholder',
);
vscode.window
.showQuickPick(CommitTemplate, CommitDetailQuickPickOptions)
.then(select => {
const templateName = (select && select.templateName) || '';
const templateContent = (select && select.templateContent) || '';
message_config.templateName = templateName;
message_config.templateContent = templateContent;
if (templateName !== '') {
completeInputMessage(true);
clearMessage();
}
});
};
// 设置 detail 信息
const setMessageInput = (_key: keyof GitMessage, message: string) => {
const _detailType = CommitDetailType.find(item => item.key === _key);
if(!_detailType || message.length <= 0) {return;}
message_config[_key] = message;
_detailType.isEdit = true;
};
//点击图标触发快捷选项 Click the icon to trigger shortcut options
let disposable = vscode.commands.registerCommand(
'extension.showGitCommit',
(uri?) => {
if (uri) {
//如果有多个repo 寻找当前的 进行填充 If there are multiple repos looking for the current to populate
repo = gitExtension.getAPI(1).repositories.find(repo => {
const uriRoot = uri._rootUri ? uri._rootUri : uri.rootUri;
return repo.rootUri.path === uriRoot?.path;
});
}
if (FillSubjectWithCurrent) {
const message = repo.inputBox.value;
setMessageInput('subject', message);
}
startMessageInput();
},
);
context.subscriptions.push(disposable);
}
// this method is called when your extension is deactivated
export function deactivate() { }
================================================
FILE: src/test/runTest.ts
================================================
import * as path from 'path';
import { runTests } from 'vscode-test';
async function main() {
try {
// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
const extensionDevelopmentPath = path.resolve(__dirname, '../../');
// The path to test runner
// Passed to --extensionTestsPath
const extensionTestsPath = path.resolve(__dirname, './suite/index');
// Download VS Code, unzip it and run the integration test
await runTests({ extensionDevelopmentPath, extensionTestsPath });
} catch (err) {
console.error('Failed to run tests');
process.exit(1);
}
}
main();
================================================
FILE: src/test/suite/extension.test.ts
================================================
import * as assert from 'assert';
// You can import and use all API from the 'vscode' module
// as well as import your extension to test it
import * as vscode from 'vscode';
// import * as myExtension from '../extension';
suite('Extension Test Suite', () => {
vscode.window.showInformationMessage('Start all tests.');
test('Sample test', () => {
assert.equal(-1, [1, 2, 3].indexOf(5));
assert.equal(-1, [1, 2, 3].indexOf(0));
});
});
================================================
FILE: src/test/suite/index.ts
================================================
import * as path from 'path';
import * as Mocha from 'mocha';
import * as glob from 'glob';
export function run(): Promise<void> {
// Create the mocha test
const mocha = new Mocha({
ui: 'tdd',
});
mocha.useColors(true);
const testsRoot = path.resolve(__dirname, '..');
return new Promise((c, e) => {
glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
if (err) {
return e(err);
}
// Add files to the test suite
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
try {
// Run the mocha test
mocha.run(failures => {
if (failures > 0) {
e(new Error(`${failures} tests failed.`));
} else {
c();
}
});
} catch (err) {
console.error(err);
e(err);
}
});
});
}
================================================
FILE: src/types/git.d.ts
================================================
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Uri, SourceControlInputBox, Event, CancellationToken } from 'vscode';
export interface Git {
readonly path: string;
}
export interface InputBox {
value: string;
}
export const enum RefType {
Head,
RemoteHead,
Tag
}
export interface Ref {
readonly type: RefType;
readonly name?: string;
readonly commit?: string;
readonly remote?: string;
}
export interface UpstreamRef {
readonly remote: string;
readonly name: string;
}
export interface Branch extends Ref {
readonly upstream?: UpstreamRef;
readonly ahead?: number;
readonly behind?: number;
}
export interface Commit {
readonly hash: string;
readonly message: string;
readonly parents: string[];
readonly authorEmail?: string | undefined;
}
export interface Submodule {
readonly name: string;
readonly path: string;
readonly url: string;
}
export interface Remote {
readonly name: string;
readonly fetchUrl?: string;
readonly pushUrl?: string;
readonly isReadOnly: boolean;
}
export const enum Status {
INDEX_MODIFIED,
INDEX_ADDED,
INDEX_DELETED,
INDEX_RENAMED,
INDEX_COPIED,
MODIFIED,
DELETED,
UNTRACKED,
IGNORED,
INTENT_TO_ADD,
ADDED_BY_US,
ADDED_BY_THEM,
DELETED_BY_US,
DELETED_BY_THEM,
BOTH_ADDED,
BOTH_DELETED,
BOTH_MODIFIED
}
export interface Change {
/**
* Returns either `originalUri` or `renameUri`, depending
* on whether this change is a rename change. When
* in doubt always use `uri` over the other two alternatives.
*/
readonly uri: Uri;
readonly originalUri: Uri;
readonly renameUri: Uri | undefined;
readonly status: Status;
}
export interface RepositoryState {
readonly HEAD: Branch | undefined;
readonly refs: Ref[];
readonly remotes: Remote[];
readonly submodules: Submodule[];
readonly rebaseCommit: Commit | undefined;
readonly mergeChanges: Change[];
readonly indexChanges: Change[];
readonly workingTreeChanges: Change[];
readonly onDidChange: Event<void>;
}
export interface RepositoryUIState {
readonly selected: boolean;
readonly onDidChange: Event<void>;
}
/**
* Log options.
*/
export interface LogOptions {
/** Max number of log entries to retrieve. If not specified, the default is 32. */
readonly maxEntries?: number;
}
export interface Repository {
readonly rootUri: Uri;
readonly inputBox: InputBox;
readonly state: RepositoryState;
readonly ui: RepositoryUIState;
getConfigs(): Promise<{ key: string; value: string }[]>;
getConfig(key: string): Promise<string>;
setConfig(key: string, value: string): Promise<string>;
getGlobalConfig(key: string): Promise<string>;
getObjectDetails(
treeish: string,
path: string
): Promise<{ mode: string; object: string; size: number }>;
detectObjectType(
object: string
): Promise<{ mimetype: string; encoding?: string }>;
buffer(ref: string, path: string): Promise<Buffer>;
show(ref: string, path: string): Promise<string>;
getCommit(ref: string): Promise<Commit>;
clean(paths: string[]): Promise<void>;
apply(patch: string, reverse?: boolean): Promise<void>;
diff(cached?: boolean): Promise<string>;
diffWithHEAD(): Promise<Change[]>;
diffWithHEAD(path: string): Promise<string>;
diffWith(ref: string): Promise<Change[]>;
diffWith(ref: string, path: string): Promise<string>;
diffIndexWithHEAD(): Promise<Change[]>;
diffIndexWithHEAD(path: string): Promise<string>;
diffIndexWith(ref: string): Promise<Change[]>;
diffIndexWith(ref: string, path: string): Promise<string>;
diffBlobs(object1: string, object2: string): Promise<string>;
diffBetween(ref1: string, ref2: string): Promise<Change[]>;
diffBetween(ref1: string, ref2: string, path: string): Promise<string>;
hashObject(data: string): Promise<string>;
createBranch(name: string, checkout: boolean, ref?: string): Promise<void>;
deleteBranch(name: string, force?: boolean): Promise<void>;
getBranch(name: string): Promise<Branch>;
setBranchUpstream(name: string, upstream: string): Promise<void>;
getMergeBase(ref1: string, ref2: string): Promise<string>;
status(): Promise<void>;
checkout(treeish: string): Promise<void>;
addRemote(name: string, url: string): Promise<void>;
removeRemote(name: string): Promise<void>;
fetch(remote?: string, ref?: string, depth?: number): Promise<void>;
pull(unshallow?: boolean): Promise<void>;
push(
remoteName?: string,
branchName?: string,
setUpstream?: boolean
): Promise<void>;
blame(path: string): Promise<string>;
log(options?: LogOptions): Promise<Commit[]>;
}
export interface API {
readonly git: Git;
readonly repositories: Repository[];
readonly onDidOpenRepository: Event<Repository>;
readonly onDidCloseRepository: Event<Repository>;
}
export interface GitExtension {
readonly enabled: boolean;
readonly onDidChangeEnablement: Event<boolean>;
/**
* Returns a specific API version.
*
* Throws error if git extension is disabled. You can listed to the
* [GitExtension.onDidChangeEnablement](#GitExtension.onDidChangeEnablement) event
* to know when the extension becomes enabled/disabled.
*
* @param version Version number.
* @returns API instance
*/
getAPI(version: 1): API;
}
export const enum GitErrorCodes {
BadConfigFile = 'BadConfigFile',
AuthenticationFailed = 'AuthenticationFailed',
NoUserNameConfigured = 'NoUserNameConfigured',
NoUserEmailConfigured = 'NoUserEmailConfigured',
NoRemoteRepositorySpecified = 'NoRemoteRepositorySpecified',
NotAGitRepository = 'NotAGitRepository',
NotAtRepositoryRoot = 'NotAtRepositoryRoot',
Conflict = 'Conflict',
StashConflict = 'StashConflict',
UnmergedChanges = 'UnmergedChanges',
PushRejected = 'PushRejected',
RemoteConnectionError = 'RemoteConnectionError',
DirtyWorkTree = 'DirtyWorkTree',
CantOpenResource = 'CantOpenResource',
GitNotFound = 'GitNotFound',
CantCreatePipe = 'CantCreatePipe',
CantAccessRemote = 'CantAccessRemote',
RepositoryNotFound = 'RepositoryNotFound',
RepositoryIsLocked = 'RepositoryIsLocked',
BranchNotFullyMerged = 'BranchNotFullyMerged',
NoRemoteReference = 'NoRemoteReference',
InvalidBranchName = 'InvalidBranchName',
BranchAlreadyExists = 'BranchAlreadyExists',
NoLocalChanges = 'NoLocalChanges',
NoStashFound = 'NoStashFound',
LocalChangesOverwritten = 'LocalChangesOverwritten',
NoUpstreamBranch = 'NoUpstreamBranch',
IsInSubmodule = 'IsInSubmodule',
WrongCase = 'WrongCase',
CantLockRef = 'CantLockRef',
CantRebaseMultipleBranches = 'CantRebaseMultipleBranches',
PatchDoesNotApply = 'PatchDoesNotApply',
NoPathFound = 'NoPathFound'
}
================================================
FILE: tsconfig.json
================================================
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"lib": [
"es6"
],
"sourceMap": true,
"rootDir": "src",
"strict": true /* enable all strict type-checking options */
/* Additional Checks */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
},
"exclude": [
"node_modules",
".vscode-test"
]
}
================================================
FILE: vsc-extension-quickstart.md
================================================
# Welcome to your VS Code Extension
## What's in the folder
* This folder contains all of the files necessary for your extension.
* `package.json` - this is the manifest file in which you declare your extension and command.
* The sample plugin registers a command and defines its title and command name. With this information VS Code can show the command in the command palette. It doesn’t yet need to load the plugin.
* `src/extension.ts` - this is the main file where you will provide the implementation of your command.
* The file exports one function, `activate`, which is called the very first time your extension is activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`.
* We pass the function containing the implementation of the command as the second parameter to `registerCommand`.
## Get up and running straight away
* Press `F5` to open a new window with your extension loaded.
* Run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World`.
* Set breakpoints in your code inside `src/extension.ts` to debug your extension.
* Find output from your extension in the debug console.
## Make changes
* You can relaunch the extension from the debug toolbar after changing code in `src/extension.ts`.
* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes.
## Explore the API
* You can open the full set of our API when you open the file `node_modules/@types/vscode/index.d.ts`.
## Run tests
* Open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Extension Tests`.
* Press `F5` to run the tests in a new window with your extension loaded.
* See the output of the test result in the debug console.
* Make changes to `src/test/suite/extension.test.ts` or create new test files inside the `test/suite` folder.
* The provided test runner will only consider files matching the name pattern `**.test.ts`.
* You can create folders inside the `test` folder to structure your tests any way you want.
## Go further
* Reduce the extension size and improve the startup time by [bundling your extension](https://code.visualstudio.com/api/working-with-extensions/bundling-extension).
* [Publish your extension](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) on the VSCode extension marketplace.
* Automate builds by setting up [Continuous Integration](https://code.visualstudio.com/api/working-with-extensions/continuous-integration).
gitextract_m1t7dyiy/ ├── .all-contributorsrc ├── .eslintrc.json ├── .gitignore ├── .vscode/ │ ├── extensions.json │ ├── launch.json │ ├── settings.json │ └── tasks.json ├── .vscodeignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── package.json ├── package.nls.ja.json ├── package.nls.json ├── package.nls.zh-cn.json ├── package.nls.zh-hk.json ├── package.nls.zh-tw.json ├── src/ │ ├── config/ │ │ ├── commit-detail.ts │ │ ├── commit-input.ts │ │ ├── commit-type.ts │ │ ├── default-temp.ts │ │ └── template-type.ts │ ├── extension.ts │ ├── test/ │ │ ├── runTest.ts │ │ └── suite/ │ │ ├── extension.test.ts │ │ └── index.ts │ └── types/ │ └── git.d.ts ├── tsconfig.json └── vsc-extension-quickstart.md
SYMBOL INDEX (30 symbols across 8 files)
FILE: src/config/commit-detail.ts
type CommitDetailType (line 7) | interface CommitDetailType extends QuickPickItem {
function GetCommitDetailType (line 17) | function GetCommitDetailType() {
FILE: src/config/commit-input.ts
type CommitInputType (line 7) | interface CommitInputType extends InputBoxOptions {}
function GetCommitInputType (line 9) | function GetCommitInputType() {
FILE: src/config/commit-type.ts
type CommitType (line 7) | interface CommitType extends QuickPickItem {
function GetCommitTypes (line 20) | function GetCommitTypes() {
FILE: src/config/template-type.ts
type CommitTemplateType (line 7) | interface CommitTemplateType extends QuickPickItem {
FILE: src/extension.ts
type GitMessage (line 16) | interface GitMessage {
function activate (line 32) | async function activate(context: vscode.ExtensionContext) {
function deactivate (line 273) | function deactivate() { }
FILE: src/test/runTest.ts
function main (line 5) | async function main() {
FILE: src/test/suite/index.ts
function run (line 5) | function run(): Promise<void> {
FILE: src/types/git.d.ts
type Git (line 8) | interface Git {
type InputBox (line 12) | interface InputBox {
type RefType (line 16) | const enum RefType {
type Ref (line 22) | interface Ref {
type UpstreamRef (line 29) | interface UpstreamRef {
type Branch (line 34) | interface Branch extends Ref {
type Commit (line 40) | interface Commit {
type Submodule (line 47) | interface Submodule {
type Remote (line 53) | interface Remote {
type Status (line 60) | const enum Status {
type Change (line 82) | interface Change {
type RepositoryState (line 94) | interface RepositoryState {
type RepositoryUIState (line 108) | interface RepositoryUIState {
type LogOptions (line 116) | interface LogOptions {
type Repository (line 121) | interface Repository {
type API (line 186) | interface API {
type GitExtension (line 193) | interface GitExtension {
type GitErrorCodes (line 210) | const enum GitErrorCodes {
Condensed preview — 29 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (82K chars).
[
{
"path": ".all-contributorsrc",
"chars": 3870,
"preview": "{\n \"files\": [\n \"README.md\"\n ],\n \"imageSize\": 100,\n \"commit\": false,\n \"commitType\": \"docs\",\n \"commitConvention\":"
},
{
"path": ".eslintrc.json",
"chars": 489,
"preview": "{\n \"root\": true,\n \"parser\": \"@typescript-eslint/parser\",\n \"parserOptions\": {\n \"ecmaVersion\": 6,\n "
},
{
"path": ".gitignore",
"chars": 90,
"preview": "out\nnode_modules\n.vscode-test/\npackage-lock.json\n.vsix\n.DS_Store\ngit-commit-plugin-*.vsix\n"
},
{
"path": ".vscode/extensions.json",
"chars": 169,
"preview": "{\n\t// See http://go.microsoft.com/fwlink/?LinkId=827846\n\t// for the documentation about the extensions.json format\n\t\"rec"
},
{
"path": ".vscode/launch.json",
"chars": 1006,
"preview": "// A launch configuration that compiles the extension and then opens it inside a new window\n// Use IntelliSense to learn"
},
{
"path": ".vscode/settings.json",
"chars": 650,
"preview": "// Place your settings in this file to overwrite default and user settings.\n{\n \"files.exclude\": {\n \"out\": fals"
},
{
"path": ".vscode/tasks.json",
"chars": 365,
"preview": "// See https://go.microsoft.com/fwlink/?LinkId=733558\n// for the documentation about the tasks.json format\n{\n\t\"version\":"
},
{
"path": ".vscodeignore",
"chars": 137,
"preview": ".vscode/**\n.vscode-test/**\nout/test/**\nsrc/**\n.gitignore\nvsc-extension-quickstart.md\n**/tsconfig.json\n**/.eslintrc.json\n"
},
{
"path": "CHANGELOG.md",
"chars": 4468,
"preview": "# CHANGELOG\n\n## [1.5.0]\n- ✨ Feat: [adding \\<br\\> allows line breaks to be displayed](https://github.com/RedJue/git-com"
},
{
"path": "LICENSE",
"chars": 1066,
"preview": " \nMIT License\n\nCopyright (c) 2018 RedJue\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\n"
},
{
"path": "README.md",
"chars": 11156,
"preview": "# Git Commit Plugin For VS Code\n<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n[![All Cont"
},
{
"path": "package.json",
"chars": 4427,
"preview": "{\n \"name\": \"git-commit-plugin\",\n \"displayName\": \"git-commit-plugin\",\n \"description\": \"Automatically generate gi"
},
{
"path": "package.nls.ja.json",
"chars": 2627,
"preview": "{\n \"extension.showGitCommit.title\": \"show git commit template\",\n \"extension.showGitCommit.placeholder\": \"コミットタイプの検"
},
{
"path": "package.nls.json",
"chars": 3181,
"preview": "{\n \"extension.showGitCommit.title\": \"show git commit template\",\n \"extension.showGitCommit.placeholder\": \"Search Gi"
},
{
"path": "package.nls.zh-cn.json",
"chars": 2353,
"preview": "{\n \"extension.showGitCommit.title\": \"show git commit template\",\n \"extension.showGitCommit.placeholder\": \"搜索提交类型\",\n"
},
{
"path": "package.nls.zh-hk.json",
"chars": 2355,
"preview": "{\n \"extension.showGitCommit.title\": \"show git commit template\",\n \"extension.showGitCommit.placeholder\": \"搜索提交類型\",\n"
},
{
"path": "package.nls.zh-tw.json",
"chars": 2355,
"preview": "{\n \"extension.showGitCommit.title\": \"show git commit template\",\n \"extension.showGitCommit.placeholder\": \"搜索提交類型\",\n"
},
{
"path": "src/config/commit-detail.ts",
"chars": 2614,
"preview": "import { QuickPickItem, QuickPickOptions, workspace } from 'vscode';\nimport { localize } from 'vscode-nls-i18n';\n\n/**\n *"
},
{
"path": "src/config/commit-input.ts",
"chars": 469,
"preview": "import { InputBoxOptions } from 'vscode';\nimport { localize } from 'vscode-nls-i18n';\n\n/**\n * @description git commit in"
},
{
"path": "src/config/commit-type.ts",
"chars": 4508,
"preview": "import { workspace, QuickPickItem } from 'vscode';\nimport { localize } from 'vscode-nls-i18n';\n\n/**\n * @description git "
},
{
"path": "src/config/default-temp.ts",
"chars": 315,
"preview": "export const Angular = {\n 'templateName': 'Angular',\n 'templateContent': '<icon><space><type>(<scope>):<space><s"
},
{
"path": "src/config/template-type.ts",
"chars": 1197,
"preview": "import { workspace, QuickPickItem } from 'vscode';\nimport * as defaultTemp from './default-temp';\n\n/**\n * @description g"
},
{
"path": "src/extension.ts",
"chars": 10499,
"preview": "// The module 'vscode' contains the VS Code extensibility API\n// Import the module and reference it with the alias vscod"
},
{
"path": "src/test/runTest.ts",
"chars": 706,
"preview": "import * as path from 'path';\n\nimport { runTests } from 'vscode-test';\n\nasync function main() {\n try {\n // The"
},
{
"path": "src/test/suite/extension.test.ts",
"chars": 465,
"preview": "import * as assert from 'assert';\n\n// You can import and use all API from the 'vscode' module\n// as well as import your "
},
{
"path": "src/test/suite/index.ts",
"chars": 1018,
"preview": "import * as path from 'path';\nimport * as Mocha from 'mocha';\nimport * as glob from 'glob';\n\nexport function run(): Prom"
},
{
"path": "src/types/git.d.ts",
"chars": 6997,
"preview": "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Micros"
},
{
"path": "tsconfig.json",
"chars": 584,
"preview": "{\n\t\"compilerOptions\": {\n\t\t\"module\": \"commonjs\",\n\t\t\"target\": \"es6\",\n\t\t\"outDir\": \"out\",\n\t\t\"lib\": [\n\t\t\t\"es6\"\n\t\t],\n\t\t\"source"
},
{
"path": "vsc-extension-quickstart.md",
"chars": 2614,
"preview": "# Welcome to your VS Code Extension\n\n## What's in the folder\n\n* This folder contains all of the files necessary for your"
}
]
About this extraction
This page contains the full source code of the RedJue/git-commit-plugin GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 29 files (71.0 KB), approximately 19.3k tokens, and a symbol index with 30 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.