Skip to main content

Module manifest

Module manifest 

Source
Expand description

Packaging slice 1 (#2207, track design/tracks/packaging.md §3, §4, §6.2): the bynk.toml tables that give a project a package identity and group projects into a workspace — [package], [dependencies], [dev-dependencies], [registries] and [workspace].

Everything here is checked; nothing here resolves. [registries] is inert configuration, and a well-formed, non-empty [dev-dependencies] is refused until slice 2b. [dependencies] path sources resolve in crate::packages (#2223), and [workspace] drives the bynk driver’s check, fmt and test across its members (crate::workspace).

The readers take a toml::Table and return typed configs, the way workers_config_from and test_targets_from do; crate::check_manifest_str calls them, and so refuses what they refuse.

Structs§

DependencySpec
One [dependencies] or [dev-dependencies] entry.
PackageConfig
[package]: a shareable project’s identity (track §3.2, decision D).
RegistryConfig
One [registries.<name>] entry (track §6.2, decision E). Inert until slice 4: nothing fetches.
WorkspaceConfig
[workspace] (decision C): the member globs and the paths they skip.

Enums§

DependencySource
Where a declared dependency comes from: exactly one of these.

Constants§

DEPENDENCY_KEYS
The entry keys of a [dependencies] or [dev-dependencies] entry.
MAX_SEGMENT_LEN
The longest an organisation, package or registry name segment may be.
REGISTRY_KEYS
The entry keys of a [registries.<name>] entry.
RESERVED
The organisation reserved for first-party packages (ADR 0012), and the name mirror-of uses for the first-party registry.

Functions§

dependencies_from
A [dependencies] or [dev-dependencies] table’s entries, each checked for shape (decision A). table is the table’s name, for messages.
identifier_problem
The problem with a package segment or an alias (decision G: [a-z][a-z0-9_]*, not a keyword): each is written in source as the first segment of <alias>.<unit>.
is_semver
Whether version is strict semver 2.0: MAJOR.MINOR.PATCH, no leading zeros, with an optional -prerelease and +build.
org_problem
The problem with an organisation segment (decision G: [a-z][a-z0-9-]*).
package_config_from
[package]’s typed content (decision D). An unknown key is crate::check_manifest_str’s to refuse.
package_name_problem
The problem with an org/package name, as (segment, problem).
read_package_config
The project’s [package] as both the build and the editor see it, the way crate::read_unstable_config reads [unstable]: the overlay’s bynk.toml when it holds one, otherwise the one on disk. None when there is no manifest, no [package], or one that isn’t well formed: its shape errors are crate::check_manifest’s to report.
registries_from
[registries]’s entries, each checked (decision E), and the rules across them: an organisation is routed by one registry at most, and a mirror mirrors bynk or a registry that isn’t itself a mirror.
registry_name_problem
The problem with a registry name (decision G: [a-z][a-z0-9-]*, not bynk).
registry_token_var
The environment variable a registry’s token is read from (track §6.1): BYNK_REGISTRY_<NAME>_TOKEN, the name uppercased with - mapped to _. A registry name holds no _, so two names never share a variable.
workspace_config_from
[workspace]’s typed content (decision C). An unknown key is crate::check_manifest_str’s to refuse; whether the globs match any member is crate::workspace::load_workspace’s.