Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 86bc357

Browse files
authored
Merge pull request #3 from garyb/ps-0.11
Update for PureScript 0.11
2 parents bdb3680 + f626346 commit 86bc357

File tree

8 files changed

+41
-55
lines changed

8 files changed

+41
-55
lines changed

.eslintrc.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"parserOptions": {
3+
"ecmaVersion": 5
4+
},
5+
"extends": "eslint:recommended",
6+
"env": {
7+
"commonjs": true
8+
},
9+
"rules": {
10+
"strict": [2, "global"],
11+
"block-scoped-var": 2,
12+
"consistent-return": 2,
13+
"eqeqeq": [2, "smart"],
14+
"guard-for-in": 2,
15+
"no-caller": 2,
16+
"no-extend-native": 2,
17+
"no-loop-func": 2,
18+
"no-new": 2,
19+
"no-param-reassign": 2,
20+
"no-return-assign": 2,
21+
"no-unused-expressions": 2,
22+
"no-use-before-define": 2,
23+
"radix": [2, "always"],
24+
"indent": [2, 2],
25+
"quotes": [2, "double"],
26+
"semi": [2, "always"]
27+
}
28+
}

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ npm-debug.log
22
/.*
33
!/.gitignore
44
!/.travis.yml
5-
!/.jscsrc
6-
!/.jshintrc
5+
!/.eslintrc.json
76
/bower_components/
87
/node_modules/
98
/output/

.jscsrc

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

.jshintrc

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

bower.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"package.json"
1919
],
2020
"dependencies": {
21-
"purescript-prelude": "^2.4.0",
22-
"purescript-dom": "^3.5.1",
23-
"purescript-css": "^2.1.0"
21+
"purescript-prelude": "^3.0.0",
22+
"purescript-dom": "^4.2.0",
23+
"purescript-css": "^3.0.0"
2424
}
2525
}

example/src/Main.purs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import Prelude
55
import Control.Monad.Eff (Eff)
66

77
import Data.Maybe (fromMaybe)
8-
import Data.Nullable (toMaybe)
98

109
import DOM (DOM)
1110
import CSS (Selector, fromString)
@@ -27,9 +26,7 @@ onLoad action
2726
=<< window
2827

2928
stringFromAttr :: forall eff. String -> Element -> Eff (dom :: DOM | eff) String
30-
stringFromAttr attr el = do
31-
val <- getAttribute attr el
32-
pure $ fromMaybe "" $ toMaybe val
29+
stringFromAttr attr el = fromMaybe "" <$> getAttribute attr el
3330

3431
testElement :: forall eff. Element -> Eff (dom :: DOM | eff) Unit
3532
testElement el = void $ C.fromElement el $ stringFromAttr "data-copy-text" el
@@ -41,6 +38,6 @@ main :: forall eff. Eff (dom :: DOM | eff) Unit
4138
main = onLoad do
4239
win <- window
4340
doc <- documentToNonElementParentNode <<< htmlDocumentToDocument <$> document win
44-
element <- toMaybe <$> getElementById (ElementId "test-element") doc
41+
element <- getElementById (ElementId "test-element") doc
4542
fromMaybe (pure unit) $ testElement <$> element
4643
testSelector $ fromString ".test-selector"

package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
"private": true,
33
"scripts": {
44
"clean": "rimraf output && rimraf .pulp-cache",
5-
"build": "jshint src && jscs src && pulp build --censor-lib --strict",
6-
"test": "pulp build -I example/src --censor-lib --strict",
5+
"build": "eslint src && pulp build -- --censor-lib --strict",
6+
"test": "pulp build -I example/src -- --censor-lib --strict",
77
"build-example": "pulp browserify -I example/src --to example/example.js"
88
},
99
"devDependencies": {
10-
"jscs": "^3.0.7",
11-
"jshint": "^2.9.4",
12-
"pulp": "^9.0.1",
13-
"purescript": "^0.10.7",
14-
"purescript-psa": "^0.3.9",
10+
"eslint": "^3.19.0",
11+
"pulp": "^11.0.0",
12+
"purescript": "^0.11.4",
13+
"purescript-psa": "^0.5.1",
1514
"rimraf": "^2.6.1"
1615
},
1716
"dependencies": {

src/Clipboard.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import DOM (DOM)
1212
import CSS (Selector, selector)
1313
import DOM.Node.Types (Element)
1414

15-
foreign import data Clipboard :: *
15+
foreign import data Clipboard :: Type
1616

1717
foreign import fromElement
1818
:: forall eff

0 commit comments

Comments
 (0)