@treeseed/sdk 0.6.10 → 0.6.11

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.
@@ -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
- const released = mergeBranchIntoTarget(root, {
3367
- sourceBranch: STAGING_BRANCH,
3368
- targetBranch: PRODUCTION_BRANCH,
3369
- message: `release: ${STAGING_BRANCH} -> ${PRODUCTION_BRANCH}`,
3370
- pushTarget: false
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treeseed/sdk",
3
- "version": "0.6.10",
3
+ "version": "0.6.11",
4
4
  "description": "Shared Treeseed SDK for content-backed and D1-backed object models.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {