sourcegraph/client/client-api/BUILD.bazel
Jason Bedard 10aefc4bb7
bazel: add bazel build,tests for client/* (#46193)
Webpack bundles compile but need further testing. Jest + mocha tests
compile but are marked as `manual` until further work is done to get them
passing. The four jest tests are green and enabled now, though.

## Test plan

`bazel build //client/...` and `bazel test //client/...`
2023-02-28 20:46:03 -08:00

56 lines
1.4 KiB
Python

load("@npm//:defs.bzl", "npm_link_all_packages")
load("//dev:defs.bzl", "npm_package", "ts_project")
load("@aspect_rules_ts//ts:defs.bzl", "ts_config")
npm_link_all_packages(name = "node_modules")
ts_config(
name = "tsconfig",
src = "tsconfig.json",
visibility = ["//client:__subpackages__"],
deps = [
"//:tsconfig",
"//client/extension-api:tsconfig",
"//client/extension-api-types:tsconfig",
"//client/template-parser:tsconfig",
],
)
ts_project(
name = "client-api_lib",
srcs = [
"src/contribution.ts",
"src/hover.ts",
"src/index.ts",
"src/reference.ts",
"src/textDocument.ts",
],
tsconfig = ":tsconfig",
# TODO(bazel): "#keep"s required for type-only imports
deps = [
":node_modules/@sourcegraph/extension-api-types", #keep
":node_modules/@sourcegraph/template-parser", #keep
"//:node_modules/@sourcegraph/extension-api-classes",
"//:node_modules/utility-types", #keep
],
)
ts_project(
name = "client-api_tests",
testonly = True,
srcs = ["src/hover.test.ts"],
tsconfig = ":tsconfig",
deps = [
":client-api_lib",
"//:node_modules/@sourcegraph/extension-api-classes",
],
)
npm_package(
name = "client-api_pkg",
srcs = [
"package.json",
":client-api_lib",
],
)