From 04d13429f071106a10677a153e4f6061ea7d8ab7 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Tue, 23 Apr 2019 19:12:00 +0200 Subject: [PATCH] build: fix api guardian error form npm (#30063) built-in, relative, absolute, nested node_modules - Error: Cannot find module '../lib/cli' built-in, relative, absolute, nested node_modules - Error: Cannot find module '../lib/cli' This is because the transpiled lib files need to be added to the data. PR Close #30063 --- tools/ts-api-guardian/BUILD.bazel | 5 +++-- tools/ts-api-guardian/index.bzl | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/ts-api-guardian/BUILD.bazel b/tools/ts-api-guardian/BUILD.bazel index dd239472d9..b830f9842f 100644 --- a/tools/ts-api-guardian/BUILD.bazel +++ b/tools/ts-api-guardian/BUILD.bazel @@ -87,7 +87,8 @@ jasmine_node_test( ) # END-INTERNAL -exports_files( - ["bin/ts-api-guardian"], +filegroup( + name = "bin", + srcs = glob(["lib/*.js"]) + ["bin/ts-api-guardian"], visibility = ["//visibility:public"], ) diff --git a/tools/ts-api-guardian/index.bzl b/tools/ts-api-guardian/index.bzl index d44a137bc1..f03e0608db 100644 --- a/tools/ts-api-guardian/index.bzl +++ b/tools/ts-api-guardian/index.bzl @@ -36,7 +36,7 @@ def ts_api_guardian_test( # Locally we need to add the TS build target # But it will replaced to @npm//ts-api-guardian when publishing "@angular//tools/ts-api-guardian:lib", - "@angular//tools/ts-api-guardian:bin/ts-api-guardian", + "@angular//tools/ts-api-guardian:bin", ] args = [