angular/devtools/WORKSPACE

110 lines
3.8 KiB
Text

# The WORKSPACE file tells Bazel that this directory is a "workspace", which is like a project root.
# The content of this file specifies all the external dependencies Bazel needs to perform a build.
####################################
# ESModule imports (and TypeScript imports) can be absolute starting with the workspace name.
# The name of the workspace should match the npm package where we publish, so that these
# imports also make sense when referencing the published package.
workspace(
name = "angular_devtools",
managed_directories = {"@npm": ["node_modules"]},
)
# These rules are built-into Bazel but we need to load them first to download more rules
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "bazel_skylib",
sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c",
urls = [
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
],
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()
# Fetch rules_nodejs so we can install our npm dependencies
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "3635797a96c7bfcd0d265dacd722a07335e64d6ded9834af8d3f1b7ba5a25bba",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.3.0/rules_nodejs-4.3.0.tar.gz"],
)
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install")
# Setup the Node.js toolchain
node_repositories(
node_version = "14.16.1",
package_json = ["//:package.json"],
)
# Fetch sass rules for compiling sass files
http_archive(
name = "io_bazel_rules_sass",
patch_args = ["-p1"],
patches = [
# Updates @bazel/work dep to 4.0.0 inside rules_sass so it is compatible
"//:io_bazel_rules_sass.patch",
],
sha256 = "5313032124ff191eed68efcfbdc6ee9b5198093b2b80a8e640ea34feabbffc69",
strip_prefix = "rules_sass-1.34.0",
urls = [
"https://github.com/bazelbuild/rules_sass/archive/1.34.0.zip",
"https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/1.34.0.zip",
],
)
# Setup the Node.js toolchain & install our npm dependencies into @npm
yarn_install(
name = "npm",
package_json = "//:package.json",
yarn_lock = "//:yarn.lock",
)
# Load karma_web_test dependencies
http_archive(
name = "io_bazel_rules_webtesting",
sha256 = "9bb461d5ef08e850025480bab185fd269242d4e533bca75bfb748001ceb343c3",
urls = ["https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.3/rules_webtesting.tar.gz"],
)
# Setup the rules_webtesting toolchain
load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories")
web_test_repositories()
load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories")
browser_repositories(
chromium = True,
firefox = True,
)
# Setup the rules_sass toolchain
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")
sass_repositories()
# Setup esbuild repositories
load("@build_bazel_rules_nodejs//toolchains/esbuild:esbuild_repositories.bzl", "esbuild_repositories")
esbuild_repositories()
# Setup repositories for browsers provided by the shared dev-infra package.
load(
"@npm//@angular/dev-infra-private/bazel/browsers:browser_repositories.bzl",
_dev_infra_browser_repositories = "browser_repositories",
)
_dev_infra_browser_repositories()
load("@build_bazel_rules_nodejs//toolchains/cypress:cypress_repositories.bzl", "cypress_repositories")
# The name you pass here names the external repository you can load cypress_web_test from
cypress_repositories(
name = "cypress",
version = "8.7.0",
)