blob: 6a022787a9d9b171f69580fe6780149247625b0a [file]
# 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.
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@build_bazel_rules_nodejs//:defs.bzl", "COMMON_REPLACEMENTS", "npm_package")
package(default_visibility = ["//visibility:public"])
exports_files([
"common.bazelrc",
"tsconfig.json",
"package.json",
])
bzl_library(
name = "bzl",
srcs = [
"declaration_provider.bzl",
"defs.bzl",
"index.for_docs.bzl",
],
visibility = ["//visibility:public"],
deps = [
"//internal/common:bzl",
"//internal/history-server:bzl",
"//internal/http-server:bzl",
"//internal/jasmine_node_test:bzl",
"//internal/linker:bzl",
"//internal/npm_package:bzl",
"//internal/rollup:bzl",
"//toolchains/node:bzl",
],
)
# Empty node_modules filegroup used for the default
# value of the node_modules attribute in nodejs_binary
# and rollup_bundle
filegroup(
name = "node_modules_none",
srcs = [],
)
npm_package(
name = "rules_nodejs_package",
srcs = glob(["*.bzl"]) + [
"BUILD.bazel",
"LICENSE",
"rules_webtesting.patch",
],
# Don't rename BUILD files as this package is not published to npm
# but is compressed in "release" below and published as a .tar.gz to GitHub
rename_build_files = False,
# Don't replace the default 0.0.0-PLACEHOLDER for this npm_package since
# we are packaging up the packager itself and this replacement will break it
replace_with_version = "",
replacements = COMMON_REPLACEMENTS,
deps = [
"//third_party/github.com/bazelbuild/bazel:package_contents",
"//third_party/github.com/bazelbuild/bazel-skylib:package_contents",
"//third_party/github.com/buffer-from:package_contents",
"//third_party/github.com/inikulin/parse5:package_contents",
"//third_party/github.com/gjtorikian/isBinaryFile:package_contents",
"//third_party/github.com/juanjoDiaz/removeNPMAbsolutePaths:package_contents",
"//third_party/github.com/source-map:package_contents",
"//third_party/github.com/source-map-support:package_contents",
"//third_party/npm/node_modules/@babel/core:package_contents",
"//third_party/npm/node_modules/@babel/plugin-transform-modules-commonjs:package_contents",
"//third_party/npm/node_modules/babelify:package_contents",
"//third_party/npm/node_modules/base64-js:package_contents",
"//third_party/npm/node_modules/browserify:package_contents",
"//third_party/npm/node_modules/ieee754:package_contents",
"//third_party/npm/node_modules/named-amd:package_contents",
"//internal:package_contents",
"//internal/bazel_integration_test:package_contents",
"//internal/golden_file_test:package_contents",
"//internal/common:package_contents",
"//internal/copy_repository:package_contents",
"//internal/history-server:package_contents",
"//internal/http-server:package_contents",
"//internal/jasmine_node_test:package_contents",
"//internal/js_library:package_contents",
"//internal/linker:package_contents",
# TODO(alexeagle): distribute separately as @bazel/rollup
"//internal/rollup:package_contents",
"//internal/node:package_contents",
"//internal/npm_install:package_contents",
"//internal/npm_package:package_contents",
"//internal/web_package:package_contents",
"//toolchains/node:package_contents",
],
)
# This artifact is published to GitHub along with each release
pkg_tar(
name = "release",
srcs = [":rules_nodejs_package"],
extension = "tar.gz",
strip_prefix = "./rules_nodejs_package",
tags = ["manual"],
)