@4s1/conventional-commit-creator 0.11.2 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/LICENSE +1 -1
- package/README.md +6 -0
- package/dist/git.d.ts +8 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +60 -0
- package/dist/git.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -6
- package/dist/index.js.map +1 -0
- package/package.json +13 -15
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [0.13.0](https://gitlab.com/4s1/conventional-commit-creator/compare/v0.12.0...v0.13.0) (2022-04-01)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* renaming type texts ([e87ce5b](https://gitlab.com/4s1/conventional-commit-creator/commit/e87ce5bcceede74620fd8fec3434a25c95e43c34))
|
|
11
|
+
|
|
12
|
+
## [0.12.0](https://gitlab.com/4s1/conventional-commit-creator/compare/v0.11.3...v0.12.0) (2022-03-11)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* first letter in description can be in upper case ([67964f3](https://gitlab.com/4s1/conventional-commit-creator/commit/67964f3afb131376ef26b11c634565de521cc7b3))
|
|
18
|
+
|
|
19
|
+
## [0.11.3](https://gitlab.com/4s1/conventional-commit-creator/compare/v0.11.2...v0.11.3) (2021-12-28)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* add whole dist folder ([3d1cd01](https://gitlab.com/4s1/conventional-commit-creator/commit/3d1cd01ab20554064de6a2ad3035a96e4f4db9b3))
|
|
25
|
+
|
|
5
26
|
## [0.11.2](https://gitlab.com/4s1/conventional-commit-creator/compare/v0.11.1...v0.11.2) (2021-12-28)
|
|
6
27
|
|
|
7
28
|
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
[](https://gitlab.com/4s1/conventional-commit-creator/pipelines)
|
|
2
|
+
[](https://gitlab.com/4s1/conventional-commit-creator/commits/main)
|
|
3
|
+
[](https://sonarcloud.io/project/issues?id=4s1_conventional-commit-creator&resolved=false&types=BUG)
|
|
4
|
+
[](https://sonarcloud.io/project/issues?id=4s1_conventional-commit-creator&resolved=false&types=VULNERABILITY)
|
|
5
|
+
[](https://sonarcloud.io/project/issues?id=4s1_conventional-commit-creator&resolved=false&types=CODE_SMELL)
|
|
6
|
+
|
|
1
7
|
# Conventional Commit Creator
|
|
2
8
|
|
|
3
9
|
This CLI application assists in creating commit messages that are conform to the conventional commit style.
|
package/dist/git.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAEA,qBAAa,GAAG;IACD,2BAA2B,IAAI,OAAO,CAAC,OAAO,CAAC;IAU/C,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC;IAWrC,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC;IAU5B,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAU/C,OAAO,CAAC,OAAO;CAWhB"}
|
package/dist/git.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Git = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
class Git {
|
|
6
|
+
async isCurrentDirUnderGitControl() {
|
|
7
|
+
try {
|
|
8
|
+
const result = await this.execute('git rev-parse --is-inside-work-tree');
|
|
9
|
+
return result.trim() === 'true';
|
|
10
|
+
}
|
|
11
|
+
catch (err) {
|
|
12
|
+
console.error(err);
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
async haveStagedChanges() {
|
|
17
|
+
try {
|
|
18
|
+
const staged = await this.execute('git diff --cached | head -5');
|
|
19
|
+
return staged !== '';
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
console.error(err);
|
|
23
|
+
console.log('return false');
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
async isAtWork() {
|
|
28
|
+
try {
|
|
29
|
+
const output = await this.execute('git remote -v');
|
|
30
|
+
return output.includes('intra.bender:');
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
console.error(err);
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async commit(msg) {
|
|
38
|
+
console.info('committing ...');
|
|
39
|
+
try {
|
|
40
|
+
await this.execute(`git commit -m "${msg}"`);
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
console.error(err);
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
execute(cmd) {
|
|
48
|
+
return new Promise((resolve, reject) => {
|
|
49
|
+
(0, child_process_1.exec)(cmd, (err, stdout) => {
|
|
50
|
+
if (err) {
|
|
51
|
+
reject(err);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
resolve(stdout);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.Git = Git;
|
|
60
|
+
//# sourceMappingURL=git.js.map
|
package/dist/git.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":";;;AAAA,iDAAmD;AAEnD,MAAa,GAAG;IACP,KAAK,CAAC,2BAA2B;QACtC,IAA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AAM,EAAE,EAAE;YACrC,IAAA,oBAAI,EAAC,GAAG,EAAE,CAAC,GAAyB,EAAE,MAAc,EAAE,EAAE;gBACtD,IAAI,GAAG,EAAE;oBACP,MAAM,CAAC,GAAG,CAAC,CAAA;oBACX,OAAM;iBACP;gBACD,OAAO,CAAC,MAAM,CAAC,CAAA;YACjB,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AArDD,kBAqDC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
const prompts_1 = __importDefault(require("prompts"));
|
|
8
8
|
const git_1 = require("./git");
|
|
9
|
+
// https://kapeli.com/cheat_sheets/Conventional_Commits.docset/Contents/Resources/Documents/index
|
|
9
10
|
const questions = [
|
|
10
11
|
{
|
|
11
12
|
type: 'select',
|
|
@@ -14,14 +15,14 @@ const questions = [
|
|
|
14
15
|
choices: [
|
|
15
16
|
{ title: 'fix - A bugfix', value: 'fix' },
|
|
16
17
|
{ title: 'feat - A new feature', value: 'feat' },
|
|
17
|
-
{ title: 'refactor -
|
|
18
|
-
{ title: 'chore - Update something without impacting the user', value: 'chore' },
|
|
18
|
+
{ title: 'refactor - A code change that neither fixes a bug nor adds a feature', value: 'refactor' },
|
|
19
19
|
{ title: 'perf - A code change that improves performance', value: 'perf' },
|
|
20
20
|
{ title: 'docs - Documentation only changes', value: 'docs' },
|
|
21
21
|
{ title: 'style - Code style (semicolon, indentation, white-space, formatting, ...)', value: 'style' },
|
|
22
22
|
{ title: 'test - add/change/delete tests', value: 'test' },
|
|
23
|
+
{ title: "chore - Other changes that don't modify src or test files", value: 'chore' },
|
|
23
24
|
{ title: 'build - build system (npm, git, VSCode, husky, tsconfig, ...)', value: 'build' },
|
|
24
|
-
{ title: 'ci - CI configuration (GitLab, RenovateBot, ...)', value: 'ci' },
|
|
25
|
+
{ title: 'ci - CI configuration (GitHub, GitLab, RenovateBot, ...)', value: 'ci' },
|
|
25
26
|
{ title: 'revert - Reverts a previous commit', value: 'revert' },
|
|
26
27
|
],
|
|
27
28
|
},
|
|
@@ -49,9 +50,6 @@ const questions = [
|
|
|
49
50
|
else if (value.length < 3) {
|
|
50
51
|
return `Your text is ${3 - value.length} char(s) too short.`;
|
|
51
52
|
}
|
|
52
|
-
else if (value[0] === value[0].toUpperCase()) {
|
|
53
|
-
return `First char must be in lower case.`;
|
|
54
|
-
}
|
|
55
53
|
else {
|
|
56
54
|
return true;
|
|
57
55
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAEA,sDAA+C;AAC/C,+BAA2B;AAS3B,iGAAiG;AACjG,MAAM,SAAS,GAAmB;IAChC;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE;YACP,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE,KAAK,EAAE;YAC9C,EAAE,KAAK,EAAE,0BAA0B,EAAE,KAAK,EAAE,MAAM,EAAE;YACpD,EAAE,KAAK,EAAE,sEAAsE,EAAE,KAAK,EAAE,UAAU,EAAE;YACpG,EAAE,KAAK,EAAE,oDAAoD,EAAE,KAAK,EAAE,MAAM,EAAE;YAC9E,EAAE,KAAK,EAAE,uCAAuC,EAAE,KAAK,EAAE,MAAM,EAAE;YACjE,EAAE,KAAK,EAAE,8EAA8E,EAAE,KAAK,EAAE,OAAO,EAAE;YACzG,EAAE,KAAK,EAAE,oCAAoC,EAAE,KAAK,EAAE,MAAM,EAAE;YAC9D,EAAE,KAAK,EAAE,8DAA8D,EAAE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,GAAG,CAAA;AACZ,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4s1/conventional-commit-creator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Conventional Commit Creator",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"conventional commit",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"conventional-commit-creator": "./dist/index.js"
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
|
-
"dist/
|
|
27
|
+
"dist/"
|
|
28
28
|
],
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "rm -rf dist && tsc",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"release:patch": "pnpm run release -- --release-as patch",
|
|
40
40
|
"start": "node dist/index.js",
|
|
41
41
|
"start:dev": "ts-node src/index.ts",
|
|
42
|
-
"test": "
|
|
42
|
+
"test": "echo no tests",
|
|
43
43
|
"test:cov": "pnpm run test -- --coverage",
|
|
44
44
|
"test:watch": "pnpm run test -- --watch"
|
|
45
45
|
},
|
|
@@ -48,23 +48,21 @@
|
|
|
48
48
|
"prompts": "^2.4.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@4s1/eslint-config": "3.
|
|
51
|
+
"@4s1/eslint-config": "3.10.0",
|
|
52
52
|
"@4s1/ts-config": "1.4.0",
|
|
53
|
-
"@commitlint/cli": "16.
|
|
54
|
-
"@commitlint/config-conventional": "16.
|
|
55
|
-
"@types/
|
|
56
|
-
"@types/node": "14.18.3",
|
|
53
|
+
"@commitlint/cli": "16.2.3",
|
|
54
|
+
"@commitlint/config-conventional": "16.2.1",
|
|
55
|
+
"@types/node": "14.18.12",
|
|
57
56
|
"@types/prompts": "2.4.0",
|
|
58
|
-
"eslint": "8.
|
|
57
|
+
"eslint": "8.12.0",
|
|
59
58
|
"husky": "7.0.4",
|
|
60
|
-
"
|
|
61
|
-
"prettier": "2.5.1",
|
|
59
|
+
"prettier": "2.6.1",
|
|
62
60
|
"standard-version": "9.3.2",
|
|
63
|
-
"ts-
|
|
64
|
-
"
|
|
65
|
-
"typescript": "4.5.4"
|
|
61
|
+
"ts-node": "10.7.0",
|
|
62
|
+
"typescript": "4.6.3"
|
|
66
63
|
},
|
|
67
64
|
"publishConfig": {
|
|
68
|
-
"access": "public"
|
|
65
|
+
"access": "public",
|
|
66
|
+
"registry": "https://registry.npmjs.org"
|
|
69
67
|
}
|
|
70
68
|
}
|