anki/ts/sql_format.bzl
Damien Elmes 8c6d0e6229 move exports_files call into ts/BUILD.bazel
Suspect it has caused a regression when building from an external
repo.
2021-01-09 18:03:26 +10:00

25 lines
747 B
Python

load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test")
def sql_format_setup():
ts_library(
name = "sql_format_lib",
srcs = ["//ts:sql_format.ts"],
deps = [
"@npm//@sqltools/formatter",
"@npm//@types/node",
"@npm//@types/diff",
"@npm//diff",
],
visibility = ["//visibility:public"],
)
def sql_format(name = "sql_format", srcs = [], **kwargs):
nodejs_test(
name = name,
entry_point = "//ts:sql_format.ts",
args = [native.package_name() + "/" + f for f in srcs],
data = ["//ts:sql_format_lib", "@npm//tslib", "@npm//diff"] + srcs,
**kwargs
)