@storm-software/git-tools 2.124.23 → 2.124.25
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/README.md +1 -1
- package/bin/git.cjs +40 -28
- package/bin/git.cjs.map +1 -1
- package/bin/git.js +37 -28
- package/bin/git.js.map +1 -1
- package/package.json +9 -9
package/bin/git.js
CHANGED
|
@@ -4,7 +4,16 @@ import { run } from './chunk-G3YPGVPS.js';
|
|
|
4
4
|
import { getConfig, handleProcess, writeSuccess, exitWithSuccess, exitWithError, writeInfo, findWorkspaceRootSafe, writeFatal, getWorkspaceConfig, joinPaths, writeDebug, isVerbose, writeWarning, defu, writeTrace, STORM_DEFAULT_RELEASE_BANNER } from './chunk-WB7NYAEQ.js';
|
|
5
5
|
import TOML from '@ltd/j-toml';
|
|
6
6
|
import { Command } from 'commander';
|
|
7
|
-
import
|
|
7
|
+
import '@inquirer/checkbox';
|
|
8
|
+
import '@inquirer/editor';
|
|
9
|
+
import default4 from '@inquirer/confirm';
|
|
10
|
+
import default5 from '@inquirer/input';
|
|
11
|
+
import '@inquirer/number';
|
|
12
|
+
import '@inquirer/expand';
|
|
13
|
+
import '@inquirer/rawlist';
|
|
14
|
+
import '@inquirer/password';
|
|
15
|
+
import '@inquirer/search';
|
|
16
|
+
import default11 from '@inquirer/select';
|
|
8
17
|
import shellescape from 'any-shell-escape';
|
|
9
18
|
import chalkTemplate from 'chalk-template';
|
|
10
19
|
import fs, { readFile as readFile$1, writeFile } from 'node:fs/promises';
|
|
@@ -452,17 +461,17 @@ function getParserRegexes(options = {}) {
|
|
|
452
461
|
|
|
453
462
|
// ../../node_modules/.pnpm/conventional-commits-parser@6.2.1/node_modules/conventional-commits-parser/dist/utils.js
|
|
454
463
|
var SCISSOR = "------------------------ >8 ------------------------";
|
|
455
|
-
function trimNewLines(
|
|
456
|
-
const matches =
|
|
464
|
+
function trimNewLines(input) {
|
|
465
|
+
const matches = input.match(/[^\r\n]/);
|
|
457
466
|
if (typeof matches?.index !== "number") {
|
|
458
467
|
return "";
|
|
459
468
|
}
|
|
460
469
|
const firstIndex = matches.index;
|
|
461
|
-
let lastIndex =
|
|
462
|
-
while (
|
|
470
|
+
let lastIndex = input.length - 1;
|
|
471
|
+
while (input[lastIndex] === "\r" || input[lastIndex] === "\n") {
|
|
463
472
|
lastIndex--;
|
|
464
473
|
}
|
|
465
|
-
return
|
|
474
|
+
return input.substring(firstIndex, lastIndex + 1);
|
|
466
475
|
}
|
|
467
476
|
function appendLine(src, line) {
|
|
468
477
|
return src ? `${src}
|
|
@@ -552,12 +561,12 @@ var CommitParser = class {
|
|
|
552
561
|
isLineAvailable() {
|
|
553
562
|
return this.lineIndex < this.lines.length;
|
|
554
563
|
}
|
|
555
|
-
parseReference(
|
|
564
|
+
parseReference(input, action) {
|
|
556
565
|
const { regexes } = this;
|
|
557
|
-
if (regexes.url.test(
|
|
566
|
+
if (regexes.url.test(input)) {
|
|
558
567
|
return null;
|
|
559
568
|
}
|
|
560
|
-
const matches = regexes.referenceParts.exec(
|
|
569
|
+
const matches = regexes.referenceParts.exec(input);
|
|
561
570
|
if (!matches) {
|
|
562
571
|
return null;
|
|
563
572
|
}
|
|
@@ -579,16 +588,16 @@ var CommitParser = class {
|
|
|
579
588
|
issue
|
|
580
589
|
};
|
|
581
590
|
}
|
|
582
|
-
parseReferences(
|
|
591
|
+
parseReferences(input) {
|
|
583
592
|
const { regexes } = this;
|
|
584
|
-
const regex =
|
|
593
|
+
const regex = input.match(regexes.references) ? regexes.references : /()(.+)/gi;
|
|
585
594
|
const references = [];
|
|
586
595
|
let matches;
|
|
587
596
|
let action;
|
|
588
597
|
let sentence;
|
|
589
598
|
let reference;
|
|
590
599
|
while (true) {
|
|
591
|
-
matches = regex.exec(
|
|
600
|
+
matches = regex.exec(input);
|
|
592
601
|
if (!matches) {
|
|
593
602
|
break;
|
|
594
603
|
}
|
|
@@ -739,21 +748,21 @@ var CommitParser = class {
|
|
|
739
748
|
});
|
|
740
749
|
}
|
|
741
750
|
}
|
|
742
|
-
parseMentions(
|
|
751
|
+
parseMentions(input) {
|
|
743
752
|
const { commit, regexes } = this;
|
|
744
753
|
let matches;
|
|
745
754
|
for (; ; ) {
|
|
746
|
-
matches = regexes.mentions.exec(
|
|
755
|
+
matches = regexes.mentions.exec(input);
|
|
747
756
|
if (!matches) {
|
|
748
757
|
break;
|
|
749
758
|
}
|
|
750
759
|
commit.mentions.push(matches[1]);
|
|
751
760
|
}
|
|
752
761
|
}
|
|
753
|
-
parseRevert(
|
|
762
|
+
parseRevert(input) {
|
|
754
763
|
const { commit, options } = this;
|
|
755
764
|
const correspondence = options.revertCorrespondence || [];
|
|
756
|
-
const matches = options.revertPattern ?
|
|
765
|
+
const matches = options.revertPattern ? input.match(options.revertPattern) : null;
|
|
757
766
|
if (matches) {
|
|
758
767
|
commit.revert = assignMatchedCorrespondence({}, matches, correspondence);
|
|
759
768
|
}
|
|
@@ -775,13 +784,13 @@ var CommitParser = class {
|
|
|
775
784
|
* @param input - Commit message string.
|
|
776
785
|
* @returns Commit object.
|
|
777
786
|
*/
|
|
778
|
-
parse(
|
|
779
|
-
if (!
|
|
787
|
+
parse(input) {
|
|
788
|
+
if (!input.trim()) {
|
|
780
789
|
throw new TypeError("Expected a raw commit");
|
|
781
790
|
}
|
|
782
791
|
const { commentChar } = this.options;
|
|
783
792
|
const commentFilter = getCommentFilter(commentChar);
|
|
784
|
-
const rawLines = trimNewLines(
|
|
793
|
+
const rawLines = trimNewLines(input).split(/\r?\n/);
|
|
785
794
|
const lines = commentChar ? truncateToScissor(rawLines, commentChar).filter((line) => commentFilter(line) && gpgFilter(line)) : rawLines.filter((line) => gpgFilter(line));
|
|
786
795
|
const commit = createCommitObject();
|
|
787
796
|
this.lines = lines;
|
|
@@ -803,8 +812,8 @@ var CommitParser = class {
|
|
|
803
812
|
}
|
|
804
813
|
}
|
|
805
814
|
this.parseBreakingHeader();
|
|
806
|
-
this.parseMentions(
|
|
807
|
-
this.parseRevert(
|
|
815
|
+
this.parseMentions(input);
|
|
816
|
+
this.parseRevert(input);
|
|
808
817
|
this.cleanupCommit();
|
|
809
818
|
return commit;
|
|
810
819
|
}
|
|
@@ -1331,7 +1340,7 @@ async function askQuestion(index, question) {
|
|
|
1331
1340
|
const message = chalkTemplate`{bold ${index + 1}. ${question.title}} - ${question.description}
|
|
1332
1341
|
`;
|
|
1333
1342
|
if (question.type === "select" && question.enum && Object.keys(question.enum).length > 1) {
|
|
1334
|
-
return
|
|
1343
|
+
return default11({
|
|
1335
1344
|
message,
|
|
1336
1345
|
choices: Object.keys(question.enum).filter((key) => !question.enum?.[key]?.hidden).map((key) => ({
|
|
1337
1346
|
name: question.enum?.[key]?.title || key,
|
|
@@ -1341,7 +1350,7 @@ async function askQuestion(index, question) {
|
|
|
1341
1350
|
default: String(question.defaultValue || "")
|
|
1342
1351
|
});
|
|
1343
1352
|
} else if (question.type === "confirm") {
|
|
1344
|
-
return
|
|
1353
|
+
return default4({
|
|
1345
1354
|
message,
|
|
1346
1355
|
default: Boolean(question.defaultValue)
|
|
1347
1356
|
});
|
|
@@ -1358,7 +1367,7 @@ async function askQuestion(index, question) {
|
|
|
1358
1367
|
return true;
|
|
1359
1368
|
};
|
|
1360
1369
|
}
|
|
1361
|
-
return
|
|
1370
|
+
return default5({
|
|
1362
1371
|
message,
|
|
1363
1372
|
required: !!(question.minLength !== void 0 && question.minLength > 0),
|
|
1364
1373
|
default: String(question.defaultValue || ""),
|
|
@@ -2326,9 +2335,9 @@ var LOWER_CASE_WHEN_NOT_FIRST = [
|
|
|
2326
2335
|
"at",
|
|
2327
2336
|
"by"
|
|
2328
2337
|
];
|
|
2329
|
-
function titleCase(
|
|
2330
|
-
if (!
|
|
2331
|
-
return
|
|
2338
|
+
function titleCase(input) {
|
|
2339
|
+
if (!input) {
|
|
2340
|
+
return input;
|
|
2332
2341
|
}
|
|
2333
2342
|
const formatSegment = (segment) => segment.toLowerCase().split(/[\s\-_]+/).filter(Boolean).map((word, index) => {
|
|
2334
2343
|
if (LOWER_CASE_WHEN_NOT_FIRST.includes(word.toLowerCase()) && index > 0) {
|
|
@@ -2339,7 +2348,7 @@ function titleCase(input2) {
|
|
|
2339
2348
|
}
|
|
2340
2349
|
return `${word ? word.charAt(0).toUpperCase() + word.toLowerCase().slice(1) : word}`;
|
|
2341
2350
|
}).join(" ");
|
|
2342
|
-
return
|
|
2351
|
+
return input.split(/\s+-\s+/).map((part) => formatSegment(part)).join(" - ");
|
|
2343
2352
|
}
|
|
2344
2353
|
|
|
2345
2354
|
// src/utilities/changelog-utils.ts
|