git.iko.soy/rowtype-yoga/purescm
on bytevector help sign in
Update package.json and README (#159)
3ab384dAntti Holvikari
README.md+21−5
@@ -1,17 +1,33 @@
1−# purs-backend-chez
1+# purescm - Chez Scheme backend for PureScript
2+
3+## Installation
4+
5+```
6+npm i --global purescm@next
7+```
2
8
3## Usage
9## Usage
4
10
5−To compile PureScript corefn files to scheme:
11+The best way to use `purescm` is to use the [spago](https://github.com/purescript/spago) integration for alternative PureScript backends. In `spago.yaml` use the `backend` config like so:
12+
13+```
14+workspace:
15+ backend:
16+ cmd: purescm
17+ args:
18+ - "build"
19+```
20+
21+Then to compile your `purescm` project you can run:
6
22
7```
23```
8−purs-backend-chez build
24+spago build
9```
25```
10
26
11This will produce output under `output/`. You can then further precompile the scheme files to a single Chez program:
27This will produce output under `output/`. You can then further precompile the scheme files to a single Chez program:
12
28
13```
29```
14−purs-backend-chez bundle-app --main Main
30+purescm bundle-app --main Main
15```
31```
16
32
17which generates a single file `output/main`. To run the compiled program:
33which generates a single file `output/main`. To run the compiled program:
@@ -52,4 +68,4 @@ Copyright 1984-2022 Cisco Systems, Inc.
52To run snapshots, run `npm run test`.
68To run snapshots, run `npm run test`.
53To overwrite old snapshots with the latest output, run `npm run test -- -a "--accept"`.
69To overwrite old snapshots with the latest output, run `npm run test -- -a "--accept"`.
54To add a new snapshot, create a file called `Snapshot.X.purs` where `X` indicates what is being tested.
70To add a new snapshot, create a file called `Snapshot.X.purs` where `X` indicates what is being tested.
55−If a snapshot needs a dependency, install it by running `spago -x test-snapshots/spago.dhall install <packages...>`. The snapshots have their own `spago.dhall` file so as not to pollute the `purs-backend-chez` binary with unneeded dependencies.
71+If a snapshot needs a dependency, install it by running `spago -x test-snapshots/spago.dhall install <packages...>`. The snapshots have their own `spago.dhall` file so as not to pollute the `purescm` binary with unneeded dependencies.
package-lock.jsonnew file+12
@@ -0,0 +1,12 @@
1+{
2+ "name": "purescm",
3+ "lockfileVersion": 3,
4+ "requires": true,
5+ "packages": {
6+ "": {
7+ "bin": {
8+ "purs-backend-chez": "index.js"
9+ }
10+ }
11+ }
12+}
package.json+9−4
@@ -1,12 +1,17 @@
1{
1{
2− "private": true,
2+ "name": "purescm",
3+ "version": "1.0.0",
3 "main": "index.js",
4 "main": "index.js",
4 "type": "module",
5 "type": "module",
6+ "files": [
7+ "vendor/**/*.sls",
8+ "bundle/index.js"
9+ ],
5 "bin": {
10 "bin": {
6− "purs-backend-chez": "./index.js"
11+ "purescm": "./index.js"
7 },
12 },
8 "scripts": {
13 "scripts": {
9− "test": "spago -x test.dhall test",
14+ "test": "spago test",
10− "build": "spago build --purs-args '-g corefn,js' && purs-backend-es bundle-module -m Main --int-tags --platform=node --minify --to=./bundle/index.js"
15+ "build": "spago build && purs-backend-es bundle-module -m Main --int-tags --platform=node --minify --to=./bundle/index.js"
11 }
16 }
12}
17}