A mise backend plugin for Dart packages from pub.dev.
The plugin installs a package with dart pub global activate into a separate directory for
each version. Then it puts the package executables on your PATH.
mise plugin install pub https://github.com/hleinone/vfox-pubmise use pub:protoc_plugin@22.3.0This adds the tool to your mise.toml:
[tools]
"pub:protoc_plugin" = "22.3.0"Other commands:
mise ls-remote pub:protoc_plugin
mise install pub:melos@latest
mise exec pub:melos -- melos --version- The
dartexecutable must be on PATH when a tool is installed and when it runs. Install Dart with mise (mise use dart@latestormise use flutter@latest) or in another way. - Network access to pub.dev.
BackendListVersionsreadshttps://pub.dev/api/packages/<name>. It returns all versions that are not retracted.BackendInstallreads theexecutablesof that version from the same pub.dev response. It runsdart pub global activate --no-executables <name> <version>withPUB_CACHEset to<install directory>/pub-cache. Each version has its own pub cache. Then it writes a wrapper for each executable into<install directory>/binand compiles the executable to a kernel snapshot in<install directory>/snapshotswithdart compile kernel.- The wrapper runs
dart --packages=<package config> <snapshot>, so package URIs resolve at run time. After a Dart SDK upgrade the snapshot is stale, and the wrapper compiles it again before it runs the tool. Compiler output goes to stderr, so the tool's stdout stays clean. This matters for protoc plugins, which speak protobuf on stdout. pub's own launchers anddart pub global runare not used at run time: pub prints status text to stdout while it rebuilds a snapshot, rewrites its launchers, does not quote paths in them, and writes them in the system code page. BackendExecEnvadds<install directory>/binto PATH.
Each installed version downloads its own copy of the package dependencies.
Linux, macOS and Windows. On Windows, pub writes .bat launchers and the plugin writes .bat
wrappers. CI runs the end-to-end test on all three platforms.
- Only pub.dev is supported. Private pub servers are not supported yet.
- On Windows, mise itself does not load Lua plugins from a directory whose path has
non-ASCII characters. Set
MISE_DATA_DIRto an ASCII path in that case. Install paths with non-ASCII characters work.
mise install # stylua, lua-language-server, actionlint
mise run format
mise run lint
mise run test # links this directory as the pub plugin and installs protoc_plugin
mise run ci # lint and testmise run test replaces a plugin named pub on your machine with a link to this directory.
On Windows, run the test from Git Bash with bash mise-tasks/test, because mise runs file
tasks through cmd there.
MIT