Alan Agius 717b02f533 ci: add ts api guardian (#12010)
* refactor: fix `import` and `export` paths to work with classic resolution

`ts-api-guardian` only support classic module resolution which means that we need to specify `index` so that the resolution works.

* build: add `npm_package` to packages

* build: add ts-api-guardian to repo

* test: add api golden files

* refactor: use proper namespace instead of alias export

* refactor: use proper namspace einstead of alias export

* build: add `_golden_api` files

At the moment ts api guardian doesn't support aliased symbols as namespaces, this is a workaround to still have namespaced symbols in the final golden file.

* build: update angular archive for workspace

* test: fix reference to `TestHost` to use namespace

* refactor: create `fs` namespace instead of aliased export

* test: update api golden file for `@angular-devkit/core/node`
2018-11-30 11:53:54 -08:00

70 lines
1.6 KiB
Python

# Copyright Google Inc. All Rights Reserved.
#
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE file at https://angular.io/license
licenses(["notice"]) # MIT
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test", "npm_package")
package(default_visibility = ["//visibility:public"])
ts_library(
name = "build_optimizer",
srcs = glob(
include = ["src/**/*.ts"],
exclude = [
# TODO(@filipesilva): shouldn't need to exclude the cli files but can't exclude them
# from jasmine_node_test.
"src/**/cli.ts",
"src/**/*_spec.ts",
"src/**/*_spec_large.ts",
"src/**/*_benchmark.ts",
],
),
deps = [
"@npm//@types/node",
"@npm//@types/source-map",
"@npm//typescript",
"@npm//@types/webpack",
],
)
ts_library(
name = "build_optimizer_test_lib",
srcs = glob(
include = [
"src/**/*_spec.ts",
"src/**/*_spec_large.ts",
],
),
deps = [
":build_optimizer",
"//packages/angular_devkit/core",
"@npm//@types/node",
"@npm//@types/jasmine",
"@npm//@types/source-map",
],
testonly = True,
# @external_begin
tsconfig = "//:tsconfig-test.json",
# @external_end
)
jasmine_node_test(
name = "build_optimizer_test",
srcs = [":build_optimizer_test_lib"],
deps = [
"@npm//jasmine",
"@npm//source-map",
]
)
npm_package(
name = "npm_package",
deps = [
":build_optimizer",
],
)