Skip to content

Repository files navigation

React App in PureScript

This is a template repository that sets up a React starter app with a basic PureScript component defined to get you started.

Prepare for class

Generate your own project here: https://github.com/mbbx6spp/react-purescript-starter/generate

Then follow ‘System Dependencies > Nix + Direnv’ and ‘System Dependencies > Yarn’ sections below.

Dependencies

Nix + Direnv

Assumes you have Nix version 2.3 or installed and preferably have direnv available in your system or user profile.

Copy the .env.sample file to .env and change any environment variables necessary for you local development environment.

$ cp .env.sample .env

Using Nix for your package manager merely requires you to run:

To use with direnv:

$ direnv allow

To use with Nix alone:

$ nix-shell

Either of the above enter you into the shell that contains all the system and tool dependencies you need with the lowest amount of fuss.

Symlink to PureScript output

$ ln -sf $PWD/output $PWD/src/output

This is needed due to React limitations (all source must appear under src/).

Yarn

In side that Nix shell:

$ yarn install

Now you will be able to run all necessary commands for the various developer activities during the course.

Versions

If you are installing necessary dependencies via a method other than Nix, please make sure your versions match the following or are above without breaking changes in between.

PureScript (purs --version):

$ purs --version
0.13.8

Spago (spago version):

$ spago version
0.15.3

Node.JS (node --version):

$ node --version
v12.18.2

Yarn (yarn --version):

$ yarn versions
1.22.4

Developer Porcelain

  • To start the React app run yarn start. This will show you the local and network URLs to use to access your development server running your React application.
  • To run PureScript tests run yarn ps:test.
  • To run JavaScript tests run yarn test.
  • To open a PureScript REPL run spago repl.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages