Registry / database / fireway

fireway

JSON →
library1.1.0jsnpmunverified

Schema migration tool for Firestore inspired by Flyway. Current stable version is 1.1.0 (released 2020). It uses semver-based file naming and stores migration state in a Firestore collection. Unlike Firestore-backed tools that require manual timestamp tracking, Fireway automates migration ordering and failure detection. It supports JavaScript and TypeScript migrations, including JSDoc-based typings. CLI-based with dry-run and forced async support. Releases are infrequent, indicating project stability.

npm install fireway
INSTALL
IMPORT
SIG · FIREWAY
F
fireway
databasejavascriptv1.1.0
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.

MigrateOptions
import { MigrateOptions } from 'fireway'
const MigrateOptions = require('fireway').MigrateOptions
Type export; requires TypeScript 3.8+ for type-only import. Use import type { MigrateOptions } for tree-shaking.
migrate function signature
export async function migrate({firestore}: MigrateOptions) { ... }
module.exports = async function migrate({firestore}) { ... }
In TypeScript migration files, prefer named export. For JavaScript, module.exports.migrate is correct.
fireway CLI
npx fireway migrate --projectId=my-project
require('fireway').migrate()
Fireway is primarily a CLI tool, not meant to be imported programmatically. Use npx or global install.

Demonstrates creating a simple migration file and running it via CLI using Firebase project ID or emulator.

// Create migration file: ./migrations/v1.0.0__initial.js module.exports.migrate = async ({firestore, FieldValue}) => { await firestore.collection('users').add({ name: 'Alice', createdAt: FieldValue.serverTimestamp() }); }; // Run: npx fireway migrate --projectId=my-firebase-project // Or for emulator: export FIRESTORE_EMULATOR_HOST=localhost:8080 && npx fireway migrate
Debug
Known issues
gotchaIf a migration fails, subsequent migrations are blocked until the failed migration record is manually removed or the database is restored.
fix
Delete the document in the 'fireway' collection corresponding to the failed migration, then fix the migration and re-run.
affects: >=0.0.0
deprecatedThe package does not have version 2.x yet, but v1.x may be considered stable with low maintenance.
fix
Monitor GitHub for updates; consider pinning version if stability is needed.
affects: 1.1.0
gotchaFireway requires @google-cloud/firestore as a peer dependency; if not installed, migrations will fail.
fix
Ensure @google-cloud/firestore is installed: npm install @google-cloud/firestore
affects: >=0.0.0
gotchaWhen using TypeScript, ts-node must be configured with module: 'commonjs' in tsconfig.json.
fix
Add 'ts-node': { 'compilerOptions': { 'module': 'commonjs' } } to tsconfig.json.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module '@google-cloud/firestore'
Missing peer dependency @google-cloud/firestore
fix
npm install @google-cloud/firestore
Migration failed: Cannot find module 'ts-node/register'
ts-node not installed or not configured
fix
npm install --save-dev ts-node && ensure tsconfig.json has 'ts-node' block with module: 'commonjs'
Error: 3 INVALID_ARGUMENT: Project id is required to access Firestore
Missing --projectId and no FIRESTORE_EMULATOR_HOST set
fix
Provide --projectId option or set FIRESTORE_EMULATOR_HOST environment variable to use local emulator
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies
@google-cloud/firestoreoptionalFireway uses the Firestore client internally to apply migrations and store state
ts-nodeoptionalRequired for TypeScript migration files
Agent activity
5 hits · last 30 days
node
4
Resources
fireway — npm install fireway · libregistry