Skip to content

Commit

Permalink
Merge pull request #210 from JordanMartinez/development
Browse files Browse the repository at this point in the history
Make next minor release: ps-0.12.x-v0.10.2
  • Loading branch information
JordanMartinez authored Jan 9, 2019
2 parents 2c12903 + 9fb26b8 commit 8551f54
Show file tree
Hide file tree
Showing 22 changed files with 5,811 additions and 99 deletions.
48 changes: 35 additions & 13 deletions 00-Getting-Started/01-Install-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,65 @@ If you ever want to support PureScript, consider making a pledge on its [Open Co

## Setting up Purescript for the First Time

### Overview

We'll show how to install the following programs:
- `purescript` - the PureScript language & compiler
- `pulp` - a build tool for PureScript
- `psc-package` - a dependency manager for PureScript

We'll also show how to install two other entities related to `psc-package`. However, these aren't required/used in this project until the `Hello World/Benchmarking` folder. What they are and why one will should install them if using `psc-package` as their dependency manager is covered more fully in `Build Tools/Tool Comparisons/Dependency Managers.md`:
- `spacchetti` - a project that speeds up tedious tasks that arise when using `psc-package`
- `dhall-to-json` - a configuration language that `spacchetti` uses for outputting well-typed JSON

### Installation

Justin Woo explains how to set up one's environment for the `0.12.x` release but has not been updated for two things. First, the PureScript release at the time was `0.12.0` but now `0.12.1` is out. Second, he did not include instructions for setting up [`spacchetti`](https://github.com/justinwoo/spacchetti) and its counterpart, `dhall`. Spacchetti is a project Justin later wrote to speed up tedious tasks that often arise when using `psc-package`.
Justin Woo explains how to set up one's environment for the `0.12.x` release but has not been updated for two things. First, the PureScript release at the time was `0.12.0` but now `0.12.1` is out. Second, he did not include instructions for setting up [`spacchetti`](https://github.com/justinwoo/spacchetti) and its counterpart, `dhall-to-json`.

If you just want to get things set up ASAP, follow the below summary of his article's instructions + the Spacchetti stuff. If you want to understand why you should do these commands, read [his article here](https://qiita.com/kimagure/items/570e6f2bbce5b4724564):
If you just want to get things set up ASAP, follow the below summary of his article's instructions. If you want to understand why you should do these commands, read [his article here](https://qiita.com/kimagure/items/570e6f2bbce5b4724564):
1. Install Node 8 or greater: https://nodejs.org/en/download/
2. Set your npm prefix: `npm set prefix ~/.npm`
3. Set your PATH: `export PATH="$HOME/.npm/bin:$PATH"`

NPM will then be used to install 4 packages
NPM will then be used to install these 3 packages
- `purescript` - the PureScript binary
- `pulp` - a build tool for PureScript
- `psc-package` - a dependency manager for PureScript
- `spacchetti` - already explained above

To install them, run this command:
```bash
npm i -g [email protected] pulp psc-package-bin-simple spacchetti-cli-bin-simple
npm i -g [email protected] pulp psc-package-bin-simple
```

<hr>

To install `spacchetti`, use NPM:
```bash
npm i -g spacchetti-cli-bin-simple
```

To install `dhall-to-json` for your platform, see their [Getting Started](https://github.com/dhall-lang/dhall-lang/wiki/Getting-started%3A-Generate-JSON-or-YAML#installation).

### Versions Used in this Project

The following commands should now work (the versions beside them are the versions I used when writing this project):
```bash
purs --version # 0.12.1
pulp --version # 12.3.0
psc-package --version # 0.3.2

## If Spacchetti was installed...
spacchetti version # 0.5.0.0
```

In addition to the above packages, you also need to install `dhall-to-json`. [Dhall](https://github.com/dhall-lang/dhall-lang):
> Dhall is a programmable configuration language that is not Turing-complete
>
> You can think of Dhall as: JSON + functions + types + imports
Good news! You don't need to understand Dhall to use it (I've literally written the instructions / examples to copy/paste).
### Building This Project

To install `dhall-to-json` for your platform, see [this page](https://github.com/dhall-lang/dhall-lang/wiki/Getting-started%3A-Generate-JSON-or-YAML)
Once the above has been verified, run the below script, which will download, install, and build every folder in this project. Open a shell in this project's parent folder and run this command:
```bash
./for-each-folder--install-deps-and-compile.sh
```

See the `Build Tools/Tool Comparisons.md` file's "Why Spacchetti"'s section for more info about why `Spacchetti` even exists.
Whenever I make a new release with breaking changes, this script will remove any outdated dependencies, reinstall the correct ones, and rebuild all of the folders' code.

### Setting up your editor

Expand Down
2 changes: 1 addition & 1 deletion 00-Getting-Started/03-Other-Important-Info.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
If you decide to read the book, here are things to be aware of:
- be wary of any references to these [deprecated packages](https://github.com/purescript-deprecated)
- **Refer to [`dwhitney`'s fork of the book's code](https://github.com/dwhitney/purescript-book/tree/0.12)**, which is currently being updating to use `0.12.x`.
- Refer to the ReadMe in `ROOT_FOLDER/Hello-World/Console-Lessons/Effect-Eff-and-Aff` to understand how to translate the no-longer-used `Eff` type to `Effect` type.
- Refer to the ReadMe in `Hello-World/Hello-World-and-Effects/Effect-Eff-and-Aff.md` to understand how to translate the no-longer-used `Eff` type to `Effect` type.

## Differences From Haskell

Expand Down
Loading

0 comments on commit 8551f54

Please sign in to comment.