Skip to content

Commit e069a50

Browse files
Remove dangling component-model leftovers (#158)
## Summary - remove the obsolete `component-demo/` directory - remove unused `cargo-component`/`jco` tooling entries from xtask tool management - rename `generate_component` / `generate-component` to `generate_plugin` / `generate-plugin` across grammar metadata, code, and docs - clean stale component-model wording in docs/comments to match the current WASM plugin architecture ## Validation - `cargo check` (in `xtask/`) succeeds - `cargo run -- lint` (in `xtask/`) succeeds (with existing non-strict parser generation warnings) Closes #157
1 parent 2a3bb06 commit e069a50

Some content is hidden

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

53 files changed

+63
-4997
lines changed

ADDING_GRAMMARS.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ grammars:
129129

130130
# Technical flags
131131
has_scanner: true # Set to true if scanner.c exists
132-
generate_component: true # Set to true to include in WASM builds
132+
generate_plugin: true # Set to true to include in WASM builds
133133

134134
# Visual representation
135135
icon: devicon-plain:groovy # Icon identifier (from iconify.design)
@@ -180,7 +180,7 @@ grammars:
180180
| `link` | String | ✅ Yes | Wikipedia or official documentation URL |
181181
| `trivia` | String | ✅ Yes | Interesting fact about the language |
182182
| `has_scanner` | Boolean | No | Set to `true` if `scanner.c` exists (default: `false`) |
183-
| `generate_component` | Boolean | No | Set to `true` to include in WASM plugin builds (default: `false`) |
183+
| `generate_plugin` | Boolean | No | Set to `true` to include in WASM plugin builds (default: `false`) |
184184
| `grammar_path` | String | No | For multi-grammar crates (e.g., `"dtd"` for XML/DTD) |
185185

186186
#### Sample Fields (in `samples` list)
@@ -355,7 +355,7 @@ grammars:
355355
tag: data
356356
tier: 3
357357
has_scanner: true
358-
generate_component: true
358+
generate_plugin: true
359359
icon: simple-icons:webassembly
360360
361361
inventor: Bytecode Alliance
@@ -804,7 +804,7 @@ cargo xtask lint --strict
804804

805805
#### `cargo xtask build [languages...]`
806806

807-
Builds language crates into WASM plugins (if `generate-component #true`).
807+
Builds language crates into WASM plugins (if `generate-plugin #true`).
808808

809809
```bash
810810
# Build a specific language
@@ -858,7 +858,7 @@ cargo xtask gen groovy
858858
# 4. Validate configuration
859859
cargo xtask lint
860860

861-
# 5. Build (if generate-component is enabled)
861+
# 5. Build (if generate-plugin is enabled)
862862
cargo xtask build groovy
863863

864864
# 6. Start dev server
@@ -1048,7 +1048,7 @@ tree-sitter highlight ../samples/example.groovy \
10481048

10491049
**Fix:**
10501050
- Ensure release mode: `cargo xtask build --release`
1051-
- Consider setting `generate-component #false` for rarely-used languages
1051+
- Consider setting `generate-plugin #false` for rarely-used languages
10521052
- Report to upstream if grammar seems bloated
10531053

10541054
---
@@ -1095,7 +1095,7 @@ grammars:
10951095
tag: code
10961096
tier: 2
10971097
has_scanner: true
1098-
generate_component: true
1098+
generate_plugin: true
10991099
icon: devicon-plain:groovy
11001100
11011101
inventor: James Strachan
@@ -1176,7 +1176,7 @@ grammars:
11761176
tag: config
11771177
tier: 1
11781178
has_scanner: false # ← No scanner
1179-
generate_component: true
1179+
generate_plugin: true
11801180
icon: simple-icons:toml
11811181

11821182
inventor: Tom Preston-Werner
@@ -1226,12 +1226,12 @@ grammars:
12261226

12271227
### WASM Plugin Configuration
12281228

1229-
Set `generate_component: true` to include in WASM builds:
1229+
Set `generate_plugin: true` to include in WASM builds:
12301230

12311231
```yaml
12321232
grammars:
12331233
- id: groovy
1234-
generate_component: true # Build WASM plugin
1234+
generate_plugin: true # Build WASM plugin
12351235
# ...
12361236
```
12371237

DEVELOP.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ grammar {
234234
icon "devicon-plain:rust"
235235
aliases "rs"
236236
has-scanner #true
237-
generate-component #true
237+
generate-plugin #true
238238
239239
sample {
240240
path "samples/example.rs"
@@ -246,6 +246,6 @@ grammar {
246246

247247
**Key fields:**
248248
- `license` - SPDX license for the grammar (used in generated Cargo.toml)
249-
- `generate-component #true` - Include in WASM plugin builds
249+
- `generate-plugin #true` - Include in WASM plugin builds
250250
- `has-scanner #true` - Grammar has external scanner (scanner.c)
251251
- `tier` - 1-5, affects default feature inclusion

PUBLISH.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,9 @@ The `v0.3.0` tag triggers the CI workflow in `.github/workflows/ci.yml` which:
6363

6464
### 2. WASM Plugins → npm
6565

66-
- All grammars with `generate-component: true` in
66+
- All grammars with `generate-plugin: true` in
6767
`langs/group-{animal}/{lang}/def/arborium.kdl`
68-
- Built via `cargo-component` for `wasm32-wasip2` from the same group directory
69-
- Transpiled via `jco` for browser compatibility
68+
- Built via `cargo xtask build` for `wasm32-unknown-unknown` from the same group directory
7069
- Published as per-language packages under the `@arborium` scope, e.g.
7170
`@arborium/rust`, `@arborium/javascript`, etc.
7271
- **Published together with crates.io** in the same per-group CI job for version sync
@@ -162,7 +161,7 @@ langs/group-{animal}/{lang}/crate/
162161
└── ...
163162
164163
langs/group-{animal}/{lang}/npm/
165-
├── Cargo.toml ← GENERATED for cargo-component
164+
├── Cargo.toml ← GENERATED for cargo xtask build
166165
├── src/
167166
│ └── bindings.rs ← GENERATED bindings
168167
└── package.json ← GENERATED npm package
@@ -195,7 +194,7 @@ These crates don't have `arborium.kdl` and are fully hand-written:
195194
- Runs tree-sitter generate into `grammar/src/*`
196195

197196
4. **Generates WASM plugin packages:**
198-
- Writes `langs/group-{animal}/{lang}/npm/Cargo.toml` for cargo-component build
197+
- Writes `langs/group-{animal}/{lang}/npm/Cargo.toml` for plugin builds
199198
- Writes `langs/group-{animal}/{lang}/npm/package.json` for npm publishing
200199
- Writes `langs/group-{animal}/{lang}/npm/src/bindings.rs` generated bindings
201200

@@ -259,10 +258,9 @@ These projects use arborium for syntax highlighting:
259258

260259
### In Progress
261260

262-
- [ ] WASM component plugin system
263-
- [x] WIT interfaces defined (`grammar.wit`, `host.wit`)
261+
- [ ] WASM plugin system
264262
- [x] Plugin runtime crate (`arborium-plugin-runtime`)
265-
- [x] Host component (`arborium-host`)
263+
- [x] Host runtime crate (`arborium-host`)
266264
- [x] Injection dependency resolution in browser
267265
- [ ] Dynamic grammar loading from bytes (currently loads from CDN)
268266

0 commit comments

Comments
 (0)