You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Is there an easier way to manage my package sets than to edit packages.json?
3
+
## Is there an easier way to manage my package sets than to edit packages.json? / How do I prepare a packages.json in some way other than editing JSON?
4
4
5
-
Yes. For example, the [Spacchetti](https://github.com/justinwoo/spacchetti/) project uses Dhall to allow for easily maintaining a fork with separate type-checked sub-sets of packages and to allow for users to have local overrides of package sets.
5
+
Yes. [purescript/package-sets](https://github.com/purescript/package-sets) itself uses Dhall to programmatically prepare the package set, which are then normalized into `packages.dhall` on release: <https://github.com/purescript/package-sets/releases>. You can import this file in your own Dhall files and add/override packages to customize your package set.
6
6
7
7
## How come I can't install (some package) from the package set?
8
8
9
9
You should make sure you're using the correct [package-set release](https://github.com/purescript/package-sets/releases) and have updated the value of "set" in your `psc-package.json` file. See [The `psc-package.json` format](https://github.com/purescript/psc-package#the-psc-packagejson-format) section for more details.
10
10
11
-
## Can I add a dependency which is not in the package set?
12
-
13
-
Not right now. We might add this feature in future, but for now, consider either:
14
-
15
-
- Adding your dependency to the package set if possible, or
16
-
- Creating your own custom package set
17
-
18
-
There used to be a feature called "add-from-bower", which could modify a package set from [purescript/package-sets](https://github.com/purescript/package-sets/). This feature was removed as it proved to be very buggy and confusing for users, who thought that this feature would let them install arbitrary bower dependencies. See <https://github.com/purescript/psc-package/issues/121>.
19
-
20
-
## Why is Add-From-Bower gone?
21
-
22
-
The feature named "add-from-bower" never did what users expected it to do: to install packages to a project from Bower.
23
-
24
-
Instead, what this feature did was to add packages to a package set from [purescript/package-sets](https://github.com/purescript/package-sets/). However, due to the buggy nature of the feature, it was agreed that the feature should be removed and left up to other tools to handle. See <https://github.com/purescript/psc-package/issues/121>, where the top post describes how the [Spacchetti](https://github.com/spacchetti/spacchetti) package set adds Bower dependencies to the package set.
25
-
26
-
If you really would like to mix Psc-Package and Bower dependencies, you have two "real" options today. However, these will break if your packages are not all compatible, because this defeats the guarantees of having a package set.
27
-
28
-
1. Install the Bower dependencies anyway, and then only source the globs for individual dependencies, so you do not have conflicting definitions of other common modules. You can do this by supplying pass-through arguments: `psc-package build -- 'bower_componenents/purescript-my-lib/src/**/*.purs'`
29
-
2. Use the "Bower style" installation of Psc-Package2Nix: <https://github.com/justinwoo/psc-package2nix/tree/master/test-bower-style>. This will require that you use a system that can use the [Nix](https://nixos.org/nix/) package manager. See the link for more details.
30
-
31
11
## Why are my changes not updated in my package set?
32
12
33
13
Package sets are cached based on a git reference (e.g. tag or branch)
@@ -42,4 +22,4 @@ $ psc-package install
42
22
43
23
## Can I use Psc-Package with Nix?
44
24
45
-
Yes, now there is a solution for using Psc-Package with Nix: <https://github.com/justinwoo/psc-package2nix>. Please file issues in that project if you run into any.
25
+
Yes, please see the page about Nix here: <https://psc-package.readthedocs.io/en/latest/nix.html>.
Copy file name to clipboardExpand all lines: docs/intro.md
+10-4Lines changed: 10 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,13 @@ A _package set_ is a mapping from package names to:
10
10
11
11
A package set repository contains a `packages.json` file which contains all mapping information. `psc-package` uses this information to decide which repos need to be cloned.
12
12
13
-
The default package set is [purescript/package-sets](https://github.com/purescript/package-sets), but it is possible to create custom package sets by forking an existing package set or creating a new one from scratch. One benefit of using the default package set is that it is verified by a continuous integration process.
13
+
The default package set is [purescript/package-sets](https://github.com/purescript/package-sets), but it is possible to create custom package sets in many ways:
14
+
15
+
* by preparing a package set with Dhall using the packages.dhall from releases: <https://github.com/purescript/package-sets/releases>
16
+
* forking `purescript/package-sets` to your own repository
17
+
* creating a new one from scratch
18
+
19
+
. One benefit of using the default package set is that it is verified by a continuous integration process.
14
20
15
21
## The `psc-package.json` format
16
22
@@ -19,7 +25,7 @@ Here is a simple project configuration:
@@ -30,6 +36,6 @@ Here is a simple project configuration:
30
36
It defines:
31
37
32
38
- The project name
33
-
- The package set to use to resolve dependencies (this corresponds to a branch or tag of the package set source repository)
34
-
- The package set sourcerepository Git URL (change this if you want to host your own package sets)
39
+
- The package set to use to resolve dependencies. This corresponds to a branch or tag of the package set source repository if you use a Git URL as your source. Otherwise it serves as just an identifier.
40
+
- The package set source, which is either a repository Git URL or a path to a package set `packages.json` file.
35
41
- Any dependencies of the project, as a list of names of packages from the package set
Justin Woo has made a psc-package2nix project for generating nix derivations from Psc-Package dependencies: <https://github.com/justinwoo/psc-package2nix>
Because of the relative rarity in using psc-package with Nix, there is not excessive documentation on how to use this tool. See mostly the `soba insdhall` and `soba nix` commands in this tool.
0 commit comments