diff --git a/.travis.yml b/.travis.yml index dd9c7d7..66da98d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,10 @@ language: node_js sudo: false node_js: - - 5 + - 7 before_install: - curl -L https://raw.githubusercontent.com/futurice/fum2github/3a270cf7a3b600900c1a8ed07c23d5f3ba8b115d/travis_long > travis_long && chmod +x travis_long install: - - ./travis_long npm install bower -g - ./travis_long npm install script: - ./travis_long npm test diff --git a/bower.json b/bower.json index e6b92e4..12e4119 100644 --- a/bower.json +++ b/bower.json @@ -21,13 +21,14 @@ "package.json" ], "dependencies": { - "purescript-eff": "1.0.0", - "purescript-generics": "1.0.0", - "purescript-argonaut-codecs": "1.0.0" + "purescript-eff": "^3.1.0", + "purescript-generics": "^4.0.0", + "purescript-argonaut-codecs": "^3.1.0", + "purescript-argonaut-generic": "^1.0.0" }, "devDependencies": { - "purescript-console": "1.0.0", - "purescript-spec": "0.8.0" + "purescript-console": "^3.0.0", + "purescript-spec": "^1.0.0" }, "version": "0.2.1" } diff --git a/package.json b/package.json index ed09c4f..aae0503 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "test": "pulp test" }, "devDependencies": { - "pulp": "9.0.1", - "purescript": "0.9.1" + "bower": "^1.8.0", + "pulp": "^11.0.0", + "purescript": "^0.11.4" } } diff --git a/src/Electron.purs b/src/Electron.purs index c254762..92763f7 100644 --- a/src/Electron.purs +++ b/src/Electron.purs @@ -1,4 +1,6 @@ module Electron where +import Control.Monad.Eff (kind Effect) + -- | The `ELECTRON` effect represents computations which require and affect the Electron environment. -foreign import data ELECTRON :: ! +foreign import data ELECTRON :: Effect diff --git a/src/Electron/BrowserWindow.purs b/src/Electron/BrowserWindow.purs index e0a2c29..4045b6e 100644 --- a/src/Electron/BrowserWindow.purs +++ b/src/Electron/BrowserWindow.purs @@ -42,7 +42,7 @@ derive instance genericBrowserWindowOption :: Generic BrowserWindowOption derive instance genericWebPreference :: Generic WebPreference -foreign import data BrowserWindow :: * +foreign import data BrowserWindow :: Type newBrowserWindow :: forall eff . BrowserWindowOptions @@ -63,7 +63,7 @@ foreign import onClose :: forall eff -> Eff (electron :: ELECTRON | eff) Unit -> Eff (electron :: ELECTRON | eff) Unit -foreign import data WebContents :: * +foreign import data WebContents :: Type foreign import webContents :: forall eff . BrowserWindow diff --git a/src/Electron/Event.purs b/src/Electron/Event.purs index b271c99..f1ffac0 100644 --- a/src/Electron/Event.purs +++ b/src/Electron/Event.purs @@ -8,7 +8,7 @@ import Prelude (Unit) import Control.Monad.Eff (Eff) import Electron (ELECTRON) -foreign import data Event :: * +foreign import data Event :: Type foreign import preventDefault :: forall e. Event -> Eff (electron :: ELECTRON | e) Unit diff --git a/src/Electron/Options.purs b/src/Electron/Options.purs index acdf80e..e2c059b 100644 --- a/src/Electron/Options.purs +++ b/src/Electron/Options.purs @@ -4,12 +4,13 @@ module Electron.Options import Prelude ((+), (>>>), unit, (#), map) import Data.Argonaut.Core (Json) -import Data.Argonaut.Encode (encodeJson, gEncodeJson') +import Data.Argonaut.Encode (encodeJson) +import Data.Argonaut.Encode.Generic (gEncodeJson') import Data.Foldable (foldl) import Data.Generic (class Generic, GenericSpine(SArray, SProd), toSpine) import Data.Maybe (Maybe(Just)) import Data.Monoid ((<>)) -import Data.String (drop, lastIndexOf, take, toLower) +import Data.String (Pattern(..), drop, lastIndexOf, take, toLower) import Data.StrMap as M encodeOptions :: forall a. (Generic a) => Array a -> Json @@ -32,6 +33,6 @@ toCamelCase s = toLower (take 1 s) <> drop 1 s simpleName :: String -> String simpleName qname = - case lastIndexOf "." qname of + case lastIndexOf (Pattern ".") qname of Just index -> drop (index + 1) qname _ -> qname diff --git a/src/Electron/Types.purs b/src/Electron/Types.purs index 1ef8c1d..76f34f2 100644 --- a/src/Electron/Types.purs +++ b/src/Electron/Types.purs @@ -5,13 +5,12 @@ module Electron.Types ) where import Prelude (Unit) -import Control.Monad.Eff (Eff) -import Electron (ELECTRON) +import Control.Monad.Eff (kind Effect, Eff) import Electron.Event (Event) -- | A boxed function that can be used as an event listener. This is necessary -- | due to the underling implementation of Eff functions. -foreign import data Listener :: # ! -> * +foreign import data Listener :: # Effect -> Type -- | Creates a Listener from a normal PureScript Eff function. foreign import mkListener diff --git a/test/Main.purs b/test/Main.purs index 1ec9cad..fc2c7fa 100644 --- a/test/Main.purs +++ b/test/Main.purs @@ -4,6 +4,8 @@ import Prelude (Unit) import Control.Monad.Eff (Eff) import Control.Monad.Eff.Console (CONSOLE) +import Control.Monad.Aff.AVar (AVAR) +import Control.Monad.Eff.Timer (TIMER) import Node.Process (PROCESS) import Data.Argonaut.Encode.Combinators ((~>), (:=)) @@ -17,7 +19,7 @@ import Test.Spec.Runner (run) import Electron.BrowserWindow (BrowserWindowOption(WebPreferences, Height, Width), WebPreference(OverlayScrollbars)) import Electron.Options (encodeOptions) -main :: forall eff. Eff (process :: PROCESS, console :: CONSOLE | eff) Unit +main :: forall eff. Eff (process :: PROCESS, console :: CONSOLE, avar :: AVAR, timer :: TIMER | eff) Unit main = run [consoleReporter] do describe "encodeOptions :: BrowserWindowOptions -> Json" do it "can encode all options" do