Skip to content

Commit e14acf8

Browse files
committed
docs: complete rule documentation audit and regeneration
Regenerated comprehensive rule documentation using proper schema-driven approach to ensure all 34 rules and providers are accurately documented. Key improvements: - All implemented rules now properly documented including previously missing wac_bundle, wac_plug, and go_wasm_component_test - Documentation generated from source schemas rather than manual edits - Verified parameter types and mandatory/optional status against actual rule implementations - Complete coverage of WIT, Rust, Go, JS, C++, WAC, RPC, and tooling rules - Accurate load statements and working examples for each rule The documentation audit confirmed 34 total rules with proper attribute definitions, examples, and provider documentation. All missing rules were already present in the schema generator but required regeneration to appear in the final documentation.
1 parent 3703d45 commit e14acf8

24 files changed

+697
-456
lines changed

docs-site/astro.config.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ export default defineConfig({
2222
description: 'Modern Bazel rules for building and composing WebAssembly components',
2323
expressiveCode: {
2424
themes: ['github-dark', 'github-light'],
25-
// Map languages for better syntax highlighting
26-
langs: ['python', 'rust', 'go', 'javascript', 'typescript', 'bash', 'yaml', 'json', 'dockerfile'],
2725
// Use Python grammar for Starlark since Starlark syntax is a subset of Python
2826
shiki: {
2927
langAlias: {

docs-site/src/components/CodeFromFile.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ try {
5757
}
5858
5959
} catch (e) {
60-
error = `Error reading file ${file}: ${e.message}`;
60+
error = `Error reading file ${file}: ${e instanceof Error ? e.message : String(e)}`;
6161
content = error;
6262
}
6363

docs-site/src/content/docs/guides/guest-vs-native-guest-bindings.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Guest vs Native-Guest Bindings
2+
title: Guest vs Native-Guest Bindings
33
description: Understanding the difference between guest component bindings and native-guest application bindings
44
---
55

@@ -63,7 +63,7 @@ wit_bindgen::generate!({
6363

6464
To understand this architecture, it's important to know the WebAssembly Component Model terminology:
6565

66-
- **Host Runtime**: The runtime environment (wasmtime, browser, etc.) that executes WebAssembly components
66+
- **Host Runtime**: The runtime environment (wasmtime, browser, etc.) that executes WebAssembly components
6767
- **Guest Component**: The WebAssembly component implementation that runs inside the host runtime
6868
- **Native-Guest Application**: A native application that works with component interfaces but runs natively
6969
- **WIT**: WebAssembly Interface Type definitions that describe component interfaces
@@ -340,4 +340,4 @@ Guest and native-guest bindings enable a rich development ecosystem around WebAs
340340
341341
This dual binding architecture resolves target triple mismatches while enabling powerful tooling and testing capabilities for WebAssembly component development.
342342
343-
> **Key Takeaway**: Don't confuse our "native-guest bindings" with the WebAssembly Component Model "host runtime" (wasmtime). Native-guest bindings are for native applications, host runtimes are separate executables that run guest components.
343+
> **Key Takeaway**: Don't confuse our "native-guest bindings" with the WebAssembly Component Model "host runtime" (wasmtime). Native-guest bindings are for native applications, host runtimes are separate executables that run guest components.

docs-site/src/content/docs/guides/host-vs-wasm-bindings.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Guest vs Native-Guest Bindings
2+
title: Guest vs Native-Guest Bindings
33
description: Understanding the difference between guest component bindings and native-guest application bindings
44
---
55

@@ -63,7 +63,7 @@ wit_bindgen::generate!({
6363

6464
To understand this architecture, it's important to know the WebAssembly Component Model terminology:
6565

66-
- **Host Runtime**: The runtime environment (wasmtime, browser, etc.) that executes WebAssembly components
66+
- **Host Runtime**: The runtime environment (wasmtime, browser, etc.) that executes WebAssembly components
6767
- **Guest Component**: The WebAssembly component implementation that runs inside the host runtime
6868
- **Native-Guest Application**: A native application that works with component interfaces but runs natively
6969
- **WIT**: WebAssembly Interface Type definitions that describe component interfaces

docs-site/src/content/docs/guides/multi-file-packaging.mdx

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Learn how to package WebAssembly components with additional files, configuration
2929
Multi-file packaging offers several strategies:
3030

3131
- **Embedded Resources** - Files built directly into the component (recommended)
32-
- **OCI Image Layers** - Traditional container-style multi-layer packaging
32+
- **OCI Image Layers** - Traditional container-style multi-layer packaging
3333
- **Bundle Archives** - Pre-packaged archives with component plus files
3434
- **Sidecar Artifacts** - Separate OCI artifacts for different file types
3535

@@ -38,7 +38,7 @@ Multi-file packaging offers several strategies:
3838
| Approach | Best For | Complexity | Performance | Security |
3939
|----------|----------|------------|-------------|----------|
4040
| **Embedded Resources** | Config files, small assets | Low | Excellent | Simple |
41-
| **OCI Image Layers** | Large assets, dynamic files | Medium | Good | Complex |
41+
| **OCI Image Layers** | Large assets, dynamic files | Medium | Good | Complex |
4242
| **Bundle Archives** | Related file collections | Medium | Good | Medium |
4343
| **Sidecar Artifacts** | Independent file lifecycles | High | Variable | Complex |
4444

@@ -48,7 +48,7 @@ Multi-file packaging offers several strategies:
4848

4949
**When to use embedded resources:**
5050
- **Configuration files** that ship with your component
51-
- **Templates and schemas** your component needs at runtime
51+
- **Templates and schemas** your component needs at runtime
5252
- **Small static assets** like icons or default data
5353
- **Documentation** that should travel with the component
5454
- **Files under 1MB total** (keeps component size reasonable)
@@ -67,13 +67,13 @@ impl Guest for Component {
6767
// Parse the embedded configuration
6868
let config: Config = serde_json::from_str(CONFIG)
6969
.expect("Invalid embedded config");
70-
70+
7171
// Use embedded template
7272
let response = TEMPLATE.replace("{{data}}", &input);
73-
73+
7474
// Validate against embedded schema
7575
validate_response(&response, SCHEMA);
76-
76+
7777
response
7878
}
7979
}
@@ -94,7 +94,7 @@ rust_wasm_component_bindgen(
9494
# Files are embedded via include_str!/include_bytes! in source
9595
data = [
9696
"config/production.json",
97-
"schemas/api.json",
97+
"schemas/api.json",
9898
"templates/response.html",
9999
],
100100
)
@@ -124,7 +124,7 @@ write_file(
124124
)
125125

126126
rust_wasm_component_bindgen(
127-
name = "configured_component",
127+
name = "configured_component",
128128
srcs = ["src/lib.rs"],
129129
wit = ":interfaces",
130130
data = [":production_config"],
@@ -175,7 +175,7 @@ genrule(
175175
)
176176

177177
genrule(
178-
name = "config_layer",
178+
name = "config_layer",
179179
srcs = [":production_configs"],
180180
outs = ["config.tar"],
181181
cmd = "tar -cf $@ -C $(dirname $(location :production_configs)) config/",
@@ -186,7 +186,7 @@ oci_image(
186186
name = "multi_layer_component",
187187
base = ":base_component_layer",
188188
tars = [
189-
":assets_layer",
189+
":assets_layer",
190190
":config_layer",
191191
],
192192
env = {
@@ -207,17 +207,17 @@ impl Guest for Component {
207207
// Read configuration from layer
208208
let config_path = std::env::var("COMPONENT_CONFIG_PATH")
209209
.unwrap_or("/etc/component/config.json".to_string());
210-
210+
211211
let config_content = fs::read_to_string(config_path)
212212
.expect("Failed to read configuration");
213-
213+
214214
// Access assets from layer
215215
let assets_path = std::env::var("COMPONENT_ASSETS_PATH")
216216
.unwrap_or("/var/lib/component/assets".to_string());
217-
217+
218218
let asset_files = fs::read_dir(assets_path)
219219
.expect("Failed to access assets directory");
220-
220+
221221
"Component initialized with layered files".to_string()
222222
}
223223
}
@@ -255,7 +255,7 @@ pkg_tar(
255255
srcs = [
256256
":my_component",
257257
"//config:production_files",
258-
"//docs:api_documentation",
258+
"//docs:api_documentation",
259259
"//schemas:validation_schemas",
260260
],
261261
package_dir = "/component",
@@ -286,12 +286,12 @@ impl Guest for Component {
286286
// Extract bundle at runtime
287287
let cursor = Cursor::new(BUNDLE_DATA);
288288
let mut archive = Archive::new(cursor);
289-
289+
290290
// Process files from bundle
291291
for entry in archive.entries().unwrap() {
292292
let mut entry = entry.unwrap();
293293
let path = entry.path().unwrap();
294-
294+
295295
match path.to_str() {
296296
Some("config/app.json") => {
297297
let mut config_content = String::new();
@@ -304,7 +304,7 @@ impl Guest for Component {
304304
_ => {} // Skip other files
305305
}
306306
}
307-
307+
308308
"Bundle extracted and processed".to_string()
309309
}
310310
}
@@ -338,7 +338,7 @@ impl Guest for Component {
338338
wasm_component_oci_image(
339339
name = "core_component",
340340
component = ":business_logic",
341-
package_name = "core-service",
341+
package_name = "core-service",
342342
tag = "v1.2.0",
343343
)
344344

@@ -355,10 +355,10 @@ oci_image(
355355
],
356356
)
357357

358-
# Assets sidecar
358+
# Assets sidecar
359359
oci_image(
360360
name = "assets_sidecar",
361-
base = "@distroless_base",
361+
base = "@distroless_base",
362362
files = {
363363
"/var/www/": "//assets:web_assets",
364364
},
@@ -383,7 +383,7 @@ oci_push(
383383
)
384384

385385
oci_push(
386-
name = "publish_assets",
386+
name = "publish_assets",
387387
image = ":assets_sidecar",
388388
repository = "registry.example.com/apps/core-service-assets",
389389
tag = "v1.2.0",
@@ -406,16 +406,16 @@ spec:
406406
repository: registry.example.com/apps/core-service
407407
tag: v1.2.0
408408
signature: sha256:abc123...
409-
410-
- name: configuration
409+
410+
- name: configuration
411411
type: config-files
412412
repository: registry.example.com/apps/core-service-config
413413
tag: v1.2.0
414414
signature: sha256:def456...
415415
mountPath: /etc/app/
416-
416+
417417
- name: assets
418-
type: static-files
418+
type: static-files
419419
repository: registry.example.com/apps/core-service-assets
420420
tag: v1.2.0
421421
signature: sha256:ghi789...
@@ -424,7 +424,7 @@ spec:
424424
425425
**Benefits of sidecar artifacts:**
426426
- ✅ **Independent lifecycles** - Update files without touching code
427-
- ✅ **Team separation** - Different teams manage different artifacts
427+
- ✅ **Team separation** - Different teams manage different artifacts
428428
- ✅ **Granular security** - Separate signatures for each artifact type
429429
- ✅ **Flexible composition** - Mix and match artifacts for different deployments
430430
@@ -452,17 +452,17 @@ wasm_component_signed_oci_image(
452452
```
453453

454454
#### OCI Image Layers
455-
```python title="BUILD.bazel"
455+
```python title="BUILD.bazel"
456456
# Dual signing: component signature + OCI manifest signature
457457
wasm_component_signed_oci_image(
458458
name = "signed_layered_component",
459459
component = ":base_component",
460460
additional_layers = [":config_layer", ":assets_layer"],
461-
461+
462462
# Sign the WASM component
463463
sign_component = True,
464464
component_signing_keys = ":component_keys",
465-
465+
466466
# Sign the complete OCI image (including layers)
467467
sign_oci_image = True,
468468
oci_signing_key = ":oci_keys",
@@ -474,7 +474,7 @@ wasm_component_signed_oci_image(
474474
# Each artifact signed independently
475475
wasm_component_signed_oci_image(
476476
name = "signed_core_component",
477-
component = ":core_service",
477+
component = ":core_service",
478478
sign_component = True,
479479
component_signing_keys = ":component_keys",
480480
)
@@ -486,7 +486,7 @@ cosign_sign(
486486
)
487487

488488
cosign_sign(
489-
name = "signed_assets_sidecar",
489+
name = "signed_assets_sidecar",
490490
image = ":assets_sidecar",
491491
key = ":assets_signing_key",
492492
)
@@ -501,7 +501,7 @@ cosign_sign(
501501
# Verify component signature
502502
wasmsign2 verify component.wasm --public-key component.pub
503503

504-
# Verify OCI image signatures
504+
# Verify OCI image signatures
505505
cosign verify registry.example.com/apps/service:v1.0.0 --key cosign.pub
506506

507507
# Verify sidecar signatures
@@ -557,7 +557,7 @@ genrule(
557557
```python title="BUILD.bazel"
558558
# Phase 1: Embedded resources (minimal change)
559559
rust_wasm_component_bindgen(
560-
name = "component_v1",
560+
name = "component_v1",
561561
srcs = ["src/lib.rs"],
562562
wit = ":interfaces",
563563
# Add embedded files gradually
@@ -568,7 +568,7 @@ rust_wasm_component_bindgen(
568568
rust_wasm_component_bindgen(
569569
name = "component_v2",
570570
srcs = ["src/lib.rs"],
571-
wit = ":interfaces",
571+
wit = ":interfaces",
572572
data = [
573573
"config/basic.json",
574574
"templates/response.html",
@@ -589,7 +589,7 @@ wasm_component_oci_image(
589589
### Choose the Right Approach
590590

591591
1. **Start with embedded resources** for most use cases
592-
2. **Use OCI layers** only when files are large or update independently
592+
2. **Use OCI layers** only when files are large or update independently
593593
3. **Consider bundle archives** for document collections
594594
4. **Use sidecar artifacts** only for complex multi-team scenarios
595595

@@ -651,6 +651,6 @@ copy_file(
651651
---
652652

653653
**Next Steps:**
654-
- Try the [embedded resources example](../examples/multi-language#embedded-resources)
654+
- Try the [embedded resources example](../examples/multi-language#embedded-resources)
655655
- Learn about [OCI signing](../security/oci-signing) for multi-layer packages
656-
- Explore [production deployment](../production/deployment-guide) patterns
656+
- Explore [production deployment](../production/deployment-guide) patterns

0 commit comments

Comments
 (0)