@lona/compiler v0.2.1
Lona Compiler
The Lona Compiler is a CLI tool for generating cross-platform UI code from JSON definitions.
The Lona Compiler is published on npm as @lona/compiler.
Usage
Installation
First, install the compiler with:
npm install --global @lona/compilerYou may also install locally to your current project if you prefer, by removing the --global.
Commands
For each command, you'll choose a code generation format: swift, js, tokens, or documentation.
Each format as a specific set of options.
In the case of js, the --framework option can have a few values:
reactnative: React Native (default)reactdom: React DOMreactsketchapp: React SketchApp
Generate workspace
This will generate the colors, text styles, shadows, custom types, and all components, writing them to output-directory in the same structure as the input workspace directory.
lona convert [path-to-workspace-directory] --format=js --output=[output-directory]Contributing
To build the compiler from source, follow these steps.
This project is written in TypeScript.
Setup: Install dependencies with yarn
From this directory, run:
yarnNote: If you don't have yarn installed already, you can download it with npm:
npm install --global yarn
Running commands
The above examples can now be run by replacing lona with ts-node src/bin.ts.