@kbn/query
KQL is transformed to ElasticSearch Query by the es-query
module used in
kibana
v8.9.0. but no such package in npm or other registries. So create
this repo to build them from the source code.
it includes 3 steps:
- build the package from
elastic/kibana
source code - copy only
es-query
and packages it depends on to this repo - setup necessary config, e.g., the main entry
elastic/kibana
source code
build from - download kibana source code, repo https://github.com/elastic/kibana
- build, run
yarn kbn bootstrap
andyarn build
update
src/dev/build/build_distributables.ts
to stop beforeif (options.createPlatformFolders)
with athrow
statement, otherwise the sub packages will be removed by later tasks.
Now we got all the sub packages transformed/compiled in folder
build/kibana/node_modules/@kbn
, and all we need is the below 2 packages:
-
es-query
and -
i18n
- used byes-query
config this repo
-
install deps used by the above 2 packages:
- lodash
- moment
- moment-timezone
- intl-format-cache@2.1.0, please use the exact version as in 'elastic/kibana' package.json
- intl-messageformat@2.2.0
- intl-relativeformat@2.1.0
-
copy the 2 packages to
deps
, and add it toNODE_PATH
env variable withcross-env
before running command. -
re-export it