Skip to content
An alternative package manager for V.
V AMPL
Branch: master
Clone or download
Latest commit 1cc0fa4 Oct 29, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
api embed vargs Oct 29, 2019
.gitignore update vargs folder Sep 1, 2019
.vpkg-lock.json 0.5.2 Oct 29, 2019
README.md 0.5.2 Oct 29, 2019
install.v 0.5.2 Oct 29, 2019
v.mod add v.mod file Oct 29, 2019
vpkg.json update lockfile Oct 29, 2019
vpkg.v move vpkg.v to root Oct 29, 2019

README.md

vpkg

vpkg is a package manager written on V for V.

Features

vpkg's approach is to incorporate the ideas taken from centralized and decentralized package managers.

  • Centralized, popular packages are being listed on VPM and on to a single registry.json file.
  • Uses a single, JSON file for storing package information as well as it's dependencies. (In this case, vpkg.json)
  • Packages stored from registry.json file can be obtained through a simple vpkg get [package name] while the rest uses regular Git URLs.
  • Support for multiple package manifests (v.mod, and vpkg.json).
  • Support for custom package registries/sources.

Running your own registry

vpkg's own registry server is a perfect template to start running your own registry server. Just modify registry.json and use any http or web library of your choice to get up and running.

Commands

VPkg 0.5
An alternative package manager for V.

USAGE

vpkg <COMMAND> [ARGS...] [options]

COMMANDS

get [packages]                             Fetch and installs packages from the registry or the git repo.
help                                       Prints this help message.
info                                       Show project's package information.
init [--format=vpkg|vmod]                  Creates a package manifest file into the current directory. Defaults to "vpkg".
install                                    Reads the package manifest file and installs the necessary packages.
migrate manifest [--format=vpkg|vmod]      Migrate manifest file to a specified format.
remove [packages]                          Removes packages
update                                     Updates packages.
version                                    Prints the Version of this program.

OPTIONS

--global, -g                               Installs the modules/packages into the `.vmodules` folder.
--force                                    Force download the packages

vpkg API

vpkg can now be imported as a separate module in which you will be able to utilize all vpkg's features into your own programs. It's especially more useful if you want to be able to create your scripts for your project to setup your dependencies without compiling and installing a separate CLI.

// install.v
module main

import vpkg.api

fn main() {
	mut inst := api.new_vpkg('.')
	inst.run(['install'])

	os.system('rm ${os.executable()}')
}
$ v run install.v
Installing packages
Fetching nedpals.vargs
Fetching package from vpm...

vargs@fc193513733c2ed99467f5d903a824ea9087ed52
1 package was installed successfully.

TODO

  • ability to publish and search packages in VPM and VPKG registry.
  • recursive installation of dependencies of packages.
  • unified logging interface

Installation

  • Clone the repo.
  • Download and install v-args and place it into the folder where your vpkg source code is located.
  • Build it from source.

Building from Source

git clone https://github.com/v-pkg/vpkg.git
cd vpkg/
v -prod .

Copyright

(C) 2019 Ned Palacios

You can’t perform that action at this time.