@storm-software/git-tools 2.124.24 → 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/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
21
21
|
|
|
22
22
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
23
23
|
|
|
24
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
package/bin/git.cjs
CHANGED
|
@@ -6,7 +6,16 @@ var chunkFH5OSXAJ_cjs = require('./chunk-FH5OSXAJ.cjs');
|
|
|
6
6
|
var chunkF65GQVIX_cjs = require('./chunk-F65GQVIX.cjs');
|
|
7
7
|
var TOML = require('@ltd/j-toml');
|
|
8
8
|
var commander = require('commander');
|
|
9
|
-
|
|
9
|
+
require('@inquirer/checkbox');
|
|
10
|
+
require('@inquirer/editor');
|
|
11
|
+
var default4 = require('@inquirer/confirm');
|
|
12
|
+
var default5 = require('@inquirer/input');
|
|
13
|
+
require('@inquirer/number');
|
|
14
|
+
require('@inquirer/expand');
|
|
15
|
+
require('@inquirer/rawlist');
|
|
16
|
+
require('@inquirer/password');
|
|
17
|
+
require('@inquirer/search');
|
|
18
|
+
var default11 = require('@inquirer/select');
|
|
10
19
|
var shellescape = require('any-shell-escape');
|
|
11
20
|
var chalkTemplate = require('chalk-template');
|
|
12
21
|
var fs = require('fs/promises');
|
|
@@ -48,6 +57,9 @@ var conventionalCommits = require('nx/src/command-line/release/config/convention
|
|
|
48
57
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
49
58
|
|
|
50
59
|
var TOML__default = /*#__PURE__*/_interopDefault(TOML);
|
|
60
|
+
var default4__default = /*#__PURE__*/_interopDefault(default4);
|
|
61
|
+
var default5__default = /*#__PURE__*/_interopDefault(default5);
|
|
62
|
+
var default11__default = /*#__PURE__*/_interopDefault(default11);
|
|
51
63
|
var shellescape__default = /*#__PURE__*/_interopDefault(shellescape);
|
|
52
64
|
var chalkTemplate__default = /*#__PURE__*/_interopDefault(chalkTemplate);
|
|
53
65
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
@@ -471,17 +483,17 @@ function getParserRegexes(options = {}) {
|
|
|
471
483
|
|
|
472
484
|
// ../../node_modules/.pnpm/conventional-commits-parser@6.2.1/node_modules/conventional-commits-parser/dist/utils.js
|
|
473
485
|
var SCISSOR = "------------------------ >8 ------------------------";
|
|
474
|
-
function trimNewLines(
|
|
475
|
-
const matches =
|
|
486
|
+
function trimNewLines(input) {
|
|
487
|
+
const matches = input.match(/[^\r\n]/);
|
|
476
488
|
if (typeof matches?.index !== "number") {
|
|
477
489
|
return "";
|
|
478
490
|
}
|
|
479
491
|
const firstIndex = matches.index;
|
|
480
|
-
let lastIndex =
|
|
481
|
-
while (
|
|
492
|
+
let lastIndex = input.length - 1;
|
|
493
|
+
while (input[lastIndex] === "\r" || input[lastIndex] === "\n") {
|
|
482
494
|
lastIndex--;
|
|
483
495
|
}
|
|
484
|
-
return
|
|
496
|
+
return input.substring(firstIndex, lastIndex + 1);
|
|
485
497
|
}
|
|
486
498
|
function appendLine(src, line) {
|
|
487
499
|
return src ? `${src}
|
|
@@ -571,12 +583,12 @@ var CommitParser = class {
|
|
|
571
583
|
isLineAvailable() {
|
|
572
584
|
return this.lineIndex < this.lines.length;
|
|
573
585
|
}
|
|
574
|
-
parseReference(
|
|
586
|
+
parseReference(input, action) {
|
|
575
587
|
const { regexes } = this;
|
|
576
|
-
if (regexes.url.test(
|
|
588
|
+
if (regexes.url.test(input)) {
|
|
577
589
|
return null;
|
|
578
590
|
}
|
|
579
|
-
const matches = regexes.referenceParts.exec(
|
|
591
|
+
const matches = regexes.referenceParts.exec(input);
|
|
580
592
|
if (!matches) {
|
|
581
593
|
return null;
|
|
582
594
|
}
|
|
@@ -598,16 +610,16 @@ var CommitParser = class {
|
|
|
598
610
|
issue
|
|
599
611
|
};
|
|
600
612
|
}
|
|
601
|
-
parseReferences(
|
|
613
|
+
parseReferences(input) {
|
|
602
614
|
const { regexes } = this;
|
|
603
|
-
const regex =
|
|
615
|
+
const regex = input.match(regexes.references) ? regexes.references : /()(.+)/gi;
|
|
604
616
|
const references = [];
|
|
605
617
|
let matches;
|
|
606
618
|
let action;
|
|
607
619
|
let sentence;
|
|
608
620
|
let reference;
|
|
609
621
|
while (true) {
|
|
610
|
-
matches = regex.exec(
|
|
622
|
+
matches = regex.exec(input);
|
|
611
623
|
if (!matches) {
|
|
612
624
|
break;
|
|
613
625
|
}
|
|
@@ -758,21 +770,21 @@ var CommitParser = class {
|
|
|
758
770
|
});
|
|
759
771
|
}
|
|
760
772
|
}
|
|
761
|
-
parseMentions(
|
|
773
|
+
parseMentions(input) {
|
|
762
774
|
const { commit, regexes } = this;
|
|
763
775
|
let matches;
|
|
764
776
|
for (; ; ) {
|
|
765
|
-
matches = regexes.mentions.exec(
|
|
777
|
+
matches = regexes.mentions.exec(input);
|
|
766
778
|
if (!matches) {
|
|
767
779
|
break;
|
|
768
780
|
}
|
|
769
781
|
commit.mentions.push(matches[1]);
|
|
770
782
|
}
|
|
771
783
|
}
|
|
772
|
-
parseRevert(
|
|
784
|
+
parseRevert(input) {
|
|
773
785
|
const { commit, options } = this;
|
|
774
786
|
const correspondence = options.revertCorrespondence || [];
|
|
775
|
-
const matches = options.revertPattern ?
|
|
787
|
+
const matches = options.revertPattern ? input.match(options.revertPattern) : null;
|
|
776
788
|
if (matches) {
|
|
777
789
|
commit.revert = assignMatchedCorrespondence({}, matches, correspondence);
|
|
778
790
|
}
|
|
@@ -794,13 +806,13 @@ var CommitParser = class {
|
|
|
794
806
|
* @param input - Commit message string.
|
|
795
807
|
* @returns Commit object.
|
|
796
808
|
*/
|
|
797
|
-
parse(
|
|
798
|
-
if (!
|
|
809
|
+
parse(input) {
|
|
810
|
+
if (!input.trim()) {
|
|
799
811
|
throw new TypeError("Expected a raw commit");
|
|
800
812
|
}
|
|
801
813
|
const { commentChar } = this.options;
|
|
802
814
|
const commentFilter = getCommentFilter(commentChar);
|
|
803
|
-
const rawLines = trimNewLines(
|
|
815
|
+
const rawLines = trimNewLines(input).split(/\r?\n/);
|
|
804
816
|
const lines = commentChar ? truncateToScissor(rawLines, commentChar).filter((line) => commentFilter(line) && gpgFilter(line)) : rawLines.filter((line) => gpgFilter(line));
|
|
805
817
|
const commit = createCommitObject();
|
|
806
818
|
this.lines = lines;
|
|
@@ -822,8 +834,8 @@ var CommitParser = class {
|
|
|
822
834
|
}
|
|
823
835
|
}
|
|
824
836
|
this.parseBreakingHeader();
|
|
825
|
-
this.parseMentions(
|
|
826
|
-
this.parseRevert(
|
|
837
|
+
this.parseMentions(input);
|
|
838
|
+
this.parseRevert(input);
|
|
827
839
|
this.cleanupCommit();
|
|
828
840
|
return commit;
|
|
829
841
|
}
|
|
@@ -1350,7 +1362,7 @@ async function askQuestion(index, question) {
|
|
|
1350
1362
|
const message = chalkTemplate__default.default`{bold ${index + 1}. ${question.title}} - ${question.description}
|
|
1351
1363
|
`;
|
|
1352
1364
|
if (question.type === "select" && question.enum && Object.keys(question.enum).length > 1) {
|
|
1353
|
-
return
|
|
1365
|
+
return default11__default.default({
|
|
1354
1366
|
message,
|
|
1355
1367
|
choices: Object.keys(question.enum).filter((key) => !question.enum?.[key]?.hidden).map((key) => ({
|
|
1356
1368
|
name: question.enum?.[key]?.title || key,
|
|
@@ -1360,7 +1372,7 @@ async function askQuestion(index, question) {
|
|
|
1360
1372
|
default: String(question.defaultValue || "")
|
|
1361
1373
|
});
|
|
1362
1374
|
} else if (question.type === "confirm") {
|
|
1363
|
-
return
|
|
1375
|
+
return default4__default.default({
|
|
1364
1376
|
message,
|
|
1365
1377
|
default: Boolean(question.defaultValue)
|
|
1366
1378
|
});
|
|
@@ -1377,7 +1389,7 @@ async function askQuestion(index, question) {
|
|
|
1377
1389
|
return true;
|
|
1378
1390
|
};
|
|
1379
1391
|
}
|
|
1380
|
-
return
|
|
1392
|
+
return default5__default.default({
|
|
1381
1393
|
message,
|
|
1382
1394
|
required: !!(question.minLength !== void 0 && question.minLength > 0),
|
|
1383
1395
|
default: String(question.defaultValue || ""),
|
|
@@ -2345,9 +2357,9 @@ var LOWER_CASE_WHEN_NOT_FIRST = [
|
|
|
2345
2357
|
"at",
|
|
2346
2358
|
"by"
|
|
2347
2359
|
];
|
|
2348
|
-
function titleCase(
|
|
2349
|
-
if (!
|
|
2350
|
-
return
|
|
2360
|
+
function titleCase(input) {
|
|
2361
|
+
if (!input) {
|
|
2362
|
+
return input;
|
|
2351
2363
|
}
|
|
2352
2364
|
const formatSegment = (segment) => segment.toLowerCase().split(/[\s\-_]+/).filter(Boolean).map((word, index) => {
|
|
2353
2365
|
if (LOWER_CASE_WHEN_NOT_FIRST.includes(word.toLowerCase()) && index > 0) {
|
|
@@ -2358,7 +2370,7 @@ function titleCase(input2) {
|
|
|
2358
2370
|
}
|
|
2359
2371
|
return `${word ? word.charAt(0).toUpperCase() + word.toLowerCase().slice(1) : word}`;
|
|
2360
2372
|
}).join(" ");
|
|
2361
|
-
return
|
|
2373
|
+
return input.split(/\s+-\s+/).map((part) => formatSegment(part)).join(" - ");
|
|
2362
2374
|
}
|
|
2363
2375
|
|
|
2364
2376
|
// src/utilities/changelog-utils.ts
|