The package
spaces/ is one npm project. Each folder in it is one space, and the folder name is the space’s id.
spaces/package.json
@tilde/spaces (hooks and components) and @tilde/contract (your handlers, typed) at build time, so don’t list them.
A page
A space default-exports a component, and exports atitle. This one lists customers, shows one, and logs a call with the setNotes action.
spaces/customers/index.tsx
- Importing a handler that doesn’t exist is a build error.
- When a page needs new data, add a read to the ontology in the same change.
- Opening the space needs an
openSpacepolicy. Theopen-customerspolicy in The ontology grants it.