typst-upgrade

Crates.iotypst-upgrade
lib.rstypst-upgrade
version
sourcesrc
created_at2024-04-11 13:13:42.703068+00
updated_at2025-02-14 10:06:39.447789+00
descriptionA tool to upgrade typst packages
homepage
repositoryhttps://github.com/Coekjan/typst-upgrade
max_upload_size
id1204902
Cargo.toml error:TOML parse error at line 22, column 1 | 22 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Yip Coekjan (Coekjan)

documentation

README

Typst Upgrade

Help you to upgrade your Typst Packages.

Usage

To upgrade your typst-package dependencies, you can use the following command (assuming your project located in /path/to/your/project):

$ typst-upgrade /path/to/your/project

See typst-upgrade --help for more information:

$ typst-upgrade --help
A tool to upgrade typst packages

Usage: typst-upgrade [OPTIONS] <TYPST_ENTRY_PATHS>...

Arguments:
  <TYPST_ENTRY_PATHS>...  

Options:
  -d, --dry-run        Dry run without editing files
  -i, --incompatible   Allow incompatible upgrades
      --color <COLOR>  [default: auto] [possible values: auto, always, never]
      --diff <DIFF>    [default: short] [possible values: short, full, none]
  -v, --verbose        Print more information
  -h, --help           Print help
  -V, --version        Print version

Examples

$ cat main.typ
#import "@preview/cetz:0.2.1"
$ typst-upgrade -i main.typ
    Checking ./main.typ
           - #import "@preview/cetz:0.2.1"
           + #import "@preview/cetz:0.3.1"
    Updating ./main.typ
$ cat main.typ
#import "@preview/cetz:0.3.1"

Compatible Upgrade

By default, typst-upgrade will only upgrade your dependencies to the latest compatible version. If you want to upgrade to the latest version regardless of compatibility, you can use the --incompatible or -i flag.

Typst packages commonly follow Semantic Versioning, so upgrading to the latest compatible version is usually recommended. Note that some packages are in-development (major version is 0), which means they may introduce breaking changes in minor versions, and --incompatible flag is required to upgrade such packages.

GitHub Actions

You can use typst-upgrade in your GitHub Actions workflow to automatically check if any of your dependencies can be upgraded. Here is an example workflow:

steps:
  - uses: actions/checkout@v4
  - uses: taiki-e/install-action@cargo-binstall
  - run: cargo binstall typst-upgrade
  - run: typst-upgrade . --dry-run

Installation

Cargo

You can install typst-upgrade via cargo:

$ cargo install typst-upgrade

Or if you use cargo-binstall, you can install typst-upgrade via cargo binstall:

$ cargo binstall typst-upgrade

Prebuilt Binaries

You can download the prebuilt binaries from the release page.

License

Licensed under the MIT License.

Commit count: 127

cargo fmt