mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[packages] Move @kbn/crypto to Bazel (#99233)
This commit is contained in:
parent
96da390e6f
commit
ae6109e15a
8 changed files with 97 additions and 17 deletions
|
@ -71,6 +71,7 @@ yarn kbn watch-bazel
|
|||
- @kbn/babel-preset
|
||||
- @kbn/config
|
||||
- @kbn/config-schema
|
||||
- @kbn/crypto
|
||||
- @kbn/dev-utils
|
||||
- @kbn/eslint-import-resolver-kibana
|
||||
- @kbn/eslint-plugin-eslint
|
||||
|
|
|
@ -128,7 +128,7 @@
|
|||
"@kbn/apm-utils": "link:bazel-bin/packages/kbn-apm-utils/npm_module",
|
||||
"@kbn/config": "link:bazel-bin/packages/kbn-config/npm_module",
|
||||
"@kbn/config-schema": "link:bazel-bin/packages/kbn-config-schema/npm_module",
|
||||
"@kbn/crypto": "link:packages/kbn-crypto",
|
||||
"@kbn/crypto": "link:bazel-bin/packages/kbn-crypto/npm_module",
|
||||
"@kbn/i18n": "link:packages/kbn-i18n",
|
||||
"@kbn/interpreter": "link:packages/kbn-interpreter",
|
||||
"@kbn/io-ts-utils": "link:packages/kbn-io-ts-utils",
|
||||
|
|
|
@ -13,6 +13,7 @@ filegroup(
|
|||
"//packages/kbn-babel-preset:build",
|
||||
"//packages/kbn-config:build",
|
||||
"//packages/kbn-config-schema:build",
|
||||
"//packages/kbn-crypto:build",
|
||||
"//packages/kbn-dev-utils:build",
|
||||
"//packages/kbn-eslint-import-resolver-kibana:build",
|
||||
"//packages/kbn-eslint-plugin-eslint:build",
|
||||
|
|
87
packages/kbn-crypto/BUILD.bazel
Normal file
87
packages/kbn-crypto/BUILD.bazel
Normal file
|
@ -0,0 +1,87 @@
|
|||
|
||||
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-cypto"
|
||||
PKG_REQUIRE_NAME = "@kbn/crypto"
|
||||
|
||||
SOURCE_FILES = glob(
|
||||
[
|
||||
"src/**/*.ts",
|
||||
],
|
||||
exclude = [
|
||||
"**/*.test.*",
|
||||
],
|
||||
)
|
||||
|
||||
SRCS = SOURCE_FILES
|
||||
|
||||
filegroup(
|
||||
name = "srcs",
|
||||
srcs = SRCS,
|
||||
)
|
||||
|
||||
NPM_MODULE_EXTRA_FILES = [
|
||||
"package.json",
|
||||
"README.md"
|
||||
]
|
||||
|
||||
SRC_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",
|
||||
]
|
||||
|
||||
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 = NPM_MODULE_EXTRA_FILES,
|
||||
deps = [":tsc"] + DEPS,
|
||||
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"],
|
||||
)
|
|
@ -4,10 +4,5 @@
|
|||
"private": true,
|
||||
"license": "SSPL-1.0 OR Elastic License 2.0",
|
||||
"main": "./target/index.js",
|
||||
"types": "./target/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "../../node_modules/.bin/tsc",
|
||||
"kbn:bootstrap": "yarn build",
|
||||
"kbn:watch": "yarn build --watch"
|
||||
}
|
||||
}
|
||||
"types": "./target/index.d.ts"
|
||||
}
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"incremental": false,
|
||||
"incremental": true,
|
||||
"outDir": "./target",
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"rootDir": "src",
|
||||
"sourceMap": true,
|
||||
"sourceRoot": "../../../../packages/kbn-crypto/src"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
]
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
|
|
|
@ -10,10 +10,7 @@
|
|||
"kbn:bootstrap": "yarn build",
|
||||
"kbn:watch": "yarn build --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@kbn/crypto": "link:../kbn-crypto"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@kbn/utility-types": "link:../kbn-utility-types"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2619,7 +2619,7 @@
|
|||
version "0.0.0"
|
||||
uid ""
|
||||
|
||||
"@kbn/crypto@link:packages/kbn-crypto":
|
||||
"@kbn/crypto@link:bazel-bin/packages/kbn-crypto/npm_module":
|
||||
version "0.0.0"
|
||||
uid ""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue