@storm-software/git-tools 2.111.25 → 2.111.27
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 +601 -291
- package/bin/git.js +564 -254
- package/package.json +1 -2
package/bin/git.cjs
CHANGED
|
@@ -71861,10 +71861,7 @@ var runCommit = async (commitizenFile = "@storm-software/git-tools/commit/config
|
|
|
71861
71861
|
|
|
71862
71862
|
`);
|
|
71863
71863
|
await runCommitLint(config, { message: message2 });
|
|
71864
|
-
const commandItems = ["git", "commit"];
|
|
71865
|
-
if (!process.env.CI && !process.env.STORM_CI) {
|
|
71866
|
-
commandItems.push("-S");
|
|
71867
|
-
}
|
|
71864
|
+
const commandItems = ["git", "commit", "-S"];
|
|
71868
71865
|
commandItems.push(...["--file", commitMsgFile]);
|
|
71869
71866
|
const command = (0, import_any_shell_escape.default)(commandItems);
|
|
71870
71867
|
if (dryRun) {
|
|
@@ -77659,7 +77656,6 @@ var chalk3 = _chunkIG6EXAQUcjs.__toESM.call(void 0, _chunkXE275LJTcjs.require_so
|
|
|
77659
77656
|
var import_enquirer2 = _chunkIG6EXAQUcjs.__toESM.call(void 0, require_enquirer(), 1);
|
|
77660
77657
|
var import_semver2 = _chunkIG6EXAQUcjs.__toESM.call(void 0, require_semver4(), 1);
|
|
77661
77658
|
var import_tmp = _chunkIG6EXAQUcjs.__toESM.call(void 0, require_tmp2(), 1);
|
|
77662
|
-
var _titlecase = require('@stryke/string-format/title-case');
|
|
77663
77659
|
|
|
77664
77660
|
|
|
77665
77661
|
|
|
@@ -77687,7 +77683,6 @@ var _launcheditor = require('nx/src/command-line/release/utils/launch-editor');
|
|
|
77687
77683
|
var _printchanges = require('nx/src/command-line/release/utils/print-changes');
|
|
77688
77684
|
var _printconfig = require('nx/src/command-line/release/utils/print-config');
|
|
77689
77685
|
var _github = require('nx/src/command-line/release/utils/remote-release-clients/github');
|
|
77690
|
-
var _remotereleaseclient = require('nx/src/command-line/release/utils/remote-release-clients/remote-release-client');
|
|
77691
77686
|
var _resolvenxjsonerrormessage = require('nx/src/command-line/release/utils/resolve-nx-json-error-message');
|
|
77692
77687
|
|
|
77693
77688
|
|
|
@@ -77695,7 +77690,6 @@ var _resolvenxjsonerrormessage = require('nx/src/command-line/release/utils/reso
|
|
|
77695
77690
|
|
|
77696
77691
|
|
|
77697
77692
|
|
|
77698
|
-
|
|
77699
77693
|
var _shared = require('nx/src/command-line/release/utils/shared');
|
|
77700
77694
|
|
|
77701
77695
|
|
|
@@ -77714,14 +77708,257 @@ var _workspaceroot = require('nx/src/utils/workspace-root');
|
|
|
77714
77708
|
|
|
77715
77709
|
// src/utilities/changelog-utils.ts
|
|
77716
77710
|
_chunkIG6EXAQUcjs.init_cjs_shims.call(void 0, );
|
|
77717
|
-
|
|
77718
77711
|
var _prettier = require('prettier');
|
|
77712
|
+
|
|
77713
|
+
// src/utilities/title-case.ts
|
|
77714
|
+
_chunkIG6EXAQUcjs.init_cjs_shims.call(void 0, );
|
|
77715
|
+
var ACRONYMS = [
|
|
77716
|
+
"3D",
|
|
77717
|
+
"4D",
|
|
77718
|
+
"5G",
|
|
77719
|
+
"6G",
|
|
77720
|
+
"7G",
|
|
77721
|
+
"8G",
|
|
77722
|
+
"ACID",
|
|
77723
|
+
"AES",
|
|
77724
|
+
"AI",
|
|
77725
|
+
"AJAX",
|
|
77726
|
+
"API",
|
|
77727
|
+
"AR",
|
|
77728
|
+
"ASCII",
|
|
77729
|
+
"B2B",
|
|
77730
|
+
"B2C",
|
|
77731
|
+
"BFF",
|
|
77732
|
+
"BI",
|
|
77733
|
+
"BIOS",
|
|
77734
|
+
"BGP",
|
|
77735
|
+
"BOM",
|
|
77736
|
+
"BYOD",
|
|
77737
|
+
"C2C",
|
|
77738
|
+
"CAGR",
|
|
77739
|
+
"CAPTCHA",
|
|
77740
|
+
"CD",
|
|
77741
|
+
"CDN",
|
|
77742
|
+
"CDP",
|
|
77743
|
+
"CI",
|
|
77744
|
+
"CI/CD",
|
|
77745
|
+
"CIAM",
|
|
77746
|
+
"CICD",
|
|
77747
|
+
"CLI",
|
|
77748
|
+
"CMDB",
|
|
77749
|
+
"CORS",
|
|
77750
|
+
"CPU",
|
|
77751
|
+
"CRUD",
|
|
77752
|
+
"CSR",
|
|
77753
|
+
"CSS",
|
|
77754
|
+
"CX",
|
|
77755
|
+
"DAG",
|
|
77756
|
+
"DBMS",
|
|
77757
|
+
"DDoS",
|
|
77758
|
+
"DNS",
|
|
77759
|
+
"DNSSEC",
|
|
77760
|
+
"DOM",
|
|
77761
|
+
"DR",
|
|
77762
|
+
"DRM",
|
|
77763
|
+
"DWH",
|
|
77764
|
+
"E2E",
|
|
77765
|
+
"EAI",
|
|
77766
|
+
"EKS",
|
|
77767
|
+
"EOF",
|
|
77768
|
+
"EOD",
|
|
77769
|
+
"ETC",
|
|
77770
|
+
"ETL",
|
|
77771
|
+
"EULA",
|
|
77772
|
+
"FIDO",
|
|
77773
|
+
"FQDN",
|
|
77774
|
+
"FTP",
|
|
77775
|
+
"FaaS",
|
|
77776
|
+
"GDPR",
|
|
77777
|
+
"GCP",
|
|
77778
|
+
"GPU",
|
|
77779
|
+
"GUID",
|
|
77780
|
+
"GUI",
|
|
77781
|
+
"GZIP",
|
|
77782
|
+
"HCI",
|
|
77783
|
+
"HDD",
|
|
77784
|
+
"HDFS",
|
|
77785
|
+
"HIPAA",
|
|
77786
|
+
"HMAC",
|
|
77787
|
+
"HOTP",
|
|
77788
|
+
"HSM",
|
|
77789
|
+
"HTML",
|
|
77790
|
+
"HTTP",
|
|
77791
|
+
"HTTP/2",
|
|
77792
|
+
"HTTP/2.0",
|
|
77793
|
+
"HTTP/3",
|
|
77794
|
+
"HTTP/3.0",
|
|
77795
|
+
"HTTP2",
|
|
77796
|
+
"HTTPS",
|
|
77797
|
+
"HTTPS/2",
|
|
77798
|
+
"HTTPS/3",
|
|
77799
|
+
"HTTPS3",
|
|
77800
|
+
"IAM",
|
|
77801
|
+
"IAMM",
|
|
77802
|
+
"IAMT",
|
|
77803
|
+
"IaaS",
|
|
77804
|
+
"ID",
|
|
77805
|
+
"IMAP",
|
|
77806
|
+
"IP",
|
|
77807
|
+
"IPFS",
|
|
77808
|
+
"IoT",
|
|
77809
|
+
"JSON",
|
|
77810
|
+
"JSONP",
|
|
77811
|
+
"JWT",
|
|
77812
|
+
"K8s",
|
|
77813
|
+
"KMS",
|
|
77814
|
+
"KPI",
|
|
77815
|
+
"LAN",
|
|
77816
|
+
"LHS",
|
|
77817
|
+
"LXC",
|
|
77818
|
+
"MFA",
|
|
77819
|
+
"ML",
|
|
77820
|
+
"MLOps",
|
|
77821
|
+
"MVC",
|
|
77822
|
+
"MVP",
|
|
77823
|
+
"NAS",
|
|
77824
|
+
"NAT",
|
|
77825
|
+
"NDA",
|
|
77826
|
+
"NFS",
|
|
77827
|
+
"NIST",
|
|
77828
|
+
"NLP",
|
|
77829
|
+
"NPS",
|
|
77830
|
+
"OCR",
|
|
77831
|
+
"OEM",
|
|
77832
|
+
"OKR",
|
|
77833
|
+
"OLAP",
|
|
77834
|
+
"OLTP",
|
|
77835
|
+
"OOP",
|
|
77836
|
+
"ORM",
|
|
77837
|
+
"OS",
|
|
77838
|
+
"OTP",
|
|
77839
|
+
"P2P",
|
|
77840
|
+
"PDP",
|
|
77841
|
+
"PaaS",
|
|
77842
|
+
"PCI",
|
|
77843
|
+
"PKI",
|
|
77844
|
+
"PP",
|
|
77845
|
+
"PWA",
|
|
77846
|
+
"PX",
|
|
77847
|
+
"QA",
|
|
77848
|
+
"RAID",
|
|
77849
|
+
"RAM",
|
|
77850
|
+
"RDS",
|
|
77851
|
+
"REST",
|
|
77852
|
+
"RHS",
|
|
77853
|
+
"RPC",
|
|
77854
|
+
"RPA",
|
|
77855
|
+
"RUM",
|
|
77856
|
+
"RSS",
|
|
77857
|
+
"SAN",
|
|
77858
|
+
"SASE",
|
|
77859
|
+
"SDLC",
|
|
77860
|
+
"SDK",
|
|
77861
|
+
"SEO",
|
|
77862
|
+
"SFTP",
|
|
77863
|
+
"SIEM",
|
|
77864
|
+
"SLA",
|
|
77865
|
+
"SMB",
|
|
77866
|
+
"SMTP",
|
|
77867
|
+
"SOAP",
|
|
77868
|
+
"SOC",
|
|
77869
|
+
"SOA",
|
|
77870
|
+
"SPDY",
|
|
77871
|
+
"SPF",
|
|
77872
|
+
"SQL",
|
|
77873
|
+
"SRV",
|
|
77874
|
+
"SRE",
|
|
77875
|
+
"SSH",
|
|
77876
|
+
"SSDL",
|
|
77877
|
+
"SSO",
|
|
77878
|
+
"SSL",
|
|
77879
|
+
"SSR",
|
|
77880
|
+
"TDD",
|
|
77881
|
+
"TLD",
|
|
77882
|
+
"TLS",
|
|
77883
|
+
"TLS1.3",
|
|
77884
|
+
"TOTP",
|
|
77885
|
+
"TRPC",
|
|
77886
|
+
"TTL",
|
|
77887
|
+
"UDP",
|
|
77888
|
+
"UI",
|
|
77889
|
+
"UID",
|
|
77890
|
+
"URI",
|
|
77891
|
+
"URL",
|
|
77892
|
+
"UTF",
|
|
77893
|
+
"UUID",
|
|
77894
|
+
"UX",
|
|
77895
|
+
"VM",
|
|
77896
|
+
"VLAN",
|
|
77897
|
+
"VPN",
|
|
77898
|
+
"VR",
|
|
77899
|
+
"WAF",
|
|
77900
|
+
"WAN",
|
|
77901
|
+
"WLAN",
|
|
77902
|
+
"WPA",
|
|
77903
|
+
"XACML",
|
|
77904
|
+
"XML",
|
|
77905
|
+
"XSRF",
|
|
77906
|
+
"XSS",
|
|
77907
|
+
"XR",
|
|
77908
|
+
"YAML",
|
|
77909
|
+
"ZTA"
|
|
77910
|
+
];
|
|
77911
|
+
var FORMAT_MAPPING = ACRONYMS.reduce(
|
|
77912
|
+
(ret, acronym) => {
|
|
77913
|
+
ret[acronym.toLowerCase()] = acronym;
|
|
77914
|
+
return ret;
|
|
77915
|
+
},
|
|
77916
|
+
{
|
|
77917
|
+
cspell: "CSpell",
|
|
77918
|
+
eslint: "ESLint",
|
|
77919
|
+
nx: "Nx"
|
|
77920
|
+
}
|
|
77921
|
+
);
|
|
77922
|
+
var LOWER_CASE_WHEN_NOT_FIRST = [
|
|
77923
|
+
"a",
|
|
77924
|
+
"an",
|
|
77925
|
+
"the",
|
|
77926
|
+
"is",
|
|
77927
|
+
"are",
|
|
77928
|
+
"of",
|
|
77929
|
+
"and",
|
|
77930
|
+
"to",
|
|
77931
|
+
"in",
|
|
77932
|
+
"for",
|
|
77933
|
+
"on",
|
|
77934
|
+
"with",
|
|
77935
|
+
"as",
|
|
77936
|
+
"at",
|
|
77937
|
+
"by"
|
|
77938
|
+
];
|
|
77939
|
+
function titleCase(input) {
|
|
77940
|
+
if (!input) {
|
|
77941
|
+
return input;
|
|
77942
|
+
}
|
|
77943
|
+
const formatSegment = (segment) => segment.toLowerCase().split(/[\s\-_]+/).filter(Boolean).map((word, index) => {
|
|
77944
|
+
if (LOWER_CASE_WHEN_NOT_FIRST.includes(word.toLowerCase()) && index > 0) {
|
|
77945
|
+
return word.toLowerCase();
|
|
77946
|
+
}
|
|
77947
|
+
if (Object.keys(FORMAT_MAPPING).includes(word.toLowerCase())) {
|
|
77948
|
+
return FORMAT_MAPPING[word.toLowerCase()];
|
|
77949
|
+
}
|
|
77950
|
+
return `${word ? word.charAt(0).toUpperCase() + word.toLowerCase().slice(1) : word}`;
|
|
77951
|
+
}).join(" ");
|
|
77952
|
+
return input.split(/\s+-\s+/).map((part) => formatSegment(part)).join(" - ");
|
|
77953
|
+
}
|
|
77954
|
+
|
|
77955
|
+
// src/utilities/changelog-utils.ts
|
|
77719
77956
|
async function generateChangelogContent(releaseVersion, filepath, newContent, currentContent, project, workspaceConfig) {
|
|
77720
77957
|
const formatOptions = await _asyncNullishCoalesce(await _prettier.resolveConfig.call(void 0, filepath), async () => ( {}));
|
|
77721
77958
|
const header = await _prettier.format.call(void 0,
|
|
77722
77959
|
`${_optionalChain([workspaceConfig, 'optionalAccess', _181 => _181.release, 'access', _182 => _182.banner]) ? `})
|
|
77723
77960
|
|
|
77724
|
-
` : ""}# Changelog ${project || _optionalChain([workspaceConfig, 'optionalAccess', _185 => _185.name]) ? "for" : ""}${_optionalChain([workspaceConfig, 'optionalAccess', _186 => _186.name]) ? ` ${
|
|
77961
|
+
` : ""}# 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)}` : ""}
|
|
77725
77962
|
|
|
77726
77963
|
`,
|
|
77727
77964
|
{
|
|
@@ -77794,6 +78031,7 @@ function parseChangelogMarkdown(contents) {
|
|
|
77794
78031
|
// src/utilities/git-utils.ts
|
|
77795
78032
|
_chunkIG6EXAQUcjs.init_cjs_shims.call(void 0, );
|
|
77796
78033
|
var _execcommandjs = require('nx/src/command-line/release/utils/exec-command.js');
|
|
78034
|
+
|
|
77797
78035
|
async function gitTag({
|
|
77798
78036
|
tag,
|
|
77799
78037
|
message: message2,
|
|
@@ -77836,6 +78074,76 @@ async function gitTag({
|
|
|
77836
78074
|
${err}`);
|
|
77837
78075
|
}
|
|
77838
78076
|
}
|
|
78077
|
+
async function gitCommit({
|
|
78078
|
+
messages,
|
|
78079
|
+
additionalArgs,
|
|
78080
|
+
dryRun,
|
|
78081
|
+
verbose,
|
|
78082
|
+
logFn
|
|
78083
|
+
}) {
|
|
78084
|
+
logFn = logFn || console.log;
|
|
78085
|
+
const commandArgs = ["commit", "-S"];
|
|
78086
|
+
for (const message2 of messages) {
|
|
78087
|
+
commandArgs.push("--message", message2);
|
|
78088
|
+
}
|
|
78089
|
+
if (additionalArgs) {
|
|
78090
|
+
if (Array.isArray(additionalArgs)) {
|
|
78091
|
+
commandArgs.push(...additionalArgs);
|
|
78092
|
+
} else {
|
|
78093
|
+
commandArgs.push(...additionalArgs.split(" "));
|
|
78094
|
+
}
|
|
78095
|
+
}
|
|
78096
|
+
if (verbose) {
|
|
78097
|
+
logFn(
|
|
78098
|
+
dryRun ? `Would commit all previously staged files in git with the following command, but --dry-run was set:` : `Committing files in git with the following command:`
|
|
78099
|
+
);
|
|
78100
|
+
logFn(`git ${commandArgs.join(" ")}`);
|
|
78101
|
+
}
|
|
78102
|
+
if (dryRun) {
|
|
78103
|
+
return;
|
|
78104
|
+
}
|
|
78105
|
+
let hasStagedFiles = false;
|
|
78106
|
+
try {
|
|
78107
|
+
await _execcommandjs.execCommand.call(void 0, "git", ["diff-index", "--quiet", "HEAD", "--cached"]);
|
|
78108
|
+
} catch (e16) {
|
|
78109
|
+
hasStagedFiles = true;
|
|
78110
|
+
}
|
|
78111
|
+
if (!hasStagedFiles) {
|
|
78112
|
+
logFn("\nNo staged files found. Skipping commit.");
|
|
78113
|
+
return;
|
|
78114
|
+
}
|
|
78115
|
+
return _execcommandjs.execCommand.call(void 0, "git", commandArgs);
|
|
78116
|
+
}
|
|
78117
|
+
async function commitChanges({
|
|
78118
|
+
changedFiles,
|
|
78119
|
+
deletedFiles,
|
|
78120
|
+
isDryRun,
|
|
78121
|
+
isVerbose: isVerbose2,
|
|
78122
|
+
gitCommitMessages,
|
|
78123
|
+
gitCommitArgs,
|
|
78124
|
+
logFn
|
|
78125
|
+
}) {
|
|
78126
|
+
logFn = logFn || console.log;
|
|
78127
|
+
if (!_optionalChain([changedFiles, 'optionalAccess', _189 => _189.length]) && !_optionalChain([deletedFiles, 'optionalAccess', _190 => _190.length])) {
|
|
78128
|
+
throw new Error("Error: No changed files to commit");
|
|
78129
|
+
}
|
|
78130
|
+
logFn(`Committing changes with git`);
|
|
78131
|
+
await _git.gitAdd.call(void 0, {
|
|
78132
|
+
changedFiles,
|
|
78133
|
+
deletedFiles,
|
|
78134
|
+
dryRun: isDryRun,
|
|
78135
|
+
verbose: isVerbose2
|
|
78136
|
+
});
|
|
78137
|
+
if (isVerbose2) {
|
|
78138
|
+
console.log("");
|
|
78139
|
+
}
|
|
78140
|
+
await gitCommit({
|
|
78141
|
+
messages: gitCommitMessages || [],
|
|
78142
|
+
additionalArgs: gitCommitArgs,
|
|
78143
|
+
dryRun: isDryRun,
|
|
78144
|
+
verbose: isVerbose2
|
|
78145
|
+
});
|
|
78146
|
+
}
|
|
77839
78147
|
|
|
77840
78148
|
// src/release/changelog-renderer.ts
|
|
77841
78149
|
_chunkIG6EXAQUcjs.init_cjs_shims.call(void 0, );
|
|
@@ -81239,6 +81547,195 @@ var {
|
|
|
81239
81547
|
var import_semver = _chunkIG6EXAQUcjs.__toESM.call(void 0, require_semver4(), 1);
|
|
81240
81548
|
var _changelogrenderer = require('nx/release/changelog-renderer'); var _changelogrenderer2 = _interopRequireDefault(_changelogrenderer);
|
|
81241
81549
|
var _conventionalcommits = require('nx/src/command-line/release/config/conventional-commits');
|
|
81550
|
+
var StormChangelogRenderer = (_class16 = class extends _changelogrenderer2.default {
|
|
81551
|
+
/**
|
|
81552
|
+
* The Storm workspace configuration object, which is loaded from the storm-workspace.json file.
|
|
81553
|
+
*/
|
|
81554
|
+
__init43() {this.workspaceConfig = null}
|
|
81555
|
+
/**
|
|
81556
|
+
* The configuration object for the ChangelogRenderer, which includes the changes, version, project, and other options.
|
|
81557
|
+
*/
|
|
81558
|
+
|
|
81559
|
+
/**
|
|
81560
|
+
* A ChangelogRenderer class takes in the determined changes and other relevant metadata and returns a string, or a Promise of a string of changelog contents (usually markdown).
|
|
81561
|
+
*
|
|
81562
|
+
* @param config - The configuration object for the ChangelogRenderer
|
|
81563
|
+
*/
|
|
81564
|
+
constructor(config) {
|
|
81565
|
+
super(config);_class16.prototype.__init43.call(this);;
|
|
81566
|
+
this.config = {
|
|
81567
|
+
...config,
|
|
81568
|
+
repoData: config.remoteReleaseClient.getRemoteRepoData()
|
|
81569
|
+
};
|
|
81570
|
+
}
|
|
81571
|
+
async render() {
|
|
81572
|
+
this.workspaceConfig = await _chunkXE275LJTcjs.getWorkspaceConfig.call(void 0, );
|
|
81573
|
+
return await super.render();
|
|
81574
|
+
}
|
|
81575
|
+
preprocessChanges() {
|
|
81576
|
+
this.relevantChanges = [...this.changes];
|
|
81577
|
+
this.breakingChanges = [];
|
|
81578
|
+
this.additionalChangesForAuthorsSection = [];
|
|
81579
|
+
for (let i = this.relevantChanges.length - 1; i >= 0; i--) {
|
|
81580
|
+
const change = this.relevantChanges[i];
|
|
81581
|
+
if (change && change.type === "revert" && change.revertedHashes) {
|
|
81582
|
+
for (const revertedHash of change.revertedHashes) {
|
|
81583
|
+
const revertedCommitIndex = this.relevantChanges.findIndex(
|
|
81584
|
+
(c) => c.shortHash && revertedHash.startsWith(c.shortHash)
|
|
81585
|
+
);
|
|
81586
|
+
if (revertedCommitIndex !== -1) {
|
|
81587
|
+
this.relevantChanges.splice(revertedCommitIndex, 1);
|
|
81588
|
+
this.relevantChanges.splice(i, 1);
|
|
81589
|
+
i--;
|
|
81590
|
+
break;
|
|
81591
|
+
}
|
|
81592
|
+
}
|
|
81593
|
+
}
|
|
81594
|
+
}
|
|
81595
|
+
if (this.isVersionPlans) {
|
|
81596
|
+
this.conventionalCommitsConfig = {
|
|
81597
|
+
types: {
|
|
81598
|
+
feat: _conventionalcommits.DEFAULT_CONVENTIONAL_COMMITS_CONFIG.types.feat,
|
|
81599
|
+
fix: _conventionalcommits.DEFAULT_CONVENTIONAL_COMMITS_CONFIG.types.fix
|
|
81600
|
+
}
|
|
81601
|
+
};
|
|
81602
|
+
for (let i = this.relevantChanges.length - 1; i >= 0; i--) {
|
|
81603
|
+
if (_optionalChain([this, 'access', _191 => _191.relevantChanges, 'access', _192 => _192[i], 'optionalAccess', _193 => _193.isBreaking])) {
|
|
81604
|
+
const change = this.relevantChanges[i];
|
|
81605
|
+
if (change) {
|
|
81606
|
+
this.additionalChangesForAuthorsSection.push(change);
|
|
81607
|
+
const line = this.formatChange(change);
|
|
81608
|
+
this.breakingChanges.push(line);
|
|
81609
|
+
this.relevantChanges.splice(i, 1);
|
|
81610
|
+
}
|
|
81611
|
+
}
|
|
81612
|
+
}
|
|
81613
|
+
} else {
|
|
81614
|
+
for (const change of this.relevantChanges) {
|
|
81615
|
+
if (change.isBreaking) {
|
|
81616
|
+
const breakingChangeExplanation = change.body ? this.extractBreakingChangeExplanation(change.body) : "";
|
|
81617
|
+
this.breakingChanges.push(
|
|
81618
|
+
breakingChangeExplanation ? `- ${change.scope ? `**${change.scope.trim()}:** ` : ""}${breakingChangeExplanation}` : this.formatChange(change)
|
|
81619
|
+
);
|
|
81620
|
+
}
|
|
81621
|
+
}
|
|
81622
|
+
}
|
|
81623
|
+
}
|
|
81624
|
+
/**
|
|
81625
|
+
* Determines if the changelog entry should be rendered as empty. This is the case when there are no relevant changes, breaking changes, or dependency bumps.
|
|
81626
|
+
*/
|
|
81627
|
+
// protected override shouldRenderEmptyEntry(): boolean {
|
|
81628
|
+
// return true;
|
|
81629
|
+
// }
|
|
81630
|
+
renderVersionTitle() {
|
|
81631
|
+
const isMajorVersion = `${(0, import_semver.major)(this.changelogEntryVersion)}.0.0` === this.changelogEntryVersion.replace(/^v/, "");
|
|
81632
|
+
return isMajorVersion ? `# ${generateChangelogTitle(this.changelogEntryVersion, this.project, this.workspaceConfig)}` : `## ${generateChangelogTitle(this.changelogEntryVersion, this.project, this.workspaceConfig)}`;
|
|
81633
|
+
}
|
|
81634
|
+
renderBreakingChanges() {
|
|
81635
|
+
return [
|
|
81636
|
+
"### Breaking Changes",
|
|
81637
|
+
"",
|
|
81638
|
+
...Array.from(new Set(this.breakingChanges))
|
|
81639
|
+
];
|
|
81640
|
+
}
|
|
81641
|
+
renderDependencyBumps() {
|
|
81642
|
+
const markdownLines = ["", "### Updated Dependencies", ""];
|
|
81643
|
+
_optionalChain([this, 'access', _194 => _194.dependencyBumps, 'optionalAccess', _195 => _195.forEach, 'call', _196 => _196(({ dependencyName, newVersion }) => {
|
|
81644
|
+
markdownLines.push(`- Updated ${dependencyName} to ${newVersion}`);
|
|
81645
|
+
})]);
|
|
81646
|
+
return markdownLines;
|
|
81647
|
+
}
|
|
81648
|
+
async renderAuthors() {
|
|
81649
|
+
const markdownLines = [];
|
|
81650
|
+
const _authors = /* @__PURE__ */ new Map();
|
|
81651
|
+
for (const change of [
|
|
81652
|
+
...this.relevantChanges,
|
|
81653
|
+
...this.additionalChangesForAuthorsSection
|
|
81654
|
+
]) {
|
|
81655
|
+
if (!change.authors) {
|
|
81656
|
+
continue;
|
|
81657
|
+
}
|
|
81658
|
+
for (const author of change.authors) {
|
|
81659
|
+
const name = this.formatName(author.name);
|
|
81660
|
+
if (!name || name.includes("[bot]") || name === _optionalChain([this, 'access', _197 => _197.workspaceConfig, 'optionalAccess', _198 => _198.bot, 'access', _199 => _199.name])) {
|
|
81661
|
+
continue;
|
|
81662
|
+
}
|
|
81663
|
+
if (_authors.has(name)) {
|
|
81664
|
+
const entry = _authors.get(name);
|
|
81665
|
+
_optionalChain([entry, 'optionalAccess', _200 => _200.email, 'access', _201 => _201.add, 'call', _202 => _202(author.email)]);
|
|
81666
|
+
} else {
|
|
81667
|
+
_authors.set(name, { email: /* @__PURE__ */ new Set([author.email]) });
|
|
81668
|
+
}
|
|
81669
|
+
}
|
|
81670
|
+
}
|
|
81671
|
+
if (this.config.repoData && this.changelogRenderOptions.mapAuthorsToGitHubUsernames) {
|
|
81672
|
+
await Promise.all(
|
|
81673
|
+
[..._authors.keys()].map(async (authorName) => {
|
|
81674
|
+
const meta = _authors.get(authorName);
|
|
81675
|
+
if (!meta) {
|
|
81676
|
+
return;
|
|
81677
|
+
}
|
|
81678
|
+
for (const email of meta.email) {
|
|
81679
|
+
if (email.endsWith("@users.noreply.github.com")) {
|
|
81680
|
+
const match = email.match(
|
|
81681
|
+
/^(\d+\+)?([^@]+)@users\.noreply\.github\.com$/
|
|
81682
|
+
);
|
|
81683
|
+
if (match && match[2]) {
|
|
81684
|
+
meta.github = match[2];
|
|
81685
|
+
break;
|
|
81686
|
+
}
|
|
81687
|
+
}
|
|
81688
|
+
const { data } = await axios_default.get(`https://ungh.cc/users/find/${email}`).catch(() => ({ data: { user: null } }));
|
|
81689
|
+
if (_optionalChain([data, 'optionalAccess', _203 => _203.user])) {
|
|
81690
|
+
meta.github = data.user.username;
|
|
81691
|
+
break;
|
|
81692
|
+
}
|
|
81693
|
+
}
|
|
81694
|
+
})
|
|
81695
|
+
);
|
|
81696
|
+
}
|
|
81697
|
+
const authors = [..._authors.entries()].map((e) => ({
|
|
81698
|
+
name: e[0],
|
|
81699
|
+
...e[1]
|
|
81700
|
+
}));
|
|
81701
|
+
if (authors.length > 0) {
|
|
81702
|
+
markdownLines.push(
|
|
81703
|
+
"",
|
|
81704
|
+
"### \u2764\uFE0F Thank You",
|
|
81705
|
+
"",
|
|
81706
|
+
...authors.sort((a, b) => a.name.localeCompare(b.name)).map((i) => {
|
|
81707
|
+
const github = i.github ? ` @${i.github}` : "";
|
|
81708
|
+
return `- ${i.name}${github}`;
|
|
81709
|
+
})
|
|
81710
|
+
);
|
|
81711
|
+
}
|
|
81712
|
+
return markdownLines;
|
|
81713
|
+
}
|
|
81714
|
+
formatChange(change) {
|
|
81715
|
+
let description = change.description || "";
|
|
81716
|
+
let extraLines = [];
|
|
81717
|
+
let extraLinesStr = "";
|
|
81718
|
+
if (description.includes("\n")) {
|
|
81719
|
+
const lines2 = description.split("\n");
|
|
81720
|
+
if (lines2.length > 1) {
|
|
81721
|
+
description = lines2[0];
|
|
81722
|
+
extraLines = lines2.slice(1);
|
|
81723
|
+
}
|
|
81724
|
+
const indentation = " ";
|
|
81725
|
+
extraLinesStr = extraLines.filter((l) => l.trim().length > 0).map((l) => `${indentation}${l}`).join("\n");
|
|
81726
|
+
}
|
|
81727
|
+
let changeLine = "- " + (!this.isVersionPlans && change.scope ? `**${change.scope.trim()}:** ` : "") + description;
|
|
81728
|
+
if (this.config.repoData && change.githubReferences) {
|
|
81729
|
+
changeLine += this.remoteReleaseClient.formatReferences(
|
|
81730
|
+
change.githubReferences
|
|
81731
|
+
);
|
|
81732
|
+
}
|
|
81733
|
+
if (extraLinesStr) {
|
|
81734
|
+
changeLine += "\n\n" + extraLinesStr;
|
|
81735
|
+
}
|
|
81736
|
+
return changeLine;
|
|
81737
|
+
}
|
|
81738
|
+
}, _class16);
|
|
81242
81739
|
|
|
81243
81740
|
// src/release/github.ts
|
|
81244
81741
|
_chunkIG6EXAQUcjs.init_cjs_shims.call(void 0, );
|
|
@@ -81253,6 +81750,9 @@ var import_enquirer = _chunkIG6EXAQUcjs.__toESM.call(void 0, require_enquirer(),
|
|
|
81253
81750
|
|
|
81254
81751
|
|
|
81255
81752
|
|
|
81753
|
+
|
|
81754
|
+
|
|
81755
|
+
|
|
81256
81756
|
function getGitHubRepoData(remoteName = "origin", createReleaseConfig) {
|
|
81257
81757
|
try {
|
|
81258
81758
|
const remoteUrl = _child_process.execSync.call(void 0, `git remote get-url ${remoteName}`, {
|
|
@@ -81282,7 +81782,11 @@ function getGitHubRepoData(remoteName = "origin", createReleaseConfig) {
|
|
|
81282
81782
|
);
|
|
81283
81783
|
}
|
|
81284
81784
|
} catch (error) {
|
|
81285
|
-
|
|
81785
|
+
import_devkit.output.error({
|
|
81786
|
+
title: `Failed to get GitHub repo data`,
|
|
81787
|
+
bodyLines: [error.message]
|
|
81788
|
+
});
|
|
81789
|
+
return void 0;
|
|
81286
81790
|
}
|
|
81287
81791
|
}
|
|
81288
81792
|
async function createOrUpdateGithubRelease(createReleaseConfig, releaseVersion, changelogContents, latestCommit, { dryRun }) {
|
|
@@ -81296,12 +81800,12 @@ async function createOrUpdateGithubRelease(createReleaseConfig, releaseVersion,
|
|
|
81296
81800
|
});
|
|
81297
81801
|
process.exit(1);
|
|
81298
81802
|
}
|
|
81299
|
-
const
|
|
81803
|
+
const tokenData = await resolveTokenData(githubRepoData.hostname);
|
|
81300
81804
|
const githubRequestConfig = {
|
|
81301
81805
|
repo: githubRepoData.slug,
|
|
81302
81806
|
hostname: githubRepoData.hostname,
|
|
81303
81807
|
apiBaseUrl: githubRepoData.apiBaseUrl,
|
|
81304
|
-
token
|
|
81808
|
+
token: _optionalChain([tokenData, 'optionalAccess', _204 => _204.token]) || null
|
|
81305
81809
|
};
|
|
81306
81810
|
let existingGithubReleaseForVersion;
|
|
81307
81811
|
try {
|
|
@@ -81310,7 +81814,7 @@ async function createOrUpdateGithubRelease(createReleaseConfig, releaseVersion,
|
|
|
81310
81814
|
releaseVersion.gitTag
|
|
81311
81815
|
);
|
|
81312
81816
|
} catch (err) {
|
|
81313
|
-
if (_optionalChain([err, 'access',
|
|
81817
|
+
if (_optionalChain([err, 'access', _205 => _205.response, 'optionalAccess', _206 => _206.status]) === 401) {
|
|
81314
81818
|
import_devkit.output.error({
|
|
81315
81819
|
title: `Unable to resolve data via the GitHub API. You can use any of the following options to resolve this:`,
|
|
81316
81820
|
bodyLines: [
|
|
@@ -81320,7 +81824,7 @@ async function createOrUpdateGithubRelease(createReleaseConfig, releaseVersion,
|
|
|
81320
81824
|
});
|
|
81321
81825
|
process.exit(1);
|
|
81322
81826
|
}
|
|
81323
|
-
if (_optionalChain([err, 'access',
|
|
81827
|
+
if (_optionalChain([err, 'access', _207 => _207.response, 'optionalAccess', _208 => _208.status]) === 404) {
|
|
81324
81828
|
} else {
|
|
81325
81829
|
throw err;
|
|
81326
81830
|
}
|
|
@@ -81337,7 +81841,7 @@ async function createOrUpdateGithubRelease(createReleaseConfig, releaseVersion,
|
|
|
81337
81841
|
}
|
|
81338
81842
|
console.log("");
|
|
81339
81843
|
_printchanges.printDiff.call(void 0,
|
|
81340
|
-
_optionalChain([existingGithubReleaseForVersion, 'optionalAccess',
|
|
81844
|
+
_optionalChain([existingGithubReleaseForVersion, 'optionalAccess', _209 => _209.body]) ? existingGithubReleaseForVersion.body : "",
|
|
81341
81845
|
changelogContents,
|
|
81342
81846
|
3,
|
|
81343
81847
|
_shared.noDiffInChangelogMessage
|
|
@@ -81364,7 +81868,7 @@ async function createOrUpdateGithubReleaseInternal(githubRequestConfig, release,
|
|
|
81364
81868
|
if (result2.status === "manual") {
|
|
81365
81869
|
if (result2.error) {
|
|
81366
81870
|
process.exitCode = 1;
|
|
81367
|
-
if (_optionalChain([result2, 'access',
|
|
81871
|
+
if (_optionalChain([result2, 'access', _210 => _210.error, 'access', _211 => _211.response, 'optionalAccess', _212 => _212.data])) {
|
|
81368
81872
|
import_devkit.output.error({
|
|
81369
81873
|
title: `A GitHub API Error occurred when creating/updating the release`,
|
|
81370
81874
|
bodyLines: [
|
|
@@ -81438,7 +81942,7 @@ async function promptForContinueInGitHub() {
|
|
|
81438
81942
|
}
|
|
81439
81943
|
]);
|
|
81440
81944
|
return reply.open === "Yes";
|
|
81441
|
-
} catch (
|
|
81945
|
+
} catch (e17) {
|
|
81442
81946
|
process.stdout.write("\x1B[?25h");
|
|
81443
81947
|
process.exit(1);
|
|
81444
81948
|
}
|
|
@@ -81475,13 +81979,13 @@ async function syncGithubRelease(githubRequestConfig, release, existingGithubRel
|
|
|
81475
81979
|
};
|
|
81476
81980
|
}
|
|
81477
81981
|
}
|
|
81478
|
-
async function
|
|
81479
|
-
const tokenFromEnv = process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
|
|
81982
|
+
async function resolveTokenData(hostname) {
|
|
81983
|
+
const tokenFromEnv = process.env.STORM_BOT_GITHUB_TOKEN || process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
|
|
81480
81984
|
if (tokenFromEnv) {
|
|
81481
|
-
return tokenFromEnv;
|
|
81985
|
+
return { token: tokenFromEnv, headerName: "Authorization" };
|
|
81482
81986
|
}
|
|
81483
|
-
const ghCLIPath =
|
|
81484
|
-
process.env.XDG_CONFIG_HOME ||
|
|
81987
|
+
const ghCLIPath = (0, import_devkit.joinPathFragments)(
|
|
81988
|
+
process.env.XDG_CONFIG_HOME || (0, import_devkit.joinPathFragments)(_os.homedir.call(void 0, ), ".config"),
|
|
81485
81989
|
"gh",
|
|
81486
81990
|
"hosts.yml"
|
|
81487
81991
|
);
|
|
@@ -81494,11 +81998,12 @@ async function resolveGithubToken(hostname) {
|
|
|
81494
81998
|
return ghCLIConfig[hostname].oauth_token;
|
|
81495
81999
|
}
|
|
81496
82000
|
if (ghCLIConfig[hostname].user && ghCLIConfig[hostname].git_protocol === "ssh") {
|
|
81497
|
-
|
|
82001
|
+
const token = _child_process.execSync.call(void 0, `gh auth token`, {
|
|
81498
82002
|
encoding: "utf8",
|
|
81499
82003
|
stdio: "pipe",
|
|
81500
82004
|
windowsHide: false
|
|
81501
82005
|
}).trim();
|
|
82006
|
+
return { token, headerName: "Authorization" };
|
|
81502
82007
|
}
|
|
81503
82008
|
}
|
|
81504
82009
|
}
|
|
@@ -81507,7 +82012,9 @@ async function resolveGithubToken(hostname) {
|
|
|
81507
82012
|
`Warning: It was not possible to automatically resolve a GitHub token from your environment for hostname ${hostname}. If you set the GITHUB_TOKEN or GH_TOKEN environment variable, that will be used for GitHub API requests.`
|
|
81508
82013
|
);
|
|
81509
82014
|
}
|
|
81510
|
-
|
|
82015
|
+
throw new Error(
|
|
82016
|
+
`Unable to resolve a GitHub token for hostname ${hostname}. Please set the GITHUB_TOKEN or GH_TOKEN environment variable, or ensure you have an active session via the official gh CLI tool (https://cli.github.com).`
|
|
82017
|
+
);
|
|
81511
82018
|
}
|
|
81512
82019
|
async function getGithubReleaseByTag(config, tag) {
|
|
81513
82020
|
return await makeGithubRequest(
|
|
@@ -81549,210 +82056,24 @@ function githubNewReleaseURL(config, release) {
|
|
|
81549
82056
|
}
|
|
81550
82057
|
return url2;
|
|
81551
82058
|
}
|
|
81552
|
-
|
|
81553
|
-
|
|
81554
|
-
|
|
81555
|
-
|
|
81556
|
-
|
|
81557
|
-
|
|
81558
|
-
}
|
|
81559
|
-
function formatReferences(references, repoData) {
|
|
81560
|
-
const pr = references.filter((ref) => ref.type === "pull-request");
|
|
81561
|
-
const issue = references.filter((ref) => ref.type === "issue");
|
|
81562
|
-
if (pr.length > 0 || issue.length > 0) {
|
|
81563
|
-
return " (" + [...pr, ...issue].map((ref) => formatReference(ref, repoData)).join(", ") + ")";
|
|
81564
|
-
}
|
|
81565
|
-
if (references.length > 0) {
|
|
81566
|
-
return " (" + formatReference(references[0], repoData) + ")";
|
|
82059
|
+
async function createGithubRemoteReleaseClient(remoteName = "origin") {
|
|
82060
|
+
const repoData = getGitHubRepoData(remoteName, "github");
|
|
82061
|
+
if (!repoData) {
|
|
82062
|
+
throw new Error(
|
|
82063
|
+
`Unable to create a remote release client because the GitHub repo slug could not be determined. Please ensure you have a valid GitHub remote configured.`
|
|
82064
|
+
);
|
|
81567
82065
|
}
|
|
81568
|
-
return
|
|
82066
|
+
return new (0, _github.GithubRemoteReleaseClient)(
|
|
82067
|
+
repoData,
|
|
82068
|
+
{
|
|
82069
|
+
provider: "github",
|
|
82070
|
+
hostname: repoData.hostname,
|
|
82071
|
+
apiBaseUrl: repoData.apiBaseUrl
|
|
82072
|
+
},
|
|
82073
|
+
await resolveTokenData(repoData.hostname)
|
|
82074
|
+
);
|
|
81569
82075
|
}
|
|
81570
82076
|
|
|
81571
|
-
// src/release/changelog-renderer.ts
|
|
81572
|
-
var StormChangelogRenderer = (_class16 = class extends _changelogrenderer2.default {
|
|
81573
|
-
/**
|
|
81574
|
-
* A ChangelogRenderer class takes in the determined changes and other relevant metadata and returns a string, or a Promise of a string of changelog contents (usually markdown).
|
|
81575
|
-
*
|
|
81576
|
-
* @param config - The configuration object for the ChangelogRenderer
|
|
81577
|
-
*/
|
|
81578
|
-
constructor(config) {
|
|
81579
|
-
super(config);_class16.prototype.__init43.call(this);;
|
|
81580
|
-
this.config = config;
|
|
81581
|
-
}
|
|
81582
|
-
/**
|
|
81583
|
-
* The Storm workspace configuration object, which is loaded from the storm-workspace.json file.
|
|
81584
|
-
*/
|
|
81585
|
-
__init43() {this.workspaceConfig = null}
|
|
81586
|
-
async render() {
|
|
81587
|
-
this.workspaceConfig = await _chunkXE275LJTcjs.getWorkspaceConfig.call(void 0, );
|
|
81588
|
-
return await super.render();
|
|
81589
|
-
}
|
|
81590
|
-
preprocessChanges() {
|
|
81591
|
-
this.relevantChanges = [...this.changes];
|
|
81592
|
-
this.breakingChanges = [];
|
|
81593
|
-
this.additionalChangesForAuthorsSection = [];
|
|
81594
|
-
for (let i = this.relevantChanges.length - 1; i >= 0; i--) {
|
|
81595
|
-
const change = this.relevantChanges[i];
|
|
81596
|
-
if (change && change.type === "revert" && change.revertedHashes) {
|
|
81597
|
-
for (const revertedHash of change.revertedHashes) {
|
|
81598
|
-
const revertedCommitIndex = this.relevantChanges.findIndex(
|
|
81599
|
-
(c) => c.shortHash && revertedHash.startsWith(c.shortHash)
|
|
81600
|
-
);
|
|
81601
|
-
if (revertedCommitIndex !== -1) {
|
|
81602
|
-
this.relevantChanges.splice(revertedCommitIndex, 1);
|
|
81603
|
-
this.relevantChanges.splice(i, 1);
|
|
81604
|
-
i--;
|
|
81605
|
-
break;
|
|
81606
|
-
}
|
|
81607
|
-
}
|
|
81608
|
-
}
|
|
81609
|
-
}
|
|
81610
|
-
if (this.isVersionPlans) {
|
|
81611
|
-
this.conventionalCommitsConfig = {
|
|
81612
|
-
types: {
|
|
81613
|
-
feat: _conventionalcommits.DEFAULT_CONVENTIONAL_COMMITS_CONFIG.types.feat,
|
|
81614
|
-
fix: _conventionalcommits.DEFAULT_CONVENTIONAL_COMMITS_CONFIG.types.fix
|
|
81615
|
-
}
|
|
81616
|
-
};
|
|
81617
|
-
for (let i = this.relevantChanges.length - 1; i >= 0; i--) {
|
|
81618
|
-
if (_optionalChain([this, 'access', _197 => _197.relevantChanges, 'access', _198 => _198[i], 'optionalAccess', _199 => _199.isBreaking])) {
|
|
81619
|
-
const change = this.relevantChanges[i];
|
|
81620
|
-
if (change) {
|
|
81621
|
-
this.additionalChangesForAuthorsSection.push(change);
|
|
81622
|
-
const line = this.formatChange(change);
|
|
81623
|
-
this.breakingChanges.push(line);
|
|
81624
|
-
this.relevantChanges.splice(i, 1);
|
|
81625
|
-
}
|
|
81626
|
-
}
|
|
81627
|
-
}
|
|
81628
|
-
} else {
|
|
81629
|
-
for (const change of this.relevantChanges) {
|
|
81630
|
-
if (change.isBreaking) {
|
|
81631
|
-
const breakingChangeExplanation = change.body ? this.extractBreakingChangeExplanation(change.body) : "";
|
|
81632
|
-
this.breakingChanges.push(
|
|
81633
|
-
breakingChangeExplanation ? `- ${change.scope ? `**${change.scope.trim()}:** ` : ""}${breakingChangeExplanation}` : this.formatChange(change)
|
|
81634
|
-
);
|
|
81635
|
-
}
|
|
81636
|
-
}
|
|
81637
|
-
}
|
|
81638
|
-
}
|
|
81639
|
-
/**
|
|
81640
|
-
* Determines if the changelog entry should be rendered as empty. This is the case when there are no relevant changes, breaking changes, or dependency bumps.
|
|
81641
|
-
*/
|
|
81642
|
-
// protected override shouldRenderEmptyEntry(): boolean {
|
|
81643
|
-
// return true;
|
|
81644
|
-
// }
|
|
81645
|
-
renderVersionTitle() {
|
|
81646
|
-
const isMajorVersion = `${(0, import_semver.major)(this.changelogEntryVersion)}.0.0` === this.changelogEntryVersion.replace(/^v/, "");
|
|
81647
|
-
return isMajorVersion ? `# ${generateChangelogTitle(this.changelogEntryVersion, this.project, this.workspaceConfig)}` : `## ${generateChangelogTitle(this.changelogEntryVersion, this.project, this.workspaceConfig)}`;
|
|
81648
|
-
}
|
|
81649
|
-
renderBreakingChanges() {
|
|
81650
|
-
return [
|
|
81651
|
-
"### Breaking Changes",
|
|
81652
|
-
"",
|
|
81653
|
-
...Array.from(new Set(this.breakingChanges))
|
|
81654
|
-
];
|
|
81655
|
-
}
|
|
81656
|
-
renderDependencyBumps() {
|
|
81657
|
-
const markdownLines = ["", "### Updated Dependencies", ""];
|
|
81658
|
-
_optionalChain([this, 'access', _200 => _200.dependencyBumps, 'optionalAccess', _201 => _201.forEach, 'call', _202 => _202(({ dependencyName, newVersion }) => {
|
|
81659
|
-
markdownLines.push(`- Updated ${dependencyName} to ${newVersion}`);
|
|
81660
|
-
})]);
|
|
81661
|
-
return markdownLines;
|
|
81662
|
-
}
|
|
81663
|
-
async renderAuthors() {
|
|
81664
|
-
const markdownLines = [];
|
|
81665
|
-
const _authors = /* @__PURE__ */ new Map();
|
|
81666
|
-
for (const change of [
|
|
81667
|
-
...this.relevantChanges,
|
|
81668
|
-
...this.additionalChangesForAuthorsSection
|
|
81669
|
-
]) {
|
|
81670
|
-
if (!change.authors) {
|
|
81671
|
-
continue;
|
|
81672
|
-
}
|
|
81673
|
-
for (const author of change.authors) {
|
|
81674
|
-
const name = this.formatName(author.name);
|
|
81675
|
-
if (!name || name.includes("[bot]") || name === _optionalChain([this, 'access', _203 => _203.workspaceConfig, 'optionalAccess', _204 => _204.bot, 'access', _205 => _205.name])) {
|
|
81676
|
-
continue;
|
|
81677
|
-
}
|
|
81678
|
-
if (_authors.has(name)) {
|
|
81679
|
-
const entry = _authors.get(name);
|
|
81680
|
-
_optionalChain([entry, 'optionalAccess', _206 => _206.email, 'access', _207 => _207.add, 'call', _208 => _208(author.email)]);
|
|
81681
|
-
} else {
|
|
81682
|
-
_authors.set(name, { email: /* @__PURE__ */ new Set([author.email]) });
|
|
81683
|
-
}
|
|
81684
|
-
}
|
|
81685
|
-
}
|
|
81686
|
-
if (this.config.repoData && this.changelogRenderOptions.mapAuthorsToGitHubUsernames) {
|
|
81687
|
-
await Promise.all(
|
|
81688
|
-
[..._authors.keys()].map(async (authorName) => {
|
|
81689
|
-
const meta = _authors.get(authorName);
|
|
81690
|
-
if (!meta) {
|
|
81691
|
-
return;
|
|
81692
|
-
}
|
|
81693
|
-
for (const email of meta.email) {
|
|
81694
|
-
if (email.endsWith("@users.noreply.github.com")) {
|
|
81695
|
-
const match = email.match(
|
|
81696
|
-
/^(\d+\+)?([^@]+)@users\.noreply\.github\.com$/
|
|
81697
|
-
);
|
|
81698
|
-
if (match && match[2]) {
|
|
81699
|
-
meta.github = match[2];
|
|
81700
|
-
break;
|
|
81701
|
-
}
|
|
81702
|
-
}
|
|
81703
|
-
const { data } = await axios_default.get(`https://ungh.cc/users/find/${email}`).catch(() => ({ data: { user: null } }));
|
|
81704
|
-
if (_optionalChain([data, 'optionalAccess', _209 => _209.user])) {
|
|
81705
|
-
meta.github = data.user.username;
|
|
81706
|
-
break;
|
|
81707
|
-
}
|
|
81708
|
-
}
|
|
81709
|
-
})
|
|
81710
|
-
);
|
|
81711
|
-
}
|
|
81712
|
-
const authors = [..._authors.entries()].map((e) => ({
|
|
81713
|
-
name: e[0],
|
|
81714
|
-
...e[1]
|
|
81715
|
-
}));
|
|
81716
|
-
if (authors.length > 0) {
|
|
81717
|
-
markdownLines.push(
|
|
81718
|
-
"",
|
|
81719
|
-
"### \u2764\uFE0F Thank You",
|
|
81720
|
-
"",
|
|
81721
|
-
...authors.sort((a, b) => a.name.localeCompare(b.name)).map((i) => {
|
|
81722
|
-
const github = i.github ? ` @${i.github}` : "";
|
|
81723
|
-
return `- ${i.name}${github}`;
|
|
81724
|
-
})
|
|
81725
|
-
);
|
|
81726
|
-
}
|
|
81727
|
-
return markdownLines;
|
|
81728
|
-
}
|
|
81729
|
-
formatChange(change) {
|
|
81730
|
-
let description = change.description || "";
|
|
81731
|
-
let extraLines = [];
|
|
81732
|
-
let extraLinesStr = "";
|
|
81733
|
-
if (description.includes("\n")) {
|
|
81734
|
-
const lines2 = description.split("\n");
|
|
81735
|
-
if (lines2.length > 1) {
|
|
81736
|
-
description = lines2[0];
|
|
81737
|
-
extraLines = lines2.slice(1);
|
|
81738
|
-
}
|
|
81739
|
-
const indentation = " ";
|
|
81740
|
-
extraLinesStr = extraLines.filter((l) => l.trim().length > 0).map((l) => `${indentation}${l}`).join("\n");
|
|
81741
|
-
}
|
|
81742
|
-
let changeLine = "- " + (!this.isVersionPlans && change.scope ? `**${change.scope.trim()}:** ` : "") + description;
|
|
81743
|
-
if (this.config.repoData && this.changelogRenderOptions.commitReferences && change.githubReferences) {
|
|
81744
|
-
changeLine += formatReferences(
|
|
81745
|
-
change.githubReferences,
|
|
81746
|
-
this.config.repoData
|
|
81747
|
-
);
|
|
81748
|
-
}
|
|
81749
|
-
if (extraLinesStr) {
|
|
81750
|
-
changeLine += "\n\n" + extraLinesStr;
|
|
81751
|
-
}
|
|
81752
|
-
return changeLine;
|
|
81753
|
-
}
|
|
81754
|
-
}, _class16);
|
|
81755
|
-
|
|
81756
82077
|
// src/release/changelog.ts
|
|
81757
82078
|
function createAPI(overrideReleaseConfig) {
|
|
81758
82079
|
return async function releaseChangelog(args) {
|
|
@@ -81817,7 +82138,7 @@ function createAPI(overrideReleaseConfig) {
|
|
|
81817
82138
|
if (args.deleteVersionPlans === void 0) {
|
|
81818
82139
|
args.deleteVersionPlans = true;
|
|
81819
82140
|
}
|
|
81820
|
-
const changelogGenerationEnabled = !!_optionalChain([nxReleaseConfig, 'optionalAccess',
|
|
82141
|
+
const changelogGenerationEnabled = !!_optionalChain([nxReleaseConfig, 'optionalAccess', _213 => _213.changelog, 'optionalAccess', _214 => _214.workspaceChangelog]) || _optionalChain([nxReleaseConfig, 'optionalAccess', _215 => _215.groups]) && Object.values(_optionalChain([nxReleaseConfig, 'optionalAccess', _216 => _216.groups])).some((g) => g.changelog);
|
|
81821
82142
|
if (!changelogGenerationEnabled) {
|
|
81822
82143
|
_output.output.warn({
|
|
81823
82144
|
title: `Changelogs are disabled. No changelog entries will be generated`,
|
|
@@ -81828,7 +82149,7 @@ function createAPI(overrideReleaseConfig) {
|
|
|
81828
82149
|
return {};
|
|
81829
82150
|
}
|
|
81830
82151
|
const tree = new (0, _tree.FsTree)(_workspaceroot.workspaceRoot, !!args.verbose);
|
|
81831
|
-
const useAutomaticFromRef = _optionalChain([nxReleaseConfig, 'optionalAccess',
|
|
82152
|
+
const useAutomaticFromRef = _optionalChain([nxReleaseConfig, 'optionalAccess', _217 => _217.changelog, 'optionalAccess', _218 => _218.automaticFromRef]) || args.firstRelease;
|
|
81832
82153
|
const { workspaceChangelogVersion, projectsVersionData } = resolveChangelogVersions(
|
|
81833
82154
|
args,
|
|
81834
82155
|
releaseGroups,
|
|
@@ -81837,20 +82158,20 @@ function createAPI(overrideReleaseConfig) {
|
|
|
81837
82158
|
const to = args.to || "HEAD";
|
|
81838
82159
|
const toSHA = await _git.getCommitHash.call(void 0, to);
|
|
81839
82160
|
const headSHA = to === "HEAD" ? toSHA : await _git.getCommitHash.call(void 0, "HEAD");
|
|
81840
|
-
const autoCommitEnabled = _nullishCoalesce(args.gitCommit, () => ( _optionalChain([nxReleaseConfig, 'access',
|
|
82161
|
+
const autoCommitEnabled = _nullishCoalesce(args.gitCommit, () => ( _optionalChain([nxReleaseConfig, 'access', _219 => _219.changelog, 'optionalAccess', _220 => _220.git, 'access', _221 => _221.commit])));
|
|
81841
82162
|
if (autoCommitEnabled && headSHA !== toSHA) {
|
|
81842
82163
|
throw new Error(
|
|
81843
82164
|
`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`
|
|
81844
82165
|
);
|
|
81845
82166
|
}
|
|
81846
|
-
const commitMessage = args.gitCommitMessage || _optionalChain([nxReleaseConfig, 'access',
|
|
82167
|
+
const commitMessage = args.gitCommitMessage || _optionalChain([nxReleaseConfig, 'access', _222 => _222.changelog, 'optionalAccess', _223 => _223.git, 'optionalAccess', _224 => _224.commitMessage]);
|
|
81847
82168
|
const commitMessageValues = _shared.createCommitMessageValues.call(void 0,
|
|
81848
82169
|
releaseGroups,
|
|
81849
82170
|
releaseGroupToFilteredProjects,
|
|
81850
82171
|
projectsVersionData,
|
|
81851
82172
|
commitMessage
|
|
81852
82173
|
);
|
|
81853
|
-
const gitTagValues = _nullishCoalesce(args.gitTag, () => ( _optionalChain([nxReleaseConfig, 'access',
|
|
82174
|
+
const gitTagValues = _nullishCoalesce(args.gitTag, () => ( _optionalChain([nxReleaseConfig, 'access', _225 => _225.changelog, 'optionalAccess', _226 => _226.git, 'access', _227 => _227.tag]))) ? _shared.createGitTagValues.call(void 0,
|
|
81854
82175
|
releaseGroups,
|
|
81855
82176
|
releaseGroupToFilteredProjects,
|
|
81856
82177
|
projectsVersionData
|
|
@@ -81911,7 +82232,7 @@ function createAPI(overrideReleaseConfig) {
|
|
|
81911
82232
|
nxReleaseConfig.releaseTagPattern,
|
|
81912
82233
|
{},
|
|
81913
82234
|
nxReleaseConfig.releaseTagPatternCheckAllBranchesWhen
|
|
81914
|
-
)), 'optionalAccess', async
|
|
82235
|
+
)), 'optionalAccess', async _228 => _228.tag]);
|
|
81915
82236
|
if (!workspaceChangelogFromRef) {
|
|
81916
82237
|
if (useAutomaticFromRef) {
|
|
81917
82238
|
workspaceChangelogFromRef = await _git.getFirstGitCommit.call(void 0, );
|
|
@@ -81965,7 +82286,7 @@ function createAPI(overrideReleaseConfig) {
|
|
|
81965
82286
|
)
|
|
81966
82287
|
});
|
|
81967
82288
|
if (workspaceChangelog && shouldCreateGitHubRelease(
|
|
81968
|
-
_optionalChain([nxReleaseConfig, 'access',
|
|
82289
|
+
_optionalChain([nxReleaseConfig, 'access', _229 => _229.changelog, 'optionalAccess', _230 => _230.workspaceChangelog]),
|
|
81969
82290
|
args.createRelease
|
|
81970
82291
|
)) {
|
|
81971
82292
|
postGitTasks.push(async (latestCommit) => {
|
|
@@ -81979,7 +82300,7 @@ function createAPI(overrideReleaseConfig) {
|
|
|
81979
82300
|
|
|
81980
82301
|
${contents}`);
|
|
81981
82302
|
await createOrUpdateGithubRelease(
|
|
81982
|
-
_optionalChain([nxReleaseConfig, 'access',
|
|
82303
|
+
_optionalChain([nxReleaseConfig, 'access', _231 => _231.changelog, 'optionalAccess', _232 => _232.workspaceChangelog]) ? _optionalChain([nxReleaseConfig, 'access', _233 => _233.changelog, 'optionalAccess', _234 => _234.workspaceChangelog, 'access', _235 => _235.createRelease]) : _github.defaultCreateReleaseProvider,
|
|
81983
82304
|
workspaceChangelog.releaseVersion,
|
|
81984
82305
|
contents,
|
|
81985
82306
|
latestCommit,
|
|
@@ -81997,13 +82318,13 @@ ${contents}`);
|
|
|
81997
82318
|
continue;
|
|
81998
82319
|
}
|
|
81999
82320
|
for (const project of releaseGroup.projects) {
|
|
82000
|
-
if (!_optionalChain([projectsVersionData, 'access',
|
|
82321
|
+
if (!_optionalChain([projectsVersionData, 'access', _236 => _236[project], 'optionalAccess', _237 => _237.newVersion])) {
|
|
82001
82322
|
continue;
|
|
82002
82323
|
}
|
|
82003
82324
|
const dependentProjects = (projectsVersionData[project].dependentProjects || []).map((dep) => {
|
|
82004
82325
|
return {
|
|
82005
82326
|
dependencyName: dep.source,
|
|
82006
|
-
newVersion: _optionalChain([projectsVersionData, 'access',
|
|
82327
|
+
newVersion: _optionalChain([projectsVersionData, 'access', _238 => _238[dep.source], 'optionalAccess', _239 => _239.newVersion])
|
|
82007
82328
|
};
|
|
82008
82329
|
}).filter((b) => b.newVersion !== null);
|
|
82009
82330
|
for (const dependent of dependentProjects) {
|
|
@@ -82025,13 +82346,13 @@ ${contents}`);
|
|
|
82025
82346
|
if (config === false) {
|
|
82026
82347
|
continue;
|
|
82027
82348
|
}
|
|
82028
|
-
const projects = _optionalChain([args, 'access',
|
|
82349
|
+
const projects = _optionalChain([args, 'access', _240 => _240.projects, 'optionalAccess', _241 => _241.length]) ? (
|
|
82029
82350
|
// 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
|
|
82030
82351
|
Array.from(releaseGroupToFilteredProjects.get(releaseGroup)).flatMap(
|
|
82031
82352
|
(project) => {
|
|
82032
82353
|
return [
|
|
82033
82354
|
project,
|
|
82034
|
-
..._optionalChain([projectsVersionData, 'access',
|
|
82355
|
+
..._optionalChain([projectsVersionData, 'access', _242 => _242[project], 'optionalAccess', _243 => _243.dependentProjects, 'access', _244 => _244.map, 'call', _245 => _245(
|
|
82035
82356
|
(dep) => dep.source
|
|
82036
82357
|
)]) || []
|
|
82037
82358
|
];
|
|
@@ -82076,14 +82397,14 @@ ${contents}`);
|
|
|
82076
82397
|
releaseGroupName: releaseGroup.name
|
|
82077
82398
|
},
|
|
82078
82399
|
releaseGroup.releaseTagPatternCheckAllBranchesWhen
|
|
82079
|
-
)), 'optionalAccess', async
|
|
82400
|
+
)), 'optionalAccess', async _246 => _246.tag]);
|
|
82080
82401
|
if (!fromRef && useAutomaticFromRef) {
|
|
82081
82402
|
const firstCommit = await _git.getFirstGitCommit.call(void 0, );
|
|
82082
82403
|
const allCommits = await getCommits(firstCommit, toSHA);
|
|
82083
82404
|
const commitsForProject = allCommits.filter(
|
|
82084
82405
|
(c) => c.affectedFiles.find((f) => f.startsWith(project.data.root))
|
|
82085
82406
|
);
|
|
82086
|
-
fromRef = _optionalChain([commitsForProject, 'access',
|
|
82407
|
+
fromRef = _optionalChain([commitsForProject, 'access', _247 => _247[0], 'optionalAccess', _248 => _248.shortHash]);
|
|
82087
82408
|
if (args.verbose) {
|
|
82088
82409
|
console.log(
|
|
82089
82410
|
`Determined --from ref for ${project.name} from the first commit in which it exists: ${fromRef}`
|
|
@@ -82111,7 +82432,7 @@ ${contents}`);
|
|
|
82111
82432
|
body: c.body,
|
|
82112
82433
|
isBreaking: c.isBreaking,
|
|
82113
82434
|
githubReferences: c.references,
|
|
82114
|
-
// TODO
|
|
82435
|
+
// TODO: Implement support for Co-authored-by and adding multiple authors
|
|
82115
82436
|
authors: [c.author],
|
|
82116
82437
|
shortHash: c.shortHash,
|
|
82117
82438
|
revertedHashes: c.revertedHashes,
|
|
@@ -82211,7 +82532,7 @@ ${contents}`);
|
|
|
82211
82532
|
releaseGroup.releaseTagPattern,
|
|
82212
82533
|
{},
|
|
82213
82534
|
releaseGroup.releaseTagPatternCheckAllBranchesWhen
|
|
82214
|
-
)), 'optionalAccess', async
|
|
82535
|
+
)), 'optionalAccess', async _249 => _249.tag]);
|
|
82215
82536
|
if (!fromRef) {
|
|
82216
82537
|
if (useAutomaticFromRef) {
|
|
82217
82538
|
fromRef = await _git.getFirstGitCommit.call(void 0, );
|
|
@@ -82240,7 +82561,7 @@ ${contents}`);
|
|
|
82240
82561
|
body: c.body,
|
|
82241
82562
|
isBreaking: c.isBreaking,
|
|
82242
82563
|
githubReferences: c.references,
|
|
82243
|
-
// TODO
|
|
82564
|
+
// TODO: Implement support for Co-authored-by and adding multiple authors
|
|
82244
82565
|
authors: [c.author],
|
|
82245
82566
|
shortHash: c.shortHash,
|
|
82246
82567
|
revertedHashes: c.revertedHashes,
|
|
@@ -82400,17 +82721,17 @@ async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTa
|
|
|
82400
82721
|
});
|
|
82401
82722
|
deletedFiles = Array.from(planFiles);
|
|
82402
82723
|
}
|
|
82403
|
-
if (_nullishCoalesce(args.gitCommit, () => ( _optionalChain([nxReleaseConfig, 'access',
|
|
82404
|
-
await
|
|
82724
|
+
if (_nullishCoalesce(args.gitCommit, () => ( _optionalChain([nxReleaseConfig, 'access', _250 => _250.changelog, 'optionalAccess', _251 => _251.git, 'access', _252 => _252.commit])))) {
|
|
82725
|
+
await commitChanges({
|
|
82405
82726
|
changedFiles,
|
|
82406
82727
|
deletedFiles,
|
|
82407
82728
|
isDryRun: !!args.dryRun,
|
|
82408
82729
|
isVerbose: !!args.verbose,
|
|
82409
82730
|
gitCommitMessages: commitMessageValues,
|
|
82410
|
-
gitCommitArgs: args.gitCommitArgs
|
|
82731
|
+
gitCommitArgs: _nullishCoalesce(args.gitCommitArgs, () => ( _optionalChain([nxReleaseConfig, 'access', _253 => _253.changelog, 'optionalAccess', _254 => _254.git, 'access', _255 => _255.commitArgs])))
|
|
82411
82732
|
});
|
|
82412
82733
|
latestCommit = await _git.getCommitHash.call(void 0, "HEAD");
|
|
82413
|
-
} else if ((_nullishCoalesce(args.stageChanges, () => ( _optionalChain([nxReleaseConfig, 'access',
|
|
82734
|
+
} else if ((_nullishCoalesce(args.stageChanges, () => ( _optionalChain([nxReleaseConfig, 'access', _256 => _256.changelog, 'optionalAccess', _257 => _257.git, 'access', _258 => _258.stageChanges])))) && changes.length) {
|
|
82414
82735
|
_output.output.logSingleLine(`Staging changed files with git`);
|
|
82415
82736
|
await _git.gitAdd.call(void 0, {
|
|
82416
82737
|
changedFiles,
|
|
@@ -82419,25 +82740,24 @@ async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTa
|
|
|
82419
82740
|
verbose: args.verbose
|
|
82420
82741
|
});
|
|
82421
82742
|
}
|
|
82422
|
-
if (_nullishCoalesce(args.gitTag, () => ( _optionalChain([nxReleaseConfig, 'access',
|
|
82743
|
+
if (_nullishCoalesce(args.gitTag, () => ( _optionalChain([nxReleaseConfig, 'access', _259 => _259.changelog, 'optionalAccess', _260 => _260.git, 'access', _261 => _261.tag])))) {
|
|
82423
82744
|
_output.output.logSingleLine(`Tagging commit with git`);
|
|
82424
82745
|
for (const tag of gitTagValues) {
|
|
82425
82746
|
await gitTag({
|
|
82426
82747
|
tag,
|
|
82427
|
-
message: args.gitTagMessage || _optionalChain([nxReleaseConfig, 'access',
|
|
82428
|
-
additionalArgs: args.gitTagArgs || _optionalChain([nxReleaseConfig, 'access',
|
|
82748
|
+
message: args.gitTagMessage || _optionalChain([nxReleaseConfig, 'access', _262 => _262.changelog, 'optionalAccess', _263 => _263.git, 'access', _264 => _264.tagMessage]),
|
|
82749
|
+
additionalArgs: args.gitTagArgs || _optionalChain([nxReleaseConfig, 'access', _265 => _265.changelog, 'optionalAccess', _266 => _266.git, 'access', _267 => _267.tagArgs]),
|
|
82429
82750
|
dryRun: args.dryRun,
|
|
82430
82751
|
verbose: args.verbose
|
|
82431
82752
|
});
|
|
82432
82753
|
}
|
|
82433
82754
|
}
|
|
82434
|
-
if (_nullishCoalesce(args.gitPush, () => ( _optionalChain([nxReleaseConfig, 'access',
|
|
82755
|
+
if (_nullishCoalesce(args.gitPush, () => ( _optionalChain([nxReleaseConfig, 'access', _268 => _268.changelog, 'optionalAccess', _269 => _269.git, 'access', _270 => _270.push])))) {
|
|
82435
82756
|
_output.output.logSingleLine(`Pushing to git remote "${args.gitRemote}"`);
|
|
82436
82757
|
await _git.gitPush.call(void 0, {
|
|
82437
82758
|
gitRemote: args.gitRemote,
|
|
82438
82759
|
dryRun: args.dryRun,
|
|
82439
82760
|
verbose: args.verbose
|
|
82440
|
-
// additionalArgs: ["--signed=if-asked"]
|
|
82441
82761
|
});
|
|
82442
82762
|
}
|
|
82443
82763
|
for (const postGitTask of postGitTasks) {
|
|
@@ -82458,7 +82778,7 @@ async function generateChangelogForWorkspace({
|
|
|
82458
82778
|
`Unable to determine the Storm workspace config. Please ensure that your storm-workspace.json file is present and valid.`
|
|
82459
82779
|
);
|
|
82460
82780
|
}
|
|
82461
|
-
const config = _optionalChain([nxReleaseConfig, 'access',
|
|
82781
|
+
const config = _optionalChain([nxReleaseConfig, 'access', _271 => _271.changelog, 'optionalAccess', _272 => _272.workspaceChangelog]);
|
|
82462
82782
|
if (config === false) {
|
|
82463
82783
|
return;
|
|
82464
82784
|
}
|
|
@@ -82480,7 +82800,7 @@ async function generateChangelogForWorkspace({
|
|
|
82480
82800
|
});
|
|
82481
82801
|
return;
|
|
82482
82802
|
}
|
|
82483
|
-
if (_optionalChain([Object, 'access',
|
|
82803
|
+
if (_optionalChain([Object, 'access', _273 => _273.values, 'call', _274 => _274(_nullishCoalesce(nxReleaseConfig.groups, () => ( {}))), 'access', _275 => _275[0], 'optionalAccess', _276 => _276.projectsRelationship]) === "independent") {
|
|
82484
82804
|
_output.output.warn({
|
|
82485
82805
|
title: `Workspace changelog is enabled, but you have configured an independent projects relationship. This is not supported, so workspace changelog will be disabled.`,
|
|
82486
82806
|
bodyLines: [
|
|
@@ -82516,17 +82836,12 @@ async function generateChangelogForWorkspace({
|
|
|
82516
82836
|
)}`
|
|
82517
82837
|
});
|
|
82518
82838
|
}
|
|
82519
|
-
const
|
|
82520
|
-
const remoteReleaseClient = await _remotereleaseclient.createRemoteReleaseClient.call(void 0,
|
|
82521
|
-
config.createRelease,
|
|
82522
|
-
gitRemote
|
|
82523
|
-
);
|
|
82839
|
+
const remoteReleaseClient = await createGithubRemoteReleaseClient(gitRemote);
|
|
82524
82840
|
const changelogRenderer = new StormChangelogRenderer({
|
|
82525
82841
|
changes,
|
|
82526
82842
|
changelogEntryVersion: releaseVersion.rawVersion,
|
|
82527
82843
|
project: null,
|
|
82528
82844
|
isVersionPlans: false,
|
|
82529
|
-
repoData: githubRepoData,
|
|
82530
82845
|
entryWhenNoChanges: config.entryWhenNoChanges,
|
|
82531
82846
|
changelogRenderOptions: config.renderOptions,
|
|
82532
82847
|
conventionalCommitsConfig: nxReleaseConfig.conventionalCommits,
|
|
@@ -82551,7 +82866,7 @@ async function generateChangelogForWorkspace({
|
|
|
82551
82866
|
releaseVersion,
|
|
82552
82867
|
interpolatedTreePath,
|
|
82553
82868
|
contents,
|
|
82554
|
-
tree.exists(interpolatedTreePath) ? _optionalChain([tree, 'access',
|
|
82869
|
+
tree.exists(interpolatedTreePath) ? _optionalChain([tree, 'access', _277 => _277.read, 'call', _278 => _278(interpolatedTreePath), 'optionalAccess', _279 => _279.toString, 'call', _280 => _280()]) : "",
|
|
82555
82870
|
null,
|
|
82556
82871
|
workspaceConfig
|
|
82557
82872
|
)
|
|
@@ -82596,11 +82911,12 @@ async function generateChangelogForProjects({
|
|
|
82596
82911
|
workspaceRoot: ""
|
|
82597
82912
|
});
|
|
82598
82913
|
}
|
|
82599
|
-
|
|
82914
|
+
const newVersion = _optionalChain([projectsVersionData, 'access', _281 => _281[project.name], 'optionalAccess', _282 => _282.newVersion]);
|
|
82915
|
+
if (!newVersion) {
|
|
82600
82916
|
continue;
|
|
82601
82917
|
}
|
|
82602
82918
|
const releaseVersion = new (0, _shared.ReleaseVersion)({
|
|
82603
|
-
version:
|
|
82919
|
+
version: newVersion,
|
|
82604
82920
|
releaseTagPattern: releaseGroup.releaseTagPattern,
|
|
82605
82921
|
projectName: project.name
|
|
82606
82922
|
});
|
|
@@ -82611,19 +82927,11 @@ async function generateChangelogForProjects({
|
|
|
82611
82927
|
releaseVersion.gitTag
|
|
82612
82928
|
)}`
|
|
82613
82929
|
});
|
|
82614
|
-
const
|
|
82615
|
-
gitRemote,
|
|
82616
|
-
config.createRelease
|
|
82617
|
-
);
|
|
82618
|
-
const remoteReleaseClient = await _remotereleaseclient.createRemoteReleaseClient.call(void 0,
|
|
82619
|
-
config.createRelease,
|
|
82620
|
-
gitRemote
|
|
82621
|
-
);
|
|
82930
|
+
const remoteReleaseClient = await createGithubRemoteReleaseClient(gitRemote);
|
|
82622
82931
|
const changelogRenderer = new StormChangelogRenderer({
|
|
82623
82932
|
changes,
|
|
82624
82933
|
changelogEntryVersion: releaseVersion.rawVersion,
|
|
82625
82934
|
project: project.name,
|
|
82626
|
-
repoData: githubRepoData,
|
|
82627
82935
|
entryWhenNoChanges: typeof config.entryWhenNoChanges === "string" ? _utils.interpolate.call(void 0, config.entryWhenNoChanges, {
|
|
82628
82936
|
projectName: project.name,
|
|
82629
82937
|
projectRoot: project.data.root,
|
|
@@ -82659,7 +82967,7 @@ ${contents}`.trim()
|
|
|
82659
82967
|
releaseVersion,
|
|
82660
82968
|
interpolatedTreePath,
|
|
82661
82969
|
contents,
|
|
82662
|
-
tree.exists(interpolatedTreePath) ? _optionalChain([tree, 'access',
|
|
82970
|
+
tree.exists(interpolatedTreePath) ? _optionalChain([tree, 'access', _283 => _283.read, 'call', _284 => _284(interpolatedTreePath), 'optionalAccess', _285 => _285.toString, 'call', _286 => _286()]) : "",
|
|
82663
82971
|
project.name,
|
|
82664
82972
|
workspaceConfig
|
|
82665
82973
|
)
|
|
@@ -82683,11 +82991,11 @@ ${contents}`.trim()
|
|
|
82683
82991
|
return projectChangelogs;
|
|
82684
82992
|
}
|
|
82685
82993
|
function checkChangelogFilesEnabled(nxReleaseConfig) {
|
|
82686
|
-
if (_optionalChain([nxReleaseConfig, 'access',
|
|
82994
|
+
if (_optionalChain([nxReleaseConfig, 'access', _287 => _287.changelog, 'optionalAccess', _288 => _288.workspaceChangelog]) && _optionalChain([nxReleaseConfig, 'access', _289 => _289.changelog, 'optionalAccess', _290 => _290.workspaceChangelog, 'access', _291 => _291.file])) {
|
|
82687
82995
|
return true;
|
|
82688
82996
|
}
|
|
82689
82997
|
return Object.values(_nullishCoalesce(nxReleaseConfig.groups, () => ( {}))).some(
|
|
82690
|
-
(releaseGroup) => typeof _optionalChain([releaseGroup, 'optionalAccess',
|
|
82998
|
+
(releaseGroup) => typeof _optionalChain([releaseGroup, 'optionalAccess', _292 => _292.changelog]) === "boolean" && releaseGroup.changelog || _optionalChain([releaseGroup, 'optionalAccess', _293 => _293.changelog, 'optionalAccess', _294 => _294.file])
|
|
82691
82999
|
);
|
|
82692
83000
|
}
|
|
82693
83001
|
async function getCommits(fromSHA, toSHA) {
|
|
@@ -82781,16 +83089,16 @@ function formatGithubReleaseNotes(releaseVersion, content, projectName, workspac
|
|
|
82781
83089
|
if (!workspaceConfig) {
|
|
82782
83090
|
return content;
|
|
82783
83091
|
}
|
|
82784
|
-
return `![${_optionalChain([
|
|
83092
|
+
return `![${_optionalChain([titleCase, 'call', _295 => _295(workspaceConfig.organization), 'optionalAccess', _296 => _296.replaceAll, 'call', _297 => _297(" ", "-")])}](${workspaceConfig.release.banner})
|
|
82785
83093
|
${workspaceConfig.release.header || ""}
|
|
82786
83094
|
|
|
82787
|
-
# ${projectName ? `${
|
|
83095
|
+
# ${projectName ? `${titleCase(projectName)} ` : ""}v${releaseVersion.rawVersion}
|
|
82788
83096
|
|
|
82789
|
-
We at [${
|
|
83097
|
+
We at [${titleCase(workspaceConfig.organization)}](${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}
|
|
82790
83098
|
|
|
82791
83099
|
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}).
|
|
82792
83100
|
|
|
82793
|
-
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([
|
|
83101
|
+
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', _298 => _298(projectName), 'optionalAccess', _299 => _299.replaceAll, 'call', _300 => _300(" ", "%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!
|
|
82794
83102
|
|
|
82795
83103
|
## Release Notes
|
|
82796
83104
|
|
|
@@ -82871,10 +83179,12 @@ var DEFAULT_RELEASE_CONFIG = {
|
|
|
82871
83179
|
|
|
82872
83180
|
// src/release/run.ts
|
|
82873
83181
|
var runRelease = async (config, options) => {
|
|
82874
|
-
|
|
82875
|
-
|
|
82876
|
-
process.env.
|
|
82877
|
-
process.env.
|
|
83182
|
+
const name = config.bot.name;
|
|
83183
|
+
const email = config.bot.email ? config.bot.email : config.bot.name ? `${config.bot.name}@users.noreply.github.com` : "bot@stormsoftware.com";
|
|
83184
|
+
process.env.GIT_AUTHOR_NAME = name;
|
|
83185
|
+
process.env.GIT_AUTHOR_EMAIL = email;
|
|
83186
|
+
process.env.GIT_COMMITTER_NAME = name;
|
|
83187
|
+
process.env.GIT_COMMITTER_EMAIL = email;
|
|
82878
83188
|
process.env.NODE_AUTH_TOKEN = process.env.NPM_TOKEN;
|
|
82879
83189
|
process.env.NPM_AUTH_TOKEN = process.env.NPM_TOKEN;
|
|
82880
83190
|
process.env.NPM_CONFIG_PROVENANCE = "true";
|
|
@@ -82890,10 +83200,10 @@ var runRelease = async (config, options) => {
|
|
|
82890
83200
|
`,
|
|
82891
83201
|
config
|
|
82892
83202
|
);
|
|
82893
|
-
if (_optionalChain([nxJson, 'access',
|
|
83203
|
+
if (_optionalChain([nxJson, 'access', _301 => _301.release, 'optionalAccess', _302 => _302.groups])) {
|
|
82894
83204
|
nxJson.release.groups = Object.keys(nxJson.release.groups).reduce(
|
|
82895
83205
|
(ret, groupName) => {
|
|
82896
|
-
const groupConfig = _optionalChain([nxJson, 'access',
|
|
83206
|
+
const groupConfig = _optionalChain([nxJson, 'access', _303 => _303.release, 'optionalAccess', _304 => _304.groups, 'optionalAccess', _305 => _305[groupName]]);
|
|
82897
83207
|
ret[groupName] = _chunkFMYKTN2Zcjs.defu.call(void 0, groupConfig, DEFAULT_RELEASE_GROUP_CONFIG);
|
|
82898
83208
|
return ret;
|
|
82899
83209
|
},
|
|
@@ -82923,7 +83233,7 @@ var runRelease = async (config, options) => {
|
|
|
82923
83233
|
});
|
|
82924
83234
|
await releaseChangelog({
|
|
82925
83235
|
...options,
|
|
82926
|
-
version: _optionalChain([nxReleaseConfig, 'optionalAccess',
|
|
83236
|
+
version: _optionalChain([nxReleaseConfig, 'optionalAccess', _306 => _306.projectsRelationship]) !== "fixed" ? void 0 : workspaceVersion,
|
|
82927
83237
|
versionData: projectsVersionData,
|
|
82928
83238
|
dryRun: false,
|
|
82929
83239
|
verbose: _chunkXE275LJTcjs.isVerbose.call(void 0, config.logLevel),
|
|
@@ -82940,7 +83250,7 @@ var runRelease = async (config, options) => {
|
|
|
82940
83250
|
);
|
|
82941
83251
|
} else {
|
|
82942
83252
|
const changedProjects = Object.keys(projectsVersionData).filter(
|
|
82943
|
-
(key) => _optionalChain([projectsVersionData, 'access',
|
|
83253
|
+
(key) => _optionalChain([projectsVersionData, 'access', _307 => _307[key], 'optionalAccess', _308 => _308.newVersion])
|
|
82944
83254
|
);
|
|
82945
83255
|
if (changedProjects.length > 0) {
|
|
82946
83256
|
_chunkXE275LJTcjs.writeInfo.call(void 0,
|
|
@@ -82956,14 +83266,14 @@ ${changedProjects.map((changedProject) => ` - ${changedProject}`).join("\n")}
|
|
|
82956
83266
|
verbose: _chunkXE275LJTcjs.isVerbose.call(void 0, config.logLevel)
|
|
82957
83267
|
});
|
|
82958
83268
|
const failedProjects = Object.keys(result2).filter(
|
|
82959
|
-
(key) => _optionalChain([result2, 'access',
|
|
83269
|
+
(key) => _optionalChain([result2, 'access', _309 => _309[key], 'optionalAccess', _310 => _310.code]) && _optionalChain([result2, 'access', _311 => _311[key], 'optionalAccess', _312 => _312.code]) > 0
|
|
82960
83270
|
);
|
|
82961
83271
|
if (failedProjects.length > 0) {
|
|
82962
83272
|
throw new Error(
|
|
82963
83273
|
`The Storm release process was not completed successfully! One or more errors occured while running the \`nx-release-publish\` executor tasks.
|
|
82964
83274
|
|
|
82965
83275
|
Please review the workflow details for the following project(s):
|
|
82966
|
-
${failedProjects.map((failedProject) => ` - ${failedProject} (Error Code: ${_optionalChain([result2, 'access',
|
|
83276
|
+
${failedProjects.map((failedProject) => ` - ${failedProject} (Error Code: ${_optionalChain([result2, 'access', _313 => _313[failedProject], 'optionalAccess', _314 => _314.code])})`).join("\n")}
|
|
82967
83277
|
`
|
|
82968
83278
|
);
|
|
82969
83279
|
}
|
|
@@ -82977,7 +83287,7 @@ async function updatePackageManifests(projectsVersionData, config) {
|
|
|
82977
83287
|
let projectGraph;
|
|
82978
83288
|
try {
|
|
82979
83289
|
projectGraph = (0, import_devkit2.readCachedProjectGraph)();
|
|
82980
|
-
} catch (
|
|
83290
|
+
} catch (e18) {
|
|
82981
83291
|
await (0, import_devkit2.createProjectGraphAsync)();
|
|
82982
83292
|
projectGraph = (0, import_devkit2.readCachedProjectGraph)();
|
|
82983
83293
|
}
|
|
@@ -82985,7 +83295,7 @@ async function updatePackageManifests(projectsVersionData, config) {
|
|
|
82985
83295
|
await Promise.all(
|
|
82986
83296
|
Object.keys(projectsVersionData).map(async (node) => {
|
|
82987
83297
|
const projectNode = projectGraph.nodes[node];
|
|
82988
|
-
if (!_optionalChain([projectNode, 'optionalAccess',
|
|
83298
|
+
if (!_optionalChain([projectNode, 'optionalAccess', _315 => _315.data, 'access', _316 => _316.root])) {
|
|
82989
83299
|
_chunkXE275LJTcjs.writeWarning.call(void 0,
|
|
82990
83300
|
`Project node ${node} not found in the project graph. Skipping manifest update.`,
|
|
82991
83301
|
config
|
|
@@ -82993,7 +83303,7 @@ async function updatePackageManifests(projectsVersionData, config) {
|
|
|
82993
83303
|
return;
|
|
82994
83304
|
}
|
|
82995
83305
|
const versionData = projectsVersionData[node];
|
|
82996
|
-
if (_optionalChain([projectNode, 'optionalAccess',
|
|
83306
|
+
if (_optionalChain([projectNode, 'optionalAccess', _317 => _317.data, 'access', _318 => _318.root]) && versionData && versionData.newVersion !== null) {
|
|
82997
83307
|
_chunkXE275LJTcjs.writeTrace.call(void 0,
|
|
82998
83308
|
`Writing version ${versionData.newVersion} update to manifest file for ${node}
|
|
82999
83309
|
`,
|