Skip to content

Feat/wasm poc#25

Draft
rzofchak-a2ai wants to merge 2 commits intomainfrom
feat/wasm-poc
Draft

Feat/wasm poc#25
rzofchak-a2ai wants to merge 2 commits intomainfrom
feat/wasm-poc

Conversation

@rzofchak-a2ai
Copy link
Copy Markdown

added wasm bindings to spackle commands to recreate spackle::Project::generate() done in typescript in the aggregate (insert moneyball gif here)

WASM.md contains a claude-generated rundown of all the changes. but generally:

  • wasm support added with wasm-bindgen
  • in-memory renditions of functions to support wasm exports for host-driven i/o
  • added small poc ts file that loads wasm, reads fixture project temaplates, and validates/renders. then evaluates hook plans
  • table-driven tests

run just poc to get poc output:

Loading WASM module...
WASM module loaded.

=== parse_config ===
  Name: (unnamed)
  Slots: 3
  Hooks: 2
    slot: slot_1 [String]
    slot: slot_2 [Number]
    slot: slot_3 [Boolean]
    hook: hook_1 → echo hook_1 output
    hook: hook_2 → echo hook_2 output

=== validate_config ===
  Config is valid.

=== validate_slot_data ===
  Slot data is valid.

=== Reading .j2 template files ===
  Found 5 template(s):
    bad.j2 (21 bytes)
    {{slot_2}}.j2.j2 (386 bytes)
    {{slot_1}}.j2 (386 bytes)
    subdir/bad.j2 (22 bytes)
    subdir/{{slot_1}}.j2 (386 bytes)

=== render_templates ===
  ERROR bad.j2: bad.j2: Error rendering contents: Failed to render 'bad.j2'
  {{slot_2}}.j2.j2 → 42.j2
    hello\n42\ntrue\n\nEu anim consequat est labore tempor do magna aliqua aute consectetur.\nPariatur enim c...
  ERROR subdir/bad.j2: subdir/bad.j2: Error rendering contents: Failed to render 'subdir/bad.j2'
  subdir/{{slot_1}}.j2 → subdir/hello
    hello\n42\ntrue\n\nEu anim consequat est labore tempor do magna aliqua aute consectetur.\nPariatur enim c...
  {{slot_1}}.j2 → hello
    hello\n42\ntrue\n\nEu anim consequat est labore tempor do magna aliqua aute consectetur.\nPariatur enim c...

=== Writing to output ===
  Wrote 3 file(s).

=== evaluate_hooks ===
  hook_1: WOULD RUN
    cmd: echo hook_1 output
  hook_2: WOULD RUN
    cmd: echo hook_2 output

Done.

@rzofchak-a2ai rzofchak-a2ai requested a review from andriygm April 16, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant