@4s1/conventional-commit-creator 0.11.1 → 0.12.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 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.12.0](https://gitlab.com/4s1/conventional-commit-creator/compare/v0.11.3...v0.12.0) (2022-03-11)
6
+
7
+
8
+ ### Features
9
+
10
+ * first letter in description can be in upper case ([67964f3](https://gitlab.com/4s1/conventional-commit-creator/commit/67964f3afb131376ef26b11c634565de521cc7b3))
11
+
12
+ ## [0.11.3](https://gitlab.com/4s1/conventional-commit-creator/compare/v0.11.2...v0.11.3) (2021-12-28)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * add whole dist folder ([3d1cd01](https://gitlab.com/4s1/conventional-commit-creator/commit/3d1cd01ab20554064de6a2ad3035a96e4f4db9b3))
18
+
19
+ ## [0.11.2](https://gitlab.com/4s1/conventional-commit-creator/compare/v0.11.1...v0.11.2) (2021-12-28)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * add shebang ([6cc8f2c](https://gitlab.com/4s1/conventional-commit-creator/commit/6cc8f2cd0dc20eaef6e11945e8a83bbaec0b6652))
25
+
5
26
  ## [0.11.1](https://gitlab.com/4s1/conventional-commit-creator/compare/v0.11.0...v0.11.1) (2021-12-26)
6
27
 
7
28
 
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 Steffen (4s1)
3
+ Copyright (c) 2022 Steffen (4s1)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,3 +1,9 @@
1
+ [![Pipeline](https://gitlab.com/4s1/conventional-commit-creator/badges/main/pipeline.svg)](https://gitlab.com/4s1/conventional-commit-creator/pipelines)
2
+ [![Coverage](https://gitlab.com/4s1/conventional-commit-creator/badges/main/coverage.svg)](https://gitlab.com/4s1/conventional-commit-creator/commits/main)
3
+ [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=4s1_conventional-commit-creator&metric=bugs)](https://sonarcloud.io/project/issues?id=4s1_conventional-commit-creator&resolved=false&types=BUG)
4
+ [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=4s1_conventional-commit-creator&metric=vulnerabilities)](https://sonarcloud.io/project/issues?id=4s1_conventional-commit-creator&resolved=false&types=VULNERABILITY)
5
+ [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=4s1_conventional-commit-creator&metric=code_smells)](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,8 @@
1
+ export declare class Git {
2
+ isCurrentDirUnderGitControl(): Promise<boolean>;
3
+ haveStagedChanges(): Promise<boolean>;
4
+ isAtWork(): Promise<boolean>;
5
+ commit(msg: string): Promise<void>;
6
+ private execute;
7
+ }
8
+ //# sourceMappingURL=git.d.ts.map
@@ -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
@@ -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,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,qCAAqC,CAAC,CAAA;YACxE,OAAO,MAAM,CAAC,IAAI,EAAE,KAAK,MAAM,CAAA;SAChC;QAAC,OAAO,GAAG,EAAE;YACZ,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAClB,OAAO,KAAK,CAAA;SACb;IACH,CAAC;IAEM,KAAK,CAAC,iBAAiB;QAC5B,IAAI;YACF,MAAM,MAAM,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@@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  "use strict";
2
3
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -48,9 +49,6 @@ const questions = [
48
49
  else if (value.length < 3) {
49
50
  return `Your text is ${3 - value.length} char(s) too short.`;
50
51
  }
51
- else if (value[0] === value[0].toUpperCase()) {
52
- return `First char must be in lower case.`;
53
- }
54
52
  else {
55
53
  return true;
56
54
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAEA,sDAA+C;AAC/C,+BAA2B;AAS3B,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,sDAAsD,EAAE,KAAK,EAAE,UAAU,EAAE;YACpF,EAAE,KAAK,EAAE,wDAAwD,EAAE,KAAK,EAAE,OAAO,EAAE;YACnF,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,kEA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,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.11.1",
3
+ "version": "0.12.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/index.js"
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": "jest",
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.5.0",
51
+ "@4s1/eslint-config": "3.10.0",
52
52
  "@4s1/ts-config": "1.4.0",
53
- "@commitlint/cli": "16.0.0",
54
- "@commitlint/config-conventional": "16.0.0",
55
- "@types/jest": "27.0.3",
56
- "@types/node": "14.18.2",
53
+ "@commitlint/cli": "16.2.1",
54
+ "@commitlint/config-conventional": "16.2.1",
55
+ "@types/node": "14.18.12",
57
56
  "@types/prompts": "2.4.0",
58
- "eslint": "8.5.0",
57
+ "eslint": "8.10.0",
59
58
  "husky": "7.0.4",
60
- "jest": "27.4.5",
61
59
  "prettier": "2.5.1",
62
60
  "standard-version": "9.3.2",
63
- "ts-jest": "27.1.2",
64
- "ts-node": "10.4.0",
65
- "typescript": "4.5.4"
61
+ "ts-node": "10.7.0",
62
+ "typescript": "4.6.2"
66
63
  },
67
64
  "publishConfig": {
68
- "access": "public"
65
+ "access": "public",
66
+ "registry": "https://registry.npmjs.org"
69
67
  }
70
68
  }