GeezerVison is showing github.com — chore: use native runtime conditions in development (#46644) · chid/opencode@55c54d1
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: CONTRIBUTING.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -157,7 +157,7 @@ Caveats: | 157 | 157 | - If `spawn` does not work for you, you can debug the server separately: | 158 | 158 | - Debug server: `bun run --inspect=ws://localhost:6499/ --cwd packages/opencode ./src/index.ts serve --port 4096`, | 159 | 159 | then attach TUI with `opencode attach http://localhost:4096` | 160 | | - - Debug TUI: `bun run --inspect=ws://localhost:6499/ --cwd packages/opencode --conditions=browser ./src/index.ts` | | 160 | + - Debug TUI: `bun run --inspect=ws://localhost:6499/ --cwd packages/opencode ./src/index.ts` | 161 | 161 |
| 162 | 162 | Other tips and tricks: | 163 | 163 |
| |
Collapse file Copy file name to clipboardExpand all lines: package.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 6 | 6 | "type": "module", | 7 | 7 | | 8 | 8 | "scripts": { | 9 | | - "dev": "bun run --cwd packages/opencode --conditions=browser src/index.ts", | | 9 | + "dev": "bun run --cwd packages/opencode src/index.ts", | 10 | 10 | "dev:desktop": "bun --cwd packages/desktop dev", | 11 | 11 | "dev:web": "bun --cwd packages/app dev", | 12 | 12 | "dev:console": "ulimit -n 10240 2>/dev/null; bun run --cwd packages/console/app dev", | |
Collapse file Copy file name to clipboardExpand all lines: packages/app/AGENTS.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 11 | 11 |
| 12 | 12 | - `opencode dev web` proxies `https://app.opencode.ai`, so local UI/CSS changes will not show there. | 13 | 13 | - For local UI changes, run the backend and app dev servers separately. | 14 | | -- Backend (from `packages/opencode`): `bun run --conditions=browser ./src/index.ts serve --port 4096` | | 14 | +- Backend (from `packages/opencode`): `bun run ./src/index.ts serve --port 4096` | 15 | 15 | - App (from `packages/app`): `bun dev -- --port 4444` | 16 | 16 | - Open `http://localhost:4444` to verify UI changes (it targets the backend at `http://localhost:4096`). | 17 | 17 |
| |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/package.json +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 12 | 12 | "bench:test": "bun run script/bench-test-suite.ts", | 13 | 13 | "profile:test": "bun run script/profile-test-files.ts", | 14 | 14 | "build": "bun run script/build.ts", | 15 | | - "dev": "bun run --conditions=browser ./src/index.ts", | 16 | | - "dev:temporary": "bun run --conditions=browser ./src/temporary.ts" | | 15 | + "dev": "bun run ./src/index.ts", | | 16 | + "dev:temporary": "bun run ./src/temporary.ts" | 17 | 17 | }, | 18 | 18 | "bin": { | 19 | 19 | "opencode": "./bin/opencode" | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/test/lib/cli-process.ts +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -211,7 +211,7 @@ export function withCliFixture<A, E>( | 211 | 211 | // on `Bun.stdin.text()` (see src/cli/cmd/run.ts — non-TTY stdin is | 212 | 212 | // consumed as the prompt). The old Process.run wrapper defaulted to | 213 | 213 | // ignore; ChildProcess.make defaults to pipe, so we set it explicitly. | 214 | | - const command = ChildProcess.make("bun", ["run", "--conditions=browser", cliEntry, ...args], { | | 214 | + const command = ChildProcess.make("bun", ["run", cliEntry, ...args], { | 215 | 215 | cwd: home, | 216 | 216 | env: { ...env, ...opts?.env }, | 217 | 217 | extendEnv: true, | @@ -283,7 +283,7 @@ export function withCliFixture<A, E>( | 283 | 283 | const options = runOpts(opts) | 284 | 284 | const proc = yield* Effect.acquireRelease( | 285 | 285 | Effect.sync(() => | 286 | | - Bun.spawn(["bun", "run", "--conditions=browser", cliEntry, ...runArgs(message, opts)], { | | 286 | + Bun.spawn(["bun", "run", cliEntry, ...runArgs(message, opts)], { | 287 | 287 | cwd: home, | 288 | 288 | env: { ...process.env, ...env, ...options?.env }, | 289 | 289 | stdin: "ignore", | @@ -324,7 +324,7 @@ export function withCliFixture<A, E>( | 324 | 324 | // as a finalizer error during test teardown. | 325 | 325 | const proc = yield* Effect.acquireRelease( | 326 | 326 | Effect.sync(() => | 327 | | - Bun.spawn(["bun", "run", "--conditions=browser", cliEntry, ...argv], { | | 327 | + Bun.spawn(["bun", "run", cliEntry, ...argv], { | 328 | 328 | cwd: home, | 329 | 329 | env: { ...process.env, ...env, ...opts?.env }, | 330 | 330 | stdout: "pipe", | @@ -395,7 +395,7 @@ export function withCliFixture<A, E>( | 395 | 395 | // Either way we await proc.exited so the test scope doesn't leak. | 396 | 396 | const proc = yield* Effect.acquireRelease( | 397 | 397 | Effect.sync(() => | 398 | | - Bun.spawn(["bun", "run", "--conditions=browser", cliEntry, ...argv], { | | 398 | + Bun.spawn(["bun", "run", cliEntry, ...argv], { | 399 | 399 | cwd: opts?.cwd ?? home, | 400 | 400 | env: { ...process.env, ...env, ...opts?.env }, | 401 | 401 | stdin: "pipe", | |
|