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

fix(builtin): don't include external files when pkg_npm is in root pa… #1677

Merged
merged 1 commit into from
Mar 2, 2020
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
1 change: 1 addition & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ install_bazel_dependencies()
git_repository(
name = "build_bazel_rules_typescript",
commit = "10a5a86885f95ab788fd841ade47b6a16e0c13d6",
patches = ["//:rules_typescript.patch"],
remote = "http://github.com/bazelbuild/rules_typescript.git",
shallow_since = "1582757372 -0800",
)
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg_npm/pkg_npm.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ PKG_NPM_OUTPUTS = {
def _filter_out_external_files(ctx, files, package_path):
result = []
for file in files:
if file.short_path.startswith(package_path):
if file.short_path.startswith(package_path) and not file.short_path.startswith("../"):
result.append(file.path)
else:
for v in ctx.attr.vendor_external:
Expand Down
2 changes: 1 addition & 1 deletion packages/worker/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ load("//third_party/github.com/bazelbuild/bazel-skylib:rules/copy_file.bzl", "co

# We reach inside the @bazel/typescript npm package to grab this one .js file
# This avoids a complex refactoring where we extract that .ts file from tsc_wrapped to a common library
_worker_path = "external/build_bazel_rules_typescript/internal/tsc_wrapped/worker"
_worker_path = "internal/tsc_wrapped/worker"

# Copy the proto file to a matching third_party/... nested directory
# so the runtime require() statements still work
Expand Down
12 changes: 12 additions & 0 deletions rules_typescript.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff BUILD.bazel BUILD.bazel
index 3a519c5..6121ef6 100644
--- BUILD.bazel
+++ BUILD.bazel
@@ -38,6 +38,7 @@ pkg_npm(
"//internal:npm_package_assets",
"//third_party/github.com/bazelbuild/bazel/src/main/protobuf:npm_package_assets",
],
+ vendor_external = ["build_bazel_rules_typescript"],
visibility = ["//visibility:public"],
deps = [
"//devserver:devserver-darwin",