Skip to content

Commit a1daa8c

Browse files
committed
docs: enhance documentation with custom logo and comprehensive rule reference
This commit significantly improves the project documentation with: ## New Custom Logo - Replace generic Houston mascot with custom 3D LEGO-style logo - Features 30+ colorful blocks representing different programming languages - Dynamic 3D space composition with realistic shadows and effects - Represents WebAssembly Component Model's modularity and composition - Languages include: Rust, Go, JavaScript, C++, Python, Zig, Swift, C#, Java, AssemblyScript, Dart, OCaml, Haskell, Elixir, Kotlin, and more - Cosmic atmosphere with energy trails showing component connections ## Documentation Structure Improvements - Separate OCI Publishing from OCI Signing for clear distinction - Add new RPC & Communication category for WRPC rules - Restructure examples into Basic/Intermediate/Advanced categories - Add comprehensive troubleshooting section - New migration guides and multi-profile build documentation ## Rule Reference Enhancements - Complete rule categorization by language and functionality - Add missing npm_install rule documentation - Update go_wit_bindgen as deprecated compatibility stub - Include new WRPC rules: wrpc_bindgen, wrpc_serve, wrpc_invoke - Auto-generated documentation now covers 30+ rules and providers ## Content Quality - Fix documentation inconsistencies across all pages - Update load statement references throughout examples - Improve code formatting and remove trailing whitespace - Add proper navigation structure to Astro configuration The documentation now provides a comprehensive, well-organized reference for all WebAssembly Component Model development with rules_wasm_component.
1 parent 46458a1 commit a1daa8c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3558
-692
lines changed

MODULE.bazel.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

checksums/registry.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def _load_tool_checksums(tool_name):
1616
1717
Returns:
1818
Dict: Tool data from embedded registry, or empty dict if not found
19-
19+
2020
Note:
2121
This function uses embedded data rather than JSON file loading because
2222
Bazel rules don't have built-in JSON parsing capabilities. The embedded

checksums/registry_test.bzl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
"""Unit tests for the checksum registry API"""
22

33
load("@bazel_skylib//lib:unittest.bzl", "asserts", "unittest")
4-
load("//checksums:registry.bzl",
5-
"get_tool_checksum", "get_tool_info", "get_latest_version",
6-
"list_supported_platforms", "get_github_repo", "validate_tool_exists",
7-
"list_available_tools")
4+
load(
5+
"//checksums:registry.bzl",
6+
"get_github_repo",
7+
"get_latest_version",
8+
"get_tool_checksum",
9+
"get_tool_info",
10+
"list_available_tools",
11+
"list_supported_platforms",
12+
"validate_tool_exists",
13+
)
814

915
def _test_get_tool_checksum(ctx):
1016
"""Test get_tool_checksum function"""
@@ -145,4 +151,4 @@ def registry_test_suite(name):
145151
get_github_repo_test,
146152
validate_tool_exists_test,
147153
list_available_tools_test,
148-
)
154+
)

checksums/tools/wizer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"last_checked": "2025-08-18T00:00:00.000000Z",
66
"supported_platforms": [
77
"darwin_amd64",
8-
"darwin_arm64",
8+
"darwin_arm64",
99
"linux_amd64",
1010
"linux_arm64",
1111
"windows_amd64"
@@ -42,4 +42,4 @@
4242
}
4343
}
4444
}
45-
}
45+
}

