Skip to content

Commit

Permalink
Adds load visibility to publish tools and refactors it to match new c…
Browse files Browse the repository at this point in the history
…onventions.

Refs #67.
  • Loading branch information
dgp1130 committed Feb 19, 2023
1 parent 8c009fa commit 686f7c5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@bazel_skylib//lib:dicts.bzl", "dicts")
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@rules_prerender_npm//:defs.bzl", "npm_link_all_packages")
load("//tools/publish:npm_publish.bzl", "npm_publish")
load("//tools/publish:defs.bzl", "npm_publish")
load("//tools/stamping:stamp_package.bzl", "stamp_package")
load("//tools/typescript:defs.bzl", "types_only")
load("//:index.bzl", "link_prerender_component", "prerender_component")
Expand Down
2 changes: 1 addition & 1 deletion packages/declarative_shadow_dom/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ load(
)
load("//tools/jasmine:defs.bzl", "jasmine_node_test")
load("//tools/typescript:defs.bzl", "ts_project")
load("//tools/publish:npm_publish.bzl", "npm_publish")
load("//tools/publish:defs.bzl", "npm_publish")
load("//tools/stamping:stamp_package.bzl", "stamp_package")

prerender_component_publish_files(
Expand Down
6 changes: 6 additions & 0 deletions tools/publish/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library")

exports_files(["npm_publish.sh"], visibility = ["//visibility:public"])

bzl_library(
name = "defs",
srcs = ["defs.bzl"],
deps = [":npm_publish"],
)

bzl_library(
name = "npm_publish",
srcs = ["npm_publish.bzl"],
Expand Down
5 changes: 5 additions & 0 deletions tools/publish/defs.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
load(":npm_publish.bzl", _npm_publish = "npm_publish")

visibility("public")

npm_publish = _npm_publish
2 changes: 2 additions & 0 deletions tools/publish/npm_publish.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ load("@aspect_rules_js//npm:providers.bzl", "NpmPackageInfo")
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("//common:label.bzl", "absolute", "file_path_of")

visibility("private")

def npm_publish(name, package, npmrc, testonly = None, visibility = None):
"""Publishes the given `npm_package()` to NPM.
Expand Down

0 comments on commit 686f7c5

Please sign in to comment.