11"Internal implementation details"
22
33load ("@aspect_rules_js//js:defs.bzl" , "js_library" )
4- load ("@bazel_lib//lib:testing.bzl" , "assert_contains" )
54load ("@bazel_skylib//:bzl_library.bzl" , "bzl_library" )
65
7- package (default_visibility = ["//visibility:public " ])
6+ package (default_visibility = ["//npm:__subpackages__ " ])
87
98js_library (
109 name = "npm_publish_mjs" ,
1110 srcs = ["npm_publish.mjs" ],
11+ visibility = ["//visibility:public" ],
1212)
1313
14- exports_files (glob (["*.bzl" ]))
15-
16- # We manually keep the generated rules documentation synced.
17- # Check that the signatures stay matched.
18- [
19- assert_contains (
20- name = "_test_gendocs_{}_{}" .format (i , j ),
21- actual = actual ,
22- expected = expected ,
23- )
24- for i , actual in enumerate ([
25- "npm_translate_lock_generate.bzl" ,
26- "npm_translate_lock_generate.docs.bzl" ,
27- ])
28- for j , expected in enumerate ([
29- """def npm_link_targets(name = "node_modules", package = None, prod = True, dev = True):""" ,
30- """def npm_link_all_packages(name = "node_modules", imported_links = [], prod = True, dev = True):""" ,
31- ])
32- ]
33-
3414bzl_library (
3515 name = "npm_package" ,
3616 srcs = ["npm_package.bzl" ],
@@ -47,12 +27,6 @@ bzl_library(
4727 ],
4828)
4929
50- starlark_doc_extract (
51- name = "npm_package.doc_extract" ,
52- src = "npm_package.bzl" ,
53- deps = [":npm_package" ],
54- )
55-
5630bzl_library (
5731 name = "npm_link_package" ,
5832 srcs = ["npm_link_package.bzl" ],
@@ -63,12 +37,6 @@ bzl_library(
6337 ],
6438)
6539
66- starlark_doc_extract (
67- name = "npm_link_package.doc_extract" ,
68- src = "npm_link_package.bzl" ,
69- deps = [":npm_link_package" ],
70- )
71-
7240bzl_library (
7341 name = "npm_link_package_store" ,
7442 srcs = ["npm_link_package_store.bzl" ],
@@ -97,6 +65,8 @@ bzl_library(
9765bzl_library (
9866 name = "npm_import" ,
9967 srcs = ["npm_import.bzl" ],
68+ # It's referenced by generated repositories.
69+ visibility = ["//visibility:public" ],
10070 deps = [
10171 ":exclude_package_contents_presets.bzl" ,
10272 ":npm_link_package_store" ,
@@ -115,17 +85,9 @@ bzl_library(
11585 ],
11686)
11787
118- starlark_doc_extract (
119- name = "npm_import.doc_extract" ,
120- src = "npm_import.bzl" ,
121- symbol_names = ["npm_import" ],
122- deps = [":npm_import" ],
123- )
124-
12588bzl_library (
12689 name = "npm_translate_lock_generate" ,
12790 srcs = ["npm_translate_lock_generate.bzl" ],
128- visibility = ["//npm:__subpackages__" ],
12991 deps = [
13092 ":starlark_codegen_utils" ,
13193 ":utils" ,
@@ -139,7 +101,6 @@ bzl_library(
139101bzl_library (
140102 name = "npm_translate_lock_helpers" ,
141103 srcs = ["npm_translate_lock_helpers.bzl" ],
142- visibility = ["//npm:__subpackages__" ],
143104 deps = [
144105 "@bazel_skylib//lib:new_sets" ,
145106 ],
@@ -148,7 +109,6 @@ bzl_library(
148109bzl_library (
149110 name = "npm_translate_lock_macro_helpers" ,
150111 srcs = ["npm_translate_lock_macro_helpers.bzl" ],
151- visibility = ["//npm:__subpackages__" ],
152112 deps = [
153113 "@bazel_skylib//lib:dicts" ,
154114 ],
@@ -157,7 +117,6 @@ bzl_library(
157117bzl_library (
158118 name = "npm_translate_lock_state" ,
159119 srcs = ["npm_translate_lock_state.bzl" ],
160- visibility = ["//npm:__subpackages__" ],
161120 deps = [
162121 ":npm_translate_lock_generate" ,
163122 ":npmrc" ,
@@ -192,20 +151,9 @@ bzl_library(
192151 ],
193152)
194153
195- starlark_doc_extract (
196- name = "npm_translate_lock.doc_extract" ,
197- src = "npm_translate_lock.bzl" ,
198- symbol_names = [
199- "list_patches" ,
200- "npm_translate_lock" ,
201- ],
202- deps = [":npm_translate_lock" ],
203- )
204-
205154bzl_library (
206155 name = "utils" ,
207156 srcs = ["utils.bzl" ],
208- visibility = ["//npm:__subpackages__" ],
209157 deps = [
210158 "@bazel_lib//lib:paths" ,
211159 "@bazel_lib//lib:repo_utils" ,
@@ -218,7 +166,6 @@ bzl_library(
218166bzl_library (
219167 name = "pnpm" ,
220168 srcs = ["pnpm.bzl" ],
221- visibility = ["//npm:__subpackages__" ],
222169 deps = [
223170 "//platforms/pnpm:index_bzl" ,
224171 ],
@@ -227,7 +174,6 @@ bzl_library(
227174bzl_library (
228175 name = "transitive_closure" ,
229176 srcs = ["transitive_closure.bzl" ],
230- visibility = ["//npm:__subpackages__" ],
231177 deps = [
232178 "utils" ,
233179 "@bazel_skylib//lib:dicts" ,
@@ -237,14 +183,12 @@ bzl_library(
237183bzl_library (
238184 name = "npm_package_internal" ,
239185 srcs = ["npm_package_internal.bzl" ],
240- visibility = ["//npm:__subpackages__" ],
241186 deps = [":npm_package_info" ],
242187)
243188
244189bzl_library (
245190 name = "npm_package_store_internal" ,
246191 srcs = ["npm_package_store_internal.bzl" ],
247- visibility = ["//npm:__subpackages__" ],
248192 deps = [
249193 ":npm_package_info" ,
250194 ":npm_package_store" ,
@@ -255,29 +199,35 @@ bzl_library(
255199bzl_library (
256200 name = "pnpm_repository" ,
257201 srcs = ["pnpm_repository.bzl" ],
258- visibility = ["//npm:__subpackages__" ],
259202 deps = [
260203 ":npm_import" ,
261204 ":versions" ,
262205 ],
263206)
264207
208+ bzl_library (
209+ name = "pnpm_extension" ,
210+ srcs = ["pnpm_extension.bzl" ],
211+ deps = [
212+ ":pnpm_repository" ,
213+ ":versions" ,
214+ "@bazel_lib//lib:lists" ,
215+ ],
216+ )
217+
265218bzl_library (
266219 name = "list_sources" ,
267220 srcs = ["list_sources.bzl" ],
268- visibility = ["//npm:__subpackages__" ],
269221)
270222
271223bzl_library (
272224 name = "npm_package_info" ,
273225 srcs = ["npm_package_info.bzl" ],
274- visibility = ["//npm:__subpackages__" ],
275226)
276227
277228bzl_library (
278229 name = "npm_package_store_info" ,
279230 srcs = ["npm_package_store_info.bzl" ],
280- visibility = ["//npm:__subpackages__" ],
281231)
282232
283233bzl_library (
@@ -288,17 +238,14 @@ bzl_library(
288238bzl_library (
289239 name = "npmrc" ,
290240 srcs = ["npmrc.bzl" ],
291- visibility = ["//npm:__subpackages__" ],
292241)
293242
294243bzl_library (
295244 name = "starlark_codegen_utils" ,
296245 srcs = ["starlark_codegen_utils.bzl" ],
297- visibility = ["//npm:__subpackages__" ],
298246)
299247
300248bzl_library (
301249 name = "versions" ,
302250 srcs = ["versions.bzl" ],
303- visibility = ["//npm:__subpackages__" ],
304251)
0 commit comments