Skip to content

Commit

Permalink
Docs: show how to import packages from the registry
Browse files Browse the repository at this point in the history
  • Loading branch information
f-f authored Sep 13, 2024
1 parent 99c485d commit b7c0483
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,18 @@ workspace:
> [!IMPORTANT]\
> You still need to `spago install my-new-package` after adding it to the package set, or Spago will not know that you want to use it as a dependency!

If a package is not in the upstream package set, you can add it exactly in the same way, by adding it to `extraPackages`.
If a package is not in the upstream package set you can make it available in your build by adding it to `extraPackages`.

E.g. if we want to add the `facebook` package:
There are a few possible scenarios - the most straightforward is when a package is already in the registry, then you just need to specify its version:

```
workspace:
registry: 41.2.0
extraPackages:
some-package-from-the-registry: 4.0.0
```

Another possibility is that the package is not in the registry (maybe it's your own fork?), but it's a git repo somewhere - e.g. if we'd like to add the `facebook` package:

```yaml
workspace:
Expand All @@ -575,7 +584,7 @@ workspace:
> If the upstream library that you are adding has a `spago.yaml` file, then Spago will just pick up the dependencies from there.
> If that's not the case, then you'll have the provide the dependencies yourself, adding a `dependencies` field.

As you might expect, this works also in the case of adding local packages:
The last possible case is the one picking up a local folder as a package (note: you'll need a `spago.yaml` file in there):

```yaml
workspace:
Expand Down

0 comments on commit b7c0483

Please sign in to comment.