lumihq / package-sets

PureScript packages for Spago and Psc-Package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Package Sets

Build Status

A curated list of PureScript packages for the spago and psc-package package managers.

What is a package set?

A package set is a collection of packages such that there is only one version for a given package in the set, and the entire set of packages successfully compiles together. This ensures that you can always install packages from the package set without introducing conflicts between modules in your dependencies.

If you use a package manager based on package sets, that means that to install a package:

  1. It must be in the package set
  2. Its dependencies and transitive dependencies must also be in the package set

Adding your package

This repository aims to be a good collection of packages you can depend on. In general we welcome all packages, provided that they follow some guidelines defined in the contributing guide. The linked document also contains instructions on how to add new packages to the set, and information on versioning and related policies.

How do I use package-sets with spago?

spago is a package manager and build tool for PureScript. It is very similar to psc-package, and the main differences are:

  • it uses Dhall for its configuration (instead of json as psc-package does)
  • it supports package overrides and additions directly in the project configuration
  • it supports local dependencies (think bower link)

With spago the package-set address is specified in the upstream variable of your local packages.dhall, which will usually import a remote packages.dhall, e.g. the one from this repo.

You can change the package-set version you are using by running spago upgrade-set, or if you want to point to a particular version, spago upgrade-set --tag <tag>.

How do I use package-sets with Psc Package?

psc-package is a package manager for PureScript that works essentially by running a bunch of git commands. Its distinguishing feature from most package managers is that it uses a package set.

psc-package will use as package-set the packages.json file in the root of any package-set repository, like in this case.

In order to use a package-set, the psc-package.json file in the root of your project, should look something like this:

{
  "name": "project-name",
  "set": "set-name",
  "source": "https://github.com/purescript/package-sets.git",
  "depends": [
    "aff",
    "console",
    "prelude"
  ]
}

The way this file works is that:

  • "set" matches the tag or branch of the git repository of the package set
  • "source" is the URL for the git repository of the package set
  • "depends" is an array of strings, where the strings are names of packages you depend on. Note: as said above, these dependencies should be contained in the package-set

When you run psc-package install, psc-package will perform the steps so that the following directory will have the package set cloned into it:

.psc-package/set-name/.set

And the package set will then be available in

.psc-package/set-name/.set/packages.json

When you install a package in your given package set, the package contents will be cloned in the following directory structure:

.psc-package/${set-name}/${package-name}/${tag}

E.g. in case of aff@v5.0.0:

.psc-package/set-name/aff/v5.0.0

About

PureScript packages for Spago and Psc-Package

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Dhall 89.3%Language:PureScript 6.9%Language:Shell 2.7%Language:Nix 0.6%Language:Makefile 0.4%