@bakers-build/addon-orca 0.6.1-next.2 → 0.6.1-next.4
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/src/workspace.d.ts +7 -0
- package/dist/src/workspace.js +7 -3
- package/package.json +6 -6
package/dist/src/workspace.d.ts
CHANGED
|
@@ -41,6 +41,12 @@ export interface OrcaWorkspaceOptions {
|
|
|
41
41
|
execGit?: GitExec;
|
|
42
42
|
logger?: ConductorLogger;
|
|
43
43
|
sleep?: Sleep;
|
|
44
|
+
/**
|
|
45
|
+
* Default `false`: before creating a worktree, set `branch.autoSetupMerge=false`
|
|
46
|
+
* in `root`, check out remote branches without `--track`, and give runs
|
|
47
|
+
* `push.default=current`. `true` leaves Git alone.
|
|
48
|
+
*/
|
|
49
|
+
autoSetupMerge?: boolean;
|
|
44
50
|
}
|
|
45
51
|
/**
|
|
46
52
|
* Per-ticket worktree hosted in Orca. The worktree is created with plain git on
|
|
@@ -83,6 +89,7 @@ export declare function orcaWorkspace(opts?: {
|
|
|
83
89
|
baseBranch?: string;
|
|
84
90
|
open?: OrcaOpenLayout;
|
|
85
91
|
adoptTimeoutMs?: number;
|
|
92
|
+
autoSetupMerge?: boolean;
|
|
86
93
|
/** Overrideable git exec for root derivation (tests). */
|
|
87
94
|
execGit?: RootGitExec;
|
|
88
95
|
}): WorkspacePlugin;
|
package/dist/src/workspace.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
3
|
import { renderTemplate, resolveBaseRef, truncateOpenTabTitle, validateBranch, } from '@bakers-build/addon-herdr/shared';
|
|
4
|
-
import { loadInstructions } from '@bakers-build/addon-workspace-git';
|
|
4
|
+
import { loadInstructions, runBranchGit, } from '@bakers-build/addon-workspace-git';
|
|
5
5
|
import { deriveCheckoutRoot, exec } from '@bakers-build/core';
|
|
6
6
|
import { assertOrcaReachable, createOrcaExec, isRecord, OrcaError, } from './orca-cli.js';
|
|
7
7
|
export const DEFAULT_OPEN_LAYOUT = {
|
|
@@ -90,6 +90,9 @@ export class OrcaWorkspace {
|
|
|
90
90
|
throw new Error('orca workspace requires a branch name');
|
|
91
91
|
}
|
|
92
92
|
validateBranch(branch);
|
|
93
|
+
const extra = this.options.autoSetupMerge
|
|
94
|
+
? {}
|
|
95
|
+
: { env: await runBranchGit(this.root, this.logger) };
|
|
93
96
|
await assertOrcaReachable(this.execOrca);
|
|
94
97
|
await this.registerRepo();
|
|
95
98
|
const path = resolve(this.root, this.options.worktreeDir ?? '.bakers-worktrees', branch);
|
|
@@ -101,7 +104,7 @@ export class OrcaWorkspace {
|
|
|
101
104
|
if (created) {
|
|
102
105
|
this.pendingOpen.add(path);
|
|
103
106
|
}
|
|
104
|
-
return { path, instructions: loadInstructions(path), created };
|
|
107
|
+
return { path, instructions: loadInstructions(path), created, ...extra };
|
|
105
108
|
}
|
|
106
109
|
/** Register the root with Orca once and make its git worktrees visible. */
|
|
107
110
|
async registerRepo() {
|
|
@@ -165,7 +168,7 @@ export class OrcaWorkspace {
|
|
|
165
168
|
if (await this.refExists(`refs/remotes/origin/${branch}`)) {
|
|
166
169
|
await this.execGit([
|
|
167
170
|
...add,
|
|
168
|
-
'--track',
|
|
171
|
+
...(this.options.autoSetupMerge ? ['--track'] : []),
|
|
169
172
|
'-b',
|
|
170
173
|
branch,
|
|
171
174
|
path,
|
|
@@ -234,6 +237,7 @@ export function orcaWorkspace(opts = {}) {
|
|
|
234
237
|
...(opts.adoptTimeoutMs !== undefined
|
|
235
238
|
? { adoptTimeoutMs: opts.adoptTimeoutMs }
|
|
236
239
|
: {}),
|
|
240
|
+
...(opts.autoSetupMerge ? { autoSetupMerge: true } : {}),
|
|
237
241
|
...(deps?.logger ? { logger: deps.logger } : {}),
|
|
238
242
|
});
|
|
239
243
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bakers-build/addon-orca",
|
|
3
|
-
"version": "0.6.1-next.
|
|
3
|
+
"version": "0.6.1-next.4",
|
|
4
4
|
"description": "bakers.build Orca integration: executor + per-ticket worktree workspace hosted in Orca.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
"directory": "bakers-cli/addons/orca"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@bakers-build/addon-herdr": "^0.6.1-next.
|
|
24
|
-
"@bakers-build/addon-workspace-git": "^0.6.1-next.
|
|
23
|
+
"@bakers-build/addon-herdr": "^0.6.1-next.4",
|
|
24
|
+
"@bakers-build/addon-workspace-git": "^0.6.1-next.4"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@bakers-build/conductor": "^0.6.1-next.
|
|
28
|
-
"@bakers-build/core": "^0.6.1-next.
|
|
27
|
+
"@bakers-build/conductor": "^0.6.1-next.4",
|
|
28
|
+
"@bakers-build/core": "^0.6.1-next.4"
|
|
29
29
|
},
|
|
30
30
|
"bakersBuild": {
|
|
31
|
-
"commit": "
|
|
31
|
+
"commit": "f9ce4e2980c83b80ba5f007fe2d8e534797cf66c",
|
|
32
32
|
"channel": "next"
|
|
33
33
|
}
|
|
34
34
|
}
|