-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[data] Extract @kbn/field-types to a package #106973
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ae751b3
move kbn-field-types to packages
Dosant 5310ea0
update docs
Dosant 9b6e6ff
Merge branch 'master' of github.com:elastic/kibana into dev/kbn-types…
Dosant cb454f3
Merge branch 'master' into dev/kbn-types-package
kibanamachine 9397e81
Merge branch 'master' of github.com:elastic/kibana into dev/kbn-types…
Dosant 5c95305
nicer messages
Dosant 2dfcbe8
transpile via babel
Dosant 7523bcd
Merge branch 'master' of github.com:elastic/kibana into dev/kbn-types…
Dosant ae01dfd
“target_node”
Dosant 7fe4b07
Merge branch 'master' into dev/kbn-types-package
kibanamachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 0 additions & 54 deletions
54
...lopment/plugins/data/public/kibana-plugin-plugins-data-public.es_field_types.md
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
...opment/plugins/data/public/kibana-plugin-plugins-data-public.kbn_field_types.md
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 0 additions & 54 deletions
54
...lopment/plugins/data/server/kibana-plugin-plugins-data-server.es_field_types.md
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
...opment/plugins/data/server/kibana-plugin-plugins-data-server.kbn_field_types.md
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["@kbn/babel-preset/node_preset"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
|
||
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project") | ||
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm") | ||
load("//src/dev/bazel:index.bzl", "jsts_transpiler") | ||
|
||
PKG_BASE_NAME = "kbn-field-types" | ||
PKG_REQUIRE_NAME = "@kbn/field-types" | ||
|
||
SOURCE_FILES = glob( | ||
[ | ||
"src/**/*.ts", | ||
], | ||
exclude = [ | ||
"**/*.test.*", | ||
], | ||
) | ||
|
||
SRCS = SOURCE_FILES | ||
|
||
filegroup( | ||
name = "srcs", | ||
srcs = SRCS, | ||
) | ||
|
||
NPM_MODULE_EXTRA_FILES = [ | ||
"package.json", | ||
"README.md" | ||
] | ||
|
||
RUNTIME_DEPS = [ | ||
"@npm//jest-styled-components", | ||
"@npm//node-forge", | ||
] | ||
|
||
TYPES_DEPS = [ | ||
"@npm//@types/flot", | ||
"@npm//@types/jest", | ||
"@npm//@types/node", | ||
"@npm//@types/node-forge", | ||
"@npm//@types/testing-library__jest-dom", | ||
"@npm//resize-observer-polyfill", | ||
"@npm//@emotion/react", | ||
"@npm//jest-styled-components", | ||
] | ||
|
||
jsts_transpiler( | ||
name = "target_node", | ||
srcs = SRCS, | ||
build_pkg_name = package_name(), | ||
) | ||
|
||
ts_config( | ||
name = "tsconfig", | ||
src = "tsconfig.json", | ||
deps = [ | ||
"//:tsconfig.base.json", | ||
], | ||
) | ||
|
||
ts_project( | ||
name = "tsc_types", | ||
args = ['--pretty'], | ||
srcs = SRCS, | ||
deps = TYPES_DEPS, | ||
declaration = True, | ||
declaration_map = True, | ||
emit_declaration_only = True, | ||
incremental = False, | ||
out_dir = "target_types", | ||
source_map = True, | ||
root_dir = "src", | ||
tsconfig = ":tsconfig", | ||
) | ||
|
||
js_library( | ||
name = PKG_BASE_NAME, | ||
srcs = NPM_MODULE_EXTRA_FILES, | ||
deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], | ||
package_name = PKG_REQUIRE_NAME, | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
pkg_npm( | ||
name = "npm_module", | ||
deps = [ | ||
":%s" % PKG_BASE_NAME, | ||
] | ||
) | ||
|
||
filegroup( | ||
name = "build", | ||
srcs = [ | ||
":npm_module", | ||
], | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# @kbn/field-types | ||
|
||
Types and utilities for kbn and es field types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
module.exports = { | ||
preset: '@kbn/test', | ||
rootDir: '../..', | ||
roots: ['<rootDir>/packages/kbn-field-types'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "@kbn/field-types", | ||
"version": "1.0.0", | ||
"private": true, | ||
"license": "SSPL-1.0 OR Elastic License 2.0", | ||
"main": "./target_node/index.js", | ||
"types": "./target_types/index.d.ts" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
export { KbnFieldType } from './kbn_field_type'; | ||
|
||
export { | ||
castEsToKbnFieldTypeName, | ||
getKbnFieldType, | ||
getKbnTypeNames, | ||
getFilterableKbnTypeNames, | ||
} from './kbn_field_types'; | ||
|
||
export { KBN_FIELD_TYPES, ES_FIELD_TYPES, KbnFieldTypeOptions } from './types'; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think it could be a good idea to have someone from @elastic/kibana-operations review this. What do you say?