Skip to content

Shougo/dpp-protocol-http

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dpp-protocol-http

This ext implements http operations.

The downloader accepts plugin URLs in these forms:

  • Archive downloads (examples):

    • GitHub archive: https://github.com/<owner>/<repo>/archive/.../xxx.zip
    • GitLab archive: https://gitlab.com/<owner>/<repo>/-/archive/.../*.zip
    • Bitbucket get: https://bitbucket.org/<owner>/<repo>/get/<hash>.zip
    • Releases/download assets: https://github.com/<owner>/<repo>/releases/download/<tag>/<asset>
    • Direct archive files: https://example.com/path/to/foo.zip (or .tar.gz/.tgz/...)
    • Plain GitHub repo root: https://github.com/<owner>/<repo> is accepted and normalized to an archive URL (see notes below).
  • Raw single-file URLs:

    • https://raw.githubusercontent.com/<owner>/<repo>/<branch>/path/to/file.vim NOTE: these are downloaded as a single file.

Notes about plain repo roots and revisions (rev)

  • Plain repository root URLs such as https://github.com/owner/repo are now accepted and will be normalized to an archive download URL: https://github.com/owner/repo/archive/refs/heads/<rev>.zip.
    • If no revision is provided, the downloader uses a default of main.
    • You can supply a revision (branch, tag, or commit SHA) - the rev parameter - to select a specific branch/tag/commit (e.g. dev-branch, v1.2.3, or a commit SHA).
    • If the repository's default branch is not main, either pass the correct rev, or enable an option that queries the remote API to discover the repository's default branch (this implementation currently uses the provided rev or main by default).
  • If an input URL already points to an archive path (e.g. .../archive/refs/heads/main.zip) and a rev is provided, the code will attempt to replace the referenced ref with the supplied rev where possible.

Other handling

  • git+https:// prefix is normalized away (e.g. git+https://github.com/... -> https://github.com/...).
  • URLs that already end with known archive extensions (zip/tar.* etc.), archive patterns, release assets, raw file URLs, and Bitbucket get URLs are returned as-is (possibly with credentials removed and host normalized to lowercase).
  • SSH-style URLs (git@github.com:owner/repo.git) and owner/repo shorthand (owner/repo) are not treated as downloadable HTTP URLs by this downloader.

Supported hosts and patterns

  • GitHub (archive, releases/download, explicit raw paths, plain repo roots)
  • GitLab (archive patterns like /-/archive/...)
  • Bitbucket (the /get/ pattern)
  • Generic direct archive URLs on arbitrary hosts
  • raw.githubusercontent.com single-file URLs

Limitations

  • This approach downloads and extracts archives or single files; it does not perform git clone. Plugins that require git metadata, submodules, or other repository operations may not work correctly.
  • If you rely on automatic default-branch detection, consider enabling an API lookup to avoid incorrect assumptions about main vs master (not enabled by default).

NOTE: The protocol does not support version lock and rollback.

Required

NOTE: To download plugins, "curl" or "wget" is required.

denops.vim

https://github.com/vim-denops/denops.vim

dpp.vim

https://github.com/Shougo/dpp.vim

System command-line tools (required/optional)

To download and extract plugins the runtime relies on common CLI tools. At minimum one downloader is required:

  • Required (at least one):

    • curl or wget — used to download files from HTTP(S) URLs NOTE: If neither curl nor wget is available the downloader cannot work.
  • Required for archive extraction (at least one set, depending on archive type):

    • For ZIP archives:
      • unzip OR python3 (zipfile module) — one of these must be available to extract .zip.
    • For tar archives (.tar, .tar.gz, .tgz, .tar.bz2, .tar.xz):
      • tar OR python3 (tarfile module) — one of these must be available to extract tar-like archives.
  • Optional but recommended for robust mover/cleanup:

    • cp or rsync — used to move extracted files from a temporary directory into the final destination when needed (zip extraction often creates a top-level folder).
    • rm — cleanup temporary files/directories.

Summary:

  • Downloader: curl or wget (required)
  • Extractors:
    • zip: unzip or python3
    • tar: tar or python3
  • Movers (recommended): cp or rsync (or python3 mover)
  • Cleanup: rm

Configuration

args.contextBuilder.setGlobal({
  protocols: [
    "http",
  ],
});

About

http protocol for dpp.vim

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published