# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # SPDX-License-Identifier: Apache-2.0 load("@aspect_rules_js//js:defs.bzl", "js_library") load("@aspect_rules_ts//ts:defs.bzl", "ts_config", "ts_project") load("@npm//:defs.bzl", "npm_link_all_packages") load("//bazel/rules_vitest:defs.bzl", "vitest_test") npm_link_all_packages() ts_config( name = "tsconfig", src = "tsconfig.json", visibility = [":__subpackages__"], ) ts_project( name = "dotprompt", srcs = glob( [ "**/*.ts", ], exclude = [ "**/*.test.ts", "**/*.bench.ts", "**/*.test.tsx", "node_modules/**", ], ), no_emit = True, out_dir = "dist", tsconfig = ":tsconfig", validate = True, visibility = ["//visibility:public"], deps = [ ":node_modules/@types/node", ":node_modules/handlebars", ":node_modules/yaml", ], ) vitest_test( name = "dotprompt_test", srcs = glob( [ "**/*.ts", "**/*.test.ts", ], exclude = [ "node_modules/**", "examples/**", "**/spec.test.ts", # TODO: Remains to be fixed. ], ) + [ "//spec:spec_js_lib", ], config = ":vitest.config.mts", deps = [ ":dotprompt", ":node_modules/@types/node", ":node_modules/handlebars", ":node_modules/vitest", ":node_modules/yaml", ], ) js_library( name = "pkg", srcs = [ "package.json", ":dotprompt", ], visibility = ["//visibility:public"], )