@treeseed/sdk 0.4.6 → 0.4.8
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/operations/providers/default.js +1 -0
- package/dist/operations/services/config-runtime.d.ts +121 -26
- package/dist/operations/services/config-runtime.js +330 -196
- package/dist/operations/services/export-runtime.d.ts +18 -0
- package/dist/operations/services/export-runtime.js +136 -0
- package/dist/operations/services/template-registry.d.ts +2 -0
- package/dist/operations/services/template-registry.js +55 -6
- package/dist/operations-registry.js +1 -0
- package/dist/operations-types.d.ts +1 -1
- package/dist/platform/book-export.d.ts +78 -0
- package/dist/platform/book-export.js +449 -0
- package/dist/platform/contracts.d.ts +5 -0
- package/dist/platform/deploy-config.d.ts +2 -0
- package/dist/platform/deploy-config.js +30 -2
- package/dist/platform/env.yaml +5 -0
- package/dist/platform/environment.d.ts +10 -1
- package/dist/platform/environment.js +82 -6
- package/dist/scripts/aggregate-book.js +13 -118
- package/dist/scripts/config-treeseed.js +18 -27
- package/dist/sdk-types.d.ts +1 -0
- package/dist/template-catalog.js +1 -0
- package/dist/workflow/operations.d.ts +293 -177
- package/dist/workflow/operations.js +302 -188
- package/dist/workflow/policy.d.ts +12 -0
- package/dist/workflow/policy.js +58 -0
- package/dist/workflow-state.d.ts +19 -1
- package/dist/workflow-state.js +57 -39
- package/dist/workflow-support.d.ts +2 -1
- package/dist/workflow-support.js +14 -6
- package/dist/workflow.d.ts +14 -1
- package/dist/workflow.js +8 -1
- package/package.json +6 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type TreeseedWorkflowBranchRole = 'feature' | 'staging' | 'main' | 'detached' | 'none';
|
|
2
|
+
export type TreeseedResolvedWorkflowPaths = {
|
|
3
|
+
requestedCwd: string;
|
|
4
|
+
tenantRoot: string | null;
|
|
5
|
+
cwd: string;
|
|
6
|
+
repoRoot: string | null;
|
|
7
|
+
branchName: string | null;
|
|
8
|
+
branchRole: TreeseedWorkflowBranchRole;
|
|
9
|
+
};
|
|
10
|
+
export declare function classifyTreeseedBranchRole(branchName: string | null, repoDir: string | null): TreeseedWorkflowBranchRole;
|
|
11
|
+
export declare function resolveTreeseedWorkflowPaths(startCwd: string): TreeseedResolvedWorkflowPaths;
|
|
12
|
+
export declare function workflowEnvironmentForBranchRole(branchRole: TreeseedWorkflowBranchRole): "local" | "staging" | "prod" | "none";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { findNearestTreeseedRoot, run } from "../operations/services/workspace-tools.js";
|
|
2
|
+
import { currentBranch, repoRoot } from "../operations/services/workspace-save.js";
|
|
3
|
+
import { PRODUCTION_BRANCH, STAGING_BRANCH } from "../operations/services/git-workflow.js";
|
|
4
|
+
function safeRepoRoot(cwd) {
|
|
5
|
+
try {
|
|
6
|
+
return repoRoot(cwd);
|
|
7
|
+
} catch {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function repoHasHead(repoDir) {
|
|
12
|
+
try {
|
|
13
|
+
run("git", ["rev-parse", "--verify", "HEAD"], { cwd: repoDir, capture: true });
|
|
14
|
+
return true;
|
|
15
|
+
} catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function classifyTreeseedBranchRole(branchName, repoDir) {
|
|
20
|
+
if (!repoDir) {
|
|
21
|
+
return "none";
|
|
22
|
+
}
|
|
23
|
+
if (!branchName) {
|
|
24
|
+
return repoHasHead(repoDir) ? "detached" : "none";
|
|
25
|
+
}
|
|
26
|
+
if (branchName === STAGING_BRANCH) {
|
|
27
|
+
return "staging";
|
|
28
|
+
}
|
|
29
|
+
if (branchName === PRODUCTION_BRANCH) {
|
|
30
|
+
return "main";
|
|
31
|
+
}
|
|
32
|
+
return "feature";
|
|
33
|
+
}
|
|
34
|
+
function resolveTreeseedWorkflowPaths(startCwd) {
|
|
35
|
+
const tenantRoot = findNearestTreeseedRoot(startCwd);
|
|
36
|
+
const cwd = tenantRoot ?? startCwd;
|
|
37
|
+
const gitRoot = safeRepoRoot(cwd);
|
|
38
|
+
const branchName = gitRoot ? currentBranch(gitRoot) || null : null;
|
|
39
|
+
return {
|
|
40
|
+
requestedCwd: startCwd,
|
|
41
|
+
tenantRoot,
|
|
42
|
+
cwd,
|
|
43
|
+
repoRoot: gitRoot,
|
|
44
|
+
branchName,
|
|
45
|
+
branchRole: classifyTreeseedBranchRole(branchName, gitRoot)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function workflowEnvironmentForBranchRole(branchRole) {
|
|
49
|
+
if (branchRole === "staging") return "staging";
|
|
50
|
+
if (branchRole === "main") return "prod";
|
|
51
|
+
if (branchRole === "feature") return "local";
|
|
52
|
+
return "none";
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
classifyTreeseedBranchRole,
|
|
56
|
+
resolveTreeseedWorkflowPaths,
|
|
57
|
+
workflowEnvironmentForBranchRole
|
|
58
|
+
};
|
package/dist/workflow-state.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TreeseedWorkflowNextStep } from './workflow.ts';
|
|
2
|
-
|
|
2
|
+
import { type TreeseedWorkflowBranchRole } from './workflow/policy.ts';
|
|
3
|
+
export type TreeseedBranchRole = TreeseedWorkflowBranchRole;
|
|
3
4
|
export type TreeseedWorkflowRecommendation = TreeseedWorkflowNextStep;
|
|
4
5
|
export type TreeseedWorkflowState = {
|
|
5
6
|
cwd: string;
|
|
@@ -44,6 +45,23 @@ export type TreeseedWorkflowState = {
|
|
|
44
45
|
devVars: boolean;
|
|
45
46
|
};
|
|
46
47
|
releaseReady: boolean;
|
|
48
|
+
readiness: {
|
|
49
|
+
local: {
|
|
50
|
+
ready: boolean;
|
|
51
|
+
blockers: string[];
|
|
52
|
+
warnings: string[];
|
|
53
|
+
};
|
|
54
|
+
staging: {
|
|
55
|
+
ready: boolean;
|
|
56
|
+
blockers: string[];
|
|
57
|
+
warnings: string[];
|
|
58
|
+
};
|
|
59
|
+
prod: {
|
|
60
|
+
ready: boolean;
|
|
61
|
+
blockers: string[];
|
|
62
|
+
warnings: string[];
|
|
63
|
+
};
|
|
64
|
+
};
|
|
47
65
|
rollbackCandidates: Array<{
|
|
48
66
|
scope: 'staging' | 'prod';
|
|
49
67
|
commit: string | null;
|
package/dist/workflow-state.js
CHANGED
|
@@ -6,30 +6,14 @@ import {
|
|
|
6
6
|
createPersistentDeployTarget,
|
|
7
7
|
loadDeployState
|
|
8
8
|
} from "./operations/services/deploy.js";
|
|
9
|
-
import { PRODUCTION_BRANCH, STAGING_BRANCH } from "./operations/services/git-workflow.js";
|
|
10
9
|
import { loadCliDeployConfig } from "./operations/services/runtime-tools.js";
|
|
11
10
|
import { collectCliPreflight } from "./operations/services/workspace-preflight.js";
|
|
12
|
-
import {
|
|
11
|
+
import { gitStatusPorcelain } from "./operations/services/workspace-save.js";
|
|
13
12
|
import { isWorkspaceRoot } from "./operations/services/workspace-tools.js";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function branchRoleFor(branchName) {
|
|
22
|
-
if (!branchName) return "none";
|
|
23
|
-
if (branchName === STAGING_BRANCH) return "staging";
|
|
24
|
-
if (branchName === PRODUCTION_BRANCH) return "main";
|
|
25
|
-
return "feature";
|
|
26
|
-
}
|
|
27
|
-
function environmentForBranchRole(branchRole) {
|
|
28
|
-
if (branchRole === "staging") return "staging";
|
|
29
|
-
if (branchRole === "main") return "prod";
|
|
30
|
-
if (branchRole === "feature") return "local";
|
|
31
|
-
return "none";
|
|
32
|
-
}
|
|
13
|
+
import {
|
|
14
|
+
resolveTreeseedWorkflowPaths,
|
|
15
|
+
workflowEnvironmentForBranchRole
|
|
16
|
+
} from "./workflow/policy.js";
|
|
33
17
|
function emptyPersistentEnvironments() {
|
|
34
18
|
return {
|
|
35
19
|
local: { initialized: false, lastValidatedAt: null, lastDeploymentTimestamp: null, lastDeployedUrl: null },
|
|
@@ -37,25 +21,54 @@ function emptyPersistentEnvironments() {
|
|
|
37
21
|
prod: { initialized: false, lastValidatedAt: null, lastDeploymentTimestamp: null, lastDeployedUrl: null }
|
|
38
22
|
};
|
|
39
23
|
}
|
|
24
|
+
function readinessForEnvironment(state, scope) {
|
|
25
|
+
const blockers = [];
|
|
26
|
+
const warnings = [];
|
|
27
|
+
if (!state.deployConfigPresent) {
|
|
28
|
+
blockers.push("Missing treeseed.site.yaml.");
|
|
29
|
+
}
|
|
30
|
+
if (!state.files.machineConfig) {
|
|
31
|
+
blockers.push("Missing Treeseed machine config.");
|
|
32
|
+
}
|
|
33
|
+
if (scope === "local") {
|
|
34
|
+
if (!state.files.envLocal) {
|
|
35
|
+
blockers.push("Missing .env.local.");
|
|
36
|
+
}
|
|
37
|
+
if (!state.files.devVars) {
|
|
38
|
+
warnings.push("Missing .dev.vars.");
|
|
39
|
+
}
|
|
40
|
+
} else {
|
|
41
|
+
if (!state.persistentEnvironments[scope].initialized) {
|
|
42
|
+
blockers.push(`Environment ${scope} is not initialized.`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
ready: blockers.length === 0,
|
|
47
|
+
blockers,
|
|
48
|
+
warnings
|
|
49
|
+
};
|
|
50
|
+
}
|
|
40
51
|
function resolveTreeseedWorkflowState(cwd) {
|
|
41
|
-
const
|
|
42
|
-
const
|
|
52
|
+
const resolved = resolveTreeseedWorkflowPaths(cwd);
|
|
53
|
+
const effectiveCwd = resolved.cwd;
|
|
54
|
+
const workspaceRoot = isWorkspaceRoot(effectiveCwd);
|
|
55
|
+
const treeseedConfigPath = resolve(effectiveCwd, "treeseed.site.yaml");
|
|
43
56
|
const tenantRoot = existsSync(treeseedConfigPath);
|
|
44
|
-
const root =
|
|
45
|
-
const branchName =
|
|
46
|
-
const branchRole =
|
|
57
|
+
const root = resolved.repoRoot;
|
|
58
|
+
const branchName = resolved.branchName;
|
|
59
|
+
const branchRole = resolved.branchRole;
|
|
47
60
|
const dirtyWorktree = root ? gitStatusPorcelain(root).length > 0 : false;
|
|
48
|
-
const preflight = collectCliPreflight({ cwd, requireAuth: false });
|
|
49
|
-
const { configPath, keyPath } = getTreeseedMachineConfigPaths(
|
|
61
|
+
const preflight = collectCliPreflight({ cwd: effectiveCwd, requireAuth: false });
|
|
62
|
+
const { configPath, keyPath } = getTreeseedMachineConfigPaths(effectiveCwd);
|
|
50
63
|
const state = {
|
|
51
|
-
cwd,
|
|
64
|
+
cwd: effectiveCwd,
|
|
52
65
|
workspaceRoot,
|
|
53
66
|
tenantRoot,
|
|
54
67
|
deployConfigPresent: tenantRoot,
|
|
55
68
|
repoRoot: root,
|
|
56
69
|
branchName,
|
|
57
70
|
branchRole,
|
|
58
|
-
environment:
|
|
71
|
+
environment: workflowEnvironmentForBranchRole(branchRole),
|
|
59
72
|
dirtyWorktree,
|
|
60
73
|
preview: {
|
|
61
74
|
enabled: false,
|
|
@@ -86,14 +99,19 @@ function resolveTreeseedWorkflowState(cwd) {
|
|
|
86
99
|
devVars: existsSync(resolve(cwd, ".dev.vars"))
|
|
87
100
|
},
|
|
88
101
|
releaseReady: branchRole === "staging" && !dirtyWorktree,
|
|
102
|
+
readiness: {
|
|
103
|
+
local: { ready: false, blockers: [], warnings: [] },
|
|
104
|
+
staging: { ready: false, blockers: [], warnings: [] },
|
|
105
|
+
prod: { ready: false, blockers: [], warnings: [] }
|
|
106
|
+
},
|
|
89
107
|
rollbackCandidates: [],
|
|
90
108
|
recommendations: []
|
|
91
109
|
};
|
|
92
110
|
if (tenantRoot) {
|
|
93
111
|
try {
|
|
94
|
-
const deployConfig = loadCliDeployConfig(
|
|
112
|
+
const deployConfig = loadCliDeployConfig(effectiveCwd);
|
|
95
113
|
for (const scope of ["local", "staging", "prod"]) {
|
|
96
|
-
const deployState = loadDeployState(
|
|
114
|
+
const deployState = loadDeployState(effectiveCwd, deployConfig, { target: createPersistentDeployTarget(scope) });
|
|
97
115
|
state.persistentEnvironments[scope] = {
|
|
98
116
|
initialized: deployState.readiness?.initialized === true || scope === "local",
|
|
99
117
|
lastValidatedAt: deployState.readiness?.lastValidatedAt ?? deployState.readiness?.initializedAt ?? null,
|
|
@@ -123,7 +141,7 @@ function resolveTreeseedWorkflowState(cwd) {
|
|
|
123
141
|
}
|
|
124
142
|
}
|
|
125
143
|
if (branchRole === "feature" && branchName) {
|
|
126
|
-
const previewState = loadDeployState(
|
|
144
|
+
const previewState = loadDeployState(effectiveCwd, deployConfig, { target: createBranchPreviewDeployTarget(branchName) });
|
|
127
145
|
state.preview = {
|
|
128
146
|
enabled: previewState.previewEnabled === true || previewState.readiness?.initialized === true,
|
|
129
147
|
url: previewState.lastDeployedUrl ?? null,
|
|
@@ -133,6 +151,9 @@ function resolveTreeseedWorkflowState(cwd) {
|
|
|
133
151
|
} catch {
|
|
134
152
|
}
|
|
135
153
|
}
|
|
154
|
+
state.readiness.local = readinessForEnvironment(state, "local");
|
|
155
|
+
state.readiness.staging = readinessForEnvironment(state, "staging");
|
|
156
|
+
state.readiness.prod = readinessForEnvironment(state, "prod");
|
|
136
157
|
state.recommendations = recommendTreeseedNextSteps(state);
|
|
137
158
|
return state;
|
|
138
159
|
}
|
|
@@ -150,13 +171,10 @@ function recommendTreeseedNextSteps(state) {
|
|
|
150
171
|
return recommendations;
|
|
151
172
|
}
|
|
152
173
|
if (state.branchRole === "feature") {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
} else {
|
|
156
|
-
recommendations.push({ operation: "stage", reason: "Merge this task branch into staging and clean up branch artifacts.", input: { message: "describe the resolution" } });
|
|
157
|
-
}
|
|
174
|
+
recommendations.push({ operation: "stage", reason: "Merge this task branch into staging and clean up branch artifacts.", input: { message: "describe the resolution" } });
|
|
175
|
+
recommendations.push({ operation: "save", reason: "Persist, verify, and push the current task branch before or independently of staging it.", input: { message: "describe your change" } });
|
|
158
176
|
if (state.preview.enabled && state.branchName) {
|
|
159
|
-
recommendations.push({ operation: "save", reason: "Save refreshes the branch preview deployment when one is enabled.", input: { message: "describe your change" } });
|
|
177
|
+
recommendations.push({ operation: "save", reason: "Save refreshes the branch preview deployment when one is enabled.", input: { message: "describe your change", preview: true } });
|
|
160
178
|
} else {
|
|
161
179
|
recommendations.push({ operation: "dev", reason: "Use the local environment for iterative work on this feature branch." });
|
|
162
180
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { applyTreeseedEnvironmentToProcess, assertTreeseedCommandEnvironment, checkTreeseedProviderConnections, clearTreeseedRemoteSession,
|
|
1
|
+
export { applyTreeseedConfigValues, applyTreeseedEnvironmentToProcess, applyTreeseedSafeRepairs, assertTreeseedCommandEnvironment, checkTreeseedProviderConnections, clearTreeseedRemoteSession, collectTreeseedConfigContext, collectTreeseedPrintEnvReport, createDefaultTreeseedMachineConfig, ensureTreeseedGitignoreEntries, getTreeseedMachineConfigPaths, loadTreeseedMachineConfig, listRelevantTreeseedConfigEntries, finalizeTreeseedConfig, resolveTreeseedMachineEnvironmentValues, resolveTreeseedRemoteConfig, resolveTreeseedRemoteSession, rotateTreeseedMachineKey, setTreeseedRemoteSession, writeTreeseedLocalEnvironmentFiles, writeTreeseedMachineConfig, } from './operations/services/config-runtime.ts';
|
|
2
|
+
export { exportTreeseedCodebase } from './operations/services/export-runtime.ts';
|
|
2
3
|
export { assertDeploymentInitialized, cleanupDestroyedState, createBranchPreviewDeployTarget, createPersistentDeployTarget, deployTargetLabel, destroyCloudflareResources, ensureGeneratedWranglerConfig, finalizeDeploymentState, loadDeployState, printDeploySummary, printDestroySummary, provisionCloudflareResources, runRemoteD1Migrations, syncCloudflareSecrets, validateDeployPrerequisites, validateDestroyPrerequisites, } from './operations/services/deploy.ts';
|
|
3
4
|
export { assertCleanWorktree, assertFeatureBranch, branchExists, checkoutBranch, createDeprecatedTaskTag, createFeatureBranchFromStaging, currentManagedBranch, deleteLocalBranch, deleteRemoteBranch, ensureLocalBranchTracking, gitWorkflowRoot, listTaskBranches, mergeCurrentBranchIntoStaging, mergeStagingIntoMain, prepareReleaseBranches, PRODUCTION_BRANCH, pushBranch, remoteBranchExists, STAGING_BRANCH, syncBranchWithOrigin, waitForStagingAutomation, } from './operations/services/git-workflow.ts';
|
|
4
5
|
export { loadCliDeployConfig, packageScriptPath, resolveWranglerBin, } from './operations/services/runtime-tools.ts';
|
package/dist/workflow-support.js
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
|
+
applyTreeseedConfigValues,
|
|
2
3
|
applyTreeseedEnvironmentToProcess,
|
|
4
|
+
applyTreeseedSafeRepairs,
|
|
3
5
|
assertTreeseedCommandEnvironment,
|
|
4
6
|
checkTreeseedProviderConnections,
|
|
5
7
|
clearTreeseedRemoteSession,
|
|
8
|
+
collectTreeseedConfigContext,
|
|
9
|
+
collectTreeseedPrintEnvReport,
|
|
6
10
|
createDefaultTreeseedMachineConfig,
|
|
7
11
|
ensureTreeseedGitignoreEntries,
|
|
8
|
-
formatTreeseedConfigEnvironmentReport,
|
|
9
|
-
formatTreeseedProviderConnectionReport,
|
|
10
12
|
getTreeseedMachineConfigPaths,
|
|
11
13
|
loadTreeseedMachineConfig,
|
|
14
|
+
listRelevantTreeseedConfigEntries,
|
|
15
|
+
finalizeTreeseedConfig,
|
|
12
16
|
resolveTreeseedMachineEnvironmentValues,
|
|
13
17
|
resolveTreeseedRemoteConfig,
|
|
14
18
|
resolveTreeseedRemoteSession,
|
|
15
19
|
rotateTreeseedMachineKey,
|
|
16
|
-
runTreeseedConfigWizard,
|
|
17
20
|
setTreeseedRemoteSession,
|
|
18
21
|
writeTreeseedLocalEnvironmentFiles,
|
|
19
22
|
writeTreeseedMachineConfig
|
|
20
23
|
} from "./operations/services/config-runtime.js";
|
|
24
|
+
import { exportTreeseedCodebase } from "./operations/services/export-runtime.js";
|
|
21
25
|
import {
|
|
22
26
|
assertDeploymentInitialized,
|
|
23
27
|
cleanupDestroyedState,
|
|
@@ -96,7 +100,9 @@ import {
|
|
|
96
100
|
export {
|
|
97
101
|
PRODUCTION_BRANCH,
|
|
98
102
|
STAGING_BRANCH,
|
|
103
|
+
applyTreeseedConfigValues,
|
|
99
104
|
applyTreeseedEnvironmentToProcess,
|
|
105
|
+
applyTreeseedSafeRepairs,
|
|
100
106
|
applyWorkspaceVersionChanges,
|
|
101
107
|
assertCleanWorktree,
|
|
102
108
|
assertDeploymentInitialized,
|
|
@@ -109,6 +115,8 @@ export {
|
|
|
109
115
|
clearTreeseedRemoteSession,
|
|
110
116
|
collectCliPreflight,
|
|
111
117
|
collectMergeConflictReport,
|
|
118
|
+
collectTreeseedConfigContext,
|
|
119
|
+
collectTreeseedPrintEnvReport,
|
|
112
120
|
configuredRailwayServices,
|
|
113
121
|
createBranchPreviewDeployTarget,
|
|
114
122
|
createDefaultTreeseedMachineConfig,
|
|
@@ -125,18 +133,19 @@ export {
|
|
|
125
133
|
ensureGeneratedWranglerConfig,
|
|
126
134
|
ensureLocalBranchTracking,
|
|
127
135
|
ensureTreeseedGitignoreEntries,
|
|
136
|
+
exportTreeseedCodebase,
|
|
128
137
|
finalizeDeploymentState,
|
|
138
|
+
finalizeTreeseedConfig,
|
|
129
139
|
findNearestTreeseedRoot,
|
|
130
140
|
findNearestTreeseedWorkspaceRoot,
|
|
131
141
|
formatMergeConflictReport,
|
|
132
|
-
formatTreeseedConfigEnvironmentReport,
|
|
133
|
-
formatTreeseedProviderConnectionReport,
|
|
134
142
|
getTreeseedMachineConfigPaths,
|
|
135
143
|
gitStatusPorcelain,
|
|
136
144
|
gitWorkflowRoot,
|
|
137
145
|
hasMeaningfulChanges,
|
|
138
146
|
incrementVersion,
|
|
139
147
|
isWorkspaceRoot,
|
|
148
|
+
listRelevantTreeseedConfigEntries,
|
|
140
149
|
listTaskBranches,
|
|
141
150
|
loadCliDeployConfig,
|
|
142
151
|
loadDeployState,
|
|
@@ -161,7 +170,6 @@ export {
|
|
|
161
170
|
run,
|
|
162
171
|
runRemoteD1Migrations,
|
|
163
172
|
runTenantDeployPreflight,
|
|
164
|
-
runTreeseedConfigWizard,
|
|
165
173
|
runWorkspaceSavePreflight,
|
|
166
174
|
setTreeseedRemoteSession,
|
|
167
175
|
syncBranchWithOrigin,
|
package/dist/workflow.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolveTreeseedWorkflowState } from './workflow-state.ts';
|
|
2
2
|
import { listTaskBranches } from './operations/services/git-workflow.ts';
|
|
3
3
|
import { TreeseedWorkflowError, type TreeseedWorkflowErrorCode } from './workflow/operations.ts';
|
|
4
|
-
export type TreeseedWorkflowOperationId = 'status' | 'config' | 'tasks' | 'switch' | 'dev' | 'save' | 'close' | 'stage' | 'release' | 'destroy';
|
|
4
|
+
export type TreeseedWorkflowOperationId = 'status' | 'config' | 'tasks' | 'switch' | 'dev' | 'save' | 'close' | 'stage' | 'release' | 'destroy' | 'export';
|
|
5
5
|
export type TreeseedWorkflowNextStep = {
|
|
6
6
|
operation: string;
|
|
7
7
|
reason?: string;
|
|
@@ -35,18 +35,21 @@ export type TreeseedSaveInput = {
|
|
|
35
35
|
hotfix?: boolean;
|
|
36
36
|
verify?: boolean;
|
|
37
37
|
refreshPreview?: boolean;
|
|
38
|
+
preview?: boolean;
|
|
38
39
|
rebase?: boolean;
|
|
39
40
|
};
|
|
40
41
|
export type TreeseedCloseInput = {
|
|
41
42
|
message: string;
|
|
42
43
|
deletePreview?: boolean;
|
|
43
44
|
deleteBranch?: boolean;
|
|
45
|
+
autoSave?: boolean;
|
|
44
46
|
};
|
|
45
47
|
export type TreeseedStageInput = {
|
|
46
48
|
message: string;
|
|
47
49
|
waitForStaging?: boolean;
|
|
48
50
|
deletePreview?: boolean;
|
|
49
51
|
deleteBranch?: boolean;
|
|
52
|
+
autoSave?: boolean;
|
|
50
53
|
};
|
|
51
54
|
export type TreeseedSwitchInput = {
|
|
52
55
|
branch?: string;
|
|
@@ -61,6 +64,12 @@ export type TreeseedConfigInput = {
|
|
|
61
64
|
environment?: TreeseedConfigScope[] | TreeseedConfigScope;
|
|
62
65
|
syncProviders?: 'none' | 'github' | 'cloudflare' | 'railway' | 'all';
|
|
63
66
|
sync?: 'none' | 'github' | 'cloudflare' | 'railway' | 'all';
|
|
67
|
+
updates?: Array<{
|
|
68
|
+
scope: Exclude<TreeseedConfigScope, 'all'>;
|
|
69
|
+
entryId: string;
|
|
70
|
+
value: string;
|
|
71
|
+
reused?: boolean;
|
|
72
|
+
}>;
|
|
64
73
|
repair?: boolean;
|
|
65
74
|
printEnv?: boolean;
|
|
66
75
|
printEnvOnly?: boolean;
|
|
@@ -68,6 +77,9 @@ export type TreeseedConfigInput = {
|
|
|
68
77
|
rotateMachineKey?: boolean;
|
|
69
78
|
nonInteractive?: boolean;
|
|
70
79
|
};
|
|
80
|
+
export type TreeseedExportInput = {
|
|
81
|
+
directory?: string;
|
|
82
|
+
};
|
|
71
83
|
export type TreeseedReleaseInput = {
|
|
72
84
|
bump: 'major' | 'minor' | 'patch';
|
|
73
85
|
};
|
|
@@ -108,4 +120,5 @@ export declare class TreeseedWorkflowSdk {
|
|
|
108
120
|
stage(input: TreeseedStageInput): Promise<TreeseedWorkflowResult>;
|
|
109
121
|
release(input: TreeseedReleaseInput): Promise<TreeseedWorkflowResult>;
|
|
110
122
|
destroy(input: TreeseedDestroyInput): Promise<TreeseedWorkflowResult>;
|
|
123
|
+
export(input?: TreeseedExportInput): Promise<TreeseedWorkflowResult>;
|
|
111
124
|
}
|
package/dist/workflow.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { resolveTreeseedWorkflowPaths } from "./workflow/policy.js";
|
|
1
2
|
import {
|
|
2
3
|
TreeseedWorkflowError,
|
|
3
4
|
workflowClose,
|
|
4
5
|
workflowConfig,
|
|
5
6
|
workflowDestroy,
|
|
6
7
|
workflowDev,
|
|
8
|
+
workflowExport,
|
|
7
9
|
workflowRelease,
|
|
8
10
|
workflowSave,
|
|
9
11
|
workflowStage,
|
|
@@ -28,7 +30,7 @@ class TreeseedWorkflowSdk {
|
|
|
28
30
|
};
|
|
29
31
|
return {
|
|
30
32
|
context,
|
|
31
|
-
cwd: () => context.cwd ?? process.cwd(),
|
|
33
|
+
cwd: () => resolveTreeseedWorkflowPaths(context.cwd ?? process.cwd()).cwd,
|
|
32
34
|
write: context.write ?? defaultWrite,
|
|
33
35
|
runStatus: async () => this.status(),
|
|
34
36
|
runTasks: async () => this.tasks()
|
|
@@ -56,6 +58,8 @@ class TreeseedWorkflowSdk {
|
|
|
56
58
|
return this.release(input);
|
|
57
59
|
case "destroy":
|
|
58
60
|
return this.destroy(input);
|
|
61
|
+
case "export":
|
|
62
|
+
return this.export(input);
|
|
59
63
|
default:
|
|
60
64
|
throw new Error(`Unsupported workflow operation "${operation}".`);
|
|
61
65
|
}
|
|
@@ -90,6 +94,9 @@ class TreeseedWorkflowSdk {
|
|
|
90
94
|
async destroy(input) {
|
|
91
95
|
return workflowDestroy(this.helpers(), input);
|
|
92
96
|
}
|
|
97
|
+
async export(input = {}) {
|
|
98
|
+
return workflowExport(this.helpers(), input);
|
|
99
|
+
}
|
|
93
100
|
}
|
|
94
101
|
export {
|
|
95
102
|
TreeseedWorkflowError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@treeseed/sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"description": "Shared Treeseed SDK for content-backed and D1-backed object models.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"react": "^19.2.5",
|
|
59
59
|
"remark-mdx": "^3.1.1",
|
|
60
60
|
"remark-parse": "^11.0.0",
|
|
61
|
+
"repomix": "^1.13.1",
|
|
61
62
|
"typescript": "^5.9.3",
|
|
62
63
|
"unified": "^11.0.5",
|
|
63
64
|
"yaml": "^2.8.1"
|
|
@@ -132,6 +133,10 @@
|
|
|
132
133
|
"types": "./dist/platform/books-data.d.ts",
|
|
133
134
|
"default": "./dist/platform/books-data.js"
|
|
134
135
|
},
|
|
136
|
+
"./platform/book-export": {
|
|
137
|
+
"types": "./dist/platform/book-export.d.ts",
|
|
138
|
+
"default": "./dist/platform/book-export.js"
|
|
139
|
+
},
|
|
135
140
|
"./platform/site-config-schema": {
|
|
136
141
|
"types": "./dist/platform/site-config-schema.d.ts",
|
|
137
142
|
"default": "./dist/platform/site-config-schema.js"
|