forked from bazel-contrib/rules_nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WORKSPACE
99 lines (80 loc) · 2.81 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Copyright 2017 The Bazel Authors. All rights reserved.
#
# 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.
workspace(name = "build_bazel_rules_nodejs")
load("//:package.bzl", "rules_nodejs_dependencies", "rules_nodejs_dev_dependencies")
rules_nodejs_dependencies()
rules_nodejs_dev_dependencies()
load("//internal/common:check_bazel_version.bzl", "check_bazel_version")
# 0.18.0: support for .bazelignore
check_bazel_version("0.18.0")
#
# Load and install our dependencies downloaded above.
#
local_repository(
name = "program_example",
path = "examples/program",
)
local_repository(
name = "packages_example",
path = "examples/packages",
)
load("//:defs.bzl", "node_repositories", "yarn_install", "npm_install")
# Install a hermetic version of node.
# After this is run, these labels will be available:
# - NodeJS:
# @nodejs//:node
# - NPM:
# @nodejs//:npm
# - The yarn package manager:
# @nodejs//:yarn
node_repositories(
package_json = [
"//:package.json",
"//examples/rollup:package.json",
"@program_example//:package.json",
"//internal/test:package.json",
"//internal/npm_install/test:package.json",
],
preserve_symlinks = True,
)
# Now the user must run either
# bazel run @nodejs//:yarn
# or
# bazel run @nodejs//:npm
load("@packages_example//:setup_workspace.bzl", "packages_example_setup_workspace")
packages_example_setup_workspace()
# Dependencies to run skydoc
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")
sass_repositories()
load("@io_bazel_skydoc//skylark:skylark.bzl", "skydoc_repositories")
skydoc_repositories()
# Dependencies to run buildifier and skylint
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
go_rules_dependencies()
go_register_toolchains()
#
# Install npm dependencies for tests
#
yarn_install(
name = "fine_grained_deps_yarn",
package_json = "//internal/e2e/fine_grained_deps:package.json",
yarn_lock = "//internal/e2e/fine_grained_deps:yarn.lock",
included_files = ["", ".js", ".d.ts", ".json", ".proto"],
)
npm_install(
name = "fine_grained_deps_npm",
package_json = "//internal/e2e/fine_grained_deps:package.json",
package_lock_json = "//internal/e2e/fine_grained_deps:package-lock.json",
included_files = ["", ".js", ".d.ts", ".json", ".proto"],
)