udd
The udd script checks the dependencies and updates the version in the URLs to the latest (matching)
published version. The version part of a dependency URL must follow the Semantic Versioning 2.0.0 ↱
specification {MAJOR.MINOR.PATCH}.
install the latest version of udd
Ensure that the ~/.deno/bin folder is already in your PATH environment variable and deno is found.
$ deno install -A -f -n udd https://deno.land/x/udd/main.ts
Check if udd is now found and executable
$ which udd
/Users/yourusername/.deno/bin/udd
$ udd --version
0.7.2
Update Project Dependencies in a Project
Check if updated dependencies are avail, but don’t update them yet.
$ udd --dry-run deps.ts
Update dependencies in a project to the latest avail version.
$ udd deps.ts
Update test_deps.ts if the project has a separate test dependencies.
$ udd test_deps.ts
Run the tests of the project to check if the update is ok.
$ deno test
In case of failed tests, fix the issues and update the tests.
Run lint to check for changes
$ deno lint
Fix linting issues if lint report problems.
If all tests succeed and ’lint’ doesn’t report errors/warnings, update/create the version lock file.
$ deno cache --lock=lock.json --lock-write deps.ts
Version Management
udd supports Semantic Versioning ↱ (SemVer 2.0.0 ↱) and the following version range specifications
as additional fragment (#${token}${version} I.e. https://repository.tld/x/library@$Major.$Minor.$Patch/mods.ts#${token}${version})
to the URL.
| Token | Name | Updates to version that: |
|---|---|---|
| ^ | Compatible | major version is the same (if major=0 then same minor version) |
| ~ | Approximately | major and minor version are the same (or both major=0) |
| < | Less than | less than the provided version |
| = | Equal | exactly this version |
Example:
|
|
Known Problems
-
The semantic version fragment in the dependencies URL is a custom extension used from
udd. This may cause incompatibilities with other tools. -
udddetects URLs in comments (/* .. */and// ..) sometimes asimportstatements and raises an error. Try to avoid using URLs in comments indepts.tsortest_deps.ts(uddVersion 0.7.2).