cargo_toml.ts

view source

Declarations
#

3 declarations

cargo_toml_load
#

cargo_toml.ts view source

(repo_dir: string): Promise<CargoMetadata | null> import {cargo_toml_load} from '@fuzdev/fuz_gitops/cargo_toml.js';

Best-effort read of a repo's root Cargo.toml for the identity fields the gitops dashboard renders. Returns null when there's no Cargo.toml.

repo_dir

absolute path to the repo

type string

returns

Promise<CargoMetadata | null>

cargo_toml_parse
#

cargo_toml.ts view source

(contents: string): CargoMetadata import {cargo_toml_parse} from '@fuzdev/fuz_gitops/cargo_toml.js';

Extracts name/version/description/repository from the [package] and [workspace.package] tables of a Cargo.toml.

Deliberately not a full TOML parser: it scans for simple key = "value" string entries in those two tables, which covers both a single-crate manifest and a workspace root. Inline-table values like version = { workspace = true } (and the equivalent version.workspace = true) are ignored — a member crate inheriting from the workspace has no literal here, and gitops only ever reads a repo's root manifest, where these are concrete. The first non-empty value for a key wins, so a top-level [package] takes precedence over [workspace.package] when both appear.

contents

type string

returns

CargoMetadata

CargoMetadata
#

cargo_toml.ts view source

CargoMetadata import type {CargoMetadata} from '@fuzdev/fuz_gitops/cargo_toml.js';

The handful of identity fields gitops reads from a Rust repo's Cargo.toml to render it on the dashboard. Everything is optional — a workspace root has no name, and any field may be absent or inherited.

name?

type string

version?

type string

description?

type string

repository?

type string

Imported by
#