* chore(NA): moving @kbn/config-schema into bazel * chore(NA): correctly format packages for the new bazel standards * chore(NA): correctly maps srcs into source_files * chore(NA): remove config-schema dep from legacy built packages package.jsons * chore(NA): include kbn/config-schema in the list of bazel packages to be built * chore(NA): change import to fix typechecking * chore(NA): remove dependency on new package built by bazel * chore(NA): be more explicit about incremental setting * chore(NA): include pretty in the args for ts_project rule * docs(NA): include package migration completion in the developer getting started Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tiago Costa <tiagoffcc@hotmail.com>
This commit is contained in:
parent
aae42b8b45
commit
769b632901
|
@ -63,5 +63,5 @@ yarn kbn watch-bazel
|
|||
|
||||
- @elastic/datemath
|
||||
- @kbn/apm-utils
|
||||
|
||||
- @kbn/config-schema
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@
|
|||
"@kbn/apm-config-loader": "link:packages/kbn-apm-config-loader",
|
||||
"@kbn/apm-utils": "link:bazel-bin/packages/kbn-apm-utils/npm_module",
|
||||
"@kbn/config": "link:packages/kbn-config",
|
||||
"@kbn/config-schema": "link:packages/kbn-config-schema",
|
||||
"@kbn/config-schema": "link:bazel-bin/packages/kbn-config-schema/npm_module",
|
||||
"@kbn/crypto": "link:packages/kbn-crypto",
|
||||
"@kbn/i18n": "link:packages/kbn-i18n",
|
||||
"@kbn/interpreter": "link:packages/kbn-interpreter",
|
||||
|
|
|
@ -4,6 +4,7 @@ filegroup(
|
|||
name = "build",
|
||||
srcs = [
|
||||
"//packages/elastic-datemath:build",
|
||||
"//packages/kbn-apm-utils:build"
|
||||
"//packages/kbn-apm-utils:build",
|
||||
"//packages/kbn-config-schema:build"
|
||||
],
|
||||
)
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@kbn/config": "link:../kbn-config",
|
||||
"@kbn/config-schema": "link:../kbn-config-schema",
|
||||
"@kbn/logging": "link:../kbn-logging",
|
||||
"@kbn/server-http-tools": "link:../kbn-server-http-tools",
|
||||
"@kbn/optimizer": "link:../kbn-optimizer",
|
||||
|
|
86
packages/kbn-config-schema/BUILD.bazel
Normal file
86
packages/kbn-config-schema/BUILD.bazel
Normal file
|
@ -0,0 +1,86 @@
|
|||
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
|
||||
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
|
||||
|
||||
PKG_BASE_NAME = "kbn-config-schema"
|
||||
PKG_REQUIRE_NAME = "@kbn/config-schema"
|
||||
|
||||
SOURCE_FILES = glob([
|
||||
"src/**/*.ts",
|
||||
"types/joi.d.ts"
|
||||
])
|
||||
|
||||
SRCS = SOURCE_FILES
|
||||
|
||||
filegroup(
|
||||
name = "srcs",
|
||||
srcs = SRCS,
|
||||
)
|
||||
|
||||
NPM_MODULE_EXTRA_FILES = [
|
||||
"package.json",
|
||||
"README.md",
|
||||
]
|
||||
|
||||
SRC_DEPS = [
|
||||
"@npm//joi",
|
||||
"@npm//lodash",
|
||||
"@npm//moment",
|
||||
"@npm//tsd",
|
||||
"@npm//type-detect",
|
||||
]
|
||||
|
||||
TYPES_DEPS = [
|
||||
"@npm//@types/jest",
|
||||
"@npm//@types/joi",
|
||||
"@npm//@types/lodash",
|
||||
"@npm//@types/node",
|
||||
"@npm//@types/type-detect",
|
||||
]
|
||||
|
||||
DEPS = SRC_DEPS + TYPES_DEPS
|
||||
|
||||
ts_config(
|
||||
name = "tsconfig",
|
||||
src = "tsconfig.json",
|
||||
deps = [
|
||||
"//:tsconfig.base.json",
|
||||
],
|
||||
)
|
||||
|
||||
ts_project(
|
||||
name = "tsc",
|
||||
args = ['--pretty'],
|
||||
srcs = SRCS,
|
||||
deps = DEPS,
|
||||
declaration = True,
|
||||
declaration_map = True,
|
||||
incremental = True,
|
||||
out_dir = "target",
|
||||
source_map = True,
|
||||
root_dir = "src",
|
||||
tsconfig = ":tsconfig",
|
||||
)
|
||||
|
||||
js_library(
|
||||
name = PKG_BASE_NAME,
|
||||
srcs = [],
|
||||
deps = [":tsc"] + DEPS,
|
||||
package_name = PKG_REQUIRE_NAME,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
pkg_npm(
|
||||
name = "npm_module",
|
||||
srcs = NPM_MODULE_EXTRA_FILES,
|
||||
deps = [
|
||||
":%s" % PKG_BASE_NAME,
|
||||
]
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "build",
|
||||
srcs = [
|
||||
":npm_module",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
|
@ -1,12 +1,8 @@
|
|||
{
|
||||
"name": "@kbn/config-schema",
|
||||
"main": "./target/out/index.js",
|
||||
"types": "./target/types/index.d.ts",
|
||||
"main": "./target/index.js",
|
||||
"types": "./target/index.d.ts",
|
||||
"version": "1.0.0",
|
||||
"license": "SSPL-1.0 OR Elastic License 2.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "../../node_modules/.bin/tsc",
|
||||
"kbn:bootstrap": "yarn build"
|
||||
}
|
||||
"private": true
|
||||
}
|
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"incremental": false,
|
||||
"outDir": "./target/out",
|
||||
"declarationDir": "./target/types",
|
||||
"stripInternal": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"incremental": true,
|
||||
"outDir": "target",
|
||||
"rootDir": "src",
|
||||
"sourceMap": true,
|
||||
"sourceRoot": "../../../../../packages/kbn-config-schema/src",
|
||||
"stripInternal": true,
|
||||
"types": [
|
||||
"jest",
|
||||
"node"
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@elastic/safer-lodash-set": "link:../elastic-safer-lodash-set",
|
||||
"@kbn/config-schema": "link:../kbn-config-schema",
|
||||
"@kbn/logging": "link:../kbn-logging",
|
||||
"@kbn/std": "link:../kbn-std"
|
||||
},
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
"kbn:watch": "yarn build --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@kbn/utils": "link:../kbn-utils",
|
||||
"@kbn/config-schema": "link:../kbn-config-schema"
|
||||
"@kbn/utils": "link:../kbn-utils"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
"kbn:watch": "yarn build --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@kbn/config-schema": "link:../kbn-config-schema",
|
||||
"@kbn/crypto": "link:../kbn-crypto",
|
||||
"@kbn/std": "link:../kbn-std"
|
||||
},
|
||||
|
|
|
@ -9,8 +9,5 @@
|
|||
"build": "rm -rf target && ../../node_modules/.bin/tsc",
|
||||
"kbn:bootstrap": "yarn build",
|
||||
"kbn:watch": "yarn build --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@kbn/config-schema": "link:../kbn-config-schema"
|
||||
}
|
||||
}
|
|
@ -363,7 +363,7 @@ export const config: {
|
|||
healthCheck: import("@kbn/config-schema").ObjectType<{
|
||||
delay: Type<import("moment").Duration>;
|
||||
}>;
|
||||
ignoreVersionMismatch: import("@kbn/config-schema/target/types/types").ConditionalType<false, boolean, boolean>;
|
||||
ignoreVersionMismatch: import("@kbn/config-schema/target/types").ConditionalType<false, boolean, boolean>;
|
||||
}>;
|
||||
};
|
||||
logging: {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import { TypeOptions } from '@kbn/config-schema/target/types/types';
|
||||
import { TypeOptions } from '@kbn/config-schema/target/types';
|
||||
|
||||
const stringOptionalNullable = schema.maybe(schema.nullable(schema.string()));
|
||||
const stringOptional = schema.maybe(schema.string());
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@elastic/safer-lodash-set": "link:../packages/elastic-safer-lodash-set",
|
||||
"@kbn/config-schema": "link:../packages/kbn-config-schema",
|
||||
"@kbn/i18n": "link:../packages/kbn-i18n",
|
||||
"@kbn/interpreter": "link:../packages/kbn-interpreter",
|
||||
"@kbn/ui-framework": "link:../packages/kbn-ui-framework"
|
||||
|
|
Loading…
Reference in a new issue