Skip to content

Commit f964400

Browse files
committed
fix(shell): restore docker-git cli menu startup
1 parent 1a5f3f4 commit f964400

File tree

5 files changed

+62
-63
lines changed

5 files changed

+62
-63
lines changed

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ services:
88
container_name: ${DOCKER_GIT_API_CONTAINER_NAME:-docker-git-api}
99
environment:
1010
DOCKER_GIT_API_PORT: ${DOCKER_GIT_API_PORT:-3334}
11+
DOCKER_GIT_CONTROLLER_REV: ${DOCKER_GIT_CONTROLLER_REV:-unknown}
1112
DOCKER_GIT_PROJECTS_ROOT: ${DOCKER_GIT_PROJECTS_ROOT:-/home/dev/.docker-git}
1213
DOCKER_GIT_PROJECTS_ROOT_VOLUME: ${DOCKER_GIT_PROJECTS_ROOT_VOLUME:-docker-git-projects}
1314
DOCKER_GIT_FEDERATION_PUBLIC_ORIGIN: ${DOCKER_GIT_FEDERATION_PUBLIC_ORIGIN:-}

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,26 @@
2222
"changeset": "changeset",
2323
"changeset-publish": "bun -e \"if (!process.env.NPM_TOKEN) { console.log('Skipping publish: NPM_TOKEN is not set'); process.exit(0); }\" && changeset publish",
2424
"changeset-version": "changeset version",
25-
"clone": "bun run --filter @prover-coder-ai/docker-git clone",
26-
"open": "bun run --filter @prover-coder-ai/docker-git open",
27-
"docker-git": "bun run --filter @prover-coder-ai/docker-git docker-git",
25+
"clone": "bash -lc 'bun run --cwd packages/app build:docker-git >/dev/null && bun ./packages/app/dist/src/docker-git/main.js clone \"$@\"' --",
26+
"open": "bash -lc 'bun run --cwd packages/app build:docker-git >/dev/null && bun ./packages/app/dist/src/docker-git/main.js open \"$@\"' --",
27+
"docker-git": "bash -lc 'bun run --cwd packages/app build:docker-git >/dev/null && bun ./packages/app/dist/src/docker-git/main.js \"$@\"' --",
2828
"e2e": "bash scripts/e2e/run-all.sh",
2929
"e2e:clone-cache": "bash scripts/e2e/clone-cache.sh",
3030
"e2e:login-context": "bash scripts/e2e/login-context.sh",
3131
"e2e:runtime-volumes-ssh": "bash scripts/e2e/runtime-volumes-ssh.sh",
3232
"e2e:opencode-autoconnect": "bash scripts/e2e/opencode-autoconnect.sh",
33-
"list": "bun run --filter @prover-coder-ai/docker-git list",
34-
"dev": "bun run --filter @prover-coder-ai/docker-git dev",
35-
"web:dev": "bun run --filter @prover-coder-ai/docker-git dev:web",
36-
"web:build": "bun run --filter @prover-coder-ai/docker-git build:web",
37-
"web:preview": "bun run --filter @prover-coder-ai/docker-git preview:web",
38-
"web:serve": "bun run --filter @prover-coder-ai/docker-git serve:web",
33+
"list": "bash -lc 'bun run --cwd packages/app build:docker-git >/dev/null && bun ./packages/app/dist/src/docker-git/main.js ps \"$@\"' --",
34+
"dev": "bun run --cwd packages/app dev",
35+
"web:dev": "bun run --cwd packages/app dev:web",
36+
"web:build": "bun run --cwd packages/app build:web",
37+
"web:preview": "bun run --cwd packages/app preview:web",
38+
"web:serve": "bun run --cwd packages/app serve:web",
3939
"lint": "bun run --filter @prover-coder-ai/docker-git lint && bun run --filter @effect-template/lib lint",
4040
"lint:tests": "bun run --filter @prover-coder-ai/docker-git lint:tests",
4141
"lint:effect": "bun run --filter @prover-coder-ai/docker-git lint:effect && bun run --filter @effect-template/lib lint:effect",
4242
"test": "bun run --filter @prover-coder-ai/docker-git test && bun run --filter @effect-template/lib test",
4343
"typecheck": "bun run --filter @prover-coder-ai/docker-git typecheck && bun run --filter @effect-template/lib typecheck",
44-
"start": "bun run --filter @prover-coder-ai/docker-git start"
44+
"start": "bash -lc 'bun run --cwd packages/app build:docker-git >/dev/null && bun ./packages/app/dist/src/docker-git/main.js \"$@\"' --"
4545
},
4646
"devDependencies": {
4747
"@changesets/changelog-github": "^0.6.0",

packages/api/Dockerfile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,17 @@ COPY patches ./patches
2424
COPY scripts ./scripts
2525
COPY packages ./packages
2626

27-
RUN bun install --frozen-lockfile --silent
27+
RUN set -eu; \
28+
for attempt in 1 2 3 4 5; do \
29+
if bun install --frozen-lockfile --silent; then \
30+
exit 0; \
31+
fi; \
32+
echo "bun install attempt ${attempt} failed; retrying..." >&2; \
33+
rm -rf /root/.bun/install/cache; \
34+
sleep $((attempt * 2)); \
35+
done; \
36+
echo "bun install failed after retries" >&2; \
37+
exit 1
2838
RUN bun run --cwd packages/lib build
2939
RUN bun run --cwd packages/api build
3040

packages/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"lint": "NODE_OPTIONS=--max-old-space-size=4096 PATH=../../scripts:$PATH vibecode-linter src/",
2626
"lint:tests": "NODE_OPTIONS=--max-old-space-size=4096 PATH=../../scripts:$PATH vibecode-linter tests/",
2727
"lint:effect": "NODE_OPTIONS=--max-old-space-size=4096 PATH=../../scripts:$PATH eslint --config eslint.effect-ts-check.config.mjs .",
28-
"prebuild:docker-git": "bun run --cwd ../lib build",
28+
"prebuild:docker-git": "bun install --cwd ../.. --silent && bun run --cwd ../lib build",
2929
"build:docker-git": "vite build --config vite.docker-git.config.ts",
3030
"check": "bun run typecheck",
3131
"clone": "bash -lc 'bun run build:docker-git >/dev/null && bun dist/src/docker-git/main.js clone \"$@\"' --",
Lines changed: 39 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { JSX } from "react"
1+
import React, { type JSX } from "react"
22

33
import type { GridlandInputProps, GridlandModule } from "@gridland/bun"
44

@@ -12,57 +12,45 @@ const renderInputValue = (props: UiTextInputProps): string => {
1212
}
1313

1414
const inputProps = (props: UiTextInputProps): GridlandInputProps => ({
15-
ariaLabel: props.ariaLabel,
16-
autoFocus: props.autoFocus,
1715
placeholder: props.placeholder,
1816
value: renderInputValue(props)
1917
})
2018

21-
export const createGridlandPrimitives = (gridland: GridlandModule) => {
22-
const GridlandBox = gridland.Box
23-
const GridlandInput = gridland.Input
24-
const GridlandText = gridland.Text
25-
26-
return {
27-
Box: ({ children, ...props }: UiBoxProps): JSX.Element => (
28-
<GridlandBox
29-
alignItems={props.alignItems}
30-
backgroundColor={props.backgroundColor}
31-
border={props.border}
32-
borderColor={props.borderColor}
33-
borderStyle={props.borderStyle}
34-
color={props.fg}
35-
flexDirection={props.flexDirection}
36-
flexGrow={props.flexGrow}
37-
flexWrap={props.flexWrap}
38-
gap={props.gap}
39-
height={props.height}
40-
justifyContent={props.justifyContent}
41-
marginBottom={props.marginBottom}
42-
marginLeft={props.marginLeft}
43-
marginRight={props.marginRight}
44-
marginTop={props.marginTop}
45-
padding={props.padding}
46-
width={props.width}
47-
>
48-
{children}
49-
</GridlandBox>
50-
),
51-
Button: ({ label }: UiButtonProps): JSX.Element => <GridlandText color="cyan">[{label}]</GridlandText>,
52-
Text: ({ children, ...props }: UiTextProps): JSX.Element => (
53-
<GridlandText
54-
bold={props.bold}
55-
color={props.fg}
56-
marginBottom={props.marginBottom}
57-
marginLeft={props.marginLeft}
58-
marginRight={props.marginRight}
59-
marginTop={props.marginTop}
60-
truncate={props.wrap === "truncate"}
61-
width={props.width}
62-
>
63-
{children}
64-
</GridlandText>
65-
),
66-
TextInput: (props: UiTextInputProps): JSX.Element => <GridlandInput {...inputProps(props)} />
67-
} as const
68-
}
19+
// CHANGE: render Gridland primitives through host component tags instead of helper functions
20+
// WHY: @gridland/bun helper functions return Gridland vnode objects, not React elements; using them as JSX
21+
// children causes React reconciliation to reject the returned object tree in the TTY menu runtime
22+
// QUOTE(ТЗ): "ЧТо бы я мог меню открыть"
23+
// REF: user-request-2026-04-13-gridland-menu-fix
24+
// SOURCE: n/a
25+
// FORMAT THEOREM: ∀p: hostTag(p) → reactElement(p) ∧ renderable(p)
26+
// PURITY: SHELL
27+
// EFFECT: n/a
28+
// INVARIANT: Gridland TUI primitives always return React elements with supported host tags
29+
// COMPLEXITY: O(1)
30+
export const createGridlandPrimitives = (_gridland: GridlandModule) => ({
31+
Box: ({ children, ...props }: UiBoxProps): JSX.Element =>
32+
React.createElement("box", {
33+
...props,
34+
children
35+
}),
36+
Button: ({ label, onPress }: UiButtonProps): JSX.Element =>
37+
React.createElement("text", {
38+
children: `[${label}]`,
39+
fg: "cyan",
40+
onClick: onPress
41+
}),
42+
Text: ({ children, ...props }: UiTextProps): JSX.Element =>
43+
React.createElement("text", {
44+
...props,
45+
children
46+
}),
47+
TextInput: (props: UiTextInputProps): JSX.Element =>
48+
React.createElement("input", {
49+
...inputProps(props),
50+
focused: props.autoFocus,
51+
onChange: props.onChange,
52+
onSubmit: () => {
53+
props.onEnter?.(false)
54+
}
55+
})
56+
}) as const

0 commit comments

Comments
 (0)