* First stab at refactoring typeahead
* Don't double submit on enter
* Add item templating
* Introduce simple kuery language
* Rename to kql and add modules
* Update KQL syntax
* Automatically insert matching pairs
* Don't match quotes after alphanumeric chars
* Get field and value suggestions
* Remove accidental changes
* Remove unnecessary test
* Don't submit on enter
* Fix typeahead
* Suggest matching recent searches
* Suggest operators
* Suggest conjunctions
* Use template, separate suggestions into separate modules
* Whoops, add this module back
* Add clarifying comment
* Fix history log key
* Don't update suggestions on every key press
* Fix key handling
* Update terminology to be clearer
* Fix typo
* Simplify building of nodes
* Don't always hide on submit
* Check items exists
* Add icon directive which wraps EuiIcon.
* kql design start
* remove comment bits
* Simplify select next/prev and reset selected on hide/backspace
* Add test
* Put persistedLog on scope so it can be tested
* Fix typos
* Build up AST for sublist by returning functions that take a field name
* Remove single quoted strings and add double quote to special characters
* Build nodes with arg nodes instead of args themselves
* Add support for exact phrase search for quoted values
* Update typeahead items when language changes
* Finish that work I didn't do in the last commit
* This commit makes Bargs very happy cuz it does a lot
* Add wildcard field support to range query
* Remove range support for wildcard values
* Remove KQL as a separate language
Updates kuery to use KQL's grammar. This will lead to a smoother
transition for both us and Kuery users. We mainly added KQL as a
separate language so that we could notify Kuery users that the syntax
had changed. I realized we could do the same by trying to parse their
query strings with the old grammar if the new grammar fails, and if the
old grammar parses successfully we can display an error message with a
link to the docs describing the syntax changes. Since Kuery now uses the
more simple KQL syntax, I've also re-enabled the filter bar when Kuery
is selected.
* Fix typeahead behavior
* Update conjunctions
* Use scope apply
* Suggest conjunctions after ranges
* Support strings in wildcard node constructor and add tests for wildcard node
* test updates
* Removing unused serializeStyle and toKueryExpression, updating tests
* Fix functional test
* Fix typo
* Show fields that match in any part of the name
* Alter order of operators
* Preserve focus after selecting by click
* Ports tests for `fromKueryExpression` to `fromKqlExpression`
* More KQL syntax tests
* Suggest conjunctions after ranges
* Fix suggestions inside parens
* fromLiteralExpression tests
* remove serializeStyle arguments which no longer exist in the function definition
* tests for getFields
* Case insensitive search for field names
* update tests for is.js
* add wildcard fieldname test for range.js
* Fix removed div
* Fix line spacing for autocomplete suggestions
* Fix conjunction suggestions with escaped preceding literals
* Escape special characters in fields and values
* Don't suggest the value that's already selected
* Update icons
* Sort prefix first
* Simplify cursor detection and suggest booleans
* Use quotes for suggested values
* get rid of references to KQL
* Don't show errors from parsing
* That didn't even exist
* Use config to determine if values are suggested
* Update suggestions on home/end
* remove hack
* Update reference to kql
* Suggestions for quoted values
* Clean up grammar
* Better support for cursor inside spaces
* Create grunt task to generate parsers from peg files
* Simplify wildcard handling
* Don't filter out the exact fields/values
* Update parsing modules
* Fix peg task
* Make operator syntax more visible
* Update OR verbiage
* Simplify and improve match pairs
* Revert "Simplify wildcard handling"
This reverts commit
|
||
---|---|---|
.. | ||
eslint-config-kibana | ||
eslint-plugin-kibana-custom | ||
kbn-babel-preset | ||
kbn-datemath | ||
kbn-dev-utils | ||
kbn-es | ||
kbn-plugin-generator | ||
kbn-plugin-helpers | ||
kbn-pm | ||
kbn-test-subj-selector | ||
kbn-ui-framework | ||
README.md |
Kibana-related packages
This folder contains packages that are intended for use in Kibana and Kibana plugins.
tl;dr:
- Don't publish to npm registry
- Always use the
@kbn
namespace - Always set
"private": true
inpackage.json
Using these packages
We no longer publish these packages to the npm registry. Now, instead of
specifying a version when including these packages, we rely on link:
dependencies in Yarn, which sets up a symlink to the package.
For example if you want to use the @kbn/datemath
package in Kibana itself, you
can specify the dependency like this:
"@kbn/datemath": "link:packages/kbn-datemath"
However, if you want to use this from a Kibana plugin, you need to account for the relative location of the Kibana repo, so it would instead be:
"@kbn/datemath": "link:../../kibana/packages/kbn-datemath"
How all of this works is described in more detail in the
@kbn/pm
docs.
Creating a new package
Create a new sub-folder. The name of the folder should mirror the name
in the
package's package.json
. E.g. if the name is @kbn/datemath
the folder name
should be kbn-datemath
.
All new packages should use the @kbn
namespace, and should be marked with
"private": true
.
Unit tests for a package
Currently there are two patterns used to test packages, one using Mocha and one using Jest. These patterns emerged out of convention and we'd like to make them more similar to each other in the near future.
1. Mocha
Today a package can follow the pattern of having a __tests__
directory in each source code directory of a package which contains the tests for that module. These are usually run by Mocha.
If a package's tests should be run with Mocha, you'll have to opt-in to run them by appending the package's test file pattern(s) to Kibana's tasks/config/simplemocha.js
file. These will then be run by the unit test runner.
yarn test
oryarn grunt test
runs all unit tests.yarn grunt simplemocha:all
runs all Mocha tests.
2. Jest
A package can also follow the pattern of having .test.js
files as siblings of the source code files, and these run by Jest.
A package using the .test.js
naming convention will have those tests automatically picked up by Jest and run by the unit test runner, currently mapped to the Kibana test
script in the root package.json
.
yarn test
oryarn grunt test
runs all unit tests.node scripts/jest
runs all Jest tests in Kibana.
Each package can also specify its own test
script in the package's package.json
, for cases where you'd prefer to run the tests from the local package directory.