@logickernel/agileflow 0.2.0 → 0.2.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logickernel/agileflow",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Automatic semantic versioning and changelog generation based on conventional commits",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/git-push.js CHANGED
@@ -1,6 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const { run } = require('./utils');
3
+ const { execSync } = require('child_process');
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ const os = require('os');
4
7
 
5
8
  /**
6
9
  * Creates an annotated tag and pushes it to the remote repository.
@@ -11,16 +14,27 @@ const { run } = require('./utils');
11
14
  */
12
15
  async function pushTag(tagName, message) {
13
16
  const safeTag = String(tagName).replace(/"/g, '\\"');
14
- const safeMsg = String(message).replace(/"/g, '\\"');
15
17
 
16
- // Create annotated tag
17
- run(`git tag -a "${safeTag}" -m "${safeMsg}"`);
18
-
19
- // Push to origin
20
- run(`git push origin "${safeTag}"`);
18
+ // Write message to a temp file to avoid shell escaping issues with special characters
19
+ const tempFile = path.join(os.tmpdir(), `agileflow-tag-${Date.now()}.txt`);
20
+ try {
21
+ fs.writeFileSync(tempFile, message, 'utf8');
22
+
23
+ // Create annotated tag using -F to read message from file
24
+ execSync(`git tag -a "${safeTag}" -F "${tempFile}"`, { stdio: 'pipe' });
25
+
26
+ // Push to origin
27
+ execSync(`git push origin "${safeTag}"`, { stdio: 'pipe' });
28
+ } finally {
29
+ // Clean up temp file
30
+ try {
31
+ fs.unlinkSync(tempFile);
32
+ } catch {
33
+ // Ignore cleanup errors
34
+ }
35
+ }
21
36
  }
22
37
 
23
38
  module.exports = {
24
39
  pushTag,
25
40
  };
26
-
package/src/utils.js CHANGED
@@ -271,11 +271,13 @@ function generateTypeChangelog(commits) {
271
271
 
272
272
  const lines = [];
273
273
  for (const entry of noScope) {
274
- lines.push(`- ${entry.description}${entry.issueRef}`);
274
+ const ref = entry.issueRef ? ` ${entry.issueRef}` : '';
275
+ lines.push(`- ${entry.description}${ref}`);
275
276
  }
276
277
  for (const scope of Object.keys(byScope).sort()) {
277
278
  for (const entry of byScope[scope]) {
278
- lines.push(`- **${scope}**: ${entry.description}${entry.issueRef}`);
279
+ const ref = entry.issueRef ? ` ${entry.issueRef}` : '';
280
+ lines.push(`- **${scope}**: ${entry.description}${ref}`);
279
281
  }
280
282
  }
281
283
  return lines;