Skip to content

upgrade to ps 0.12 #28

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 1 commit 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
23 changes: 18 additions & 5 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,23 @@
"package.json"
],
"dependencies": {
"purescript-ace": "^4.0.0",
"purescript-halogen": "^3.1.1",
"purescript-now": "^3.0.0",
"purescript-random": "^3.0.0",
"purescript-refs": "^3.0.0"
"purescript-ace": "^7.0.0",
"purescript-halogen": "4.0.0",
"purescript-now": "^4.0.0",
"purescript-random": "^4.0.0",
"purescript-refs": "^4.1.0",
"purescript-aff": "^5.1.1",
"purescript-foreign-object": "^2.0.1",
"purescript-prelude": "^4.1.1"
},
"resolutions": {
"purescript-foreign-object": "^2.0.1",
"purescript-typelevel-prelude": "^4.0.0",
"purescript-web-html": "^2.0.0",
"purescript-web-uievents": "^2.0.0",
"purescript-web-file": "^2.0.0",
"purescript-web-dom": "^2.0.0",
"purescript-web-storage": "^3.0.0",
"purescript-web-events": "^2.0.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something is wrong somewhere if you were forced to make resolutions - maybe some other dependency or dependencies that need updating first - I don't mind making resolutions in projects / apps that aren't going to be depended upon, but having it in a library is going to cause issues for anyone who wants to rely on it too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate bower so much. ok I can take a look, I just updated everything to latest

Copy link
Member

@garyb garyb May 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use npm-check-updates to bump everything to the latest version (you can use a flag to run it on bower too) if you don't already know about that. It doesn't help with figuring out where the conflicts are when bower has a meltdown unfortunately, but it's useful to take some of the pain out!

}
}
27 changes: 26 additions & 1 deletion example/bower.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
{
"name": "purescript-ace-halogen-example",
"private": true,
"ignore": [
"**/.*",
"bower_components",
"node_modules",
"example",
"output",
"test",
"bower.json",
"package.json"
],
"dependencies": {
"purescript-ace-halogen": "*",
"ace-builds": "^1.2.2"
"purescript-prelude": "^4.1.1",
"purescript-halogen": "4.0.0",
"purescript-ace": "^7.0.0",
"purescript-aff": "^5.1.1",
"purescript-random": "^4.0.0",
"ace-builds": "^1.4.4"
},
"resolutions": {
"purescript-foreign-object": "^2.0.1",
"purescript-typelevel-prelude": "^4.0.0",
"purescript-web-html": "^2.0.0",
"purescript-web-uievents": "^2.0.0",
"purescript-web-file": "^2.0.0",
"purescript-web-dom": "^2.0.0",
"purescript-web-storage": "^3.0.0",
"purescript-web-events": "^2.0.0"
}
}
7 changes: 4 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
"build": "pulp browserify --optimise --to example.js"
},
"devDependencies": {
"pulp": "^9.0.1",
"purescript": "^0.10.1",
"rimraf": "^2.5.4"
"bower": "^1.8.4",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding bower as an explicit local dependency doesn't work too well, since it complains if it's not the most up to date version at all times.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I can remove. this was when I was struggling to get yarn run example working but now it does.

"pulp": "^12.4.2",
"purescript": "^0.12.5",
"rimraf": "^2.6.2"
}
}
29 changes: 12 additions & 17 deletions example/src/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ module Main where

import Prelude

import Control.Monad.Aff (Aff)
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Class (liftEff)
import Control.Monad.Eff.Random (RANDOM)
import Control.Monad.Eff.Now (NOW)
import Effect (Effect)
import Effect.Aff (Aff)
import Effect.Class (liftEffect)

import Data.Maybe (Maybe(..))

Expand All @@ -19,7 +17,7 @@ import Halogen.VDom.Driver (runUI)
import Ace.Editor as Editor
import Ace.EditSession as Session
import Ace.Halogen.Component (AceQuery, AceMessage(..), aceComponent)
import Ace.Types (ACE, Editor)
import Ace.Types (Editor)

data Query a
= HandleMessage AceMessage a
Expand All @@ -35,13 +33,10 @@ initialState =

type AceSlot = Unit

type MainEffects = HA.HalogenEffects (random ∷ RANDOM, now ∷ NOW, ace ∷ ACE)
type MainAff = Aff MainEffects
type MainHtml = H.ParentHTML Query AceQuery AceSlot Aff
type MainDSL = H.ParentDSL State Query AceQuery AceSlot Void Aff

type MainHtml = H.ParentHTML Query AceQuery AceSlot MainAff
type MainDSL = H.ParentDSL State Query AceQuery AceSlot Void MainAff

ui ∷ H.Component HH.HTML Query Unit Void MainAff
ui ∷ H.Component HH.HTML Query Unit Void Aff
ui =
H.parentComponent
{ initialState: const initialState
Expand All @@ -58,11 +53,11 @@ ui =
, HH.div_ [ HH.text state.text ]
]

component :: State → H.Component HH.HTML AceQuery Unit AceMessage MainAff
component :: State → H.Component HH.HTML AceQuery Unit AceMessage Aff
component state = aceComponent (initEditor state) Nothing

initEditor ∷ State → Editor → MainAff Unit
initEditor state editor = liftEff $ do
initEditor ∷ State → Editor → Aff Unit
initEditor state editor = liftEffect $ do
session ← Editor.getSession editor
Session.setMode "ace/mode/yaml" session
_ ← Editor.setValue state.text Nothing editor
Expand All @@ -71,8 +66,8 @@ ui =
eval ∷ Query ~> MainDSL
eval = case _ of
HandleMessage (TextChanged text) next → do
H.modify (_ { text = text })
_ <- H.modify (_ { text = text })
pure next

main ∷ Eff MainEffects Unit
main ∷ Effect Unit
main = HA.runHalogenAff (runUI ui unit =<< HA.awaitBody)
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
"scripts": {
"clean": "rimraf output && rimraf .pulp-cache",
"build": "eslint src && pulp build -- --censor-lib --strict",
"purs:ide": "purs ide server --log-level=debug 'bower_components/purescript-*/src/**/*.purs' 'src/**/*.purs'",
"example": "bower link && cd example && bower link purescript-ace-halogen && npm run -s build"
},
"devDependencies": {
"bower": "^1.8.4",
"eslint": "^4.16.0",
"pulp": "^12.0.1",
"purescript": "^0.11.7",
"purescript-psa": "^0.6.0",
"pulp": "^12.4.2",
"purescript": "^0.12.5",
"purescript-psa": "^0.7.2",
"rimraf": "^2.6.2"
}
}
Loading