Adding Packages
Use nubo get to add a package.
nubo get github.com/nubolang/colorYou can add a specific revision with @.
nubo get github.com/nubolang/color@f5063d6If no revision is provided, Nubo uses latest.
nubo get github.com/nubolang/colorURI Format
Section titled “URI Format”Package URIs are parsed like this:
domain/user/repodomain/user/repo@versiondomain/user/repo/subpathdomain/user/repo/subpath@versionExamples:
nubo get github.com/nubolang/colornubo get github.com/nubolang/color@mainnubo get github.com/nubolang/color@f5063d6nubo get github.com/org/repo/subpackageNubo accepts URIs with or without https://.
nubo get https://github.com/nubolang/colornubo get github.com/nubolang/colorInternally, the source becomes a Git URL:
https://github.com/nubolang/color.gitWhat Happens During Add
Section titled “What Happens During Add”When a package is added, Nubo:
- Parses the package URI.
- Builds a Git repository URL.
- Clones the repository into a temporary cache path.
- Resolves the requested revision.
- Checks out the exact commit.
- Moves the package into the global package cache.
- Hashes the package directory.
- Updates
_nubo.yaml. - Updates
lock.yaml. - Loads and merges nested dependencies from the package’s own
lock.yaml, if it exists.
Cache Path
Section titled “Cache Path”Downloaded packages are stored in the global cache.
~/nubo/packages/<domain>/<user>/<repo>@<full-commit-hash>Example:
~/nubo/packages/github.com/nubolang/color@f5063d6fa53bf8be818f4316273ee81fb5474d21Package Name
Section titled “Package Name”A package added from:
github.com/nubolang/colorgets the package name:
nubolang/colorIf a subpath is used:
github.com/org/repo/tools/colorsthe package name becomes:
org/repo/tools/colorsUpdating Existing Entries
Section titled “Updating Existing Entries”If a package already exists in _nubo.yaml or lock.yaml, Nubo updates the existing entry instead of adding a duplicate.
Entries are matched by package name or source URL.
Nested Dependencies
Section titled “Nested Dependencies”If the downloaded package contains a lock.yaml, Nubo loads it and merges its entries into the current project’s lockfile.
This lets packages bring their own locked dependencies.
Example
Section titled “Example”nubo get github.com/nubolang/colorResult in _nubo.yaml:
packages: - source: https://github.com/nubolang/color.git commit: f5063d6Result in lock.yaml:
entries: - name: nubolang/color source: https://github.com/nubolang/color.git commit_hash: f5063d6fa53bf8be818f4316273ee81fb5474d21 hash: sha256:d0b1dc4e7af156690f762c2d90c6bbe62c7ad265cd9a9e9e54c30fac26cbf0ef