blob: 4f0b22af32688c026dd4fb3c6e2afd5183aa53ee [file] [log] [blame]
Rob Mohrbe98ead2019-11-14 07:16:40 -08001# Copyright 2019 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7# https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
Matthew Soulanille376d7972020-06-01 15:50:07 -070014
15workspace(
16 name = "pigweed",
17 managed_directories = {"@npm": ["node_modules"]},
18)
19
20# Set up build_bazel_rules_nodejs
21load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
22http_archive(
23 name = "build_bazel_rules_nodejs",
24 sha256 = "f9e7b9f42ae202cc2d2ce6d698ccb49a9f7f7ea572a78fd451696d03ef2ee116",
25 urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.6.0/rules_nodejs-1.6.0.tar.gz"],
26)
27
28load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories")
29
30node_repositories(package_json = ["//:package.json"])
31
32# Install packages with yarn
33load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")
34yarn_install(
35 name = "npm",
36 package_json = "//:package.json",
37 yarn_lock = "//:yarn.lock",
38)
39
40# Install Bazel rules from npm packages
41load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies")
42install_bazel_dependencies()
43
44
45# Setup TypeScript
46load("@npm_bazel_typescript//:index.bzl", "ts_setup_workspace")
47ts_setup_workspace()