$ show JXA-userland/JXA
This repository provides a toolkit for developing JavaScript for Automation (JXA) scripts on macOS using TypeScript. It includes packages for running JXA code from Node.js (@jxa/run), an interactive REPL (@jxa/repl), type definitions for macOS applications (@jxa/types and @jxa/global-type), and a tool to generate TypeScript definitions from Apple's SDEF files (@jxa/sdef-to-dts). The monorepo structure (managed by Lerna) separates concerns into focused packages, enabling type-safe and efficient automation of macOS applications.
The LLM identified 2 files worth highlighting for reuse:
Provides a function to execute JXA code via osascript and return the result as a Promise. Handles errors and encapsulates the complexity of interacting with macOS scripting infrastructure, making it reusable in any Node.js project requiring JXA execution.
Converts macOS SDEF (Scripting Definition) XML files to TypeScript declaration files. Parses the XML, converts to an intermediate JSON schema, and uses json-schema-to-typescript to generate accurate type definitions. This automates the creation of up-to-date type definitions for macOS applications, reducing manual effort and ensuring consistency.