| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
Package manager for daslang. Installs, updates, builds, and manages daslang modules from git repositories or a central package index.
# run daspkg
daslang utils/daspkg/main.das -- <command> [args...]
# install a package by name (from the index)
daslang utils/daspkg/main.das -- install daspkg-test-pure
# install a package by URL
daslang utils/daspkg/main.das -- install github.com/borisbat/daspkg-test-pure
# install a specific version
daslang utils/daspkg/main.das -- install github.com/borisbat/daspkg-test-versions@1.0
# install all dependencies listed in .das_package
daslang utils/daspkg/main.das -- install
# install globally (shared across projects)
daslang utils/daspkg/main.das -- install --global dasImgui| Command | Description |
|---|---|
| install <url|name|path>[@version] | Install a package from git, index, or local path |
| install (no args) | Install all dependencies from .das_package |
| remove <name> | Remove an installed package |
| update [name] | Re-install at pinned version (re-clone, rebuild) |
| upgrade [name] | Upgrade to latest version |
| list | List installed packages |
| search <query> | Search the package index |
| build | Build all C/C++ packages (cmake) |
| check | Verify installed packages are present |
| doctor | Check environment (git, cmake, gh) |
| release [--out <dir>] [--paranoid | --quick] | Bundle project as a redistributable standalone. Release ALWAYS mints the tune sidecar; --quick is the only mode that inherits a complete existing one |
| introduce [url] | Submit a package to the index via PR |
| withdraw <name> | Remove a package from the index via PR |
All package commands accept --global / -g to operate on global modules.
| Flag | Description |
|---|---|
| --root <path> | Project root (default: current directory) |
| --force | Force reinstall (overrides duplicate/version checks) |
| --global, -g | Operate on global modules in {das_root}/modules/ |
| --color / --no-color | Enable/disable ANSI colored output |
| --verbose, -v | Print debug details (git commands, resolve steps) |
| --json | Machine-readable JSON output (search, list, check) |
| --branch <name>, -b <name> | Install from a git branch (e.g. master) instead of a tag |
| --out <path> | Output directory for release (default: current directory) |
| --paranoid | Accepted for compatibility; the tuner runs one margin-decided protocol and this flag no longer changes the budget |
| --quick | During release, accept a complete existing sidecar instead of re-minting (an incomplete or stale scope still mints - an exe never ships unmeasured). Forgetting it costs one re-mint, never correctness |
Large packages (e.g. dasImgui) can be installed globally - once under {das_root}/modules/ - shared across all projects using that SDK. Avoids redundant clones and builds.
daspkg install --global dasImgui # install to das_root/modules/
daspkg list --global # list global packages
daspkg update --global dasImgui # re-install at pinned version
daspkg remove --global dasImgui # remove globallyExecutable daslang script declaring metadata, version resolution, dependencies, and build info.
options gen2
require daslib/daspkg
[export]
def package() {
package_name("mymodule")
package_author("username")
package_description("What this module does")
package_source("github.com/user/mymodule")
package_license("MIT")
package_tag("networking")
package_min_sdk("0.4")
}
[export]
def resolve(sdk_version, version : string) {
if (version == "" || version == "latest") {
download_tag("v2.0")
} else {
download_tag("v{version}")
}
// alternatives: download_branch("main"), download_redirect("github.com/other/repo", "v3.0")
}
[export]
def dependencies(version : string) {
require_package("github.com/user/dep-a", ">=1.0")
require_package("github.com/user/dep-b")
}
[export]
def build() {
cmake_build() // or: custom_build("make all"), or: no_build()
}
[export]
def release() {
release_main("main.das")
release_include("assets/**") // release-owned; refreshed every time
release_include_if_missing("app.toml") // user-owned after initialization
}Use release_include_if_missing for editable deployment files. They are copied only when absent, excluded from .daspkg_release.manifest, and preserved even when upgrading from an older manifest that previously treated the same path as release-owned.
All functions except package() are optional. A repo without .das_package gets a "dumb clone" - no version resolution, no deps, no build.
my_project/
main.das
.das_package # project manifest (lists dependencies)
daspkg.lock # installed packages, versions, sources
modules/
<package_name>/
.das_module # provided by package author
.das_package # package manifest
_build/ # cmake build directory (if C++ package)
*.shared_module # built C++ output (if applicable)
.daspkg_cache/ # index cache (gitignored)
.daspkg_tmp/ # temp dir during install (gitignored)
{das_root}/ # daScript SDK root (for global modules)
modules/
.daspkg_global.lock # global lock file
<global_package>/
.daspkg_standalone # marker: built by daspkg, skip in CMake
{
"sdk_version": "",
"packages": [
{
"name": "mymodule",
"source": "github.com/user/mymodule",
"version": "1.0",
"tag": "v1.0",
"branch": "",
"root": true,
"local": false,
"global": false
}
]
}The global lock file ({das_root}/modules/.daspkg_global.lock) uses the same format.
| File | Description |
|---|---|
| main.das | CLI entry point - parses args, dispatches to commands |
| commands.das | Command implementations: install, remove, update, upgrade, build, check, doctor |
| index.das | Package index: fetch, search, introduce, withdraw |
| lockfile.das | LockFile / PackageEntry structs, JSON serialization |
| package_runner.das | In-process .das_package compiler - compiles, simulates, extracts metadata |
| utils.das | Shared utilities: run_cmd, force_rmdir, path helpers |
| daslib/daspkg.das | API module that .das_package scripts require |
The package runner compiles .das_package scripts in-process using compile_file + simulate + invoke_in_context. It calls exported functions and reads state from daslib/daspkg module globals via get_context_global_variable.
Review gates live in REVIEW.md - run the unit suite on every change.
| File | Count | Type |
|---|---|---|
| test_daspkg.das | 151 | Unit tests (local operations, parsing, lock file, package_runner) |
| test_daspkg_git.das | 70 | Integration tests (git clone, version resolve, index, global modules) |
# unit tests - fast, no network
daslang dastest/dastest.das -- --test utils/daspkg/test_daspkg.das
# integration tests - requires network
daslang dastest/dastest.das -- --test utils/daspkg/test_daspkg_git.das| Repository | Purpose |
|---|---|
| borisbat/daspkg-test-pure | Pure daslang module |
| borisbat/daspkg-test-versions | Module with version tags (v1.0, v2.0) |
| borisbat/daspkg-test-deps | Module with transitive dependency |
| borisbat/daspkg-index | Central package index |
Run daspkg doctor to check your environment.
| Back | FazBrowse Home | New Git URL |