Watch
1
0
Fork
You've already forked packages
0
packages/README.md
Weft packages 306b143104 packages/ at markup-kit dd1e6eb5270e
A snapshot of packages/ in the Weft repository; the official packages are published from these commits.

Markup-Kit-Commit: dd1e6eb5270e62e0c8b6c202b3d01f0da6e00ddc
2026-11-19 20:43:26 +00:00

48 lines
2.8 KiB
Markdown

# Official packages
Packages published under the `weft` owner, written in Weft over HTTP APIs and `std`. There is no npm bridge
(`docs/packages.md`, Rulings): anything an app needs from the JS ecosystem is written here instead.
| package | what | capabilities |
|---|---|---|
| [`weft/markdown`](markdown/README.md) | CommonMark and GFM: a syntax tree, HTML and a sanitiser | none |
| [`weft/stripe`](stripe/README.md) | Stripe's API: customers, Checkout, payments, subscriptions, prices, products, webhooks | `http.fetch@api.stripe.com` |
| [`weft/email`](email/README.md) | Resend and Postmark, MIME with attachments, templates rendered to HTML and text | `http.fetch@api.resend.com`, `http.fetch@api.postmarkapp.com`, `http.media` (its `Img` shows the image a template names) |
Each folder is a Weft project with its own `weft.toml`. Its tests, benchmarks and scripts stay out of the published archive
(`include` in the manifest).
## Trying them against a local registry
`scripts/verify-local.mjs` runs the whole path on this machine: it starts `apps/registry`, makes a publish token and a
signing key for the owner `weft`, publishes each package signed, and then in a fresh app runs `weft add`, `check`, `run`,
`build --target js` and `install --frozen`.
```sh
cargo build --release -p weft-cli # in core/
node packages/scripts/verify-local.mjs # every package, or name some: markdown stripe email
```
## Publishing for real
None of this has happened yet. In order:
1. **Deploy the registry** at pkg.weft-lang.dev (`apps/registry/README.md`, What a deploy needs).
2. **Make the owner's token**: `POST /v1/tokens` with `{ "owners": ["weft"] }` and the operator's `REGISTRY_ADMIN_TOKEN`. `weft` is
a reserved owner, so only the operator can grant it.
3. **Make the signing key offline**: `weft publish --new-key`, keep the secret out of the repository, and register the public
key with `PUT /v1/owners/weft/key`. From then on the registry takes only versions signed by it.
4. **Set each manifest's `repository`** to the public source. It is a placeholder today
(`https://git.weft-lang.dev/weft/packages`), and a signed statement records it for good.
5. **Publish from a clean checkout**, with the commit recorded: `WEFT_TOKEN=… WEFT_SIGNING_KEY=… WEFT_COMMIT=$(git rev-parse HEAD)
weft publish --sign --dir packages/<name>`.
6. **Look at the generated pages** (`/packages/weft/<name>`) before announcing a version: published versions can be yanked but
never changed.
Before each package's first real release:
| package | still to do |
|---|---|
| `weft/markdown` | nothing beyond the steps above |
| `weft/stripe` | run its calls against a Stripe test-mode key: so far they have met only stripe-mock and a scripted server |
| `weft/email` | send a message through Resend and Postmark with test keys: so far they have met only a scripted server |