Skip to content
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

[7.14] chore(NA): moving @kbn/babel-code-parser to babel transpiler (#107574) #107597

Merged
merged 1 commit into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 7 additions & 20 deletions packages/kbn-babel-code-parser/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("@npm//@babel/cli:index.bzl", "babel")
load("//src/dev/bazel:index.bzl", "jsts_transpiler")

PKG_BASE_NAME = "kbn-babel-code-parser"
PKG_REQUIRE_NAME = "@kbn/babel-code-parser"
Expand All @@ -25,35 +25,22 @@ NPM_MODULE_EXTRA_FILES = [
"README.md",
]

DEPS = [
"//packages/kbn-babel-preset",
RUNTIME_DEPS = [
"@npm//@babel/parser",
"@npm//@babel/traverse",
"@npm//lodash",
]

babel(
name = "target",
data = DEPS + [
":srcs",
".babelrc",
],
output_dir = True,
# the following arg paths includes $(execpath) as babel runs on the sandbox root
args = [
"./%s/src" % package_name(),
"--config-file",
"./%s/.babelrc" % package_name(),
"--out-dir",
"$(@D)",
"--quiet"
],
jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
)

js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = DEPS + [":target"],
deps = RUNTIME_DEPS + [":target_node"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-babel-code-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "babel code parser for Kibana",
"private": true,
"version": "1.0.0",
"main": "./target/index.js",
"main": "./target_node/index.js",
"license": "SSPL-1.0 OR Elastic License 2.0",
"repository": {
"type": "git",
Expand Down