Skip to content

Commit d4c2081

Browse files
authored
Merge pull request #17 from garyb/0.9-updates
Update for PureScript 0.9
2 parents b9cb64c + c0bb8b1 commit d4c2081

File tree

11 files changed

+156
-80
lines changed

11 files changed

+156
-80
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
/.*
22
!/.gitignore
3+
!/.jscsrc
4+
!/.jshintrc
35
!/.travis.yml
46
bower_components/
57
node_modules/
68
output/
7-
/example/example.js
9+
example/example.js
10+
example/.*

.jscsrc

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"preset": "grunt",
3+
"disallowSpacesInFunctionExpression": null,
4+
"requireSpacesInFunctionExpression": {
5+
"beforeOpeningRoundBrace": true,
6+
"beforeOpeningCurlyBrace": true
7+
},
8+
"disallowSpacesInAnonymousFunctionExpression": null,
9+
"requireSpacesInAnonymousFunctionExpression": {
10+
"beforeOpeningRoundBrace": true,
11+
"beforeOpeningCurlyBrace": true
12+
},
13+
"disallowSpacesInsideObjectBrackets": null,
14+
"requireSpacesInsideObjectBrackets": "all",
15+
"validateQuoteMarks": "\"",
16+
"requireCurlyBraces": null
17+
}

.jshintrc

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"bitwise": true,
3+
"eqeqeq": true,
4+
"forin": true,
5+
"freeze": true,
6+
"funcscope": true,
7+
"futurehostile": true,
8+
"strict": "global",
9+
"latedef": true,
10+
"maxparams": 1,
11+
"noarg": true,
12+
"nocomma": true,
13+
"nonew": true,
14+
"notypeof": true,
15+
"singleGroups": true,
16+
"undef": true,
17+
"unused": true,
18+
"eqnull": true,
19+
"predef": ["exports"]
20+
}

