rules_nodejs

Public API for toolchains

These provide platform-specific tool binaries for rules to consume and use. They are mostly useful for authors of custom rules, and aren’t exposed to end-users.

See https://docs.bazel.build/versions/main/toolchains.html

cypress_toolchain

USAGE

cypress_toolchain(name, cypress_bin, cypress_bin_path, cypress_files)

Defines a cypress toolchain.

For usage see https://docs.bazel.build/versions/main/toolchains.html#defining-toolchains.

ATTRIBUTES

name

(Name, mandatory): A unique name for this target.

cypress_bin

(Label): A hermetically downloaded cypress executable binary for the target platform.

Defaults to None

cypress_bin_path

(String): Path to an existing cypress executable for the target platform.

Defaults to ""

cypress_files

(Label): A hermetically downloaded cypress filegroup of all cypress binary files for the target platform. Must be set when cypress_bin is set.

Defaults to None

node_toolchain

USAGE

node_toolchain(name, target_tool, target_tool_path)

Defines a node toolchain.

For usage see https://docs.bazel.build/versions/main/toolchains.html#defining-toolchains.

ATTRIBUTES

name

(Name, mandatory): A unique name for this target.

target_tool

(Label): A hermetically downloaded nodejs executable target for the target platform.

Defaults to None

target_tool_path

(String): Path to an existing nodejs executable for the target platform.

Defaults to ""

node_toolchain_configure

USAGE

node_toolchain_configure(name, repo_mapping, target_tool, target_tool_path)

Creates an external repository with a node_toolchain //:toolchain target properly configured.

ATTRIBUTES

name

(Name, mandatory): A unique name for this repository.

repo_mapping

(Dictionary: String -> String, mandatory): A dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository.<p>For example, an entry "@foo": "@bar" declares that, for any time this repository depends on @foo (such as a dependency on @foo//some:target, it should actually resolve that dependency within globally-declared @bar (@bar//some:target).

target_tool

(Label): Target for a downloaded nodejs binary for the target os.

Defaults to None

target_tool_path

(String): Absolute path to a pre-installed nodejs binary for the target os.

Defaults to ""

configure_esbuild_toolchains

USAGE

configure_esbuild_toolchains(name, platforms)

Configures esbuild toolchains for a list of supported platforms

PARAMETERS

name

unused

Defaults to ""

platforms

dict of platforms to configure toolchains for

Defaults to {}

cypress_repositories

USAGE

cypress_repositories(name, version, linux_urls, linux_sha256, darwin_urls, darwin_sha256,
                     windows_urls, windows_sha256)
Repository rule used to install cypress binary.

PARAMETERS

name

Name of the external workspace where the cypress binary lives

version

Version of cypress binary to use. Should match package.json

linux_urls

(Optional) URLs at which the cypress binary for linux distros of linux can be downloaded. If omitted, https://cdn.cypress.io/desktop will be used.

Defaults to []

linux_sha256

(Optional) SHA-256 of the linux cypress binary

Defaults to ""

darwin_urls

(Optional) URLs at which the cypress binary for darwin distros of linux can be downloaded. If omitted, https://cdn.cypress.io/desktop will be used.

Defaults to []

darwin_sha256

(Optional) SHA-256 of the darwin cypress binary

Defaults to ""

windows_urls

(Optional) URLs at which the cypress binary for windows distros of linux can be downloaded. If omitted, https://cdn.cypress.io/desktop will be used.

Defaults to []

windows_sha256

(Optional) SHA-256 of the windows cypress binary

Defaults to ""

esbuild_repositories

USAGE

esbuild_repositories(name, npm_repository)

Helper for fetching and setting up the esbuild versions and toolchains

PARAMETERS

name

currently unused

Defaults to ""

npm_repository

the name of the repository where the @bazel/esbuild package is installed by npm_install or yarn_install.

Defaults to "npm"