git.iko.soy/rowtype-yoga/package-sets
on psc-0.13.6-20200404 help sign in
97 lines 3.9 kB history raw
1# Package Sets
3[![Build Status](https://travis-ci.org/purescript/package-sets.svg?branch=master)](https://travis-ci.org/purescript/package-sets)
5A curated list of PureScript packages for Psc-Package and Spago
7![](https://i.imgur.com/roCuNQ9.png)
10- [What is a package-set?](#what-is-a-package-set)
11- [Add your package](#add-your-package)
12- [How do I use package-sets with `psc-package`?](#how-do-i-use-package-sets-with-psc-package)
13- [How do I use package-sets with `spago`?](#how-do-i-use-package-sets-with-spago)
16## What is a package set?
18A package set is a **collection** of packages, such that there is only **one** entry (i.e. version) for a given package in the set.
20If you use a package manager based on package-sets, this means that when you want to install a package:
21- it must be in the package set
22- its dependencies and all the transitive dependencies must be in the package set
24## Add your package
26This repository aims to be a good collection of packages you can depend on.
27In general we welcome all packages, provided that they follow some guidelines defined in the [contributing guide](CONTRIBUTING.md).
29The linked document also contains instructions on how to add new packages to the set, and information on versioning and related policies.
31## How do I use `package-sets` with Psc Package?
33[`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**.
35`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].
37In order to use a package-set, the `psc-package.json` file in the root of your project, should look something like this:
39```json
41 "name": "project-name",
42 "set": "set-name",
43 "source": "https://github.com/purescript/package-sets.git",
44 "depends": [
45 "aff",
46 "console",
47 "prelude"
48 ]
50```
52The way this file works is that:
53- `"set"` matches the tag or branch of the git repository of the package set
54- `"source"` is the URL for the git repository of the package set
55- `"depends"` is an array of strings, where the strings are names of packages you depend on.
56 *Note:* as said above, these dependencies should be contained in the package-set
58When you run `psc-package install`, psc-package will perform the steps so that the following directory will have the package set cloned into it:
60```
61.psc-package/set-name/.set
62```
64And the package set will then be available in
66```
67.psc-package/set-name/.set/packages.json
68```
70When you install a package in your given package set, the package contents will be cloned in the following directory structure:
72```
73.psc-package/${set-name}/${package-name}/${tag}
74```
76E.g. in case of `aff@v5.0.0`:
78```
79.psc-package/set-name/aff/v5.0.0
80```
82## How do I use `package-sets` with `spago`?
84[`spago`][spago] is a package manager and build tool for PureScript. It is very similar to `psc-package`, and the main differences are:
85- it uses Dhall for its configuration (instead of `json` as `psc-package` does)
86- it supports package overrides and additions directly in the project configuration
87- it supports local dependencies (think `bower link`)
89With `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.
91You can change the package-set version you are using by just pointing the `upstream` to a different location, and running `spago freeze` afterwards (see [its readme][spago] for more info about this)
94[spago]: https://github.com/spacchetti/spago
95[psc-package]: https://github.com/purescript/psc-package
96[issues]: https://github.com/purescript/package-sets/issues
97[packages-json]: https://github.com/purescript/package-sets/blob/master/packages.json