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

* chore(NA): moving @kbn/babel-code-parser to babel transpiler

* chore(NA): fix package.json main field
This commit is contained in:
Tiago Costa 2021-08-03 22:06:28 +01:00 committed by GitHub
parent cc014f5a56
commit 7d5f3a2c63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 21 deletions

View file

@ -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"
@ -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"],
)

View file

@ -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",