@treeseed/sdk 0.6.10 → 0.6.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/workflow/operations.js +36 -6
- package/package.json +1 -1
|
@@ -232,6 +232,26 @@ function ensureWorkflowCommandBins(root, helpers) {
|
|
|
232
232
|
helpers.write(`[workspace][link] Linked ${name} command shim.`);
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
+
function unresolvedMergePaths(repoDir) {
|
|
236
|
+
return run("git", ["diff", "--name-only", "--diff-filter=U"], { cwd: repoDir, capture: true }).split("\n").map((line) => line.trim()).filter(Boolean);
|
|
237
|
+
}
|
|
238
|
+
function resolveRootReleaseSubmoduleConflicts(root, selectedPackageNames) {
|
|
239
|
+
const gitRoot = repoRoot(root);
|
|
240
|
+
const packages = checkedOutWorkspacePackageRepos(root).filter((pkg) => selectedPackageNames.has(pkg.name)).map((pkg) => ({
|
|
241
|
+
...pkg,
|
|
242
|
+
repoPath: relative(gitRoot, pkg.dir)
|
|
243
|
+
}));
|
|
244
|
+
const packagePaths = new Set(packages.map((pkg) => pkg.repoPath));
|
|
245
|
+
const unresolved = unresolvedMergePaths(gitRoot);
|
|
246
|
+
if (unresolved.length === 0 || unresolved.some((filePath) => !packagePaths.has(filePath))) {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
for (const pkg of packages) {
|
|
250
|
+
syncBranchWithOrigin(pkg.dir, PRODUCTION_BRANCH);
|
|
251
|
+
run("git", ["add", pkg.repoPath], { cwd: gitRoot });
|
|
252
|
+
}
|
|
253
|
+
return true;
|
|
254
|
+
}
|
|
235
255
|
function unlinkWorkflowWorkspaceLinks(root, helpers, mode = "auto") {
|
|
236
256
|
if (!shouldManageWorkspaceLinks(mode, helpers.context.env)) {
|
|
237
257
|
return inspectWorkspaceDependencyMode(root, { mode: "off", env: helpers.context.env });
|
|
@@ -3363,12 +3383,21 @@ async function workflowRelease(helpers, input) {
|
|
|
3363
3383
|
commitAllIfChanged(gitRoot, `release: ${level} bump`);
|
|
3364
3384
|
pushBranch(gitRoot, STAGING_BRANCH);
|
|
3365
3385
|
const stagingCommit = headCommit(gitRoot);
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3386
|
+
let released;
|
|
3387
|
+
try {
|
|
3388
|
+
released = mergeBranchIntoTarget(root, {
|
|
3389
|
+
sourceBranch: STAGING_BRANCH,
|
|
3390
|
+
targetBranch: PRODUCTION_BRANCH,
|
|
3391
|
+
message: `release: ${STAGING_BRANCH} -> ${PRODUCTION_BRANCH}`,
|
|
3392
|
+
pushTarget: false
|
|
3393
|
+
});
|
|
3394
|
+
} catch (error) {
|
|
3395
|
+
if (!resolveRootReleaseSubmoduleConflicts(root, effectiveSelectedPackageNames)) {
|
|
3396
|
+
throw error;
|
|
3397
|
+
}
|
|
3398
|
+
commitAllIfChanged(gitRoot, `release: ${STAGING_BRANCH} -> ${PRODUCTION_BRANCH}`);
|
|
3399
|
+
released = { commitSha: headCommit(gitRoot) };
|
|
3400
|
+
}
|
|
3372
3401
|
for (const pkg of checkedOutWorkspacePackageRepos(root)) {
|
|
3373
3402
|
if (effectiveSelectedPackageNames.has(pkg.name)) {
|
|
3374
3403
|
syncBranchWithOrigin(pkg.dir, PRODUCTION_BRANCH);
|
|
@@ -3455,6 +3484,7 @@ async function workflowRelease(helpers, input) {
|
|
|
3455
3484
|
}
|
|
3456
3485
|
return { status: "completed", repos: cleanupReports };
|
|
3457
3486
|
});
|
|
3487
|
+
syncAllCheckedOutPackageRepos(root, STAGING_BRANCH);
|
|
3458
3488
|
const workspaceLinks = ensureWorkflowWorkspaceLinks(root, helpers, effectiveInput.workspaceLinks ?? "auto");
|
|
3459
3489
|
const payload = {
|
|
3460
3490
|
mode,
|