Simplify the library README

This commit is contained in:
joeduffy 2017-03-11 09:01:33 -08:00
parent 45064d6299
commit c36bb75653

View file

@ -1,41 +1,27 @@
# coconut/lib
This directory contains the various libraries (Nuts) that Coconut programs may depend upon.
This directory contains some libraries that Coconut programs may depend upon.
## Overview
The Coconut standard library underneath `coconut/` is special in that every program will ultimately use it directly or
indirectly to create resources.
Similarly, `cocojs/` is the CocoJS compiler's runtime library, and so most CocoJS programs will on it.
Note that these are written in the Coconut subsets of the languages and therefore cannot perform I/O, etc.
## Installation and Usage
Eventually these packages will be published like any other NPM package. For now, they are consumed only in a
development capacity, and so there are some manual steps required to prepare a development workspace.
development capacity, and so there are some manual steps required to prepare a developer workspace.
For each library `<lib>` you wish to use, in dependency order:
For each library `<lib>` you wish to use, please see its `install.sh` script in its root directory. This performs
installation so that it can be used simply by adding a dependency to it.
* `cd <lib>`
* `yarn install`
* For each dependency `<dep>`:
- `yarn link dep`
* `yarn build`
* `yarn link`
And then from within each Nut's directory, `<lib>`, that will consume said libraries:
We currently use NPM/Yarn symlinks to ease the developer workspace flow. As such, you will need to run:
* `yarn link <lib>`
For example, let's say we want to use the standard library and the AWS library from another Nut, `/dev/mypackage`:
* First, `cd $GOPATH/src/github.com/pulumi/coconut/lib/coconut`:
* `yarn install`
* `yarn build`
* `yarn link`
* Next, `cd $GOPATH/src/github.com/pulumi/coconut/lib`:
* `yarn install`
* `yarn link @coconut/coconut`
* `yarn build`
* `yarn link`
* Finally, `cd /dev/mypackage`:
* `yarn link @coconut/coconut`
* `yarn link @coconut/aws`
* Now we are ready to go working on `mypackage`, and the two Nut references will be resolved correctly.
In a project that intends to consume `<lib>` before actually using it. For example, `yarn link @coconut/coconut`.