Skip to content

yaoxiang.lock Format

yaoxiang.lock is YaoXiang's dependency lock file, recording the exact version information for all dependencies.

Overview

  • Auto-generated: Automatically generated and updated by yaoxiang install and yaoxiang update
  • Do not edit manually: This file is automatically maintained by the package manager
  • Should be committed to version control: Ensures team members and CI builds use the same dependency versions

File Structure

toml
# Auto-generated by YaoXiang package manager

[package]
version = 1

[package.dependency-name]
version = "version number"
source = "source type"
checksum = "checksum (optional)"

Field Descriptions

[package] Section

FieldTypeDescription
versionintegerLock file format version, currently 1

[package.<name>] Section

FieldTypeDescription
versionstringResolved exact version number
sourcestringDependency source: registry, git, or path
checksumstringSHA-256 checksum (optional)

Example

toml
# Auto-generated by YaoXiang package manager
# 2024-01-15 10:30:00

[package]
version = 1

[package.http]
version = "1.0.0"
source = "registry"
checksum = "abc123..."

[package.json]
version = "2.0.0"
source = "registry"

[package.utils]
version = "0.1.0"
source = "path"

[package.bleeding]
version = "main"
source = "git"

Source Types

TypeDescriptionConfiguration Example
registryFetched from remote registryhttp = "1.0.0"
gitFetched from Git repository{ git = "https://..." }
pathFetched from local path{ path = "./lib" }

Relationship with Manifest

yaoxiang.toml          yaoxiang.lock
     │                       │
     │   yaoxiang install    │
     ├──────────────────────►│
     │                       │
     │   Declare "http = *>" │  Lock "http = 1.0.0"
     │                       │
  • yaoxiang.toml: Declares the desired dependencies (can use ranges)
  • yaoxiang.lock: Records the actually installed versions (exact versions)