-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
docs: improve plugin documentation with comparisons and template links #7962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,52 @@ | ||
| # asdf Backend | ||
|
|
||
| ::: warning | ||
| asdf plugins are considered legacy. For new tools, prefer [vfox plugins](/dev-tools/backends/vfox.html) which are written in Lua, work cross-platform (including Windows), and have access to built-in modules for HTTP, JSON, HTML parsing, and more. | ||
| ::: | ||
|
|
||
| `asdf` is the original backend for mise. | ||
|
|
||
| It relies on asdf plugins for each tool. asdf plugins are more risky to use because they're typically written by a single developer unrelated to the tool vendor. They also generally do not function on Windows because they're written | ||
| in bash which is often not available on Windows and the scripts generally are not written to be cross-platform. | ||
|
|
||
| asdf plugins are not used for tools inside the [registry](https://github.com/jdx/mise/blob/main/registry/) whenever possible. Sometimes it is not possible to use more secure backends like aqua/ubi because tools have complex install setups or need to export env vars. | ||
| asdf plugins are not used for tools inside the [registry](https://github.com/jdx/mise/blob/main/registry/) whenever possible. Sometimes it is not possible to use more secure backends like aqua/github because tools have complex install setups or need to export env vars. | ||
|
|
||
| All of these are hosted in the mise-plugins org to secure the supply chain so you do not need to rely on plugins maintained by anyone except me. | ||
|
|
||
| Because of the extra complexity of asdf tools and security concerns we are actively moving tools in | ||
| the registry away from asdf where possible to backends like aqua and ubi which don't require plugins. | ||
| That said, not all tools can function with ubi/aqua if they have a unique installation process or | ||
| the registry away from asdf where possible to backends like aqua and github which don't require plugins. | ||
| That said, not all tools can function with github/aqua if they have a unique installation process or | ||
| need to set env vars other than `PATH`. | ||
|
|
||
| ## Feature Comparison: asdf vs vfox | ||
|
|
||
| | Feature | asdf Plugins | vfox Plugins | | ||
| | ------------------------------- | ------------------ | -------------------- | | ||
| | **Language** | Bash scripts | Lua | | ||
| | **Windows Support** | ❌ | ✅ | | ||
| | **Built-in HTTP module** | ❌ (requires curl) | ✅ | | ||
| | **Built-in JSON module** | ❌ (requires jq) | ✅ | | ||
| | **Built-in HTML parsing** | ❌ | ✅ | | ||
| | **Built-in archive extraction** | ❌ | ✅ | | ||
| | **Built-in semver module** | ❌ | ✅ | | ||
| | **Built-in logging** | ❌ | ✅ | | ||
| | **Post-install hooks** | ❌ | ✅ | | ||
| | **Security attestations** | ❌ | ✅ (cosign, SLSA) | | ||
| | **Multi-tool plugins** | ❌ | ✅ (backend plugins) | | ||
| | **Lock file support** | ❌ | ✅ | | ||
| | **Rolling version checksums** | ❌ | ✅ | | ||
|
|
||
| ## Hook Migration: asdf to vfox | ||
|
|
||
| | asdf Script | vfox Hook | Notes | | ||
| | --------------------------- | ------------------------ | ---------------------------------------------------------------- | | ||
| | `bin/list-all` | `Available` | Return structured version objects instead of plain text | | ||
| | `bin/download` | `PreInstall` | Return URL and checksum; mise handles the download | | ||
| | `bin/install` | `PostInstall` | Runs after mise downloads and extracts the tool | | ||
| | `bin/exec-env` | `EnvKeys` | Return structured key/value pairs instead of `export` statements | | ||
| | `bin/list-legacy-filenames` | `PLUGIN.legacyFilenames` | Set in `metadata.lua` instead of a script | | ||
| | `bin/parse-legacy-file` | `ParseLegacyFile` | Return structured result instead of plain text | | ||
|
|
||
| ## Writing asdf (legacy) plugins for mise | ||
|
|
||
| See the asdf documentation for more information on [writing plugins](https://asdf-vm.com/plugins/create.html). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -12,11 +12,17 @@ Unlike [tool plugins](tool-plugin-development.md) and [backend plugins](backend- | |||||
|
|
||||||
| ## Quick Start | ||||||
|
|
||||||
| The fastest way to create an environment plugin is to use the [mise-env-plugin-template](https://github.com/jdx/mise-env-sample): | ||||||
| The fastest way to create an environment plugin is to use the [mise-env-plugin-template](https://github.com/jdx/mise-env-plugin-template). | ||||||
|
|
||||||
| ::: tip | ||||||
| The [mise-env-plugin-template](https://github.com/jdx/mise-env-plugin-template) provides a ready-to-use starting point with LuaCATS type definitions, stylua formatting, and hk linting pre-configured. | ||||||
| ::: | ||||||
|
|
||||||
| To get started: | ||||||
|
|
||||||
| ```bash | ||||||
| # Clone the template | ||||||
| git clone https://github.com/jdx/mise-env-sample my-env-plugin | ||||||
| git clone https://github.com/jdx/mise-env-plugin-template my-env-plugin | ||||||
| cd my-env-plugin | ||||||
|
|
||||||
| # Customize for your use case | ||||||
|
|
@@ -416,7 +422,7 @@ See [Plugin Publishing](/plugin-publishing.html) for detailed instructions. | |||||
|
|
||||||
| ## Examples | ||||||
|
|
||||||
| - [mise-env-sample](https://github.com/jdx/mise-env-sample) - Simple example showing basic usage | ||||||
| - [mise-env-sample](https://github.com/jdx/mise-env-plugin-template) - Simple example showing basic usage | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The link text
Suggested change
|
||||||
| - The [mise-plugins](https://github.com/mise-plugins) organization currently hosts tool plugins only—add your environment plugin there (or share it with the community) so others can learn from more examples | ||||||
|
|
||||||
| ## Migration from Tool Plugins | ||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence is redundant as the same information is presented in more detail in the
tipblock that follows. To improve clarity and reduce repetition, I suggest removing this line and the following blank line, letting thetipblock introduce the template.