fa03028688
* emotion deps * kbn-babel * kbn-test * examples * babel-plugin-styled-components config * css prop type fixes * type context * declaration location * some emotion types resolved * clean up * emotion v10 accomodations * types * kbn-crypto * kbn-telemetry-tools * bazel * eslint rule; shared file regex array * update paths * Update packages/kbn-eslint-plugin-eslint/rules/module_migration.js Co-authored-by: Spencer <email@spalger.com> * remove placeholder styles * doc api changes * snapshot updates * storybook comments * use constant * bump new deps * condense versions Co-authored-by: Spencer <email@spalger.com>
144 lines
2.7 KiB
Python
144 lines
2.7 KiB
Python
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
|
|
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
|
|
load("@npm//webpack-cli:index.bzl", webpack = "webpack_cli")
|
|
|
|
PKG_BASE_NAME = "kbn-ui-shared-deps"
|
|
PKG_REQUIRE_NAME = "@kbn/ui-shared-deps"
|
|
|
|
SOURCE_FILES = glob(
|
|
[
|
|
"src/**/*",
|
|
],
|
|
exclude = [
|
|
"**/*.md",
|
|
],
|
|
)
|
|
|
|
SRCS = SOURCE_FILES
|
|
|
|
filegroup(
|
|
name = "srcs",
|
|
srcs = SRCS,
|
|
)
|
|
|
|
NPM_MODULE_EXTRA_FILES = [
|
|
"flot_charts/package.json",
|
|
"theme/package.json",
|
|
"package.json",
|
|
"README.md"
|
|
]
|
|
|
|
SRC_DEPS = [
|
|
"//packages/elastic-datemath",
|
|
"//packages/elastic-safer-lodash-set",
|
|
"//packages/kbn-analytics",
|
|
"//packages/kbn-babel-preset",
|
|
"//packages/kbn-i18n",
|
|
"//packages/kbn-monaco",
|
|
"//packages/kbn-std",
|
|
"//packages/kbn-utils",
|
|
"@npm//@elastic/charts",
|
|
"@npm//@elastic/eui",
|
|
"@npm//@elastic/numeral",
|
|
"@npm//@emotion/react",
|
|
"@npm//abortcontroller-polyfill",
|
|
"@npm//angular",
|
|
"@npm//babel-loader",
|
|
"@npm//compression-webpack-plugin",
|
|
"@npm//core-js",
|
|
"@npm//css-minimizer-webpack-plugin",
|
|
"@npm//css-loader",
|
|
"@npm//fflate",
|
|
"@npm//jquery",
|
|
"@npm//loader-utils",
|
|
"@npm//mini-css-extract-plugin",
|
|
"@npm//moment",
|
|
"@npm//moment-timezone",
|
|
"@npm//raw-loader",
|
|
"@npm//react",
|
|
"@npm//react-dom",
|
|
"@npm//react-intl",
|
|
"@npm//react-is",
|
|
"@npm//react-router",
|
|
"@npm//react-router-dom",
|
|
"@npm//regenerator-runtime",
|
|
"@npm//resize-observer-polyfill",
|
|
"@npm//rison-node",
|
|
"@npm//rxjs",
|
|
"@npm//styled-components",
|
|
"@npm//symbol-observable",
|
|
"@npm//terser-webpack-plugin",
|
|
"@npm//url-loader",
|
|
"@npm//val-loader",
|
|
"@npm//whatwg-fetch"
|
|
]
|
|
|
|
TYPES_DEPS = [
|
|
"@npm//@types/node",
|
|
]
|
|
|
|
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,
|
|
allow_js = True,
|
|
declaration = True,
|
|
declaration_map = True,
|
|
incremental = True,
|
|
out_dir = "target",
|
|
source_map = True,
|
|
root_dir = "src",
|
|
tsconfig = ":tsconfig",
|
|
)
|
|
|
|
webpack(
|
|
name = "shared_built_assets",
|
|
data = DEPS + [
|
|
"//:package.json",
|
|
":srcs",
|
|
":tsconfig",
|
|
":webpack.config.js",
|
|
],
|
|
output_dir = True,
|
|
args = [
|
|
"--config",
|
|
"$(location webpack.config.js)",
|
|
"--output-path",
|
|
"$(@D)",
|
|
"--display=minimal"
|
|
],
|
|
)
|
|
|
|
js_library(
|
|
name = PKG_BASE_NAME,
|
|
srcs = NPM_MODULE_EXTRA_FILES,
|
|
deps = DEPS + [":tsc", ":shared_built_assets"],
|
|
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"],
|
|
)
|