@releasekit/version 0.2.0-next.10 → 0.2.0-next.12
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/dist/{chunk-DXDB5P7S.js → chunk-LUNSWEJQ.js} +65 -28
- package/dist/cli.cjs +65 -28
- package/dist/cli.js +1 -1
- package/dist/index.cjs +65 -28
- package/dist/index.js +1 -1
- package/package.json +4 -4
|
@@ -275,8 +275,8 @@ To fix this:
|
|
|
275
275
|
let result = template.replace(/\$\{version\}/g, version).replace(/\$\{packageName\}/g, packageName || "");
|
|
276
276
|
if (additionalContext) {
|
|
277
277
|
for (const [key, value] of Object.entries(additionalContext)) {
|
|
278
|
-
const placeholder = `\${${key}}`;
|
|
279
|
-
result = result.replace(new RegExp(placeholder
|
|
278
|
+
const placeholder = `${key ? `\${${key}}` : ""}`;
|
|
279
|
+
result = result.replace(new RegExp(escapeRegExp(placeholder), "g"), value);
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
return result;
|
|
@@ -969,9 +969,9 @@ import { exit } from "process";
|
|
|
969
969
|
// src/changelog/commitParser.ts
|
|
970
970
|
var CONVENTIONAL_COMMIT_REGEX = /^(\w+)(?:\(([^)]+)\))?(!)?: (.+)(?:\n\n([\s\S]*))?/;
|
|
971
971
|
var BREAKING_CHANGE_REGEX = /BREAKING CHANGE: ([\s\S]+?)(?:\n\n|$)/;
|
|
972
|
-
function
|
|
972
|
+
function extractAllChangelogEntriesWithHash(projectDir, revisionRange) {
|
|
973
973
|
try {
|
|
974
|
-
const args = ["log", revisionRange, "--pretty=format:%H|||%B---COMMIT_DELIMITER---", "--no-merges"
|
|
974
|
+
const args = ["log", revisionRange, "--pretty=format:%H|||%B---COMMIT_DELIMITER---", "--no-merges"];
|
|
975
975
|
const output = execSync("git", args, { cwd: projectDir, encoding: "utf8" }).toString();
|
|
976
976
|
const commits = output.split("---COMMIT_DELIMITER---").filter((commit) => commit.trim() !== "");
|
|
977
977
|
return commits.map((commit) => {
|
|
@@ -985,27 +985,54 @@ function extractChangelogEntriesWithHash(projectDir, revisionRange) {
|
|
|
985
985
|
}).filter((item) => item !== null);
|
|
986
986
|
} catch (error) {
|
|
987
987
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
988
|
-
log(`Error extracting commits with hash: ${errorMessage}`, "error");
|
|
988
|
+
log(`Error extracting all commits with hash: ${errorMessage}`, "error");
|
|
989
989
|
return [];
|
|
990
990
|
}
|
|
991
991
|
}
|
|
992
|
-
function
|
|
992
|
+
function commitTouchesAnyPackage(projectDir, commitHash, packageDirs, sharedPackageDirs = []) {
|
|
993
993
|
try {
|
|
994
|
-
const
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
994
|
+
const output = execSync("git", ["diff-tree", "--no-commit-id", "--name-only", "-r", commitHash], {
|
|
995
|
+
cwd: projectDir,
|
|
996
|
+
encoding: "utf8"
|
|
997
|
+
}).toString().trim();
|
|
998
|
+
if (!output) {
|
|
999
|
+
return false;
|
|
1000
|
+
}
|
|
1001
|
+
const changedFiles = output.split("\n");
|
|
1002
|
+
return changedFiles.some((file) => {
|
|
1003
|
+
return packageDirs.some((pkgDir) => {
|
|
1004
|
+
if (sharedPackageDirs.some((sharedDir) => pkgDir.includes(sharedDir))) {
|
|
1005
|
+
return false;
|
|
1006
|
+
}
|
|
1007
|
+
const normalizedFile = file.replace(/\\/g, "/");
|
|
1008
|
+
const normalizedPkgDir = pkgDir.replace(/\\/g, "/").replace(/^\.\//, "");
|
|
1009
|
+
return normalizedFile.startsWith(normalizedPkgDir);
|
|
1010
|
+
});
|
|
1011
|
+
});
|
|
1006
1012
|
} catch (error) {
|
|
1007
|
-
|
|
1008
|
-
|
|
1013
|
+
log(
|
|
1014
|
+
`Error checking if commit ${commitHash} touches packages: ${error instanceof Error ? error.message : String(error)}`,
|
|
1015
|
+
"debug"
|
|
1016
|
+
);
|
|
1017
|
+
return false;
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
function extractRepoLevelChangelogEntries(projectDir, revisionRange, packageDirs, sharedPackageDirs = []) {
|
|
1021
|
+
try {
|
|
1022
|
+
const allCommits = extractAllChangelogEntriesWithHash(projectDir, revisionRange);
|
|
1023
|
+
const repoLevelCommits = allCommits.filter((commit) => {
|
|
1024
|
+
const touchesPackage = commitTouchesAnyPackage(projectDir, commit.hash, packageDirs, sharedPackageDirs);
|
|
1025
|
+
return !touchesPackage;
|
|
1026
|
+
});
|
|
1027
|
+
if (repoLevelCommits.length > 0) {
|
|
1028
|
+
log(
|
|
1029
|
+
`Found ${repoLevelCommits.length} repo-level commit(s) (including shared packages: ${sharedPackageDirs.join(", ")})`,
|
|
1030
|
+
"debug"
|
|
1031
|
+
);
|
|
1032
|
+
}
|
|
1033
|
+
return repoLevelCommits.map((c) => c.entry);
|
|
1034
|
+
} catch (error) {
|
|
1035
|
+
log(`Error extracting repo-level commits: ${error instanceof Error ? error.message : String(error)}`, "warning");
|
|
1009
1036
|
return [];
|
|
1010
1037
|
}
|
|
1011
1038
|
}
|
|
@@ -1458,13 +1485,18 @@ var PackageProcessor = class {
|
|
|
1458
1485
|
revisionRange = "HEAD";
|
|
1459
1486
|
}
|
|
1460
1487
|
changelogEntries = extractChangelogEntriesFromCommits(pkgPath, revisionRange);
|
|
1461
|
-
const
|
|
1462
|
-
const
|
|
1463
|
-
const
|
|
1464
|
-
const
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1488
|
+
const allPackageDirs = packages.map((p) => p.dir);
|
|
1489
|
+
const sharedPackageNames = ["config", "core", "@releasekit/config", "@releasekit/core"];
|
|
1490
|
+
const sharedPackageDirs = packages.filter((p) => sharedPackageNames.includes(p.packageJson.name)).map((p) => p.dir);
|
|
1491
|
+
const repoLevelEntries = extractRepoLevelChangelogEntries(
|
|
1492
|
+
pkgPath,
|
|
1493
|
+
revisionRange,
|
|
1494
|
+
allPackageDirs,
|
|
1495
|
+
sharedPackageDirs
|
|
1496
|
+
);
|
|
1497
|
+
if (repoLevelEntries.length > 0) {
|
|
1498
|
+
log(`Adding ${repoLevelEntries.length} repo-level commit(s) to ${name} changelog`, "debug");
|
|
1499
|
+
changelogEntries = [...repoLevelEntries, ...changelogEntries];
|
|
1468
1500
|
}
|
|
1469
1501
|
if (changelogEntries.length === 0) {
|
|
1470
1502
|
changelogEntries = [
|
|
@@ -1600,7 +1632,12 @@ var PackageProcessor = class {
|
|
|
1600
1632
|
const packageNames = updatedPackagesInfo.map((p) => p.name).join(", ");
|
|
1601
1633
|
const representativeVersion = updatedPackagesInfo[0]?.version || "multiple";
|
|
1602
1634
|
let commitMessage = this.commitMessageTemplate || "chore(release): publish packages";
|
|
1603
|
-
const
|
|
1635
|
+
const MAX_COMMIT_MSG_LENGTH = 1e4;
|
|
1636
|
+
if (commitMessage.length > MAX_COMMIT_MSG_LENGTH) {
|
|
1637
|
+
log("Commit message template too long, truncating", "warning");
|
|
1638
|
+
commitMessage = commitMessage.slice(0, MAX_COMMIT_MSG_LENGTH);
|
|
1639
|
+
}
|
|
1640
|
+
const placeholderRegex = /\$\{[^{}$]{1,1000}\}/;
|
|
1604
1641
|
if (updatedPackagesInfo.length === 1 && placeholderRegex.test(commitMessage)) {
|
|
1605
1642
|
const packageName = updatedPackagesInfo[0].name;
|
|
1606
1643
|
commitMessage = formatCommitMessage(commitMessage, representativeVersion, packageName);
|
package/dist/cli.cjs
CHANGED
|
@@ -401,9 +401,9 @@ var path6 = __toESM(require("path"), 1);
|
|
|
401
401
|
init_commandExecutor();
|
|
402
402
|
var CONVENTIONAL_COMMIT_REGEX = /^(\w+)(?:\(([^)]+)\))?(!)?: (.+)(?:\n\n([\s\S]*))?/;
|
|
403
403
|
var BREAKING_CHANGE_REGEX = /BREAKING CHANGE: ([\s\S]+?)(?:\n\n|$)/;
|
|
404
|
-
function
|
|
404
|
+
function extractAllChangelogEntriesWithHash(projectDir, revisionRange) {
|
|
405
405
|
try {
|
|
406
|
-
const args = ["log", revisionRange, "--pretty=format:%H|||%B---COMMIT_DELIMITER---", "--no-merges"
|
|
406
|
+
const args = ["log", revisionRange, "--pretty=format:%H|||%B---COMMIT_DELIMITER---", "--no-merges"];
|
|
407
407
|
const output = execSync("git", args, { cwd: projectDir, encoding: "utf8" }).toString();
|
|
408
408
|
const commits = output.split("---COMMIT_DELIMITER---").filter((commit) => commit.trim() !== "");
|
|
409
409
|
return commits.map((commit) => {
|
|
@@ -417,27 +417,54 @@ function extractChangelogEntriesWithHash(projectDir, revisionRange) {
|
|
|
417
417
|
}).filter((item) => item !== null);
|
|
418
418
|
} catch (error) {
|
|
419
419
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
420
|
-
log(`Error extracting commits with hash: ${errorMessage}`, "error");
|
|
420
|
+
log(`Error extracting all commits with hash: ${errorMessage}`, "error");
|
|
421
421
|
return [];
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function commitTouchesAnyPackage(projectDir, commitHash, packageDirs, sharedPackageDirs = []) {
|
|
425
425
|
try {
|
|
426
|
-
const
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
426
|
+
const output = execSync("git", ["diff-tree", "--no-commit-id", "--name-only", "-r", commitHash], {
|
|
427
|
+
cwd: projectDir,
|
|
428
|
+
encoding: "utf8"
|
|
429
|
+
}).toString().trim();
|
|
430
|
+
if (!output) {
|
|
431
|
+
return false;
|
|
432
|
+
}
|
|
433
|
+
const changedFiles = output.split("\n");
|
|
434
|
+
return changedFiles.some((file) => {
|
|
435
|
+
return packageDirs.some((pkgDir) => {
|
|
436
|
+
if (sharedPackageDirs.some((sharedDir) => pkgDir.includes(sharedDir))) {
|
|
437
|
+
return false;
|
|
438
|
+
}
|
|
439
|
+
const normalizedFile = file.replace(/\\/g, "/");
|
|
440
|
+
const normalizedPkgDir = pkgDir.replace(/\\/g, "/").replace(/^\.\//, "");
|
|
441
|
+
return normalizedFile.startsWith(normalizedPkgDir);
|
|
442
|
+
});
|
|
443
|
+
});
|
|
438
444
|
} catch (error) {
|
|
439
|
-
|
|
440
|
-
|
|
445
|
+
log(
|
|
446
|
+
`Error checking if commit ${commitHash} touches packages: ${error instanceof Error ? error.message : String(error)}`,
|
|
447
|
+
"debug"
|
|
448
|
+
);
|
|
449
|
+
return false;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
function extractRepoLevelChangelogEntries(projectDir, revisionRange, packageDirs, sharedPackageDirs = []) {
|
|
453
|
+
try {
|
|
454
|
+
const allCommits = extractAllChangelogEntriesWithHash(projectDir, revisionRange);
|
|
455
|
+
const repoLevelCommits = allCommits.filter((commit) => {
|
|
456
|
+
const touchesPackage = commitTouchesAnyPackage(projectDir, commit.hash, packageDirs, sharedPackageDirs);
|
|
457
|
+
return !touchesPackage;
|
|
458
|
+
});
|
|
459
|
+
if (repoLevelCommits.length > 0) {
|
|
460
|
+
log(
|
|
461
|
+
`Found ${repoLevelCommits.length} repo-level commit(s) (including shared packages: ${sharedPackageDirs.join(", ")})`,
|
|
462
|
+
"debug"
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
return repoLevelCommits.map((c) => c.entry);
|
|
466
|
+
} catch (error) {
|
|
467
|
+
log(`Error extracting repo-level commits: ${error instanceof Error ? error.message : String(error)}`, "warning");
|
|
441
468
|
return [];
|
|
442
469
|
}
|
|
443
470
|
}
|
|
@@ -751,8 +778,8 @@ To fix this:
|
|
|
751
778
|
let result = template.replace(/\$\{version\}/g, version).replace(/\$\{packageName\}/g, packageName || "");
|
|
752
779
|
if (additionalContext) {
|
|
753
780
|
for (const [key, value] of Object.entries(additionalContext)) {
|
|
754
|
-
const placeholder = `\${${key}}`;
|
|
755
|
-
result = result.replace(new RegExp(placeholder
|
|
781
|
+
const placeholder = `${key ? `\${${key}}` : ""}`;
|
|
782
|
+
result = result.replace(new RegExp(escapeRegExp(placeholder), "g"), value);
|
|
756
783
|
}
|
|
757
784
|
}
|
|
758
785
|
return result;
|
|
@@ -1634,13 +1661,18 @@ var PackageProcessor = class {
|
|
|
1634
1661
|
revisionRange = "HEAD";
|
|
1635
1662
|
}
|
|
1636
1663
|
changelogEntries = extractChangelogEntriesFromCommits(pkgPath, revisionRange);
|
|
1637
|
-
const
|
|
1638
|
-
const
|
|
1639
|
-
const
|
|
1640
|
-
const
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1664
|
+
const allPackageDirs = packages.map((p) => p.dir);
|
|
1665
|
+
const sharedPackageNames = ["config", "core", "@releasekit/config", "@releasekit/core"];
|
|
1666
|
+
const sharedPackageDirs = packages.filter((p) => sharedPackageNames.includes(p.packageJson.name)).map((p) => p.dir);
|
|
1667
|
+
const repoLevelEntries = extractRepoLevelChangelogEntries(
|
|
1668
|
+
pkgPath,
|
|
1669
|
+
revisionRange,
|
|
1670
|
+
allPackageDirs,
|
|
1671
|
+
sharedPackageDirs
|
|
1672
|
+
);
|
|
1673
|
+
if (repoLevelEntries.length > 0) {
|
|
1674
|
+
log(`Adding ${repoLevelEntries.length} repo-level commit(s) to ${name} changelog`, "debug");
|
|
1675
|
+
changelogEntries = [...repoLevelEntries, ...changelogEntries];
|
|
1644
1676
|
}
|
|
1645
1677
|
if (changelogEntries.length === 0) {
|
|
1646
1678
|
changelogEntries = [
|
|
@@ -1776,7 +1808,12 @@ var PackageProcessor = class {
|
|
|
1776
1808
|
const packageNames = updatedPackagesInfo.map((p) => p.name).join(", ");
|
|
1777
1809
|
const representativeVersion = updatedPackagesInfo[0]?.version || "multiple";
|
|
1778
1810
|
let commitMessage = this.commitMessageTemplate || "chore(release): publish packages";
|
|
1779
|
-
const
|
|
1811
|
+
const MAX_COMMIT_MSG_LENGTH = 1e4;
|
|
1812
|
+
if (commitMessage.length > MAX_COMMIT_MSG_LENGTH) {
|
|
1813
|
+
log("Commit message template too long, truncating", "warning");
|
|
1814
|
+
commitMessage = commitMessage.slice(0, MAX_COMMIT_MSG_LENGTH);
|
|
1815
|
+
}
|
|
1816
|
+
const placeholderRegex = /\$\{[^{}$]{1,1000}\}/;
|
|
1780
1817
|
if (updatedPackagesInfo.length === 1 && placeholderRegex.test(commitMessage)) {
|
|
1781
1818
|
const packageName = updatedPackagesInfo[0].name;
|
|
1782
1819
|
commitMessage = formatCommitMessage(commitMessage, representativeVersion, packageName);
|
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -285,8 +285,8 @@ To fix this:
|
|
|
285
285
|
let result = template.replace(/\$\{version\}/g, version).replace(/\$\{packageName\}/g, packageName || "");
|
|
286
286
|
if (additionalContext) {
|
|
287
287
|
for (const [key, value] of Object.entries(additionalContext)) {
|
|
288
|
-
const placeholder = `\${${key}}`;
|
|
289
|
-
result = result.replace(new RegExp(placeholder
|
|
288
|
+
const placeholder = `${key ? `\${${key}}` : ""}`;
|
|
289
|
+
result = result.replace(new RegExp(escapeRegExp(placeholder), "g"), value);
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
return result;
|
|
@@ -1168,9 +1168,9 @@ var path6 = __toESM(require("path"), 1);
|
|
|
1168
1168
|
init_commandExecutor();
|
|
1169
1169
|
var CONVENTIONAL_COMMIT_REGEX = /^(\w+)(?:\(([^)]+)\))?(!)?: (.+)(?:\n\n([\s\S]*))?/;
|
|
1170
1170
|
var BREAKING_CHANGE_REGEX = /BREAKING CHANGE: ([\s\S]+?)(?:\n\n|$)/;
|
|
1171
|
-
function
|
|
1171
|
+
function extractAllChangelogEntriesWithHash(projectDir, revisionRange) {
|
|
1172
1172
|
try {
|
|
1173
|
-
const args = ["log", revisionRange, "--pretty=format:%H|||%B---COMMIT_DELIMITER---", "--no-merges"
|
|
1173
|
+
const args = ["log", revisionRange, "--pretty=format:%H|||%B---COMMIT_DELIMITER---", "--no-merges"];
|
|
1174
1174
|
const output = execSync("git", args, { cwd: projectDir, encoding: "utf8" }).toString();
|
|
1175
1175
|
const commits = output.split("---COMMIT_DELIMITER---").filter((commit) => commit.trim() !== "");
|
|
1176
1176
|
return commits.map((commit) => {
|
|
@@ -1184,27 +1184,54 @@ function extractChangelogEntriesWithHash(projectDir, revisionRange) {
|
|
|
1184
1184
|
}).filter((item) => item !== null);
|
|
1185
1185
|
} catch (error) {
|
|
1186
1186
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
1187
|
-
log(`Error extracting commits with hash: ${errorMessage}`, "error");
|
|
1187
|
+
log(`Error extracting all commits with hash: ${errorMessage}`, "error");
|
|
1188
1188
|
return [];
|
|
1189
1189
|
}
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1191
|
+
function commitTouchesAnyPackage(projectDir, commitHash, packageDirs, sharedPackageDirs = []) {
|
|
1192
1192
|
try {
|
|
1193
|
-
const
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1193
|
+
const output = execSync("git", ["diff-tree", "--no-commit-id", "--name-only", "-r", commitHash], {
|
|
1194
|
+
cwd: projectDir,
|
|
1195
|
+
encoding: "utf8"
|
|
1196
|
+
}).toString().trim();
|
|
1197
|
+
if (!output) {
|
|
1198
|
+
return false;
|
|
1199
|
+
}
|
|
1200
|
+
const changedFiles = output.split("\n");
|
|
1201
|
+
return changedFiles.some((file) => {
|
|
1202
|
+
return packageDirs.some((pkgDir) => {
|
|
1203
|
+
if (sharedPackageDirs.some((sharedDir) => pkgDir.includes(sharedDir))) {
|
|
1204
|
+
return false;
|
|
1205
|
+
}
|
|
1206
|
+
const normalizedFile = file.replace(/\\/g, "/");
|
|
1207
|
+
const normalizedPkgDir = pkgDir.replace(/\\/g, "/").replace(/^\.\//, "");
|
|
1208
|
+
return normalizedFile.startsWith(normalizedPkgDir);
|
|
1209
|
+
});
|
|
1210
|
+
});
|
|
1205
1211
|
} catch (error) {
|
|
1206
|
-
|
|
1207
|
-
|
|
1212
|
+
log(
|
|
1213
|
+
`Error checking if commit ${commitHash} touches packages: ${error instanceof Error ? error.message : String(error)}`,
|
|
1214
|
+
"debug"
|
|
1215
|
+
);
|
|
1216
|
+
return false;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
function extractRepoLevelChangelogEntries(projectDir, revisionRange, packageDirs, sharedPackageDirs = []) {
|
|
1220
|
+
try {
|
|
1221
|
+
const allCommits = extractAllChangelogEntriesWithHash(projectDir, revisionRange);
|
|
1222
|
+
const repoLevelCommits = allCommits.filter((commit) => {
|
|
1223
|
+
const touchesPackage = commitTouchesAnyPackage(projectDir, commit.hash, packageDirs, sharedPackageDirs);
|
|
1224
|
+
return !touchesPackage;
|
|
1225
|
+
});
|
|
1226
|
+
if (repoLevelCommits.length > 0) {
|
|
1227
|
+
log(
|
|
1228
|
+
`Found ${repoLevelCommits.length} repo-level commit(s) (including shared packages: ${sharedPackageDirs.join(", ")})`,
|
|
1229
|
+
"debug"
|
|
1230
|
+
);
|
|
1231
|
+
}
|
|
1232
|
+
return repoLevelCommits.map((c) => c.entry);
|
|
1233
|
+
} catch (error) {
|
|
1234
|
+
log(`Error extracting repo-level commits: ${error instanceof Error ? error.message : String(error)}`, "warning");
|
|
1208
1235
|
return [];
|
|
1209
1236
|
}
|
|
1210
1237
|
}
|
|
@@ -1632,13 +1659,18 @@ var PackageProcessor = class {
|
|
|
1632
1659
|
revisionRange = "HEAD";
|
|
1633
1660
|
}
|
|
1634
1661
|
changelogEntries = extractChangelogEntriesFromCommits(pkgPath, revisionRange);
|
|
1635
|
-
const
|
|
1636
|
-
const
|
|
1637
|
-
const
|
|
1638
|
-
const
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1662
|
+
const allPackageDirs = packages.map((p) => p.dir);
|
|
1663
|
+
const sharedPackageNames = ["config", "core", "@releasekit/config", "@releasekit/core"];
|
|
1664
|
+
const sharedPackageDirs = packages.filter((p) => sharedPackageNames.includes(p.packageJson.name)).map((p) => p.dir);
|
|
1665
|
+
const repoLevelEntries = extractRepoLevelChangelogEntries(
|
|
1666
|
+
pkgPath,
|
|
1667
|
+
revisionRange,
|
|
1668
|
+
allPackageDirs,
|
|
1669
|
+
sharedPackageDirs
|
|
1670
|
+
);
|
|
1671
|
+
if (repoLevelEntries.length > 0) {
|
|
1672
|
+
log(`Adding ${repoLevelEntries.length} repo-level commit(s) to ${name} changelog`, "debug");
|
|
1673
|
+
changelogEntries = [...repoLevelEntries, ...changelogEntries];
|
|
1642
1674
|
}
|
|
1643
1675
|
if (changelogEntries.length === 0) {
|
|
1644
1676
|
changelogEntries = [
|
|
@@ -1774,7 +1806,12 @@ var PackageProcessor = class {
|
|
|
1774
1806
|
const packageNames = updatedPackagesInfo.map((p) => p.name).join(", ");
|
|
1775
1807
|
const representativeVersion = updatedPackagesInfo[0]?.version || "multiple";
|
|
1776
1808
|
let commitMessage = this.commitMessageTemplate || "chore(release): publish packages";
|
|
1777
|
-
const
|
|
1809
|
+
const MAX_COMMIT_MSG_LENGTH = 1e4;
|
|
1810
|
+
if (commitMessage.length > MAX_COMMIT_MSG_LENGTH) {
|
|
1811
|
+
log("Commit message template too long, truncating", "warning");
|
|
1812
|
+
commitMessage = commitMessage.slice(0, MAX_COMMIT_MSG_LENGTH);
|
|
1813
|
+
}
|
|
1814
|
+
const placeholderRegex = /\$\{[^{}$]{1,1000}\}/;
|
|
1778
1815
|
if (updatedPackagesInfo.length === 1 && placeholderRegex.test(commitMessage)) {
|
|
1779
1816
|
const packageName = updatedPackagesInfo[0].name;
|
|
1780
1817
|
commitMessage = formatCommitMessage(commitMessage, representativeVersion, packageName);
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@releasekit/version",
|
|
3
|
-
"version": "0.2.0-next.
|
|
3
|
+
"version": "0.2.0-next.12",
|
|
4
4
|
"description": "Semantic versioning based on Git history and conventional commits",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
"@types/micromatch": "^4.0.10",
|
|
54
54
|
"chalk": "catalog:",
|
|
55
55
|
"commander": "catalog:",
|
|
56
|
-
"conventional-changelog-angular": "^8.
|
|
56
|
+
"conventional-changelog-angular": "^8.3.0",
|
|
57
57
|
"conventional-changelog-conventional-commits": "npm:conventional-changelog-conventionalcommits@^9.0.0",
|
|
58
|
-
"conventional-changelog-conventionalcommits": "^9.
|
|
58
|
+
"conventional-changelog-conventionalcommits": "^9.3.0",
|
|
59
59
|
"conventional-commits-filter": "^5.0.0",
|
|
60
60
|
"conventional-recommended-bump": "^11.2.0",
|
|
61
61
|
"figlet": "^1.10.0",
|
|
62
|
-
"git-semver-tags": "^8.0.
|
|
62
|
+
"git-semver-tags": "^8.0.1",
|
|
63
63
|
"micromatch": "^4.0.8",
|
|
64
64
|
"semver": "catalog:",
|
|
65
65
|
"smol-toml": "catalog:"
|