package-manager 0.0.1-preview.1
The Zena package manager's libraries: manifests, version selection, lockfiles, archives and the registry client
package-manager#
Client libraries for Zena packages published on AT Protocol: package manifests (zena-package.json), lockfiles (zena-lock.json), deterministic CAR source archives, dependency resolution, and registry queries. Versions and ranges are the package zena-lang:semver (packages/semver).
Usage#
import {readManifest} from 'package-manager/manifest';
import {Range} from 'zena-lang:semver';
let manifest = readManifest('{"name": "hello", "version": "1.0.0"}');
let version = manifest.version;
let matches = version != null && Range.parse('^1.0.0').includes(version);
Libraries#
package-manager/manifest: reading a package'szena-package.json, and rewriting its dependencies while keeping the rest of the file.package-manager/workspace: a workspace's packages, read from disk: the root's manifest, the packages it lists, and the ones they depend on by path.package-manager/files: which files a package publishes: its manifest'sfilespatterns, or by default every file but tests, and always the manifest, README, and license, never hidden files,node_modules, or the lockfile.package-manager/archive: source archives, the CAR files that hold a release's source. Packing is deterministic, so the same files always have the same CID, and unpacking accepts only what packing writes.package-manager/records: the profile, release, retraction, and maintainers records, an organization's members record, and the private membership entries it commits to, read from the atproto data model with the checks their lexicons describe, and written back. Also the rules for package names.package-manager/registry-methods: the NSIDs of the App View's XRPC methods.package-manager/registry: finding packages: resolving a DID, a handle, orscope:nameto a DID, a package's versions and retractions, its profile, and its releases with their proofs.package-manager/resolve: version selection, from the ranges in all of a workspace's manifests to what its lockfile pins, installing as few versions of each package as the ranges allow.package-manager/resolution: the packages a workspace's lockfile,zena-lock.json, pins, writing it, and what writing it changes in the pins already there (diffPins), including releases changed in place.package-manager/cache: the package cache, where each source archive is unpacked intosources/<CID>for the compiler to read.package-manager/fetch: fetching pinned packages into the cache. The release record's proof is checked against the account's signing key, the record and the source archive against the CIDs the lockfile pins, and the release's dependencies against the names it maps.package-manager/validate: checking a package directory and its manifest before publishing.package-manager/testing/fake-pds: an in-process PLC directory, DNS-over-HTTPS resolver, and PDS for package accounts, for testing code that finds and fetches packages.
3.5 KiB
Raw
/**
* The NSIDs of the package host's XRPC methods, whose lexicons are in
* `packages/package-manager/lexicons/dev/zena-lang/registry`. The host serves
* them (`registry/xrpc`), and `zena` calls them, so both spell each name
* the same way. `test/lexicons_test.zena` checks that every one has a
* lexicon, and every host lexicon a constant here.
*/
export let COMPLETE_CHANGE = 'dev.zena-lang.registry.completeChange';
export let COMPLETE_RELEASE = 'dev.zena-lang.registry.completeRelease';
export let CREATE_AUTOMATION_ACCOUNT = 'dev.zena-lang.registry.createAutomationAccount';
export let CREATE_PACKAGE = 'dev.zena-lang.registry.createPackage';
export let CREATE_SCOPE = 'dev.zena-lang.registry.createScope';
export let CREATE_WEB_SESSION = 'dev.zena-lang.registry.createWebSession';
export let DELETE_TEAM = 'dev.zena-lang.registry.deleteTeam';
export let DESCRIBE_REGISTRY = 'dev.zena-lang.registry.describeRegistry';
export let GET_ENTRIES = 'dev.zena-lang.registry.getEntries';
export let GET_MEMBERSHIPS = 'dev.zena-lang.registry.getMemberships';
export let GET_PENDING_CHANGES = 'dev.zena-lang.registry.getPendingChanges';
export let GET_PENDING_RELEASES = 'dev.zena-lang.registry.getPendingReleases';
export let ISSUE_AUTOMATION_TOKEN = 'dev.zena-lang.registry.issueAutomationToken';
export let LIST_PACKAGES = 'dev.zena-lang.registry.listPackages';
export let LIST_SCOPE_CREATORS = 'dev.zena-lang.registry.listScopeCreators';
export let LIST_SCOPES = 'dev.zena-lang.registry.listScopes';
export let PUBLISH = 'dev.zena-lang.registry.publish';
export let PUT_MAINTAINERS = 'dev.zena-lang.registry.putMaintainers';
export let PUT_MEMBERS = 'dev.zena-lang.registry.putMembers';
export let PUT_POLICY = 'dev.zena-lang.registry.putPolicy';
export let PUT_PROFILE = 'dev.zena-lang.registry.putProfile';
export let PUT_SCOPE_CREATOR = 'dev.zena-lang.registry.putScopeCreator';
export let PUT_SCOPE_MAINTAINERS = 'dev.zena-lang.registry.putScopeMaintainers';
export let PUT_SCOPE_ORGANIZATION = 'dev.zena-lang.registry.putScopeOrganization';
export let PUT_SCOPE_PROFILE = 'dev.zena-lang.registry.putScopeProfile';
export let PUT_TEAM = 'dev.zena-lang.registry.putTeam';
export let RENAME_PACKAGE = 'dev.zena-lang.registry.renamePackage';
export let RETIRE_AUTOMATION_ACCOUNT = 'dev.zena-lang.registry.retireAutomationAccount';
export let RETRACT = 'dev.zena-lang.registry.retract';
export let UPGRADE_SCOPE = 'dev.zena-lang.registry.upgradeScope';
export let UPLOAD_ARTIFACT = 'dev.zena-lang.registry.uploadArtifact';
export let WITHDRAW_CHANGE = 'dev.zena-lang.registry.withdrawChange';
export let WITHDRAW_RELEASE = 'dev.zena-lang.registry.withdrawRelease';
/**
* The service an account's DID document names its package host by, and
* its type: a client finds the host's methods at its endpoint
* (package-manager.md, "Finding a host"). A token for the host's methods
* may name it as the fragment of the host's DID.
*/
export let REGISTRY_SERVICE = 'zena_registry';
export let REGISTRY_TYPE = 'ZenaRegistry';
/** Every method above. */
export let REGISTRY_METHODS: Array<String> = [
COMPLETE_CHANGE, COMPLETE_RELEASE, CREATE_AUTOMATION_ACCOUNT, CREATE_PACKAGE, CREATE_SCOPE,
CREATE_WEB_SESSION, DELETE_TEAM, DESCRIBE_REGISTRY, GET_ENTRIES, GET_MEMBERSHIPS, GET_PENDING_CHANGES,
GET_PENDING_RELEASES, ISSUE_AUTOMATION_TOKEN, LIST_PACKAGES, LIST_SCOPES, LIST_SCOPE_CREATORS, PUBLISH,
PUT_MAINTAINERS, PUT_MEMBERS, PUT_POLICY, PUT_PROFILE, PUT_SCOPE_CREATOR, PUT_SCOPE_MAINTAINERS,
PUT_SCOPE_ORGANIZATION, PUT_SCOPE_PROFILE, PUT_TEAM, RENAME_PACKAGE, RETIRE_AUTOMATION_ACCOUNT, RETRACT,
UPGRADE_SCOPE, UPLOAD_ARTIFACT, WITHDRAW_CHANGE, WITHDRAW_RELEASE
];
- atproto atproto.zena-lang.pkg.zena-lang.dev ~0.0.1-preview.1
- zena-lang:semver semver.zena-lang.pkg.zena-lang.dev ~0.0.1-preview.1
| Version | Published | Dependencies | Approved by |
|---|---|---|---|
| 0.0.1-preview.1 | 2026-11-19 |
|
|