prometheus/web/ui/module/lezer-promql
Bryan Boreham a6947a0369
Merge 3.1 into main (#15775)
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2025-01-03 14:28:51 +00:00
..
src v2.55.0 2024-10-25 14:16:22 +02:00
test adapt the lezer grammar and codemirror autocompletion with duration and number that are equivalent (#14417) 2024-07-31 15:31:42 +02:00
.gitignore enable ui module publication (#10876) 2022-06-30 12:10:10 +02:00
.npmignore enable ui module publication (#10876) 2022-06-30 12:10:10 +02:00
build.sh
generate-types.sh
jest.config.cjs
package.json Merge 3.1 into main (#15775) 2025-01-03 14:28:51 +00:00
README.md Add readme for lezer-promql and update codemirror-promql readme (#10875) 2022-06-22 16:57:03 +02:00
rollup.config.js

lezer-promql

Overview

This is a PromQL grammar for the lezer parser system. It is inspired by the initial grammar coming from Prometheus written in yacc.

This library is stable but doesn't provide any guideline of how to use it as it has been integrated into codemirror-promql. If you want to use this library, you perhaps want to actually use @prometheus-io/codemirror-promql instead.

Note: This library is a lezer-based implementation of the authoritative, goyacc-based PromQL grammar. Any changes to the authoritative grammar need to be reflected in this package as well.

Installation

This package is available as an npm package:

npm install --save @prometheus-io/lezer-promql

Note: you will have to manually install the lezer dependencies as it is a peer dependency to this package.

npm install --save @lezer/lr @lezer/highlight

Development

Building

npm i
npm run build

Testing

npm run test

License

The code is licensed under an Apache 2.0 license.