lang-firestore
v0.1.0
Published
Firestore query language basic support for the CodeMirror code editor
Maintainers
Readme
Install
npm install lang-firestoreUsage
import { 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")!,
});Features
- 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
Contributing
PRs welcome. Run tests and build locally:
npm i
npm run test
npm run buildSponsor
If you find this useful, consider sponsoring: github.com/sponsors/omar-dulaimi
License
MIT
