Skip to content

Commit b7c0483

Browse files
authored
Docs: show how to import packages from the registry
1 parent 99c485d commit b7c0483

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,9 +558,18 @@ workspace:
558558
> [!IMPORTANT]\
559559
> 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!
560560

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

563-
E.g. if we want to add the `facebook` package:
563+
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:
564+
565+
```
566+
workspace:
567+
registry: 41.2.0
568+
extraPackages:
569+
some-package-from-the-registry: 4.0.0
570+
```
571+
572+
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:
564573

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

578-
As you might expect, this works also in the case of adding local packages:
587+
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):
579588

580589
```yaml
581590
workspace:

0 commit comments

Comments
 (0)