@storm-software/git-tools 2.130.19 → 2.130.20
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 +9 -9
- package/bin/git.cjs.map +1 -1
- package/bin/git.js +21 -21
- package/bin/git.js.map +1 -1
- package/package.json +7 -7
package/bin/git.js
CHANGED
|
@@ -34,7 +34,7 @@ import 'stream';
|
|
|
34
34
|
import util from 'node:util';
|
|
35
35
|
import { existsSync, readFileSync, rmSync, readdirSync, writeFileSync, statSync, promises } from 'node:fs';
|
|
36
36
|
import wrap from 'word-wrap';
|
|
37
|
-
import Path, { join
|
|
37
|
+
import Path, { join, extname } from 'node:path';
|
|
38
38
|
import { createProjectGraphAsync, readProjectsConfigurationFromProjectGraph } from 'nx/src/project-graph/project-graph.js';
|
|
39
39
|
import { resolveConfig, format } from 'prettier';
|
|
40
40
|
import { parse as parse$1, Syntax } from '@textlint/markdown-to-ast';
|
|
@@ -424,19 +424,19 @@ async function createPreset(variant = "monorepo") {
|
|
|
424
424
|
);
|
|
425
425
|
}
|
|
426
426
|
|
|
427
|
-
// ../../node_modules/.pnpm/conventional-commits-parser@6.
|
|
427
|
+
// ../../node_modules/.pnpm/conventional-commits-parser@6.4.0/node_modules/conventional-commits-parser/dist/regex.js
|
|
428
428
|
var nomatchRegex = /(?!.*)/;
|
|
429
429
|
function escape(string) {
|
|
430
430
|
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
431
431
|
}
|
|
432
|
-
function
|
|
433
|
-
return parts.map((val) => escape(val.trim())).filter(Boolean).join(
|
|
432
|
+
function joinOr(parts) {
|
|
433
|
+
return parts.map((val) => typeof val === "string" ? escape(val.trim()) : val.source).filter(Boolean).join("|");
|
|
434
434
|
}
|
|
435
435
|
function getNotesRegex(noteKeywords, notesPattern) {
|
|
436
436
|
if (!noteKeywords) {
|
|
437
437
|
return nomatchRegex;
|
|
438
438
|
}
|
|
439
|
-
const noteKeywordsSelection =
|
|
439
|
+
const noteKeywordsSelection = joinOr(noteKeywords);
|
|
440
440
|
if (!notesPattern) {
|
|
441
441
|
return new RegExp(`^[\\s|*]*(${noteKeywordsSelection})[:\\s]+(.*)`, "i");
|
|
442
442
|
}
|
|
@@ -447,13 +447,13 @@ function getReferencePartsRegex(issuePrefixes, issuePrefixesCaseSensitive) {
|
|
|
447
447
|
return nomatchRegex;
|
|
448
448
|
}
|
|
449
449
|
const flags = issuePrefixesCaseSensitive ? "g" : "gi";
|
|
450
|
-
return new RegExp(`(?:.*?)??\\s*([\\w-\\.\\/]*?)??(${
|
|
450
|
+
return new RegExp(`(?:.*?)??\\s*([\\w-\\.\\/]*?)??(${joinOr(issuePrefixes)})([\\w-]+)(?=\\s|$|[,;)\\]])`, flags);
|
|
451
451
|
}
|
|
452
452
|
function getReferencesRegex(referenceActions) {
|
|
453
453
|
if (!referenceActions) {
|
|
454
454
|
return /()(.+)/gi;
|
|
455
455
|
}
|
|
456
|
-
const joinedKeywords =
|
|
456
|
+
const joinedKeywords = joinOr(referenceActions);
|
|
457
457
|
return new RegExp(`(${joinedKeywords})(?:\\s+(.*?))(?=(?:${joinedKeywords})|$)`, "gi");
|
|
458
458
|
}
|
|
459
459
|
function getParserRegexes(options = {}) {
|
|
@@ -469,7 +469,7 @@ function getParserRegexes(options = {}) {
|
|
|
469
469
|
};
|
|
470
470
|
}
|
|
471
471
|
|
|
472
|
-
// ../../node_modules/.pnpm/conventional-commits-parser@6.
|
|
472
|
+
// ../../node_modules/.pnpm/conventional-commits-parser@6.4.0/node_modules/conventional-commits-parser/dist/utils.js
|
|
473
473
|
var SCISSOR = "------------------------ >8 ------------------------";
|
|
474
474
|
function trimNewLines(input) {
|
|
475
475
|
const matches = input.match(/[^\r\n]/);
|
|
@@ -509,7 +509,7 @@ function assignMatchedCorrespondence(target, matches, correspondence) {
|
|
|
509
509
|
return target;
|
|
510
510
|
}
|
|
511
511
|
|
|
512
|
-
// ../../node_modules/.pnpm/conventional-commits-parser@6.
|
|
512
|
+
// ../../node_modules/.pnpm/conventional-commits-parser@6.4.0/node_modules/conventional-commits-parser/dist/options.js
|
|
513
513
|
var defaultOptions = {
|
|
514
514
|
noteKeywords: ["BREAKING CHANGE", "BREAKING-CHANGE"],
|
|
515
515
|
issuePrefixes: ["#"],
|
|
@@ -535,7 +535,7 @@ var defaultOptions = {
|
|
|
535
535
|
fieldPattern: /^-(.*?)-$/
|
|
536
536
|
};
|
|
537
537
|
|
|
538
|
-
// ../../node_modules/.pnpm/conventional-commits-parser@6.
|
|
538
|
+
// ../../node_modules/.pnpm/conventional-commits-parser@6.4.0/node_modules/conventional-commits-parser/dist/CommitParser.js
|
|
539
539
|
function createCommitObject(initialData = {}) {
|
|
540
540
|
return {
|
|
541
541
|
merge: null,
|
|
@@ -1675,7 +1675,7 @@ function separateFilesAndDirs(fileInfos) {
|
|
|
1675
1675
|
}
|
|
1676
1676
|
function findMarkdownFiles(currentPath) {
|
|
1677
1677
|
function getFileInfo(entry) {
|
|
1678
|
-
const target = join
|
|
1678
|
+
const target = join(currentPath, entry);
|
|
1679
1679
|
return {
|
|
1680
1680
|
name: entry,
|
|
1681
1681
|
path: target
|
|
@@ -1714,7 +1714,7 @@ var getExecutorMarkdown = (_packageName, executorsJsonFile, executorsJson) => {
|
|
|
1714
1714
|
let description = "";
|
|
1715
1715
|
let required = [];
|
|
1716
1716
|
if (executor.schema) {
|
|
1717
|
-
const schemaJsonPath = join
|
|
1717
|
+
const schemaJsonPath = join(
|
|
1718
1718
|
findFilePath(executorsJsonFile),
|
|
1719
1719
|
executor.schema
|
|
1720
1720
|
);
|
|
@@ -1812,7 +1812,7 @@ var getGeneratorMarkdown = (packageName, generatorsJsonFile, generatorsJson) =>
|
|
|
1812
1812
|
let example = "";
|
|
1813
1813
|
const required = [];
|
|
1814
1814
|
if (generator.schema) {
|
|
1815
|
-
const schemaJsonPath = join
|
|
1815
|
+
const schemaJsonPath = join(
|
|
1816
1816
|
findFilePath(generatorsJsonFile),
|
|
1817
1817
|
generator.schema
|
|
1818
1818
|
);
|
|
@@ -2003,13 +2003,13 @@ var runReadme = async ({
|
|
|
2003
2003
|
}
|
|
2004
2004
|
let resolvedProject = project;
|
|
2005
2005
|
if (workspace) {
|
|
2006
|
-
if (!existsSync(join
|
|
2006
|
+
if (!existsSync(join(workspaceRoot, "project.json"))) {
|
|
2007
2007
|
throw new Error(
|
|
2008
2008
|
`The \`workspace\` flag was provided to the \`storm-git readme\` command-line interface, but a project.json file could not be found at the workspace root (${workspaceRoot}). Please ensure you are running this command from the root of your workspace.`
|
|
2009
2009
|
);
|
|
2010
2010
|
}
|
|
2011
2011
|
const projectJson = JSON.parse(
|
|
2012
|
-
readFileSync(join
|
|
2012
|
+
readFileSync(join(workspaceRoot, "project.json"), "utf8") ?? "{}"
|
|
2013
2013
|
);
|
|
2014
2014
|
if (!projectJson?.name) {
|
|
2015
2015
|
throw new Error(
|
|
@@ -2042,10 +2042,10 @@ var runProjectReadme = async (projectName, { templates, output: output3, clean =
|
|
|
2042
2042
|
});
|
|
2043
2043
|
const projectConfigs = readProjectsConfigurationFromProjectGraph(projectGraph);
|
|
2044
2044
|
const project = projectConfigs.projects[projectName];
|
|
2045
|
-
const inputFile = join
|
|
2045
|
+
const inputFile = join(project?.root ?? "./", "README.md");
|
|
2046
2046
|
if (existsSync(inputFile)) {
|
|
2047
2047
|
console.info(`Formatting ${projectName}'s README file at "${inputFile}"`);
|
|
2048
|
-
const outputFilePath = output3 ? output3.includes("README.md") ? output3 : join
|
|
2048
|
+
const outputFilePath = output3 ? output3.includes("README.md") ? output3 : join(findFilePath(output3), "README.md") : inputFile;
|
|
2049
2049
|
if (clean && existsSync(outputFilePath)) {
|
|
2050
2050
|
if (outputFilePath === inputFile) {
|
|
2051
2051
|
console.warn(
|
|
@@ -2061,7 +2061,7 @@ var runProjectReadme = async (projectName, { templates, output: output3, clean =
|
|
|
2061
2061
|
let newContent = readdirSync(templates).reduce(
|
|
2062
2062
|
(ret, fileName) => {
|
|
2063
2063
|
console.info(`Using template "${fileName}" to format file...`);
|
|
2064
|
-
const templateFilePath = join
|
|
2064
|
+
const templateFilePath = join(templates, fileName);
|
|
2065
2065
|
const templateContent = readFileSync(templateFilePath, "utf8");
|
|
2066
2066
|
const section = findFileName(templateFilePath).replace(templates, "").replace("README.", "").replace(".md", "");
|
|
2067
2067
|
return formatReadMeFromSectionName(section, templateContent, ret);
|
|
@@ -2069,7 +2069,7 @@ var runProjectReadme = async (projectName, { templates, output: output3, clean =
|
|
|
2069
2069
|
readFileSync(inputFile, "utf8")
|
|
2070
2070
|
);
|
|
2071
2071
|
let packageName = projectName;
|
|
2072
|
-
const packageJsonPath = join
|
|
2072
|
+
const packageJsonPath = join(findFilePath(inputFile), "package.json");
|
|
2073
2073
|
if (existsSync(packageJsonPath)) {
|
|
2074
2074
|
const packageJson = JSON.parse(
|
|
2075
2075
|
readFileSync(packageJsonPath, "utf8") ?? "{}"
|
|
@@ -2086,7 +2086,7 @@ var runProjectReadme = async (projectName, { templates, output: output3, clean =
|
|
|
2086
2086
|
}
|
|
2087
2087
|
}
|
|
2088
2088
|
if (newContent.includes("<!-- START executors -->")) {
|
|
2089
|
-
const executorsJsonPath = join
|
|
2089
|
+
const executorsJsonPath = join(findFilePath(inputFile), "executors.json");
|
|
2090
2090
|
if (existsSync(executorsJsonPath)) {
|
|
2091
2091
|
const executorsJson = JSON.parse(
|
|
2092
2092
|
readFileSync(executorsJsonPath, "utf8") ?? "{}"
|
|
@@ -2102,7 +2102,7 @@ var runProjectReadme = async (projectName, { templates, output: output3, clean =
|
|
|
2102
2102
|
}
|
|
2103
2103
|
}
|
|
2104
2104
|
if (newContent.includes("<!-- START generators -->")) {
|
|
2105
|
-
const generatorsJsonPath = join
|
|
2105
|
+
const generatorsJsonPath = join(
|
|
2106
2106
|
findFilePath(inputFile),
|
|
2107
2107
|
"generators.json"
|
|
2108
2108
|
);
|