Registry / gcp / firebase-bolt-compiler

firebase-bolt-compiler

JSON →
library1.2.9jsnpmunverified

Compiles Firebase Bolt schema definitions (from firebase-bolt) into TypeScript interfaces, Flow types, and other code artifacts. Current stable version is 1.2.9, last released in September 2017. This package is a TypeScript rewrite of firebase-bolt-transpiler, using the same AST types as the original firebase-bolt package. It is primarily a CLI tool that reads .bolt files and outputs TypeScript or Flow type definitions. Key differentiators: generates path helper functions (since v1.2.0), handles null explicitly, and provides stricter typing compared to the original transpiler. No active development since 2017.

npm install firebase-bolt-compiler
INSTALL
IMPORT
SIG · FIREBASE-BOLT-COMP
F
firebase-bolt-compiler
gcpjavascriptv1.2.9
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

compile
import { compile } from 'firebase-bolt-compiler';
const compile = require('firebase-bolt-compiler').compile;
Package exports a compile function but primary use is via CLI. Use the named import for programmatic usage.
default
import pkg from 'firebase-bolt-compiler';
import { default } from 'firebase-bolt-compiler';
No default export; use named exports only.
generateTypeScript
import { generateTypeScript } from 'firebase-bolt-compiler';
const { generateTypeScript } = require('firebase-bolt-compiler');
The public API includes generateTypeScript, generateFlow, etc. See source for full list.

Compiles a Bolt schema string to TypeScript interfaces using the programmatic API.

// install: yarn add firebase-bolt-compiler firebase-bolt import { readFileSync } from 'fs'; import { compile, generateTypeScript } from 'firebase-bolt-compiler'; const boltContent = ` path /users/{uid} is Users { read() { true } write() { isCurrentUser(uid) } } type Users extends User[] {} type User { firstName: String; lastName: String; } `; const ast = compile(boltContent); const tsOutput = generateTypeScript(ast); console.log(tsOutput); // Outputs: // type Users = { [key: string]: User }; // export interface User { // firstName: string; // lastName: string; // }
bolt --version
Debug
Known issues
deprecatedPackage has not been updated since 2017 and may not work with newer Firebase products (Firestore, etc.).
fix
Consider migrating to Firebase's official Security Rules tools or use firebase-bolt directly.
affects: >=1.2.0
gotchaThe compile function expects the full Bolt source, not just a file path. It does not handle file I/O; the CLI does that.
fix
Read the file contents separately before passing to compile().
affects: >=1.0.0
breakingBefore v1.2.0, TypeScript generation did not include path helper functions. Code relying on path helpers may break if upgrading from <1.2.0.
fix
Upgrade to v1.2.0+ and update generated type imports to include path functions.
affects: <1.2.0
gotchaThe CLI output goes to stdout; there is no --output flag. Redirect to file manually.
fix
Use shell redirection: firebase-bolt-compiler < input.bolt > output.ts
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: compile is not a function
Using default import when the package only exports named exports.
fix
Use named import: import { compile } from 'firebase-bolt-compiler';
Cannot find module 'firebase-bolt'
Missing peer dependency firebase-bolt.
fix
Install firebase-bolt: npm install firebase-bolt
firebase-bolt-compiler: command not found
Global installation missing or not in PATH.
fix
Install globally: npm install -g firebase-bolt-compiler, or use npx: npx firebase-bolt-compiler
Error: Could not parse bolt file: Unexpected token
Invalid Bolt syntax in input file.
fix
Validate the .bolt file using firebase-bolt's validator or check the Bolt language specification.
Upgrade
Version history
1.2.9latest on npm
Audit
Dependencies
firebase-boltrequiredUses the same AST types from firebase-bolt for parsing .bolt files
Agent activity
46 hits · last 30 days
node
37
OpenAI (training)
2
Bingbot
1
Resources
firebase-bolt-compiler — npm install firebase-bolt-compiler · libregistry