A curated list of PureScript packages for the spago
and psc-package
package managers.
- What is a package-set?
- Add your package
- How do I use package-sets with
spago
? - How do I use package-sets with
psc-package
?
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:
- It must be in the package set
- Its dependencies and transitive dependencies must also be in the package set
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.
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
aspsc-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>
.
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