An open API service indexing awesome lists of open source software.

https://github.com/fatalus69/valkyrie

A package manager for Odin
https://github.com/fatalus69/valkyrie

odin package-manager

Last synced: 6 months ago
JSON representation

A package manager for Odin

Awesome Lists containing this project

README

          

# Valkyrie - A package manager for Odin
## Sketch and Future TODO's:

## GENERAL:
- CLI Name: valkyrie
- Package folder: runepkg
- Config Files: valkyrie.toml (dependencies and settings) & valkyrie.lock (pin exact versions, tags or commits)
- Import style: import "runepkg:foo"

### Commands:
- valkyrie install [package] – installs one package from ressource or all packages in valkyrie.toml
- valkyrie remove [package] - removes desired package
- valkyrie update [package] - updates all or desired package
- valkyrie init – starts an interactive setup
- valkyrie clean-install - wipes + reinstalls all packages
- valkyrie list - list installed packages

##### Maybe:
- valkyrie doctor - check setup of toml
- valkyrie validate - check for invalid toml
- valkyrie graph - show dependency graph (future feature)

#### Dependency Format:
- git - with ref, tag or branch
- path - for local package development
- version (maybe)

#### Lock File:
- exact commit hash
- metadata

#### Stuff I should consider:
- A script that replaces import "runepkg:foo" with relative paths during build or a wrapper that does that during odin build

#### Example of valkyire.toml:
````toml
[dependencies]
foo = { git = "https://github.com/user/foo", rev = "main" }
bar = { git = "https://github.com/user/bar", tag = "v1.2.3" }
baz = { path = "../local_baz" }
````
#### Structure:
```
src/
├── main.odin # CLI entrypoint
├── cli/
│ ├── commands.odin # All commands and dispatch logic
│ ├── parser.odin # os.args[] parser & help output
├── core/
│ ├── config.odin # valkyrie.toml reading/writing
│ ├── lockfile.odin # valkyrie.lock reading/writing
│ ├── resolver.odin # dependency resolver (git clones, paths, etc)
│ ├── installer.odin # install/update/remove logic
│ ├── util.odin # helper stuff (string handling, error printing, etc)
└── types/
├── package.odin # structs for dependencies, versions, etc
└── config_schema.odin # if needed for TOML struct definitions
```

#### Important Structs:
```odin
Command = struct {
name: string,
requires_argument: bool,
fn: proc(arg: string),
}

Dependency = struct {
name: string,
source_type: enum { git, path },
url_or_path: string,
version: string, // rev/tag/branch
}

ProjectConfig = struct {
dependencies: map[string]Dependency,
}
```