Add a package manager: rex init/add/remove/get/update/deps

Packages come from git (a registry can be added later; a bare version in
rex.toml is reserved for it). rex.toml [deps] names them, rex.lock pins exact
commits, and run/build/check/test download what is missing. `import json`
reads the package's json.rex; package files get `@json...` module keys so they
never mix with the project's own files. Newest tag of the same major version
wins when packages disagree. The language server reads downloaded packages.
Docs: docs/14-packages.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Your NameandClaude Opus 5.5 committed 2026-11-16 10:30:11 +01:00
1 parent 300d767124
commit 15da1e2379
16 files changed
+1588 -61

No files matched your search

+9 -1
View File
@@ -2208,7 +2208,15 @@ fn docs_examples_run() {
let end = after.find("```").unwrap();
let code = &after[..end];
rest = &after[end + 3..];
if !code.contains("func main") || code.contains("import utils") {
// programs that import files or packages that aren't in the text can't run alone
let foreign = code.lines().any(|l| {
// `import "zlib.h"` and `import z "zlib.h"` are C headers
l.strip_prefix("import ").map_or(false, |rest| {
let w = rest.split_whitespace().next().unwrap_or("");
!rest.contains('"') && !rex::stdlib::MODULES.contains(&w)
})
});
if !code.contains("func main") || foreign {
continue;
}
// the output block, if one follows right away