@storm-software/git-tools 2.112.1 → 2.112.3
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/{chunk-XE275LJT.cjs → chunk-MZP2IRY3.cjs} +46 -3
- package/bin/{chunk-EAYXHTXS.js → chunk-OVA4IJGK.js} +46 -3
- package/bin/git.cjs +138 -121
- package/bin/git.js +27 -10
- package/bin/post-checkout.cjs +9 -9
- package/bin/post-checkout.js +1 -1
- package/bin/post-commit.cjs +9 -9
- package/bin/post-commit.js +1 -1
- package/bin/post-merge.cjs +9 -9
- package/bin/post-merge.js +1 -1
- package/bin/pre-commit.cjs +9 -9
- package/bin/pre-commit.js +1 -1
- package/bin/pre-install.cjs +9 -9
- package/bin/pre-install.js +1 -1
- package/bin/pre-push.cjs +13 -13
- package/bin/pre-push.js +1 -1
- package/bin/prepare.cjs +7 -7
- package/bin/prepare.js +1 -1
- package/bin/version-warning.cjs +5 -5
- package/bin/version-warning.js +1 -1
- package/package.json +1 -1
package/bin/git.cjs
CHANGED
|
@@ -20,7 +20,7 @@ var _chunkGWDOCACNcjs = require('./chunk-GWDOCACN.cjs');
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkMZP2IRY3cjs = require('./chunk-MZP2IRY3.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
var _chunkFMYKTN2Zcjs = require('./chunk-FMYKTN2Z.cjs');
|
|
@@ -3274,7 +3274,7 @@ var require_wrap_ansi = _chunkIG6EXAQUcjs.__commonJS.call(void 0, {
|
|
|
3274
3274
|
_chunkIG6EXAQUcjs.init_cjs_shims.call(void 0, );
|
|
3275
3275
|
var stringWidth = require_string_width();
|
|
3276
3276
|
var stripAnsi2 = require_strip_ansi();
|
|
3277
|
-
var ansiStyles2 =
|
|
3277
|
+
var ansiStyles2 = _chunkMZP2IRY3cjs.require_ansi_styles.call(void 0, );
|
|
3278
3278
|
var ESCAPES2 = /* @__PURE__ */ new Set([
|
|
3279
3279
|
"\x1B",
|
|
3280
3280
|
"\x9B"
|
|
@@ -15298,7 +15298,7 @@ var require_node = _chunkIG6EXAQUcjs.__commonJS.call(void 0, {
|
|
|
15298
15298
|
);
|
|
15299
15299
|
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
15300
15300
|
try {
|
|
15301
|
-
const supportsColor2 =
|
|
15301
|
+
const supportsColor2 = _chunkMZP2IRY3cjs.require_supports_color.call(void 0, );
|
|
15302
15302
|
if (supportsColor2 && (supportsColor2.stderr || supportsColor2).level >= 2) {
|
|
15303
15303
|
exports.colors = [
|
|
15304
15304
|
20,
|
|
@@ -70469,7 +70469,7 @@ function getRuleFromScopeEnum(scopeEnum2) {
|
|
|
70469
70469
|
// src/commitlint/run.ts
|
|
70470
70470
|
var COMMIT_EDITMSG_PATH = ".git/COMMIT_EDITMSG";
|
|
70471
70471
|
var runCommitLint = async (config, params) => {
|
|
70472
|
-
|
|
70472
|
+
_chunkMZP2IRY3cjs.writeInfo.call(void 0,
|
|
70473
70473
|
"\u{1F4DD} Validating git commit message aligns with the Storm Software specification",
|
|
70474
70474
|
config
|
|
70475
70475
|
);
|
|
@@ -70477,7 +70477,7 @@ var runCommitLint = async (config, params) => {
|
|
|
70477
70477
|
if (params.message && params.message !== COMMIT_EDITMSG_PATH) {
|
|
70478
70478
|
commitMessage = params.message;
|
|
70479
70479
|
} else {
|
|
70480
|
-
const commitFile =
|
|
70480
|
+
const commitFile = _chunkMZP2IRY3cjs.joinPaths.call(void 0,
|
|
70481
70481
|
config.workspaceRoot,
|
|
70482
70482
|
params.file || params.message || COMMIT_EDITMSG_PATH
|
|
70483
70483
|
);
|
|
@@ -70494,17 +70494,17 @@ var runCommitLint = async (config, params) => {
|
|
|
70494
70494
|
if (upstreamRemote) {
|
|
70495
70495
|
const upstreamRemoteIdentifier = _optionalChain([upstreamRemote, 'access', _84 => _84.split, 'call', _85 => _85(" "), 'access', _86 => _86[0], 'optionalAccess', _87 => _87.trim, 'call', _88 => _88()]);
|
|
70496
70496
|
if (!upstreamRemoteIdentifier) {
|
|
70497
|
-
|
|
70497
|
+
_chunkMZP2IRY3cjs.writeWarning.call(void 0,
|
|
70498
70498
|
`No upstream remote found for ${config.name}.git. Skipping comparison.`,
|
|
70499
70499
|
config
|
|
70500
70500
|
);
|
|
70501
70501
|
return;
|
|
70502
70502
|
}
|
|
70503
|
-
|
|
70503
|
+
_chunkMZP2IRY3cjs.writeDebug.call(void 0, `Comparing against remote ${upstreamRemoteIdentifier}`);
|
|
70504
70504
|
const currentBranch = _child_process2.default.execSync("git branch --show-current").toString().trim();
|
|
70505
70505
|
gitLogCmd = gitLogCmd + ` ${currentBranch} ^${upstreamRemoteIdentifier}/main`;
|
|
70506
70506
|
} else {
|
|
70507
|
-
|
|
70507
|
+
_chunkMZP2IRY3cjs.writeWarning.call(void 0,
|
|
70508
70508
|
`No upstream remote found for ${config.name}.git. Skipping comparison against upstream main.`,
|
|
70509
70509
|
config
|
|
70510
70510
|
);
|
|
@@ -70512,7 +70512,7 @@ var runCommitLint = async (config, params) => {
|
|
|
70512
70512
|
}
|
|
70513
70513
|
commitMessage = _child_process2.default.execSync(gitLogCmd).toString().trim();
|
|
70514
70514
|
if (!commitMessage) {
|
|
70515
|
-
|
|
70515
|
+
_chunkMZP2IRY3cjs.writeWarning.call(void 0,
|
|
70516
70516
|
"No commits found. Skipping commit message validation.",
|
|
70517
70517
|
config
|
|
70518
70518
|
);
|
|
@@ -70535,7 +70535,7 @@ var runCommitLint = async (config, params) => {
|
|
|
70535
70535
|
helpUrl: commitlintConfig.helpUrl
|
|
70536
70536
|
});
|
|
70537
70537
|
if (!matchCommit || report.errors.length || report.warnings.length) {
|
|
70538
|
-
|
|
70538
|
+
_chunkMZP2IRY3cjs.writeSuccess.call(void 0, `Commit was processing completed successfully!`, config);
|
|
70539
70539
|
} else {
|
|
70540
70540
|
let errorMessage = " Oh no! Your commit message: \n-------------------------------------------------------------------\n" + commitMessage + "\n-------------------------------------------------------------------\n\n Does not follow the commit message convention specified by Storm Software.";
|
|
70541
70541
|
errorMessage += "\ntype(scope): subject \n BLANK LINE \n body";
|
|
@@ -71696,7 +71696,7 @@ async function createState(config, commitizenFile = "@storm-software/git-tools/c
|
|
|
71696
71696
|
answers: {}
|
|
71697
71697
|
};
|
|
71698
71698
|
} else {
|
|
71699
|
-
|
|
71699
|
+
_chunkMZP2IRY3cjs.writeInfo.call(void 0, `Using custom commit config file: ${commitizenFile}`, config);
|
|
71700
71700
|
let commitizenConfig = await Promise.resolve().then(() => _interopRequireWildcard(require(commitizenFile)));
|
|
71701
71701
|
if (_optionalChain([commitizenConfig, 'optionalAccess', _94 => _94.default])) {
|
|
71702
71702
|
commitizenConfig = _optionalChain([commitizenConfig, 'optionalAccess', _95 => _95.default]);
|
|
@@ -71759,7 +71759,7 @@ async function createState(config, commitizenFile = "@storm-software/git-tools/c
|
|
|
71759
71759
|
const project = projectConfigurations.projects[scope];
|
|
71760
71760
|
if (project) {
|
|
71761
71761
|
let description = `${project.name} - ${project.root}`;
|
|
71762
|
-
const packageJsonPath =
|
|
71762
|
+
const packageJsonPath = _chunkMZP2IRY3cjs.joinPaths.call(void 0, project.root, "package.json");
|
|
71763
71763
|
if (_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
71764
71764
|
const packageJson = await hfs.json(packageJsonPath);
|
|
71765
71765
|
description = packageJson.description || description;
|
|
@@ -71839,10 +71839,10 @@ ${closedIssueEmoji}${config.prompt.settings.closedIssueMessage}${issues}`;
|
|
|
71839
71839
|
|
|
71840
71840
|
// src/commit/run.ts
|
|
71841
71841
|
var runCommit = async (commitizenFile = "@storm-software/git-tools/commit/config", dryRun = false) => {
|
|
71842
|
-
const config = await
|
|
71842
|
+
const config = await _chunkMZP2IRY3cjs.getConfig.call(void 0, );
|
|
71843
71843
|
const state = await createState(config, commitizenFile);
|
|
71844
71844
|
if (dryRun) {
|
|
71845
|
-
|
|
71845
|
+
_chunkMZP2IRY3cjs.writeInfo.call(void 0, "Running in dry mode.", config);
|
|
71846
71846
|
}
|
|
71847
71847
|
console.log(chalk_template_default`
|
|
71848
71848
|
{bold.#999999 ----------------------------------------}
|
|
@@ -71852,7 +71852,7 @@ var runCommit = async (commitizenFile = "@storm-software/git-tools/commit/config
|
|
|
71852
71852
|
`);
|
|
71853
71853
|
state.answers = await askQuestions(state);
|
|
71854
71854
|
const message2 = formatCommitMessage(state);
|
|
71855
|
-
const commitMsgFile =
|
|
71855
|
+
const commitMsgFile = _chunkMZP2IRY3cjs.joinPaths.call(void 0, getGitDir(), "COMMIT_EDITMSG");
|
|
71856
71856
|
console.log(chalk_template_default`
|
|
71857
71857
|
{bold.#999999 ----------------------------------------}
|
|
71858
71858
|
|
|
@@ -71865,11 +71865,11 @@ var runCommit = async (commitizenFile = "@storm-software/git-tools/commit/config
|
|
|
71865
71865
|
commandItems.push(...["--file", commitMsgFile]);
|
|
71866
71866
|
const command = (0, import_any_shell_escape.default)(commandItems);
|
|
71867
71867
|
if (dryRun) {
|
|
71868
|
-
|
|
71868
|
+
_chunkMZP2IRY3cjs.writeDebug.call(void 0,
|
|
71869
71869
|
`Skipping execution [dry-run]: ${command.replace(commitMsgFile, ".git/COMMIT_EDITMSG")}`,
|
|
71870
71870
|
config
|
|
71871
71871
|
);
|
|
71872
|
-
|
|
71872
|
+
_chunkMZP2IRY3cjs.writeDebug.call(void 0, `Message [dry-run]: ${message2}`, config);
|
|
71873
71873
|
} else {
|
|
71874
71874
|
await _promises2.default.writeFile(commitMsgFile, message2);
|
|
71875
71875
|
_chunkGWDOCACNcjs.run.call(void 0, config, command);
|
|
@@ -77652,7 +77652,7 @@ var _nxjsonjs = require('nx/src/config/nx-json.js');
|
|
|
77652
77652
|
|
|
77653
77653
|
// src/release/changelog.ts
|
|
77654
77654
|
_chunkIG6EXAQUcjs.init_cjs_shims.call(void 0, );
|
|
77655
|
-
var chalk3 = _chunkIG6EXAQUcjs.__toESM.call(void 0,
|
|
77655
|
+
var chalk3 = _chunkIG6EXAQUcjs.__toESM.call(void 0, _chunkMZP2IRY3cjs.require_source.call(void 0, ), 1);
|
|
77656
77656
|
var import_enquirer2 = _chunkIG6EXAQUcjs.__toESM.call(void 0, require_enquirer(), 1);
|
|
77657
77657
|
var import_semver2 = _chunkIG6EXAQUcjs.__toESM.call(void 0, require_semver4(), 1);
|
|
77658
77658
|
var import_tmp = _chunkIG6EXAQUcjs.__toESM.call(void 0, require_tmp2(), 1);
|
|
@@ -77998,7 +77998,7 @@ function generateChangelogTitle(version2, project, workspaceConfig) {
|
|
|
77998
77998
|
if (!_optionalChain([workspaceConfig, 'optionalAccess', _188 => _188.name]) || !project) {
|
|
77999
77999
|
return version2;
|
|
78000
78000
|
}
|
|
78001
|
-
return `[${version2}](https://github.com/${workspaceConfig.organization}/${workspaceConfig.name}/releases/tag/${project}%40${version2}) (${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)})`;
|
|
78001
|
+
return `[${version2}](https://github.com/${typeof workspaceConfig.organization === "string" ? workspaceConfig.organization : _optionalChain([workspaceConfig, 'access', _189 => _189.organization, 'optionalAccess', _190 => _190.name])}/${workspaceConfig.name}/releases/tag/${project}%40${version2}) (${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)})`;
|
|
78002
78002
|
}
|
|
78003
78003
|
function parseChangelogMarkdown(contents) {
|
|
78004
78004
|
const CHANGELOG_RELEASE_HEAD_RE = new RegExp(
|
|
@@ -78124,7 +78124,7 @@ async function commitChanges({
|
|
|
78124
78124
|
logFn
|
|
78125
78125
|
}) {
|
|
78126
78126
|
logFn = logFn || console.log;
|
|
78127
|
-
if (!_optionalChain([changedFiles, 'optionalAccess',
|
|
78127
|
+
if (!_optionalChain([changedFiles, 'optionalAccess', _191 => _191.length]) && !_optionalChain([deletedFiles, 'optionalAccess', _192 => _192.length])) {
|
|
78128
78128
|
throw new Error("Error: No changed files to commit");
|
|
78129
78129
|
}
|
|
78130
78130
|
logFn(`Committing changes with git`);
|
|
@@ -81569,7 +81569,7 @@ var StormChangelogRenderer = (_class16 = class extends _changelogrenderer2.defau
|
|
|
81569
81569
|
};
|
|
81570
81570
|
}
|
|
81571
81571
|
async render() {
|
|
81572
|
-
this.workspaceConfig = await
|
|
81572
|
+
this.workspaceConfig = await _chunkMZP2IRY3cjs.getWorkspaceConfig.call(void 0, );
|
|
81573
81573
|
return await super.render();
|
|
81574
81574
|
}
|
|
81575
81575
|
preprocessChanges() {
|
|
@@ -81600,7 +81600,7 @@ var StormChangelogRenderer = (_class16 = class extends _changelogrenderer2.defau
|
|
|
81600
81600
|
}
|
|
81601
81601
|
};
|
|
81602
81602
|
for (let i = this.relevantChanges.length - 1; i >= 0; i--) {
|
|
81603
|
-
if (_optionalChain([this, 'access',
|
|
81603
|
+
if (_optionalChain([this, 'access', _193 => _193.relevantChanges, 'access', _194 => _194[i], 'optionalAccess', _195 => _195.isBreaking])) {
|
|
81604
81604
|
const change = this.relevantChanges[i];
|
|
81605
81605
|
if (change) {
|
|
81606
81606
|
this.additionalChangesForAuthorsSection.push(change);
|
|
@@ -81640,8 +81640,11 @@ var StormChangelogRenderer = (_class16 = class extends _changelogrenderer2.defau
|
|
|
81640
81640
|
}
|
|
81641
81641
|
renderDependencyBumps() {
|
|
81642
81642
|
const markdownLines = ["", "### Updated Dependencies", ""];
|
|
81643
|
-
_optionalChain([this, 'access',
|
|
81644
|
-
|
|
81643
|
+
_optionalChain([this, 'access', _196 => _196.dependencyBumps, 'optionalAccess', _197 => _197.forEach, 'call', _198 => _198(({ dependencyName, newVersion }) => {
|
|
81644
|
+
const markdownLine = `- Updated ${dependencyName} to ${newVersion}`;
|
|
81645
|
+
if (!markdownLines.includes(markdownLine)) {
|
|
81646
|
+
markdownLines.push(markdownLine);
|
|
81647
|
+
}
|
|
81645
81648
|
})]);
|
|
81646
81649
|
return markdownLines;
|
|
81647
81650
|
}
|
|
@@ -81657,12 +81660,12 @@ var StormChangelogRenderer = (_class16 = class extends _changelogrenderer2.defau
|
|
|
81657
81660
|
}
|
|
81658
81661
|
for (const author of change.authors) {
|
|
81659
81662
|
const name = this.formatName(author.name);
|
|
81660
|
-
if (!name || name.includes("[bot]") || name === _optionalChain([this, 'access',
|
|
81663
|
+
if (!name || name.includes("[bot]") || name === _optionalChain([this, 'access', _199 => _199.workspaceConfig, 'optionalAccess', _200 => _200.bot, 'access', _201 => _201.name])) {
|
|
81661
81664
|
continue;
|
|
81662
81665
|
}
|
|
81663
81666
|
if (_authors.has(name)) {
|
|
81664
81667
|
const entry = _authors.get(name);
|
|
81665
|
-
_optionalChain([entry, 'optionalAccess',
|
|
81668
|
+
_optionalChain([entry, 'optionalAccess', _202 => _202.email, 'access', _203 => _203.add, 'call', _204 => _204(author.email)]);
|
|
81666
81669
|
} else {
|
|
81667
81670
|
_authors.set(name, { email: /* @__PURE__ */ new Set([author.email]) });
|
|
81668
81671
|
}
|
|
@@ -81686,7 +81689,7 @@ var StormChangelogRenderer = (_class16 = class extends _changelogrenderer2.defau
|
|
|
81686
81689
|
}
|
|
81687
81690
|
}
|
|
81688
81691
|
const { data } = await axios_default.get(`https://ungh.cc/users/find/${email}`).catch(() => ({ data: { user: null } }));
|
|
81689
|
-
if (_optionalChain([data, 'optionalAccess',
|
|
81692
|
+
if (_optionalChain([data, 'optionalAccess', _205 => _205.user])) {
|
|
81690
81693
|
meta.github = data.user.username;
|
|
81691
81694
|
break;
|
|
81692
81695
|
}
|
|
@@ -81740,7 +81743,7 @@ var StormChangelogRenderer = (_class16 = class extends _changelogrenderer2.defau
|
|
|
81740
81743
|
// src/release/github.ts
|
|
81741
81744
|
_chunkIG6EXAQUcjs.init_cjs_shims.call(void 0, );
|
|
81742
81745
|
var import_devkit = _chunkIG6EXAQUcjs.__toESM.call(void 0, require_devkit(), 1);
|
|
81743
|
-
var chalk2 = _chunkIG6EXAQUcjs.__toESM.call(void 0,
|
|
81746
|
+
var chalk2 = _chunkIG6EXAQUcjs.__toESM.call(void 0, _chunkMZP2IRY3cjs.require_source.call(void 0, ), 1);
|
|
81744
81747
|
var import_enquirer = _chunkIG6EXAQUcjs.__toESM.call(void 0, require_enquirer(), 1);
|
|
81745
81748
|
|
|
81746
81749
|
|
|
@@ -81805,7 +81808,7 @@ async function createOrUpdateGithubRelease(createReleaseConfig, releaseVersion,
|
|
|
81805
81808
|
repo: githubRepoData.slug,
|
|
81806
81809
|
hostname: githubRepoData.hostname,
|
|
81807
81810
|
apiBaseUrl: githubRepoData.apiBaseUrl,
|
|
81808
|
-
token: _optionalChain([tokenData, 'optionalAccess',
|
|
81811
|
+
token: _optionalChain([tokenData, 'optionalAccess', _206 => _206.token]) || null
|
|
81809
81812
|
};
|
|
81810
81813
|
let existingGithubReleaseForVersion;
|
|
81811
81814
|
try {
|
|
@@ -81814,7 +81817,7 @@ async function createOrUpdateGithubRelease(createReleaseConfig, releaseVersion,
|
|
|
81814
81817
|
releaseVersion.gitTag
|
|
81815
81818
|
);
|
|
81816
81819
|
} catch (err) {
|
|
81817
|
-
if (_optionalChain([err, 'access',
|
|
81820
|
+
if (_optionalChain([err, 'access', _207 => _207.response, 'optionalAccess', _208 => _208.status]) === 401) {
|
|
81818
81821
|
import_devkit.output.error({
|
|
81819
81822
|
title: `Unable to resolve data via the GitHub API. You can use any of the following options to resolve this:`,
|
|
81820
81823
|
bodyLines: [
|
|
@@ -81824,7 +81827,7 @@ async function createOrUpdateGithubRelease(createReleaseConfig, releaseVersion,
|
|
|
81824
81827
|
});
|
|
81825
81828
|
process.exit(1);
|
|
81826
81829
|
}
|
|
81827
|
-
if (_optionalChain([err, 'access',
|
|
81830
|
+
if (_optionalChain([err, 'access', _209 => _209.response, 'optionalAccess', _210 => _210.status]) === 404) {
|
|
81828
81831
|
} else {
|
|
81829
81832
|
throw err;
|
|
81830
81833
|
}
|
|
@@ -81841,7 +81844,7 @@ async function createOrUpdateGithubRelease(createReleaseConfig, releaseVersion,
|
|
|
81841
81844
|
}
|
|
81842
81845
|
console.log("");
|
|
81843
81846
|
_printchanges.printDiff.call(void 0,
|
|
81844
|
-
_optionalChain([existingGithubReleaseForVersion, 'optionalAccess',
|
|
81847
|
+
_optionalChain([existingGithubReleaseForVersion, 'optionalAccess', _211 => _211.body]) ? existingGithubReleaseForVersion.body : "",
|
|
81845
81848
|
changelogContents,
|
|
81846
81849
|
3,
|
|
81847
81850
|
_shared.noDiffInChangelogMessage
|
|
@@ -81868,7 +81871,7 @@ async function createOrUpdateGithubReleaseInternal(githubRequestConfig, release,
|
|
|
81868
81871
|
if (result2.status === "manual") {
|
|
81869
81872
|
if (result2.error) {
|
|
81870
81873
|
process.exitCode = 1;
|
|
81871
|
-
if (_optionalChain([result2, 'access',
|
|
81874
|
+
if (_optionalChain([result2, 'access', _212 => _212.error, 'access', _213 => _213.response, 'optionalAccess', _214 => _214.data])) {
|
|
81872
81875
|
import_devkit.output.error({
|
|
81873
81876
|
title: `A GitHub API Error occurred when creating/updating the release`,
|
|
81874
81877
|
bodyLines: [
|
|
@@ -82088,9 +82091,9 @@ async function isUserAnOrganizationMember(userId, config, remoteName = "origin")
|
|
|
82088
82091
|
repo: repoData.slug,
|
|
82089
82092
|
hostname: repoData.hostname,
|
|
82090
82093
|
apiBaseUrl: repoData.apiBaseUrl,
|
|
82091
|
-
token: _optionalChain([tokenData, 'optionalAccess',
|
|
82094
|
+
token: _optionalChain([tokenData, 'optionalAccess', _215 => _215.token]) || null
|
|
82092
82095
|
},
|
|
82093
|
-
`/orgs/${config.organization}/members/${userId}`,
|
|
82096
|
+
`/orgs/${typeof config.organization === "string" ? config.organization : _optionalChain([config, 'access', _216 => _216.organization, 'optionalAccess', _217 => _217.name])}/members/${userId}`,
|
|
82094
82097
|
{}
|
|
82095
82098
|
);
|
|
82096
82099
|
if (result2.status !== 204) {
|
|
@@ -82105,7 +82108,7 @@ async function isUserAnOrganizationMember(userId, config, remoteName = "origin")
|
|
|
82105
82108
|
// src/release/changelog.ts
|
|
82106
82109
|
function createAPI(overrideReleaseConfig) {
|
|
82107
82110
|
return async function releaseChangelog(args) {
|
|
82108
|
-
const workspaceConfig = await
|
|
82111
|
+
const workspaceConfig = await _chunkMZP2IRY3cjs.getWorkspaceConfig.call(void 0, );
|
|
82109
82112
|
const projectGraph = await _projectgraph.createProjectGraphAsync.call(void 0, { exitOnError: true });
|
|
82110
82113
|
const nxJson = _nxjson.readNxJson.call(void 0, );
|
|
82111
82114
|
const userProvidedReleaseConfig = _deepmergejson.deepMergeJson.call(void 0,
|
|
@@ -82166,7 +82169,7 @@ function createAPI(overrideReleaseConfig) {
|
|
|
82166
82169
|
if (args.deleteVersionPlans === void 0) {
|
|
82167
82170
|
args.deleteVersionPlans = true;
|
|
82168
82171
|
}
|
|
82169
|
-
const changelogGenerationEnabled = !!_optionalChain([nxReleaseConfig, 'optionalAccess',
|
|
82172
|
+
const changelogGenerationEnabled = !!_optionalChain([nxReleaseConfig, 'optionalAccess', _218 => _218.changelog, 'optionalAccess', _219 => _219.workspaceChangelog]) || _optionalChain([nxReleaseConfig, 'optionalAccess', _220 => _220.groups]) && Object.values(_optionalChain([nxReleaseConfig, 'optionalAccess', _221 => _221.groups])).some((g) => g.changelog);
|
|
82170
82173
|
if (!changelogGenerationEnabled) {
|
|
82171
82174
|
_output.output.warn({
|
|
82172
82175
|
title: `Changelogs are disabled. No changelog entries will be generated`,
|
|
@@ -82177,7 +82180,7 @@ function createAPI(overrideReleaseConfig) {
|
|
|
82177
82180
|
return {};
|
|
82178
82181
|
}
|
|
82179
82182
|
const tree = new (0, _tree.FsTree)(_workspaceroot.workspaceRoot, !!args.verbose);
|
|
82180
|
-
const useAutomaticFromRef = _optionalChain([nxReleaseConfig, 'optionalAccess',
|
|
82183
|
+
const useAutomaticFromRef = _optionalChain([nxReleaseConfig, 'optionalAccess', _222 => _222.changelog, 'optionalAccess', _223 => _223.automaticFromRef]) || args.firstRelease;
|
|
82181
82184
|
const { workspaceChangelogVersion, projectsVersionData } = resolveChangelogVersions(
|
|
82182
82185
|
args,
|
|
82183
82186
|
releaseGroups,
|
|
@@ -82186,20 +82189,20 @@ function createAPI(overrideReleaseConfig) {
|
|
|
82186
82189
|
const to = args.to || "HEAD";
|
|
82187
82190
|
const toSHA = await _git.getCommitHash.call(void 0, to);
|
|
82188
82191
|
const headSHA = to === "HEAD" ? toSHA : await _git.getCommitHash.call(void 0, "HEAD");
|
|
82189
|
-
const autoCommitEnabled = _nullishCoalesce(args.gitCommit, () => ( _optionalChain([nxReleaseConfig, 'access',
|
|
82192
|
+
const autoCommitEnabled = _nullishCoalesce(args.gitCommit, () => ( _optionalChain([nxReleaseConfig, 'access', _224 => _224.changelog, 'optionalAccess', _225 => _225.git, 'access', _226 => _226.commit])));
|
|
82190
82193
|
if (autoCommitEnabled && headSHA !== toSHA) {
|
|
82191
82194
|
throw new Error(
|
|
82192
82195
|
`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`
|
|
82193
82196
|
);
|
|
82194
82197
|
}
|
|
82195
|
-
const commitMessage = args.gitCommitMessage || _optionalChain([nxReleaseConfig, 'access',
|
|
82198
|
+
const commitMessage = args.gitCommitMessage || _optionalChain([nxReleaseConfig, 'access', _227 => _227.changelog, 'optionalAccess', _228 => _228.git, 'optionalAccess', _229 => _229.commitMessage]);
|
|
82196
82199
|
const commitMessageValues = _shared.createCommitMessageValues.call(void 0,
|
|
82197
82200
|
releaseGroups,
|
|
82198
82201
|
releaseGroupToFilteredProjects,
|
|
82199
82202
|
projectsVersionData,
|
|
82200
82203
|
commitMessage
|
|
82201
82204
|
);
|
|
82202
|
-
const gitTagValues = _nullishCoalesce(args.gitTag, () => ( _optionalChain([nxReleaseConfig, 'access',
|
|
82205
|
+
const gitTagValues = _nullishCoalesce(args.gitTag, () => ( _optionalChain([nxReleaseConfig, 'access', _230 => _230.changelog, 'optionalAccess', _231 => _231.git, 'access', _232 => _232.tag]))) ? _shared.createGitTagValues.call(void 0,
|
|
82203
82206
|
releaseGroups,
|
|
82204
82207
|
releaseGroupToFilteredProjects,
|
|
82205
82208
|
projectsVersionData
|
|
@@ -82260,7 +82263,7 @@ function createAPI(overrideReleaseConfig) {
|
|
|
82260
82263
|
nxReleaseConfig.releaseTagPattern,
|
|
82261
82264
|
{},
|
|
82262
82265
|
nxReleaseConfig.releaseTagPatternCheckAllBranchesWhen
|
|
82263
|
-
)), 'optionalAccess', async
|
|
82266
|
+
)), 'optionalAccess', async _233 => _233.tag]);
|
|
82264
82267
|
if (!workspaceChangelogFromRef) {
|
|
82265
82268
|
if (useAutomaticFromRef) {
|
|
82266
82269
|
workspaceChangelogFromRef = await _git.getFirstGitCommit.call(void 0, );
|
|
@@ -82314,7 +82317,7 @@ function createAPI(overrideReleaseConfig) {
|
|
|
82314
82317
|
)
|
|
82315
82318
|
});
|
|
82316
82319
|
if (workspaceChangelog && shouldCreateGitHubRelease(
|
|
82317
|
-
_optionalChain([nxReleaseConfig, 'access',
|
|
82320
|
+
_optionalChain([nxReleaseConfig, 'access', _234 => _234.changelog, 'optionalAccess', _235 => _235.workspaceChangelog]),
|
|
82318
82321
|
args.createRelease
|
|
82319
82322
|
)) {
|
|
82320
82323
|
postGitTasks.push(async (latestCommit) => {
|
|
@@ -82328,7 +82331,7 @@ function createAPI(overrideReleaseConfig) {
|
|
|
82328
82331
|
|
|
82329
82332
|
${contents}`);
|
|
82330
82333
|
await createOrUpdateGithubRelease(
|
|
82331
|
-
_optionalChain([nxReleaseConfig, 'access',
|
|
82334
|
+
_optionalChain([nxReleaseConfig, 'access', _236 => _236.changelog, 'optionalAccess', _237 => _237.workspaceChangelog]) ? _optionalChain([nxReleaseConfig, 'access', _238 => _238.changelog, 'optionalAccess', _239 => _239.workspaceChangelog, 'access', _240 => _240.createRelease]) : _github.defaultCreateReleaseProvider,
|
|
82332
82335
|
workspaceChangelog.releaseVersion,
|
|
82333
82336
|
contents,
|
|
82334
82337
|
latestCommit,
|
|
@@ -82346,13 +82349,13 @@ ${contents}`);
|
|
|
82346
82349
|
continue;
|
|
82347
82350
|
}
|
|
82348
82351
|
for (const project of releaseGroup.projects) {
|
|
82349
|
-
if (!_optionalChain([projectsVersionData, 'access',
|
|
82352
|
+
if (!_optionalChain([projectsVersionData, 'access', _241 => _241[project], 'optionalAccess', _242 => _242.newVersion])) {
|
|
82350
82353
|
continue;
|
|
82351
82354
|
}
|
|
82352
82355
|
const dependentProjects = (projectsVersionData[project].dependentProjects || []).map((dep) => {
|
|
82353
82356
|
return {
|
|
82354
82357
|
dependencyName: dep.source,
|
|
82355
|
-
newVersion: _optionalChain([projectsVersionData, 'access',
|
|
82358
|
+
newVersion: _optionalChain([projectsVersionData, 'access', _243 => _243[dep.source], 'optionalAccess', _244 => _244.newVersion])
|
|
82356
82359
|
};
|
|
82357
82360
|
}).filter((b) => b.newVersion !== null);
|
|
82358
82361
|
for (const dependent of dependentProjects) {
|
|
@@ -82374,13 +82377,13 @@ ${contents}`);
|
|
|
82374
82377
|
if (config === false) {
|
|
82375
82378
|
continue;
|
|
82376
82379
|
}
|
|
82377
|
-
const projects = _optionalChain([args, 'access',
|
|
82380
|
+
const projects = _optionalChain([args, 'access', _245 => _245.projects, 'optionalAccess', _246 => _246.length]) ? (
|
|
82378
82381
|
// 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
|
|
82379
82382
|
Array.from(releaseGroupToFilteredProjects.get(releaseGroup)).flatMap(
|
|
82380
82383
|
(project) => {
|
|
82381
82384
|
return [
|
|
82382
82385
|
project,
|
|
82383
|
-
..._optionalChain([projectsVersionData, 'access',
|
|
82386
|
+
..._optionalChain([projectsVersionData, 'access', _247 => _247[project], 'optionalAccess', _248 => _248.dependentProjects, 'access', _249 => _249.map, 'call', _250 => _250(
|
|
82384
82387
|
(dep) => dep.source
|
|
82385
82388
|
)]) || []
|
|
82386
82389
|
];
|
|
@@ -82425,14 +82428,14 @@ ${contents}`);
|
|
|
82425
82428
|
releaseGroupName: releaseGroup.name
|
|
82426
82429
|
},
|
|
82427
82430
|
releaseGroup.releaseTagPatternCheckAllBranchesWhen
|
|
82428
|
-
)), 'optionalAccess', async
|
|
82431
|
+
)), 'optionalAccess', async _251 => _251.tag]);
|
|
82429
82432
|
if (!fromRef && useAutomaticFromRef) {
|
|
82430
82433
|
const firstCommit = await _git.getFirstGitCommit.call(void 0, );
|
|
82431
82434
|
const allCommits = await getCommits(firstCommit, toSHA);
|
|
82432
82435
|
const commitsForProject = allCommits.filter(
|
|
82433
82436
|
(c) => c.affectedFiles.find((f) => f.startsWith(project.data.root))
|
|
82434
82437
|
);
|
|
82435
|
-
fromRef = _optionalChain([commitsForProject, 'access',
|
|
82438
|
+
fromRef = _optionalChain([commitsForProject, 'access', _252 => _252[0], 'optionalAccess', _253 => _253.shortHash]);
|
|
82436
82439
|
if (args.verbose) {
|
|
82437
82440
|
console.log(
|
|
82438
82441
|
`Determined --from ref for ${project.name} from the first commit in which it exists: ${fromRef}`
|
|
@@ -82560,7 +82563,7 @@ ${contents}`);
|
|
|
82560
82563
|
releaseGroup.releaseTagPattern,
|
|
82561
82564
|
{},
|
|
82562
82565
|
releaseGroup.releaseTagPatternCheckAllBranchesWhen
|
|
82563
|
-
)), 'optionalAccess', async
|
|
82566
|
+
)), 'optionalAccess', async _254 => _254.tag]);
|
|
82564
82567
|
if (!fromRef) {
|
|
82565
82568
|
if (useAutomaticFromRef) {
|
|
82566
82569
|
fromRef = await _git.getFirstGitCommit.call(void 0, );
|
|
@@ -82749,17 +82752,17 @@ async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTa
|
|
|
82749
82752
|
});
|
|
82750
82753
|
deletedFiles = Array.from(planFiles);
|
|
82751
82754
|
}
|
|
82752
|
-
if (_nullishCoalesce(args.gitCommit, () => ( _optionalChain([nxReleaseConfig, 'access',
|
|
82755
|
+
if (_nullishCoalesce(args.gitCommit, () => ( _optionalChain([nxReleaseConfig, 'access', _255 => _255.changelog, 'optionalAccess', _256 => _256.git, 'access', _257 => _257.commit])))) {
|
|
82753
82756
|
await commitChanges({
|
|
82754
82757
|
changedFiles,
|
|
82755
82758
|
deletedFiles,
|
|
82756
82759
|
isDryRun: !!args.dryRun,
|
|
82757
82760
|
isVerbose: !!args.verbose,
|
|
82758
82761
|
gitCommitMessages: commitMessageValues,
|
|
82759
|
-
gitCommitArgs: _nullishCoalesce(args.gitCommitArgs, () => ( _optionalChain([nxReleaseConfig, 'access',
|
|
82762
|
+
gitCommitArgs: _nullishCoalesce(args.gitCommitArgs, () => ( _optionalChain([nxReleaseConfig, 'access', _258 => _258.changelog, 'optionalAccess', _259 => _259.git, 'access', _260 => _260.commitArgs])))
|
|
82760
82763
|
});
|
|
82761
82764
|
latestCommit = await _git.getCommitHash.call(void 0, "HEAD");
|
|
82762
|
-
} else if ((_nullishCoalesce(args.stageChanges, () => ( _optionalChain([nxReleaseConfig, 'access',
|
|
82765
|
+
} else if ((_nullishCoalesce(args.stageChanges, () => ( _optionalChain([nxReleaseConfig, 'access', _261 => _261.changelog, 'optionalAccess', _262 => _262.git, 'access', _263 => _263.stageChanges])))) && changes.length) {
|
|
82763
82766
|
_output.output.logSingleLine(`Staging changed files with git`);
|
|
82764
82767
|
await _git.gitAdd.call(void 0, {
|
|
82765
82768
|
changedFiles,
|
|
@@ -82768,19 +82771,19 @@ async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTa
|
|
|
82768
82771
|
verbose: args.verbose
|
|
82769
82772
|
});
|
|
82770
82773
|
}
|
|
82771
|
-
if (_nullishCoalesce(args.gitTag, () => ( _optionalChain([nxReleaseConfig, 'access',
|
|
82774
|
+
if (_nullishCoalesce(args.gitTag, () => ( _optionalChain([nxReleaseConfig, 'access', _264 => _264.changelog, 'optionalAccess', _265 => _265.git, 'access', _266 => _266.tag])))) {
|
|
82772
82775
|
_output.output.logSingleLine(`Tagging commit with git`);
|
|
82773
82776
|
for (const tag of gitTagValues) {
|
|
82774
82777
|
await gitTag({
|
|
82775
82778
|
tag,
|
|
82776
|
-
message: args.gitTagMessage || _optionalChain([nxReleaseConfig, 'access',
|
|
82777
|
-
additionalArgs: args.gitTagArgs || _optionalChain([nxReleaseConfig, 'access',
|
|
82779
|
+
message: args.gitTagMessage || _optionalChain([nxReleaseConfig, 'access', _267 => _267.changelog, 'optionalAccess', _268 => _268.git, 'access', _269 => _269.tagMessage]),
|
|
82780
|
+
additionalArgs: args.gitTagArgs || _optionalChain([nxReleaseConfig, 'access', _270 => _270.changelog, 'optionalAccess', _271 => _271.git, 'access', _272 => _272.tagArgs]),
|
|
82778
82781
|
dryRun: args.dryRun,
|
|
82779
82782
|
verbose: args.verbose
|
|
82780
82783
|
});
|
|
82781
82784
|
}
|
|
82782
82785
|
}
|
|
82783
|
-
if (_nullishCoalesce(args.gitPush, () => ( _optionalChain([nxReleaseConfig, 'access',
|
|
82786
|
+
if (_nullishCoalesce(args.gitPush, () => ( _optionalChain([nxReleaseConfig, 'access', _273 => _273.changelog, 'optionalAccess', _274 => _274.git, 'access', _275 => _275.push])))) {
|
|
82784
82787
|
_output.output.logSingleLine(`Pushing to git remote "${args.gitRemote}"`);
|
|
82785
82788
|
await _git.gitPush.call(void 0, {
|
|
82786
82789
|
gitRemote: args.gitRemote,
|
|
@@ -82800,13 +82803,13 @@ async function generateChangelogForWorkspace({
|
|
|
82800
82803
|
workspaceChangelogVersion,
|
|
82801
82804
|
changes
|
|
82802
82805
|
}) {
|
|
82803
|
-
const workspaceConfig = await
|
|
82806
|
+
const workspaceConfig = await _chunkMZP2IRY3cjs.getWorkspaceConfig.call(void 0, );
|
|
82804
82807
|
if (!workspaceConfig) {
|
|
82805
82808
|
throw new Error(
|
|
82806
82809
|
`Unable to determine the Storm workspace config. Please ensure that your storm-workspace.json file is present and valid.`
|
|
82807
82810
|
);
|
|
82808
82811
|
}
|
|
82809
|
-
const config = _optionalChain([nxReleaseConfig, 'access',
|
|
82812
|
+
const config = _optionalChain([nxReleaseConfig, 'access', _276 => _276.changelog, 'optionalAccess', _277 => _277.workspaceChangelog]);
|
|
82810
82813
|
if (config === false) {
|
|
82811
82814
|
return;
|
|
82812
82815
|
}
|
|
@@ -82828,7 +82831,7 @@ async function generateChangelogForWorkspace({
|
|
|
82828
82831
|
});
|
|
82829
82832
|
return;
|
|
82830
82833
|
}
|
|
82831
|
-
if (_optionalChain([Object, 'access',
|
|
82834
|
+
if (_optionalChain([Object, 'access', _278 => _278.values, 'call', _279 => _279(_nullishCoalesce(nxReleaseConfig.groups, () => ( {}))), 'access', _280 => _280[0], 'optionalAccess', _281 => _281.projectsRelationship]) === "independent") {
|
|
82832
82835
|
_output.output.warn({
|
|
82833
82836
|
title: `Workspace changelog is enabled, but you have configured an independent projects relationship. This is not supported, so workspace changelog will be disabled.`,
|
|
82834
82837
|
bodyLines: [
|
|
@@ -82894,7 +82897,7 @@ async function generateChangelogForWorkspace({
|
|
|
82894
82897
|
releaseVersion,
|
|
82895
82898
|
interpolatedTreePath,
|
|
82896
82899
|
contents,
|
|
82897
|
-
tree.exists(interpolatedTreePath) ? _optionalChain([tree, 'access',
|
|
82900
|
+
tree.exists(interpolatedTreePath) ? _optionalChain([tree, 'access', _282 => _282.read, 'call', _283 => _283(interpolatedTreePath), 'optionalAccess', _284 => _284.toString, 'call', _285 => _285()]) : "",
|
|
82898
82901
|
null,
|
|
82899
82902
|
workspaceConfig
|
|
82900
82903
|
)
|
|
@@ -82916,7 +82919,7 @@ async function generateChangelogForProjects({
|
|
|
82916
82919
|
nxReleaseConfig,
|
|
82917
82920
|
projectToAdditionalDependencyBumps
|
|
82918
82921
|
}) {
|
|
82919
|
-
const workspaceConfig = await
|
|
82922
|
+
const workspaceConfig = await _chunkMZP2IRY3cjs.getWorkspaceConfig.call(void 0, );
|
|
82920
82923
|
if (!workspaceConfig) {
|
|
82921
82924
|
throw new Error(
|
|
82922
82925
|
`Unable to determine the Storm workspace config. Please ensure that your storm-workspace.json file is present and valid.`
|
|
@@ -82939,7 +82942,7 @@ async function generateChangelogForProjects({
|
|
|
82939
82942
|
workspaceRoot: ""
|
|
82940
82943
|
});
|
|
82941
82944
|
}
|
|
82942
|
-
const newVersion = _optionalChain([projectsVersionData, 'access',
|
|
82945
|
+
const newVersion = _optionalChain([projectsVersionData, 'access', _286 => _286[project.name], 'optionalAccess', _287 => _287.newVersion]);
|
|
82943
82946
|
if (!newVersion) {
|
|
82944
82947
|
continue;
|
|
82945
82948
|
}
|
|
@@ -82995,7 +82998,7 @@ ${contents}`.trim()
|
|
|
82995
82998
|
releaseVersion,
|
|
82996
82999
|
interpolatedTreePath,
|
|
82997
83000
|
contents,
|
|
82998
|
-
tree.exists(interpolatedTreePath) ? _optionalChain([tree, 'access',
|
|
83001
|
+
tree.exists(interpolatedTreePath) ? _optionalChain([tree, 'access', _288 => _288.read, 'call', _289 => _289(interpolatedTreePath), 'optionalAccess', _290 => _290.toString, 'call', _291 => _291()]) : "",
|
|
82999
83002
|
project.name,
|
|
83000
83003
|
workspaceConfig
|
|
83001
83004
|
)
|
|
@@ -83019,11 +83022,11 @@ ${contents}`.trim()
|
|
|
83019
83022
|
return projectChangelogs;
|
|
83020
83023
|
}
|
|
83021
83024
|
function checkChangelogFilesEnabled(nxReleaseConfig) {
|
|
83022
|
-
if (_optionalChain([nxReleaseConfig, 'access',
|
|
83025
|
+
if (_optionalChain([nxReleaseConfig, 'access', _292 => _292.changelog, 'optionalAccess', _293 => _293.workspaceChangelog]) && _optionalChain([nxReleaseConfig, 'access', _294 => _294.changelog, 'optionalAccess', _295 => _295.workspaceChangelog, 'access', _296 => _296.file])) {
|
|
83023
83026
|
return true;
|
|
83024
83027
|
}
|
|
83025
83028
|
return Object.values(_nullishCoalesce(nxReleaseConfig.groups, () => ( {}))).some(
|
|
83026
|
-
(releaseGroup) => typeof _optionalChain([releaseGroup, 'optionalAccess',
|
|
83029
|
+
(releaseGroup) => typeof _optionalChain([releaseGroup, 'optionalAccess', _297 => _297.changelog]) === "boolean" && releaseGroup.changelog || _optionalChain([releaseGroup, 'optionalAccess', _298 => _298.changelog, 'optionalAccess', _299 => _299.file])
|
|
83027
83030
|
);
|
|
83028
83031
|
}
|
|
83029
83032
|
async function getCommits(fromSHA, toSHA) {
|
|
@@ -83117,20 +83120,34 @@ function formatGithubReleaseNotes(releaseVersion, content, projectName, workspac
|
|
|
83117
83120
|
if (!workspaceConfig) {
|
|
83118
83121
|
return content;
|
|
83119
83122
|
}
|
|
83120
|
-
return `
|
|
83121
83126
|
${workspaceConfig.release.header || ""}
|
|
83122
83127
|
|
|
83123
83128
|
# ${projectName ? `${titleCase(projectName)} ` : ""}v${releaseVersion.rawVersion}
|
|
83124
83129
|
|
|
83125
|
-
We at [${
|
|
83130
|
+
We at [${workspaceConfig.organization ? titleCase(
|
|
83131
|
+
typeof workspaceConfig.organization === "string" ? workspaceConfig.organization : workspaceConfig.organization.name
|
|
83132
|
+
) : ""}](${workspaceConfig.homepage}) are very excited to announce the v${releaseVersion.rawVersion} release of the ${projectName ? titleCase(projectName) : workspaceConfig.name ? titleCase(workspaceConfig.name) : "Storm Software"} project! \u{1F680}
|
|
83126
83133
|
|
|
83127
83134
|
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}).
|
|
83128
83135
|
|
|
83129
|
-
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',
|
|
83136
|
+
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/${typeof workspaceConfig.organization === "string" ? workspaceConfig.organization : _optionalChain([workspaceConfig, 'access', _300 => _300.organization, 'optionalAccess', _301 => _301.name])}/${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', _302 => _302(projectName), 'optionalAccess', _303 => _303.replaceAll, 'call', _304 => _304(" ", "%20")])}%20` : ""}v${releaseVersion.rawVersion}%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/${typeof workspaceConfig.organization === "string" ? workspaceConfig.organization : _optionalChain([workspaceConfig, 'access', _305 => _305.organization, 'optionalAccess', _306 => _306.name])}/${workspaceConfig.name}/releases/tag/${releaseVersion.gitTag}) about this release!
|
|
83130
83137
|
|
|
83131
83138
|
## Release Notes
|
|
83132
83139
|
|
|
83133
|
-
${content.replaceAll(
|
|
83140
|
+
${content.replaceAll(
|
|
83141
|
+
`## ${generateChangelogTitle(
|
|
83142
|
+
releaseVersion.rawVersion,
|
|
83143
|
+
projectName,
|
|
83144
|
+
workspaceConfig
|
|
83145
|
+
)}`,
|
|
83146
|
+
""
|
|
83147
|
+
).replaceAll(
|
|
83148
|
+
`# ${generateChangelogTitle(releaseVersion.rawVersion, projectName, workspaceConfig)}`,
|
|
83149
|
+
""
|
|
83150
|
+
)}
|
|
83134
83151
|
|
|
83135
83152
|
---
|
|
83136
83153
|
|
|
@@ -83211,12 +83228,12 @@ var runRelease = async (config, options) => {
|
|
|
83211
83228
|
throw new Error("The `GITHUB_ACTOR` environment variable is not set.");
|
|
83212
83229
|
}
|
|
83213
83230
|
if (!await isUserAnOrganizationMember(process.env.GITHUB_ACTOR, config)) {
|
|
83214
|
-
|
|
83231
|
+
_chunkMZP2IRY3cjs.writeFatal.call(void 0,
|
|
83215
83232
|
"You must be a member of the Storm Software organization to run the release process.",
|
|
83216
83233
|
config
|
|
83217
83234
|
);
|
|
83218
83235
|
throw new Error(
|
|
83219
|
-
`The GitHub actor "${process.env.GITHUB_ACTOR}" is not a member of the organization "${config.organization}". Only members of the organization can initiate releases.`
|
|
83236
|
+
`The GitHub actor "${process.env.GITHUB_ACTOR}" is not a member of the organization "${typeof config.organization === "string" ? config.organization : _optionalChain([config, 'access', _307 => _307.organization, 'optionalAccess', _308 => _308.name])}". Only members of the organization can initiate releases.`
|
|
83220
83237
|
);
|
|
83221
83238
|
}
|
|
83222
83239
|
const name = config.bot.name;
|
|
@@ -83228,22 +83245,22 @@ var runRelease = async (config, options) => {
|
|
|
83228
83245
|
process.env.NODE_AUTH_TOKEN = process.env.NPM_TOKEN;
|
|
83229
83246
|
process.env.NPM_AUTH_TOKEN = process.env.NPM_TOKEN;
|
|
83230
83247
|
process.env.NPM_CONFIG_PROVENANCE = "true";
|
|
83231
|
-
|
|
83248
|
+
_chunkMZP2IRY3cjs.writeDebug.call(void 0, "Creating workspace Project Graph data...", config);
|
|
83232
83249
|
const nxJson = _nxjsonjs.readNxJson.call(void 0, );
|
|
83233
|
-
|
|
83250
|
+
_chunkMZP2IRY3cjs.writeDebug.call(void 0, "Reading in the workspaces release configuration", config);
|
|
83234
83251
|
const to = options.head || process.env.NX_HEAD;
|
|
83235
83252
|
const from = options.base || process.env.NX_BASE;
|
|
83236
|
-
|
|
83253
|
+
_chunkMZP2IRY3cjs.writeDebug.call(void 0,
|
|
83237
83254
|
`Using the following Git SHAs to determine the release content:
|
|
83238
83255
|
- From: ${from}
|
|
83239
83256
|
- To: ${to}
|
|
83240
83257
|
`,
|
|
83241
83258
|
config
|
|
83242
83259
|
);
|
|
83243
|
-
if (_optionalChain([nxJson, 'access',
|
|
83260
|
+
if (_optionalChain([nxJson, 'access', _309 => _309.release, 'optionalAccess', _310 => _310.groups])) {
|
|
83244
83261
|
nxJson.release.groups = Object.keys(nxJson.release.groups).reduce(
|
|
83245
83262
|
(ret, groupName) => {
|
|
83246
|
-
const groupConfig = _optionalChain([nxJson, 'access',
|
|
83263
|
+
const groupConfig = _optionalChain([nxJson, 'access', _311 => _311.release, 'optionalAccess', _312 => _312.groups, 'optionalAccess', _313 => _313[groupName]]);
|
|
83247
83264
|
ret[groupName] = _chunkFMYKTN2Zcjs.defu.call(void 0, groupConfig, DEFAULT_RELEASE_GROUP_CONFIG);
|
|
83248
83265
|
return ret;
|
|
83249
83266
|
},
|
|
@@ -83254,18 +83271,18 @@ var runRelease = async (config, options) => {
|
|
|
83254
83271
|
nxJson.release,
|
|
83255
83272
|
DEFAULT_RELEASE_CONFIG
|
|
83256
83273
|
);
|
|
83257
|
-
|
|
83274
|
+
_chunkMZP2IRY3cjs.writeInfo.call(void 0,
|
|
83258
83275
|
"Using the following `nx.json` release configuration values",
|
|
83259
83276
|
config
|
|
83260
83277
|
);
|
|
83261
|
-
|
|
83278
|
+
_chunkMZP2IRY3cjs.writeInfo.call(void 0, nxReleaseConfig, config);
|
|
83262
83279
|
const releaseVersion = _versionjs.createAPI.call(void 0, nxReleaseConfig);
|
|
83263
83280
|
const releaseChangelog = createAPI(nxReleaseConfig);
|
|
83264
83281
|
const releasePublish = _publishjs.createAPI.call(void 0, nxReleaseConfig);
|
|
83265
|
-
|
|
83282
|
+
_chunkMZP2IRY3cjs.writeDebug.call(void 0, "Determining the current release versions...", config);
|
|
83266
83283
|
const { workspaceVersion, projectsVersionData } = await releaseVersion({
|
|
83267
83284
|
dryRun: false,
|
|
83268
|
-
verbose:
|
|
83285
|
+
verbose: _chunkMZP2IRY3cjs.isVerbose.call(void 0, config.logLevel),
|
|
83269
83286
|
preid: config.preid,
|
|
83270
83287
|
deleteVersionPlans: false,
|
|
83271
83288
|
stageChanges: true,
|
|
@@ -83273,27 +83290,27 @@ var runRelease = async (config, options) => {
|
|
|
83273
83290
|
});
|
|
83274
83291
|
await releaseChangelog({
|
|
83275
83292
|
...options,
|
|
83276
|
-
version: _optionalChain([nxReleaseConfig, 'optionalAccess',
|
|
83293
|
+
version: _optionalChain([nxReleaseConfig, 'optionalAccess', _314 => _314.projectsRelationship]) !== "fixed" ? void 0 : workspaceVersion,
|
|
83277
83294
|
versionData: projectsVersionData,
|
|
83278
83295
|
dryRun: false,
|
|
83279
|
-
verbose:
|
|
83296
|
+
verbose: _chunkMZP2IRY3cjs.isVerbose.call(void 0, config.logLevel),
|
|
83280
83297
|
to,
|
|
83281
83298
|
from,
|
|
83282
83299
|
gitCommit: true,
|
|
83283
83300
|
gitCommitMessage: "release(monorepo): Publish workspace release updates"
|
|
83284
83301
|
});
|
|
83285
|
-
|
|
83302
|
+
_chunkMZP2IRY3cjs.writeDebug.call(void 0, "Tagging commit with git", config);
|
|
83286
83303
|
if (options.skipPublish) {
|
|
83287
|
-
|
|
83304
|
+
_chunkMZP2IRY3cjs.writeWarning.call(void 0,
|
|
83288
83305
|
"Skipping publishing packages since `skipPublish` was provided as `true` in the release options.",
|
|
83289
83306
|
config
|
|
83290
83307
|
);
|
|
83291
83308
|
} else {
|
|
83292
83309
|
const changedProjects = Object.keys(projectsVersionData).filter(
|
|
83293
|
-
(key) => _optionalChain([projectsVersionData, 'access',
|
|
83310
|
+
(key) => _optionalChain([projectsVersionData, 'access', _315 => _315[key], 'optionalAccess', _316 => _316.newVersion])
|
|
83294
83311
|
);
|
|
83295
83312
|
if (changedProjects.length > 0) {
|
|
83296
|
-
|
|
83313
|
+
_chunkMZP2IRY3cjs.writeInfo.call(void 0,
|
|
83297
83314
|
`Publishing release for ${changedProjects.length} ${changedProjects.length === 1 ? "project" : "projects"}:
|
|
83298
83315
|
${changedProjects.map((changedProject) => ` - ${changedProject}`).join("\n")}
|
|
83299
83316
|
`,
|
|
@@ -83303,25 +83320,25 @@ ${changedProjects.map((changedProject) => ` - ${changedProject}`).join("\n")}
|
|
|
83303
83320
|
const result2 = await releasePublish({
|
|
83304
83321
|
...options,
|
|
83305
83322
|
dryRun: !!options.dryRun,
|
|
83306
|
-
verbose:
|
|
83323
|
+
verbose: _chunkMZP2IRY3cjs.isVerbose.call(void 0, config.logLevel)
|
|
83307
83324
|
});
|
|
83308
83325
|
const failedProjects = Object.keys(result2).filter(
|
|
83309
|
-
(key) => _optionalChain([result2, 'access',
|
|
83326
|
+
(key) => _optionalChain([result2, 'access', _317 => _317[key], 'optionalAccess', _318 => _318.code]) && _optionalChain([result2, 'access', _319 => _319[key], 'optionalAccess', _320 => _320.code]) > 0
|
|
83310
83327
|
);
|
|
83311
83328
|
if (failedProjects.length > 0) {
|
|
83312
83329
|
throw new Error(
|
|
83313
83330
|
`The Storm release process was not completed successfully! One or more errors occured while running the \`nx-release-publish\` executor tasks.
|
|
83314
83331
|
|
|
83315
83332
|
Please review the workflow details for the following project(s):
|
|
83316
|
-
${failedProjects.map((failedProject) => ` - ${failedProject} (Error Code: ${_optionalChain([result2, 'access',
|
|
83333
|
+
${failedProjects.map((failedProject) => ` - ${failedProject} (Error Code: ${_optionalChain([result2, 'access', _321 => _321[failedProject], 'optionalAccess', _322 => _322.code])})`).join("\n")}
|
|
83317
83334
|
`
|
|
83318
83335
|
);
|
|
83319
83336
|
}
|
|
83320
83337
|
} else {
|
|
83321
|
-
|
|
83338
|
+
_chunkMZP2IRY3cjs.writeWarning.call(void 0, "Skipped publishing packages.", config);
|
|
83322
83339
|
}
|
|
83323
83340
|
}
|
|
83324
|
-
|
|
83341
|
+
_chunkMZP2IRY3cjs.writeSuccess.call(void 0, "Completed the Storm workspace release process!", config);
|
|
83325
83342
|
};
|
|
83326
83343
|
async function updatePackageManifests(projectsVersionData, config) {
|
|
83327
83344
|
let projectGraph;
|
|
@@ -83335,26 +83352,26 @@ async function updatePackageManifests(projectsVersionData, config) {
|
|
|
83335
83352
|
await Promise.all(
|
|
83336
83353
|
Object.keys(projectsVersionData).map(async (node) => {
|
|
83337
83354
|
const projectNode = projectGraph.nodes[node];
|
|
83338
|
-
if (!_optionalChain([projectNode, 'optionalAccess',
|
|
83339
|
-
|
|
83355
|
+
if (!_optionalChain([projectNode, 'optionalAccess', _323 => _323.data, 'access', _324 => _324.root])) {
|
|
83356
|
+
_chunkMZP2IRY3cjs.writeWarning.call(void 0,
|
|
83340
83357
|
`Project node ${node} not found in the project graph. Skipping manifest update.`,
|
|
83341
83358
|
config
|
|
83342
83359
|
);
|
|
83343
83360
|
return;
|
|
83344
83361
|
}
|
|
83345
83362
|
const versionData = projectsVersionData[node];
|
|
83346
|
-
if (_optionalChain([projectNode, 'optionalAccess',
|
|
83347
|
-
|
|
83363
|
+
if (_optionalChain([projectNode, 'optionalAccess', _325 => _325.data, 'access', _326 => _326.root]) && versionData && versionData.newVersion !== null) {
|
|
83364
|
+
_chunkMZP2IRY3cjs.writeTrace.call(void 0,
|
|
83348
83365
|
`Writing version ${versionData.newVersion} update to manifest file for ${node}
|
|
83349
83366
|
`,
|
|
83350
83367
|
config
|
|
83351
83368
|
);
|
|
83352
|
-
const projectRoot =
|
|
83369
|
+
const projectRoot = _chunkMZP2IRY3cjs.joinPaths.call(void 0,
|
|
83353
83370
|
config.workspaceRoot,
|
|
83354
83371
|
projectNode.data.root
|
|
83355
83372
|
);
|
|
83356
|
-
const packageJsonPath =
|
|
83357
|
-
const cargoTomlPath =
|
|
83373
|
+
const packageJsonPath = _chunkMZP2IRY3cjs.joinPaths.call(void 0, projectRoot, "package.json");
|
|
83374
|
+
const cargoTomlPath = _chunkMZP2IRY3cjs.joinPaths.call(void 0, projectRoot, "Cargo.toml");
|
|
83358
83375
|
if (_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
83359
83376
|
const packageJsonContent = await _promises.readFile.call(void 0, packageJsonPath, "utf8");
|
|
83360
83377
|
const packageJson = JSON.parse(packageJsonContent);
|
|
@@ -83372,7 +83389,7 @@ async function updatePackageManifests(projectsVersionData, config) {
|
|
|
83372
83389
|
})
|
|
83373
83390
|
);
|
|
83374
83391
|
} else {
|
|
83375
|
-
|
|
83392
|
+
_chunkMZP2IRY3cjs.writeWarning.call(void 0, "No project nodes found. Skipping manifest updates.", config);
|
|
83376
83393
|
}
|
|
83377
83394
|
}
|
|
83378
83395
|
|
|
@@ -83380,8 +83397,8 @@ async function updatePackageManifests(projectsVersionData, config) {
|
|
|
83380
83397
|
var _config = {};
|
|
83381
83398
|
function createProgram(config) {
|
|
83382
83399
|
_config = config;
|
|
83383
|
-
|
|
83384
|
-
const root2 =
|
|
83400
|
+
_chunkMZP2IRY3cjs.writeInfo.call(void 0, "\u26A1 Running Storm Git Tools", config);
|
|
83401
|
+
const root2 = _chunkMZP2IRY3cjs.findWorkspaceRootSafe.call(void 0, process.cwd());
|
|
83385
83402
|
process.env.STORM_WORKSPACE_ROOT ??= root2;
|
|
83386
83403
|
process.env.NX_WORKSPACE_ROOT_PATH ??= root2;
|
|
83387
83404
|
if (root2) {
|
|
@@ -83446,12 +83463,12 @@ async function commitAction({
|
|
|
83446
83463
|
dryRun = false
|
|
83447
83464
|
}) {
|
|
83448
83465
|
try {
|
|
83449
|
-
|
|
83466
|
+
_chunkMZP2IRY3cjs.writeInfo.call(void 0,
|
|
83450
83467
|
`\u26A1 Preparing to commit your changes. Please provide the requested details below...`,
|
|
83451
83468
|
_config
|
|
83452
83469
|
);
|
|
83453
83470
|
await runCommit(config, dryRun);
|
|
83454
|
-
|
|
83471
|
+
_chunkMZP2IRY3cjs.writeSuccess.call(void 0,
|
|
83455
83472
|
`\u{1F389} Storm Commit processing completed successfully!
|
|
83456
83473
|
|
|
83457
83474
|
Note: Please run "pnpm push" to upload these changes to the remote ${_config.name ? _config.name : _config.namespace ? _config.namespace : _config.organization ? _config.organization : "Storm-Software"} Git repository at ${_config.repository}
|
|
@@ -83459,7 +83476,7 @@ Note: Please run "pnpm push" to upload these changes to the remote ${_config.nam
|
|
|
83459
83476
|
_config
|
|
83460
83477
|
);
|
|
83461
83478
|
} catch (error) {
|
|
83462
|
-
|
|
83479
|
+
_chunkMZP2IRY3cjs.writeFatal.call(void 0,
|
|
83463
83480
|
`A fatal error occurred while running commit action:
|
|
83464
83481
|
|
|
83465
83482
|
${error.message}`,
|
|
@@ -83470,14 +83487,14 @@ ${error.message}`,
|
|
|
83470
83487
|
}
|
|
83471
83488
|
async function readmeAction(options) {
|
|
83472
83489
|
try {
|
|
83473
|
-
|
|
83490
|
+
_chunkMZP2IRY3cjs.writeInfo.call(void 0, "\u26A1 Formatting the workspace's README.md files", _config);
|
|
83474
83491
|
await runReadme(options);
|
|
83475
|
-
|
|
83492
|
+
_chunkMZP2IRY3cjs.writeSuccess.call(void 0,
|
|
83476
83493
|
"Formatting of the workspace's README.md files is complete\n",
|
|
83477
83494
|
_config
|
|
83478
83495
|
);
|
|
83479
83496
|
} catch (error) {
|
|
83480
|
-
|
|
83497
|
+
_chunkMZP2IRY3cjs.writeFatal.call(void 0,
|
|
83481
83498
|
`A fatal error occurred while running README format action:
|
|
83482
83499
|
|
|
83483
83500
|
${error.message}`
|
|
@@ -83492,7 +83509,7 @@ async function releaseAction({
|
|
|
83492
83509
|
dryRun
|
|
83493
83510
|
}) {
|
|
83494
83511
|
try {
|
|
83495
|
-
|
|
83512
|
+
_chunkMZP2IRY3cjs.writeInfo.call(void 0,
|
|
83496
83513
|
"\u26A1 Running the Storm Release and Publish process on the workspace",
|
|
83497
83514
|
_config
|
|
83498
83515
|
);
|
|
@@ -83502,9 +83519,9 @@ async function releaseAction({
|
|
|
83502
83519
|
base,
|
|
83503
83520
|
head
|
|
83504
83521
|
});
|
|
83505
|
-
|
|
83522
|
+
_chunkMZP2IRY3cjs.writeSuccess.call(void 0, "Release completed successfully!\n", _config);
|
|
83506
83523
|
} catch (error) {
|
|
83507
|
-
|
|
83524
|
+
_chunkMZP2IRY3cjs.writeFatal.call(void 0,
|
|
83508
83525
|
`A fatal error occurred while running release action:
|
|
83509
83526
|
|
|
83510
83527
|
${error.message} ${error.stack ? `
|
|
@@ -83522,8 +83539,8 @@ async function commitLintAction({
|
|
|
83522
83539
|
file
|
|
83523
83540
|
}) {
|
|
83524
83541
|
try {
|
|
83525
|
-
|
|
83526
|
-
`\u26A1 Linting the ${_config.repository ? _config.repository : _config.namespace ? _config.namespace : _config.name ? _config.name : _config.organization ? _config.organization : "Storm-Software"} repository's commit messages.`,
|
|
83542
|
+
_chunkMZP2IRY3cjs.writeInfo.call(void 0,
|
|
83543
|
+
`\u26A1 Linting the ${_config.repository ? _config.repository : _config.namespace ? _config.namespace : _config.name ? _config.name : typeof _config.organization === "string" ? _config.organization : _optionalChain([_config, 'access', _327 => _327.organization, 'optionalAccess', _328 => _328.name]) ? _optionalChain([_config, 'access', _329 => _329.organization, 'optionalAccess', _330 => _330.name]) : "Storm-Software"} repository's commit messages.`,
|
|
83527
83544
|
_config
|
|
83528
83545
|
);
|
|
83529
83546
|
await runCommitLint(_config, {
|
|
@@ -83531,12 +83548,12 @@ async function commitLintAction({
|
|
|
83531
83548
|
message: message2,
|
|
83532
83549
|
file
|
|
83533
83550
|
});
|
|
83534
|
-
|
|
83551
|
+
_chunkMZP2IRY3cjs.writeSuccess.call(void 0,
|
|
83535
83552
|
"Linting the commit messages completed successfully!\n",
|
|
83536
83553
|
_config
|
|
83537
83554
|
);
|
|
83538
83555
|
} catch (error) {
|
|
83539
|
-
|
|
83556
|
+
_chunkMZP2IRY3cjs.writeFatal.call(void 0,
|
|
83540
83557
|
`A fatal error occurred while linting the commit messages:
|
|
83541
83558
|
|
|
83542
83559
|
${error.message}`,
|
|
@@ -83548,18 +83565,18 @@ ${error.message}`,
|
|
|
83548
83565
|
|
|
83549
83566
|
// bin/git.ts
|
|
83550
83567
|
void (async () => {
|
|
83551
|
-
const config = await
|
|
83568
|
+
const config = await _chunkMZP2IRY3cjs.getConfig.call(void 0, );
|
|
83552
83569
|
try {
|
|
83553
|
-
|
|
83570
|
+
_chunkMZP2IRY3cjs.handleProcess.call(void 0, config);
|
|
83554
83571
|
const program2 = createProgram(config);
|
|
83555
83572
|
await program2.parseAsync(process.argv);
|
|
83556
|
-
|
|
83573
|
+
_chunkMZP2IRY3cjs.writeSuccess.call(void 0,
|
|
83557
83574
|
`\u{1F389} Git ${process.argv && process.argv.length >= 3 && process.argv[2] ? process.argv[2] : "tool"} processing completed successfully!`,
|
|
83558
83575
|
config
|
|
83559
83576
|
);
|
|
83560
|
-
|
|
83577
|
+
_chunkMZP2IRY3cjs.exitWithSuccess.call(void 0, config);
|
|
83561
83578
|
} catch (error) {
|
|
83562
|
-
|
|
83579
|
+
_chunkMZP2IRY3cjs.exitWithError.call(void 0, config);
|
|
83563
83580
|
process.exit(1);
|
|
83564
83581
|
}
|
|
83565
83582
|
})();
|