Skip to content

New: Install/update plugins from git URLs#238

Draft
taylortom wants to merge 4 commits intomasterfrom
feature/install-from-git-url
Draft

New: Install/update plugins from git URLs#238
taylortom wants to merge 4 commits intomasterfrom
feature/install-from-git-url

Conversation

@taylortom
Copy link
Member

@taylortom taylortom commented Feb 25, 2026

New

  • Support installing plugins directly from HTTPS git URLs (adapt install https://github.com/user/plugin.git)
  • Support specifying a branch or tag via #ref suffix (adapt install https://github.com/user/plugin.git#v2.0.0)
  • Git-installed plugins are tracked in adapt.json with the full git URL
  • Git-installed plugins can be updated via adapt update, which re-clones HEAD from the stored URL
  • Git-sourced plugins show a (git) label in install/update summaries

Fix

  • Handle git plugins in the node API (api.js): updateFramework now correctly caches/restores git plugins, getPluginUpdateInfos routes git plugins through fetchSourceInfo instead of fetchBowerInfo, and manifest reading properly splits URL#ref entries

Chore

  • Extract git clone operations into reusable utilities: lib/util/gitClone.js (low-level promise wrapper) and lib/integration/PluginManagement/clone.js (clone plugin + write .bower.json metadata), mirroring the existing AdaptFramework/clone.js pattern
  • Migrate all existing inline exec('git clone ...') calls to the shared gitClone utility — the dev-mode clone install in Target.js and the framework clone in AdaptFramework/clone.js — so all git clone operations go through a single code path

Fixes #237

Testing

  1. adapt install https://github.com/<user>/<adapt-plugin>.git — should clone and install
  2. adapt install https://github.com/<user>/<adapt-plugin>.git#v1.0.0 — should clone and checkout tag
  3. Check adapt.json stores the git URL as the dependency value
  4. Check src/<type>/<name>/.bower.json has _wasInstalledFromGitRepo: true and _gitUrl
  5. adapt update <plugin-name> — should re-clone and update from stored URL
  6. adapt update --dry-run — should show git plugins as updateable with (git) label
  7. Re-running adapt install from adapt.json should re-install git plugins from stored URLs
  8. Existing bower registry and local path installs should continue to work unchanged
  9. api.updateFramework() should preserve git plugins through a framework reinstall
  10. api.getPluginUpdateInfos() should return info for git-installed plugins
  11. adapt install --dev <plugin> should still clone from bower registry URL (existing behaviour)

Allow users to install plugins directly from HTTPS git URLs instead of
requiring them to be registered in the bower registry. Supports optional
branch/tag refs via URL#ref syntax.
…Infos)

Ensure git-sourced plugins survive framework updates by correctly
serialising them as URLs when caching. Split URL#ref when reading
manifest entries. Route git plugins through fetchSourceInfo instead
of fetchBowerInfo in getPluginUpdateInfos.
Add lib/util/gitClone.js as a low-level promise wrapper around
git clone, and lib/integration/PluginManagement/clone.js for the
higher-level "clone plugin and write .bower.json metadata" operation.
Refactor Plugin.js and Target.js to use these instead of inline
exec calls.
Update the dev-mode clone install in Target.js and the framework
clone in AdaptFramework/clone.js to use the shared gitClone utility,
eliminating all inline exec('git clone ...') calls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Support installing plugins directly from git URLs

1 participant