@treeseed/sdk 0.6.8 → 0.6.10
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/index.d.ts +1 -1
- package/dist/index.js +2 -0
- package/dist/managed-dependencies.d.ts +23 -0
- package/dist/managed-dependencies.js +133 -12
- package/dist/operations/providers/default.js +35 -0
- package/dist/operations/services/config-runtime.js +25 -6
- package/dist/operations/services/deploy.js +14 -1
- package/dist/operations/services/export-runtime.js +4 -0
- package/dist/operations/services/git-workflow.d.ts +2 -0
- package/dist/operations/services/git-workflow.js +39 -4
- package/dist/operations/services/github-api.d.ts +10 -0
- package/dist/operations/services/github-api.js +20 -1
- package/dist/operations/services/github-automation.d.ts +3 -0
- package/dist/operations/services/package-reference-policy.js +19 -3
- package/dist/operations/services/repository-save-orchestrator.js +10 -4
- package/dist/operations/services/workspace-dependency-mode.js +10 -18
- package/dist/operations-registry.js +1 -0
- package/dist/scripts/patch-starlight-content-path.js +2 -1
- package/dist/scripts/prepare.js +14 -0
- package/dist/verification.js +22 -1
- package/dist/workflow/operations.d.ts +259 -429
- package/dist/workflow/operations.js +662 -78
- package/dist/workflow/runs.d.ts +38 -0
- package/dist/workflow/runs.js +182 -15
- package/dist/workflow/worktrees.d.ts +39 -0
- package/dist/workflow/worktrees.js +224 -0
- package/dist/workflow-state.d.ts +13 -0
- package/dist/workflow-state.js +35 -2
- package/dist/workflow-support.d.ts +1 -1
- package/dist/workflow-support.js +2 -0
- package/dist/workflow.d.ts +14 -1
- package/package.json +2 -2
- package/templates/github/deploy.workflow.yml +135 -5
|
@@ -7,7 +7,7 @@ export { configuredRailwayServices, deployRailwayService, validateRailwayDeployP
|
|
|
7
7
|
export { ensureRailwayEnvironment, ensureRailwayProject, ensureRailwayService, getRailwayAuthProfile, listRailwayEnvironments, listRailwayProjects, listRailwayServices, listRailwayVariables, railwayGraphqlRequest, resolveRailwayApiToken, resolveRailwayApiUrl, resolveRailwayWorkspace, resolveRailwayWorkspaceContext, upsertRailwayVariables, } from './operations/services/railway-api.ts';
|
|
8
8
|
export { runTenantDeployPreflight, runWorkspaceSavePreflight, } from './operations/services/save-deploy-preflight.ts';
|
|
9
9
|
export { collectCliPreflight } from './operations/services/workspace-preflight.ts';
|
|
10
|
-
export { collectTreeseedDependencyStatus, createTreeseedManagedToolEnv, formatTreeseedDependencyFailureDetails, formatTreeseedDependencyReport, installTreeseedDependencies, resolveTreeseedToolBinary, resolveTreeseedToolCommand, } from './managed-dependencies.ts';
|
|
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';
|
|
12
12
|
export { applyWorkspaceVersionChanges, collectMergeConflictReport, currentBranch, formatMergeConflictReport, gitStatusPorcelain, hasMeaningfulChanges, incrementVersion, originRemoteUrl, planWorkspaceReleaseBump, repoRoot, } from './operations/services/workspace-save.ts';
|
|
13
13
|
export { assertNoWorkspaceLinksInDeploymentLockfiles, collectDeploymentLockfileWorkspaceIssues, discoverWorkspaceLinks, ensureLocalWorkspaceLinks, inspectWorkspaceDependencyMode, unlinkLocalWorkspaceLinks, type DependencyResolutionMode, type DeploymentLockfileWorkspaceIssue, type WorkspaceLinksMode, } from './operations/services/workspace-dependency-mode.ts';
|
package/dist/workflow-support.js
CHANGED
|
@@ -113,6 +113,7 @@ import {
|
|
|
113
113
|
import { collectCliPreflight } from "./operations/services/workspace-preflight.js";
|
|
114
114
|
import {
|
|
115
115
|
collectTreeseedDependencyStatus,
|
|
116
|
+
collectTreeseedToolStatus,
|
|
116
117
|
createTreeseedManagedToolEnv,
|
|
117
118
|
formatTreeseedDependencyFailureDetails,
|
|
118
119
|
formatTreeseedDependencyReport,
|
|
@@ -185,6 +186,7 @@ export {
|
|
|
185
186
|
collectTreeseedDependencyStatus,
|
|
186
187
|
collectTreeseedPrintEnvReport,
|
|
187
188
|
collectTreeseedReconcileStatus,
|
|
189
|
+
collectTreeseedToolStatus,
|
|
188
190
|
configuredRailwayServices,
|
|
189
191
|
createBranchPreviewDeployTarget,
|
|
190
192
|
createDefaultTreeseedMachineConfig,
|
package/dist/workflow.d.ts
CHANGED
|
@@ -26,6 +26,9 @@ export type TreeseedWorkflowRecovery = {
|
|
|
26
26
|
lock?: Record<string, unknown> | null;
|
|
27
27
|
};
|
|
28
28
|
export type TreeseedWorkflowExecutionMode = 'execute' | 'plan';
|
|
29
|
+
export type TreeseedWorkflowWorktreeMode = 'auto' | 'on' | 'off';
|
|
30
|
+
export type TreeseedWorkflowCiMode = 'auto' | 'hosted' | 'off';
|
|
31
|
+
export type TreeseedWorkflowVerifyMode = 'fast' | 'local' | 'hosted' | 'both' | 'skip';
|
|
29
32
|
export type TreeseedWorkflowContext = {
|
|
30
33
|
cwd?: string;
|
|
31
34
|
env?: NodeJS.ProcessEnv;
|
|
@@ -101,7 +104,9 @@ export type TreeseedSaveInput = {
|
|
|
101
104
|
devDependencyReferenceMode?: 'git-tag' | 'registry-prerelease';
|
|
102
105
|
gitDependencyProtocol?: 'preserve-origin' | 'https' | 'ssh';
|
|
103
106
|
gitRemoteWriteMode?: 'ssh-pushurl' | 'off';
|
|
104
|
-
verifyMode?: 'action-first' | 'local-only' | 'skip';
|
|
107
|
+
verifyMode?: 'action-first' | 'local-only' | 'skip' | TreeseedWorkflowVerifyMode;
|
|
108
|
+
ciMode?: TreeseedWorkflowCiMode;
|
|
109
|
+
worktreeMode?: TreeseedWorkflowWorktreeMode;
|
|
105
110
|
commitMessageMode?: 'auto' | 'cloudflare' | 'generated' | 'fallback';
|
|
106
111
|
workspaceLinks?: 'auto' | 'off';
|
|
107
112
|
plan?: boolean;
|
|
@@ -112,6 +117,7 @@ export type TreeseedCloseInput = {
|
|
|
112
117
|
deletePreview?: boolean;
|
|
113
118
|
deleteBranch?: boolean;
|
|
114
119
|
autoSave?: boolean;
|
|
120
|
+
worktreeMode?: TreeseedWorkflowWorktreeMode;
|
|
115
121
|
workspaceLinks?: 'auto' | 'off';
|
|
116
122
|
plan?: boolean;
|
|
117
123
|
dryRun?: boolean;
|
|
@@ -122,6 +128,8 @@ export type TreeseedStageInput = {
|
|
|
122
128
|
deletePreview?: boolean;
|
|
123
129
|
deleteBranch?: boolean;
|
|
124
130
|
autoSave?: boolean;
|
|
131
|
+
ciMode?: TreeseedWorkflowCiMode;
|
|
132
|
+
worktreeMode?: TreeseedWorkflowWorktreeMode;
|
|
125
133
|
workspaceLinks?: 'auto' | 'off';
|
|
126
134
|
plan?: boolean;
|
|
127
135
|
dryRun?: boolean;
|
|
@@ -132,6 +140,7 @@ export type TreeseedSwitchInput = {
|
|
|
132
140
|
preview?: boolean;
|
|
133
141
|
createIfMissing?: boolean;
|
|
134
142
|
baseBranch?: string;
|
|
143
|
+
worktreeMode?: TreeseedWorkflowWorktreeMode;
|
|
135
144
|
workspaceLinks?: 'auto' | 'off';
|
|
136
145
|
plan?: boolean;
|
|
137
146
|
dryRun?: boolean;
|
|
@@ -174,12 +183,15 @@ export type TreeseedConfigInput = {
|
|
|
174
183
|
};
|
|
175
184
|
export type TreeseedExportInput = {
|
|
176
185
|
directory?: string;
|
|
186
|
+
worktreeMode?: TreeseedWorkflowWorktreeMode;
|
|
177
187
|
};
|
|
178
188
|
export type TreeseedReleaseInput = {
|
|
179
189
|
bump: 'major' | 'minor' | 'patch';
|
|
180
190
|
devTagCleanup?: 'safe-after-release' | 'off';
|
|
181
191
|
gitDependencyProtocol?: 'preserve-origin' | 'https' | 'ssh';
|
|
182
192
|
gitRemoteWriteMode?: 'ssh-pushurl' | 'off';
|
|
193
|
+
ciMode?: TreeseedWorkflowCiMode;
|
|
194
|
+
worktreeMode?: TreeseedWorkflowWorktreeMode;
|
|
183
195
|
workspaceLinks?: 'auto' | 'off';
|
|
184
196
|
plan?: boolean;
|
|
185
197
|
dryRun?: boolean;
|
|
@@ -189,6 +201,7 @@ export type TreeseedResumeInput = {
|
|
|
189
201
|
};
|
|
190
202
|
export type TreeseedRecoverInput = {
|
|
191
203
|
runId?: string;
|
|
204
|
+
pruneStale?: boolean;
|
|
192
205
|
};
|
|
193
206
|
export type TreeseedDestroyInput = {
|
|
194
207
|
target?: 'local' | 'staging' | 'prod';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@treeseed/sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.10",
|
|
4
4
|
"description": "Shared Treeseed SDK for content-backed and D1-backed object models.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"setup:ci": "npm ci",
|
|
35
35
|
"build": "npm run build:dist",
|
|
36
36
|
"build:dist": "node ./scripts/run-ts.mjs ./scripts/build-dist.ts",
|
|
37
|
-
"prepare": "
|
|
37
|
+
"prepare": "node ./scripts/prepare.mjs",
|
|
38
38
|
"prepack": "npm run build:dist",
|
|
39
39
|
"test": "npm run test:unit",
|
|
40
40
|
"test:unit": "vitest run --config ./vitest.config.ts",
|
|
@@ -150,7 +150,33 @@ jobs:
|
|
|
150
150
|
cache-dependency-path: __CACHE_DEPENDENCY_PATH__
|
|
151
151
|
|
|
152
152
|
- name: Install dependencies
|
|
153
|
-
run:
|
|
153
|
+
run: |
|
|
154
|
+
node -e "const fs = require('fs'); for (const file of ['packages/sdk/package.json', 'packages/core/package.json', 'packages/cli/package.json']) { if (!fs.existsSync(file)) continue; const p = JSON.parse(fs.readFileSync(file, 'utf8')); if (p.scripts) delete p.scripts.prepare; fs.writeFileSync(file, JSON.stringify(p, null, '\t') + '\n'); }"
|
|
155
|
+
for attempt in 1 2 3; do
|
|
156
|
+
if npm ci --ignore-scripts; then
|
|
157
|
+
break
|
|
158
|
+
fi
|
|
159
|
+
if test "${attempt}" = "3"; then
|
|
160
|
+
exit 1
|
|
161
|
+
fi
|
|
162
|
+
echo "npm ci failed; retrying (${attempt}/3)."
|
|
163
|
+
sleep $((attempt * 10))
|
|
164
|
+
done
|
|
165
|
+
for dir in packages/sdk packages/core packages/cli; do
|
|
166
|
+
if test -d "${dir}/.git" || git -C "${dir}" rev-parse --git-dir >/dev/null 2>&1; then
|
|
167
|
+
git -C "${dir}" checkout -- package.json
|
|
168
|
+
fi
|
|
169
|
+
done
|
|
170
|
+
|
|
171
|
+
- name: Build workspace package artifacts
|
|
172
|
+
shell: bash
|
|
173
|
+
run: |
|
|
174
|
+
set -euo pipefail
|
|
175
|
+
for dir in packages/sdk packages/core packages/cli; do
|
|
176
|
+
if test -f "${dir}/package.json"; then
|
|
177
|
+
npm --prefix "${dir}" run build:dist
|
|
178
|
+
fi
|
|
179
|
+
done
|
|
154
180
|
|
|
155
181
|
- name: Verify workspace
|
|
156
182
|
shell: bash
|
|
@@ -263,7 +289,33 @@ __WORKING_DIRECTORY_BLOCK__
|
|
|
263
289
|
cache-dependency-path: __CACHE_DEPENDENCY_PATH__
|
|
264
290
|
|
|
265
291
|
- name: Install dependencies
|
|
266
|
-
run:
|
|
292
|
+
run: |
|
|
293
|
+
node -e "const fs = require('fs'); for (const file of ['packages/sdk/package.json', 'packages/core/package.json', 'packages/cli/package.json']) { if (!fs.existsSync(file)) continue; const p = JSON.parse(fs.readFileSync(file, 'utf8')); if (p.scripts) delete p.scripts.prepare; fs.writeFileSync(file, JSON.stringify(p, null, '\t') + '\n'); }"
|
|
294
|
+
for attempt in 1 2 3; do
|
|
295
|
+
if npm ci --ignore-scripts; then
|
|
296
|
+
break
|
|
297
|
+
fi
|
|
298
|
+
if test "${attempt}" = "3"; then
|
|
299
|
+
exit 1
|
|
300
|
+
fi
|
|
301
|
+
echo "npm ci failed; retrying (${attempt}/3)."
|
|
302
|
+
sleep $((attempt * 10))
|
|
303
|
+
done
|
|
304
|
+
for dir in packages/sdk packages/core packages/cli; do
|
|
305
|
+
if test -d "${dir}/.git" || git -C "${dir}" rev-parse --git-dir >/dev/null 2>&1; then
|
|
306
|
+
git -C "${dir}" checkout -- package.json
|
|
307
|
+
fi
|
|
308
|
+
done
|
|
309
|
+
|
|
310
|
+
- name: Build workspace package artifacts
|
|
311
|
+
shell: bash
|
|
312
|
+
run: |
|
|
313
|
+
set -euo pipefail
|
|
314
|
+
for dir in packages/sdk packages/core packages/cli; do
|
|
315
|
+
if test -f "${dir}/package.json"; then
|
|
316
|
+
npm --prefix "${dir}" run build:dist
|
|
317
|
+
fi
|
|
318
|
+
done
|
|
267
319
|
|
|
268
320
|
- name: Install Railway CLI
|
|
269
321
|
run: npm install -g @railway/cli
|
|
@@ -384,7 +436,33 @@ __WORKING_DIRECTORY_BLOCK__
|
|
|
384
436
|
cache-dependency-path: __CACHE_DEPENDENCY_PATH__
|
|
385
437
|
|
|
386
438
|
- name: Install dependencies
|
|
387
|
-
run:
|
|
439
|
+
run: |
|
|
440
|
+
node -e "const fs = require('fs'); for (const file of ['packages/sdk/package.json', 'packages/core/package.json', 'packages/cli/package.json']) { if (!fs.existsSync(file)) continue; const p = JSON.parse(fs.readFileSync(file, 'utf8')); if (p.scripts) delete p.scripts.prepare; fs.writeFileSync(file, JSON.stringify(p, null, '\t') + '\n'); }"
|
|
441
|
+
for attempt in 1 2 3; do
|
|
442
|
+
if npm ci --ignore-scripts; then
|
|
443
|
+
break
|
|
444
|
+
fi
|
|
445
|
+
if test "${attempt}" = "3"; then
|
|
446
|
+
exit 1
|
|
447
|
+
fi
|
|
448
|
+
echo "npm ci failed; retrying (${attempt}/3)."
|
|
449
|
+
sleep $((attempt * 10))
|
|
450
|
+
done
|
|
451
|
+
for dir in packages/sdk packages/core packages/cli; do
|
|
452
|
+
if test -d "${dir}/.git" || git -C "${dir}" rev-parse --git-dir >/dev/null 2>&1; then
|
|
453
|
+
git -C "${dir}" checkout -- package.json
|
|
454
|
+
fi
|
|
455
|
+
done
|
|
456
|
+
|
|
457
|
+
- name: Build workspace package artifacts
|
|
458
|
+
shell: bash
|
|
459
|
+
run: |
|
|
460
|
+
set -euo pipefail
|
|
461
|
+
for dir in packages/sdk packages/core packages/cli; do
|
|
462
|
+
if test -f "${dir}/package.json"; then
|
|
463
|
+
npm --prefix "${dir}" run build:dist
|
|
464
|
+
fi
|
|
465
|
+
done
|
|
388
466
|
|
|
389
467
|
- name: Install Railway CLI
|
|
390
468
|
run: npm install -g @railway/cli
|
|
@@ -497,7 +575,33 @@ __WORKING_DIRECTORY_BLOCK__
|
|
|
497
575
|
cache-dependency-path: __CACHE_DEPENDENCY_PATH__
|
|
498
576
|
|
|
499
577
|
- name: Install dependencies
|
|
500
|
-
run:
|
|
578
|
+
run: |
|
|
579
|
+
node -e "const fs = require('fs'); for (const file of ['packages/sdk/package.json', 'packages/core/package.json', 'packages/cli/package.json']) { if (!fs.existsSync(file)) continue; const p = JSON.parse(fs.readFileSync(file, 'utf8')); if (p.scripts) delete p.scripts.prepare; fs.writeFileSync(file, JSON.stringify(p, null, '\t') + '\n'); }"
|
|
580
|
+
for attempt in 1 2 3; do
|
|
581
|
+
if npm ci --ignore-scripts; then
|
|
582
|
+
break
|
|
583
|
+
fi
|
|
584
|
+
if test "${attempt}" = "3"; then
|
|
585
|
+
exit 1
|
|
586
|
+
fi
|
|
587
|
+
echo "npm ci failed; retrying (${attempt}/3)."
|
|
588
|
+
sleep $((attempt * 10))
|
|
589
|
+
done
|
|
590
|
+
for dir in packages/sdk packages/core packages/cli; do
|
|
591
|
+
if test -d "${dir}/.git" || git -C "${dir}" rev-parse --git-dir >/dev/null 2>&1; then
|
|
592
|
+
git -C "${dir}" checkout -- package.json
|
|
593
|
+
fi
|
|
594
|
+
done
|
|
595
|
+
|
|
596
|
+
- name: Build workspace package artifacts
|
|
597
|
+
shell: bash
|
|
598
|
+
run: |
|
|
599
|
+
set -euo pipefail
|
|
600
|
+
for dir in packages/sdk packages/core packages/cli; do
|
|
601
|
+
if test -f "${dir}/package.json"; then
|
|
602
|
+
npm --prefix "${dir}" run build:dist
|
|
603
|
+
fi
|
|
604
|
+
done
|
|
501
605
|
|
|
502
606
|
- name: Install Railway CLI
|
|
503
607
|
run: npm install -g @railway/cli
|
|
@@ -590,7 +694,33 @@ __WORKING_DIRECTORY_BLOCK__
|
|
|
590
694
|
cache-dependency-path: __CACHE_DEPENDENCY_PATH__
|
|
591
695
|
|
|
592
696
|
- name: Install dependencies
|
|
593
|
-
run:
|
|
697
|
+
run: |
|
|
698
|
+
node -e "const fs = require('fs'); for (const file of ['packages/sdk/package.json', 'packages/core/package.json', 'packages/cli/package.json']) { if (!fs.existsSync(file)) continue; const p = JSON.parse(fs.readFileSync(file, 'utf8')); if (p.scripts) delete p.scripts.prepare; fs.writeFileSync(file, JSON.stringify(p, null, '\t') + '\n'); }"
|
|
699
|
+
for attempt in 1 2 3; do
|
|
700
|
+
if npm ci --ignore-scripts; then
|
|
701
|
+
break
|
|
702
|
+
fi
|
|
703
|
+
if test "${attempt}" = "3"; then
|
|
704
|
+
exit 1
|
|
705
|
+
fi
|
|
706
|
+
echo "npm ci failed; retrying (${attempt}/3)."
|
|
707
|
+
sleep $((attempt * 10))
|
|
708
|
+
done
|
|
709
|
+
for dir in packages/sdk packages/core packages/cli; do
|
|
710
|
+
if test -d "${dir}/.git" || git -C "${dir}" rev-parse --git-dir >/dev/null 2>&1; then
|
|
711
|
+
git -C "${dir}" checkout -- package.json
|
|
712
|
+
fi
|
|
713
|
+
done
|
|
714
|
+
|
|
715
|
+
- name: Build workspace package artifacts
|
|
716
|
+
shell: bash
|
|
717
|
+
run: |
|
|
718
|
+
set -euo pipefail
|
|
719
|
+
for dir in packages/sdk packages/core packages/cli; do
|
|
720
|
+
if test -f "${dir}/package.json"; then
|
|
721
|
+
npm --prefix "${dir}" run build:dist
|
|
722
|
+
fi
|
|
723
|
+
done
|
|
594
724
|
|
|
595
725
|
- name: Download Treeseed deployment state
|
|
596
726
|
uses: actions/download-artifact@v4
|