@storm-software/git-tools 2.111.11 → 2.111.13
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 +142 -117
- package/bin/git.js +90 -65
- package/dist/commitlint/config.cjs +1 -1
- package/dist/commitlint/config.js +1 -1
- package/package.json +1 -1
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
|
@@ -69131,7 +69131,7 @@ var DEFAULT_COMMIT_RULES = {
|
|
|
69131
69131
|
};
|
|
69132
69132
|
var DEFAULT_COMMITLINT_CONFIG = {
|
|
69133
69133
|
rules: DEFAULT_COMMIT_RULES,
|
|
69134
|
-
helpUrl: "https://stormsoftware.com/
|
|
69134
|
+
helpUrl: "https://developer.stormsoftware.com/commitlint",
|
|
69135
69135
|
parserOpts: {
|
|
69136
69136
|
headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/,
|
|
69137
69137
|
breakingHeaderPattern: /^(\w*)(?:\((.*)\))?!: (.*)$/,
|
|
@@ -70418,10 +70418,7 @@ _chunkDG64PTNNcjs.init_cjs_shims.call(void 0, );
|
|
|
70418
70418
|
|
|
70419
70419
|
|
|
70420
70420
|
var _projectgraph = require('nx/src/project-graph/project-graph');
|
|
70421
|
-
async function getNxScopes(context
|
|
70422
|
-
const ctx = context || {};
|
|
70423
|
-
const workspaceRoot2 = process.env.NX_WORKSPACE_ROOT_PATH || process.env.STORM_WORKSPACE_ROOT || ctx.cwd || process.cwd();
|
|
70424
|
-
process.env.NX_WORKSPACE_ROOT_PATH ??= workspaceRoot2;
|
|
70421
|
+
async function getNxScopes(context) {
|
|
70425
70422
|
let projectGraph;
|
|
70426
70423
|
try {
|
|
70427
70424
|
projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
|
|
@@ -70438,18 +70435,20 @@ async function getNxScopes(context, selector = (params) => true) {
|
|
|
70438
70435
|
const result2 = Object.entries(projectConfigs.projects || {}).map(([name, project]) => ({
|
|
70439
70436
|
name,
|
|
70440
70437
|
...project
|
|
70441
|
-
})).filter(
|
|
70438
|
+
})).filter(
|
|
70439
|
+
(project) => project.name && project.root && project.root !== "." && project.root !== context.config.workspaceRoot && !project.name.includes("e2e")
|
|
70440
|
+
).filter((project) => project.targets).map((project) => project.name).filter(Boolean).sort((a, b) => a.localeCompare(b));
|
|
70442
70441
|
result2.unshift("monorepo");
|
|
70443
70442
|
return result2;
|
|
70444
70443
|
}
|
|
70445
|
-
|
|
70446
|
-
return
|
|
70447
|
-
|
|
70448
|
-
|
|
70449
|
-
);
|
|
70450
|
-
}
|
|
70451
|
-
|
|
70452
|
-
if (!_optionalChain([scopeEnum2, 'optionalAccess',
|
|
70444
|
+
function getScopeEnumUtil(context) {
|
|
70445
|
+
return () => getScopeEnum(context);
|
|
70446
|
+
}
|
|
70447
|
+
function getScopeEnum(context) {
|
|
70448
|
+
return getNxScopes(context);
|
|
70449
|
+
}
|
|
70450
|
+
function getRuleFromScopeEnum(scopeEnum2) {
|
|
70451
|
+
if (!_optionalChain([scopeEnum2, 'optionalAccess', _79 => _79.filter, 'call', _80 => _80(Boolean), 'access', _81 => _81.length])) {
|
|
70453
70452
|
throw new Error("No scopes found in the Storm workspace.");
|
|
70454
70453
|
}
|
|
70455
70454
|
return [
|
|
@@ -70457,7 +70456,7 @@ var getRuleFromScopeEnum = (scopeEnum2) => {
|
|
|
70457
70456
|
"always",
|
|
70458
70457
|
scopeEnum2.filter(Boolean)
|
|
70459
70458
|
];
|
|
70460
|
-
}
|
|
70459
|
+
}
|
|
70461
70460
|
|
|
70462
70461
|
// src/commitlint/run.ts
|
|
70463
70462
|
var COMMIT_EDITMSG_PATH = ".git/COMMIT_EDITMSG";
|
|
@@ -70475,7 +70474,7 @@ var runCommitLint = async (config, params) => {
|
|
|
70475
70474
|
params.file || params.message || COMMIT_EDITMSG_PATH
|
|
70476
70475
|
);
|
|
70477
70476
|
if (_fs.existsSync.call(void 0, commitFile)) {
|
|
70478
|
-
commitMessage = await _asyncOptionalChain([(await _promises.readFile.call(void 0, commitFile, "utf8")), 'optionalAccess', async
|
|
70477
|
+
commitMessage = await _asyncOptionalChain([(await _promises.readFile.call(void 0, commitFile, "utf8")), 'optionalAccess', async _82 => _82.trim, 'call', async _83 => _83()]);
|
|
70479
70478
|
}
|
|
70480
70479
|
}
|
|
70481
70480
|
if (!commitMessage) {
|
|
@@ -70485,7 +70484,7 @@ var runCommitLint = async (config, params) => {
|
|
|
70485
70484
|
(remote) => remote.includes(`${config.name}.git`)
|
|
70486
70485
|
);
|
|
70487
70486
|
if (upstreamRemote) {
|
|
70488
|
-
const upstreamRemoteIdentifier = _optionalChain([upstreamRemote, 'access',
|
|
70487
|
+
const upstreamRemoteIdentifier = _optionalChain([upstreamRemote, 'access', _84 => _84.split, 'call', _85 => _85(" "), 'access', _86 => _86[0], 'optionalAccess', _87 => _87.trim, 'call', _88 => _88()]);
|
|
70489
70488
|
if (!upstreamRemoteIdentifier) {
|
|
70490
70489
|
_chunkSN4DGQCWcjs.writeWarning.call(void 0,
|
|
70491
70490
|
`No upstream remote found for ${config.name}.git. Skipping comparison.`,
|
|
@@ -70513,7 +70512,9 @@ var runCommitLint = async (config, params) => {
|
|
|
70513
70512
|
}
|
|
70514
70513
|
}
|
|
70515
70514
|
const allowedTypes = Object.keys(DEFAULT_COMMIT_TYPES).join("|");
|
|
70516
|
-
const allowedScopes = await getNxScopes(
|
|
70515
|
+
const allowedScopes = await getNxScopes({
|
|
70516
|
+
config
|
|
70517
|
+
});
|
|
70517
70518
|
const commitMsgRegex = `(${allowedTypes})\\((${allowedScopes})\\)!?:\\s(([a-z0-9:-s])+)`;
|
|
70518
70519
|
const matchCommit = new RegExp(commitMsgRegex, "g").test(commitMessage);
|
|
70519
70520
|
const commitlintConfig = _chunk4CISOROAcjs.defu.call(void 0,
|
|
@@ -70845,7 +70846,7 @@ var Hfs = class {
|
|
|
70845
70846
|
"arrayBuffer",
|
|
70846
70847
|
filePath
|
|
70847
70848
|
);
|
|
70848
|
-
return _optionalChain([result2, 'optionalAccess',
|
|
70849
|
+
return _optionalChain([result2, 'optionalAccess', _89 => _89.buffer]);
|
|
70849
70850
|
}
|
|
70850
70851
|
/**
|
|
70851
70852
|
* Reads the given file and returns the contents as an Uint8Array.
|
|
@@ -71250,7 +71251,7 @@ var Retrier = class {
|
|
|
71250
71251
|
* processed.
|
|
71251
71252
|
*/
|
|
71252
71253
|
retry(fn, { signal } = {}) {
|
|
71253
|
-
_optionalChain([signal, 'optionalAccess',
|
|
71254
|
+
_optionalChain([signal, 'optionalAccess', _90 => _90.throwIfAborted, 'call', _91 => _91()]);
|
|
71254
71255
|
let result2;
|
|
71255
71256
|
try {
|
|
71256
71257
|
result2 = fn();
|
|
@@ -71266,7 +71267,7 @@ var Retrier = class {
|
|
|
71266
71267
|
}
|
|
71267
71268
|
return new Promise((resolve, reject2) => {
|
|
71268
71269
|
this.#queue.push(new RetryTask(fn, error, resolve, reject2, signal));
|
|
71269
|
-
_optionalChain([signal, 'optionalAccess',
|
|
71270
|
+
_optionalChain([signal, 'optionalAccess', _92 => _92.addEventListener, 'call', _93 => _93("abort", () => {
|
|
71270
71271
|
reject2(signal.reason);
|
|
71271
71272
|
})]);
|
|
71272
71273
|
this.#processQueue();
|
|
@@ -71633,6 +71634,11 @@ var hfs = new NodeHfs();
|
|
|
71633
71634
|
|
|
71634
71635
|
|
|
71635
71636
|
|
|
71637
|
+
|
|
71638
|
+
|
|
71639
|
+
|
|
71640
|
+
|
|
71641
|
+
|
|
71636
71642
|
// src/commit/config.ts
|
|
71637
71643
|
_chunkDG64PTNNcjs.init_cjs_shims.call(void 0, );
|
|
71638
71644
|
var DEFAULT_COMMIT_CONFIG = {
|
|
@@ -71643,19 +71649,19 @@ var DEFAULT_COMMIT_CONFIG = {
|
|
|
71643
71649
|
};
|
|
71644
71650
|
|
|
71645
71651
|
// src/commit/commit-state.ts
|
|
71646
|
-
|
|
71652
|
+
function getGitDir() {
|
|
71647
71653
|
const devNull = process.platform === "win32" ? " nul" : "/dev/null";
|
|
71648
71654
|
const dir = _child_process.execSync.call(void 0, `git rev-parse --absolute-git-dir 2>${devNull}`).toString().trim();
|
|
71649
71655
|
return dir;
|
|
71650
|
-
}
|
|
71651
|
-
|
|
71656
|
+
}
|
|
71657
|
+
function getGitRootDir() {
|
|
71652
71658
|
const devNull = process.platform === "win32" ? " nul" : "/dev/null";
|
|
71653
71659
|
const dir = _child_process.execSync.call(void 0, `git rev-parse --show-toplevel 2>${devNull}`).toString().trim();
|
|
71654
71660
|
return dir;
|
|
71655
|
-
}
|
|
71656
|
-
|
|
71661
|
+
}
|
|
71662
|
+
async function resolveCommitOptions(config, workspaceConfig) {
|
|
71657
71663
|
return {
|
|
71658
|
-
utils: { getScopeEnum },
|
|
71664
|
+
utils: { getScopeEnum: getScopeEnumUtil({ config: workspaceConfig }) },
|
|
71659
71665
|
parserPreset: "conventional-changelog-conventionalcommits",
|
|
71660
71666
|
prompt: {
|
|
71661
71667
|
settings: config.settings,
|
|
@@ -71663,9 +71669,11 @@ var resolveCommitOptions = async (config) => {
|
|
|
71663
71669
|
questions: config.questions
|
|
71664
71670
|
}
|
|
71665
71671
|
};
|
|
71666
|
-
}
|
|
71667
|
-
|
|
71668
|
-
|
|
71672
|
+
}
|
|
71673
|
+
async function resolveDefaultCommitOptions(config) {
|
|
71674
|
+
return resolveCommitOptions(DEFAULT_COMMIT_CONFIG, config);
|
|
71675
|
+
}
|
|
71676
|
+
async function createState(config, commitizenFile = "@storm-software/git-tools/commit/config") {
|
|
71669
71677
|
let root2;
|
|
71670
71678
|
try {
|
|
71671
71679
|
root2 = getGitRootDir();
|
|
@@ -71675,19 +71683,20 @@ var createState = async (config, commitizenFile = "@storm-software/git-tools/com
|
|
|
71675
71683
|
let state;
|
|
71676
71684
|
if (commitizenFile === "@storm-software/git-tools/commit/config") {
|
|
71677
71685
|
state = {
|
|
71678
|
-
config: await resolveDefaultCommitOptions(),
|
|
71686
|
+
config: await resolveDefaultCommitOptions(config),
|
|
71679
71687
|
root: root2,
|
|
71680
71688
|
answers: {}
|
|
71681
71689
|
};
|
|
71682
71690
|
} else {
|
|
71683
71691
|
_chunkSN4DGQCWcjs.writeInfo.call(void 0, `Using custom commit config file: ${commitizenFile}`, config);
|
|
71684
71692
|
let commitizenConfig = await Promise.resolve().then(() => _interopRequireWildcard(require(commitizenFile)));
|
|
71685
|
-
if (_optionalChain([commitizenConfig, 'optionalAccess',
|
|
71686
|
-
commitizenConfig = _optionalChain([commitizenConfig, 'optionalAccess',
|
|
71693
|
+
if (_optionalChain([commitizenConfig, 'optionalAccess', _94 => _94.default])) {
|
|
71694
|
+
commitizenConfig = _optionalChain([commitizenConfig, 'optionalAccess', _95 => _95.default]);
|
|
71687
71695
|
}
|
|
71688
71696
|
state = {
|
|
71689
71697
|
config: await resolveCommitOptions(
|
|
71690
|
-
_chunk4CISOROAcjs.defu.call(void 0, _nullishCoalesce(commitizenConfig, () => ( {})), DEFAULT_COMMIT_CONFIG)
|
|
71698
|
+
_chunk4CISOROAcjs.defu.call(void 0, _nullishCoalesce(commitizenConfig, () => ( {})), DEFAULT_COMMIT_CONFIG),
|
|
71699
|
+
config
|
|
71691
71700
|
),
|
|
71692
71701
|
root: root2,
|
|
71693
71702
|
answers: {}
|
|
@@ -71696,20 +71705,22 @@ var createState = async (config, commitizenFile = "@storm-software/git-tools/com
|
|
|
71696
71705
|
if (state.config.prompt.questions.type && state.config.prompt.questions.type.enum) {
|
|
71697
71706
|
state.config.prompt.questions.type.enum = Object.keys(state.config.prompt.questions.type.enum).reduce(
|
|
71698
71707
|
(ret, key) => {
|
|
71699
|
-
|
|
71700
|
-
|
|
71701
|
-
|
|
71702
|
-
|
|
71703
|
-
|
|
71708
|
+
if (state.config.prompt.questions.type.enum) {
|
|
71709
|
+
ret[key] = {
|
|
71710
|
+
...state.config.prompt.questions.type.enum[key],
|
|
71711
|
+
title: chalk_template_default`${_optionalChain([state, 'access', _96 => _96.config, 'access', _97 => _97.prompt, 'access', _98 => _98.questions, 'access', _99 => _99.type, 'access', _100 => _100.enum, 'access', _101 => _101[key], 'optionalAccess', _102 => _102.emoji]) ? `${_optionalChain([state, 'access', _103 => _103.config, 'access', _104 => _104.prompt, 'access', _105 => _105.questions, 'access', _106 => _106.type, 'access', _107 => _107.enum, 'access', _108 => _108[key], 'optionalAccess', _109 => _109.emoji])} ` : ""}{bold ${key}} ${_optionalChain([state, 'access', _110 => _110.config, 'access', _111 => _111.prompt, 'access', _112 => _112.questions, 'access', _113 => _113.type, 'access', _114 => _114.enum, 'access', _115 => _115[key], 'optionalAccess', _116 => _116.title]) && _optionalChain([state, 'access', _117 => _117.config, 'access', _118 => _118.prompt, 'access', _119 => _119.questions, 'access', _120 => _120.type, 'access', _121 => _121.enum, 'access', _122 => _122[key], 'optionalAccess', _123 => _123.title]) !== key ? `- ${_optionalChain([state, 'access', _124 => _124.config, 'access', _125 => _125.prompt, 'access', _126 => _126.questions, 'access', _127 => _127.type, 'access', _128 => _128.enum, 'access', _129 => _129[key], 'optionalAccess', _130 => _130.title])}` : ""}${_optionalChain([state, 'access', _131 => _131.config, 'access', _132 => _132.prompt, 'access', _133 => _133.questions, 'access', _134 => _134.type, 'access', _135 => _135.enum, 'access', _136 => _136[key], 'optionalAccess', _137 => _137.semverBump]) ? ` (version bump: ${_optionalChain([state, 'access', _138 => _138.config, 'access', _139 => _139.prompt, 'access', _140 => _140.questions, 'access', _141 => _141.type, 'access', _142 => _142.enum, 'access', _143 => _143[key], 'optionalAccess', _144 => _144.semverBump])})` : ""}`,
|
|
71712
|
+
hidden: false
|
|
71713
|
+
};
|
|
71714
|
+
}
|
|
71704
71715
|
return ret;
|
|
71705
71716
|
},
|
|
71706
71717
|
{}
|
|
71707
71718
|
);
|
|
71708
71719
|
}
|
|
71709
71720
|
if (!state.config.prompt.questions.scope || !state.config.prompt.questions.scope.enum || Object.keys(state.config.prompt.questions.scope.enum).length === 0) {
|
|
71710
|
-
const
|
|
71711
|
-
|
|
71712
|
-
|
|
71721
|
+
const scopes = await getScopeEnum({
|
|
71722
|
+
config
|
|
71723
|
+
});
|
|
71713
71724
|
for (const scope of scopes) {
|
|
71714
71725
|
if (scope === "monorepo") {
|
|
71715
71726
|
state.config.prompt.questions.scope.enum[scope] = {
|
|
@@ -71719,15 +71730,29 @@ var createState = async (config, commitizenFile = "@storm-software/git-tools/com
|
|
|
71719
71730
|
projectRoot: "/"
|
|
71720
71731
|
};
|
|
71721
71732
|
} else {
|
|
71722
|
-
let
|
|
71733
|
+
let projectGraph;
|
|
71723
71734
|
try {
|
|
71724
|
-
|
|
71725
|
-
} catch (
|
|
71735
|
+
projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
|
|
71736
|
+
} catch (e15) {
|
|
71737
|
+
await _projectgraph.createProjectGraphAsync.call(void 0, );
|
|
71738
|
+
projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
|
|
71739
|
+
}
|
|
71740
|
+
if (!projectGraph) {
|
|
71741
|
+
throw new Error(
|
|
71742
|
+
"Failed to load the project graph. Please run `nx reset`, then run the `storm-git commit` command again."
|
|
71743
|
+
);
|
|
71726
71744
|
}
|
|
71745
|
+
const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
71746
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _145 => _145.projects, 'optionalAccess', _146 => _146[scope]])) {
|
|
71747
|
+
throw new Error(
|
|
71748
|
+
`Failed to load the project configuration for project ${scope}. Please run \`nx reset\`, then run the \`storm-git commit\` command again.`
|
|
71749
|
+
);
|
|
71750
|
+
}
|
|
71751
|
+
const project = projectConfigurations.projects[scope];
|
|
71727
71752
|
if (project) {
|
|
71728
71753
|
let description = `${project.name} - ${project.root}`;
|
|
71729
71754
|
const packageJsonPath = _chunkSN4DGQCWcjs.joinPaths.call(void 0, project.root, "package.json");
|
|
71730
|
-
if (
|
|
71755
|
+
if (_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
71731
71756
|
const packageJson = await hfs.json(packageJsonPath);
|
|
71732
71757
|
description = packageJson.description || description;
|
|
71733
71758
|
}
|
|
@@ -71749,7 +71774,7 @@ var createState = async (config, commitizenFile = "@storm-software/git-tools/com
|
|
|
71749
71774
|
{}
|
|
71750
71775
|
);
|
|
71751
71776
|
return state;
|
|
71752
|
-
}
|
|
71777
|
+
}
|
|
71753
71778
|
|
|
71754
71779
|
// src/commit/format-commit-message.ts
|
|
71755
71780
|
_chunkDG64PTNNcjs.init_cjs_shims.call(void 0, );
|
|
@@ -71771,9 +71796,9 @@ var formatCommitMessage = (state) => {
|
|
|
71771
71796
|
if (typeof answers.subject !== "string") {
|
|
71772
71797
|
throw new Error("Invalid subject type.");
|
|
71773
71798
|
}
|
|
71774
|
-
const emoji = _optionalChain([answers, 'access',
|
|
71799
|
+
const emoji = _optionalChain([answers, 'access', _147 => _147.type, 'optionalAccess', _148 => _148[answers.type], 'optionalAccess', _149 => _149.emoji]) ? answers.type[answers.type].emoji : "";
|
|
71775
71800
|
const scope = answers.scope ? answers.scope.trim() : "";
|
|
71776
|
-
const subject = _optionalChain([answers, 'access',
|
|
71801
|
+
const subject = _optionalChain([answers, 'access', _150 => _150.subject, 'optionalAccess', _151 => _151.trim, 'call', _152 => _152()]);
|
|
71777
71802
|
const type = answers.type;
|
|
71778
71803
|
const format2 = config.prompt.settings.format || "{type}({scope}): {emoji}{subject}";
|
|
71779
71804
|
const body = answers.body && typeof answers.body === "string" ? (0, import_word_wrap.default)(answers.body || "", wrapOptions) : "";
|
|
@@ -71864,10 +71889,10 @@ var askQuestion = (index, question) => {
|
|
|
71864
71889
|
if (question.type === "select" && question.enum && Object.keys(question.enum).length > 1) {
|
|
71865
71890
|
return esm_default11({
|
|
71866
71891
|
message: message2,
|
|
71867
|
-
choices: Object.keys(question.enum).filter((key) => !_optionalChain([question, 'access',
|
|
71868
|
-
name: _optionalChain([question, 'access',
|
|
71892
|
+
choices: Object.keys(question.enum).filter((key) => !_optionalChain([question, 'access', _153 => _153.enum, 'optionalAccess', _154 => _154[key], 'optionalAccess', _155 => _155.hidden])).map((key) => ({
|
|
71893
|
+
name: _optionalChain([question, 'access', _156 => _156.enum, 'optionalAccess', _157 => _157[key], 'optionalAccess', _158 => _158.title]) || key,
|
|
71869
71894
|
value: key,
|
|
71870
|
-
description: _optionalChain([question, 'access',
|
|
71895
|
+
description: _optionalChain([question, 'access', _159 => _159.enum, 'optionalAccess', _160 => _160[key], 'optionalAccess', _161 => _161.description]) || ""
|
|
71871
71896
|
})),
|
|
71872
71897
|
default: String(question.defaultValue || "")
|
|
71873
71898
|
});
|
|
@@ -71917,9 +71942,9 @@ var _projectgraphjs = require('nx/src/project-graph/project-graph.js');
|
|
|
71917
71942
|
_chunkDG64PTNNcjs.init_cjs_shims.call(void 0, );
|
|
71918
71943
|
|
|
71919
71944
|
function findFileName(filePath) {
|
|
71920
|
-
return _nullishCoalesce(_optionalChain([filePath, 'optionalAccess',
|
|
71921
|
-
_optionalChain([filePath, 'optionalAccess',
|
|
71922
|
-
), 'optionalAccess',
|
|
71945
|
+
return _nullishCoalesce(_optionalChain([filePath, 'optionalAccess', _162 => _162.split, 'call', _163 => _163(
|
|
71946
|
+
_optionalChain([filePath, 'optionalAccess', _164 => _164.includes, 'call', _165 => _165(_path2.default.sep)]) ? _path2.default.sep : _optionalChain([filePath, 'optionalAccess', _166 => _166.includes, 'call', _167 => _167("/")]) ? "/" : "\\"
|
|
71947
|
+
), 'optionalAccess', _168 => _168.pop, 'call', _169 => _169()]), () => ( ""));
|
|
71923
71948
|
}
|
|
71924
71949
|
function findFilePath(filePath) {
|
|
71925
71950
|
return filePath.replace(findFileName(filePath), "");
|
|
@@ -77169,7 +77194,7 @@ _chunkDG64PTNNcjs.init_cjs_shims.call(void 0, );
|
|
|
77169
77194
|
|
|
77170
77195
|
|
|
77171
77196
|
var getExecutorMarkdown = (_packageName, executorsJsonFile, executorsJson) => {
|
|
77172
|
-
if (!_optionalChain([executorsJson, 'optionalAccess',
|
|
77197
|
+
if (!_optionalChain([executorsJson, 'optionalAccess', _170 => _170.executors])) {
|
|
77173
77198
|
return "";
|
|
77174
77199
|
}
|
|
77175
77200
|
return Object.entries(executorsJson.executors).map(([name, executor]) => {
|
|
@@ -77213,7 +77238,7 @@ var getExecutorMarkdown = (_packageName, executorsJsonFile, executorsJson) => {
|
|
|
77213
77238
|
result3 += ` | ${schema.enum.map(
|
|
77214
77239
|
(x2) => !schema.type || schema.type === "string" ? `"${x2}"` : `\`${x2}\``
|
|
77215
77240
|
).join(" \\| ")} `;
|
|
77216
|
-
} else if (schema.type === "array" && _optionalChain([schema, 'access',
|
|
77241
|
+
} else if (schema.type === "array" && _optionalChain([schema, 'access', _171 => _171.items, 'optionalAccess', _172 => _172.type])) {
|
|
77217
77242
|
result3 += ` | \`${schema.items.type}[]\` `;
|
|
77218
77243
|
} else {
|
|
77219
77244
|
result3 += ` | \`${schema.type}\` `;
|
|
@@ -77266,7 +77291,7 @@ ${result2}`;
|
|
|
77266
77291
|
}).join("\n\n");
|
|
77267
77292
|
};
|
|
77268
77293
|
var getGeneratorMarkdown = (packageName, generatorsJsonFile, generatorsJson) => {
|
|
77269
|
-
if (!_optionalChain([generatorsJson, 'optionalAccess',
|
|
77294
|
+
if (!_optionalChain([generatorsJson, 'optionalAccess', _173 => _173.generators])) {
|
|
77270
77295
|
return "";
|
|
77271
77296
|
}
|
|
77272
77297
|
return Object.entries(generatorsJson.generators).map(([name, generator]) => {
|
|
@@ -77311,7 +77336,7 @@ var getGeneratorMarkdown = (packageName, generatorsJsonFile, generatorsJson) =>
|
|
|
77311
77336
|
resultSchema += ` | ${schema.enum.map(
|
|
77312
77337
|
(x2) => !schema.type || schema.type === "string" ? `"${x2}"` : `\`${x2}\``
|
|
77313
77338
|
).join(" \\| ")} `;
|
|
77314
|
-
} else if (schema.type === "array" && _optionalChain([schema, 'access',
|
|
77339
|
+
} else if (schema.type === "array" && _optionalChain([schema, 'access', _174 => _174.items, 'optionalAccess', _175 => _175.type])) {
|
|
77315
77340
|
resultSchema += ` | \`${schema.items.type}[]\` `;
|
|
77316
77341
|
} else {
|
|
77317
77342
|
resultSchema += ` | \`${schema.type}\` `;
|
|
@@ -77489,7 +77514,7 @@ var runProjectReadme = async (projectName, { templates, output: output3, clean =
|
|
|
77489
77514
|
});
|
|
77490
77515
|
const projectConfigs = _projectgraphjs.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
77491
77516
|
const project = projectConfigs.projects[projectName];
|
|
77492
|
-
const inputFile = _path.join.call(void 0, _nullishCoalesce(_optionalChain([project, 'optionalAccess',
|
|
77517
|
+
const inputFile = _path.join.call(void 0, _nullishCoalesce(_optionalChain([project, 'optionalAccess', _176 => _176.root]), () => ( "./")), "README.md");
|
|
77493
77518
|
if (_fs.existsSync.call(void 0, inputFile)) {
|
|
77494
77519
|
console.info(`Formatting ${projectName}'s README file at "${inputFile}"`);
|
|
77495
77520
|
const outputFilePath = output3 ? output3.includes("README.md") ? output3 : _path.join.call(void 0, findFilePath(output3), "README.md") : inputFile;
|
|
@@ -77521,14 +77546,14 @@ var runProjectReadme = async (projectName, { templates, output: output3, clean =
|
|
|
77521
77546
|
const packageJson = JSON.parse(
|
|
77522
77547
|
_nullishCoalesce(_fs.readFileSync.call(void 0, packageJsonPath, "utf8"), () => ( "{}"))
|
|
77523
77548
|
);
|
|
77524
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
77549
|
+
if (_optionalChain([packageJson, 'optionalAccess', _177 => _177.version])) {
|
|
77525
77550
|
console.info("Adding version...");
|
|
77526
77551
|
newContent = newContent.replace(
|
|
77527
77552
|
"<!-- VERSION -->",
|
|
77528
77553
|
packageJson.version
|
|
77529
77554
|
);
|
|
77530
77555
|
}
|
|
77531
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
77556
|
+
if (_optionalChain([packageJson, 'optionalAccess', _178 => _178.name])) {
|
|
77532
77557
|
packageName = packageJson.name;
|
|
77533
77558
|
}
|
|
77534
77559
|
}
|
|
@@ -77538,7 +77563,7 @@ var runProjectReadme = async (projectName, { templates, output: output3, clean =
|
|
|
77538
77563
|
const executorsJson = JSON.parse(
|
|
77539
77564
|
_nullishCoalesce(_fs.readFileSync.call(void 0, executorsJsonPath, "utf8"), () => ( "{}"))
|
|
77540
77565
|
);
|
|
77541
|
-
if (_optionalChain([executorsJson, 'optionalAccess',
|
|
77566
|
+
if (_optionalChain([executorsJson, 'optionalAccess', _179 => _179.executors])) {
|
|
77542
77567
|
console.info("Adding executors...");
|
|
77543
77568
|
newContent = formatReadMeFromSectionName(
|
|
77544
77569
|
"executors",
|
|
@@ -77557,7 +77582,7 @@ var runProjectReadme = async (projectName, { templates, output: output3, clean =
|
|
|
77557
77582
|
const generatorsJson = JSON.parse(
|
|
77558
77583
|
_nullishCoalesce(_fs.readFileSync.call(void 0, generatorsJsonPath, "utf8"), () => ( "{}"))
|
|
77559
77584
|
);
|
|
77560
|
-
if (_optionalChain([generatorsJson, 'optionalAccess',
|
|
77585
|
+
if (_optionalChain([generatorsJson, 'optionalAccess', _180 => _180.generators])) {
|
|
77561
77586
|
console.info("Adding generators...");
|
|
77562
77587
|
newContent = formatReadMeFromSectionName(
|
|
77563
77588
|
"generators",
|
|
@@ -77683,9 +77708,9 @@ var _prettier = require('prettier');
|
|
|
77683
77708
|
async function generateChangelogContent(releaseVersion, filepath, newContent, currentContent, project, workspaceConfig) {
|
|
77684
77709
|
const formatOptions = await _asyncNullishCoalesce(await _prettier.resolveConfig.call(void 0, filepath), async () => ( {}));
|
|
77685
77710
|
const header = await _prettier.format.call(void 0,
|
|
77686
|
-
`${_optionalChain([workspaceConfig, 'optionalAccess',
|
|
77711
|
+
`${_optionalChain([workspaceConfig, 'optionalAccess', _181 => _181.release, 'access', _182 => _182.banner]) ? `})
|
|
77687
77712
|
|
|
77688
|
-
` : ""}# Changelog ${project || _optionalChain([workspaceConfig, 'optionalAccess',
|
|
77713
|
+
` : ""}# Changelog ${project || _optionalChain([workspaceConfig, 'optionalAccess', _185 => _185.name]) ? "for" : ""}${_optionalChain([workspaceConfig, 'optionalAccess', _186 => _186.name]) ? ` ${titleCase(workspaceConfig.name)}` : ""}${project ? `${_optionalChain([workspaceConfig, 'optionalAccess', _187 => _187.name]) ? " -" : ""} ${titleCase(project)}` : ""}
|
|
77689
77714
|
|
|
77690
77715
|
`,
|
|
77691
77716
|
{
|
|
@@ -77730,7 +77755,7 @@ var titleCase = (input) => {
|
|
|
77730
77755
|
).join(" ");
|
|
77731
77756
|
};
|
|
77732
77757
|
function generateChangelogTitle(version2, project, workspaceConfig) {
|
|
77733
|
-
if (!_optionalChain([workspaceConfig, 'optionalAccess',
|
|
77758
|
+
if (!_optionalChain([workspaceConfig, 'optionalAccess', _188 => _188.name]) || !project) {
|
|
77734
77759
|
return version2;
|
|
77735
77760
|
}
|
|
77736
77761
|
return `[${version2}](https://github.com/${workspaceConfig.organization}/${workspaceConfig.name}/releases/tag/${project}%40${version2}) (${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)})`;
|
|
@@ -81282,7 +81307,7 @@ async function createOrUpdateGithubRelease(createReleaseConfig, releaseVersion,
|
|
|
81282
81307
|
releaseVersion.gitTag
|
|
81283
81308
|
);
|
|
81284
81309
|
} catch (err) {
|
|
81285
|
-
if (_optionalChain([err, 'access',
|
|
81310
|
+
if (_optionalChain([err, 'access', _189 => _189.response, 'optionalAccess', _190 => _190.status]) === 401) {
|
|
81286
81311
|
import_devkit.output.error({
|
|
81287
81312
|
title: `Unable to resolve data via the GitHub API. You can use any of the following options to resolve this:`,
|
|
81288
81313
|
bodyLines: [
|
|
@@ -81292,7 +81317,7 @@ async function createOrUpdateGithubRelease(createReleaseConfig, releaseVersion,
|
|
|
81292
81317
|
});
|
|
81293
81318
|
process.exit(1);
|
|
81294
81319
|
}
|
|
81295
|
-
if (_optionalChain([err, 'access',
|
|
81320
|
+
if (_optionalChain([err, 'access', _191 => _191.response, 'optionalAccess', _192 => _192.status]) === 404) {
|
|
81296
81321
|
} else {
|
|
81297
81322
|
throw err;
|
|
81298
81323
|
}
|
|
@@ -81309,7 +81334,7 @@ async function createOrUpdateGithubRelease(createReleaseConfig, releaseVersion,
|
|
|
81309
81334
|
}
|
|
81310
81335
|
console.log("");
|
|
81311
81336
|
_printchanges.printDiff.call(void 0,
|
|
81312
|
-
_optionalChain([existingGithubReleaseForVersion, 'optionalAccess',
|
|
81337
|
+
_optionalChain([existingGithubReleaseForVersion, 'optionalAccess', _193 => _193.body]) ? existingGithubReleaseForVersion.body : "",
|
|
81313
81338
|
changelogContents,
|
|
81314
81339
|
3,
|
|
81315
81340
|
_shared.noDiffInChangelogMessage
|
|
@@ -81336,7 +81361,7 @@ async function createOrUpdateGithubReleaseInternal(githubRequestConfig, release,
|
|
|
81336
81361
|
if (result2.status === "manual") {
|
|
81337
81362
|
if (result2.error) {
|
|
81338
81363
|
process.exitCode = 1;
|
|
81339
|
-
if (_optionalChain([result2, 'access',
|
|
81364
|
+
if (_optionalChain([result2, 'access', _194 => _194.error, 'access', _195 => _195.response, 'optionalAccess', _196 => _196.data])) {
|
|
81340
81365
|
import_devkit.output.error({
|
|
81341
81366
|
title: `A GitHub API Error occurred when creating/updating the release`,
|
|
81342
81367
|
bodyLines: [
|
|
@@ -81413,7 +81438,7 @@ async function promptForContinueInGitHub() {
|
|
|
81413
81438
|
}
|
|
81414
81439
|
]);
|
|
81415
81440
|
return reply.open === "Yes";
|
|
81416
|
-
} catch (
|
|
81441
|
+
} catch (e16) {
|
|
81417
81442
|
process.stdout.write("\x1B[?25h");
|
|
81418
81443
|
process.exit(1);
|
|
81419
81444
|
}
|
|
@@ -81589,7 +81614,7 @@ var StormChangelogRenderer = (_class16 = class extends _changelogrenderer2.defau
|
|
|
81589
81614
|
}
|
|
81590
81615
|
};
|
|
81591
81616
|
for (let i = this.relevantChanges.length - 1; i >= 0; i--) {
|
|
81592
|
-
if (_optionalChain([this, 'access',
|
|
81617
|
+
if (_optionalChain([this, 'access', _197 => _197.relevantChanges, 'access', _198 => _198[i], 'optionalAccess', _199 => _199.isBreaking])) {
|
|
81593
81618
|
const change = this.relevantChanges[i];
|
|
81594
81619
|
if (change) {
|
|
81595
81620
|
this.additionalChangesForAuthorsSection.push(change);
|
|
@@ -81629,7 +81654,7 @@ var StormChangelogRenderer = (_class16 = class extends _changelogrenderer2.defau
|
|
|
81629
81654
|
}
|
|
81630
81655
|
renderDependencyBumps() {
|
|
81631
81656
|
const markdownLines = ["", "### Updated Dependencies", ""];
|
|
81632
|
-
_optionalChain([this, 'access',
|
|
81657
|
+
_optionalChain([this, 'access', _200 => _200.dependencyBumps, 'optionalAccess', _201 => _201.forEach, 'call', _202 => _202(({ dependencyName, newVersion }) => {
|
|
81633
81658
|
markdownLines.push(`- Updated ${dependencyName} to ${newVersion}`);
|
|
81634
81659
|
})]);
|
|
81635
81660
|
return markdownLines;
|
|
@@ -81646,12 +81671,12 @@ var StormChangelogRenderer = (_class16 = class extends _changelogrenderer2.defau
|
|
|
81646
81671
|
}
|
|
81647
81672
|
for (const author of change.authors) {
|
|
81648
81673
|
const name = this.formatName(author.name);
|
|
81649
|
-
if (!name || name.includes("[bot]") || name === _optionalChain([this, 'access',
|
|
81674
|
+
if (!name || name.includes("[bot]") || name === _optionalChain([this, 'access', _203 => _203.workspaceConfig, 'optionalAccess', _204 => _204.bot, 'access', _205 => _205.name])) {
|
|
81650
81675
|
continue;
|
|
81651
81676
|
}
|
|
81652
81677
|
if (_authors.has(name)) {
|
|
81653
81678
|
const entry = _authors.get(name);
|
|
81654
|
-
_optionalChain([entry, 'optionalAccess',
|
|
81679
|
+
_optionalChain([entry, 'optionalAccess', _206 => _206.email, 'access', _207 => _207.add, 'call', _208 => _208(author.email)]);
|
|
81655
81680
|
} else {
|
|
81656
81681
|
_authors.set(name, { email: /* @__PURE__ */ new Set([author.email]) });
|
|
81657
81682
|
}
|
|
@@ -81675,7 +81700,7 @@ var StormChangelogRenderer = (_class16 = class extends _changelogrenderer2.defau
|
|
|
81675
81700
|
}
|
|
81676
81701
|
}
|
|
81677
81702
|
const { data } = await axios_default.get(`https://ungh.cc/users/find/${email}`).catch(() => ({ data: { user: null } }));
|
|
81678
|
-
if (_optionalChain([data, 'optionalAccess',
|
|
81703
|
+
if (_optionalChain([data, 'optionalAccess', _209 => _209.user])) {
|
|
81679
81704
|
meta.github = data.user.username;
|
|
81680
81705
|
break;
|
|
81681
81706
|
}
|
|
@@ -81788,7 +81813,7 @@ function createAPI(overrideReleaseConfig) {
|
|
|
81788
81813
|
if (args.deleteVersionPlans === void 0) {
|
|
81789
81814
|
args.deleteVersionPlans = true;
|
|
81790
81815
|
}
|
|
81791
|
-
const changelogGenerationEnabled = !!_optionalChain([nxReleaseConfig, 'optionalAccess',
|
|
81816
|
+
const changelogGenerationEnabled = !!_optionalChain([nxReleaseConfig, 'optionalAccess', _210 => _210.changelog, 'optionalAccess', _211 => _211.workspaceChangelog]) || _optionalChain([nxReleaseConfig, 'optionalAccess', _212 => _212.groups]) && Object.values(_optionalChain([nxReleaseConfig, 'optionalAccess', _213 => _213.groups])).some((g) => g.changelog);
|
|
81792
81817
|
if (!changelogGenerationEnabled) {
|
|
81793
81818
|
_output.output.warn({
|
|
81794
81819
|
title: `Changelogs are disabled. No changelog entries will be generated`,
|
|
@@ -81799,7 +81824,7 @@ function createAPI(overrideReleaseConfig) {
|
|
|
81799
81824
|
return {};
|
|
81800
81825
|
}
|
|
81801
81826
|
const tree = new (0, _tree.FsTree)(_workspaceroot.workspaceRoot, !!args.verbose);
|
|
81802
|
-
const useAutomaticFromRef = _optionalChain([nxReleaseConfig, 'optionalAccess',
|
|
81827
|
+
const useAutomaticFromRef = _optionalChain([nxReleaseConfig, 'optionalAccess', _214 => _214.changelog, 'optionalAccess', _215 => _215.automaticFromRef]) || args.firstRelease;
|
|
81803
81828
|
const { workspaceChangelogVersion, projectsVersionData } = resolveChangelogVersions(
|
|
81804
81829
|
args,
|
|
81805
81830
|
releaseGroups,
|
|
@@ -81808,20 +81833,20 @@ function createAPI(overrideReleaseConfig) {
|
|
|
81808
81833
|
const to = args.to || "HEAD";
|
|
81809
81834
|
const toSHA = await _git.getCommitHash.call(void 0, to);
|
|
81810
81835
|
const headSHA = to === "HEAD" ? toSHA : await _git.getCommitHash.call(void 0, "HEAD");
|
|
81811
|
-
const autoCommitEnabled = _nullishCoalesce(args.gitCommit, () => ( _optionalChain([nxReleaseConfig, 'access',
|
|
81836
|
+
const autoCommitEnabled = _nullishCoalesce(args.gitCommit, () => ( _optionalChain([nxReleaseConfig, 'access', _216 => _216.changelog, 'optionalAccess', _217 => _217.git, 'access', _218 => _218.commit])));
|
|
81812
81837
|
if (autoCommitEnabled && headSHA !== toSHA) {
|
|
81813
81838
|
throw new Error(
|
|
81814
81839
|
`You are attempting to recreate the changelog for an old release (Head: "${headSHA}", To: "${toSHA}", From: "${args.from}"), but you have enabled auto-commit mode. Please disable auto-commit mode by updating your nx.json, or passing --git-commit=false`
|
|
81815
81840
|
);
|
|
81816
81841
|
}
|
|
81817
|
-
const commitMessage = args.gitCommitMessage || _optionalChain([nxReleaseConfig, 'access',
|
|
81842
|
+
const commitMessage = args.gitCommitMessage || _optionalChain([nxReleaseConfig, 'access', _219 => _219.changelog, 'optionalAccess', _220 => _220.git, 'optionalAccess', _221 => _221.commitMessage]);
|
|
81818
81843
|
const commitMessageValues = _shared.createCommitMessageValues.call(void 0,
|
|
81819
81844
|
releaseGroups,
|
|
81820
81845
|
releaseGroupToFilteredProjects,
|
|
81821
81846
|
projectsVersionData,
|
|
81822
81847
|
commitMessage
|
|
81823
81848
|
);
|
|
81824
|
-
const gitTagValues = _nullishCoalesce(args.gitTag, () => ( _optionalChain([nxReleaseConfig, 'access',
|
|
81849
|
+
const gitTagValues = _nullishCoalesce(args.gitTag, () => ( _optionalChain([nxReleaseConfig, 'access', _222 => _222.changelog, 'optionalAccess', _223 => _223.git, 'access', _224 => _224.tag]))) ? _shared.createGitTagValues.call(void 0,
|
|
81825
81850
|
releaseGroups,
|
|
81826
81851
|
releaseGroupToFilteredProjects,
|
|
81827
81852
|
projectsVersionData
|
|
@@ -81882,7 +81907,7 @@ function createAPI(overrideReleaseConfig) {
|
|
|
81882
81907
|
nxReleaseConfig.releaseTagPattern,
|
|
81883
81908
|
{},
|
|
81884
81909
|
nxReleaseConfig.releaseTagPatternCheckAllBranchesWhen
|
|
81885
|
-
)), 'optionalAccess', async
|
|
81910
|
+
)), 'optionalAccess', async _225 => _225.tag]);
|
|
81886
81911
|
if (!workspaceChangelogFromRef) {
|
|
81887
81912
|
if (useAutomaticFromRef) {
|
|
81888
81913
|
workspaceChangelogFromRef = await _git.getFirstGitCommit.call(void 0, );
|
|
@@ -81936,7 +81961,7 @@ function createAPI(overrideReleaseConfig) {
|
|
|
81936
81961
|
)
|
|
81937
81962
|
});
|
|
81938
81963
|
if (workspaceChangelog && shouldCreateGitHubRelease(
|
|
81939
|
-
_optionalChain([nxReleaseConfig, 'access',
|
|
81964
|
+
_optionalChain([nxReleaseConfig, 'access', _226 => _226.changelog, 'optionalAccess', _227 => _227.workspaceChangelog]),
|
|
81940
81965
|
args.createRelease
|
|
81941
81966
|
)) {
|
|
81942
81967
|
postGitTasks.push(async (latestCommit) => {
|
|
@@ -81950,7 +81975,7 @@ function createAPI(overrideReleaseConfig) {
|
|
|
81950
81975
|
|
|
81951
81976
|
${contents}`);
|
|
81952
81977
|
await createOrUpdateGithubRelease(
|
|
81953
|
-
_optionalChain([nxReleaseConfig, 'access',
|
|
81978
|
+
_optionalChain([nxReleaseConfig, 'access', _228 => _228.changelog, 'optionalAccess', _229 => _229.workspaceChangelog]) ? _optionalChain([nxReleaseConfig, 'access', _230 => _230.changelog, 'optionalAccess', _231 => _231.workspaceChangelog, 'access', _232 => _232.createRelease]) : _github.defaultCreateReleaseProvider,
|
|
81954
81979
|
workspaceChangelog.releaseVersion,
|
|
81955
81980
|
contents,
|
|
81956
81981
|
latestCommit,
|
|
@@ -81968,13 +81993,13 @@ ${contents}`);
|
|
|
81968
81993
|
continue;
|
|
81969
81994
|
}
|
|
81970
81995
|
for (const project of releaseGroup.projects) {
|
|
81971
|
-
if (!_optionalChain([projectsVersionData, 'access',
|
|
81996
|
+
if (!_optionalChain([projectsVersionData, 'access', _233 => _233[project], 'optionalAccess', _234 => _234.newVersion])) {
|
|
81972
81997
|
continue;
|
|
81973
81998
|
}
|
|
81974
81999
|
const dependentProjects = (projectsVersionData[project].dependentProjects || []).map((dep) => {
|
|
81975
82000
|
return {
|
|
81976
82001
|
dependencyName: dep.source,
|
|
81977
|
-
newVersion: _optionalChain([projectsVersionData, 'access',
|
|
82002
|
+
newVersion: _optionalChain([projectsVersionData, 'access', _235 => _235[dep.source], 'optionalAccess', _236 => _236.newVersion])
|
|
81978
82003
|
};
|
|
81979
82004
|
}).filter((b) => b.newVersion !== null);
|
|
81980
82005
|
for (const dependent of dependentProjects) {
|
|
@@ -81996,13 +82021,13 @@ ${contents}`);
|
|
|
81996
82021
|
if (config === false) {
|
|
81997
82022
|
continue;
|
|
81998
82023
|
}
|
|
81999
|
-
const projects = _optionalChain([args, 'access',
|
|
82024
|
+
const projects = _optionalChain([args, 'access', _237 => _237.projects, 'optionalAccess', _238 => _238.length]) ? (
|
|
82000
82025
|
// If the user has passed a list of projects, we need to use the filtered list of projects within the release group, plus any dependents
|
|
82001
82026
|
Array.from(releaseGroupToFilteredProjects.get(releaseGroup)).flatMap(
|
|
82002
82027
|
(project) => {
|
|
82003
82028
|
return [
|
|
82004
82029
|
project,
|
|
82005
|
-
..._optionalChain([projectsVersionData, 'access',
|
|
82030
|
+
..._optionalChain([projectsVersionData, 'access', _239 => _239[project], 'optionalAccess', _240 => _240.dependentProjects, 'access', _241 => _241.map, 'call', _242 => _242(
|
|
82006
82031
|
(dep) => dep.source
|
|
82007
82032
|
)]) || []
|
|
82008
82033
|
];
|
|
@@ -82047,14 +82072,14 @@ ${contents}`);
|
|
|
82047
82072
|
releaseGroupName: releaseGroup.name
|
|
82048
82073
|
},
|
|
82049
82074
|
releaseGroup.releaseTagPatternCheckAllBranchesWhen
|
|
82050
|
-
)), 'optionalAccess', async
|
|
82075
|
+
)), 'optionalAccess', async _243 => _243.tag]);
|
|
82051
82076
|
if (!fromRef && useAutomaticFromRef) {
|
|
82052
82077
|
const firstCommit = await _git.getFirstGitCommit.call(void 0, );
|
|
82053
82078
|
const allCommits = await getCommits(firstCommit, toSHA);
|
|
82054
82079
|
const commitsForProject = allCommits.filter(
|
|
82055
82080
|
(c) => c.affectedFiles.find((f) => f.startsWith(project.data.root))
|
|
82056
82081
|
);
|
|
82057
|
-
fromRef = _optionalChain([commitsForProject, 'access',
|
|
82082
|
+
fromRef = _optionalChain([commitsForProject, 'access', _244 => _244[0], 'optionalAccess', _245 => _245.shortHash]);
|
|
82058
82083
|
if (args.verbose) {
|
|
82059
82084
|
console.log(
|
|
82060
82085
|
`Determined --from ref for ${project.name} from the first commit in which it exists: ${fromRef}`
|
|
@@ -82182,7 +82207,7 @@ ${contents}`);
|
|
|
82182
82207
|
releaseGroup.releaseTagPattern,
|
|
82183
82208
|
{},
|
|
82184
82209
|
releaseGroup.releaseTagPatternCheckAllBranchesWhen
|
|
82185
|
-
)), 'optionalAccess', async
|
|
82210
|
+
)), 'optionalAccess', async _246 => _246.tag]);
|
|
82186
82211
|
if (!fromRef) {
|
|
82187
82212
|
if (useAutomaticFromRef) {
|
|
82188
82213
|
fromRef = await _git.getFirstGitCommit.call(void 0, );
|
|
@@ -82371,17 +82396,17 @@ async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTa
|
|
|
82371
82396
|
});
|
|
82372
82397
|
deletedFiles = Array.from(planFiles);
|
|
82373
82398
|
}
|
|
82374
|
-
if (_nullishCoalesce(args.gitCommit, () => ( _optionalChain([nxReleaseConfig, 'access',
|
|
82399
|
+
if (_nullishCoalesce(args.gitCommit, () => ( _optionalChain([nxReleaseConfig, 'access', _247 => _247.changelog, 'optionalAccess', _248 => _248.git, 'access', _249 => _249.commit])))) {
|
|
82375
82400
|
await _shared.commitChanges.call(void 0, {
|
|
82376
82401
|
changedFiles,
|
|
82377
82402
|
deletedFiles,
|
|
82378
82403
|
isDryRun: !!args.dryRun,
|
|
82379
82404
|
isVerbose: !!args.verbose,
|
|
82380
82405
|
gitCommitMessages: commitMessageValues,
|
|
82381
|
-
gitCommitArgs: args.gitCommitArgs || _optionalChain([nxReleaseConfig, 'access',
|
|
82406
|
+
gitCommitArgs: args.gitCommitArgs || _optionalChain([nxReleaseConfig, 'access', _250 => _250.changelog, 'optionalAccess', _251 => _251.git, 'access', _252 => _252.commitArgs])
|
|
82382
82407
|
});
|
|
82383
82408
|
latestCommit = await _git.getCommitHash.call(void 0, "HEAD");
|
|
82384
|
-
} else if ((_nullishCoalesce(args.stageChanges, () => ( _optionalChain([nxReleaseConfig, 'access',
|
|
82409
|
+
} else if ((_nullishCoalesce(args.stageChanges, () => ( _optionalChain([nxReleaseConfig, 'access', _253 => _253.changelog, 'optionalAccess', _254 => _254.git, 'access', _255 => _255.stageChanges])))) && changes.length) {
|
|
82385
82410
|
_output.output.logSingleLine(`Staging changed files with git`);
|
|
82386
82411
|
await _git.gitAdd.call(void 0, {
|
|
82387
82412
|
changedFiles,
|
|
@@ -82390,19 +82415,19 @@ async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTa
|
|
|
82390
82415
|
verbose: args.verbose
|
|
82391
82416
|
});
|
|
82392
82417
|
}
|
|
82393
|
-
if (_nullishCoalesce(args.gitTag, () => ( _optionalChain([nxReleaseConfig, 'access',
|
|
82418
|
+
if (_nullishCoalesce(args.gitTag, () => ( _optionalChain([nxReleaseConfig, 'access', _256 => _256.changelog, 'optionalAccess', _257 => _257.git, 'access', _258 => _258.tag])))) {
|
|
82394
82419
|
_output.output.logSingleLine(`Tagging commit with git`);
|
|
82395
82420
|
for (const tag of gitTagValues) {
|
|
82396
82421
|
await gitTag({
|
|
82397
82422
|
tag,
|
|
82398
|
-
message: args.gitTagMessage || _optionalChain([nxReleaseConfig, 'access',
|
|
82399
|
-
additionalArgs: args.gitTagArgs || _optionalChain([nxReleaseConfig, 'access',
|
|
82423
|
+
message: args.gitTagMessage || _optionalChain([nxReleaseConfig, 'access', _259 => _259.changelog, 'optionalAccess', _260 => _260.git, 'access', _261 => _261.tagMessage]),
|
|
82424
|
+
additionalArgs: args.gitTagArgs || _optionalChain([nxReleaseConfig, 'access', _262 => _262.changelog, 'optionalAccess', _263 => _263.git, 'access', _264 => _264.tagArgs]),
|
|
82400
82425
|
dryRun: args.dryRun,
|
|
82401
82426
|
verbose: args.verbose
|
|
82402
82427
|
});
|
|
82403
82428
|
}
|
|
82404
82429
|
}
|
|
82405
|
-
if (_nullishCoalesce(args.gitPush, () => ( _optionalChain([nxReleaseConfig, 'access',
|
|
82430
|
+
if (_nullishCoalesce(args.gitPush, () => ( _optionalChain([nxReleaseConfig, 'access', _265 => _265.changelog, 'optionalAccess', _266 => _266.git, 'access', _267 => _267.push])))) {
|
|
82406
82431
|
_output.output.logSingleLine(`Pushing to git remote "${args.gitRemote}"`);
|
|
82407
82432
|
await _git.gitPush.call(void 0, {
|
|
82408
82433
|
gitRemote: args.gitRemote,
|
|
@@ -82430,7 +82455,7 @@ async function generateChangelogForWorkspace({
|
|
|
82430
82455
|
`Unable to determine the Storm workspace config. Please ensure that your storm-workspace.json file is present and valid.`
|
|
82431
82456
|
);
|
|
82432
82457
|
}
|
|
82433
|
-
const config = _optionalChain([nxReleaseConfig, 'access',
|
|
82458
|
+
const config = _optionalChain([nxReleaseConfig, 'access', _268 => _268.changelog, 'optionalAccess', _269 => _269.workspaceChangelog]);
|
|
82434
82459
|
if (config === false) {
|
|
82435
82460
|
return;
|
|
82436
82461
|
}
|
|
@@ -82452,7 +82477,7 @@ async function generateChangelogForWorkspace({
|
|
|
82452
82477
|
});
|
|
82453
82478
|
return;
|
|
82454
82479
|
}
|
|
82455
|
-
if (_optionalChain([Object, 'access',
|
|
82480
|
+
if (_optionalChain([Object, 'access', _270 => _270.values, 'call', _271 => _271(_nullishCoalesce(nxReleaseConfig.groups, () => ( {}))), 'access', _272 => _272[0], 'optionalAccess', _273 => _273.projectsRelationship]) === "independent") {
|
|
82456
82481
|
_output.output.warn({
|
|
82457
82482
|
title: `Workspace changelog is enabled, but you have configured an independent projects relationship. This is not supported, so workspace changelog will be disabled.`,
|
|
82458
82483
|
bodyLines: [
|
|
@@ -82518,7 +82543,7 @@ async function generateChangelogForWorkspace({
|
|
|
82518
82543
|
releaseVersion,
|
|
82519
82544
|
interpolatedTreePath,
|
|
82520
82545
|
contents,
|
|
82521
|
-
tree.exists(interpolatedTreePath) ? _optionalChain([tree, 'access',
|
|
82546
|
+
tree.exists(interpolatedTreePath) ? _optionalChain([tree, 'access', _274 => _274.read, 'call', _275 => _275(interpolatedTreePath), 'optionalAccess', _276 => _276.toString, 'call', _277 => _277()]) : "",
|
|
82522
82547
|
null,
|
|
82523
82548
|
workspaceConfig
|
|
82524
82549
|
)
|
|
@@ -82563,7 +82588,7 @@ async function generateChangelogForProjects({
|
|
|
82563
82588
|
workspaceRoot: ""
|
|
82564
82589
|
});
|
|
82565
82590
|
}
|
|
82566
|
-
if (!_optionalChain([projectsVersionData, 'access',
|
|
82591
|
+
if (!_optionalChain([projectsVersionData, 'access', _278 => _278[project.name], 'optionalAccess', _279 => _279.newVersion])) {
|
|
82567
82592
|
continue;
|
|
82568
82593
|
}
|
|
82569
82594
|
const releaseVersion = new (0, _shared.ReleaseVersion)({
|
|
@@ -82621,7 +82646,7 @@ ${contents}`.trim()
|
|
|
82621
82646
|
releaseVersion,
|
|
82622
82647
|
interpolatedTreePath,
|
|
82623
82648
|
contents,
|
|
82624
|
-
tree.exists(interpolatedTreePath) ? _optionalChain([tree, 'access',
|
|
82649
|
+
tree.exists(interpolatedTreePath) ? _optionalChain([tree, 'access', _280 => _280.read, 'call', _281 => _281(interpolatedTreePath), 'optionalAccess', _282 => _282.toString, 'call', _283 => _283()]) : "",
|
|
82625
82650
|
project.name,
|
|
82626
82651
|
workspaceConfig
|
|
82627
82652
|
)
|
|
@@ -82645,11 +82670,11 @@ ${contents}`.trim()
|
|
|
82645
82670
|
return projectChangelogs;
|
|
82646
82671
|
}
|
|
82647
82672
|
function checkChangelogFilesEnabled(nxReleaseConfig) {
|
|
82648
|
-
if (_optionalChain([nxReleaseConfig, 'access',
|
|
82673
|
+
if (_optionalChain([nxReleaseConfig, 'access', _284 => _284.changelog, 'optionalAccess', _285 => _285.workspaceChangelog]) && _optionalChain([nxReleaseConfig, 'access', _286 => _286.changelog, 'optionalAccess', _287 => _287.workspaceChangelog, 'access', _288 => _288.file])) {
|
|
82649
82674
|
return true;
|
|
82650
82675
|
}
|
|
82651
82676
|
return Object.values(_nullishCoalesce(nxReleaseConfig.groups, () => ( {}))).some(
|
|
82652
|
-
(releaseGroup) => typeof _optionalChain([releaseGroup, 'optionalAccess',
|
|
82677
|
+
(releaseGroup) => typeof _optionalChain([releaseGroup, 'optionalAccess', _289 => _289.changelog]) === "boolean" && releaseGroup.changelog || _optionalChain([releaseGroup, 'optionalAccess', _290 => _290.changelog, 'optionalAccess', _291 => _291.file])
|
|
82653
82678
|
);
|
|
82654
82679
|
}
|
|
82655
82680
|
async function getCommits(fromSHA, toSHA) {
|
|
@@ -82743,7 +82768,7 @@ function formatGithubReleaseNotes(releaseVersion, content, projectName, workspac
|
|
|
82743
82768
|
if (!workspaceConfig) {
|
|
82744
82769
|
return content;
|
|
82745
82770
|
}
|
|
82746
|
-
return `![${_optionalChain([titleCase, 'call',
|
|
82771
|
+
return `![${_optionalChain([titleCase, 'call', _292 => _292(workspaceConfig.organization), 'optionalAccess', _293 => _293.replaceAll, 'call', _294 => _294(" ", "-")])}](${workspaceConfig.release.banner})
|
|
82747
82772
|
${workspaceConfig.release.header || ""}
|
|
82748
82773
|
|
|
82749
82774
|
# ${projectName ? `${titleCase(projectName)} ` : ""}v${releaseVersion.rawVersion}
|
|
@@ -82752,7 +82777,7 @@ We at [${titleCase(workspaceConfig.organization)}](${workspaceConfig.homepage})
|
|
|
82752
82777
|
|
|
82753
82778
|
These changes are released under the ${workspaceConfig.license.includes("license") ? workspaceConfig.license : `${workspaceConfig.license} license`}. You can find more details on [our licensing page](${workspaceConfig.licensing}). You can find guides, API references, and other documentation around this release (and much more) on [our documentation site](${workspaceConfig.docs}).
|
|
82754
82779
|
|
|
82755
|
-
If you have any questions or comments, feel free to reach out to the team on [Discord](${workspaceConfig.account.discord}) or [our contact page](${workspaceConfig.contact}). Please help us spread the word by giving [this repository](https://github.com/${workspaceConfig.organization}/${workspaceConfig.name}) a star \u2B50 on GitHub or [posting on X (Twitter)](https://x.com/intent/tweet?text=Check%20out%20the%20latest%20@${workspaceConfig.account.twitter}%20release%20${projectName ? `${_optionalChain([titleCase, 'call',
|
|
82780
|
+
If you have any questions or comments, feel free to reach out to the team on [Discord](${workspaceConfig.account.discord}) or [our contact page](${workspaceConfig.contact}). Please help us spread the word by giving [this repository](https://github.com/${workspaceConfig.organization}/${workspaceConfig.name}) a star \u2B50 on GitHub or [posting on X (Twitter)](https://x.com/intent/tweet?text=Check%20out%20the%20latest%20@${workspaceConfig.account.twitter}%20release%20${projectName ? `${_optionalChain([titleCase, 'call', _295 => _295(projectName), 'optionalAccess', _296 => _296.replaceAll, 'call', _297 => _297(" ", "%20")])}%20` : ""}v${releaseVersion.rawVersion}%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/${workspaceConfig.organization}/${workspaceConfig.name}/releases/tag/${releaseVersion.gitTag}) about this release!
|
|
82756
82781
|
|
|
82757
82782
|
## Release Notes
|
|
82758
82783
|
|
|
@@ -82848,10 +82873,10 @@ var runRelease = async (config, options) => {
|
|
|
82848
82873
|
`,
|
|
82849
82874
|
config
|
|
82850
82875
|
);
|
|
82851
|
-
if (_optionalChain([nxJson, 'access',
|
|
82876
|
+
if (_optionalChain([nxJson, 'access', _298 => _298.release, 'optionalAccess', _299 => _299.groups])) {
|
|
82852
82877
|
nxJson.release.groups = Object.keys(nxJson.release.groups).reduce(
|
|
82853
82878
|
(ret, groupName) => {
|
|
82854
|
-
const groupConfig = _optionalChain([nxJson, 'access',
|
|
82879
|
+
const groupConfig = _optionalChain([nxJson, 'access', _300 => _300.release, 'optionalAccess', _301 => _301.groups, 'optionalAccess', _302 => _302[groupName]]);
|
|
82855
82880
|
ret[groupName] = _chunk4CISOROAcjs.defu.call(void 0, groupConfig, DEFAULT_RELEASE_GROUP_CONFIG);
|
|
82856
82881
|
return ret;
|
|
82857
82882
|
},
|
|
@@ -82881,7 +82906,7 @@ var runRelease = async (config, options) => {
|
|
|
82881
82906
|
});
|
|
82882
82907
|
await releaseChangelog({
|
|
82883
82908
|
...options,
|
|
82884
|
-
version: _optionalChain([nxReleaseConfig, 'optionalAccess',
|
|
82909
|
+
version: _optionalChain([nxReleaseConfig, 'optionalAccess', _303 => _303.projectsRelationship]) !== "fixed" ? void 0 : workspaceVersion,
|
|
82885
82910
|
versionData: projectsVersionData,
|
|
82886
82911
|
dryRun: false,
|
|
82887
82912
|
verbose: _chunkSN4DGQCWcjs.isVerbose.call(void 0, config.logLevel),
|
|
@@ -82898,7 +82923,7 @@ var runRelease = async (config, options) => {
|
|
|
82898
82923
|
);
|
|
82899
82924
|
} else {
|
|
82900
82925
|
const changedProjects = Object.keys(projectsVersionData).filter(
|
|
82901
|
-
(key) => _optionalChain([projectsVersionData, 'access',
|
|
82926
|
+
(key) => _optionalChain([projectsVersionData, 'access', _304 => _304[key], 'optionalAccess', _305 => _305.newVersion])
|
|
82902
82927
|
);
|
|
82903
82928
|
if (changedProjects.length > 0) {
|
|
82904
82929
|
_chunkSN4DGQCWcjs.writeInfo.call(void 0,
|
|
@@ -82914,14 +82939,14 @@ ${changedProjects.map((changedProject) => ` - ${changedProject}`).join("\n")}
|
|
|
82914
82939
|
verbose: _chunkSN4DGQCWcjs.isVerbose.call(void 0, config.logLevel)
|
|
82915
82940
|
});
|
|
82916
82941
|
const failedProjects = Object.keys(result2).filter(
|
|
82917
|
-
(key) => _optionalChain([result2, 'access',
|
|
82942
|
+
(key) => _optionalChain([result2, 'access', _306 => _306[key], 'optionalAccess', _307 => _307.code]) && _optionalChain([result2, 'access', _308 => _308[key], 'optionalAccess', _309 => _309.code]) > 0
|
|
82918
82943
|
);
|
|
82919
82944
|
if (failedProjects.length > 0) {
|
|
82920
82945
|
throw new Error(
|
|
82921
82946
|
`The Storm release process was not completed successfully! One or more errors occured while running the \`nx-release-publish\` executor tasks.
|
|
82922
82947
|
|
|
82923
82948
|
Please review the workflow details for the following project(s):
|
|
82924
|
-
${failedProjects.map((failedProject) => ` - ${failedProject} (Error Code: ${_optionalChain([result2, 'access',
|
|
82949
|
+
${failedProjects.map((failedProject) => ` - ${failedProject} (Error Code: ${_optionalChain([result2, 'access', _310 => _310[failedProject], 'optionalAccess', _311 => _311.code])})`).join("\n")}
|
|
82925
82950
|
`
|
|
82926
82951
|
);
|
|
82927
82952
|
}
|
|
@@ -82935,7 +82960,7 @@ async function updatePackageManifests(projectsVersionData, config) {
|
|
|
82935
82960
|
let projectGraph;
|
|
82936
82961
|
try {
|
|
82937
82962
|
projectGraph = (0, import_devkit2.readCachedProjectGraph)();
|
|
82938
|
-
} catch (
|
|
82963
|
+
} catch (e17) {
|
|
82939
82964
|
await (0, import_devkit2.createProjectGraphAsync)();
|
|
82940
82965
|
projectGraph = (0, import_devkit2.readCachedProjectGraph)();
|
|
82941
82966
|
}
|
|
@@ -82943,7 +82968,7 @@ async function updatePackageManifests(projectsVersionData, config) {
|
|
|
82943
82968
|
await Promise.all(
|
|
82944
82969
|
Object.keys(projectsVersionData).map(async (node) => {
|
|
82945
82970
|
const projectNode = projectGraph.nodes[node];
|
|
82946
|
-
if (!_optionalChain([projectNode, 'optionalAccess',
|
|
82971
|
+
if (!_optionalChain([projectNode, 'optionalAccess', _312 => _312.data, 'access', _313 => _313.root])) {
|
|
82947
82972
|
_chunkSN4DGQCWcjs.writeWarning.call(void 0,
|
|
82948
82973
|
`Project node ${node} not found in the project graph. Skipping manifest update.`,
|
|
82949
82974
|
config
|
|
@@ -82951,7 +82976,7 @@ async function updatePackageManifests(projectsVersionData, config) {
|
|
|
82951
82976
|
return;
|
|
82952
82977
|
}
|
|
82953
82978
|
const versionData = projectsVersionData[node];
|
|
82954
|
-
if (_optionalChain([projectNode, 'optionalAccess',
|
|
82979
|
+
if (_optionalChain([projectNode, 'optionalAccess', _314 => _314.data, 'access', _315 => _315.root]) && versionData && versionData.newVersion !== null) {
|
|
82955
82980
|
_chunkSN4DGQCWcjs.writeTrace.call(void 0,
|
|
82956
82981
|
`Writing version ${versionData.newVersion} update to manifest file for ${node}
|
|
82957
82982
|
`,
|
package/bin/git.js
CHANGED
|
@@ -79382,7 +79382,7 @@ var DEFAULT_COMMIT_RULES = {
|
|
|
79382
79382
|
};
|
|
79383
79383
|
var DEFAULT_COMMITLINT_CONFIG = {
|
|
79384
79384
|
rules: DEFAULT_COMMIT_RULES,
|
|
79385
|
-
helpUrl: "https://stormsoftware.com/
|
|
79385
|
+
helpUrl: "https://developer.stormsoftware.com/commitlint",
|
|
79386
79386
|
parserOpts: {
|
|
79387
79387
|
headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/,
|
|
79388
79388
|
breakingHeaderPattern: /^(\w*)(?:\((.*)\))?!: (.*)$/,
|
|
@@ -80669,10 +80669,7 @@ import {
|
|
|
80669
80669
|
readCachedProjectGraph,
|
|
80670
80670
|
readProjectsConfigurationFromProjectGraph
|
|
80671
80671
|
} from "nx/src/project-graph/project-graph";
|
|
80672
|
-
async function getNxScopes(context
|
|
80673
|
-
const ctx = context || {};
|
|
80674
|
-
const workspaceRoot2 = process.env.NX_WORKSPACE_ROOT_PATH || process.env.STORM_WORKSPACE_ROOT || ctx.cwd || process.cwd();
|
|
80675
|
-
process.env.NX_WORKSPACE_ROOT_PATH ??= workspaceRoot2;
|
|
80672
|
+
async function getNxScopes(context) {
|
|
80676
80673
|
let projectGraph;
|
|
80677
80674
|
try {
|
|
80678
80675
|
projectGraph = readCachedProjectGraph();
|
|
@@ -80689,17 +80686,19 @@ async function getNxScopes(context, selector = (params) => true) {
|
|
|
80689
80686
|
const result2 = Object.entries(projectConfigs.projects || {}).map(([name, project]) => ({
|
|
80690
80687
|
name,
|
|
80691
80688
|
...project
|
|
80692
|
-
})).filter(
|
|
80689
|
+
})).filter(
|
|
80690
|
+
(project) => project.name && project.root && project.root !== "." && project.root !== context.config.workspaceRoot && !project.name.includes("e2e")
|
|
80691
|
+
).filter((project) => project.targets).map((project) => project.name).filter(Boolean).sort((a, b) => a.localeCompare(b));
|
|
80693
80692
|
result2.unshift("monorepo");
|
|
80694
80693
|
return result2;
|
|
80695
80694
|
}
|
|
80696
|
-
|
|
80697
|
-
return
|
|
80698
|
-
|
|
80699
|
-
|
|
80700
|
-
);
|
|
80701
|
-
}
|
|
80702
|
-
|
|
80695
|
+
function getScopeEnumUtil(context) {
|
|
80696
|
+
return () => getScopeEnum(context);
|
|
80697
|
+
}
|
|
80698
|
+
function getScopeEnum(context) {
|
|
80699
|
+
return getNxScopes(context);
|
|
80700
|
+
}
|
|
80701
|
+
function getRuleFromScopeEnum(scopeEnum2) {
|
|
80703
80702
|
if (!scopeEnum2?.filter(Boolean).length) {
|
|
80704
80703
|
throw new Error("No scopes found in the Storm workspace.");
|
|
80705
80704
|
}
|
|
@@ -80708,7 +80707,7 @@ var getRuleFromScopeEnum = (scopeEnum2) => {
|
|
|
80708
80707
|
"always",
|
|
80709
80708
|
scopeEnum2.filter(Boolean)
|
|
80710
80709
|
];
|
|
80711
|
-
}
|
|
80710
|
+
}
|
|
80712
80711
|
|
|
80713
80712
|
// src/commitlint/run.ts
|
|
80714
80713
|
var COMMIT_EDITMSG_PATH = ".git/COMMIT_EDITMSG";
|
|
@@ -80764,7 +80763,9 @@ var runCommitLint = async (config, params) => {
|
|
|
80764
80763
|
}
|
|
80765
80764
|
}
|
|
80766
80765
|
const allowedTypes = Object.keys(DEFAULT_COMMIT_TYPES).join("|");
|
|
80767
|
-
const allowedScopes = await getNxScopes(
|
|
80766
|
+
const allowedScopes = await getNxScopes({
|
|
80767
|
+
config
|
|
80768
|
+
});
|
|
80768
80769
|
const commitMsgRegex = `(${allowedTypes})\\((${allowedScopes})\\)!?:\\s(([a-z0-9:-s])+)`;
|
|
80769
80770
|
const matchCommit = new RegExp(commitMsgRegex, "g").test(commitMessage);
|
|
80770
80771
|
const commitlintConfig = defu(
|
|
@@ -81882,7 +81883,12 @@ var hfs = new NodeHfs();
|
|
|
81882
81883
|
|
|
81883
81884
|
// src/commit/commit-state.ts
|
|
81884
81885
|
import { execSync } from "node:child_process";
|
|
81885
|
-
import {
|
|
81886
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
81887
|
+
import {
|
|
81888
|
+
createProjectGraphAsync as createProjectGraphAsync2,
|
|
81889
|
+
readCachedProjectGraph as readCachedProjectGraph2,
|
|
81890
|
+
readProjectsConfigurationFromProjectGraph as readProjectsConfigurationFromProjectGraph2
|
|
81891
|
+
} from "nx/src/project-graph/project-graph";
|
|
81886
81892
|
|
|
81887
81893
|
// src/commit/config.ts
|
|
81888
81894
|
init_esm_shims();
|
|
@@ -81894,19 +81900,19 @@ var DEFAULT_COMMIT_CONFIG = {
|
|
|
81894
81900
|
};
|
|
81895
81901
|
|
|
81896
81902
|
// src/commit/commit-state.ts
|
|
81897
|
-
|
|
81903
|
+
function getGitDir() {
|
|
81898
81904
|
const devNull = process.platform === "win32" ? " nul" : "/dev/null";
|
|
81899
81905
|
const dir = execSync(`git rev-parse --absolute-git-dir 2>${devNull}`).toString().trim();
|
|
81900
81906
|
return dir;
|
|
81901
|
-
}
|
|
81902
|
-
|
|
81907
|
+
}
|
|
81908
|
+
function getGitRootDir() {
|
|
81903
81909
|
const devNull = process.platform === "win32" ? " nul" : "/dev/null";
|
|
81904
81910
|
const dir = execSync(`git rev-parse --show-toplevel 2>${devNull}`).toString().trim();
|
|
81905
81911
|
return dir;
|
|
81906
|
-
}
|
|
81907
|
-
|
|
81912
|
+
}
|
|
81913
|
+
async function resolveCommitOptions(config, workspaceConfig) {
|
|
81908
81914
|
return {
|
|
81909
|
-
utils: { getScopeEnum },
|
|
81915
|
+
utils: { getScopeEnum: getScopeEnumUtil({ config: workspaceConfig }) },
|
|
81910
81916
|
parserPreset: "conventional-changelog-conventionalcommits",
|
|
81911
81917
|
prompt: {
|
|
81912
81918
|
settings: config.settings,
|
|
@@ -81914,9 +81920,11 @@ var resolveCommitOptions = async (config) => {
|
|
|
81914
81920
|
questions: config.questions
|
|
81915
81921
|
}
|
|
81916
81922
|
};
|
|
81917
|
-
}
|
|
81918
|
-
|
|
81919
|
-
|
|
81923
|
+
}
|
|
81924
|
+
async function resolveDefaultCommitOptions(config) {
|
|
81925
|
+
return resolveCommitOptions(DEFAULT_COMMIT_CONFIG, config);
|
|
81926
|
+
}
|
|
81927
|
+
async function createState(config, commitizenFile = "@storm-software/git-tools/commit/config") {
|
|
81920
81928
|
let root2;
|
|
81921
81929
|
try {
|
|
81922
81930
|
root2 = getGitRootDir();
|
|
@@ -81926,7 +81934,7 @@ var createState = async (config, commitizenFile = "@storm-software/git-tools/com
|
|
|
81926
81934
|
let state;
|
|
81927
81935
|
if (commitizenFile === "@storm-software/git-tools/commit/config") {
|
|
81928
81936
|
state = {
|
|
81929
|
-
config: await resolveDefaultCommitOptions(),
|
|
81937
|
+
config: await resolveDefaultCommitOptions(config),
|
|
81930
81938
|
root: root2,
|
|
81931
81939
|
answers: {}
|
|
81932
81940
|
};
|
|
@@ -81938,7 +81946,8 @@ var createState = async (config, commitizenFile = "@storm-software/git-tools/com
|
|
|
81938
81946
|
}
|
|
81939
81947
|
state = {
|
|
81940
81948
|
config: await resolveCommitOptions(
|
|
81941
|
-
defu(commitizenConfig ?? {}, DEFAULT_COMMIT_CONFIG)
|
|
81949
|
+
defu(commitizenConfig ?? {}, DEFAULT_COMMIT_CONFIG),
|
|
81950
|
+
config
|
|
81942
81951
|
),
|
|
81943
81952
|
root: root2,
|
|
81944
81953
|
answers: {}
|
|
@@ -81947,20 +81956,22 @@ var createState = async (config, commitizenFile = "@storm-software/git-tools/com
|
|
|
81947
81956
|
if (state.config.prompt.questions.type && state.config.prompt.questions.type.enum) {
|
|
81948
81957
|
state.config.prompt.questions.type.enum = Object.keys(state.config.prompt.questions.type.enum).reduce(
|
|
81949
81958
|
(ret, key) => {
|
|
81950
|
-
|
|
81951
|
-
|
|
81952
|
-
|
|
81953
|
-
|
|
81954
|
-
|
|
81959
|
+
if (state.config.prompt.questions.type.enum) {
|
|
81960
|
+
ret[key] = {
|
|
81961
|
+
...state.config.prompt.questions.type.enum[key],
|
|
81962
|
+
title: chalk_template_default`${state.config.prompt.questions.type.enum[key]?.emoji ? `${state.config.prompt.questions.type.enum[key]?.emoji} ` : ""}{bold ${key}} ${state.config.prompt.questions.type.enum[key]?.title && state.config.prompt.questions.type.enum[key]?.title !== key ? `- ${state.config.prompt.questions.type.enum[key]?.title}` : ""}${state.config.prompt.questions.type.enum[key]?.semverBump ? ` (version bump: ${state.config.prompt.questions.type.enum[key]?.semverBump})` : ""}`,
|
|
81963
|
+
hidden: false
|
|
81964
|
+
};
|
|
81965
|
+
}
|
|
81955
81966
|
return ret;
|
|
81956
81967
|
},
|
|
81957
81968
|
{}
|
|
81958
81969
|
);
|
|
81959
81970
|
}
|
|
81960
81971
|
if (!state.config.prompt.questions.scope || !state.config.prompt.questions.scope.enum || Object.keys(state.config.prompt.questions.scope.enum).length === 0) {
|
|
81961
|
-
const
|
|
81962
|
-
|
|
81963
|
-
|
|
81972
|
+
const scopes = await getScopeEnum({
|
|
81973
|
+
config
|
|
81974
|
+
});
|
|
81964
81975
|
for (const scope of scopes) {
|
|
81965
81976
|
if (scope === "monorepo") {
|
|
81966
81977
|
state.config.prompt.questions.scope.enum[scope] = {
|
|
@@ -81970,15 +81981,29 @@ var createState = async (config, commitizenFile = "@storm-software/git-tools/com
|
|
|
81970
81981
|
projectRoot: "/"
|
|
81971
81982
|
};
|
|
81972
81983
|
} else {
|
|
81973
|
-
let
|
|
81984
|
+
let projectGraph;
|
|
81974
81985
|
try {
|
|
81975
|
-
|
|
81976
|
-
} catch
|
|
81986
|
+
projectGraph = readCachedProjectGraph2();
|
|
81987
|
+
} catch {
|
|
81988
|
+
await createProjectGraphAsync2();
|
|
81989
|
+
projectGraph = readCachedProjectGraph2();
|
|
81990
|
+
}
|
|
81991
|
+
if (!projectGraph) {
|
|
81992
|
+
throw new Error(
|
|
81993
|
+
"Failed to load the project graph. Please run `nx reset`, then run the `storm-git commit` command again."
|
|
81994
|
+
);
|
|
81995
|
+
}
|
|
81996
|
+
const projectConfigurations = readProjectsConfigurationFromProjectGraph2(projectGraph);
|
|
81997
|
+
if (!projectConfigurations?.projects?.[scope]) {
|
|
81998
|
+
throw new Error(
|
|
81999
|
+
`Failed to load the project configuration for project ${scope}. Please run \`nx reset\`, then run the \`storm-git commit\` command again.`
|
|
82000
|
+
);
|
|
81977
82001
|
}
|
|
82002
|
+
const project = projectConfigurations.projects[scope];
|
|
81978
82003
|
if (project) {
|
|
81979
82004
|
let description = `${project.name} - ${project.root}`;
|
|
81980
82005
|
const packageJsonPath = joinPaths(project.root, "package.json");
|
|
81981
|
-
if (
|
|
82006
|
+
if (existsSync2(packageJsonPath)) {
|
|
81982
82007
|
const packageJson = await hfs.json(packageJsonPath);
|
|
81983
82008
|
description = packageJson.description || description;
|
|
81984
82009
|
}
|
|
@@ -82000,7 +82025,7 @@ var createState = async (config, commitizenFile = "@storm-software/git-tools/com
|
|
|
82000
82025
|
{}
|
|
82001
82026
|
);
|
|
82002
82027
|
return state;
|
|
82003
|
-
}
|
|
82028
|
+
}
|
|
82004
82029
|
|
|
82005
82030
|
// src/commit/format-commit-message.ts
|
|
82006
82031
|
init_esm_shims();
|
|
@@ -82115,10 +82140,10 @@ var askQuestion = (index, question) => {
|
|
|
82115
82140
|
if (question.type === "select" && question.enum && Object.keys(question.enum).length > 1) {
|
|
82116
82141
|
return esm_default11({
|
|
82117
82142
|
message: message2,
|
|
82118
|
-
choices: Object.keys(question.enum).filter((key) => !question.enum[key]?.hidden).map((key) => ({
|
|
82119
|
-
name: question.enum[key]?.title || key,
|
|
82143
|
+
choices: Object.keys(question.enum).filter((key) => !question.enum?.[key]?.hidden).map((key) => ({
|
|
82144
|
+
name: question.enum?.[key]?.title || key,
|
|
82120
82145
|
value: key,
|
|
82121
|
-
description: question.enum[key]?.description || ""
|
|
82146
|
+
description: question.enum?.[key]?.description || ""
|
|
82122
82147
|
})),
|
|
82123
82148
|
default: String(question.defaultValue || "")
|
|
82124
82149
|
});
|
|
@@ -82152,7 +82177,7 @@ var askQuestion = (index, question) => {
|
|
|
82152
82177
|
// src/readme/run.ts
|
|
82153
82178
|
init_esm_shims();
|
|
82154
82179
|
import {
|
|
82155
|
-
existsSync as
|
|
82180
|
+
existsSync as existsSync4,
|
|
82156
82181
|
readFileSync as readFileSync3,
|
|
82157
82182
|
readdirSync as readdirSync2,
|
|
82158
82183
|
rmSync,
|
|
@@ -82160,8 +82185,8 @@ import {
|
|
|
82160
82185
|
} from "node:fs";
|
|
82161
82186
|
import { join as join5 } from "node:path";
|
|
82162
82187
|
import {
|
|
82163
|
-
createProjectGraphAsync as
|
|
82164
|
-
readProjectsConfigurationFromProjectGraph as
|
|
82188
|
+
createProjectGraphAsync as createProjectGraphAsync3,
|
|
82189
|
+
readProjectsConfigurationFromProjectGraph as readProjectsConfigurationFromProjectGraph3
|
|
82165
82190
|
} from "nx/src/project-graph/project-graph.js";
|
|
82166
82191
|
|
|
82167
82192
|
// src/utilities/file-utils.ts
|
|
@@ -87417,7 +87442,7 @@ function findMarkdownFiles(currentPath) {
|
|
|
87417
87442
|
|
|
87418
87443
|
// src/readme/nx-docs.ts
|
|
87419
87444
|
init_esm_shims();
|
|
87420
|
-
import { existsSync as
|
|
87445
|
+
import { existsSync as existsSync3, readFileSync as readFileSync2 } from "node:fs";
|
|
87421
87446
|
import { join as join4 } from "node:path";
|
|
87422
87447
|
var getExecutorMarkdown = (_packageName, executorsJsonFile, executorsJson) => {
|
|
87423
87448
|
if (!executorsJson?.executors) {
|
|
@@ -87436,7 +87461,7 @@ var getExecutorMarkdown = (_packageName, executorsJsonFile, executorsJson) => {
|
|
|
87436
87461
|
findFilePath(executorsJsonFile),
|
|
87437
87462
|
executor.schema
|
|
87438
87463
|
);
|
|
87439
|
-
if (
|
|
87464
|
+
if (existsSync3(schemaJsonPath)) {
|
|
87440
87465
|
const schemaJson = JSON.parse(
|
|
87441
87466
|
readFileSync2(schemaJsonPath, "utf8") ?? "{}"
|
|
87442
87467
|
);
|
|
@@ -87534,7 +87559,7 @@ var getGeneratorMarkdown = (packageName, generatorsJsonFile, generatorsJson) =>
|
|
|
87534
87559
|
findFilePath(generatorsJsonFile),
|
|
87535
87560
|
generator.schema
|
|
87536
87561
|
);
|
|
87537
|
-
if (
|
|
87562
|
+
if (existsSync3(schemaJsonPath)) {
|
|
87538
87563
|
const schemaJson = JSON.parse(
|
|
87539
87564
|
readFileSync2(schemaJsonPath, "utf8") ?? "{}"
|
|
87540
87565
|
);
|
|
@@ -87711,10 +87736,10 @@ var runReadme = async ({
|
|
|
87711
87736
|
clean = true,
|
|
87712
87737
|
prettier = true
|
|
87713
87738
|
}) => {
|
|
87714
|
-
const projectGraph = await
|
|
87739
|
+
const projectGraph = await createProjectGraphAsync3({
|
|
87715
87740
|
exitOnError: true
|
|
87716
87741
|
});
|
|
87717
|
-
const projectConfigs =
|
|
87742
|
+
const projectConfigs = readProjectsConfigurationFromProjectGraph3(projectGraph);
|
|
87718
87743
|
if (project) {
|
|
87719
87744
|
await runProjectReadme(project, {
|
|
87720
87745
|
templates,
|
|
@@ -87734,16 +87759,16 @@ var runReadme = async ({
|
|
|
87734
87759
|
}
|
|
87735
87760
|
};
|
|
87736
87761
|
var runProjectReadme = async (projectName, { templates, output: output3, clean = true, prettier = true }) => {
|
|
87737
|
-
const projectGraph = await
|
|
87762
|
+
const projectGraph = await createProjectGraphAsync3({
|
|
87738
87763
|
exitOnError: true
|
|
87739
87764
|
});
|
|
87740
|
-
const projectConfigs =
|
|
87765
|
+
const projectConfigs = readProjectsConfigurationFromProjectGraph3(projectGraph);
|
|
87741
87766
|
const project = projectConfigs.projects[projectName];
|
|
87742
87767
|
const inputFile = join5(project?.root ?? "./", "README.md");
|
|
87743
|
-
if (
|
|
87768
|
+
if (existsSync4(inputFile)) {
|
|
87744
87769
|
console.info(`Formatting ${projectName}'s README file at "${inputFile}"`);
|
|
87745
87770
|
const outputFilePath = output3 ? output3.includes("README.md") ? output3 : join5(findFilePath(output3), "README.md") : inputFile;
|
|
87746
|
-
if (clean &&
|
|
87771
|
+
if (clean && existsSync4(outputFilePath)) {
|
|
87747
87772
|
if (outputFilePath === inputFile) {
|
|
87748
87773
|
console.warn(
|
|
87749
87774
|
"Skipping cleaning since output directory + file name is the same as input directory + file name."
|
|
@@ -87767,7 +87792,7 @@ var runProjectReadme = async (projectName, { templates, output: output3, clean =
|
|
|
87767
87792
|
);
|
|
87768
87793
|
let packageName = projectName;
|
|
87769
87794
|
const packageJsonPath = join5(findFilePath(inputFile), "package.json");
|
|
87770
|
-
if (
|
|
87795
|
+
if (existsSync4(packageJsonPath)) {
|
|
87771
87796
|
const packageJson = JSON.parse(
|
|
87772
87797
|
readFileSync3(packageJsonPath, "utf8") ?? "{}"
|
|
87773
87798
|
);
|
|
@@ -87784,7 +87809,7 @@ var runProjectReadme = async (projectName, { templates, output: output3, clean =
|
|
|
87784
87809
|
}
|
|
87785
87810
|
if (newContent.includes("<!-- START executors -->")) {
|
|
87786
87811
|
const executorsJsonPath = join5(findFilePath(inputFile), "executors.json");
|
|
87787
|
-
if (
|
|
87812
|
+
if (existsSync4(executorsJsonPath)) {
|
|
87788
87813
|
const executorsJson = JSON.parse(
|
|
87789
87814
|
readFileSync3(executorsJsonPath, "utf8") ?? "{}"
|
|
87790
87815
|
);
|
|
@@ -87803,7 +87828,7 @@ var runProjectReadme = async (projectName, { templates, output: output3, clean =
|
|
|
87803
87828
|
findFilePath(inputFile),
|
|
87804
87829
|
"generators.json"
|
|
87805
87830
|
);
|
|
87806
|
-
if (
|
|
87831
|
+
if (existsSync4(generatorsJsonPath)) {
|
|
87807
87832
|
const generatorsJson = JSON.parse(
|
|
87808
87833
|
readFileSync3(generatorsJsonPath, "utf8") ?? "{}"
|
|
87809
87834
|
);
|
|
@@ -87864,7 +87889,7 @@ var runProjectReadme = async (projectName, { templates, output: output3, clean =
|
|
|
87864
87889
|
// src/release/run.ts
|
|
87865
87890
|
init_esm_shims();
|
|
87866
87891
|
var import_devkit2 = __toESM(require_devkit(), 1);
|
|
87867
|
-
import { existsSync as
|
|
87892
|
+
import { existsSync as existsSync6 } from "node:fs";
|
|
87868
87893
|
import { readFile as readFile2, writeFile } from "node:fs/promises";
|
|
87869
87894
|
import { createAPI as createReleasePublishAPI } from "nx/src/command-line/release/publish.js";
|
|
87870
87895
|
import { createAPI as createReleaseVersionAPI } from "nx/src/command-line/release/version.js";
|
|
@@ -87920,7 +87945,7 @@ import {
|
|
|
87920
87945
|
createFileMapUsingProjectGraph,
|
|
87921
87946
|
createProjectFileMapUsingProjectGraph
|
|
87922
87947
|
} from "nx/src/project-graph/file-map-utils";
|
|
87923
|
-
import { createProjectGraphAsync as
|
|
87948
|
+
import { createProjectGraphAsync as createProjectGraphAsync4 } from "nx/src/project-graph/project-graph";
|
|
87924
87949
|
import { interpolate } from "nx/src/tasks-runner/utils";
|
|
87925
87950
|
import { isCI } from "nx/src/utils/is-ci";
|
|
87926
87951
|
import { output as output2 } from "nx/src/utils/output";
|
|
@@ -91468,7 +91493,7 @@ var import_devkit = __toESM(require_devkit(), 1);
|
|
|
91468
91493
|
var chalk2 = __toESM(require_source(), 1);
|
|
91469
91494
|
var import_enquirer = __toESM(require_enquirer(), 1);
|
|
91470
91495
|
import { execSync as execSync2 } from "node:child_process";
|
|
91471
|
-
import { existsSync as
|
|
91496
|
+
import { existsSync as existsSync5, promises as fsp } from "node:fs";
|
|
91472
91497
|
import { homedir } from "node:os";
|
|
91473
91498
|
import { printDiff } from "nx/src/command-line/release/utils/print-changes";
|
|
91474
91499
|
import { defaultCreateReleaseProvider } from "nx/src/command-line/release/utils/remote-release-clients/github";
|
|
@@ -91710,7 +91735,7 @@ async function resolveGithubToken(hostname) {
|
|
|
91710
91735
|
"gh",
|
|
91711
91736
|
"hosts.yml"
|
|
91712
91737
|
);
|
|
91713
|
-
if (
|
|
91738
|
+
if (existsSync5(ghCLIPath)) {
|
|
91714
91739
|
const yamlContents = await fsp.readFile(ghCLIPath, "utf8");
|
|
91715
91740
|
const { load: load2 } = require_js_yaml();
|
|
91716
91741
|
const ghCLIConfig = load2(yamlContents);
|
|
@@ -91978,7 +92003,7 @@ var StormChangelogRenderer = class extends DefaultChangelogRenderer {
|
|
|
91978
92003
|
function createAPI(overrideReleaseConfig) {
|
|
91979
92004
|
return async function releaseChangelog(args) {
|
|
91980
92005
|
const workspaceConfig = await getWorkspaceConfig();
|
|
91981
|
-
const projectGraph = await
|
|
92006
|
+
const projectGraph = await createProjectGraphAsync4({ exitOnError: true });
|
|
91982
92007
|
const nxJson = readNxJson();
|
|
91983
92008
|
const userProvidedReleaseConfig = deepMergeJson(
|
|
91984
92009
|
nxJson.release ?? {},
|
|
@@ -93213,12 +93238,12 @@ async function updatePackageManifests(projectsVersionData, config) {
|
|
|
93213
93238
|
);
|
|
93214
93239
|
const packageJsonPath = joinPaths(projectRoot, "package.json");
|
|
93215
93240
|
const cargoTomlPath = joinPaths(projectRoot, "Cargo.toml");
|
|
93216
|
-
if (
|
|
93241
|
+
if (existsSync6(packageJsonPath)) {
|
|
93217
93242
|
const packageJsonContent = await readFile2(packageJsonPath, "utf8");
|
|
93218
93243
|
const packageJson = JSON.parse(packageJsonContent);
|
|
93219
93244
|
packageJson.version = versionData.newVersion;
|
|
93220
93245
|
await writeFile(packageJsonPath, JSON.stringify(packageJson));
|
|
93221
|
-
} else if (
|
|
93246
|
+
} else if (existsSync6(cargoTomlPath)) {
|
|
93222
93247
|
const cargoToml = parseCargoToml(
|
|
93223
93248
|
await readFile2(cargoTomlPath, "utf8")
|
|
93224
93249
|
);
|
|
@@ -29,7 +29,7 @@ var DEFAULT_COMMIT_RULES = {
|
|
|
29
29
|
};
|
|
30
30
|
var DEFAULT_COMMITLINT_CONFIG = {
|
|
31
31
|
rules: DEFAULT_COMMIT_RULES,
|
|
32
|
-
helpUrl: "https://stormsoftware.com/
|
|
32
|
+
helpUrl: "https://developer.stormsoftware.com/commitlint",
|
|
33
33
|
parserOpts: {
|
|
34
34
|
headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/,
|
|
35
35
|
breakingHeaderPattern: /^(\w*)(?:\((.*)\))?!: (.*)$/,
|
|
@@ -29,7 +29,7 @@ var DEFAULT_COMMIT_RULES = {
|
|
|
29
29
|
};
|
|
30
30
|
var DEFAULT_COMMITLINT_CONFIG = {
|
|
31
31
|
rules: DEFAULT_COMMIT_RULES,
|
|
32
|
-
helpUrl: "https://stormsoftware.com/
|
|
32
|
+
helpUrl: "https://developer.stormsoftware.com/commitlint",
|
|
33
33
|
parserOpts: {
|
|
34
34
|
headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/,
|
|
35
35
|
breakingHeaderPattern: /^(\w*)(?:\((.*)\))?!: (.*)$/,
|