3.1.6 • Published 2 years ago

@rontav/firebase-bolt-compiler v3.1.6

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

Firebase Bolt Compiler

CircleCI npm

Compiles Firebase Bolt files to TypeScript, Flow, and more.

This package is a rewrite of firebase-bolt-transpiler in TypeScript. It uses the same AST types from the original firebase-bolt package providing more safety and flexibility to generate different code artifacts.

Installation

yarn install firebase-bolt-compiler

Usage

To generate TypeScript:

firebase-bolt-compiler < rules.bolt

To generate Flow:

firebase-bolt-compiler --flow < rules.bolt

Example

Using the following rules.bolt file as an input:

path /users/{uid} is Users {
  read() { true }
  write() { isCurrentUser(uid) }
}

type Users extends User[] {}

type User {
  firstName: String;
  lastName: String;
}

Will generate the TypeScript code below:

export const P_users = ['users'] as const;

export type T_Users = { [key: string]: T_User };

export interface T_User {
    firstName: string;
    lastName: string;
}

export interface dbPaths {
    users?: Record<string, T_Users>
}
3.1.6

2 years ago

3.1.5

2 years ago

3.1.3

3 years ago

3.1.2

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.1.4

3 years ago

3.0.0

3 years ago

2.0.2

3 years ago