@storm-software/git-tools 2.125.5 → 2.127.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/README.md +2 -1
- package/bin/git.cjs +72 -37
- package/bin/git.cjs.map +1 -1
- package/bin/git.js +88 -53
- package/bin/git.js.map +1 -1
- package/dist/lefthook/recommended.yml +2 -6
- package/dist/types.d.cts +1 -0
- package/dist/types.d.ts +1 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
27
27
|
|
|
28
28
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
29
29
|
|
|
30
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
31
31
|
|
|
32
32
|
<!-- prettier-ignore-start -->
|
|
33
33
|
<!-- markdownlint-disable -->
|
|
@@ -46,6 +46,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
46
46
|
|
|
47
47
|
<!-- START doctoc -->
|
|
48
48
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
49
|
+
|
|
49
50
|
## Table of Contents
|
|
50
51
|
|
|
51
52
|
- [Storm Git Tools](#storm-git-tools)
|
package/bin/git.cjs
CHANGED
|
@@ -36,6 +36,7 @@ var util = require('util');
|
|
|
36
36
|
var wrap = require('word-wrap');
|
|
37
37
|
var Path = require('path');
|
|
38
38
|
var projectGraph_js = require('nx/src/project-graph/project-graph.js');
|
|
39
|
+
var prettier = require('prettier');
|
|
39
40
|
var markdownToAst = require('@textlint/markdown-to-ast');
|
|
40
41
|
var anchor = require('anchor-markdown-header');
|
|
41
42
|
var htmlparser2 = require('htmlparser2');
|
|
@@ -50,7 +51,6 @@ var chalk = require('chalk');
|
|
|
50
51
|
var printChanges = require('nx/src/command-line/release/utils/print-changes');
|
|
51
52
|
var shared = require('nx/src/command-line/release/utils/shared');
|
|
52
53
|
var utils = require('nx/src/tasks-runner/utils');
|
|
53
|
-
var prettier = require('prettier');
|
|
54
54
|
var execCommand_js = require('nx/src/command-line/release/utils/exec-command.js');
|
|
55
55
|
var git = require('nx/src/command-line/release/utils/git');
|
|
56
56
|
var semver = require('semver');
|
|
@@ -1300,11 +1300,11 @@ var formatCommitMessage = (state, workspaceConfig) => {
|
|
|
1300
1300
|
const scope = workspaceConfig.variant !== "minimal" && typeof answers.scope === "string" && answers.scope ? answers.scope.trim() : "";
|
|
1301
1301
|
const subject = answers.subject?.trim();
|
|
1302
1302
|
const type = answers.type;
|
|
1303
|
-
const
|
|
1303
|
+
const format3 = config5.settings.format || (workspaceConfig.variant !== "minimal" ? "{type}({scope}): {emoji}{subject}" : "{type}: {emoji}{subject}");
|
|
1304
1304
|
const body = answers.body && typeof answers.body === "string" ? wrap__default.default(answers.body || "", wrapOptions) : "";
|
|
1305
1305
|
const breaking = answers.breakingBody && typeof answers.breakingBody === "string" ? wrap__default.default(answers.breakingBody || "", wrapOptions) : "";
|
|
1306
1306
|
const issues = answers.issuesBody && typeof answers.issuesBody === "string" ? wrap__default.default(answers.issuesBody || "", wrapOptions) : "";
|
|
1307
|
-
const head =
|
|
1307
|
+
const head = format3.replace(/\{emoji\}/g, config5.settings.disableEmoji ? "" : `${emoji} `).replace(/\{scope\}/g, scope).replace(/\{subject\}/g, subject || "").replace(/\{type\}/g, type || "");
|
|
1308
1308
|
let msg = head;
|
|
1309
1309
|
if (body) {
|
|
1310
1310
|
msg += `
|
|
@@ -1617,45 +1617,53 @@ async function transformAndSave(files, mode = "github.com", maxHeaderLevel = 3,
|
|
|
1617
1617
|
"--update-only flag is enabled. Only updating files that already have a TOC."
|
|
1618
1618
|
);
|
|
1619
1619
|
}
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1620
|
+
return Promise.all(
|
|
1621
|
+
files.map((x) => {
|
|
1622
|
+
const result = transform(
|
|
1623
|
+
fs$1.readFileSync(x.path, "utf8"),
|
|
1624
|
+
mode,
|
|
1625
|
+
maxHeaderLevel,
|
|
1626
|
+
title,
|
|
1627
|
+
noTitle,
|
|
1628
|
+
entryPrefix,
|
|
1629
|
+
processAll,
|
|
1630
|
+
updateOnly
|
|
1631
|
+
);
|
|
1632
|
+
result.path = x.path;
|
|
1633
|
+
return result;
|
|
1634
|
+
}).filter((file) => file.transformed).map(async (file) => {
|
|
1635
|
+
console.log('Writting changes to "%s"', file.path);
|
|
1636
|
+
const prettierConfig = await prettier.resolveConfig(file.path, {
|
|
1637
|
+
useCache: true,
|
|
1638
|
+
editorconfig: true
|
|
1639
|
+
});
|
|
1640
|
+
return fs.writeFile(
|
|
1641
|
+
file.path,
|
|
1642
|
+
await prettier.format(
|
|
1643
|
+
file.data,
|
|
1644
|
+
prettierConfig ? { ...prettierConfig, parser: "markdown" } : { parser: "markdown" }
|
|
1645
|
+
),
|
|
1646
|
+
"utf8"
|
|
1647
|
+
);
|
|
1648
|
+
})
|
|
1649
|
+
);
|
|
1646
1650
|
}
|
|
1647
1651
|
var doctoc = (directory, mode = "github.com", maxHeaderLevel = 3, title = "## Table of Contents", noTitle = false, entryPrefix = void 0, processAll = false, updateOnly = false) => {
|
|
1648
1652
|
let files = [];
|
|
1649
1653
|
const stat = fs$1.statSync(directory);
|
|
1650
1654
|
if (stat.isDirectory()) {
|
|
1651
1655
|
console.log(
|
|
1652
|
-
'\
|
|
1656
|
+
'\nCreating Table of Contents for "%s" and its sub directories for %s.',
|
|
1653
1657
|
directory,
|
|
1654
1658
|
mode
|
|
1655
1659
|
);
|
|
1656
1660
|
files = findMarkdownFiles(directory);
|
|
1657
1661
|
} else {
|
|
1658
|
-
console.log(
|
|
1662
|
+
console.log(
|
|
1663
|
+
'\nCreating Table of Contents for single file "%s" for %s.',
|
|
1664
|
+
directory,
|
|
1665
|
+
mode
|
|
1666
|
+
);
|
|
1659
1667
|
files = [{ path: directory }];
|
|
1660
1668
|
}
|
|
1661
1669
|
transformAndSave(
|
|
@@ -1668,7 +1676,10 @@ var doctoc = (directory, mode = "github.com", maxHeaderLevel = 3, title = "## Ta
|
|
|
1668
1676
|
processAll,
|
|
1669
1677
|
updateOnly
|
|
1670
1678
|
);
|
|
1671
|
-
console.log(
|
|
1679
|
+
console.log(
|
|
1680
|
+
"\nCompleted generating Table of Contents for %s file(s).",
|
|
1681
|
+
files.length
|
|
1682
|
+
);
|
|
1672
1683
|
};
|
|
1673
1684
|
var markdownExts = [".md", ".markdown"];
|
|
1674
1685
|
var ignoredDirs = [".", "..", ".git", "node_modules"];
|
|
@@ -1999,14 +2010,38 @@ var runReadme = async ({
|
|
|
1999
2010
|
project,
|
|
2000
2011
|
output: output3,
|
|
2001
2012
|
clean = true,
|
|
2002
|
-
prettier = true
|
|
2013
|
+
prettier = true,
|
|
2014
|
+
workspace = false
|
|
2003
2015
|
}) => {
|
|
2004
2016
|
const projectGraph = await projectGraph_js.createProjectGraphAsync({
|
|
2005
2017
|
exitOnError: true
|
|
2006
2018
|
});
|
|
2007
2019
|
const projectConfigs = projectGraph_js.readProjectsConfigurationFromProjectGraph(projectGraph);
|
|
2008
|
-
|
|
2009
|
-
|
|
2020
|
+
const workspaceRoot = chunkDFXXNV3C_cjs.findWorkspaceRootSafe(process.cwd());
|
|
2021
|
+
if (!workspaceRoot) {
|
|
2022
|
+
throw new Error(
|
|
2023
|
+
"Unable to find the workspace root. Please ensure you are running this command from within a workspace."
|
|
2024
|
+
);
|
|
2025
|
+
}
|
|
2026
|
+
let resolvedProject = project;
|
|
2027
|
+
if (workspace) {
|
|
2028
|
+
if (!fs$1.existsSync(Path.join(workspaceRoot, "project.json"))) {
|
|
2029
|
+
throw new Error(
|
|
2030
|
+
`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.`
|
|
2031
|
+
);
|
|
2032
|
+
}
|
|
2033
|
+
const projectJson = JSON.parse(
|
|
2034
|
+
fs$1.readFileSync(Path.join(workspaceRoot, "project.json"), "utf8") ?? "{}"
|
|
2035
|
+
);
|
|
2036
|
+
if (!projectJson?.name) {
|
|
2037
|
+
throw new Error(
|
|
2038
|
+
`The \`workspace\` flag was provided to the \`storm-git readme\` command-line interface, but a name field could not be found in the project.json file at the workspace root (${workspaceRoot}). Please ensure the project.json file at the workspace root contains a name field.`
|
|
2039
|
+
);
|
|
2040
|
+
}
|
|
2041
|
+
resolvedProject = projectJson.name;
|
|
2042
|
+
}
|
|
2043
|
+
if (resolvedProject) {
|
|
2044
|
+
await runProjectReadme(resolvedProject, {
|
|
2010
2045
|
templates,
|
|
2011
2046
|
output: output3,
|
|
2012
2047
|
clean,
|
|
@@ -3900,8 +3935,8 @@ function createProgram(config5) {
|
|
|
3900
3935
|
"./tools/readme-templates"
|
|
3901
3936
|
).option(
|
|
3902
3937
|
"--project <project>",
|
|
3903
|
-
"The specific project to generate a README.md file for"
|
|
3904
|
-
).option("--output <path>", "Where to output the generated README.md file").option(
|
|
3938
|
+
"The specific project to generate a README.md file for. Defaults to the workspace root README.md if not provided."
|
|
3939
|
+
).option("--workspace", "Run for the workspace root's README.md file").option("--output <path>", "Where to output the generated README.md file").option(
|
|
3905
3940
|
"--clean",
|
|
3906
3941
|
"Should the output README.md file be cleaned before generation",
|
|
3907
3942
|
true
|