-
-
Notifications
You must be signed in to change notification settings - Fork 167
Expand file tree
/
Copy pathMODULE.bazel
More file actions
129 lines (123 loc) · 4.32 KB
/
MODULE.bazel
File metadata and controls
129 lines (123 loc) · 4.32 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
module(name = "examples")
bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True)
local_path_override(
module_name = "aspect_rules_js",
path = "..",
)
bazel_dep(name = "bazel_lib", version = "3.0.0", dev_dependency = True)
bazel_dep(name = "bazel_skylib", version = "1.5.0", dev_dependency = True)
bazel_dep(name = "jq.bzl", version = "0.4.0", dev_dependency = True)
bazel_dep(name = "platforms", version = "1.0.0", dev_dependency = True)
bazel_dep(name = "rules_nodejs", version = "6.7.3", dev_dependency = True)
bazel_dep(name = "rules_shell", version = "0.6.1", dev_dependency = True)
node = use_extension(
"@rules_nodejs//nodejs:extensions.bzl",
"node",
dev_dependency = True,
)
use_repo(node, "nodejs_toolchains")
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")
pnpm.pnpm(
name = "pnpm",
pnpm_version = "10.22.0",
pnpm_version_integrity = "sha512-vwSe/plbKPUn/StBrgR0zikYb37cs79UUIe9Yfu+uyv3U2LRMH/aCcLSiOHkmXh6wS1Py2F6l0cYpgUfLu50HA==",
)
use_repo(pnpm, "pnpm", "pnpm__links")
npm = use_extension(
"@aspect_rules_js//npm:extensions.bzl",
"npm",
dev_dependency = True,
)
npm.npm_translate_lock(
name = "npm",
bins = {
# derived from "bin" attribute in node_modules/typescript/package.json
"typescript": [
"tsc=./bin/tsc",
"tsserver=./bin/tsserver",
],
},
custom_postinstalls = {
"@aspect-test/c": "echo moo > cow.txt",
"@aspect-test/[email protected]": "echo mooo >> cow.txt",
},
data = [
"//:package.json",
"//:pnpm-workspace.yaml",
"//js_binary:package.json",
"//js_lib_pkg/a:package.json",
"//js_lib_pkg/b:package.json",
"//linked_consumer:package.json",
"//linked_empty_node_modules:package.json",
"//linked_lib:package.json",
"//linked_pkg:package.json",
"//macro:package.json",
"//nextjs:package.json",
"//npm_deps:package.json",
"//npm_deps/patches:[email protected]",
"//npm_package/libs/lib_a:package.json",
"//npm_package/packages/pkg_a:package.json",
"//npm_package/packages/pkg_b:package.json",
"//npm_package/packages/pkg_d:package.json",
"//npm_package/packages/pkg_e:package.json",
"//package_json_module:package.json",
"//runfiles:package.json",
"//stack_traces:package.json",
"//vite3:package.json",
"//vite6:package.json",
"//webpack_cli:package.json",
],
generate_bzl_library_targets = True,
lifecycle_hooks_execution_requirements = {
"*": [
"no-sandbox",
],
},
npmrc = "//:.npmrc",
package_visibility = {
"@mycorp/pkg-a": [
"//js_binary:__subpackages__",
"//npm_deps:__subpackages__",
],
"@mycorp/pkg-d": [
"//npm_deps:__subpackages__",
"//npm_package:__subpackages__",
],
"@mycorp/pkg-e": ["//npm_deps:__subpackages__"],
},
pnpm_lock = "//:pnpm-lock.yaml",
public_hoist_packages = {
# Instructs the linker to hoist the [email protected] npm package to `node_modules/ms` in the `npm_deps` package.
# Similar to adding `public-hoist-pattern[]=ms` in .npmrc but with control over which version to hoist and where
# to hoist it. This hoisted package can be referenced by the label `//npm_deps:node_modules/ms` same as
# other direct dependencies in the `npm_deps/package.json`.
"[email protected]": ["npm_deps"],
},
update_pnpm_lock = True,
use_pnpm = "@pnpm//:package/bin/pnpm.cjs",
verify_node_modules_ignored = "//:.bazelignore",
verify_patches = "//npm_deps/patches:patches",
)
use_repo(
npm,
"npm",
"npm__next__14.2.35_1816342077__links",
"npm__rollup__4.55.2",
"npm__rollup__4.55.2__links",
)
# As an example, manually import a package using explicit coordinates.
# Just a demonstration of the syntax de-sugaring.
npm.npm_import(
name = "acorn__8.4.0",
bins = {"acorn": "./bin/acorn"},
integrity = "sha512-ULr0LDaEqQrMFGyQ3bhJkLsbtrQ8QibAseGZeaSUiT/6zb9IvIkomWHJIvgvwad+hinRAgsI51JcWk2yvwyL+w==",
package = "acorn",
# Root package where to link the package store
root_package = "",
version = "8.4.0",
)
use_repo(
npm,
"acorn__8.4.0",
"acorn__8.4.0__links",
)