diff --git a/.gitignore b/.gitignore index b4a75c8..3c97271 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /.* !/.gitignore +!/.travis.yml /bower_components/ /node_modules/ /output/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f8ab9a3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,17 @@ +language: node_js +dist: trusty +sudo: required +node_js: 5 +install: + - npm install -g bower + - npm install +script: + - npm run build +after_success: +- >- + test $TRAVIS_TAG && + node_modules/.bin/psc-publish > .pursuit.json && + curl -X POST http://pursuit.purescript.org/packages \ + -d @.pursuit.json \ + -H 'Accept: application/json' \ + -H "Authorization: token ${GITHUB_TOKEN}" diff --git a/package.json b/package.json index 5f30a82..8382314 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "scripts": { - "postinstall": "pulp dep install", + "postinstall": "bower install", "build": "pulp browserify --optimise --to dist/app.js", "watch": "pulp -w browserify --to dist/app.js" }, @@ -9,7 +9,7 @@ "virtual-dom": "^2.1.1" }, "devDependencies": { - "pulp": "^7.0.0", + "pulp": "^8.1.0", "purescript": "^0.7.6" } } diff --git a/src/Main.purs b/src/Main.purs index 0ba63c5..3ac9510 100644 --- a/src/Main.purs +++ b/src/Main.purs @@ -2,14 +2,12 @@ module Main where import Prelude -import Control.Monad.Aff (runAff) import Control.Monad.Eff (Eff()) -import Control.Monad.Eff.Exception (throwException) import Halogen -import Halogen.Util (awaitBody) -import qualified Halogen.HTML.Indexed as H -import qualified Halogen.HTML.Events.Indexed as E +import Halogen.Util (awaitBody, runHalogenAff) +import Halogen.HTML.Indexed as H +import Halogen.HTML.Events.Indexed as E data Query a = ToggleState a @@ -18,7 +16,7 @@ type State = { on :: Boolean } initialState :: State initialState = { on: false } -ui :: forall g. (Functor g) => Component State Query g +ui :: forall g. Component State Query g ui = component { render, eval } where @@ -44,6 +42,6 @@ ui = component { render, eval } pure next main :: Eff (HalogenEffects ()) Unit -main = runAff throwException (const (pure unit)) $ do +main = runHalogenAff do body <- awaitBody runUI ui initialState body