@releasekit/version 0.2.0 → 0.3.0-next.1
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-GH75HGCN.js → chunk-ZEXPJ53Z.js} +29 -258
- package/dist/cli.cjs +46 -276
- package/dist/cli.js +1 -1
- package/dist/index.cjs +25 -253
- package/dist/index.d.cts +0 -3
- package/dist/index.d.ts +0 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -89,8 +89,7 @@ function toVersionConfig(config, gitConfig) {
|
|
|
89
89
|
packages: [],
|
|
90
90
|
updateInternalDependencies: "minor",
|
|
91
91
|
versionPrefix: "",
|
|
92
|
-
baseBranch: gitConfig?.branch
|
|
93
|
-
skipHooks: gitConfig?.skipHooks
|
|
92
|
+
baseBranch: gitConfig?.branch
|
|
94
93
|
};
|
|
95
94
|
}
|
|
96
95
|
return {
|
|
@@ -109,7 +108,6 @@ function toVersionConfig(config, gitConfig) {
|
|
|
109
108
|
releaseType: bp.releaseType
|
|
110
109
|
})),
|
|
111
110
|
defaultReleaseType: config.defaultReleaseType,
|
|
112
|
-
skipHooks: gitConfig?.skipHooks,
|
|
113
111
|
mismatchStrategy: config.mismatchStrategy,
|
|
114
112
|
versionPrefix: config.versionPrefix ?? "",
|
|
115
113
|
prereleaseIdentifier: config.prereleaseIdentifier,
|
|
@@ -133,22 +131,6 @@ var import_semver3 = __toESM(require("semver"), 1);
|
|
|
133
131
|
var import_node_fs = require("fs");
|
|
134
132
|
var import_node_path = require("path");
|
|
135
133
|
init_commandExecutor();
|
|
136
|
-
function isGitRepository(directory) {
|
|
137
|
-
const gitDir = (0, import_node_path.join)(directory, ".git");
|
|
138
|
-
if (!(0, import_node_fs.existsSync)(gitDir)) {
|
|
139
|
-
return false;
|
|
140
|
-
}
|
|
141
|
-
const stats = (0, import_node_fs.statSync)(gitDir);
|
|
142
|
-
if (!stats.isDirectory()) {
|
|
143
|
-
return false;
|
|
144
|
-
}
|
|
145
|
-
try {
|
|
146
|
-
execSync("git", ["rev-parse", "--is-inside-work-tree"], { cwd: directory });
|
|
147
|
-
return true;
|
|
148
|
-
} catch (_error) {
|
|
149
|
-
return false;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
134
|
function getCurrentBranch() {
|
|
153
135
|
const result = execSync("git", ["rev-parse", "--abbrev-ref", "HEAD"]);
|
|
154
136
|
return result.toString().trim();
|
|
@@ -228,14 +210,11 @@ function log(message, level = "info") {
|
|
|
228
210
|
default:
|
|
229
211
|
chalkFn = import_chalk.default.blue;
|
|
230
212
|
}
|
|
213
|
+
const formattedMessage = level === "debug" ? `[DEBUG] ${message}` : message;
|
|
231
214
|
if (isJsonOutputMode()) {
|
|
232
|
-
|
|
233
|
-
chalkFn(message);
|
|
234
|
-
console.error(message);
|
|
235
|
-
}
|
|
215
|
+
console.error(chalkFn(formattedMessage));
|
|
236
216
|
return;
|
|
237
217
|
}
|
|
238
|
-
const formattedMessage = level === "debug" ? `[DEBUG] ${message}` : message;
|
|
239
218
|
if (level === "error") {
|
|
240
219
|
console.error(chalkFn(formattedMessage));
|
|
241
220
|
} else {
|
|
@@ -604,13 +583,13 @@ var import_semver2 = __toESM(require("semver"), 1);
|
|
|
604
583
|
|
|
605
584
|
// src/git/tagVerification.ts
|
|
606
585
|
init_commandExecutor();
|
|
607
|
-
function verifyTag(tagName,
|
|
586
|
+
function verifyTag(tagName, cwd3) {
|
|
608
587
|
if (!tagName || tagName.trim() === "") {
|
|
609
588
|
return { exists: false, reachable: false, error: "Empty tag name" };
|
|
610
589
|
}
|
|
611
590
|
try {
|
|
612
591
|
execSync("git", ["rev-parse", "--verify", tagName], {
|
|
613
|
-
cwd:
|
|
592
|
+
cwd: cwd3,
|
|
614
593
|
stdio: "ignore"
|
|
615
594
|
});
|
|
616
595
|
return { exists: true, reachable: true };
|
|
@@ -707,11 +686,11 @@ var VersionMismatchError = class extends Error {
|
|
|
707
686
|
this.name = "VersionMismatchError";
|
|
708
687
|
}
|
|
709
688
|
};
|
|
710
|
-
async function getBestVersionSource(tagName, packageVersion,
|
|
689
|
+
async function getBestVersionSource(tagName, packageVersion, cwd3, mismatchStrategy = "error", strictReachable = false) {
|
|
711
690
|
if (!tagName?.trim()) {
|
|
712
691
|
return packageVersion ? { source: "package", version: packageVersion, reason: "No git tag provided" } : { source: "initial", version: "0.1.0", reason: "No git tag or package version available" };
|
|
713
692
|
}
|
|
714
|
-
const verification = verifyTag(tagName,
|
|
693
|
+
const verification = verifyTag(tagName, cwd3);
|
|
715
694
|
if (!verification.exists || !verification.reachable) {
|
|
716
695
|
if (strictReachable) {
|
|
717
696
|
throw new Error(
|
|
@@ -976,7 +955,7 @@ async function calculateVersion(config, options) {
|
|
|
976
955
|
}
|
|
977
956
|
|
|
978
957
|
// src/core/versionEngine.ts
|
|
979
|
-
var
|
|
958
|
+
var import_node_process2 = require("process");
|
|
980
959
|
var import_get_packages = require("@manypkg/get-packages");
|
|
981
960
|
|
|
982
961
|
// src/errors/baseError.ts
|
|
@@ -997,34 +976,6 @@ var BaseVersionError = class _BaseVersionError extends import_core.ReleaseKitErr
|
|
|
997
976
|
// src/errors/gitError.ts
|
|
998
977
|
var GitError = class extends BaseVersionError {
|
|
999
978
|
};
|
|
1000
|
-
function createGitError(code, details) {
|
|
1001
|
-
const messages = {
|
|
1002
|
-
["NOT_GIT_REPO" /* NOT_GIT_REPO */]: "Not a git repository",
|
|
1003
|
-
["GIT_PROCESS_ERROR" /* GIT_PROCESS_ERROR */]: "Failed to create new version",
|
|
1004
|
-
["NO_FILES" /* NO_FILES */]: "No files specified for commit",
|
|
1005
|
-
["NO_COMMIT_MESSAGE" /* NO_COMMIT_MESSAGE */]: "Commit message is required",
|
|
1006
|
-
["GIT_ERROR" /* GIT_ERROR */]: "Git operation failed",
|
|
1007
|
-
["TAG_ALREADY_EXISTS" /* TAG_ALREADY_EXISTS */]: "Git tag already exists"
|
|
1008
|
-
};
|
|
1009
|
-
const suggestions = {
|
|
1010
|
-
["NOT_GIT_REPO" /* NOT_GIT_REPO */]: [
|
|
1011
|
-
"Initialize git repository with: git init",
|
|
1012
|
-
"Ensure you are in the correct directory"
|
|
1013
|
-
],
|
|
1014
|
-
["TAG_ALREADY_EXISTS" /* TAG_ALREADY_EXISTS */]: [
|
|
1015
|
-
"Delete the existing tag: git tag -d <tag-name>",
|
|
1016
|
-
"Use a different version by incrementing manually",
|
|
1017
|
-
"Check if this version was already released"
|
|
1018
|
-
],
|
|
1019
|
-
["GIT_PROCESS_ERROR" /* GIT_PROCESS_ERROR */]: void 0,
|
|
1020
|
-
["NO_FILES" /* NO_FILES */]: void 0,
|
|
1021
|
-
["NO_COMMIT_MESSAGE" /* NO_COMMIT_MESSAGE */]: void 0,
|
|
1022
|
-
["GIT_ERROR" /* GIT_ERROR */]: void 0
|
|
1023
|
-
};
|
|
1024
|
-
const baseMessage = messages[code];
|
|
1025
|
-
const fullMessage = details ? `${baseMessage}: ${details}` : baseMessage;
|
|
1026
|
-
return new GitError(fullMessage, code, suggestions[code]);
|
|
1027
|
-
}
|
|
1028
979
|
|
|
1029
980
|
// src/errors/versionError.ts
|
|
1030
981
|
var VersionError = class extends BaseVersionError {
|
|
@@ -1342,135 +1293,6 @@ function extractIssueIds(body) {
|
|
|
1342
1293
|
// src/core/versionStrategies.ts
|
|
1343
1294
|
init_commandExecutor();
|
|
1344
1295
|
|
|
1345
|
-
// src/git/commands.ts
|
|
1346
|
-
var import_node_process2 = require("process");
|
|
1347
|
-
init_commandExecutor();
|
|
1348
|
-
async function gitAdd(files) {
|
|
1349
|
-
return execAsync("git", ["add", ...files]);
|
|
1350
|
-
}
|
|
1351
|
-
async function gitCommit(options) {
|
|
1352
|
-
const args = ["commit"];
|
|
1353
|
-
if (options.amend) {
|
|
1354
|
-
args.push("--amend");
|
|
1355
|
-
}
|
|
1356
|
-
if (options.author) {
|
|
1357
|
-
args.push("--author", options.author);
|
|
1358
|
-
}
|
|
1359
|
-
if (options.date) {
|
|
1360
|
-
args.push("--date", options.date);
|
|
1361
|
-
}
|
|
1362
|
-
if (options.skipHooks) {
|
|
1363
|
-
args.push("--no-verify");
|
|
1364
|
-
}
|
|
1365
|
-
args.push("-m", options.message);
|
|
1366
|
-
return execAsync("git", args);
|
|
1367
|
-
}
|
|
1368
|
-
async function createGitTag(options) {
|
|
1369
|
-
const { tag, message = "" } = options;
|
|
1370
|
-
const args = ["tag", "-a", "-m", message, tag];
|
|
1371
|
-
try {
|
|
1372
|
-
return await execAsync("git", args);
|
|
1373
|
-
} catch (error) {
|
|
1374
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
1375
|
-
if (errorMessage.includes("already exists")) {
|
|
1376
|
-
throw createGitError(
|
|
1377
|
-
"TAG_ALREADY_EXISTS" /* TAG_ALREADY_EXISTS */,
|
|
1378
|
-
`Tag '${tag}' already exists in the repository. Please use a different version or delete the existing tag first.`
|
|
1379
|
-
);
|
|
1380
|
-
}
|
|
1381
|
-
throw createGitError("GIT_ERROR" /* GIT_ERROR */, errorMessage);
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
async function gitProcess(options) {
|
|
1385
|
-
const { files, nextTag, commitMessage, skipHooks, dryRun } = options;
|
|
1386
|
-
if (!isGitRepository((0, import_node_process2.cwd)())) {
|
|
1387
|
-
throw createGitError("NOT_GIT_REPO" /* NOT_GIT_REPO */);
|
|
1388
|
-
}
|
|
1389
|
-
try {
|
|
1390
|
-
if (!dryRun) {
|
|
1391
|
-
await gitAdd(files);
|
|
1392
|
-
await gitCommit({
|
|
1393
|
-
message: commitMessage,
|
|
1394
|
-
skipHooks
|
|
1395
|
-
});
|
|
1396
|
-
if (nextTag) {
|
|
1397
|
-
const tagMessage = `New Version ${nextTag} generated at ${(/* @__PURE__ */ new Date()).toISOString()}`;
|
|
1398
|
-
await createGitTag({
|
|
1399
|
-
tag: nextTag,
|
|
1400
|
-
message: tagMessage
|
|
1401
|
-
});
|
|
1402
|
-
}
|
|
1403
|
-
} else {
|
|
1404
|
-
log("[DRY RUN] Would add files:", "info");
|
|
1405
|
-
for (const file of files) {
|
|
1406
|
-
log(` - ${file}`, "info");
|
|
1407
|
-
}
|
|
1408
|
-
log(`[DRY RUN] Would commit with message: "${commitMessage}"`, "info");
|
|
1409
|
-
if (nextTag) {
|
|
1410
|
-
log(`[DRY RUN] Would create tag: ${nextTag}`, "info");
|
|
1411
|
-
}
|
|
1412
|
-
}
|
|
1413
|
-
} catch (err) {
|
|
1414
|
-
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
1415
|
-
if (errorMessage.includes("already exists") && nextTag) {
|
|
1416
|
-
log(`Tag '${nextTag}' already exists in the repository.`, "error");
|
|
1417
|
-
throw createGitError(
|
|
1418
|
-
"TAG_ALREADY_EXISTS" /* TAG_ALREADY_EXISTS */,
|
|
1419
|
-
`Tag '${nextTag}' already exists in the repository. Please use a different version or delete the existing tag first.`
|
|
1420
|
-
);
|
|
1421
|
-
}
|
|
1422
|
-
log(`Git process error: ${errorMessage}`, "error");
|
|
1423
|
-
if (err instanceof Error && err.stack) {
|
|
1424
|
-
console.error("Git process stack trace:");
|
|
1425
|
-
console.error(err.stack);
|
|
1426
|
-
}
|
|
1427
|
-
throw createGitError("GIT_PROCESS_ERROR" /* GIT_PROCESS_ERROR */, errorMessage);
|
|
1428
|
-
}
|
|
1429
|
-
}
|
|
1430
|
-
async function createGitCommitAndTag(files, nextTag, commitMessage, skipHooks, dryRun) {
|
|
1431
|
-
try {
|
|
1432
|
-
if (!files || files.length === 0) {
|
|
1433
|
-
throw createGitError("NO_FILES" /* NO_FILES */);
|
|
1434
|
-
}
|
|
1435
|
-
if (!commitMessage) {
|
|
1436
|
-
throw createGitError("NO_COMMIT_MESSAGE" /* NO_COMMIT_MESSAGE */);
|
|
1437
|
-
}
|
|
1438
|
-
setCommitMessage(commitMessage);
|
|
1439
|
-
if (nextTag) {
|
|
1440
|
-
addTag(nextTag);
|
|
1441
|
-
}
|
|
1442
|
-
await gitProcess({
|
|
1443
|
-
files,
|
|
1444
|
-
nextTag,
|
|
1445
|
-
commitMessage,
|
|
1446
|
-
skipHooks,
|
|
1447
|
-
dryRun
|
|
1448
|
-
});
|
|
1449
|
-
if (!dryRun) {
|
|
1450
|
-
log(`Created tag: ${nextTag}`, "success");
|
|
1451
|
-
}
|
|
1452
|
-
} catch (error) {
|
|
1453
|
-
if (error instanceof GitError) {
|
|
1454
|
-
throw error;
|
|
1455
|
-
}
|
|
1456
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
1457
|
-
log(`Failed to create git commit and tag: ${errorMessage}`, "error");
|
|
1458
|
-
if (error instanceof Error) {
|
|
1459
|
-
console.error("Git operation error details:");
|
|
1460
|
-
console.error(error.stack || error.message);
|
|
1461
|
-
if (errorMessage.includes("Command failed:")) {
|
|
1462
|
-
const cmdOutput = errorMessage.split("Command failed:")[1];
|
|
1463
|
-
if (cmdOutput) {
|
|
1464
|
-
console.error("Git command output:", cmdOutput.trim());
|
|
1465
|
-
}
|
|
1466
|
-
}
|
|
1467
|
-
} else {
|
|
1468
|
-
console.error("Unknown git error:", error);
|
|
1469
|
-
}
|
|
1470
|
-
throw new GitError(`Git operation failed: ${errorMessage}`, "GIT_ERROR" /* GIT_ERROR */);
|
|
1471
|
-
}
|
|
1472
|
-
}
|
|
1473
|
-
|
|
1474
1296
|
// src/package/packageManagement.ts
|
|
1475
1297
|
var import_node_fs5 = __toESM(require("fs"), 1);
|
|
1476
1298
|
var import_node_path5 = __toESM(require("path"), 1);
|
|
@@ -1505,7 +1327,6 @@ function updatePackageVersion(packagePath, version, dryRun = false) {
|
|
|
1505
1327
|
// src/package/packageProcessor.ts
|
|
1506
1328
|
var fs5 = __toESM(require("fs"), 1);
|
|
1507
1329
|
var import_node_path6 = __toESM(require("path"), 1);
|
|
1508
|
-
var import_node_process3 = require("process");
|
|
1509
1330
|
|
|
1510
1331
|
// src/utils/packageMatching.ts
|
|
1511
1332
|
var import_micromatch2 = __toESM(require("micromatch"), 1);
|
|
@@ -1547,7 +1368,6 @@ var PackageProcessor = class {
|
|
|
1547
1368
|
tagTemplate;
|
|
1548
1369
|
commitMessageTemplate;
|
|
1549
1370
|
dryRun;
|
|
1550
|
-
skipHooks;
|
|
1551
1371
|
getLatestTag;
|
|
1552
1372
|
config;
|
|
1553
1373
|
// Config for version calculation
|
|
@@ -1558,7 +1378,6 @@ var PackageProcessor = class {
|
|
|
1558
1378
|
this.tagTemplate = options.tagTemplate;
|
|
1559
1379
|
this.commitMessageTemplate = options.commitMessageTemplate || "";
|
|
1560
1380
|
this.dryRun = options.dryRun || false;
|
|
1561
|
-
this.skipHooks = options.skipHooks || false;
|
|
1562
1381
|
this.getLatestTag = options.getLatestTag;
|
|
1563
1382
|
this.config = options.config;
|
|
1564
1383
|
this.fullConfig = options.fullConfig;
|
|
@@ -1761,19 +1580,12 @@ var PackageProcessor = class {
|
|
|
1761
1580
|
this.tagTemplate,
|
|
1762
1581
|
this.fullConfig.packageSpecificTags
|
|
1763
1582
|
);
|
|
1764
|
-
const tagMessage = `chore(release): ${name} ${nextVersion}`;
|
|
1765
1583
|
addTag(packageTag);
|
|
1766
1584
|
tags.push(packageTag);
|
|
1767
|
-
if (
|
|
1768
|
-
try {
|
|
1769
|
-
await createGitTag({ tag: packageTag, message: tagMessage });
|
|
1770
|
-
log(`Created tag: ${packageTag}`, "success");
|
|
1771
|
-
} catch (tagError) {
|
|
1772
|
-
log(`Failed to create tag ${packageTag} for ${name}: ${tagError.message}`, "error");
|
|
1773
|
-
log(tagError.stack || "No stack trace available", "error");
|
|
1774
|
-
}
|
|
1775
|
-
} else {
|
|
1585
|
+
if (this.dryRun) {
|
|
1776
1586
|
log(`[DRY RUN] Would create tag: ${packageTag}`, "info");
|
|
1587
|
+
} else {
|
|
1588
|
+
log(`Version ${nextVersion} prepared (tag: ${packageTag})`, "success");
|
|
1777
1589
|
}
|
|
1778
1590
|
updatedPackagesInfo.push({ name, version: nextVersion, path: pkgPath });
|
|
1779
1591
|
}
|
|
@@ -1781,30 +1593,6 @@ var PackageProcessor = class {
|
|
|
1781
1593
|
log("No packages required a version update.", "info");
|
|
1782
1594
|
return { updatedPackages: [], tags };
|
|
1783
1595
|
}
|
|
1784
|
-
const filesToCommit = [];
|
|
1785
|
-
for (const info of updatedPackagesInfo) {
|
|
1786
|
-
const packageJsonPath = import_node_path6.default.join(info.path, "package.json");
|
|
1787
|
-
if (fs5.existsSync(packageJsonPath)) {
|
|
1788
|
-
filesToCommit.push(packageJsonPath);
|
|
1789
|
-
}
|
|
1790
|
-
const cargoEnabled = this.fullConfig.cargo?.enabled !== false;
|
|
1791
|
-
if (cargoEnabled) {
|
|
1792
|
-
const cargoPaths = this.fullConfig.cargo?.paths;
|
|
1793
|
-
if (cargoPaths && cargoPaths.length > 0) {
|
|
1794
|
-
for (const cargoPath of cargoPaths) {
|
|
1795
|
-
const resolvedCargoPath = import_node_path6.default.resolve(info.path, cargoPath, "Cargo.toml");
|
|
1796
|
-
if (fs5.existsSync(resolvedCargoPath)) {
|
|
1797
|
-
filesToCommit.push(resolvedCargoPath);
|
|
1798
|
-
}
|
|
1799
|
-
}
|
|
1800
|
-
} else {
|
|
1801
|
-
const cargoTomlPath = import_node_path6.default.join(info.path, "Cargo.toml");
|
|
1802
|
-
if (fs5.existsSync(cargoTomlPath)) {
|
|
1803
|
-
filesToCommit.push(cargoTomlPath);
|
|
1804
|
-
}
|
|
1805
|
-
}
|
|
1806
|
-
}
|
|
1807
|
-
}
|
|
1808
1596
|
const packageNames = updatedPackagesInfo.map((p) => p.name).join(", ");
|
|
1809
1597
|
const representativeVersion = updatedPackagesInfo[0]?.version || "multiple";
|
|
1810
1598
|
let commitMessage = this.commitMessageTemplate || "chore(release): publish packages";
|
|
@@ -1821,21 +1609,7 @@ var PackageProcessor = class {
|
|
|
1821
1609
|
commitMessage = `chore(release): ${packageNames} ${representativeVersion}`;
|
|
1822
1610
|
}
|
|
1823
1611
|
setCommitMessage(commitMessage);
|
|
1824
|
-
if (
|
|
1825
|
-
try {
|
|
1826
|
-
await gitAdd(filesToCommit);
|
|
1827
|
-
await gitCommit({ message: commitMessage, skipHooks: this.skipHooks });
|
|
1828
|
-
log(`Created commit for targeted release: ${packageNames}`, "success");
|
|
1829
|
-
} catch (commitError) {
|
|
1830
|
-
log("Failed to create commit for targeted release.", "error");
|
|
1831
|
-
console.error(commitError);
|
|
1832
|
-
(0, import_node_process3.exit)(1);
|
|
1833
|
-
}
|
|
1834
|
-
} else {
|
|
1835
|
-
log("[DRY RUN] Would add files:", "info");
|
|
1836
|
-
for (const file of filesToCommit) {
|
|
1837
|
-
log(` - ${file}`, "info");
|
|
1838
|
-
}
|
|
1612
|
+
if (this.dryRun) {
|
|
1839
1613
|
log(`[DRY RUN] Would commit with message: "${commitMessage}"`, "info");
|
|
1840
1614
|
}
|
|
1841
1615
|
return {
|
|
@@ -1886,7 +1660,6 @@ function createSyncStrategy(config) {
|
|
|
1886
1660
|
commitMessage = `chore(release): v\${version}`,
|
|
1887
1661
|
prereleaseIdentifier,
|
|
1888
1662
|
dryRun,
|
|
1889
|
-
skipHooks,
|
|
1890
1663
|
mainPackage
|
|
1891
1664
|
} = config;
|
|
1892
1665
|
const formattedPrefix = formatVersionPrefix(versionPrefix || "v");
|
|
@@ -2036,7 +1809,13 @@ function createSyncStrategy(config) {
|
|
|
2036
1809
|
config.packageSpecificTags || false
|
|
2037
1810
|
);
|
|
2038
1811
|
const formattedCommitMessage = formatCommitMessage(commitMessage, nextVersion, commitPackageName, void 0);
|
|
2039
|
-
|
|
1812
|
+
addTag(nextTag);
|
|
1813
|
+
setCommitMessage(formattedCommitMessage);
|
|
1814
|
+
if (!dryRun) {
|
|
1815
|
+
log(`Version ${nextVersion} prepared (tag: ${nextTag})`, "success");
|
|
1816
|
+
} else {
|
|
1817
|
+
log(`Would create tag: ${nextTag}`, "info");
|
|
1818
|
+
}
|
|
2040
1819
|
} catch (error) {
|
|
2041
1820
|
if (BaseVersionError.isVersionError(error)) {
|
|
2042
1821
|
log(`Synced Strategy failed: ${error.message} (${error.code})`, "error");
|
|
@@ -2051,14 +1830,7 @@ function createSyncStrategy(config) {
|
|
|
2051
1830
|
function createSingleStrategy(config) {
|
|
2052
1831
|
return async (packages) => {
|
|
2053
1832
|
try {
|
|
2054
|
-
const {
|
|
2055
|
-
mainPackage,
|
|
2056
|
-
versionPrefix,
|
|
2057
|
-
tagTemplate,
|
|
2058
|
-
commitMessage = `chore(release): \${version}`,
|
|
2059
|
-
dryRun,
|
|
2060
|
-
skipHooks
|
|
2061
|
-
} = config;
|
|
1833
|
+
const { mainPackage, versionPrefix, tagTemplate, commitMessage = `chore(release): \${version}`, dryRun } = config;
|
|
2062
1834
|
let packageName;
|
|
2063
1835
|
if (mainPackage) {
|
|
2064
1836
|
packageName = mainPackage;
|
|
@@ -2178,9 +1950,10 @@ function createSingleStrategy(config) {
|
|
|
2178
1950
|
log(`Updated package ${packageName} to version ${nextVersion}`, "success");
|
|
2179
1951
|
const tagName = formatTag(nextVersion, formattedPrefix, packageName, tagTemplate, config.packageSpecificTags);
|
|
2180
1952
|
const commitMsg = formatCommitMessage(commitMessage, nextVersion, packageName);
|
|
1953
|
+
addTag(tagName);
|
|
1954
|
+
setCommitMessage(commitMsg);
|
|
2181
1955
|
if (!dryRun) {
|
|
2182
|
-
|
|
2183
|
-
log(`Created tag: ${tagName}`, "success");
|
|
1956
|
+
log(`Version ${nextVersion} prepared (tag: ${tagName})`, "success");
|
|
2184
1957
|
} else {
|
|
2185
1958
|
log(`Would create tag: ${tagName}`, "info");
|
|
2186
1959
|
}
|
|
@@ -2205,7 +1978,6 @@ function createAsyncStrategy(config) {
|
|
|
2205
1978
|
tagTemplate: config.tagTemplate,
|
|
2206
1979
|
commitMessageTemplate: config.commitMessage || "",
|
|
2207
1980
|
dryRun: config.dryRun || false,
|
|
2208
|
-
skipHooks: config.skipHooks || false,
|
|
2209
1981
|
getLatestTag: dependencies.getLatestTag,
|
|
2210
1982
|
fullConfig: config,
|
|
2211
1983
|
// Extract common version configuration properties
|
|
@@ -2293,13 +2065,13 @@ var VersionEngine = class {
|
|
|
2293
2065
|
if (this.workspaceCache) {
|
|
2294
2066
|
return this.workspaceCache;
|
|
2295
2067
|
}
|
|
2296
|
-
const pkgsResult = (0, import_get_packages.getPackagesSync)((0,
|
|
2068
|
+
const pkgsResult = (0, import_get_packages.getPackagesSync)((0, import_node_process2.cwd)());
|
|
2297
2069
|
if (!pkgsResult || !pkgsResult.packages) {
|
|
2298
2070
|
throw createVersionError("PACKAGES_NOT_FOUND" /* PACKAGES_NOT_FOUND */);
|
|
2299
2071
|
}
|
|
2300
2072
|
if (!pkgsResult.root) {
|
|
2301
2073
|
log("Root path is undefined in packages result, setting to current working directory", "warning");
|
|
2302
|
-
pkgsResult.root = (0,
|
|
2074
|
+
pkgsResult.root = (0, import_node_process2.cwd)();
|
|
2303
2075
|
}
|
|
2304
2076
|
if (this.config.packages && this.config.packages.length > 0) {
|
|
2305
2077
|
const originalCount = pkgsResult.packages.length;
|
package/dist/index.d.cts
CHANGED
|
@@ -26,7 +26,6 @@ interface Config extends VersionConfigBase {
|
|
|
26
26
|
versionStrategy?: 'branchPattern' | 'commitMessage';
|
|
27
27
|
branchPatterns?: BranchPattern[];
|
|
28
28
|
defaultReleaseType?: ReleaseType;
|
|
29
|
-
skipHooks?: boolean;
|
|
30
29
|
dryRun?: boolean;
|
|
31
30
|
latestTag?: string;
|
|
32
31
|
isPrerelease?: boolean;
|
|
@@ -151,7 +150,6 @@ interface PackageProcessorOptions {
|
|
|
151
150
|
tagTemplate?: string;
|
|
152
151
|
commitMessageTemplate?: string;
|
|
153
152
|
dryRun?: boolean;
|
|
154
|
-
skipHooks?: boolean;
|
|
155
153
|
getLatestTag: () => Promise<string | null>;
|
|
156
154
|
config: Omit<VersionConfigBase, 'versionPrefix' | 'path' | 'name'>;
|
|
157
155
|
fullConfig: Config;
|
|
@@ -171,7 +169,6 @@ declare class PackageProcessor {
|
|
|
171
169
|
private tagTemplate?;
|
|
172
170
|
private commitMessageTemplate;
|
|
173
171
|
private dryRun;
|
|
174
|
-
private skipHooks;
|
|
175
172
|
private getLatestTag;
|
|
176
173
|
private config;
|
|
177
174
|
private fullConfig;
|
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,6 @@ interface Config extends VersionConfigBase {
|
|
|
26
26
|
versionStrategy?: 'branchPattern' | 'commitMessage';
|
|
27
27
|
branchPatterns?: BranchPattern[];
|
|
28
28
|
defaultReleaseType?: ReleaseType;
|
|
29
|
-
skipHooks?: boolean;
|
|
30
29
|
dryRun?: boolean;
|
|
31
30
|
latestTag?: string;
|
|
32
31
|
isPrerelease?: boolean;
|
|
@@ -151,7 +150,6 @@ interface PackageProcessorOptions {
|
|
|
151
150
|
tagTemplate?: string;
|
|
152
151
|
commitMessageTemplate?: string;
|
|
153
152
|
dryRun?: boolean;
|
|
154
|
-
skipHooks?: boolean;
|
|
155
153
|
getLatestTag: () => Promise<string | null>;
|
|
156
154
|
config: Omit<VersionConfigBase, 'versionPrefix' | 'path' | 'name'>;
|
|
157
155
|
fullConfig: Config;
|
|
@@ -171,7 +169,6 @@ declare class PackageProcessor {
|
|
|
171
169
|
private tagTemplate?;
|
|
172
170
|
private commitMessageTemplate;
|
|
173
171
|
private dryRun;
|
|
174
|
-
private skipHooks;
|
|
175
172
|
private getLatestTag;
|
|
176
173
|
private config;
|
|
177
174
|
private fullConfig;
|
package/dist/index.js
CHANGED