Skip to content

Commit 46dbaec

Browse files
committed
feat: Migrate to Spago v1
Resolves #315
1 parent c41dfbc commit 46dbaec

12 files changed

Lines changed: 1843 additions & 163 deletions

File tree

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ stack build
7171

7272
# Set up the PureScript environment for the server
7373
cd staging
74-
spago build
74+
npm run build
7575

7676
# Ensure the compiled JavaScript is available to the client via symbolic link.
7777
ln -s "$PWD/output" "$PWD/../client/public/js/output"
@@ -109,13 +109,12 @@ npm run serve:(dev|production)
109109

110110
### 4. Choosing a Tag
111111

112-
The built-in examples for Try PureScript are loaded from this GitHub repository. To change the tag that the examples are loaded from, you'll need to touch three files:
112+
The built-in examples for Try PureScript are loaded from this GitHub repository. To change the tag that the examples are loaded from, you'll need to touch two files:
113113

114-
* `client/config/dev/Try.Config.purs`
115-
* `client/config/prod/Try.Config.purs`
114+
* `client/src/Try/Config.js`
116115
* `client/examples/Main.purs`, in the `fromExample` function.
117116

118-
If you are preparing a release or if you need to adjust examples in development, you should change the tag in these three places (and ensure you're using the same tag in each place!).
117+
If you are preparing a release or if you need to adjust examples in development, you should change the tag in these two places (and ensure you're using the same tag in each place!).
119118

120119
## Server API
121120

client/config/dev/Try.Config.purs

Lines changed: 0 additions & 15 deletions
This file was deleted.

client/config/prod/Try.Config.purs

Lines changed: 0 additions & 15 deletions
This file was deleted.

client/package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,24 @@
33
"private": true,
44
"scripts": {
55
"clean": "rimraf output",
6-
"test": "spago test --path config/dev/Try.Config.purs",
7-
"build": "spago build --path config/dev/Try.Config.purs",
8-
"build:dev": "spago bundle-app --path config/dev/Try.Config.purs --to client.js",
9-
"build:production": "spago bundle-app --path config/prod/Try.Config.purs --purs-args '--censor-lib --strict' --to client.js",
10-
"bundle": "esbuild --outfile=public/js/index.js --bundle --minify --platform=browser --format=iife --tree-shaking=true client.js",
6+
"test": "spago test",
7+
"build": "spago build",
8+
"build:dev": "spago bundle --outfile client.js --force",
9+
"build:production": "spago bundle --outfile client.js --force --strict",
10+
"bundle:dev": "esbuild --define:__DEVELOPMENT__=true --outfile=public/js/index.js --bundle --minify --platform=browser --format=iife --tree-shaking=true client.js",
11+
"bundle:production": "esbuild --define:__DEVELOPMENT__=false --outfile=public/js/index.js --bundle --minify --platform=browser --format=iife --tree-shaking=true client.js",
1112
"serve": "http-server public/ -o / --cors=\"Access-Control-Allow-Origin: *\" -c-1",
12-
"serve:dev": "npm run build:dev && npm run bundle && npm run serve",
13-
"serve:production": "npm run build:production && npm run bundle && npm run serve",
13+
"serve:dev": "npm run build:dev && npm run bundle:dev && npm run serve",
14+
"serve:production": "npm run build:production && npm run bundle:production && npm run serve",
1415
"updateConfigVersions": "node updateSharedConfigVersions.mjs src/Try/SharedConfig.purs"
1516
},
1617
"devDependencies": {
1718
"esbuild": "^0.14.43",
1819
"http-server": "^14.1.0",
19-
"purescript": "^0.15.2",
20+
"purescript": "^0.15.10",
2021
"purescript-psa": "^0.8.2",
2122
"rimraf": "^2.5.4",
22-
"spago": "^0.20.9"
23+
"spago": "^1.0.4"
2324
},
2425
"dependencies": {
2526
"ace-builds": "^1.5.0",

client/packages.dhall

Lines changed: 0 additions & 5 deletions
This file was deleted.

client/spago.dhall

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)