Skip to content

Commit 55c54d1

Browse files
authored
chore: use native runtime conditions in development (anomalyco#46644)
1 parent 2da5a4b commit 55c54d1

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Caveats:
157157
- If `spawn` does not work for you, you can debug the server separately:
158158
- Debug server: `bun run --inspect=ws://localhost:6499/ --cwd packages/opencode ./src/index.ts serve --port 4096`,
159159
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`
161161

162162
Other tips and tricks:
163163

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"type": "module",
77
"packageManager": "[email protected]",
88
"scripts": {
9-
"dev": "bun run --cwd packages/opencode --conditions=browser src/index.ts",
9+
"dev": "bun run --cwd packages/opencode src/index.ts",
1010
"dev:desktop": "bun --cwd packages/desktop dev",
1111
"dev:web": "bun --cwd packages/app dev",
1212
"dev:console": "ulimit -n 10240 2>/dev/null; bun run --cwd packages/console/app dev",

‎packages/app/AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
- `opencode dev web` proxies `https://app.opencode.ai`, so local UI/CSS changes will not show there.
1313
- 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`
1515
- App (from `packages/app`): `bun dev -- --port 4444`
1616
- Open `http://localhost:4444` to verify UI changes (it targets the backend at `http://localhost:4096`).
1717

‎packages/opencode/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"bench:test": "bun run script/bench-test-suite.ts",
1313
"profile:test": "bun run script/profile-test-files.ts",
1414
"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"
1717
},
1818
"bin": {
1919
"opencode": "./bin/opencode"

‎packages/opencode/test/lib/cli-process.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export function withCliFixture<A, E>(
211211
// on `Bun.stdin.text()` (see src/cli/cmd/run.ts — non-TTY stdin is
212212
// consumed as the prompt). The old Process.run wrapper defaulted to
213213
// 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], {
215215
cwd: home,
216216
env: { ...env, ...opts?.env },
217217
extendEnv: true,
@@ -283,7 +283,7 @@ export function withCliFixture<A, E>(
283283
const options = runOpts(opts)
284284
const proc = yield* Effect.acquireRelease(
285285
Effect.sync(() =>
286-
Bun.spawn(["bun", "run", "--conditions=browser", cliEntry, ...runArgs(message, opts)], {
286+
Bun.spawn(["bun", "run", cliEntry, ...runArgs(message, opts)], {
287287
cwd: home,
288288
env: { ...process.env, ...env, ...options?.env },
289289
stdin: "ignore",
@@ -324,7 +324,7 @@ export function withCliFixture<A, E>(
324324
// as a finalizer error during test teardown.
325325
const proc = yield* Effect.acquireRelease(
326326
Effect.sync(() =>
327-
Bun.spawn(["bun", "run", "--conditions=browser", cliEntry, ...argv], {
327+
Bun.spawn(["bun", "run", cliEntry, ...argv], {
328328
cwd: home,
329329
env: { ...process.env, ...env, ...opts?.env },
330330
stdout: "pipe",
@@ -395,7 +395,7 @@ export function withCliFixture<A, E>(
395395
// Either way we await proc.exited so the test scope doesn't leak.
396396
const proc = yield* Effect.acquireRelease(
397397
Effect.sync(() =>
398-
Bun.spawn(["bun", "run", "--conditions=browser", cliEntry, ...argv], {
398+
Bun.spawn(["bun", "run", cliEntry, ...argv], {
399399
cwd: opts?.cwd ?? home,
400400
env: { ...process.env, ...env, ...opts?.env },
401401
stdin: "pipe",

0 commit comments

Comments
 (0)