Skip to content

0.144.0

Choose a tag to compare

@github-actions github-actions released this 04 Sep 13:47
· 4 commits to master since this release
0.144.0
dd95686

Added

  • Lua os library support — the os library is now available in the Lua sandbox, providing access to date, time, and environment functions. Parity with Neovim: all functions available on desktop, nil on mobile. os.execute and os.exit are permanently blocked for security.
    • Plugin: src/lua/engine.ts (opened os library, added defense-in-depth blocks)

Changed

  • Fengari CJS-to-TypeScript-ESM conversion — all 37 fengari source files converted from CommonJS JavaScript to TypeScript ESM with full typing (strict: true). Broken circular dependencies between defs.ts/luaconf.ts and linit.ts/lualib.ts. Implemented a hybrid TValue type system with type predicates and narrowed accessors.
    • Plugin: src/lib/fengari/*.ts (37 files converted from .js CJS to .ts ESM)
    • Plugin: src/lib/fengari/index.ts (barrel rewritten — no as any casts)
    • Plugin: src/lib/fengari/platform.ts (was .js)
    • Plugin: src/lib/fengari/package.json (removed — CJS marker no longer needed)
    • Plugin: src/lib/fengari/DIFFERENCES.md (updated for TS conversion)
    • Plugin: src/lua/engine.ts (null check for luaL_newstate())
    • Plugin: vitest.config.ts (removed .test.js pattern)
    • Plugin: eslint.config.mts (removed all fengari-specific rule overrides — all suppressions now inline with descriptions)
    • Plugin: src/lib/fengari/lbaselib.ts (console.logconsole.warn for Lua print() fallback — dead code in plugin context, avoids community scanner no-console warning)
    • Plugin: src/lua/engine.ts (narrowed lua_atnativeerror handler string coercion)
  • Host-agnostic Lua runtime — replaced platform guards with a dependency injection pattern. Fengari no longer sniffs for Node.js or browser environments, instead using a provider injected by the plugin.
    • Plugin: src/lib/fengari/platform.ts (platform provider implementation)
    • Plugin: src/lua/engine.ts (injected Obsidian platform provider)

Tests

  • 23 unit tests in test/unit/fengari/ (6 fork-specific converted to typed TS, 17 upstream absorbed from fengari repo)
  • 13 unit tests in test/unit/lua/os-lib.test.ts for the os library

Documentation

  • CHANGELOG.md
  • AGENTS.md: updated fengari section — TypeScript ESM conversion, TValue type system, test organization
  • CONTRIBUTING.md: updated fengari directory description
  • KNOWN_LIMITATIONS.md: updated absorbed fengari references and links
  • docs/configuration/lua-config.md: updated absorbed fengari references

Full Changelog: 0.143.0...0.144.0