@bakers-build/ui 0.11.1-next.7 → 0.11.1-next.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/src/ui.d.ts CHANGED
@@ -28,11 +28,9 @@ export interface RunBbUiOptions {
28
28
  /** BB-472 — the loaded connection config's absolute path, so the
29
29
  * workspace-picker screen can find `workspace_id`'s owning file. */
30
30
  configPath?: string | undefined;
31
- /** BB-472 — re-executes this process; the picker calls it after writing a
32
- * new workspace selection. */
33
- restartProcess?: (() => void) | undefined;
34
- /** Persist a product-workspace name through the conductor-owned contract. */
35
- selectWorkspace?: ((name: string) => Promise<void>) | undefined;
31
+ /** BB-472 — re-executes this process scoped to the picked workspace; the
32
+ * picker calls it and nothing is written. */
33
+ restartProcess?: ((workspace: string) => void) | undefined;
36
34
  buildProgram: (opts: {
37
35
  plugins: unknown[];
38
36
  }) => DropshProgram;
@@ -86,6 +84,8 @@ export interface UiDeps {
86
84
  printConfig?: boolean;
87
85
  /** Sink for `--print-config`; default: `process.stdout.write`. */
88
86
  stdout?: (s: string) => void;
87
+ /** Re-exec seam for the workspace switch; default: `reExecUnderBun`. */
88
+ reExec?: (argv: string[]) => void;
89
89
  /** Daily update lookup; injectable for startup ordering tests. */
90
90
  updateCheck?: () => Promise<string | null>;
91
91
  /** Positional `[target]` (`BB-221`, `#19`, `ticket:…`, `project:…`, `run:…`). */
package/dist/src/ui.js CHANGED
@@ -421,18 +421,20 @@ export async function cmdUi(deps = {}) {
421
421
  // reExecUnderBun step this process took to reach OpenTUI at all
422
422
  // (`shouldReExecUnderBun`, above). Absent only when the bun binary could
423
423
  // not be resolved, which already failed startup before this point.
424
- restartProcess: () => {
425
- const bin = resolveBunBinary(host.resolveBases);
426
- if (bin)
427
- reExecUnderBun(bin, process.argv);
424
+ // A pick scopes the new process through `--workspace` and writes no
425
+ // config file, so it cannot pin a workspace the project is not in.
426
+ restartProcess: (workspace) => {
427
+ const argv = process.argv.filter((arg, i, all) => arg !== '--workspace' &&
428
+ all[i - 1] !== '--workspace' &&
429
+ !arg.startsWith('--workspace='));
430
+ const reExec = deps.reExec ??
431
+ ((next) => {
432
+ const bin = resolveBunBinary(host.resolveBases);
433
+ if (bin)
434
+ reExecUnderBun(bin, next);
435
+ });
436
+ reExec([...argv, '--workspace', workspace]);
428
437
  },
429
- ...(conductorPath && host.projectContext
430
- ? {
431
- selectWorkspace: async (name) => {
432
- await host.projectContext?.writeWorkspace(conductorPath, name);
433
- },
434
- }
435
- : {}),
436
438
  // The plugins are real constructed `DropSHPlugin[]` now (core built them),
437
439
  // matching dropsh's declared contract — F3's substance, a descriptor handed
438
440
  // to an API expecting instances, is gone. The two casts that remain are
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bakers-build/ui",
3
- "version": "0.11.1-next.7",
3
+ "version": "0.11.1-next.8",
4
4
  "description": "bakers.build project-first cockpit: the `bakers ui` command plugin (renderer resolved dynamically).",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -26,13 +26,13 @@
26
26
  "directory": "bakers-cli/ui"
27
27
  },
28
28
  "dependencies": {
29
- "@bakers-build/core": "^0.11.1-next.7",
30
- "@bakers-build/addon-workspace": "^0.11.1-next.7",
29
+ "@bakers-build/core": "^0.11.1-next.8",
30
+ "@bakers-build/addon-workspace": "^0.11.1-next.8",
31
31
  "commander": "^12.1.0",
32
32
  "dropsh": "^0.8.2"
33
33
  },
34
34
  "bakersBuild": {
35
- "commit": "9f305d0873788b79f7af9e8eb650eb4115fa72d6",
35
+ "commit": "8807d1cd2569de7e4555aa0485037cec48ad1d1e",
36
36
  "channel": "next"
37
37
  }
38
38
  }