From 7aa55af93f35e13c0372b49b1649348031824471 Mon Sep 17 00:00:00 2001 From: Martin Allen <31280145+martyall@users.noreply.github.com> Date: Thu, 18 Apr 2024 22:40:14 -0700 Subject: [PATCH] upgrade deps (#87) * upgrade deps * correct hash * bump npm deps * tidy --- package.json | 5 +- packages.dhall | 163 +++++++++++++++++++++++++++++++++++- spago.dhall | 3 - src/Data/AbiParser.purs | 3 +- src/Data/CodeGen.purs | 9 +- src/Data/GeneratorMain.purs | 4 +- 6 files changed, 169 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 80ec714..7e29989 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,9 @@ }, "dependencies": { "ethjs-provider-http": "^0.1.6", - "keccak": "^1.0.2", + "keccak": "^3.0.0", "rlp": "^2.0.0", - "secp256k1": "^3.0.1", - "yargs": "^8.0.2" + "secp256k1": "^5.0.0" }, "devDependencies": { "purescript": "^0.15.8", diff --git a/packages.dhall b/packages.dhall index f51f337..20b7382 100644 --- a/packages.dhall +++ b/packages.dhall @@ -1,5 +1,162 @@ 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 -in upstream +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 additions = + { bytestrings = eth-core-deps.bytestrings + , coroutine-transducers = web3-deps.coroutine-transducers + , dodo-printer = + { dependencies = + [ "aff" + , "ansi" + , "arrays" + , "avar" + , "console" + , "control" + , "effect" + , "either" + , "exceptions" + , "foldable-traversable" + , "integers" + , "lists" + , "maybe" + , "minibench" + , "newtype" + , "node-buffer" + , "node-child-process" + , "node-path" + , "node-process" + , "node-streams" + , "parallel" + , "partial" + , "posix-types" + , "prelude" + , "safe-coerce" + , "strings" + , "tuples" + ] + , repo = "https://github.com/natefaubion/purescript-dodo-printer.git" + , version = "v2.2.1" + } + , eth-core = web3-deps.eth-core + , quotient = eth-core-deps.quotient + , tidy = + { dependencies = + [ "arrays" + , "dodo-printer" + , "foldable-traversable" + , "lists" + , "maybe" + , "ordered-collections" + , "partial" + , "prelude" + , "language-cst-parser" + , "strings" + , "tuples" + ] + , repo = "https://github.com/natefaubion/purescript-tidy.git" + , version = "v0.10.0" + } + , tidy-codegen = + { dependencies = + [ "aff" + , "ansi" + , "arrays" + , "avar" + , "bifunctors" + , "console" + , "control" + , "dodo-printer" + , "effect" + , "either" + , "enums" + , "exceptions" + , "filterable" + , "foldable-traversable" + , "free" + , "identity" + , "integers" + , "language-cst-parser" + , "lazy" + , "lists" + , "maybe" + , "newtype" + , "node-buffer" + , "node-child-process" + , "node-path" + , "node-process" + , "node-streams" + , "ordered-collections" + , "parallel" + , "partial" + , "posix-types" + , "prelude" + , "record" + , "safe-coerce" + , "st" + , "strings" + , "tidy" + , "transformers" + , "tuples" + , "type-equality" + , "unicode" + ] + , repo = + "https://github.com/natefaubion/purescript-tidy-codegen.git" + , version = "v4.0.0" + } + , web3 = + { dependencies = + [ "aff" + , "argonaut" + , "arrays" + , "bifunctors" + , "bytestrings" + , "control" + , "coroutine-transducers" + , "coroutines" + , "effect" + , "either" + , "eth-core" + , "exceptions" + , "foldable-traversable" + , "foreign" + , "foreign-object" + , "fork" + , "gen" + , "heterogeneous" + , "maybe" + , "newtype" + , "parallel" + , "parsing" + , "partial" + , "prelude" + , "profunctor-lenses" + , "record" + , "ring-modules" + , "simple-json" + , "strings" + , "tagged" + , "tailrec" + , "transformers" + , "tuples" + , "typelevel-prelude" + , "unfoldable" + , "unsafe-coerce" + , "variant" + , "identity" + ], + repo = "https://github.com/f-o-a-m/purescript-web3.git", + version = "v7.2.0" + } + } + +in upstream // additions diff --git a/spago.dhall b/spago.dhall index 1493af8..6c93b31 100644 --- a/spago.dhall +++ b/spago.dhall @@ -12,7 +12,6 @@ , "control" , "effect" , "either" - , "errors" , "eth-core" , "exceptions" , "fixed-points" @@ -22,11 +21,9 @@ , "language-cst-parser" , "lists" , "maybe" - , "mkdirp" , "newtype" , "node-buffer" , "node-fs" - , "node-fs-aff" , "node-path" , "node-process" , "optparse" diff --git a/src/Data/AbiParser.purs b/src/Data/AbiParser.purs index 38a52af..a0af095 100644 --- a/src/Data/AbiParser.purs +++ b/src/Data/AbiParser.purs @@ -3,7 +3,6 @@ module Data.AbiParser where import Prelude import Control.Alternative ((<|>)) -import Control.Error.Util (note) import Data.Argonaut ((.:?)) import Data.Argonaut as A import Data.Argonaut.Core (fromObject) @@ -13,7 +12,7 @@ import Data.Argonaut.Decode.Error (JsonDecodeError(..), printJsonDecodeError) import Data.Argonaut.Encode.Class (encodeJson) import Data.Array (fromFoldable, intercalate, length, zip, (..)) import Data.Bifunctor (lmap) -import Data.Either (Either(..), either) +import Data.Either (Either(..), either, note) import Data.Foldable (foldr) import Data.FunctorWithIndex (mapWithIndex) import Data.Generic.Rep (class Generic) diff --git a/src/Data/CodeGen.purs b/src/Data/CodeGen.purs index 35dc872..e2df436 100644 --- a/src/Data/CodeGen.purs +++ b/src/Data/CodeGen.purs @@ -4,7 +4,6 @@ import Prelude import Ansi.Codes (Color(..)) import Ansi.Output (withGraphics, foreground) -import Control.Error.Util (note) import Control.Monad.Error.Class (throwError) import Control.Monad.State (class MonadState, StateT, evalStateT, get, put) import Control.Monad.Writer (class MonadTell, runWriterT, tell) @@ -16,7 +15,7 @@ import Data.Argonaut.Prisms (_Object) import Data.Array (catMaybes, concat, foldMap, length, null) import Data.Array as Array import Data.Bifunctor (lmap) -import Data.Either (Either(..), either) +import Data.Either (Either(..), either, note) import Data.Foldable (for_) import Data.Generator (genCode, toSignature) import Data.Identity (Identity(..)) @@ -36,9 +35,9 @@ import Effect.Exception (error) import Network.Ethereum.Core.HexString (unHex) import Network.Ethereum.Core.Keccak256 (toSelector) import Node.Encoding (Encoding(UTF8)) -import Node.FS.Aff (readTextFile, writeTextFile, readdir, stat) +import Node.FS.Aff (readTextFile, writeTextFile, readdir, stat, mkdir') +import Node.FS.Perms (permsReadWrite) import Node.FS.Stats as Stats -import Node.FS.Sync.Mkdirp (mkdirp) import Node.Path (FilePath, basenameWithoutExt, extname) import Partial.Unsafe (unsafePartial) import Tidy.Codegen as Gen @@ -56,7 +55,7 @@ generatePS :: GeneratorOptions -> Aff ABIErrors generatePS os = do let opts = os { pursDir = os.pursDir <> "/" <> replaceAll (Pattern ".") (Replacement "/") os.modulePrefix } fs <- getAllJsonFiles opts.jsonDir - liftEffect $ mkdirp opts.pursDir + mkdir' opts.pursDir { recursive: true, mode: permsReadWrite } case fs of [] -> throwError <<< error $ "No abi json files found in directory: " <> opts.jsonDir fs' -> do diff --git a/src/Data/GeneratorMain.purs b/src/Data/GeneratorMain.purs index aa4c20e..9c5f9d4 100644 --- a/src/Data/GeneratorMain.purs +++ b/src/Data/GeneratorMain.purs @@ -8,7 +8,7 @@ import Data.CodeGen (GeneratorOptions, generatePS) import Effect (Effect) import Effect.Aff (launchAff_) import Effect.Class (liftEffect) -import Node.Process (exit) +import Node.Process (exit') import Options.Applicative (Parser, ParserInfo, boolean, execParser, fullDesc, header, help, helper, info, long, metavar, option, progDesc, showDefault, strOption, value, (<**>)) data Args = Args GeneratorOptions @@ -62,7 +62,7 @@ generatorMain :: Effect Unit generatorMain = launchAff_ do (Args args) <- liftEffect $ execParser opts errs <- generatePS args - liftEffect <<< exit $ + liftEffect <<< exit' $ if (A.null errs) then 0 else 1 where opts :: ParserInfo Args