docs-site/astro.config.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,19 @@ export default defineConfig({
8080
label: 'Guides',
8181
items: [
8282
{ label: 'Advanced Features', slug: 'guides/advanced-features' },
83+
{ label: 'Migration Guide', slug: 'guides/migration' },
8384
{ label: 'Toolchain Configuration', slug: 'guides/toolchain-configuration' },
85+
{ label: 'Multi-Profile Builds', slug: 'guides/multi-profile-builds' },
8486
{ label: 'External WIT Dependencies', slug: 'guides/external-wit-dependencies' },
8587
],
8688
},
8789
{
8890
label: 'Examples',
8991
items: [
9092
{ label: 'Basic Component', slug: 'examples/basic' },
93+
{ label: 'Basic Examples', slug: 'examples/basic-examples' },
94+
{ label: 'Intermediate Examples', slug: 'examples/intermediate-examples' },
95+
{ label: 'Advanced Examples', slug: 'examples/advanced-examples' },
9196
{ label: 'Calculator (C++)', slug: 'examples/calculator' },
9297
{ label: 'HTTP Service (Go)', slug: 'examples/http-service' },
9398
{ label: 'Multi-Language System', slug: 'examples/multi-language' },
@@ -104,6 +109,7 @@ export default defineConfig({
104109
label: 'Security',
105110
items: [
106111
{ label: 'Component Signing', slug: 'security/component-signing' },
112+
{ label: 'OCI Component Signing', slug: 'security/oci-signing' },
107113
],
108114
},
109115
{
@@ -114,6 +120,12 @@ export default defineConfig({
114120
{ label: 'Performance Optimization', slug: 'production/performance' },
115121
],
116122
},
123+
{
124+
label: 'Troubleshooting',
125+
items: [
126+
{ label: 'Export Macro Visibility', slug: 'troubleshooting/export-macro-visibility' },
127+
],
128+
},
117129
{
118130
label: 'Reference',
119131
items: [

docs-site/docs_build.bzl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ def _docs_build_impl(ctx):
1515
source_files = ctx.files.srcs
1616
package_json = ctx.file.package_json
1717

18-
1918
# Prepare input files list
2019
input_file_args = []
2120
for src in source_files:
@@ -25,7 +24,7 @@ def _docs_build_impl(ctx):
2524
ctx.actions.run_shell(
2625
command = """
2726
set -euo pipefail
28-
27+
2928
# Store execution root and output path
3029
EXEC_ROOT="$(pwd)"
3130
OUTPUT_TAR="$1"
@@ -42,7 +41,7 @@ def _docs_build_impl(ctx):
4241
# Copy all source files, maintaining docs-site structure
4342
for src_file in "$@"; do
4443
if [[ "$src_file" == docs-site/* ]]; then
45-
# Remove docs-site/ prefix to get relative path
44+
# Remove docs-site/ prefix to get relative path
4645
rel_path="${src_file#docs-site/}"
4746
dest_file="$WORK_DIR/$rel_path"
4847
dest_dir="$(dirname "$dest_file")"
@@ -103,10 +102,10 @@ docs_build = rule(
103102
toolchains = ["@rules_wasm_component//toolchains:jco_toolchain_type"],
104103
doc = """
105104
Builds documentation site using hermetic Node.js and npm from jco_toolchain.
106-
107-
This rule follows the Bazel Way by properly using toolchains instead of
105+
106+
This rule follows the Bazel Way by properly using toolchains instead of
108107
direct file references in genrules.
109-
108+
110109
Example:
111110
docs_build(
112111
name = "site",

docs-site/docs_dev.bzl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22

33
def _docs_dev_server_impl(ctx):
44
"""Implementation of docs_dev_server rule for local development"""
5-
6-
# Get jco toolchain for hermetic Node.js access
5+
6+
# Get jco toolchain for hermetic Node.js access
77
jco_toolchain = ctx.toolchains["@rules_wasm_component//toolchains:jco_toolchain_type"]
88
node = jco_toolchain.node
99
npm = jco_toolchain.npm
10-
10+
1111
# Create runner script
1212
runner = ctx.actions.declare_file(ctx.attr.name + "_runner.sh")
13-
13+
1414
# Input source files and package.json
1515
source_files = ctx.files.srcs
1616
package_json = ctx.file.package_json
17-
17+
1818
# Prepare source file list
1919
source_paths = []
2020
for src in source_files:
2121
if src.path.startswith("docs-site/"):
2222
source_paths.append(src.path)
23-
23+
2424
ctx.actions.write(
2525
output = runner,
2626
content = """#!/bin/bash
@@ -68,18 +68,18 @@ $NPM run dev
6868
npm = npm.path,
6969
copy_commands = "\n".join([
7070
'if [[ "{src}" == docs-site/* ]]; then\n' +
71-
' rel_path="${{src#docs-site/}}"\n'.format(src=src) +
71+
' rel_path="${{src#docs-site/}}"\n'.format(src = src) +
7272
' dest_file="$WORK_DIR/$rel_path"\n' +
7373
' dest_dir="$(dirname "$dest_file")"\n' +
7474
' mkdir -p "$dest_dir"\n' +
75-
' cp "{src}" "$dest_file"\n'.format(src=src) +
76-
'fi'
75+
' cp "{src}" "$dest_file"\n'.format(src = src) +
76+
"fi"
7777
for src in source_paths
78-
])
78+
]),
7979
),
8080
is_executable = True,
8181
)
82-
82+
8383
return [
8484
DefaultInfo(
8585
files = depset([runner]),
@@ -108,18 +108,18 @@ docs_dev_server = rule(
108108
executable = True,
109109
doc = """
110110
Runs a development server for the documentation site with live reload.
111-
111+
112112
This rule starts an Astro dev server on http://localhost:4321 with hot module
113113
replacement for rapid documentation development.
114-
114+
115115
Example:
116116
docs_dev_server(
117117
name = "docs_dev",
118118
srcs = glob(["src/**/*", "public/**/*", "*.json", "*.mjs"]),
119119
package_json = "package.json",
120120
)
121-
121+
122122
Run with:
123123
bazel run //docs-site:docs_dev
124124
""",
125-
)
125+
)

docs-site/scripts/generate-rule-docs.js

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,26 +177,46 @@ function generateRuleReference(schemas) {
177177
lines.push('> For the most up-to-date information, see the [source repository](https://github.com/pulseengine/rules_wasm_component).');
178178
lines.push('');
179179

180-
// Categorize rules
180+
// Categorize rules by language and type
181181
const categories = {
182182
'WIT & Interface Rules': [],
183-
'Component Rules': [],
183+
'Rust Component Rules': [],
184+
'Go Component Rules': [],
185+
'JavaScript Component Rules': [],
186+
'C++ Component Rules': [],
184187
'Composition Rules': [],
185-
'Providers': [],
186-
'Other Rules': []
188+
'RPC & Communication': [],
189+
'Component Tools': [],
190+
'Security & Signing': [],
191+
'Registry & Distribution': [],
192+
'Providers': []
187193
};
188194

189195
Object.entries(schemas).forEach(([name, data]) => {
190196
if (data.type === 'provider') {
191197
categories['Providers'].push({ name, data });
192-
} else if (name.includes('wit_')) {
198+
} else if (name.includes('wit_') && !name.includes('go_wit') && !name.includes('cpp_wit')) {
193199
categories['WIT & Interface Rules'].push({ name, data });
194-
} else if (name.includes('wasm_component') || name.includes('rust_') || name.includes('go_') || name.includes('js_') || name.includes('cpp_')) {
195-
categories['Component Rules'].push({ name, data });
200+
} else if (name.includes('rust_') || name === 'rust_wasm_component' || name === 'rust_wasm_component_bindgen' || name === 'rust_wasm_component_test') {
201+
categories['Rust Component Rules'].push({ name, data });
202+
} else if (name.includes('go_') || name === 'go_wasm_component' || name === 'go_wit_bindgen') {
203+
categories['Go Component Rules'].push({ name, data });
204+
} else if (name.includes('js_') || name.includes('jco_') || name.includes('npm_') || name === 'js_component') {
205+
categories['JavaScript Component Rules'].push({ name, data });
206+
} else if (name.includes('cpp_') || name.includes('cc_') || name === 'cpp_component') {
207+
categories['C++ Component Rules'].push({ name, data });
196208
} else if (name.includes('wac_') || name.includes('compose')) {
197209
categories['Composition Rules'].push({ name, data });
210+
} else if (name.includes('wrpc_')) {
211+
categories['RPC & Communication'].push({ name, data });
212+
} else if (name.includes('wasm_component_new') || name.includes('wasm_component_wizer') || name.includes('wasm_validate')) {
213+
categories['Component Tools'].push({ name, data });
214+
} else if (name.includes('wasm_sign') || name.includes('wasm_verify') || name.includes('wasm_keygen')) {
215+
categories['Security & Signing'].push({ name, data });
216+
} else if (name.includes('wkg_') || name.includes('wasm_component_from_oci')) {
217+
categories['Registry & Distribution'].push({ name, data });
198218
} else {
199-
categories['Other Rules'].push({ name, data });
219+
categories['Component Tools'].push({ name, data });
200220
}
201221
});
202222

0 commit comments

Comments
 (0)