-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathts.MODULE.bazel
More file actions
62 lines (52 loc) · 2.03 KB
/
ts.MODULE.bazel
File metadata and controls
62 lines (52 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
"""Configuration for Bazel with Node.js, TypeScript, and JavaScript dependencies."""
PNPM_VERSION = "10.22.0"
NODE_VERSION = "22.8.0"
# Node.js
# See: https://github.com/bazel-contrib/rules_nodejs/blob/main/nodejs/private/node_versions.bzl
bazel_dep(name = "rules_nodejs", version = "6.7.3")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True)
node.toolchain(node_version = NODE_VERSION)
# TypeScript.
bazel_dep(name = "aspect_rules_ts", version = "3.8.3")
rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext", dev_dependency = True)
rules_ts_ext.deps(ts_version_from = "//:package.json")
use_repo(rules_ts_ext, "npm_typescript")
# JavaScript.
bazel_dep(name = "aspect_rules_js", version = "2.9.2")
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
npm.npm_translate_lock(
name = "npm",
data = [
":package.json",
":pnpm-workspace.yaml",
"//js:package.json",
"//third_party/docsite:package.json",
],
npmrc = "//:.npmrc",
pnpm_lock = "//:pnpm-lock.bazel.yaml",
update_pnpm_lock = True,
verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")
# Allow us to do 'bazel run @pnpm -- --dir=$PWD install'
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm", dev_dependency = True)
pnpm.pnpm(
name = "pnpm",
pnpm_version = PNPM_VERSION,
)
use_repo(pnpm, "pnpm")