Firebase Bolt Transpiler
raw JSON → 0.1.0 verified Fri May 01 auth: no javascript abandoned
Transpile Firebase Bolt type definitions to TypeScript interfaces. Current version 0.1.0, experimental. No active maintenance. Converts Bolt schemas like 'type Person { name: String }' to TypeScript interfaces. Limited by Bolt compiler's handling of arrays and inheritance. Alternatives: write TypeScript manually.
Common errors
error TypeError: boltTranspiler.typescript is not a function ↓
cause Package not installed correctly or imported with wrong case.
fix
Ensure package is installed: npm install firebase-bolt-transpiler. Use: const boltTranspiler = require('boltTranspiler');
error Cannot find module 'boltTranspiler' ↓
cause Import path is wrong; package name is 'firebase-bolt-transpiler' not 'boltTranspiler'.
fix
Install correct package: npm install firebase-bolt-transpiler, then: const boltTranspiler = require('firebase-bolt-transpiler');
error boltTranspiler.dart is not a function ↓
cause No Dart support exists; only TypeScript, Swift, Java stubs.
fix
Use only typescript() method; ignore dart(), java(), swift() stubs.
Warnings
breaking Array types (e.g. Object[]) are not translated to arrays; they become Map<String, Object> generics. ↓
fix Manually edit the generated TypeScript to use actual arrays.
breaking ExtendedObject extends Object {} does not produce 'extends Object' in output; Bolt compiler marks everything as derived from Object. ↓
fix Remove 'extends Object' from input Bolt code.
gotcha Package is abandoned; no releases or updates since 2016. ↓
fix Avoid using this package; use alternative tools or write TypeScript manually.
gotcha Swift and Java transpilation methods are documented but not implemented. ↓
fix Do not rely on swift() or java() methods; they return undefined.
Install
npm install firebase-bolt-transpiler yarn add firebase-bolt-transpiler pnpm add firebase-bolt-transpiler Imports
- boltTranspiler wrong
import boltTranspiler from 'boltTranspiler';correctconst boltTranspiler = require('boltTranspiler'); - typescript wrong
boltTranspiler.TypeScript('type Person { name: String }')correctboltTranspiler.typescript('type Person { name: String }') - swift wrong
boltTranspiler.Swift('type Person { name: String }')correctboltTranspiler.swift('type Person { name: String }')
Quickstart
const boltTranspiler = require('boltTranspiler');
const boltCode = `type Person {
name: String
age: Number
address: String?
}`;
const tsOutput = boltTranspiler.typescript(boltCode);
console.log(tsOutput);
// Output:
// interface Person {
// name: string;
// age: number;
// address?: string;
// }