Skip to content

Setup @elastic/esql-parser package with ES|QL and PromQL parsers - #232

Merged
vadimkibana merged 14 commits into
mainfrom
parser-package-3
Aug 25, 2026
Merged

Setup @elastic/esql-parser package with ES|QL and PromQL parsers#232
vadimkibana merged 14 commits into
mainfrom
parser-package-3

Conversation

@vadimkibana

@vadimkibana vadimkibana commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Moves ES|QL and PromQL CST-to-AST converters to @elastic/esql-parser.
  • The parser is still re-exported from @elastic/esql — so there is no breaking change.
  • Moves tests into their correct locations.
  • Adds some missing tests.

Details

Technical details, breaking changes or considerations you have made while working in this PR.

Checklist

  • Unit tests have been added or updated.
  • The proper documentation has been added or updated.
  • A changeset has been added (yarn changeset) if this change should be released. See docs/RELEASE.md.
  • If this PR contains breaking changes, you have explained them using the BREAKING CHANGE: change syntax and selected a major bump in the changeset.
  • The PR is opened as a draft until CI is green.

@vadimkibana vadimkibana changed the title Parser package 3 Setup @elastic/esql-parser package with ES|QL and PromQL parsers Aug 21, 2026

@bartoval bartoval left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍​

@vadimkibana
vadimkibana merged commit bbf69c0 into main Aug 25, 2026
2 checks passed
@vadimkibana
vadimkibana deleted the parser-package-3 branch August 25, 2026 10:16
@github-actions github-actions Bot mentioned this pull request Aug 25, 2026
vadimkibana added a commit that referenced this pull request Aug 28, 2026
Resolves conflicts between the AST unboxing work and origin/main's
independent landing of the esql-parser package (#232) and DENSE_VECTOR
command support (#234). Unboxing wins everywhere both sides touched the
same lines; main's DENSE_VECTOR additions come in unchanged (already
boxing-free).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
stratoula pushed a commit that referenced this pull request Aug 31, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @elastic/esql-parser@4.22.0

### Minor Changes

- [#232](#232)
[`bbf69c0`](bbf69c0)
Thanks [@vadimkibana](https://github.com/vadimkibana)! - Extract the
parser and the AST visitor out of `@elastic/esql` into the packages that
own them.

`@elastic/esql-parser` now holds the ES|QL parser (`parse`, `Parser`,
`ParseOptions`, `ParseResult`, `ESQLErrorListener`), the PromQL parser
(`PromQLParser`, `PromQLErrorListener`, `PromQLCstToAstConverter`), the
ANTLR token helpers (`getPosition`, `findTokens`, `findFirstToken`,
`findVisibleToken`, `findPunctuationToken`, `isLikelyPunctuation`), and
the parser constants (`DEFAULT_CHANNEL`, `HIDDEN_CHANNEL`,
`HEADER_COMMANDS`, `SOURCE_COMMANDS`). It also declares the runtime
dependencies it needs (`antlr4`, `@elastic/esql-ast`,
`@elastic/esql-definitions`, `@elastic/esql-promql-grammar`,
`@elastic/esql-traversal`, `@elastic/esql-types`); previously it
declared none, so its CommonJS build inlined the ANTLR runtime and
failed to load under `require`.

`@elastic/esql-traversal` now holds the AST `Visitor` together with its
visitor contexts, and `printAst`.

`@elastic/esql` re-exports all of the above, so its public API is
unchanged.

- [#234](#234)
[`2e9ed09`](2e9ed09)
Thanks [@vadimkibana](https://github.com/vadimkibana)! - Add
`DENSE_VECTOR` command parsing and traversal support

### Patch Changes

- Updated dependencies
[[`bbf69c0`](bbf69c0),
[`2e9ed09`](2e9ed09)]:
  - @elastic/esql-traversal@4.22.0
  - @elastic/esql-types@4.22.0
  - @elastic/esql-definitions@4.22.0
  - @elastic/esql-promql-grammar@4.22.0
  - @elastic/esql-ast@4.22.0
## @elastic/esql-traversal@4.22.0

### Minor Changes

- [#232](#232)
[`bbf69c0`](bbf69c0)
Thanks [@vadimkibana](https://github.com/vadimkibana)! - Extract the
parser and the AST visitor out of `@elastic/esql` into the packages that
own them.

`@elastic/esql-parser` now holds the ES|QL parser (`parse`, `Parser`,
`ParseOptions`, `ParseResult`, `ESQLErrorListener`), the PromQL parser
(`PromQLParser`, `PromQLErrorListener`, `PromQLCstToAstConverter`), the
ANTLR token helpers (`getPosition`, `findTokens`, `findFirstToken`,
`findVisibleToken`, `findPunctuationToken`, `isLikelyPunctuation`), and
the parser constants (`DEFAULT_CHANNEL`, `HIDDEN_CHANNEL`,
`HEADER_COMMANDS`, `SOURCE_COMMANDS`). It also declares the runtime
dependencies it needs (`antlr4`, `@elastic/esql-ast`,
`@elastic/esql-definitions`, `@elastic/esql-promql-grammar`,
`@elastic/esql-traversal`, `@elastic/esql-types`); previously it
declared none, so its CommonJS build inlined the ANTLR runtime and
failed to load under `require`.

`@elastic/esql-traversal` now holds the AST `Visitor` together with its
visitor contexts, and `printAst`.

`@elastic/esql` re-exports all of the above, so its public API is
unchanged.

- [#234](#234)
[`2e9ed09`](2e9ed09)
Thanks [@vadimkibana](https://github.com/vadimkibana)! - Add
`DENSE_VECTOR` command parsing and traversal support

### Patch Changes

- Updated dependencies
[[`2e9ed09`](2e9ed09)]:
  - @elastic/esql-types@4.22.0
  - @elastic/esql-ast@4.22.0
## @elastic/esql-types@4.22.0

### Minor Changes

- [#234](#234)
[`2e9ed09`](2e9ed09)
Thanks [@vadimkibana](https://github.com/vadimkibana)! - Add
`DENSE_VECTOR` command parsing and traversal support
## @elastic/esql@4.22.0

### Patch Changes

- [#232](#232)
[`bbf69c0`](bbf69c0)
Thanks [@vadimkibana](https://github.com/vadimkibana)! - Extract the
parser and the AST visitor out of `@elastic/esql` into the packages that
own them.

`@elastic/esql-parser` now holds the ES|QL parser (`parse`, `Parser`,
`ParseOptions`, `ParseResult`, `ESQLErrorListener`), the PromQL parser
(`PromQLParser`, `PromQLErrorListener`, `PromQLCstToAstConverter`), the
ANTLR token helpers (`getPosition`, `findTokens`, `findFirstToken`,
`findVisibleToken`, `findPunctuationToken`, `isLikelyPunctuation`), and
the parser constants (`DEFAULT_CHANNEL`, `HIDDEN_CHANNEL`,
`HEADER_COMMANDS`, `SOURCE_COMMANDS`). It also declares the runtime
dependencies it needs (`antlr4`, `@elastic/esql-ast`,
`@elastic/esql-definitions`, `@elastic/esql-promql-grammar`,
`@elastic/esql-traversal`, `@elastic/esql-types`); previously it
declared none, so its CommonJS build inlined the ANTLR runtime and
failed to load under `require`.

`@elastic/esql-traversal` now holds the AST `Visitor` together with its
visitor contexts, and `printAst`.

`@elastic/esql` re-exports all of the above, so its public API is
unchanged.

- Updated dependencies
[[`bbf69c0`](bbf69c0),
[`2e9ed09`](2e9ed09)]:
  - @elastic/esql-parser@4.22.0
  - @elastic/esql-traversal@4.22.0
  - @elastic/esql-types@4.22.0
  - @elastic/esql-definitions@4.22.0
  - @elastic/esql-grammar@4.22.0
  - @elastic/esql-promql-grammar@4.22.0
  - @elastic/pretty-printer@4.22.0
  - @elastic/esql-ast@4.22.0
## @elastic/esql-ast@4.22.0

### Patch Changes

- Updated dependencies
[[`2e9ed09`](2e9ed09)]:
  - @elastic/esql-types@4.22.0
  - @elastic/esql-definitions@4.22.0
  - @elastic/esql-grammar@4.22.0
  - @elastic/esql-promql-grammar@4.22.0
## @elastic/elasticsearch-esql-dsl@4.22.0

### Patch Changes

- Updated dependencies []:
  - @elastic/elasticsearch-query-builder@4.22.0
## @elastic/highlightjs-esql@4.22.0

### Patch Changes

- Updated dependencies []:
  - @elastic/esql-definitions@4.22.0
## @elastic/monaco-esql@4.22.0

### Patch Changes

- Updated dependencies []:
  - @elastic/esql-definitions@4.22.0
## @elastic/prismjs-esql@4.22.0

### Patch Changes

- Updated dependencies []:
  - @elastic/esql-definitions@4.22.0
## @elastic/textmate-esql@4.22.0

### Patch Changes

- Updated dependencies []:
  - @elastic/esql-definitions@4.22.0
## @elastic/esql-definitions@4.22.0


## @elastic/esql-grammar@4.22.0


## @elastic/esql-promql-grammar@4.22.0


## @elastic/pretty-printer@4.22.0


## @elastic/elasticsearch-query-builder@4.22.0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants