Appearance
Publishing
Publishing turns a package directory into a tarball and pushes it somewhere a Host can install from. The default publish target is Gitea, the Matrix-native registry; Gitea serves the npm-compatible HTTP API so existing npm/pnpm tooling Just Works against it. Local registry directories are also supported for tests and air-gapped builds.
Pages
- Versioning — semver discipline,
package.jsonauthority, fork metadata - Package metadata — what
mx publishcarries beyond the tarball: discovery metadata, registry index - Gitea-backed publication — the Matrix-native registry path: HiveCast production runs Gitea behind the npm protocol
- npm-compatible publication — the default
mx publish --registry <url>path - Signing and trust — target state
- Release channels — target state, partial: npm dist-tags + Matrix-side conventions
Where Gitea fits
The registry-side description (where bytes end up, how the index is updated, channels and revocation) lives in the docs-registry Publishing section. This page is the author-facing pipeline: how mx publish runs.
| Concern | This docs package | docs-registry |
|---|---|---|
mx publish flow, dry-run, errors | yes | no |
Versioning, package.json discipline | yes | no |
| Where the tarball lands | no | yes |
| How the catalog index is updated | no | yes |
| Revocation, promotion, dist-tags | partial (author actions) | full |
What mx publish does, in order
- Resolves
cwdand registry options (packages/mx-cli/src/commands/publish.ts:88-105). - Reads stored credentials. If no credential is found, throws
MX_AUTH_REQUIRED. Runmx loginfirst. - Runs
ensurePublishPreflight:- Re-validates
matrix.jsonagainst the CLI validator. - Checks
runtime.entryexists on disk. - Checks
webapp.distDir/webapp.entryexists if awebappblock is declared. - Checks the package declares at least one of: root actor, a component, a webapp, or a
matrix.service.jsonfactory.
- Re-validates
- Reads the version from
package.json. - Extracts discovery metadata (
packages/mx-cli/src/utils/discovery-extractor.ts). - Packs the tarball:
- For npm-compatible registries (Gitea is one), uses
packNpmPublishTarball(npm's own pack logic). - For local registries, uses the in-tree
packCommand.
- For npm-compatible registries (Gitea is one), uses
- If
--dry-run, returns the tarball path and exits. - Otherwise:
- For npm-compatible registries, calls
publishNpmTarballwhich shells out tonpm publishagainst the configured registry URL. - For local registries, calls
publishRegistryVersionto record the tarball under<registryRoot>/<packageName>/<version>/and updates the local discovery index.
- For npm-compatible registries, calls
Status: target state — single manifest (P1.41). Today the publish-preflight checks honor either a
matrix.service.jsonfactory reference or amatrix.json-declared instance factory. P1.41 absorbsmatrix.service.jsonintomatrix.json. After P1.41 the preflight only checksmatrix.json. See P1.41.
The two registry surfaces
Default — npm-compatible HTTP registry (Gitea behind the API)
bash
mx publish --registry https://registry.hivecast.ai/api/packages/open-matrix/npm/Used when --registry is set or when no --registry-dir is set. Default URL is https://registry.hivecast.ai/api/packages/open-matrix/npm/ (packages/mx-cli/src/utils/config-store.ts:DEFAULT_PACKAGE_REGISTRY).
Gitea serves the npm-compatible API; from mx publish's point of view it is just an npm registry that happens to be reversible (operators can delete versions on Gitea). This is the v1 path.
Local — directory-backed registry
bash
mx publish --registry-dir /tmp/my-registryWrites the tarball into <registry-dir>/<packageName>/<version>/ and updates <registry-dir>/index.json. No HTTP server involved. Useful for tests, air-gapped environments, and CI fixtures.
The two are mutually exclusive: --registry and --registry-dir together throw MX_REGISTRY_INVALID.
Public — npmjs.com (target state, vertical-specific)
Status: target state — vertical-specific, post-v1. The npm publish safety audit at
projects/matrix-3/packages/docs/content/security/npm-publish-safety.mdis mandatory prerequisite reading. Once published to npmjs.com, a version is permanent — npm does not allow deletion. The substrate's launch wedge ishivecast install gitea://...and the MCP bridge, not npmjs.com publication.
See also
- Overview → Package lifecycle
- Installing — the receiving side of every publication path
- Reference → CLI reference
docs-registry/ Publishing — registry-side description
Source:
projects/matrix-3/packages/mx-cli/src/commands/publish.tsorchestrates the publish flow;packages/mx-cli/src/utils/npm-registry-client.tsandpackages/mx-cli/src/utils/registry-store.tsimplement the two registry surfaces.