@4s1/conventional-commit-creator 0.6.0 → 0.10.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,25 @@
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.10.0](https://gitlab.com/4s1/conventional-commit-creator/compare/v0.9.0...v0.10.0) (2021-12-15)
6
+
7
+ ## [0.9.0](https://gitlab.com/4s1/conventional-commit-creator/compare/v0.8.0...v0.9.0) (2021-12-10)
8
+
9
+ ## [0.8.0](https://gitlab.com/4s1/conventional-commit-creator/compare/v0.7.0...v0.8.0) (2021-11-18)
10
+
11
+
12
+ ### Features
13
+
14
+ * add hack for redmine at work ([538273e](https://gitlab.com/4s1/conventional-commit-creator/commit/538273e997c074bb28c877571b68e82a9d3fff52))
15
+
16
+ ## [0.7.0](https://gitlab.com/4s1/conventional-commit-creator/compare/v0.6.0...v0.7.0) (2021-11-18)
17
+
18
+
19
+ ### Features
20
+
21
+ * remove brackets from issue ([cbaca2f](https://gitlab.com/4s1/conventional-commit-creator/commit/cbaca2f05ac80731ecf2b6a10c19ccf993df20c5))
22
+ * **svn:** remove support for git svn ([e3a2dff](https://gitlab.com/4s1/conventional-commit-creator/commit/e3a2dff303a46e089363fcb46b10f8e045a5c72a))
23
+
5
24
  ## [0.6.0](https://gitlab.com/4s1/conventional-commit-creator/compare/v0.5.1...v0.6.0) (2021-11-13)
6
25
 
7
26
 
package/README.md CHANGED
@@ -1,12 +1,16 @@
1
1
  # Conventional Commit Creator
2
2
 
3
+ This CLI application assists in creating commit messages that are conform to the conventional commit style.
4
+ It will ask for type, scope (optional), description and issue (optional).
5
+
3
6
  ## Install
4
7
 
5
8
  ```bash
6
- npm install -g --registry=https://gitlab.com/api/v4/packages/npm/ @4s1/conventional-commit-creator
9
+ # Install globally
10
+ npm install -g @4s1/conventional-commit-creator
7
11
  ```
8
12
 
9
- ## Run
13
+ ## Usage
10
14
 
11
15
  ```bash
12
16
  conventional-commit-creator
package/dist/index.js CHANGED
@@ -1,30 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
6
- }) : (function(o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- o[k2] = m[k];
9
- }));
10
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
11
- Object.defineProperty(o, "default", { enumerable: true, value: v });
12
- }) : function(o, v) {
13
- o["default"] = v;
14
- });
15
- var __importStar = (this && this.__importStar) || function (mod) {
16
- if (mod && mod.__esModule) return mod;
17
- var result = {};
18
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
19
- __setModuleDefault(result, mod);
20
- return result;
21
- };
22
3
  var __importDefault = (this && this.__importDefault) || function (mod) {
23
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
24
5
  };
25
6
  Object.defineProperty(exports, "__esModule", { value: true });
26
7
  const prompts_1 = __importDefault(require("prompts"));
27
- const fs = __importStar(require("fs"));
28
8
  const child_process_1 = require("child_process");
29
9
  const questions = [
30
10
  {
@@ -84,7 +64,6 @@ const questions = [
84
64
  },
85
65
  ];
86
66
  async function main() {
87
- const gitRootPath = await getGitRootPath();
88
67
  if (!(await haveStagedChanges())) {
89
68
  console.error('Nothing to commit');
90
69
  process.exit(0);
@@ -95,23 +74,22 @@ async function main() {
95
74
  process.exit(1);
96
75
  },
97
76
  });
98
- const isGitSvn = await checkIsGitSvn(gitRootPath);
99
- const msg = createMsg(data, isGitSvn);
77
+ const msg = createMsg(data);
100
78
  await commit(msg);
101
79
  console.info('done');
102
80
  }
103
- function createMsg(data, isGitSvn) {
81
+ function createMsg(data) {
104
82
  let msg = `${data.type.trim()}`;
105
83
  if (data.scope) {
106
84
  msg += `(${data.scope.trim()})`;
107
85
  }
108
86
  msg += `: ${data.description.trim()}`;
109
87
  if (data.issue) {
110
- if (isGitSvn) {
111
- msg += ` (refs #${data.issue})`;
88
+ if (!isBender()) {
89
+ msg += ` (#${data.issue})`;
112
90
  }
113
91
  else {
114
- msg += ` (#${data.issue})`;
92
+ msg += ` [refs #${data.issue}]`;
115
93
  }
116
94
  }
117
95
  return msg;
@@ -136,21 +114,16 @@ async function haveStagedChanges() {
136
114
  process.exit(1);
137
115
  }
138
116
  }
139
- async function getGitRootPath() {
117
+ async function isBender() {
140
118
  try {
141
- const path = await execute('git rev-parse --show-toplevel');
142
- return path.trim();
119
+ const output = await execute('git remote -v');
120
+ return output.includes('intra.bender:');
143
121
  }
144
122
  catch (err) {
145
123
  console.error(err);
146
124
  process.exit(1);
147
125
  }
148
126
  }
149
- async function checkIsGitSvn(gitRootPath) {
150
- const fullPath = `${gitRootPath}/.git/svn`;
151
- const res = fs.existsSync(fullPath);
152
- return res;
153
- }
154
127
  async function execute(cmd) {
155
128
  return new Promise((resolve, reject) => {
156
129
  (0, child_process_1.exec)(cmd, (err, stdout) => {
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@4s1/conventional-commit-creator",
3
- "version": "0.6.0",
3
+ "version": "0.10.0",
4
4
  "description": "Conventional Commit Creator",
5
+ "keywords": [
6
+ "conventional commit",
7
+ "4s1"
8
+ ],
5
9
  "bugs": {
6
10
  "url": "https://gitlab.com/4s1/conventional-commit-creator/issues"
7
11
  },
@@ -43,15 +47,20 @@
43
47
  "prompts": "^2.4.2"
44
48
  },
45
49
  "devDependencies": {
46
- "@4s1/eslint-config": "3.2.2",
47
- "@4s1/ts-config": "1.3.0",
48
- "@types/node": "14.17.33",
50
+ "@4s1/eslint-config": "^3.4.0",
51
+ "@4s1/ts-config": "^1.4.0",
52
+ "@commitlint/cli": "15.0.0",
53
+ "@commitlint/config-conventional": "15.0.0",
54
+ "@types/node": "14.18.0",
49
55
  "@types/prompts": "2.4.0",
50
- "eslint": "8.2.0",
56
+ "eslint": "8.4.1",
51
57
  "husky": "7.0.4",
52
- "prettier": "2.4.1",
58
+ "prettier": "2.5.1",
53
59
  "standard-version": "9.3.2",
54
60
  "ts-node": "10.4.0",
55
- "typescript": "4.4.4"
61
+ "typescript": "4.5.4"
62
+ },
63
+ "publishConfig": {
64
+ "access": "public"
56
65
  }
57
66
  }