-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* docs: produce API docs for rules in the @npm repo * fix formatting * fix formatting * rename: npm_link_all_packages.md
- Loading branch information
Showing
8 changed files
with
182 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
"""\ | ||
Build rules generated by `npm_translate_lock` | ||
============================================= | ||
These are loaded from the external repository created by `npm_translate_lock` based on the name provided. | ||
For example, if you run `npm_translate_lock(name = "npm")` then these rules can be loaded with | ||
``` | ||
load("@npm//:defs.bzl", "npm_link_targets", "npm_link_all_packages") | ||
``` | ||
""" | ||
|
||
# NOTE: we don't attempt to run stardoc against @npm//:defs.bzl to produce these docstrings | ||
# because that file load()s from BUILD files in every package, so the bzl_library target required | ||
# is impossible to write. | ||
# Instead, we define the interfaces in this file, while the implementations live in npm_translate_lock_generate.bzl. | ||
|
||
# buildifier: disable=unused-variable | ||
def npm_link_targets(name = "node_modules", package = None): | ||
"""Generated list of target names that are linked by npm_link_all_packages() | ||
Args: | ||
name: name of catch all target to generate for all packages linked | ||
package: Bazel package to generate targets names for. | ||
Set to an empty string "" to specify the root package. | ||
If unspecified, the current package (`native.package_name()`) is used. | ||
Returns: | ||
A list of target names that are linked by npm_link_all_packages() | ||
""" | ||
pass | ||
|
||
# buildifier: disable=unused-variable | ||
def npm_link_all_packages(name = "node_modules", imported_links = []): | ||
"""Generated list of npm_link_package() target generators and first-party linked packages corresponding to the packages in {pnpm_lock_label} | ||
If you use manually-written [`npm_import`](/docs/npm_import.md#npm_import) you can link these as well, for example, | ||
load("@npm//:defs.bzl", "npm_link_all_packages") | ||
load("@npm_meaning-of-life__links//:defs.bzl", npm_link_meaning_of_life = "npm_link_imported_package") | ||
npm_link_all_packages( | ||
name = "node_modules", | ||
imported_links = [ | ||
npm_link_meaning_of_life, | ||
], | ||
) | ||
Args: | ||
name: name of catch all target to generate for all packages linked | ||
imported_links: optional list link functions from manually imported packages that were fetched with npm_import rules. | ||
""" | ||
pass |