Skip to content

Commit

Permalink
Prepare to Push to BCR
Browse files Browse the repository at this point in the history
Last bit of housecleaning before attempting to push this version to the BCR. Primarily just updates examples/bzlmod/ to use clarodocs().
  • Loading branch information
JasonSteving99 committed Apr 2, 2024
1 parent c58590b commit 6704a8e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module(
name = "claro-lang",
repo_name = "claro-lang",
version = "0.1.499",
version = "0.1.500",
)

bazel_dep(name = "aspect_bazel_lib", version = "2.0.1")
Expand Down
2 changes: 1 addition & 1 deletion examples/bzlmod/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module(name = "example-claro-module")

bazel_dep(name = "claro-lang", version = "0.1.409")
bazel_dep(name = "claro-lang", version = "0.1.500")

14 changes: 14 additions & 0 deletions examples/bzlmod/hello_world_with_module_demo/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@claro-lang//:rules.bzl", "claro_binary", "claro_module")
load("@claro-lang//tools/clarodocs/generator:clarodocs_rules.bzl", "clarodocs")


claro_module(
Expand All @@ -15,3 +16,16 @@ claro_binary(
"Hello": ":hello_world",
}
)

# It's recommended to run this using `$ ibazel run hello_world_docs`. This way, you should be able to just keep the
# generated site open throughout the duration of your development session and ibazel will auto-rebuild the
# :hello_world_binary program as you save changes, and the site will automatically refresh with the latest dep graph and
# module APIs.
#
# Find instructions to install ibazel at: https://github.com/bazelbuild/bazel-watcher.
#
# You can use this `clarodocs(...)` rule to generate a site for arbitrary `claro_binary(...)` targets.
clarodocs(
name = "hello_world_docs",
root = ":hello_world_binary",
)
6 changes: 3 additions & 3 deletions tools/clarodocs/generator/clarodocs_rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ def clarodocs(name, root, out = None):
substitutions = {
"{{MODULE_DEP_GRAPH_CONFIG_JSON}}": dep_graph_json_config,
},
out = "vite-config.js",
out = name + "-vite-config.js",
)
# The clarodocs site itself is hosted from `.../tools/clarodocs/` so in order for Vite to reference the generated
# config at startup time we'll just move two levels back so that the current `native.package_name()` call works.
generated_vite_config_relative_location = "../../" + native.package_name()
# Fast developer round-trip under ibazel
js_run_devserver(
name = name,
args = [".", "--config", generated_vite_config_relative_location + "/vite-config.js"],
args = [".", "--config", generated_vite_config_relative_location + "/" + name + "-vite-config.js"],
# TODO(steving) Figure out why js_run_devserver() isn't noticing that the dep_graph_json_config is changing as
# TODO(steving) the program's source code changes.
data = RUNTIME_DEPS + [dep_graph_json_config + "_lib", "vite-config.js"],
data = RUNTIME_DEPS + [dep_graph_json_config + "_lib", name + "-vite-config.js"],
tool = "@claro-lang//tools/clarodocs:vite",
)

Expand Down
2 changes: 1 addition & 1 deletion tools/clarodocs/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ function AppImpl() {
return (
<div className="App" style={{ display: "flex", width: "100vw" }}>
<Layout>
<Header style={{ display: 'flex', height: '12vh' }}>
<Header style={{ display: 'flex', height: '8vh' }}>
<div className="demo-logo" />
<Menu
theme="dark"
Expand Down

0 comments on commit 6704a8e

Please sign in to comment.