Skip to content

Commit

Permalink
fix(typescript): include package.json in third-party DeclarationInfo
Browse files Browse the repository at this point in the history
It may be needed in transitive compilations to resolve the "typings" key

Fixes #2044
  • Loading branch information
Alex Eagle authored and alexeagle committed Jul 20, 2020
1 parent 93484ba commit 1c70656
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/npm_install/node_module_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ def _node_module_library_impl(ctx):
declarations = depset([
f
for f in ctx.files.srcs
if f.path.endswith(".d.ts") and
if (
f.path.endswith(".d.ts") or
# package.json may be required to resolve "typings" key
f.path.endswith("/package.json")
) and
# exclude eg. external/npm/node_modules/protobufjs/node_modules/@types/node/index.d.ts
# these would be duplicates of the typings provided directly in another dependency.
# also exclude all /node_modules/typescript/lib/lib.*.d.ts files as these are determined by
Expand Down

0 comments on commit 1c70656

Please sign in to comment.