From 37d178041799aaf8113f6f5128334be7eb4bfd97 Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 29 Aug 2015 16:45:04 +0200 Subject: Using npm to compile elm and haskell sources --- .gitignore | 1 + README.md | 4 ++-- gen | 5 ----- package.json | 18 ++++++++++++++++++ 4 files changed, 21 insertions(+), 7 deletions(-) delete mode 100755 gen create mode 100644 package.json diff --git a/.gitignore b/.gitignore index 254a354..32e9bab 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ public/javascripts/client.js sessionKey deploy kimsufi.tar.gz +node_modules diff --git a/README.md b/README.md index 8cfbe01..42a3802 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Share costs with a group of people. ``` cabal sandbox init cabal install --only-dependencies -cabal build elm package install -./dist/build/sharedCost/sharedCost +npm install +npm run watch ``` diff --git a/gen b/gen deleted file mode 100755 index 5e5358d..0000000 --- a/gen +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -trap 'fuser -k 3000/tcp' EXIT -elm-make src/client/Main.elm --output public/javascripts/client.js \ - && cabal build \ - && ./dist/build/sharedCost/sharedCost diff --git a/package.json b/package.json new file mode 100644 index 0000000..ad80280 --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "devDependencies": { + "watch": "0.16.0" + }, + "scripts": { + "watch": "npm run watch-server & npm run watch-client", + "watch-server": "watch 'npm run build-and-launch-server' src/server", + "watch-client": "watch 'npm run build-client' src/client", + + "build": "npm run build-server && npm run build-client", + "build-server": "cabal build", + "build-client": "elm make src/client/Main.elm --output public/javascripts/client.js", + + "build-and-launch-server": "npm run build-server && npm run kill-server && npm run launch-server", + "launch-server": "./dist/build/sharedCost/sharedCost &", + "kill-server": "pkill sharedCost || true" + } +} -- cgit v1.2.3