From 6302cc5d37d8e52c58c41fec30d85e35596ab0d2 Mon Sep 17 00:00:00 2001 From: Dexoron Date: Sun, 5 Jul 2026 17:39:19 +0800 Subject: [PATCH] New translations dependencies.mdx (German) [ci skip] --- .../de-DE/docs/reference/dependencies.mdx.mdx | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 docs-crowdin-export/de-DE/docs/reference/dependencies.mdx.mdx diff --git a/docs-crowdin-export/de-DE/docs/reference/dependencies.mdx.mdx b/docs-crowdin-export/de-DE/docs/reference/dependencies.mdx.mdx new file mode 100644 index 0000000..a2a88a9 --- /dev/null +++ b/docs-crowdin-export/de-DE/docs/reference/dependencies.mdx.mdx @@ -0,0 +1,84 @@ +--- +sidebar_label: Dependencies +--- + +# Dependencies + +## Formats + +The `[dependencies]` section supports three formats: + +### String (registry) + +```toml +[dependencies] +fmt = "10.1.1" +spdlog = "1.12" +catch2 = "3.4.0" +``` + +The version string is used as-is for registry lookup. + +### Table (git) + +```toml +[dependencies] +fmt = { git = "https://github.com/fmtlib/fmt", tag = "10.1.1" } +``` + +Fields: `git`, `branch`, `tag`, `rev`. + +### Table (path) + +```toml +[dependencies] +mylib = { path = "../mylib" } +``` + +## Registry + +DCR uses a package registry for dependency lookup by name. + +```toml +# ~/.dcr/config.toml +[[registry]] +name = "default" +url = "https://index.dcr.pm" +``` + +Registry priority: order in `config.toml`. The `DCR_INDEX_PATH` variable overrides the path to `index.json`. + +## Git dependencies + +DCR clones git repositories via `git2`: + +* `branch` — switch to a branch +* `tag` — switch to a tag +* `rev` — switch to a specific commit +* `features` — feature flags (parsed, but does not affect build) + +Cache path: `~/.dcr/git/\/`. + +## Path dependencies + +Local paths. DCR automatically discovers include and lib directories from the neighbor's `dcr.toml`. + +```toml +[dependencies] +mylib = { path = "/abs/path/to/lib" } +mylib = { path = "../relative/path" } +``` + +## dcr.lock + +Dependency lock file. Contains package names and sources. + +Created during `dcr build` when registry dependencies are present. Not updated during `dcr add` — only on the next `dcr build`. + +## Resolution process + +1. Load all dependencies (registry → git → path) +2. For path deps: recursively read their `dcr.toml` +3. For registry deps: search `index.json` +4. For git deps: clone to cache +5. Collect `include_dirs`, `lib_dirs`, `libs` for the compiler