Docs overview
Docs overview
This page describes how Mesh will work, not how it works today. It is a live spec of the developer experience, written before the code. Mesh is not released: nothing here can be installed or run yet, and any detail may change.
Mesh is a TypeScript framework modelled on Ash, the declarative resource framework for Elixir. You describe a resource once, in one .mx file: its data, its actions and its rules. Mesh derives types, handlers and schema from that file. Mesh runs on Bun only.
Mesh serves any kind of program: a command line, a daemon, a worker or a web app. There is no server in version 1 and no transport at all. An action is a generated TypeScript function, and calling it is the whole interface.
How to read these pages
These pages are written before the code, from the design, to model how using Mesh should feel. They are a live spec: a specific proposal, not a description of a shipped framework. Anything on them can change, and several details are marked “Not decided yet” with a link to the decision record that has to settle them.
If you want to know what Mesh does rather than what it will do, read the Architecture section: the roadmap, the decision records and the research behind them.
The reading path
- Getting started — which page answers which question, and how to try Mesh today.
- Installation — Bun, and adding Mesh to a new or existing project.
- Example: a todo list — two resources, a relationship, a validation, a policy and a calculation, and a script that calls them. This is the page to read first if you want to see the shape of the thing.
- Usage — the loop: change a resource, build, let the type checker tell you what broke, update the database, check before committing.
- Project structure — which files live where, and which ones are committed.
- Calling actions — the generated signatures, the scope argument, filters,
load, the error classes andcan. - Configuration —
mesh.config.ts: the resource folder, the output folder, the data adapter, the extensions. - Command-line tool — every
meshcommand, the guard, andexplain. - Resource file reference — the tags a resource file may use, one by one.
What exists today
Only two things:
- Tag contracts for resource files. The vocabulary of a resource file (
resource,attribute,createand so on) is defined as contracts that MX, the parser Mesh builds on, enforces when it parses a.mxfile. The code ispackages/compiler/src/contracts.tsin the repository. See the Resource file reference. - The resource model. A plain-data representation of a resource: attributes, actions, relationships and their registries, with a diagnostic type. It is
packages/modelin the repository.
There is no code generation, no runtime, no CLI and no package to install. Milestone M0 is done; M1, the build skeleton, is next. The order of work is the roadmap.
The vocabulary follows Ash’s DSL for v1, in kebab-case with the trailing ? dropped, and is reviewed after v1. allow-nil, type="atom", destination= and create-timestamp are the current spellings in the aligned contracts and the Resource file reference. The vocabulary mapping lists every one and what Ash does.