Skip to content

Commit

Permalink
refactor: convert nestjs example to ts_project
Browse files Browse the repository at this point in the history
We no longer recommend ts_library so our examples shouldn't use it
  • Loading branch information
alexeagle authored and gregmagolan committed May 29, 2021
1 parent 8a44f62 commit 66769c7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
11 changes: 7 additions & 4 deletions examples/nestjs/src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
load("@io_bazel_rules_docker//nodejs:image.bzl", "nodejs_image")
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm//@bazel/typescript:index.bzl", "ts_project")

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

ts_library(
ts_project(
name = "app",
srcs = glob(
["*.ts"],
exclude = ["*.spec.ts"],
),
module_name = "examples_nestjs",
declaration = True,
tsconfig = "//:tsconfig.json",
deps = [
"@npm//@nestjs/common",
"@npm//@nestjs/core",
Expand All @@ -35,9 +36,11 @@ ts_library(
],
)

ts_library(
ts_project(
name = "test_lib",
srcs = glob(["*.spec.ts"]),
declaration = True,
tsconfig = "//:tsconfig.json",
deps = [
":app",
"@npm//@nestjs/common",
Expand Down
10 changes: 10 additions & 0 deletions examples/nestjs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"target": "ES2015",
"module": "commonjs",
"rootDirs": [".", "bazel-out/k8-fastbuild/bin", "bazel-out/darwin-fastbuild/bin"],
"declaration": true
},
"exclude": ["external"]
}

0 comments on commit 66769c7

Please sign in to comment.