@treeseed/sdk 0.6.11 → 0.6.13

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.
@@ -287,7 +287,7 @@ function listTaskBranches(repoDir) {
287
287
  gitLines(repoDir, ["for-each-ref", "--format=%(refname:short)", "refs/heads"]).filter(isTaskBranch)
288
288
  );
289
289
  const remote = new Set(
290
- gitLines(repoDir, ["for-each-ref", "--format=%(refname:short)", "refs/remotes/origin"]).map((branchName) => branchName.replace(/^origin\//, "")).filter(isTaskBranch)
290
+ gitLines(repoDir, ["for-each-ref", "--format=%(refname:short)", "refs/remotes/origin"]).filter((branchName) => branchName.startsWith("origin/") && branchName !== "origin/HEAD").map((branchName) => branchName.replace(/^origin\//, "")).filter(isTaskBranch)
291
291
  );
292
292
  const current = currentBranch(repoDir);
293
293
  const branches = [.../* @__PURE__ */ new Set([...local, ...remote])].sort((left, right) => left.localeCompare(right));
@@ -28,6 +28,9 @@ export declare function validateSaveAutomationPrerequisites({ cwd }: {
28
28
  export declare function runWorkspaceSavePreflight({ cwd }: {
29
29
  cwd: any;
30
30
  }): void;
31
+ export declare function runWorkspaceReleasePreflight({ cwd }: {
32
+ cwd: any;
33
+ }): void;
31
34
  export declare function runTenantDeployPreflight({ cwd, scope }: {
32
35
  cwd: any;
33
36
  scope?: string | undefined;
@@ -62,6 +62,11 @@ function runWorkspaceSavePreflight({ cwd }) {
62
62
  runStep("test", "workspace-test", { cwd });
63
63
  runStep("build", "tenant-build", { cwd });
64
64
  }
65
+ function runWorkspaceReleasePreflight({ cwd }) {
66
+ runStep("lint", "workspace-lint", { cwd });
67
+ runStep("test", "workspace-release-test", { cwd });
68
+ runStep("build", "tenant-build", { cwd });
69
+ }
65
70
  function runTenantDeployPreflight({ cwd, scope = "prod" }) {
66
71
  applyTreeseedEnvironmentToProcess({ tenantRoot: cwd, scope, override: true });
67
72
  assertTreeseedCommandEnvironment({ tenantRoot: cwd, scope, purpose: "deploy" });
@@ -71,6 +76,7 @@ function runTenantDeployPreflight({ cwd, scope = "prod" }) {
71
76
  }
72
77
  export {
73
78
  runTenantDeployPreflight,
79
+ runWorkspaceReleasePreflight,
74
80
  runWorkspaceSavePreflight,
75
81
  validateSaveAutomationPrerequisites
76
82
  };
@@ -0,0 +1,15 @@
1
+ import { sortWorkspacePackages, workspacePackages, run } from '../operations/services/workspace-tools.js';
2
+ const packages = sortWorkspacePackages(workspacePackages());
3
+ for (const pkg of packages) {
4
+ const scripts = pkg.packageJson.scripts ?? {};
5
+ const scriptName = typeof scripts['test:release'] === 'string'
6
+ ? 'test:release'
7
+ : typeof scripts['test:unit'] === 'string'
8
+ ? 'test:unit'
9
+ : typeof scripts.test === 'string'
10
+ ? 'test'
11
+ : null;
12
+ if (scriptName) {
13
+ run('npm', ['run', scriptName], { cwd: pkg.dir });
14
+ }
15
+ }
@@ -68,7 +68,7 @@ import {
68
68
  } from "../operations/services/git-workflow.js";
69
69
  import { getGitHubAutomationMode, resolveGitHubRepositorySlug, waitForGitHubWorkflowCompletion } from "../operations/services/github-automation.js";
70
70
  import { loadCliDeployConfig, packageScriptPath, resolveWranglerBin } from "../operations/services/runtime-tools.js";
71
- import { runTenantDeployPreflight, runWorkspaceSavePreflight } from "../operations/services/save-deploy-preflight.js";
71
+ import { runTenantDeployPreflight, runWorkspaceReleasePreflight, runWorkspaceSavePreflight } from "../operations/services/save-deploy-preflight.js";
72
72
  import { collectCliPreflight } from "../operations/services/workspace-preflight.js";
73
73
  import {
74
74
  collectMergeConflictReport,
@@ -3176,7 +3176,7 @@ async function workflowRelease(helpers, input) {
3176
3176
  }
3177
3177
  prepareReleaseBranches(root);
3178
3178
  ensureWorkflowWorkspaceLinks(root, helpers, effectiveInput.workspaceLinks ?? "auto");
3179
- runWorkspaceSavePreflight({ cwd: root });
3179
+ runWorkspaceReleasePreflight({ cwd: root });
3180
3180
  await executeJournalStep(root, workflowRun.runId, "workspace-unlink", () => unlinkWorkflowWorkspaceLinks(root, helpers, effectiveInput.workspaceLinks ?? "auto"), { rerunCompleted: true });
3181
3181
  if (mode === "root-only") {
3182
3182
  const rootRelease2 = await executeJournalStep(root, workflowRun.runId, "release-root", () => {
@@ -3484,6 +3484,7 @@ async function workflowRelease(helpers, input) {
3484
3484
  }
3485
3485
  return { status: "completed", repos: cleanupReports };
3486
3486
  });
3487
+ syncAllCheckedOutPackageRepos(root, STAGING_BRANCH);
3487
3488
  const workspaceLinks = ensureWorkflowWorkspaceLinks(root, helpers, effectiveInput.workspaceLinks ?? "auto");
3488
3489
  const payload = {
3489
3490
  mode,
@@ -5,7 +5,7 @@ export { assertCleanWorktree, assertFeatureBranch, branchExists, checkoutBranch,
5
5
  export { loadCliDeployConfig, packageScriptPath, resolveWranglerBin, } from './operations/services/runtime-tools.ts';
6
6
  export { configuredRailwayServices, deployRailwayService, validateRailwayDeployPrerequisites, } from './operations/services/railway-deploy.ts';
7
7
  export { ensureRailwayEnvironment, ensureRailwayProject, ensureRailwayService, getRailwayAuthProfile, listRailwayEnvironments, listRailwayProjects, listRailwayServices, listRailwayVariables, railwayGraphqlRequest, resolveRailwayApiToken, resolveRailwayApiUrl, resolveRailwayWorkspace, resolveRailwayWorkspaceContext, upsertRailwayVariables, } from './operations/services/railway-api.ts';
8
- export { runTenantDeployPreflight, runWorkspaceSavePreflight, } from './operations/services/save-deploy-preflight.ts';
8
+ export { runTenantDeployPreflight, runWorkspaceReleasePreflight, runWorkspaceSavePreflight, } from './operations/services/save-deploy-preflight.ts';
9
9
  export { collectCliPreflight } from './operations/services/workspace-preflight.ts';
10
10
  export { collectTreeseedDependencyStatus, collectTreeseedToolStatus, createTreeseedManagedToolEnv, formatTreeseedDependencyFailureDetails, formatTreeseedDependencyReport, installTreeseedDependencies, resolveTreeseedToolBinary, resolveTreeseedToolCommand, type TreeseedToolStatusResult, } from './managed-dependencies.ts';
11
11
  export { runTreeseedCopilotTask, type TreeseedCopilotTaskInput, type TreeseedCopilotTaskResult, } from './copilot.ts';
@@ -108,6 +108,7 @@ import {
108
108
  } from "./operations/services/railway-api.js";
109
109
  import {
110
110
  runTenantDeployPreflight,
111
+ runWorkspaceReleasePreflight,
111
112
  runWorkspaceSavePreflight
112
113
  } from "./operations/services/save-deploy-preflight.js";
113
114
  import { collectCliPreflight } from "./operations/services/workspace-preflight.js";
@@ -279,6 +280,7 @@ export {
279
280
  runRemoteD1Migrations,
280
281
  runTenantDeployPreflight,
281
282
  runTreeseedCopilotTask,
283
+ runWorkspaceReleasePreflight,
282
284
  runWorkspaceSavePreflight,
283
285
  setTreeseedRemoteSession,
284
286
  syncBranchWithOrigin,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treeseed/sdk",
3
- "version": "0.6.11",
3
+ "version": "0.6.13",
4
4
  "description": "Shared Treeseed SDK for content-backed and D1-backed object models.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
@@ -38,6 +38,9 @@
38
38
  "prepack": "npm run build:dist",
39
39
  "test": "npm run test:unit",
40
40
  "test:unit": "vitest run --config ./vitest.config.ts",
41
+ "test:unit:fast": "vitest run --config ./vitest.fast.config.ts",
42
+ "test:workflow:lifecycle": "vitest run --config ./vitest.config.ts test/utils/workflow-lifecycle.test.ts",
43
+ "test:release": "npm run test:unit:fast",
41
44
  "test:smoke": "node ./scripts/run-ts.mjs ./scripts/test-smoke.ts",
42
45
  "fixtures:resolve": "node ./scripts/run-ts.mjs ./scripts/fixture-tools.ts resolve",
43
46
  "fixtures:check": "node ./scripts/run-ts.mjs ./scripts/fixture-tools.ts check",