yaoxiang.lock Format
yaoxiang.lock records the exact version information after dependency resolution.
Overview
- Automatically generated: maintained by
yx installandyx update - Do not edit manually
- Should be committed to version control: to ensure team members and CI use the same versions
File Structure
toml
# This file is automatically generated by yaoxiang, do not edit manually.
version = 1
[package.依赖名]
version = "版本号"
source = "来源"
checksum = "SHA-256"version is at the top level, not in the [package] section version = 1 is a
top-level key for the file, describing the lock file format version. Each dependency forms its own [package.<dependency name>] table, with no version format version field inside the table.
Field Description
Top Level
| Field | Type | Description |
|---|---|---|
version | integer | Lock file format version, currently 1 |
package | table | One [package.<name>] table per dependency |
[package.<dependency name>]
| Field | Type | Description |
|---|---|---|
version | string | Resolved version number |
source | string | Dependency source; the default value is registry, and the line is omitted when using the default |
checksum | string | SHA-256 checksum; not written for local sources |
Source Values
source value | Corresponding declaration | Checksum written |
|---|---|---|
git | { git = "https://..." } | ✅ |
path | { path = "../lib" } | ❌ |
workspace | { workspace = "key" } | ❌ |
registry | some-lib = "1.0.0" | Not yet implemented |
Examples
Git source (with checksum):
toml
# This file is automatically generated by yaoxiang, do not edit manually.
version = 1
[package.some-lib]
version = "0.1.0"
source = "git"
checksum = "8a56047cbb1c706f4c1bcadbaaae610d466c698f7622adf03b0d749212207914"Workspace source:
toml
# This file is automatically generated by yaoxiang, do not edit manually.
version = 1
[package.mylib]
version = "0.1.0"
source = "workspace"Relationship with the Manifest
yaoxiang.toml yaoxiang.lock
│ │
│ yx install / yx update │
├────────────────────────────►│
│ │
│ declares "^0.1.0" │ locks "0.1.0" + checksumyaoxiang.toml: declares the desired rangeyaoxiang.lock: records the actually resolved version
If the two are inconsistent at build time, an error is reported prompting you to run yx install — it does not silently auto-install.
vendor Consistency
yx run / yx check verifies that .yaoxiang/vendor/ is consistent with the lock file. When the manifest declares dependencies but install has never been run, the error message will suggest running yaoxiang install.
