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

test: assert external tsconfig is usable with workers #239

Merged
merged 1 commit into from
Nov 12, 2022
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@types/node": "18.6.1",
"date-fns": "2.29.1",
"rxjs": "7",
"typescript": "4.8.2"
"typescript": "4.8.2",
"@tsconfig/node16-strictest-esm": "^1.0.3"
}
}
6 changes: 6 additions & 0 deletions examples/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions examples/tsconfig_external/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
load("@aspect_rules_ts//ts:defs.bzl", "ts_config", "ts_project")

ts_config(
name = "config",
src = "tsconfig.json",
deps = [
"//examples:node_modules/@tsconfig/node16-strictest-esm"
],
)

ts_project(
thesayyn marked this conversation as resolved.
Show resolved Hide resolved
name = "tsconfig_external",
srcs = [
"index.ts",
],
tsconfig = ":config"
)
6 changes: 6 additions & 0 deletions examples/tsconfig_external/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


// @ts-expect-error
function name(params: number) {

}
3 changes: 3 additions & 0 deletions examples/tsconfig_external/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@tsconfig/node16-strictest-esm/tsconfig.json"
}
12 changes: 11 additions & 1 deletion ts/private/ts_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

load("@aspect_bazel_lib//lib:paths.bzl", "relative_file")
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_file_to_bin_action", "copy_files_to_bin_actions")
load("@aspect_rules_js//js:libs.bzl", "js_lib_helpers")
load(":ts_lib.bzl", _lib = "lib")

TsConfigInfo = provider(
Expand All @@ -29,7 +30,16 @@ TsConfigInfo = provider(

def _ts_config_impl(ctx):
files = [copy_file_to_bin_action(ctx, ctx.file.src)]
transitive_deps = [depset(copy_files_to_bin_actions(ctx, ctx.files.deps))]
transitive_deps = [
depset(copy_files_to_bin_actions(ctx, ctx.files.deps)),
js_lib_helpers.gather_files_from_js_providers(
targets = ctx.attr.deps,
include_transitive_sources = True,
include_declarations = True,
include_npm_linked_packages = True,
)
]

for dep in ctx.attr.deps:
if TsConfigInfo in dep:
transitive_deps.append(dep[TsConfigInfo].deps)
Expand Down