diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9174f17..cac58df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,6 @@ jobs: steps: - uses: actions/checkout@v2 - uses: asdf-vm/actions/install@v1 - - run: spago build --path example/**/*.purs - - run: spago test + - run: spago -x spago.example.dhall build + - run: spago -x spago.test.dhall test - run: for example in $(ls example); do spago run -m Example.${example%.*} -p example/$example; done diff --git a/.tool-versions b/.tool-versions index 909398f..c87c1dd 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ -nodejs 14.15.4 -spago 0.19.1 -purescript 0.14.0 +nodejs 16.15.0 +spago 0.20.9 +purescript 0.15.2 diff --git a/bower.json b/bower.json index e833228..adaf6b4 100644 --- a/bower.json +++ b/bower.json @@ -14,14 +14,24 @@ "output" ], "dependencies": { - "purescript-console": "^v5.0.0", - "purescript-effect": "^v3.0.0", - "purescript-node-fs-aff": "^v7.0.0", - "purescript-node-process": "^v8.1.0", - "purescript-parsing": "^v6.0.0", - "purescript-psci-support": "^v5.0.0", - "purescript-run": "^v4.0.0", - "purescript-spec": "^v5.0.0", - "purescript-sunde": "^v2.0.0" + "purescript-aff": "^v7.0.0", + "purescript-arrays": "^v7.0.0", + "purescript-control": "^v6.0.0", + "purescript-effect": "^v4.0.0", + "purescript-either": "^v6.1.0", + "purescript-exceptions": "^v6.0.0", + "purescript-foldable-traversable": "^v6.0.0", + "purescript-maybe": "^v6.0.0", + "purescript-node-buffer": "^v8.0.0", + "purescript-node-child-process": "^v9.0.0", + "purescript-node-fs-aff": "^v9.0.0", + "purescript-node-process": "^v10.0.0", + "purescript-parsing": "^v10.0.0", + "purescript-prelude": "^v6.0.0", + "purescript-run": "^v5.0.0", + "purescript-strings": "^v6.0.0", + "purescript-sunde": "^v3.0.0", + "purescript-transformers": "^v6.0.0", + "purescript-tuples": "^v7.0.0" } } diff --git a/packages.dhall b/packages.dhall index e3b6af9..fcaafb3 100644 --- a/packages.dhall +++ b/packages.dhall @@ -1,11 +1,11 @@ -let mkPackage = - https://raw.githubusercontent.com/purescript/package-sets/psc-0.13.0-20190626/src/mkPackage.dhall sha256:0b197efa1d397ace6eb46b243ff2d73a3da5638d8d0ac8473e8e4a8fc528cf57 - let upstream = - https://github.com/purescript/package-sets/releases/download/psc-0.14.0-20210324/packages.dhall sha256:b4564d575da6aed1c042ca7936da97c8b7a29473b63f4515f09bb95fae8dddab - -let overrides = {=} - -let additions = {=} - -in upstream // overrides // additions + https://github.com/purescript/package-sets/releases/download/psc-0.15.2-20220706/packages.dhall + sha256:7a24ebdbacb2bfa27b2fc6ce3da96f048093d64e54369965a2a7b5d9892b6031 + +in upstream + with parsing.version = "v10.0.0" + with sunde = + { dependencies = [ "aff", "effect", "node-child-process", "prelude" ] + , repo = "https://github.com/justinwoo/purescript-sunde.git" + , version = "v3.0.0" + } diff --git a/spago.dhall b/spago.dhall index 45c4abd..d119a64 100644 --- a/spago.dhall +++ b/spago.dhall @@ -1,20 +1,27 @@ -{ sources = - [ "src/**/*.purs", "test/**/*.purs" ] -, name = - "dotenv" +{ name = "dotenv" , license = "MIT" , repository = "https://github.com/nsaunders/purescript-dotenv.git" , dependencies = - [ "console" - , "effect" - , "node-fs-aff" - , "node-process" - , "parsing" - , "psci-support" - , "run" - , "spec" - , "sunde" - ] -, packages = - ./packages.dhall + [ "aff" + , "arrays" + , "control" + , "effect" + , "either" + , "exceptions" + , "foldable-traversable" + , "maybe" + , "node-buffer" + , "node-child-process" + , "node-fs-aff" + , "node-process" + , "parsing" + , "prelude" + , "run" + , "strings" + , "sunde" + , "transformers" + , "tuples" + ] +, sources = [ "src/**/*.purs" ] +, packages = ./packages.dhall } diff --git a/spago.example.dhall b/spago.example.dhall new file mode 100644 index 0000000..69eac0a --- /dev/null +++ b/spago.example.dhall @@ -0,0 +1,11 @@ +let conf = ./spago.dhall + +in conf // { + sources = conf.sources # [ "example/**/*.purs" ], + dependencies = conf.dependencies # + [ "console" + , "foreign-object" + , "integers" + , "lists" + ] +} diff --git a/spago.test.dhall b/spago.test.dhall new file mode 100644 index 0000000..4a8699a --- /dev/null +++ b/spago.test.dhall @@ -0,0 +1,6 @@ +let conf = ./spago.dhall + +in conf // { + sources = conf.sources # [ "test/**/*.purs" ], + dependencies = conf.dependencies # [ "ordered-collections", "spec" ] +} diff --git a/src/Dotenv.purs b/src/Dotenv.purs index 10577d5..73b8493 100644 --- a/src/Dotenv.purs +++ b/src/Dotenv.purs @@ -20,7 +20,7 @@ import Effect.Exception (error) import Node.Encoding (Encoding(UTF8)) import Node.FS.Aff (readTextFile) import Run (case_, interpret, on) -import Text.Parsing.Parser (parseErrorMessage, runParser) +import Parsing (parseErrorMessage, runParser) -- | The type of a setting name type Name = String diff --git a/src/Dotenv/Internal/ChildProcess.purs b/src/Dotenv/Internal/ChildProcess.purs index fc09270..e7a9765 100644 --- a/src/Dotenv/Internal/ChildProcess.purs +++ b/src/Dotenv/Internal/ChildProcess.purs @@ -5,12 +5,12 @@ module Dotenv.Internal.ChildProcess (CHILD_PROCESS, ChildProcessF(..), _childPro import Prelude import Control.Monad.Error.Class (throwError) import Data.Maybe (Maybe(Nothing)) -import Data.Symbol (SProxy(..)) import Effect.Aff (Aff) import Effect.Exception (error) import Node.ChildProcess (Exit(..), defaultSpawnOptions) import Run (Run, lift) import Sunde (spawn) as Sunde +import Type.Proxy (Proxy(..)) -- | A data type representing the supported operations data ChildProcessF a = Spawn String (Array String) (String -> a) @@ -18,7 +18,7 @@ data ChildProcessF a = Spawn String (Array String) (String -> a) derive instance functorChildProcessF :: Functor ChildProcessF -- | The effect label used for a child process -_childProcess = SProxy :: SProxy "childProcess" +_childProcess = Proxy :: Proxy "childProcess" -- | The effect type used for a child process type CHILD_PROCESS r = (childProcess :: ChildProcessF | r) diff --git a/src/Dotenv/Internal/Environment.purs b/src/Dotenv/Internal/Environment.purs index e409401..1af8f9a 100644 --- a/src/Dotenv/Internal/Environment.purs +++ b/src/Dotenv/Internal/Environment.purs @@ -10,11 +10,11 @@ module Dotenv.Internal.Environment import Prelude import Data.Maybe (Maybe) -import Data.Symbol (SProxy(..)) import Effect.Aff (Aff) import Effect.Class (liftEffect) import Node.Process (lookupEnv, setEnv) as P import Run (Run, lift) +import Type.Proxy (Proxy(..)) -- | A data type representing the supported operations. data EnvironmentF a @@ -24,7 +24,7 @@ data EnvironmentF a derive instance functorEnvironmentF :: Functor EnvironmentF -- The effect label used for reading or modifying the environment. -_environment = SProxy :: SProxy "environment" +_environment = Proxy :: Proxy "environment" -- | The effect type used for reading or modifying the environment type ENVIRONMENT r = (environment :: EnvironmentF | r) diff --git a/src/Dotenv/Internal/Parse.purs b/src/Dotenv/Internal/Parse.purs index 562c12d..8c9b155 100644 --- a/src/Dotenv/Internal/Parse.purs +++ b/src/Dotenv/Internal/Parse.purs @@ -3,16 +3,18 @@ module Dotenv.Internal.Parse where import Prelude hiding (between) + import Control.Alt ((<|>)) import Data.Array ((:), fromFoldable, head, length, many, some) import Data.Maybe (fromMaybe) import Data.String.CodeUnits (fromCharArray) import Data.Tuple (Tuple(..)) import Dotenv.Internal.Types (Name, Setting, UnresolvedValue(..)) -import Text.Parsing.Parser (Parser) -import Text.Parsing.Parser.Combinators ((), lookAhead, notFollowedBy, skipMany, sepEndBy, try) -import Text.Parsing.Parser.String (char, noneOf, oneOf, string, whiteSpace) -import Text.Parsing.Parser.Token (alphaNum) +import Parsing (Parser) +import Parsing.Combinators ((), lookAhead, notFollowedBy, skipMany, sepEndBy, try) +import Parsing.String (char, string) +import Parsing.String.Basic (noneOf, oneOf, whiteSpace) +import Parsing.Token (alphaNum) -- | Newline characters (carriage return / line feed) newlineChars :: Array Char @@ -47,8 +49,8 @@ variableSubstitution = commandSubstitution :: Parser String UnresolvedValue commandSubstitution = do _ <- string "$(" - command <- fromCharArray <$> (some $ noneOf (')' : whitespaceChars)) - arguments <- many $ whiteSpace *> (fromCharArray <$> (some $ noneOf (')' : whitespaceChars))) + command <- fromCharArray <$> (some (noneOf (')' : whitespaceChars))) + arguments <- many (whiteSpace *> (fromCharArray <$> (some (noneOf (')' : whitespaceChars))))) _ <- whiteSpace *> char ')' pure $ CommandSubstitution command arguments diff --git a/test/Parse.purs b/test/Parse.purs index 8c87d3d..5c5a85e 100644 --- a/test/Parse.purs +++ b/test/Parse.purs @@ -7,7 +7,7 @@ import Dotenv.Internal.Parse (settings) import Dotenv.Internal.Types (UnresolvedValue(..)) import Test.Spec (Spec, describe, it) import Test.Spec.Assertions (shouldEqual) -import Text.Parsing.Parser (runParser) +import Parsing (runParser) tests :: Spec Unit tests = describe "settings (parser)" do