Skip to content

Bump up to 0.11 #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 6 additions & 5 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 3 additions & 1 deletion src/Electron.purs
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions src/Electron/BrowserWindow.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Electron/Event.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 4 additions & 3 deletions src/Electron/Options.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
5 changes: 2 additions & 3 deletions src/Electron/Types.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion test/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ((~>), (:=))
Expand All @@ -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
Expand Down