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

Add .d.cts, .d.cts.map, .d.mts, .d.mts.map and package.json to DeclarationInfo provider #12

Merged
merged 1 commit into from
Nov 15, 2023
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
19 changes: 8 additions & 11 deletions internal/js_library/js_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,14 @@ def _impl(ctx):

# register typings
if (
(
file.path.endswith(".d.ts") or
file.path.endswith(".d.ts.map") or
# package.json may be required to resolve "typings" key
file.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
# the tsconfig "lib" attribute
len(file.path.split("/node_modules/")) < 3 and file.path.find("/node_modules/typescript/lib/lib.") == -1
file.path.endswith(".d.ts") or
file.path.endswith(".d.ts.map") or
file.path.endswith(".d.cts") or
file.path.endswith(".d.cts.map") or
file.path.endswith(".d.mts") or
file.path.endswith(".d.mts.map") or
# package.json may be required to resolve "typings" key
file.path.endswith("/package.json")
):
typings.append(file)

Expand Down