Skip to content

Commit 503e2ee

Browse files
authored
Revert "fix: produce starlark_doc_extract rules for public API" (#2710)
Reverts #2703 It didn't work because this repo relies on private/ bzl files to give documentation on npm_translate_lock, among others. Also we don't want the examples to have documentation generated. See https://registry.bazel.build/docs/aspect_rules_js/3.0.0-rc3 which was wrong 😓
1 parent 3bf471e commit 503e2ee

9 files changed

Lines changed: 81 additions & 9 deletions

File tree

contrib/nextjs/BUILD.bazel

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@bazel_lib//:bzl_library.bzl", "bzl_library")
1+
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
22

33
package(default_visibility = ["//visibility:public"])
44

@@ -18,3 +18,9 @@ bzl_library(
1818
"@bazel_lib//lib:directory_path",
1919
],
2020
)
21+
22+
starlark_doc_extract(
23+
name = "defs.doc_extract",
24+
src = "defs.bzl",
25+
deps = [":defs"],
26+
)

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ Continuing our example, where we wrote a macro in `tsc.bzl`, we'd write this to
331331

332332
```starlark
333333
load("@bazel_lib//lib:docs.bzl", "stardoc_with_diff_test", "update_docs")
334-
load("@bazel_lib//:bzl_library.bzl", "bzl_library")
334+
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
335335
336336
bzl_library(
337337
name = "tsc",

examples/js_library/two/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@aspect_rules_js//js:defs.bzl", "js_test")
2-
load("@bazel_lib//:bzl_library.bzl", "bzl_library")
2+
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
33
load(":tsc.bzl", "tsc")
44

55
tsc(

examples/macro/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@bazel_lib//:bzl_library.bzl", "bzl_library")
1+
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
22
load("@npm//:defs.bzl", "npm_link_all_packages")
33
load("//examples/macro:mocha.bzl", "mocha_test")
44

js/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"Public API"
22

3-
load("@bazel_lib//:bzl_library.bzl", "bzl_library")
3+
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
44

55
exports_files(
66
glob(["*.bzl"]),

js/private/BUILD.bazel

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"Internal implementation details"
22

3-
load("@bazel_lib//:bzl_library.bzl", "bzl_library")
3+
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
44

55
package(default_visibility = ["//visibility:public"])
66

@@ -24,6 +24,12 @@ bzl_library(
2424
],
2525
)
2626

27+
starlark_doc_extract(
28+
name = "js_info_files.doc_extract",
29+
src = "js_info_files.bzl",
30+
deps = [":js_info_files"],
31+
)
32+
2733
bzl_library(
2834
name = "js_binary",
2935
srcs = ["js_binary.bzl"],
@@ -40,6 +46,12 @@ bzl_library(
4046
],
4147
)
4248

49+
starlark_doc_extract(
50+
name = "js_binary.doc_extract",
51+
src = "js_binary.bzl",
52+
deps = [":js_binary"],
53+
)
54+
4355
bzl_library(
4456
name = "js_helpers",
4557
srcs = ["js_helpers.bzl"],
@@ -62,6 +74,12 @@ bzl_library(
6274
],
6375
)
6476

77+
starlark_doc_extract(
78+
name = "js_library.doc_extract",
79+
src = "js_library.bzl",
80+
deps = [":js_library"],
81+
)
82+
6583
bzl_library(
6684
name = "js_run_binary",
6785
srcs = ["js_run_binary.bzl"],
@@ -75,6 +93,12 @@ bzl_library(
7593
],
7694
)
7795

96+
starlark_doc_extract(
97+
name = "js_run_binary.doc_extract",
98+
src = "js_run_binary.bzl",
99+
deps = [":js_run_binary"],
100+
)
101+
78102
bzl_library(
79103
name = "js_run_devserver",
80104
srcs = ["js_run_devserver.bzl"],
@@ -86,6 +110,13 @@ bzl_library(
86110
],
87111
)
88112

113+
starlark_doc_extract(
114+
name = "js_run_devserver.doc_extract",
115+
src = "js_run_devserver.bzl",
116+
symbol_names = ["js_run_devserver"],
117+
deps = [":js_run_devserver"],
118+
)
119+
89120
bzl_library(
90121
name = "js_info",
91122
srcs = ["js_info.bzl"],
@@ -107,3 +138,9 @@ bzl_library(
107138
"@tar.bzl//tar",
108139
],
109140
)
141+
142+
starlark_doc_extract(
143+
name = "js_image_layer.doc_extract",
144+
src = "js_image_layer.bzl",
145+
deps = [":js_image_layer"],
146+
)

npm/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"Public API"
22

3-
load("@bazel_lib//:bzl_library.bzl", "bzl_library")
3+
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
44

55
exports_files(
66
glob(["*.bzl"]),

npm/private/BUILD.bazel

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"Internal implementation details"
22

33
load("@aspect_rules_js//js:defs.bzl", "js_library")
4-
load("@bazel_lib//:bzl_library.bzl", "bzl_library")
54
load("@bazel_lib//lib:testing.bzl", "assert_contains")
5+
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
66

77
package(default_visibility = ["//visibility:public"])
88

@@ -47,6 +47,12 @@ bzl_library(
4747
],
4848
)
4949

50+
starlark_doc_extract(
51+
name = "npm_package.doc_extract",
52+
src = "npm_package.bzl",
53+
deps = [":npm_package"],
54+
)
55+
5056
bzl_library(
5157
name = "npm_link_package",
5258
srcs = ["npm_link_package.bzl"],
@@ -57,6 +63,12 @@ bzl_library(
5763
],
5864
)
5965

66+
starlark_doc_extract(
67+
name = "npm_link_package.doc_extract",
68+
src = "npm_link_package.bzl",
69+
deps = [":npm_link_package"],
70+
)
71+
6072
bzl_library(
6173
name = "npm_link_package_store",
6274
srcs = ["npm_link_package_store.bzl"],
@@ -103,6 +115,13 @@ bzl_library(
103115
],
104116
)
105117

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+
106125
bzl_library(
107126
name = "npm_translate_lock_generate",
108127
srcs = ["npm_translate_lock_generate.bzl"],
@@ -173,6 +192,16 @@ bzl_library(
173192
],
174193
)
175194

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+
176205
bzl_library(
177206
name = "utils",
178207
srcs = ["utils.bzl"],

platforms/pnpm/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@bazel_lib//:bzl_library.bzl", "bzl_library")
1+
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
22
load(":index.bzl", "PNPM_ARCHS", "PNPM_PLATFORMS")
33

44
# Constraints representing the pnpm [os] and [cpu] fields.

0 commit comments

Comments
 (0)