Expand description
§weft-pack — packages for a content-addressed language
npm distributes names that move; weft-pack distributes hashes that can’t. A definition’s name IS the hash of its canonical bytes, so:
- a package can never be changed under you (no left-pad: unpublishing a hash breaks nothing for anyone who has the bytes, and the bytes verify),
- two packages can never conflict (defs are keyed by hash; the same def pulled in twice is literally one entry),
- names are petnames: a package’s
exportsmaps human names to hashes purely for authoring convenience — the linked module never contains a name, only hashes, - and there is no trust problem a registry must solve: verification is local. Whoever serves you the bytes, the verifier decides.
A registry is therefore just a static file host — a directory, a CDN, or
a Thread host’s .well-known/weft/ — serving <name>.weftpack.json.
The weftpack CLI (crates/weft-pack) hashes, verifies, links, and fetches.
Structs§
- Package
- A distributable set of definitions plus the petnames it exports.