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:

1
2
3
4
5
6
7
8
// update to latest of same major version:
import { A } from "https://repo.tld/x/lib@2.10.0/mod.ts#^";
// update to latests of same major and minor version:
import { B } from "https://repo.tld/x/lib@0.36.0/mod.ts#~"
// update to latest version below version 0.2.0:
import { C } from "https://repo.tld/x/lib@0.1.11/mod.ts#<0.2.0";
// use excat the version 0.34.0:
import { D } from "https://repo.tld/x/lib@0.34.0/mod.ts#=";

Known Problems

See also