Skip to main content

Module pkg

Module pkg 

Source
Expand description

Shared package-identity resolution.

A single package: block in the IDL (weaveffi_ir::ir::Package) is the source of truth for the name, version, and metadata stamped into every ecosystem manifest (package.json, pyproject.toml, *.gemspec, *.csproj, pubspec.yaml, Package.swift, build.gradle, go.mod).

This module centralizes the resolution rules (precedence and defaults) so all eleven generators agree on the package identity instead of each one hardcoding weaveffi / 0.1.0. Generators read resolve in their manifest code and map the ResolvedPackage fields onto whatever their ecosystem’s manifest format requires.

Structs§

ResolvedPackage
Package identity resolved for one generator/manifest.

Constants§

DEFAULT_NAME
Fallback package name when the IDL omits package.name and no per-target override or input basename is available.
DEFAULT_VERSION
Fallback package version when the IDL omits package.version.

Functions§

name_from_basename
Strip directory and extension from an IDL basename to use as a fallback package name. "path/kvstore.yml""kvstore", None/empty → DEFAULT_NAME.
pascal_ident
UpperCamelCase identifier-safe form of an arbitrary package name. Word boundaries are any run of non-alphanumerics (and existing camel humps are preserved). "my-kv.store""MyKvStore", "kvstore""Kvstore".
resolve
Resolve package identity for a generator.
sanitize_ident
Lower-case identifier-safe form of an arbitrary package name.