hypra

SEM-014: invalid action name

Error: the page doesn't build until this is fixed.

An action's name is part of an address (/_a/cart.add) and the name AI agents call it by, so it's made of letters, digits, dots, dashes and underscores.

Fails

page(title: "Shoes", description: "All our running shoes, from light racers to trail shoes.") {
  h1 "Shoes"
  action("add to cart", id: 42) "Add to cart"
}
error[SEM-014]: `add to cart` isn't a valid action name
 --> page.hypra:3:10
  |
3 |   action("add to cart", id: 42) "Add to cart"
  |          ^^^^^^^^^^^^^
  = help: use letters, digits, dots, dashes and underscores, e.g. "cart.add"
  = docs: https://hypralang.dev/rules/sem-014/

1 error, 0 warnings

Fixed

page(title: "Shoes", description: "All our running shoes, from light racers to trail shoes.") {
  h1 "Shoes"
  action("cart.add", id: 42) "Add to cart"
}