forked from aspect-build/rules_js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWORKSPACE
76 lines (55 loc) · 2.11 KB
/
WORKSPACE
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
workspace(
# see https://docs.bazel.build/versions/main/skylark/deploying.html#workspace
name = "aspect_rules_js",
)
load("//js:dev_repositories.bzl", "rules_js_dev_dependencies")
rules_js_dev_dependencies()
load("//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
nodejs_register_toolchains(
name = "nodejs",
node_version = "16.9.0",
)
load("@bazel_skylib//lib:unittest.bzl", "register_unittest_toolchains")
register_unittest_toolchains()
load("@aspect_bazel_lib//lib:host_repo.bzl", "host_repo")
host_repo(name = "aspect_bazel_lib_host")
############################################
# Gazelle, for generating bzl_library targets
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
go_rules_dependencies()
go_register_toolchains(version = "1.17.2")
gazelle_dependencies()
############################################
# Example npm dependencies
load("@aspect_rules_js//js:npm_import.bzl", "npm_import", "translate_pnpm_lock")
translate_pnpm_lock(
name = "npm",
custom_postinstalls = {
"@aspect-test/c": "echo 'moo' > cow.txt",
"@aspect-test/[email protected]": "echo 'mooo' >> cow.txt",
},
patch_args = {
"@gregmagolan/test-a": ["-p1"],
},
patches = {
"@gregmagolan/test-a": ["//examples/npm_deps:patches/test-a.patch"],
"@gregmagolan/[email protected]": ["//examples/npm_deps:patches/[email protected]"],
},
pnpm_lock = "//:pnpm-lock.yaml",
)
load("@npm//:repositories.bzl", "npm_repositories")
# Declares npm_import rules from the pnpm-lock.yaml file
npm_repositories()
# As an example, manually import a package using explicit coordinates.
# Just a demonstration of the syntax de-sugaring.
npm_import(
name = "acorn__8.4.0",
integrity = "sha512-ULr0LDaEqQrMFGyQ3bhJkLsbtrQ8QibAseGZeaSUiT/6zb9IvIkomWHJIvgvwad+hinRAgsI51JcWk2yvwyL+w==",
package = "acorn",
# Root package where to link the virtual store
root_package = "",
version = "8.4.0",
)