Skip to main content
Version: 0.6.x

repositories

Declare runtime dependencies

These are needed for local dev, and users must install them as well. See https://docs.bazel.build/versions/main/skylark/deploying.html#dependencies

Repository Rules

cypress_repositories

Fetch external tools needed for cypress toolchain

Example usage (generated):

load("@aspect_rules_cypress//cypress:repositories.bzl", "cypress_repositories")

cypress_repositories(
# A unique name for this repository.
name = "",
version = "",
platform = "",
)

name

Required name.

A unique name for this repository.

repo_mapping

Optional dictionary: String → String.

In WORKSPACE context only: a dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository.

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).

This attribute is not supported in MODULE.bazel context (when invoking a repository rule inside a module extension's implementation function).

version

Required string.

platform

Required string.

sha256

Optional string. Default: ""

Macros and Functions

cypress_register_toolchains

Convenience macro for setting up cypress toolchain for all supported platforms.

  • create a repository for each built-in platform like "cypress_linux-x64" - this repository is lazily fetched when node is needed for that platform.

Example usage (generated):

load("@aspect_rules_cypress//cypress:repositories.bzl", "cypress_register_toolchains")

cypress_register_toolchains(
# base name for all created repos, like `cypress` or `cypress_10_1`
name = "",
)

name

Required.

base name for all created repos, like cypress or cypress_10_1

cypress_version

Optional. Default: None

Cypress version

cypress_integrity

Optional. Default: None

Mapping from platform to integrity file hash.

Valid platform values are: darwin-x64, darwin-arm64, linux-x64, linux-arm64, win32-x64. See @aspect_rules_cypress//cypress/private:versions.bzl

We have provided a helper script to help generate these integrity hashes.

bazel run @aspect_rules_cypress//scripts:mirror_releases <VERSION_NUMBER>

Alternatively, download a binary manually to compute its integrity hash, see https://docs.cypress.io/guides/references/advanced-installation#Download-URLs

Once downloaded, run shasum -a 256 to get the integrity hash

register

Optional. Default: True

Whether to call Bazel register_toolchains on the created toolchains. Should be True when used from a WORKSPACE file, and False used from bzlmod which has its own toolchain registration syntax.