asdf-community / asdf-community/asdf-flutter

Remove jq dependency to follow asdf plugin script guidelines

Open
#57 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
127
Forks
41
PR merge metrics
No merged PRs in 30d

Description

This plugin currently requires `jq` as an external dependency to parse the Flutter release JSON.
The `jq` binary is either expected to be pre-installed or is silently downloaded from GitHub by `bin/jq-downloader` at runtime.

We should remove this dependency and replace it with portable shell commands.

## Why

The [asdf Plugin Golden Rules](https://asdf-vm.com/plugins/create.html#golden-rules-for-plugin-scripts) state:

> keep your dependency list of Shell tools/commands small

The current approach has several problems:

1. **Violation of Golden Rules**
Downloading external binaries within plugin scripts goes against the spirit of the asdf plugin guidelines.
1. **Implicit network access**
When `jq` is not found, `bin/jq-downloader` automatically downloads the binary from GitHub via `curl -sL` and places it in the plugin directory, with no notification to the user. Silently fetching an external binary and granting it execute permission without user consent is unexpected behavior that erodes trust.
1. **Rosetta workaround**
The README contains a troubleshooting section for Rosetta on Apple Silicon, which exists solely because of the `jq` binary.
1. **Past issues**
`jq` has been a recurring source of problems: #16, #17, #30, #31, #37, #44, #45. Every time the surrounding circumstances change — hardware refresh, repository migration, or missing installation — this plugin breaks. The fix has always been to patch around `jq`, never to remove the dependency itself.

## How

Replace every `jq`-based parsing call with `grep`, `sed`, and `awk` tools that are available by default on any POSIX system.
With AI coding assistance, writing accurate shell-based JSON parsing against a known, stable JSON schema should be straightforward.

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate every jq-based parsing call, then inspect bin/jq-downloader and the README sections that document jq and the Rosetta workaround. Replace the parsing with portable grep, sed, and awk commands for the known Flutter release JSON, and verify that no runtime jq download or jq dependency remains.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
cli, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.