From 4a93661a0a894a17f68a004d6f44f76989ba04f1 Mon Sep 17 00:00:00 2001 From: Caleb Foust Date: Thu, 25 Jun 2026 04:45:22 -0700 Subject: [PATCH] fix: docs build failure and add local example validation The docs build was failing because the signal/wait example blocks forever (nothing sends :my-channel in a standalone run), timing out the Janet example validator. Mark it `# ignore` like other blocking examples; the non-blocking signal/send example stays validated. Also fix a dynamic-property arity mismatch in layouts.md: the :title property now passes (size, layout), so border-title takes [size layout] (border-fg is preset with only the layout, so it stays [layout]). This clears the "function takes at most 1 args, got 2" log lines. Add a `just docs-validate` recipe that runs CI's exact example check locally. It clears both docs/.docusaurus and docs/node_modules/.cache so the markdown preprocessor actually re-runs -- a stale webpack cache otherwise reuses processed output and silently skips validation. Co-Authored-By: Claude Opus 4.8 (1M context) --- docs/docs/layouts.md | 2 +- justfile | 9 +++++++++ pkg/cy/api/docs-signal.md | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/docs/layouts.md b/docs/docs/layouts.md index 256eb6c0..b39368ca 100644 --- a/docs/docs/layouts.md +++ b/docs/docs/layouts.md @@ -85,7 +85,7 @@ This example uses the following code: (defn border-title - [layout] + [size layout] # Get the NodeID of the node the user is attached to (def node (layout/attach-id layout)) (if diff --git a/justfile b/justfile index 9f784141..f12c7148 100644 --- a/justfile +++ b/justfile @@ -46,6 +46,15 @@ docs-build-assets: rm -rf docs/.docusaurus cd docs && npm run build +# Validate the Janet code examples embedded in the docs, the same check +# CI runs. Clears the Docusaurus/webpack caches first so the markdown +# preprocessor actually re-runs (otherwise cached output is reused and +# the examples are silently skipped). Skips story asset generation for +# speed. +docs-validate: + rm -rf docs/.docusaurus docs/node_modules/.cache + cd docs && CY_SKIP_ASSETS=1 npm run build + api: go run ./cmd/docs/main.go diff --git a/pkg/cy/api/docs-signal.md b/pkg/cy/api/docs-signal.md index cfbfee72..50b75e09 100644 --- a/pkg/cy/api/docs-signal.md +++ b/pkg/cy/api/docs-signal.md @@ -23,6 +23,7 @@ Optional named parameters: - `:timeout` (number, default 0): Maximum number of seconds to wait. A value of 0 means wait indefinitely. Returns an error if the timeout is reached. ```janet +# ignore # Wait with a 10-second timeout (def result (signal/wait :my-channel :timeout 10)) (print result)