|
| 1 | +workspace( |
| 2 | + name = "full_stack_suite", |
| 3 | +) |
| 4 | + |
| 5 | +# Docs: |
| 6 | +# "As of rules_nodejs 5.0, symlink_node_modules defaults to False and |
| 7 | +# using managed_directories is not recommended" |
| 8 | + |
| 9 | +# Issue: |
| 10 | +# https://github.com/bazelbuild/rules_nodejs/issues/2708 |
| 11 | + |
| 12 | +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 13 | + |
| 14 | +# Javascript / Typescript tooling |
| 15 | + |
| 16 | +http_archive( |
| 17 | + name = "build_bazel_rules_nodejs", |
| 18 | + sha256 = "a09edc4ba3931a856a5ac6836f248c302d55055d35d36e390a0549799c33145b", |
| 19 | + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.0.2/rules_nodejs-5.0.2.tar.gz"], |
| 20 | +) |
| 21 | + |
| 22 | +load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies") |
| 23 | + |
| 24 | +build_bazel_rules_nodejs_dependencies() |
| 25 | + |
| 26 | +load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains") |
| 27 | + |
| 28 | +nodejs_register_toolchains( |
| 29 | + name = "nodejs", # You can load another version under another name |
| 30 | + node_version = "16.13.2", |
| 31 | +) |
| 32 | + |
| 33 | +# It is also possible to set up the various things |
| 34 | +# nodejs_register_toolchains separately, which lets you do things like |
| 35 | +# set a Yarn version. |
| 36 | + |
| 37 | +# build_bazel_rules_nodejs comes with bazel_skylib |
| 38 | + |
| 39 | +load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") |
| 40 | + |
| 41 | +bazel_skylib_workspace() |
| 42 | + |
| 43 | +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") |
| 44 | + |
| 45 | +yarn_install( |
| 46 | + name = "npm", |
| 47 | + # This is required to allow rules to reach inside packages and |
| 48 | + # depend on arbitrary files. It is needed for ts_library, |
| 49 | + # ng_module, and many other cases. |
| 50 | + exports_directories_only = False, |
| 51 | + package_json = "//:package.json", |
| 52 | + yarn_lock = "//:yarn.lock", |
| 53 | +) |
| 54 | + |
| 55 | +# Setup esbuild repositories |
| 56 | + |
| 57 | +load("@build_bazel_rules_nodejs//toolchains/esbuild:esbuild_repositories.bzl", "esbuild_repositories") |
| 58 | + |
| 59 | +esbuild_repositories(npm_repository = "npm") |
| 60 | + |
| 61 | +# Needed the POM file generator: |
| 62 | + |
| 63 | +http_archive( |
| 64 | + name = "bazel_common", |
| 65 | + strip_prefix = "bazel-common-bf8e5ef95b118d1716b0cb4982cf15b6ed1c896f", |
| 66 | + url = "https://github.com/google/bazel-common/archive/bf8e5ef95b118d1716b0cb4982cf15b6ed1c896f.zip", |
| 67 | +) |
0 commit comments