Commit Graph

4 Commits

Author SHA1 Message Date
Claude Bot
aa5ea829a2 feat(repl): add shell command support and fix async event loop handling
- Add $`command` syntax for running shell commands in REPL
- Transform $`...` to await Bun.$`...` for shell execution
- Fix event loop handling for async operations by calling autoTick()
- Now properly awaits Bun.sleep(), setTimeout(), and Bun.$ operations
- Add tests for shell commands and Bun.sleep

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 22:11:14 +00:00
Claude Bot
261f429fd1 feat(repl): add JSC-based autocomplete for object properties
The REPL now provides intelligent autocomplete for object properties
by dynamically querying the JSC runtime. When typing `obj.` and pressing
Tab, the REPL will show available properties from the actual object.

Features:
- Property completion for any object (e.g., `Bun.`, `console.`)
- Navigates nested paths (e.g., `Bun.file.`)
- Includes both own properties and prototype chain

Also adds tests for class persistence and destructuring to verify
the full AST transforms work correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 20:44:24 +00:00
Claude Bot
73cd4e92bb feat(repl): integrate full transpiler with replMode for AST transforms
This replaces the simple string-based let/const->var transform with
Bun's full transpiler in replMode, enabling:

- Proper hoisting of let/const/var/function/class declarations
- Top-level await support via async IIFE wrapping
- Result capture in { value: expr } wrapper
- Object literal disambiguation (wrapping { } in parens)
- Class and function declarations that persist across lines

The REPL now properly awaits promises by running the event loop
until they resolve, allowing `await Promise.resolve(42)` to work.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 20:28:02 +00:00
Claude Bot
e6f08624b1 test(repl): add comprehensive tests for bun repl
Add tests covering:
- Basic expression evaluation
- Bun globals availability
- Variable persistence (let, const, function)
- REPL commands (.help, .timing)
- Error handling
- Object and array display
- Multi-statement lines

Note: Top-level await test is skipped until the full REPL transforms
are integrated, which will wrap code containing await in an async IIFE.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 18:40:35 +00:00