Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

Perry is a native TypeScript compiler written in Rust that compiles TypeScript source code directly to native executables. It uses SWC for TypeScript parsing and LLVM for code generation.

**Current Version:** 0.5.142
**Current Version:** 0.5.143

## TypeScript Parity Status

Expand Down Expand Up @@ -149,6 +149,7 @@ First-resolved directory cached in `compile_package_dirs`; subsequent imports re

Keep entries to 1-2 lines max. Full details in CHANGELOG.md.

- **v0.5.143** — New `perry dev <entry.ts>` subcommand (V1 watch mode, PR #126 by @TheHypnoo). Watches the nearest project root (package.json/perry.toml, falls back to entry dir) recursively via the `notify` crate, debounces 300ms, recompiles on any `.ts|.tsx|.mts|.cts|.json|.toml` change, kills the running child, and relaunches the fresh binary. Ignores `node_modules`, `target`, `.git`, `dist`, `build`, `.perry-dev`. Output defaults to `.perry-dev/<stem>`. Args after `--` forward to the child (`perry dev src/main.ts -- --port 3000`). Smoke-tested: initial build ~15s (cold auto-optimize), post-edit rebuild ~330ms (hot libs cached). 8 unit tests cover the pure helpers (`is_trigger_path`, `is_relevant`, `find_project_root`); `tempfile` added as dev-dep. Docs added to `docs/src/cli/commands.md` on merge. V2 follow-ups planned: in-memory AST cache + per-module `.o` reuse for incremental compilation.
- **v0.5.142** — Make `stdlib/fs/roundtrip.ts` cross-platform. v0.5.140 introduced the example with a hardcoded `/tmp/perry_fs_demo.txt` path, which has no equivalent on Windows; the Windows doc-tests run correctly wrote to `C:\Users\…\tmp\…` (or wherever write fell back to) but the subsequent `readFileSync(path, "utf-8")` returned empty because the file wasn't at `/tmp`, so `roundtrip ok: false`. Switched the example to `os.tmpdir() + path.join`, re-blessed the expected stdout (dropped the absolute path from the "wrote N bytes" line since it varies per OS). Also removes the same bug if the example is ever run on a Windows dev box.
- **v0.5.142** — Fix async arrow / closure return values (closes #125). `compile_closure` (`crates/perry-codegen/src/codegen.rs:1657, 1818`) had been dropping the `is_async` flag from `Expr::Closure` — the FnCtx was always constructed with `is_async_fn: false`, so `Stmt::Return` inside an async arrow never wrapped its value in `js_promise_resolved`. Consumers that rely on the closure returning a real Promise pointer (Fastify's server runtime inspects handler results with `js_is_promise` → `js_promise_value`) got back a raw NaN-boxed object pointer, treated it as a Promise, and read the object's field memory as `Promise.value` — surfacing as a gibberish decimal (a raw heap address reinterpreted as f64) in the HTTP response body. Threaded `is_async` through the destructure, set `is_async_fn: is_async`, and wrapped the no-explicit-return fallback too. Also stripped ~10 stale debug `eprintln!`s from `crates/perry-stdlib/src/fastify/context.rs` + `app.rs` (including a hardcoded "email" field probe that was spamming unrelated output on every JSON body parse). Side effect: gap suite jumped from 14/28 @ 117 diffs to 22/28 @ 29 diffs since async closures are load-bearing across test_gap_class_advanced/node_*/typeof_instanceof/etc.
- **v0.5.141** — Two follow-ups from the v0.5.140 CI run: (1) Ubuntu `ui/styling/counter_card.ts` hit `undefined reference to perry_ui_widget_set_border_color` / `_set_border_width` — same pattern as v0.5.136's `buttonSetContentTintColor` (declared in perry's dispatch table, not exported by perry-ui-gtk4 because GTK4 borders are CSS-driven). Dropped the two calls from the example, documented inline. (2) Windows `cargo build -p perry-ui-windows` hit `E0505: cannot move out of out because it is borrowed` in `encode_png_rgba` — the early-return-on-header-error kept `encoder`'s borrow of `out` alive across the `return`. Restructured to commit the encoder's success/failure to a local `bool` and clear `out` after the borrow ends.
Expand Down
136 changes: 109 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ opt-level = "s" # Optimize for size in stdlib
opt-level = 3

[workspace.package]
version = "0.5.142"
version = "0.5.143"
edition = "2021"
license = "MIT"
repository = "https://github.com/PerryTS/perry"
Expand Down
Loading
Loading