From 69129cc4b8a78b422bdac73fa2f307b14aa5bdcd Mon Sep 17 00:00:00 2001 From: martyall Date: Thu, 18 Apr 2024 22:59:24 -0700 Subject: [PATCH 1/2] upgraded deps --- packages.dhall | 23 ++++++++++++++++------- spago.dhall | 7 ------- src/Chanterelle.purs | 4 ++-- src/Chanterelle/Compile.purs | 3 +-- src/Chanterelle/Utils/FS.purs | 4 ++-- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/packages.dhall b/packages.dhall index a74050c..5ed1f18 100644 --- a/packages.dhall +++ b/packages.dhall @@ -1,6 +1,18 @@ let upstream = - https://raw.githubusercontent.com/f-o-a-m/package-sets/9e9623711d22de73259e765f5acf8407b7332998/purs-0.15.7-web3.dhall - sha256:f0ffdb72aef1af63caf537a130b40d8f73779e82496404d9cedb66c6a699b55d + https://github.com/purescript/package-sets/releases/download/psc-0.15.15-20240416/packages.dhall + sha256:ca727657c01cc31d0e79c2113b59126b9826f4b56d20a8193be3c725599fb754 + +let eth-core-deps = + https://raw.githubusercontent.com/f-o-a-m/purescript-eth-core/master/packages.dhall + sha256:af2751772a729d58edf7056805007934e3687b3079f8a02ac514e705aeab8c42 + +let web3-deps = + https://raw.githubusercontent.com/f-o-a-m/purescript-web3/master/packages.dhall + sha256:c1bebe7e4899bd64304a84fea26f9ea635e20897f206ce6fa86bd446715c5ffc + +let web3-generator-deps = + https://raw.githubusercontent.com/f-o-a-m/purescript-web3-generator/master/packages.dhall + sha256:89a7ee097ae9a095bf3bfddcb354d4c6b747d15b9b47ef0f5dc5f2280d3a8929 let additions = { solc = @@ -43,7 +55,6 @@ let additions = , "control" , "effect" , "either" - , "errors" , "eth-core" , "exceptions" , "fixed-points" @@ -54,11 +65,9 @@ let additions = , "maybe" , "language-cst-parser" , "tidy-codegen" - , "mkdirp" , "newtype" , "node-buffer" , "node-fs" - , "node-fs-aff" , "node-path" , "node-process" , "ordered-collections" @@ -73,8 +82,8 @@ let additions = , "web3" ] , repo = "https://github.com/f-o-a-m/purescript-web3-generator.git" - , version = "v7.0.0" + , version = "v7.1.0" } } -in upstream // additions +in upstream // eth-core-deps // web3-deps // web3-generator-deps // additions diff --git a/spago.dhall b/spago.dhall index 3dcd5b2..1e3488e 100644 --- a/spago.dhall +++ b/spago.dhall @@ -1,7 +1,3 @@ -{- -Welcome to a Spago project! -You can edit this file as you like. --} { name = "chanterelle" , dependencies = [ "aff" @@ -17,7 +13,6 @@ You can edit this file as you like. , "datetime" , "effect" , "either" - , "errors" , "eth-core" , "exceptions" , "foldable-traversable" @@ -28,11 +23,9 @@ You can edit this file as you like. , "js-date" , "logging" , "maybe" - , "mkdirp" , "newtype" , "node-buffer" , "node-fs" - , "node-fs-aff" , "node-path" , "node-process" , "now" diff --git a/src/Chanterelle.purs b/src/Chanterelle.purs index 12e2606..4e66f41 100644 --- a/src/Chanterelle.purs +++ b/src/Chanterelle.purs @@ -17,7 +17,7 @@ import Data.Show.Generic (genericShow) import Effect.Aff (Aff) import Effect.Class (liftEffect) import Node.Path (resolve) -import Node.Process (cwd, exit) +import Node.Process (cwd, exit') data SelectCLI (a :: Type) (b :: Type) = SelectCLI a @@ -110,4 +110,4 @@ runCommand project = case _ of eRes <- runCompileM Chanterelle.generatePS project either terminateOnCompileError mempty eRes - terminateOnCompileError e = logCompileError e *> liftEffect (exit 1) + terminateOnCompileError e = logCompileError e *> liftEffect (exit' 1) diff --git a/src/Chanterelle/Compile.purs b/src/Chanterelle/Compile.purs index bf2ddbc..1159658 100644 --- a/src/Chanterelle/Compile.purs +++ b/src/Chanterelle/Compile.purs @@ -12,7 +12,6 @@ import Chanterelle.Types.Compile (CompileError(..)) import Chanterelle.Types.Project (ChanterelleModule(..), ChanterelleProject(..), ChanterelleProjectSpec(..), getSolc, partitionSelectionSpecs) import Chanterelle.Utils (assertDirectory', fileIsDirty) import Chanterelle.Utils.Error (withExceptT') -import Control.Error.Util (note) import Control.Monad.Error.Class (class MonadThrow, throwError) import Control.Monad.Reader (class MonadAsk, ask) import Data.Argonaut (decodeJson, printJsonDecodeError) @@ -20,7 +19,7 @@ import Data.Argonaut as A import Data.Argonaut.Parser as AP import Data.Array (catMaybes, partition) import Data.Bifunctor (lmap) -import Data.Either (Either(..), either, hush) +import Data.Either (Either(..), either, hush, note) import Data.Lens ((^?)) import Data.Lens.Index (ix) import Data.Maybe (Maybe(..), fromMaybe, maybe) diff --git a/src/Chanterelle/Utils/FS.purs b/src/Chanterelle/Utils/FS.purs index 8b33ace..e48042c 100644 --- a/src/Chanterelle/Utils/FS.purs +++ b/src/Chanterelle/Utils/FS.purs @@ -15,8 +15,8 @@ import Effect.Class (liftEffect) import Effect.Uncurried (EffectFn2, EffectFn3, runEffectFn2, runEffectFn3) import Node.Encoding (Encoding(..)) import Node.FS.Aff as FS +import Node.FS.Perms (permsReadWrite) import Node.FS.Stats as Stats -import Node.FS.Sync.Mkdirp (mkdirp) import Node.Path (FilePath) import Node.Path as Path @@ -49,7 +49,7 @@ assertDirectory dn = do Left _ -> do -- assume an error means the file doesn't exist log Debug ("creating directory " <> dn) - liftEffect $ mkdirp dn + liftAff $ FS.mkdir' dn {recursive: true, mode: permsReadWrite} Right stats -> if not (Stats.isDirectory stats) then throwError ("Path " <> dn <> " exists but is not a directory!") else log Debug ("path " <> dn <> " exists and is a directory") From 7aac56342cfaf4d7a2f37daace55422e4f552478 Mon Sep 17 00:00:00 2001 From: martyall Date: Thu, 18 Apr 2024 23:01:33 -0700 Subject: [PATCH 2/2] tidy --- src/Chanterelle/Utils/FS.purs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Chanterelle/Utils/FS.purs b/src/Chanterelle/Utils/FS.purs index e48042c..71a3857 100644 --- a/src/Chanterelle/Utils/FS.purs +++ b/src/Chanterelle/Utils/FS.purs @@ -49,7 +49,7 @@ assertDirectory dn = do Left _ -> do -- assume an error means the file doesn't exist log Debug ("creating directory " <> dn) - liftAff $ FS.mkdir' dn {recursive: true, mode: permsReadWrite} + liftAff $ FS.mkdir' dn { recursive: true, mode: permsReadWrite } Right stats -> if not (Stats.isDirectory stats) then throwError ("Path " <> dn <> " exists but is not a directory!") else log Debug ("path " <> dn <> " exists and is a directory")