Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(examples): remove a usage of raw tsc #1734

Merged
merged 1 commit into from
Mar 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 9 additions & 23 deletions examples/app/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_web")
load("@npm//html-insert-assets:index.bzl", "html_insert_assets")
load("@npm//http-server:index.bzl", "http_server")
load("@npm//typescript:index.bzl", "tsc")
load("@npm_bazel_protractor//:index.bzl", "protractor_web_test_suite")
load("@npm_bazel_rollup//:index.bzl", "rollup_bundle")
load("@npm_bazel_terser//:index.bzl", "terser_minified")
load("@npm_bazel_typescript//:index.bzl", "ts_devserver", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_devserver", "ts_library", "ts_project")

package(default_visibility = ["//visibility:public"])

Expand Down Expand Up @@ -61,26 +60,13 @@ http_server(
templated_args = ["package"],
)

# we could use ts_library here, but we use plain typescript to demonstrate that it works
tsc(
name = "e2e",
# This could also be `ts_library` but we mix them here to illustrate
ts_project(
name = "tsconfig-test",
testonly = 1,
# Remember that Bazel requires it know what outputs are created ahead of time
# so that it can construct a dependency graph.
outs = [
"app.e2e-spec.js",
],
args = [
"-p",
"$(execpath tsconfig-test.json)",
"--outDir",
# $(RULEDIR) is a shorthand for the dist/bin directory where Bazel requires we write outputs
"$(RULEDIR)",
],
data = [
"app.e2e-spec.ts",
"tsconfig.json",
"tsconfig-test.json",
srcs = ["app.e2e-spec.ts"],
extends = ["tsconfig.json"],
deps = [
"@npm//@types/jasmine",
"@npm//@types/node",
"@npm//protractor",
Expand All @@ -89,16 +75,16 @@ tsc(

protractor_web_test_suite(
name = "prodserver_test",
srcs = ["app.e2e-spec.js"],
on_prepare = ":protractor.on-prepare.js",
server = "//:prodserver",
deps = [":e2e"],
)

protractor_web_test_suite(
name = "devserver_test",
srcs = ["app.e2e-spec.js"],
on_prepare = ":protractor.on-prepare.js",
server = "//:devserver",
deps = [":e2e"],
)

# Just a dummy test so that we have a test target for //... on certain bazelci platforms with bazel_integration_test
Expand Down