|
1 |
| -workspace(name = "aspect_rules_js") |
| 1 | +# This file is not used by Bazel 8 and should be removed. |
| 2 | +# |
| 3 | +# However its presence works around issues with some tools: |
| 4 | +# https://github.com/bazel-contrib/bazel-gazelle/issues/2012 |
| 5 | +# https://github.com/bazelbuild/bazel-watcher/issues/646 |
2 | 6 |
|
3 |
| -# buildifier: disable=bzl-visibility |
4 |
| -load("//js/private:dev_deps.bzl", "rules_js_dev_dependencies") |
5 |
| - |
6 |
| -rules_js_dev_dependencies() |
7 |
| - |
8 |
| -load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") |
9 |
| - |
10 |
| -rules_js_dependencies() |
11 |
| - |
12 |
| -load("@aspect_rules_js//js:toolchains.bzl", "rules_js_register_toolchains") |
13 |
| - |
14 |
| -rules_js_register_toolchains(node_version = "16.14.2") |
15 |
| - |
16 |
| -load("@aspect_bazel_lib//lib:repositories.bzl", "register_expand_template_toolchains") |
17 |
| - |
18 |
| -register_expand_template_toolchains() |
19 |
| - |
20 |
| -load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains") |
21 |
| - |
22 |
| -# Alternate toolchains for testing across versions |
23 |
| -nodejs_register_toolchains( |
24 |
| - name = "node16", |
25 |
| - node_version = "16.13.1", |
26 |
| -) |
27 |
| - |
28 |
| -nodejs_register_toolchains( |
29 |
| - name = "node18", |
30 |
| - node_version = "18.13.0", |
31 |
| -) |
32 |
| - |
33 |
| -nodejs_register_toolchains( |
34 |
| - name = "node20", |
35 |
| - node_version = "20.11.1", |
36 |
| -) |
37 |
| - |
38 |
| -load("@bazel_skylib//lib:unittest.bzl", "register_unittest_toolchains") |
39 |
| - |
40 |
| -register_unittest_toolchains() |
41 |
| - |
42 |
| -load("@aspect_bazel_lib//lib:host_repo.bzl", "host_repo") |
43 |
| - |
44 |
| -host_repo(name = "aspect_bazel_lib_host") |
45 |
| - |
46 |
| -############################################ |
47 |
| -# Example npm dependencies |
48 |
| - |
49 |
| -load("@aspect_rules_js//npm:repositories.bzl", "npm_import", "npm_translate_lock") |
50 |
| - |
51 |
| -npm_translate_lock( |
52 |
| - name = "npm", |
53 |
| - bins = { |
54 |
| - # derived from "bin" attribute in node_modules/typescript/package.json |
55 |
| - "typescript": { |
56 |
| - "tsc": "./bin/tsc", |
57 |
| - "tsserver": "./bin/tsserver", |
58 |
| - }, |
59 |
| - }, |
60 |
| - custom_postinstalls = { |
61 |
| - "@aspect-test/c": "echo moo > cow.txt", |
62 |
| - "@aspect-test/c@2.0.2": "echo mooo >> cow.txt", |
63 |
| - }, |
64 |
| - data = [ |
65 |
| - "//:examples/npm_deps/patches/meaning-of-life@1.0.0-pnpm.patch", |
66 |
| - "//:package.json", |
67 |
| - "//:pnpm-workspace.yaml", |
68 |
| - "//examples/js_binary:package.json", |
69 |
| - "//examples/linked_consumer:package.json", |
70 |
| - "//examples/linked_empty_node_modules:package.json", |
71 |
| - "//examples/linked_lib:package.json", |
72 |
| - "//examples/linked_pkg:package.json", |
73 |
| - "//examples/macro:package.json", |
74 |
| - "//examples/npm_deps:package.json", |
75 |
| - "//examples/npm_package/libs/lib_a:package.json", |
76 |
| - "//examples/npm_package/packages/pkg_a:package.json", |
77 |
| - "//examples/npm_package/packages/pkg_b:package.json", |
78 |
| - "//examples/npm_package/packages/pkg_d:package.json", |
79 |
| - "//examples/npm_package/packages/pkg_e:package.json", |
80 |
| - "//examples/runfiles:package.json", |
81 |
| - "//examples/webpack_cli:package.json", |
82 |
| - "//js/private/coverage/bundle:package.json", |
83 |
| - "//js/private/image:package.json", |
84 |
| - "//js/private/test/image:package.json", |
85 |
| - "//js/private/test/js_run_devserver:package.json", |
86 |
| - "//js/private/worker/src:package.json", |
87 |
| - "//npm/private/test:package.json", |
88 |
| - "//npm/private/test:vendored/lodash-4.17.21.tgz", |
89 |
| - "//npm/private/test/npm_package:package.json", |
90 |
| - "//npm/private/test/npm_package_publish:package.json", |
91 |
| - "//npm/private/test/vendored/is-odd:package.json", |
92 |
| - "//npm/private/test/vendored/semver-max:package.json", |
93 |
| - ], |
94 |
| - exclude_package_contents = { |
95 |
| - "chalk": ["**/README*"], |
96 |
| - }, |
97 |
| - generate_bzl_library_targets = True, |
98 |
| - lifecycle_hooks = { |
99 |
| - # We fetch @kubernetes/client-node from source and it has a `prepare` lifecycle hook that needs to be run |
100 |
| - # which runs the `build` package.json script: https://github.com/kubernetes-client/javascript/blob/fc681991e61c6808dd26012a2331f83671a11218/package.json#L28. |
101 |
| - # Here we run run build so we just run `tsc` instead of `npm run build` which ends up just running `tsc`. |
102 |
| - "@kubernetes/client-node": ["build"], |
103 |
| - # 'install' hook fails as it assumes the following path to `node-pre-gyp`: ./node_modules/.bin/node-pre-gyp |
104 |
| - # https://github.com/stultuss/protoc-gen-grpc-ts/blob/53d52a9d0e1fe3cbe930dec5581eca89b3dde807/package.json#L28 |
105 |
| - "protoc-gen-grpc@2.0.3": [], |
106 |
| - }, |
107 |
| - lifecycle_hooks_execution_requirements = { |
108 |
| - "*": [ |
109 |
| - "no-sandbox", |
110 |
| - ], |
111 |
| - # If @kubernetes/client-node is not sandboxed, will fail with |
112 |
| - # ``` |
113 |
| - # src/azure_auth.ts(97,43): error TS2575: No overload expects 2 arguments, but overloads do exist that expect either 1 or 4 arguments. |
114 |
| - # src/azure_auth.ts(98,34): error TS2575: No overload expects 2 arguments, but overloads do exist that expect either 1 or 4 arguments. |
115 |
| - # src/gcp_auth.ts(93,43): error TS2575: No overload expects 2 arguments, but overloads do exist that expect either 1 or 4 arguments. |
116 |
| - # src/gcp_auth.ts(94,34): error TS2575: No overload expects 2 arguments, but overloads do exist that expect either 1 or 4 arguments. |
117 |
| - # ``` |
118 |
| - # since a `jsonpath-plus@7.2.0` that is newer then the transitive dep `jsonpath-plus@0.19.0` is found outside of the sandbox that |
119 |
| - # includes typings that don't match the 0.19.0 "any" usage. |
120 |
| - "@kubernetes/client-node": [], |
121 |
| - "@figma/nodegit": [ |
122 |
| - "no-sandbox", |
123 |
| - "requires-network", |
124 |
| - ], |
125 |
| - "esbuild": [ |
126 |
| - "no-sandbox", |
127 |
| - "requires-network", |
128 |
| - ], |
129 |
| - "segfault-handler": [ |
130 |
| - "no-sandbox", |
131 |
| - "requires-network", |
132 |
| - ], |
133 |
| - "puppeteer": [ |
134 |
| - "no-sandbox", |
135 |
| - "requires-network", |
136 |
| - ], |
137 |
| - }, |
138 |
| - npmrc = "//:.npmrc", |
139 |
| - package_visibility = { |
140 |
| - "unused": ["//visibility:private"], |
141 |
| - "@mycorp/pkg-a": ["//examples:__subpackages__"], |
142 |
| - }, |
143 |
| - pnpm_lock = "//:pnpm-lock.yaml", |
144 |
| - # Use a version that's not vendored into rules_js by providing a (version, integrity) tuple. |
145 |
| - # curl --silent https://registry.npmjs.org/pnpm | jq '.versions["8.6.11"].dist.integrity' |
146 |
| - pnpm_version = ("8.6.11", "sha512-jqknppuj45tDzJsLcLqkAxytBHZXIx9JTYkGNq0/7pSRggpio9wRxTDj4NA2ilOHPlJ5BVjB5Ij5dx65woMi5A=="), |
147 |
| - public_hoist_packages = { |
148 |
| - # Instructs the linker to hoist the ms@2.1.3 npm package to `node_modules/ms` in the `examples/npm_deps` package. |
149 |
| - # Similar to adding `public-hoist-pattern[]=ms` in .npmrc but with control over which version to hoist and where |
150 |
| - # to hoist it. This hoisted package can be referenced by the label `//examples/npm_deps:node_modules/ms` same as |
151 |
| - # other direct dependencies in the `examples/npm_deps/package.json`. |
152 |
| - "ms@2.1.3": ["examples/npm_deps"], |
153 |
| - }, |
154 |
| - update_pnpm_lock = True, |
155 |
| - verify_node_modules_ignored = "//:.bazelignore", |
156 |
| - verify_patches = "//examples/npm_deps/patches:patches", |
157 |
| -) |
158 |
| - |
159 |
| -load("@npm//:repositories.bzl", "npm_repositories") |
160 |
| - |
161 |
| -# Declares npm_import rules from the pnpm-lock.yaml file |
162 |
| -npm_repositories() |
163 |
| - |
164 |
| -# As an example, manually import a package using explicit coordinates. |
165 |
| -# Just a demonstration of the syntax de-sugaring. |
166 |
| -npm_import( |
167 |
| - name = "acorn__8.4.0", |
168 |
| - bins = {"acorn": "./bin/acorn"}, |
169 |
| - integrity = "sha512-ULr0LDaEqQrMFGyQ3bhJkLsbtrQ8QibAseGZeaSUiT/6zb9IvIkomWHJIvgvwad+hinRAgsI51JcWk2yvwyL+w==", |
170 |
| - package = "acorn", |
171 |
| - # Root package where to link the package store |
172 |
| - root_package = "", |
173 |
| - version = "8.4.0", |
174 |
| -) |
175 |
| - |
176 |
| -############################################ |
177 |
| -# Stardoc |
178 |
| -load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories") |
179 |
| - |
180 |
| -stardoc_repositories() |
181 |
| - |
182 |
| -load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps") |
183 |
| - |
184 |
| -rules_jvm_external_deps() |
185 |
| - |
186 |
| -load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup") |
187 |
| - |
188 |
| -rules_jvm_external_setup() |
189 |
| - |
190 |
| -load("@io_bazel_stardoc//:deps.bzl", "stardoc_external_deps") |
191 |
| - |
192 |
| -stardoc_external_deps() |
193 |
| - |
194 |
| -load("@bazel_features//:deps.bzl", "bazel_features_deps") |
195 |
| - |
196 |
| -bazel_features_deps() |
197 |
| - |
198 |
| -load("@stardoc_maven//:defs.bzl", stardoc_pinned_maven_install = "pinned_maven_install") |
199 |
| - |
200 |
| -stardoc_pinned_maven_install() |
201 |
| - |
202 |
| -# Buildifier |
203 |
| -load("@buildifier_prebuilt//:deps.bzl", "buildifier_prebuilt_deps") |
204 |
| - |
205 |
| -buildifier_prebuilt_deps() |
206 |
| - |
207 |
| -load("@buildifier_prebuilt//:defs.bzl", "buildifier_prebuilt_register_toolchains") |
208 |
| - |
209 |
| -buildifier_prebuilt_register_toolchains() |
210 |
| - |
211 |
| -# rules_lint |
212 |
| -load( |
213 |
| - "@aspect_rules_lint//format:repositories.bzl", |
214 |
| - "rules_lint_dependencies", |
215 |
| -) |
216 |
| - |
217 |
| -rules_lint_dependencies() |
218 |
| - |
219 |
| -load("@rules_multitool//multitool:multitool.bzl", "multitool") |
220 |
| - |
221 |
| -multitool( |
222 |
| - name = "multitool", |
223 |
| - lockfiles = [ |
224 |
| - "@aspect_rules_lint//format:multitool.lock.json", |
225 |
| - "@aspect_rules_lint//lint:multitool.lock.json", |
226 |
| - ], |
227 |
| -) |
228 |
| - |
229 |
| -load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies") |
230 |
| - |
231 |
| -bazel_toolchain_dependencies() |
232 |
| - |
233 |
| -load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain") |
234 |
| - |
235 |
| -llvm_toolchain( |
236 |
| - name = "llvm_toolchain", |
237 |
| - llvm_version = "14.0.0", |
238 |
| - sha256 = { |
239 |
| - "darwin-aarch64": "1b8975db6b638b308c1ee437291f44cf8f67a2fb926eb2e6464efd180e843368", |
240 |
| - "linux-x86_64": "564fcbd79c991e93fdf75f262fa7ac6553ec1dd04622f5d7db2a764c5dc7fac6", |
241 |
| - }, |
242 |
| - strip_prefix = { |
243 |
| - "darwin-aarch64": "clang+llvm-14.0.0-arm64-apple-darwin", |
244 |
| - "linux-x86_64": "clang+llvm-14.0.0-x86_64-linux-gnu", |
245 |
| - }, |
246 |
| - sysroot = { |
247 |
| - "linux-aarch64": "@org_chromium_sysroot_linux_arm64//:sysroot", |
248 |
| - "linux-x86_64": "@org_chromium_sysroot_linux_x86_64//:sysroot", |
249 |
| - "darwin-aarch64": "@sysroot_darwin_universal//:sysroot", |
250 |
| - "darwin-x86_64": "@sysroot_darwin_universal//:sysroot", |
251 |
| - }, |
252 |
| - urls = { |
253 |
| - "darwin-aarch64": ["https://github.com/aspect-forks/llvm-project/releases/download/aspect-release-14.0.0/clang+llvm-14.0.0-arm64-apple-darwin.tar.xz"], |
254 |
| - "linux-x86_64": ["https://github.com/aspect-forks/llvm-project/releases/download/aspect-release-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu.tar.xz"], |
255 |
| - }, |
256 |
| -) |
257 |
| - |
258 |
| -load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains") |
259 |
| - |
260 |
| -llvm_register_toolchains() |
| 7 | +fail("Local WORKSPACE development unsupported") |
0 commit comments