git.iko.soy/rowtype-yoga/package-sets
on master help sign in
90 lines 4.0 kB history raw
1# Package Sets
3[![Build Status](https://github.com/purescript/package-sets/workflows/build/badge.svg)](https://github.com/purescript/package-sets/actions)
5A curated list of PureScript packages for the `spago` and `psc-package` package managers.
7- [What is a package-set?](#what-is-a-package-set)
8- [Add your package](#add-your-package)
9- [How do I use package-sets with `spago`?](#how-do-i-use-package-sets-with-spago)
10- [How do I use package-sets with `psc-package`?](#how-do-i-use-package-sets-with-psc-package)
12## What is a package set?
14A 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.
16If you use a package manager based on package sets, that means that to install a package:
181. It must be in the package set
192. Its dependencies and transitive dependencies must also be in the package set
21## Adding your package
23This 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](CONTRIBUTING.md). The linked document also contains instructions on how to add new packages to the set, and information on versioning and related policies.
25## How do I use `package-sets` with `spago`?
27[`spago`][spago] is a package manager and build tool for PureScript. It is very similar to `psc-package`, and the main differences are:
28- it uses Dhall for its configuration (instead of `json` as `psc-package` does)
29- it supports package overrides and additions directly in the project configuration
30- it supports local dependencies (think `bower link`)
32With `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.
34You 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>`.
36## How do I use `package-sets` with Psc Package?
38[`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**.
40`psc-package` will use as package-set the `packages.json` file in the root of any package-set repository, like in [this case][packages-json].
42In order to use a package-set, the `psc-package.json` file in the root of your project, should look something like this:
44```json
46 "name": "project-name",
47 "set": "set-name",
48 "source": "https://github.com/purescript/package-sets.git",
49 "depends": [
50 "aff",
51 "console",
52 "prelude"
53 ]
55```
57The way this file works is that:
58- `"set"` matches the tag or branch of the git repository of the package set
59- `"source"` is the URL for the git repository of the package set
60- `"depends"` is an array of strings, where the strings are names of packages you depend on.
61 *Note:* as said above, these dependencies should be contained in the package-set
63When you run `psc-package install`, psc-package will perform the steps so that the following directory will have the package set cloned into it:
65```
66.psc-package/set-name/.set
67```
69And the package set will then be available in
71```
72.psc-package/set-name/.set/packages.json
73```
75When you install a package in your given package set, the package contents will be cloned in the following directory structure:
77```
78.psc-package/${set-name}/${package-name}/${tag}
79```
81E.g. in case of `aff@v5.0.0`:
83```
84.psc-package/set-name/aff/v5.0.0
85```
87[spago]: https://github.com/spacchetti/spago
88[psc-package]: https://github.com/purescript/psc-package
89[issues]: https://github.com/purescript/package-sets/issues
90[packages-json]: https://github.com/purescript/package-sets/blob/master/packages.json