.travis.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
language: node_js
22
dist: trusty
33
sudo: required
4-
node_js: 5
4+
node_js: 6
55
install:
6-
- npm install
76
- npm install -g bower
7+
- npm install
88
- bower install
99
script:
10-
- npm run example
10+
- npm run -s build
11+
- npm run -s example
1112
after_success:
1213
- >-
1314
test $TRAVIS_TAG &&

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Build Status](https://travis-ci.org/slamdata/purescript-ace-halogen.svg?branch=master)](https://travis-ci.org/slamdata/purescript-ace-halogen)
55
[![Dependency Status](https://www.versioneye.com/user/projects/563a1eda1d47d4001500088b/badge.svg?style=flat)](https://www.versioneye.com/user/projects/563a1eda1d47d4001500088b)
66

7-
A [Halogen](https://github.com/slamdata/purescript-halogen) component for the Ace editor.
7+
[Halogen](https://github.com/slamdata/purescript-halogen) component for the [Ace editor](https://ace.c9.io).
88

99
## Installation
1010

bower.json

+12-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"Gary Burgess <[email protected]>",
66
"Maxim Zimaliev <[email protected]>"
77
],
8-
"description": "A Halogen component for the Ace editor",
8+
"description": "Halogen component for the Ace editor",
99
"keywords": [
1010
"purescript",
1111
"halogen",
@@ -18,15 +18,19 @@
1818
"license": "Apache-2.0",
1919
"ignore": [
2020
"**/.*",
21-
"node_modules",
2221
"bower_components",
23-
"test"
22+
"node_modules",
23+
"example",
24+
"output",
25+
"test",
26+
"bower.json",
27+
"package.json"
2428
],
2529
"dependencies": {
26-
"purescript-ace": "^0.11.0",
27-
"purescript-datetime": "^0.9.1",
28-
"purescript-halogen": "^0.8.0",
29-
"purescript-random": "^0.2.3",
30-
"purescript-refs": "^0.2.0"
30+
"purescript-ace": "^1.0.0",
31+
"purescript-halogen": "^0.9.0",
32+
"purescript-now": "^1.0.0",
33+
"purescript-random": "^1.0.0",
34+
"purescript-refs": "^1.0.0"
3135
}
3236
}

example/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"virtual-dom": "^2.1.1"
99
},
1010
"devDependencies": {
11-
"pulp": "^8.1.0",
12-
"purescript": "^0.7.6",
11+
"pulp": "^9.0.1",
12+
"purescript": "^0.9.1",
1313
"rimraf": "^2.5.2"
1414
}
1515
}

example/src/Main.purs

+10-12
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,24 @@ module Main where
22

33
import Prelude
44

5-
import Control.Bind ((=<<))
6-
import Control.Monad.Aff (Aff())
7-
import Control.Monad.Eff (Eff())
5+
import Control.Monad.Aff (Aff)
6+
import Control.Monad.Eff (Eff)
87
import Control.Monad.Eff.Class (liftEff)
9-
import Control.Monad.Eff.Random (RANDOM())
10-
import Control.Monad.Eff.Ref (REF())
8+
import Control.Monad.Eff.Random (RANDOM)
9+
import Control.Monad.Eff.Ref (REF)
10+
import Control.Monad.Eff.Now (NOW)
1111

12-
import Data.Date (Now())
13-
import Data.Functor.Coproduct (Coproduct())
12+
import Data.Functor.Coproduct (Coproduct)
1413
import Data.Maybe (Maybe (..), fromMaybe)
15-
import Data.NaturalTransformation (Natural())
1614

1715
import Halogen as H
1816
import Halogen.HTML.Indexed as HH
1917
import Halogen.Util (runHalogenAff, awaitBody)
2018

2119
import Ace.Editor as Editor
2220
import Ace.EditSession as Session
23-
import Ace.Halogen.Component (AceState(), AceQuery (TextChanged, GetText), aceConstructor)
24-
import Ace.Types (ACE(), Editor())
21+
import Ace.Halogen.Component (AceState, AceQuery (TextChanged, GetText), aceConstructor)
22+
import Ace.Types (ACE, Editor)
2523

2624
data Query a
2725
= UpdateText a
@@ -40,7 +38,7 @@ type AceSlot = Unit
4038
type StateP g = H.ParentState State AceState Query AceQuery g AceSlot
4139
type QueryP = Coproduct Query (H.ChildF AceSlot AceQuery)
4240
type MainHtml g = H.ParentHTML AceState Query AceQuery g AceSlot
43-
type MainEffects = H.HalogenEffects (random :: RANDOM, now :: Now, ref :: REF, ace :: ACE)
41+
type MainEffects = H.HalogenEffects (random :: RANDOM, now :: NOW, ref :: REF, ace :: ACE)
4442
type MainAff = Aff MainEffects
4543
type MainDSL = H.ParentDSL State AceState Query AceQuery MainAff AceSlot
4644

@@ -62,7 +60,7 @@ ui = H.parentComponent { render, eval, peek: Just (peek <<< H.runChildF) }
6260
Editor.setValue state.text Nothing editor
6361
pure unit
6462

65-
eval :: Natural Query MainDSL
63+
eval :: Query ~> MainDSL
6664
eval (UpdateText next) =
6765
pure next
6866

package.json

+8-9
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": "pulp build --censor-lib --strict",
6-
"example": "bower link && cd example && bower link purescript-ace-halogen && npm run build"
7-
},
8-
"dependencies": {
9-
"virtual-dom": "^2.1.1"
5+
"build": "jshint src && jscs src && pulp build --censor-lib --strict",
6+
"example": "bower link && cd example && bower link purescript-ace-halogen && npm i --production && npm run -s build"
107
},
118
"devDependencies": {
12-
"pulp": "^8.2.0",
13-
"purescript-psa": "^0.3.8",
14-
"purescript": "^0.8.5",
15-
"rimraf": "^2.5.2"
9+
"jscs": "^2.8.0",
10+
"jshint": "^2.9.1",
11+
"pulp": "^9.0.1",
12+
"purescript": "^0.9.1",
13+
"purescript-psa": "^0.3.9",
14+
"rimraf": "^2.5.0"
1615
}
1716
}

src/Ace/Halogen/Component.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// module Ace.Halogen.Component
1+
"use strict";
22

3-
exports.completeFns = {value: {}};
3+
exports.completeFns = { value: {} };
44

5-
exports.initialized = {value: false};
5+
exports.initialized = { value: false };
66

7-
exports.focused = {value: ""};
7+
exports.focused = { value: "" };
88

9-
exports.dataset = function(node) {
10-
return function() {
11-
return node.dataset;
12-
};
9+
exports.dataset = function (node) {
10+
return function () {
11+
return node.dataset;
12+
};
1313
};

0 commit comments

Comments
 (0)