0.1.0 • Published 3 years ago

@macaron-app/tools v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

The Macaron compiler library and command-line interface

Macaron is a visual React component editor, which is now in beta testing.

This library / CLI is the compiler that converts Macaron files to React components.

Installation

$ npm install -g @macaron-app/tools

Usage

Compile Macaron files to React components

$ macaron compile src/*.macaron
# => generates src/*.macaron.js

Help

$ macaron help

API

import { compileFile, compilePage } from "@macaron-app/tools";

compileFile("src/components.macaron");

const contents = fs.readFileSync("src/components.macaron", "utf8");
const json = JSON.parse(contents) as unknown;
compilePage(json); // => { ".macaron.js": ..., ".macaron.d.ts": ... }