Firestore query language support for the CodeMirror editor.
npm install lang-firestoreimport { EditorState } from "@codemirror/state";
import { EditorView, basicSetup } from "codemirror";
import { firestore } from "lang-firestore";
new EditorView({
state: EditorState.create({
doc: 'db.collection("users").where("age", ">=", 21).get()',
extensions: [basicSetup, firestore()],
}),
parent: document.querySelector("#app")!,
});- Syntax highlighting for common Firestore query chains (db, collection, doc, where, orderBy, limit, pagination, mutations)
- Operator words:
in,not-in,array-contains,array-contains-any - Basic completions for Firestore API and operators
PRs welcome. Run tests and build locally:
npm i
npm run test
npm run buildIf you find this useful, consider sponsoring: github.com/sponsors/omar-dulaimi
MIT