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

feat(builtin): new js_library rule #2109

Merged
merged 47 commits into from
Aug 17, 2020
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1daa8bb
feat(typescript): include module_mappings_aspect on ts_project deps
mistic Aug 12, 2020
3f21290
chore(builtin): remove old js_library rule
mistic Aug 12, 2020
a05de59
chore(builtin): rename node_module_library rule into new js_library rule
mistic Aug 12, 2020
b55aa4a
feat(builtin): new js_library rule proposal implementation
mistic Aug 12, 2020
a508486
feat(builtin): include old amd_names from legacy js_library
mistic Aug 13, 2020
14a706f
refactor(builtin): update usages of js_library to use targets from co…
mistic Aug 13, 2020
00943c4
refactor(builtin): update usages of node_module_library into the new …
mistic Aug 13, 2020
3bba742
fix(builtin): wrong import of copy_to_bin bzl file
mistic Aug 13, 2020
ba7deb3
fix(builtin): wrong import of copy_to_bin bzl file. Now importing fro…
mistic Aug 13, 2020
ff7c268
fix(builtin): correctly setup copy_to_bin on gjtorikian/isBinaryFile …
mistic Aug 13, 2020
c38b2ef
chore(builtin): lint fix the entire code base
mistic Aug 13, 2020
1962095
chore(builtin): lint fix the entire code base for imports
mistic Aug 13, 2020
11acd00
fix(builtin): gjtorikian/isBinaryFile to use deps composition on the …
mistic Aug 13, 2020
9ec1861
fix(builtin): js_library usage on grpc_web/BUILD.bazel
mistic Aug 13, 2020
622c9cc
fix(builtin): js_library usage on grpc_web/BUILD.bazel
mistic Aug 13, 2020
0b0bf78
test(builtin): fix js_binary usages in a couple of places across tests
mistic Aug 13, 2020
68d8531
chore(builtin): run lint fix
mistic Aug 13, 2020
81faea0
chore(builtin): include some changes according PR review
mistic Aug 13, 2020
4f516f5
feat(builtin): only include declarationinfo provider in case there ar…
mistic Aug 13, 2020
b806e17
fix(builtin): remove legacy string-typed typescript provider
mistic Aug 13, 2020
580c947
chore(builtin): include some changes according PR review
mistic Aug 13, 2020
a65fb7e
fix(builtin): typo when appending declarationinfo provider
mistic Aug 13, 2020
11d2983
fix(builtin): isBinaryFile js_library usage
mistic Aug 13, 2020
d6e1907
refactor(builtin): remove non needed provider filtering on the rule d…
mistic Aug 14, 2020
1be5fa4
refactor(builtin): remove non needed provider filtering on the rule d…
mistic Aug 14, 2020
269d303
refactor(builtin): remove non needed provider filtering on the rule d…
mistic Aug 14, 2020
f57b958
refactor(builtin): update files on linkable package info
mistic Aug 14, 2020
1e1391e
refactor(builtin): update files on linkable package info
mistic Aug 14, 2020
e35955f
refactor(builtin): simplify providers on js_library
mistic Aug 14, 2020
fbd2034
refactor(builtin): reworked implementation of js_library
mistic Aug 14, 2020
3cc1fec
chore(builtin): apply lint fix to all changes rules
mistic Aug 14, 2020
36c502a
fix(builtin): remove bad import for js_library
mistic Aug 14, 2020
10b2e67
fix(builtin): declare deps on isBinaryFile as internal only as it imp…
mistic Aug 14, 2020
18c4ad9
chore(builtin): remove unused import on isBinaryFile package
mistic Aug 15, 2020
017f19a
chore(builtin): remove unused deps from isBinaryFile package
mistic Aug 15, 2020
daaa6cb
docs(builtin): complete documentation for js_library
mistic Aug 15, 2020
0880d88
docs(builtin): complete documentation for js_library arguments
mistic Aug 15, 2020
8a9920a
chore(builtin): fixed linting problems on js_library
mistic Aug 15, 2020
03e7fe3
feat(builtin): include sources from deps that are not node_modules
mistic Aug 15, 2020
28d7ed0
feat(builtin): recover old behaviour of auto copy into bin
mistic Aug 15, 2020
f67b293
chore(builtin): reorganize imports
mistic Aug 15, 2020
ba2e13c
feat(builtin): include every file in the list of files depsets
mistic Aug 17, 2020
97ebf68
refactor(builtin): don't rely on extra src variable to copy files int…
mistic Aug 17, 2020
9ae2712
docs(builtin): add note about include_npm_package_info check
mistic Aug 17, 2020
98599f8
chore(builtin): remove every copy_to_bin rule previously added
mistic Aug 17, 2020
b590bfa
fix(builtin): workaround for examples/user_managed_deps failing test
mistic Aug 17, 2020
0b54193
docs(builtin): explain why we need one copy_to_bin left
mistic Aug 17, 2020
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
Prev Previous commit
Next Next commit
refactor(builtin): remove non needed provider filtering on the rule d…
…ep processing
mistic committed Aug 14, 2020

Verified

This commit was signed with the committer’s verified signature.
mistic Tiago Costa
commit d6e1907d5472792a58d276d004614acb90fc769d
16 changes: 4 additions & 12 deletions internal/js_library/js_library.bzl
Original file line number Diff line number Diff line change
@@ -55,9 +55,7 @@ def write_amd_names_shim(actions, amd_names_shim, targets):

def _js_library_impl(ctx):
direct_sources = depset(ctx.files.srcs)
direct_named_module_sources = depset(ctx.files.named_module_srcs)
sources_depsets = [direct_sources]
named_module_sources_depsets = [direct_named_module_sources]

# We cannot always expose the NpmPackageInfo as the linker
# only allow us to reference node modules from a single workspace at a time.
@@ -92,24 +90,21 @@ def _js_library_impl(ctx):
transitive_declarations_depsets.append(dep[DeclarationInfo].transitive_declarations)
if NpmPackageInfo in dep:
sources_depsets.append(dep[NpmPackageInfo].sources)
if JSModuleInfo in dep:
sources_depsets.append(dep[JSModuleInfo].sources)
if JSNamedModuleInfo in dep:
named_module_sources_depsets.append(dep[JSNamedModuleInfo].sources)

transitive_declarations = depset(transitive = transitive_declarations_depsets)
transitive_sources = depset(transitive = sources_depsets + named_module_sources_depsets)
transitive_sources = depset(transitive = sources_depsets)

providers = [
DefaultInfo(
files = direct_sources,
runfiles = ctx.runfiles(files = ctx.files.srcs),
),
js_module_info(
sources = direct_sources,
deps = ctx.attr.deps,
),
js_named_module_info(
sources = direct_named_module_sources,
sources = depset(ctx.files.named_module_srcs),
deps = ctx.attr.deps,
),
AmdNamesInfo(names = ctx.attr.amd_names),
@@ -127,10 +122,7 @@ def _js_library_impl(ctx):
providers.append(LinkablePackageInfo(
package_name = ctx.attr.package_name,
path = path,
files = depset([
transitive_sources,
transitive_declarations,
]),
files = depset(transitive = [transitive_sources, transitive_declarations])
))

if include_npm_package_info: