diff --git a/.gitignore b/.gitignore index 2aa1f4c8..c8c2e4c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /node_modules /output /scratch +/.vscode result diff --git a/app/spago.yaml b/app/spago.yaml index 440db497..d02027d4 100644 --- a/app/spago.yaml +++ b/app/spago.yaml @@ -32,6 +32,7 @@ package: - httpurple - identity - integers + - js-fetch - js-date - js-uri - js-promise-aff @@ -43,7 +44,6 @@ package: - node-child-process - node-execa - node-fs - - node-fs-aff - node-path - node-process - now diff --git a/app/src/App/API.purs b/app/src/App/API.purs index aaab81d9..225e2e24 100644 --- a/app/src/App/API.purs +++ b/app/src/App/API.purs @@ -34,6 +34,7 @@ import Data.String.NonEmpty as NonEmptyString import Data.String.Regex as Regex import Effect.Aff as Aff import Effect.Ref as Ref +import Node.ChildProcess.Types (Exit(..)) import Node.FS.Aff as FS.Aff import Node.FS.Stats as FS.Stats import Node.FS.Sync as FS.Sync @@ -722,7 +723,7 @@ publishRegistry { source, payload, metadata: Metadata metadata, manifest: Manife Tar.create { cwd: tmp, folderName: newDir } Log.info "Tarball created. Verifying its size..." - FS.Stats.Stats { size: bytes } <- Run.liftAff $ FS.Aff.stat tarballPath + bytes <- Run.liftAff $ map FS.Stats.size $ FS.Aff.stat tarballPath for_ (Operation.Validation.validateTarballSize bytes) case _ of Operation.Validation.ExceedsMaximum maxPackageBytes -> Except.throw $ "Package tarball is " <> show bytes <> " bytes, which exceeds the maximum size of " <> show maxPackageBytes <> " bytes." @@ -1144,11 +1145,11 @@ jsonToDhallManifest dhallTypes jsonStr = do -- will remove the './' prefix. We need to manually append this to the relative path. let args = [ "--records-loose", "--unions-strict", Path.concat [ dhallTypes, "v1", "Manifest.dhall" ] ] process <- Execa.execa cmd args identity - process.stdin.writeUtf8End jsonStr - result <- process.result - pure case result of - Right _ -> Right jsonStr - Left { stderr } -> Left stderr + for_ process.stdin \{ writeUtf8End } -> writeUtf8End jsonStr + result <- process.getResult + pure case result.exit of + Normally 0 -> Right jsonStr + _ -> Left result.stderr getPacchettiBotti :: forall r. Run (PACCHETTIBOTTI_ENV + r) Owner getPacchettiBotti = do diff --git a/app/src/App/CLI/Git.purs b/app/src/App/CLI/Git.purs index ce046282..ac64c8e6 100644 --- a/app/src/App/CLI/Git.purs +++ b/app/src/App/CLI/Git.purs @@ -6,6 +6,7 @@ import Data.Array as Array import Data.Array.NonEmpty as NonEmptyArray import Data.String as String import Data.String.CodeUnits as CodeUnits +import Node.ChildProcess.Types (Exit(..)) import Node.Library.Execa as Execa import Parsing as Parsing import Parsing.Combinators as Parsing.Combinators @@ -73,10 +74,10 @@ mkAuthOrigin address committer = AuthOrigin $ Array.fold -- | Run the `git` tool via the command line. gitCLI :: Array String -> Maybe FilePath -> Aff (Either String String) gitCLI args cwd = do - result <- liftAff $ _.result =<< Execa.execa "git" args (_ { cwd = cwd }) - pure case result of - Right { stdout } -> Right (String.trim stdout) - Left { stdout, stderr } -> Left (stdout <> stderr) + result <- liftAff $ _.getResult =<< Execa.execa "git" args (_ { cwd = cwd }) + pure case result.exit of + Normally 0 -> Right (String.trim result.stdout) + _ -> Left (result.stdout <> result.stderr) withGit :: forall r. FilePath -> Array String -> (String -> String) -> Run (AFF + EXCEPT String + r) String withGit cwd args onError = Run.liftAff (gitCLI args (Just cwd)) >>= case _ of diff --git a/app/src/App/CLI/Licensee.purs b/app/src/App/CLI/Licensee.purs index 2fde6f88..8e602e14 100644 --- a/app/src/App/CLI/Licensee.purs +++ b/app/src/App/CLI/Licensee.purs @@ -6,6 +6,7 @@ import Control.Parallel as Parallel import Data.Array as Array import Data.Codec.Argonaut as CA import Data.Codec.Argonaut.Record as CA.Record +import Node.ChildProcess.Types (Exit(..)) import Node.FS.Aff as FS import Node.Library.Execa as Execa import Node.Path as Path @@ -25,15 +26,11 @@ detect :: FilePath -> Aff (Either String (Array String)) detect directory = do let cmd = "licensee" let args = [ "detect", "--json", directory ] - result <- _.result =<< Execa.execa cmd args identity - let - { exitCode, stdout, stderr } = case result of - Left { exitCode, stdout, stderr } -> { exitCode, stdout, stderr } - Right { exitCode, stdout, stderr } -> { exitCode: Just exitCode, stdout, stderr } - pure case exitCode of + result <- _.getResult =<< Execa.execa cmd args identity + pure case result.exit of -- Licensee will exit with `1` if it didn't parse any licenses, -- but we consider this valid Licensee output. - Just n | n == 0 || n == 1 -> do + Normally n | n == 0 || n == 1 -> do let parse :: String -> Either JsonDecodeError (Array String) parse str = map (map _.spdx_id <<< _.licenses) $ flip parseJson str $ CA.Record.object "Licenses" @@ -41,7 +38,7 @@ detect directory = do { spdx_id: CA.string } } - case parse stdout of + case parse result.stdout of Left error -> do let printedError = CA.printJsonDecodeError error Left printedError @@ -52,4 +49,4 @@ detect directory = do Right $ Array.filter (_ /= "NOASSERTION") out _ -> - Left stderr + Left result.stderr diff --git a/app/src/App/CLI/Purs.purs b/app/src/App/CLI/Purs.purs index 38fa0f19..234ccc09 100644 --- a/app/src/App/CLI/Purs.purs +++ b/app/src/App/CLI/Purs.purs @@ -8,6 +8,7 @@ import Data.Codec.Argonaut.Compat as CA.Compat import Data.Codec.Argonaut.Record as CA.Record import Data.Foldable (foldMap) import Data.String as String +import Node.ChildProcess.Types (Exit(..)) import Node.Library.Execa as Execa import Registry.Version as Version @@ -123,19 +124,20 @@ callCompiler compilerArgs = do { errors: CA.array compilerErrorCodec } - result <- _.result =<< Execa.execa purs (printCommand compilerArgs.command) (_ { cwd = compilerArgs.cwd }) - pure case result of - Left { originalMessage } - | originalMessage == Just (String.joinWith " " [ "spawn", purs, "ENOENT" ]) -> Left MissingCompiler - Left { stdout, stderr } -> Left do - let - output = case compilerArgs.version of - Nothing -> stdout - Just version | Right min <- Version.parse "0.14.0", version < min -> stderr - Just _ -> stdout - case parseJson errorsCodec output of - Left err -> UnknownError $ String.joinWith "\n" [ stdout, stderr, CA.printJsonDecodeError err ] - Right ({ errors } :: { errors :: Array CompilerError }) - | Array.null errors -> UnknownError "Non-normal exit code, but no errors reported." - | otherwise -> CompilationError errors - Right { stdout } -> Right stdout + result <- _.getResult =<< Execa.execa purs (printCommand compilerArgs.command) (_ { cwd = compilerArgs.cwd }) + pure case result.exit of + Normally 0 -> + Right result.stdout + _ + | result.originalMessage == Just (String.joinWith " " [ "spawn", purs, "ENOENT" ]) -> Left MissingCompiler + | otherwise -> Left do + let + output = case compilerArgs.version of + Nothing -> result.stdout + Just version | Right min <- Version.parse "0.14.0", version < min -> result.stderr + Just _ -> result.stdout + case parseJson errorsCodec output of + Left err -> UnknownError $ String.joinWith "\n" [ result.stdout, result.stderr, CA.printJsonDecodeError err ] + Right ({ errors } :: { errors :: Array CompilerError }) + | Array.null errors -> UnknownError "Non-normal exit code, but no errors reported." + | otherwise -> CompilationError errors diff --git a/app/src/App/CLI/PursVersions.purs b/app/src/App/CLI/PursVersions.purs index 9a69d169..f11cf993 100644 --- a/app/src/App/CLI/PursVersions.purs +++ b/app/src/App/CLI/PursVersions.purs @@ -5,6 +5,7 @@ import Registry.App.Prelude import Data.Array as Array import Data.Array.NonEmpty as NEA import Data.String as String +import Node.ChildProcess.Types (Exit(..)) import Node.Library.Execa as Execa import Registry.Version as Version import Run (AFF, Run) @@ -15,9 +16,11 @@ import Run.Except as Except -- | Returns a sorted array of PureScript compilers supported by the Registry pursVersions :: forall r. Run (EXCEPT String + AFF + r) (NonEmptyArray Version) pursVersions = do - result <- Run.liftAff $ _.result =<< Execa.execa "purs-versions" [] identity - { stdout } <- Except.rethrow $ lmap (\{ stdout, stderr } -> stdout <> stderr) result - let { fail, success } = partitionEithers $ map Version.parse (String.split (String.Pattern " ") stdout) + result <- Run.liftAff $ _.getResult =<< Execa.execa "purs-versions" [] identity + case result.exit of + Normally 0 -> pure unit + _ -> Except.throw $ result.stdout <> result.stderr + let { fail, success } = partitionEithers $ map Version.parse (String.split (String.Pattern " ") result.stdout) when (Array.length fail > 0) do Except.throw (String.joinWith ", " fail) diff --git a/app/src/App/CLI/Tar.purs b/app/src/App/CLI/Tar.purs index 7705c852..27d39d36 100644 --- a/app/src/App/CLI/Tar.purs +++ b/app/src/App/CLI/Tar.purs @@ -15,7 +15,7 @@ type ExtractArgs = { cwd :: String, archive :: FilePath } extract :: forall m. MonadEffect m => ExtractArgs -> m Unit extract { cwd, archive } = liftEffect do let cmd = "tar -xzf " <> archive - void $ ChildProcess.execSync cmd (ChildProcess.defaultExecSyncOptions { cwd = Just cwd }) + void $ ChildProcess.execSync' cmd (_ { cwd = Just cwd }) type CreateArgs = { cwd :: String, folderName :: String } @@ -39,4 +39,4 @@ create { cwd, folderName } = liftEffect do , "-" , folderName ] - void $ ChildProcess.execSync cmd (ChildProcess.defaultExecSyncOptions { cwd = Just cwd }) + void $ ChildProcess.execSync' cmd (_ { cwd = Just cwd }) diff --git a/app/src/App/GitHubIssue.purs b/app/src/App/GitHubIssue.purs index f8d7738d..900d5efb 100644 --- a/app/src/App/GitHubIssue.purs +++ b/app/src/App/GitHubIssue.purs @@ -113,7 +113,7 @@ main = launchAff_ $ do liftEffect (Ref.read thrownRef) >>= case _ of true -> - liftEffect $ Process.exit 1 + liftEffect $ Process.exit' 1 _ -> do -- After the run, close the issue. If an exception was thrown then the issue will remain open. _ <- Octokit.request env.octokit (Octokit.closeIssueRequest { address: Constants.registry, issue: env.issue }) diff --git a/app/src/App/Legacy/Manifest.purs b/app/src/App/Legacy/Manifest.purs index be4c34ce..b61e15c6 100644 --- a/app/src/App/Legacy/Manifest.purs +++ b/app/src/App/Legacy/Manifest.purs @@ -21,6 +21,7 @@ import Data.These (These(..)) import Data.These as These import Data.Variant as Variant import Effect.Aff as Aff +import Node.ChildProcess.Types (Exit(..)) import Node.FS.Aff as FS.Aff import Node.Library.Execa as Execa import Node.Path as Path @@ -359,11 +360,11 @@ fetchSpagoDhallJson address ref = Run.Except.runExceptAt _spagoDhallError do let cmd = "dhall-to-json" let args = [] process <- Execa.execa cmd args (_ { cwd = cwd }) - process.stdin.writeUtf8End dhall - result <- process.result - pure case result of - Right { stdout } -> lmap CA.printJsonDecodeError $ parseJson CA.json stdout - Left { stderr } -> Left stderr + for_ process.stdin \{ writeUtf8End } -> writeUtf8End dhall + result <- process.getResult + pure case result.exit of + Normally 0 -> lmap CA.printJsonDecodeError $ parseJson CA.json result.stdout + _ -> Left result.stderr newtype Bowerfile = Bowerfile { description :: Maybe String diff --git a/app/src/App/Server.purs b/app/src/App/Server.purs index d8ac1e50..46e2b00b 100644 --- a/app/src/App/Server.purs +++ b/app/src/App/Server.purs @@ -230,7 +230,7 @@ main = do createServerEnv # Aff.runAff_ case _ of Left error -> do Console.log $ "Failed to start server: " <> Aff.message error - Process.exit 1 + Process.exit' 1 Right env -> do _healthcheck <- Aff.launchAff do let diff --git a/app/src/Fetch/Retry.purs b/app/src/Fetch/Retry.purs index 10d4d3fe..4260f6e4 100644 --- a/app/src/Fetch/Retry.purs +++ b/app/src/Fetch/Retry.purs @@ -11,10 +11,10 @@ import Effect.Aff (Error) import Effect.Aff as Aff import Fetch (class ToCoreRequestOptions, HighlevelRequestOptions, Response, new) import Fetch (Response) as ReExport -import Fetch.Core as Core -import Fetch.Core.Request as CoreRequest import Fetch.Internal.Request as Request import Fetch.Internal.Response as Response +import JS.Fetch as Core +import JS.Fetch.Request as CoreRequest import Prim.Row (class Union) import Promise.Aff as Promise.Aff diff --git a/app/test/App/CLI/Tar.purs b/app/test/App/CLI/Tar.purs index ab415593..ac9d5670 100644 --- a/app/test/App/CLI/Tar.purs +++ b/app/test/App/CLI/Tar.purs @@ -46,6 +46,6 @@ spec = do FS.Aff.writeTextFile UTF8 (Path.concat [ tmp, name ]) contents hashAndBytes path = do - FS.Stats.Stats { size: bytes } <- FS.Aff.stat path + stats <- FS.Aff.stat path hash <- Sha256.hashFile path - pure { hash, bytes } + pure { hash, bytes: FS.Stats.size stats } diff --git a/foreign/spago.yaml b/foreign/spago.yaml index f9dcb627..9f325e62 100644 --- a/foreign/spago.yaml +++ b/foreign/spago.yaml @@ -40,6 +40,5 @@ package: main: Test.Foreign dependencies: - node-fs - - node-fs-aff - node-process - spec diff --git a/foreign/src/Foreign/Gzip.purs b/foreign/src/Foreign/Gzip.purs index 83954011..daef2497 100644 --- a/foreign/src/Foreign/Gzip.purs +++ b/foreign/src/Foreign/Gzip.purs @@ -11,7 +11,7 @@ import Effect.Aff.Class (class MonadAff, liftAff) import Effect.Exception (Error) import Effect.Uncurried (EffectFn1, EffectFn3, mkEffectFn1, runEffectFn3) import Fetch (class ToRequestBody) -import Fetch.Core.RequestBody (RequestBody) +import JS.Fetch.RequestBody (RequestBody) import Node.Buffer (Buffer) import Unsafe.Coerce (unsafeCoerce) diff --git a/foreign/test/Foreign/Gzip.purs b/foreign/test/Foreign/Gzip.purs index 9f06d30d..4323f5dd 100644 --- a/foreign/test/Foreign/Gzip.purs +++ b/foreign/test/Foreign/Gzip.purs @@ -2,7 +2,8 @@ module Test.Registry.Foreign.Gzip (spec) where import Prelude -import Data.Either (Either(..)) +import Data.Maybe (fromMaybe) +import Node.ChildProcess.Types (Exit(..)) import Node.FS.Aff as FS.Aff import Node.Library.Execa as Execa import Node.Path as Path @@ -22,5 +23,7 @@ spec = do contents = "" Gzip buffer <- Gzip.compress contents FS.Aff.writeFile file buffer - result <- _.result =<< Execa.execa "zcat" [ file ] identity - (_.stdout <$> result) `Assert.shouldEqual` Right contents + result <- _.getResult =<< Execa.execa "zcat" [ file ] identity + case result.exit of + Normally 0 -> result.stdout `Assert.shouldEqual` contents + _ -> Assert.fail $ fromMaybe result.message result.originalMessage diff --git a/lib/spago.yaml b/lib/spago.yaml index 561b8231..c550af53 100644 --- a/lib/spago.yaml +++ b/lib/spago.yaml @@ -27,7 +27,6 @@ package: - newtype - node-buffer - node-fs - - node-fs-aff - node-path - nullable - ordered-collections diff --git a/lib/test/Registry/Sha256.purs b/lib/test/Registry/Sha256.purs index 3ffc3e8b..41c1f5cd 100644 --- a/lib/test/Registry/Sha256.purs +++ b/lib/test/Registry/Sha256.purs @@ -7,6 +7,7 @@ import Control.Monad.Except as Except import Data.Either (Either(..)) import Data.String as String import Effect.Aff (Aff) +import Node.ChildProcess.Types (Exit(..)) import Node.Library.Execa as Execa import Node.Path (FilePath) import Node.Path as Path @@ -61,9 +62,9 @@ sha256Nix :: FilePath -> ExceptT String Aff Sha256.Sha256 sha256Nix path = ExceptT do -- In Nix 2.4 this will become `nix hash file` let args = [ "hash-file", "--sri", path ] - result <- _.result =<< Execa.execa "nix" args identity - pure $ case result of - Right { stdout } -> - Sha256.parse $ String.trim stdout - Left { stderr } -> - Left stderr + result <- _.getResult =<< Execa.execa "nix" args identity + pure $ case result.exit of + Normally 0 -> + Sha256.parse $ String.trim result.stdout + _ -> + Left result.stderr diff --git a/scripts/src/CompilerVersions.purs b/scripts/src/CompilerVersions.purs index 790aa827..42dd5d85 100644 --- a/scripts/src/CompilerVersions.purs +++ b/scripts/src/CompilerVersions.purs @@ -100,7 +100,7 @@ main = launchAff_ do args <- Array.drop 2 <$> liftEffect Process.argv let description = "A script for determining the supported compiler versions for packages." arguments <- case Arg.parseArgs "compiler-versions" description parser args of - Left err -> Console.log (Arg.printArgError err) *> liftEffect (Process.exit 1) + Left err -> Console.log (Arg.printArgError err) *> liftEffect (Process.exit' 1) Right command -> pure command -- Environment @@ -141,7 +141,7 @@ main = launchAff_ do let interpret :: Run _ ~> Aff interpret = - Except.catch (\error -> Run.liftEffect (Console.log error *> Process.exit 1)) + Except.catch (\error -> Run.liftEffect (Console.log error *> Process.exit' 1)) >>> Registry.interpret (Registry.handle registryEnv) >>> Storage.interpret (Storage.handleReadOnly cache) >>> GitHub.interpret (GitHub.handle { octokit, cache, ref: githubCacheRef }) @@ -229,7 +229,7 @@ compilersForPackageVersion package version target = do if Array.null supported then do Log.error $ "Could not find supported compiler versions for " <> formatPackageVersion package version - Run.liftEffect $ Process.exit 1 + Run.liftEffect $ Process.exit' 1 else Log.info $ "Found supported compiler versions for " <> formatPackageVersion package version <> ": " <> Array.intercalate ", " (map Version.print supported) diff --git a/scripts/src/LegacyImporter.purs b/scripts/src/LegacyImporter.purs index 36102e92..f5a61959 100644 --- a/scripts/src/LegacyImporter.purs +++ b/scripts/src/LegacyImporter.purs @@ -99,7 +99,7 @@ main = launchAff_ do let description = "A script for uploading legacy registry packages." mode <- case Arg.parseArgs "legacy-importer" description parser args of - Left err -> Console.log (Arg.printArgError err) *> liftEffect (Process.exit 1) + Left err -> Console.log (Arg.printArgError err) *> liftEffect (Process.exit' 1) Right command -> pure command Env.loadEnvFile ".env" @@ -166,7 +166,7 @@ main = launchAff_ do # runAppEffects # Cache.interpret Legacy.Manifest._legacyCache (Cache.handleMemoryFs { cache, ref: legacyCacheRef }) # Cache.interpret _importCache (Cache.handleMemoryFs { cache, ref: importCacheRef }) - # Except.catch (\msg -> Log.error msg *> Run.liftEffect (Process.exit 1)) + # Except.catch (\msg -> Log.error msg *> Run.liftEffect (Process.exit' 1)) # Comment.interpret Comment.handleLog # Log.interpret (\log -> Log.handleTerminal Normal log *> Log.handleFs Verbose logPath log) # Env.runResourceEnv resourceEnv diff --git a/scripts/src/PackageDeleter.purs b/scripts/src/PackageDeleter.purs index a8c8339b..1e868ee0 100644 --- a/scripts/src/PackageDeleter.purs +++ b/scripts/src/PackageDeleter.purs @@ -100,7 +100,7 @@ main = launchAff_ do args <- Array.drop 2 <$> liftEffect Process.argv let description = "A script for deleting registry packages." arguments <- case Arg.parseArgs "package-deleter" description parser args of - Left err -> Console.log (Arg.printArgError err) *> liftEffect (Process.exit 1) + Left err -> Console.log (Arg.printArgError err) *> liftEffect (Process.exit' 1) Right command -> pure command -- Environment @@ -145,7 +145,7 @@ main = launchAff_ do Package name version -> pure $ Map.singleton name [ version ] -- --file packagesversions.json File path -> liftAff (readJsonFile deletePackagesCodec path) >>= case _ of - Left err -> Console.log err *> liftEffect (Process.exit 1) + Left err -> Console.log err *> liftEffect (Process.exit' 1) Right values -> pure values let diff --git a/scripts/src/PackageSetUpdater.purs b/scripts/src/PackageSetUpdater.purs index 3f561e9c..95053eed 100644 --- a/scripts/src/PackageSetUpdater.purs +++ b/scripts/src/PackageSetUpdater.purs @@ -57,7 +57,7 @@ main = Aff.launchAff_ do args <- Array.drop 2 <$> liftEffect Process.argv let description = "A script for updating the package sets." mode <- case Arg.parseArgs "package-set-updater" description parser args of - Left err -> Console.log (Arg.printArgError err) *> liftEffect (Process.exit 1) + Left err -> Console.log (Arg.printArgError err) *> liftEffect (Process.exit' 1) Right command -> pure command -- Environment @@ -113,7 +113,7 @@ main = Aff.launchAff_ do # Registry.interpret (Registry.handle registryEnv) # Storage.interpret (Storage.handleReadOnly cache) # GitHub.interpret (GitHub.handle { octokit, cache, ref: githubCacheRef }) - # Except.catch (\msg -> Log.error msg *> Run.liftEffect (Process.exit 1)) + # Except.catch (\msg -> Log.error msg *> Run.liftEffect (Process.exit' 1)) # Comment.interpret Comment.handleLog # Log.interpret (\log -> Log.handleTerminal Normal log *> Log.handleFs Verbose logPath log) # Env.runResourceEnv resourceEnv diff --git a/scripts/src/PackageTransferrer.purs b/scripts/src/PackageTransferrer.purs index ef32a764..d0c25e07 100644 --- a/scripts/src/PackageTransferrer.purs +++ b/scripts/src/PackageTransferrer.purs @@ -85,7 +85,7 @@ main = launchAff_ do # Registry.interpret (Registry.handle registryEnv) # Storage.interpret (Storage.handleReadOnly cache) # GitHub.interpret (GitHub.handle { octokit, cache, ref: githubCacheRef }) - # Except.catch (\msg -> Log.error msg *> Run.liftEffect (Process.exit 1)) + # Except.catch (\msg -> Log.error msg *> Run.liftEffect (Process.exit' 1)) # Comment.interpret Comment.handleLog # Log.interpret (\log -> Log.handleTerminal Normal log *> Log.handleFs Verbose logPath log) # Env.runPacchettiBottiEnv { privateKey, publicKey } diff --git a/scripts/src/Solver.purs b/scripts/src/Solver.purs index 517be4fb..53dfc5b4 100644 --- a/scripts/src/Solver.purs +++ b/scripts/src/Solver.purs @@ -63,7 +63,7 @@ main = launchAff_ do getAction = case args of [ "--file", path ] -> do packageversions <- liftAff (readJsonFile deletePackagesCodec path) >>= case _ of - Left err -> Aff.log err *> liftEffect (Process.exit 1) + Left err -> Aff.log err *> liftEffect (Process.exit' 1) Right values -> pure values pure \registry -> do forWithIndex_ packageversions \package versionsofpackage -> do @@ -85,7 +85,7 @@ main = launchAff_ do package = unsafeFromRight $ PackageName.parse "manifest" version = unsafeFromRight $ Version.parse "0.0.0" deps <- liftAff (readJsonFile codec path) >>= case _ of - Left err -> Aff.log err *> liftEffect (Process.exit 1) + Left err -> Aff.log err *> liftEffect (Process.exit' 1) Right values -> pure values pure \registry -> test registry package version deps [ "--all" ] -> pure \registry -> do @@ -148,7 +148,7 @@ main = launchAff_ do # runAppEffects # Cache.interpret Legacy.Manifest._legacyCache (Cache.handleMemoryFs { cache, ref: legacyCacheRef }) # Cache.interpret _importCache (Cache.handleMemoryFs { cache, ref: importCacheRef }) - # Except.catch (\msg -> Log.error msg *> Run.liftEffect (Process.exit 1)) + # Except.catch (\msg -> Log.error msg *> Run.liftEffect (Process.exit' 1)) # Comment.interpret Comment.handleLog # Env.runResourceEnv resourceEnv # Log.interpret (\log -> Log.handleTerminal Normal log *> Log.handleFs Verbose logPath log) diff --git a/scripts/src/VerifyIntegrity.purs b/scripts/src/VerifyIntegrity.purs index 89458442..423c2002 100644 --- a/scripts/src/VerifyIntegrity.purs +++ b/scripts/src/VerifyIntegrity.purs @@ -59,7 +59,7 @@ main = launchAff_ do args <- Array.drop 2 <$> liftEffect Process.argv let description = "A script for verifying that the registry and registry-index repos match each other and S3." arguments <- case Arg.parseArgs "package-verify" description parser args of - Left err -> Console.log (Arg.printArgError err) *> liftEffect (Process.exit 1) + Left err -> Console.log (Arg.printArgError err) *> liftEffect (Process.exit' 1) Right command -> pure command -- Environment @@ -103,13 +103,13 @@ main = launchAff_ do Package name -> pure (Just [ name ]) -- --file packagesversions.json File path -> liftAff (readJsonFile (CA.array PackageName.codec) path) >>= case _ of - Left err -> Console.log err *> liftEffect (Process.exit 1) + Left err -> Console.log err *> liftEffect (Process.exit' 1) Right values -> pure (Just values) All -> pure Nothing let interpret = - Except.catch (\error -> Run.liftEffect (Console.log error *> Process.exit 1)) + Except.catch (\error -> Run.liftEffect (Console.log error *> Process.exit' 1)) >>> Registry.interpret (Registry.handle registryEnv) >>> Storage.interpret (Storage.handleS3 { s3, cache }) >>> GitHub.interpret (GitHub.handle { octokit, cache, ref: githubCacheRef }) @@ -146,7 +146,7 @@ main = launchAff_ do Log.info "Finished." when (any isLeft results) do - liftEffect $ Process.exit 1 + liftEffect $ Process.exit' 1 intercalateMap :: forall f a d. Monoid d => Foldable f => d -> (a -> d) -> f a -> d intercalateMap s f = intercalate s <<< map f <<< Array.fromFoldable diff --git a/spago.lock b/spago.lock index cd022e4e..09072d27 100644 --- a/spago.lock +++ b/spago.lock @@ -30,6 +30,7 @@ workspace: - identity - integers - js-date + - js-fetch - js-promise-aff - js-uri - lists @@ -40,7 +41,6 @@ workspace: - node-child-process - node-execa - node-fs - - node-fs-aff - node-path - node-process - now @@ -108,7 +108,6 @@ workspace: - variant test_dependencies: - node-fs - - node-fs-aff - node-process - spec registry-lib: @@ -137,7 +136,6 @@ workspace: - newtype - node-buffer - node-fs - - node-fs-aff - node-path - nullable - ordered-collections @@ -195,8 +193,65 @@ workspace: - variant test_dependencies: [] package_set: - registry: 35.1.0 - extra_packages: {} + registry: 46.0.0 + extra_packages: + dodo-printer: + dependencies: + - aff + - ansi + - arrays + - avar + - console + - control + - effect + - either + - exceptions + - foldable-traversable + - integers + - lists + - maybe + - newtype + - parallel + - partial + - posix-types + - prelude + - safe-coerce + - strings + - tuples + repo: https://github.com/natefaubion/purescript-dodo-printer.git + version: v2.2.1 + language-cst-parser: + dependencies: + - arrays + - console + - const + - control + - effect + - either + - enums + - foldable-traversable + - free + - functions + - functors + - identity + - integers + - lazy + - lists + - maybe + - newtype + - numbers + - ordered-collections + - partial + - prelude + - st + - strings + - transformers + - tuples + - typelevel-prelude + - unfoldable + - unsafe-coerce + repo: https://github.com/natefaubion/purescript-language-cst-parser.git + version: v0.13.0 packages: aff: type: registry @@ -278,8 +333,8 @@ packages: dependencies: [] arrays: type: registry - version: 7.2.1 - integrity: sha256-HCUzV3uCSt6YBI9vlt1Ott20/2JfSCUoNsd+D6ORieQ= + version: 7.3.0 + integrity: sha256-tmcklBlc/muUtUfr9RapdCPwnlQeB3aSrC4dK85gQlc= dependencies: - bifunctors - control @@ -352,8 +407,8 @@ packages: - unfoldable codec: type: registry - version: 6.0.0 - integrity: sha256-VLG7Ii38xmeT5UGH98xBFiWp1YnFZim/iMg+aQz2RB8= + version: 6.1.0 + integrity: sha256-6vMLNlsJxQarVQ9cn1FYfl5x6opfzxAza15SzRdxFxQ= dependencies: - bifunctors - profunctor @@ -370,8 +425,8 @@ packages: - variant console: type: registry - version: 6.0.0 - integrity: sha256-gJpJ53fCDAL8BiCiJXH0HNAJ9K3gJtLo8GDaCK6hA5U= + version: 6.1.0 + integrity: sha256-CxmAzjgyuGDmt9FZW51VhV6rBPwR6o0YeKUzA9rSzcM= dependencies: - effect - prelude @@ -448,9 +503,9 @@ packages: - tuples - type-equality dodo-printer: - type: registry - version: 2.2.1 - integrity: sha256-9HgCr5c0TMZCSi/ibCB5LlAL8HTQf/KTRljIXkZeEKM= + type: git + url: https://github.com/natefaubion/purescript-dodo-printer.git + rev: 831c5c963a57ca4bfd62f96335267d7d0785851d dependencies: - aff - ansi @@ -465,14 +520,7 @@ packages: - integers - lists - maybe - - minibench - newtype - - node-buffer - - node-child-process - - node-fs-aff - - node-path - - node-process - - node-streams - parallel - partial - posix-types @@ -482,8 +530,8 @@ packages: - tuples dotenv: type: registry - version: 4.0.0 - integrity: sha256-iqWz97FnrHLlfJ/pIsTfTNprpqpqZsh5OmLNjVlMLDo= + version: 4.0.3 + integrity: sha256-UPOkwHp4lci+ABmljihtxS+WAUy5ijxWCNKj/edcY7M= dependencies: - aff - arrays @@ -496,13 +544,16 @@ packages: - maybe - node-buffer - node-child-process - - node-fs-aff + - node-event-emitter + - node-fs + - node-os - node-process + - node-streams - parsing - prelude + - refs - run - strings - - sunde - transformers - tuples - typelevel-prelude @@ -563,46 +614,24 @@ packages: - unsafe-coerce fetch: type: registry - version: 2.0.0 - integrity: sha256-43ojzk1qxr5EUTuRmL8R4Fnqd0V3uXFhL5lWCytaer0= + version: 4.0.0 + integrity: sha256-Ita74WPIvzCsSIkUQQbBDKgIrsnuBWIRzEJ8Q5P7iQU= dependencies: - aff - arraybuffer-types + - bifunctors - effect - - fetch-core - foreign - http-methods + - js-fetch - js-promise-aff - - newtype - - prelude - - record - - typelevel-prelude - - web-file - - web-streams - fetch-core: - type: registry - version: 5.1.0 - integrity: sha256-mBifgiz5g2QhyCHeYn/A6M6+7FWEw63KxXN+UWFHX/o= - dependencies: - - arraybuffer-types - - arrays - - console - - effect - - foldable-traversable - - foreign - - foreign-object - - functions - - http-methods - - js-promise - maybe - newtype - - nullable + - ordered-collections - prelude - record - - tuples + - strings - typelevel-prelude - - unfoldable - - unsafe-coerce - web-file - web-streams filterable: @@ -692,8 +721,8 @@ packages: - transformers free: type: registry - version: 7.0.0 - integrity: sha256-72auTIZAG6fhz4F94rxyDwgfnHwp+/89rujZpZWrV0w= + version: 7.1.0 + integrity: sha256-JAumgEsGSzJCNLD8AaFvuX7CpqS5yruCngi6yI7+V5k= dependencies: - catenable-lists - control @@ -776,8 +805,8 @@ packages: - strings httpurple: type: registry - version: 3.0.1 - integrity: sha256-2NjXMO3zz0UXAVTqH06I1B96uzIB10Ck0FJrecryp9U= + version: 4.0.0 + integrity: sha256-oGslmTfJinvk8RPV5dzFOSxRhu6JN3gO8dUZeP6pKcA= dependencies: - aff - arrays @@ -789,6 +818,7 @@ packages: - either - exceptions - foldable-traversable + - foreign - foreign-object - functions - js-uri @@ -798,8 +828,10 @@ packages: - maybe - newtype - node-buffer + - node-event-emitter - node-fs - node-http + - node-net - node-process - node-streams - options @@ -854,6 +886,29 @@ packages: - foreign - integers - now + js-fetch: + type: registry + version: 0.2.1 + integrity: sha256-zQaVi9wFWku1SsWmdR11kRpOb+wxkNWR49cn928ucjw= + dependencies: + - arraybuffer-types + - arrays + - effect + - foldable-traversable + - foreign + - foreign-object + - functions + - http-methods + - js-promise + - maybe + - newtype + - prelude + - record + - tuples + - typelevel-prelude + - unfoldable + - web-file + - web-streams js-promise: type: registry version: 1.0.0 @@ -896,9 +951,9 @@ packages: - record - typelevel-prelude language-cst-parser: - type: registry - version: 0.13.0 - integrity: sha256-8eeW0hs+PQR+suxqbz5tfbsrcbmonQY3o3IsWobcfi0= + type: git + url: https://github.com/natefaubion/purescript-language-cst-parser.git + rev: 5621f2e9fa1a0df5930b95b26f922fa94c494e80 dependencies: - arrays - console @@ -917,7 +972,6 @@ packages: - lists - maybe - newtype - - node-process - numbers - ordered-collections - partial @@ -994,18 +1048,6 @@ packages: dependencies: - newtype - prelude - minibench: - type: registry - version: 4.0.1 - integrity: sha256-7jyxcklZI49q/otYvMV4f9YnJwEqQ3Me5buhDwAOydw= - dependencies: - - console - - effect - - integers - - numbers - - partial - - prelude - - refs mmorph: type: registry version: 7.0.0 @@ -1023,24 +1065,27 @@ packages: - safe-coerce node-buffer: type: registry - version: 8.0.0 - integrity: sha256-RwOTB8yTS4Jjqc55JqxRcVaMXP+cYJ5aww0XH1Z/I8A= + version: 9.0.0 + integrity: sha256-PWE2DJ5ruBLCmeA/fUiuySEFmUJ/VuRfyrnCuVZBlu4= dependencies: - arraybuffer-types - effect - maybe + - nullable - st - unsafe-coerce node-child-process: type: registry - version: 9.0.0 - integrity: sha256-bi7hXHcrgqw6UQzD4p0kr2flPxdqyRHv3bLcffZYpm0= + version: 11.1.0 + integrity: sha256-vioMNgk8p+CGwlb6T3I3TIir27el85Yg4satLE/I89w= dependencies: - exceptions - foreign - foreign-object - functions + - node-event-emitter - node-fs + - node-os - node-streams - nullable - posix-types @@ -1059,8 +1104,8 @@ packages: - unsafe-coerce node-execa: type: registry - version: 3.0.0 - integrity: sha256-ApGpjD1sq39MRsLgRPqCj3f9OhTy6J/BLNvrpmRZ4jk= + version: 5.0.0 + integrity: sha256-yNcgbCs4guwoTApyV6LRoYCYnU5loWgQiqMtsbloZqk= dependencies: - aff - arrays @@ -1076,9 +1121,11 @@ packages: - js-timers - maybe - node-buffer + - node-child-process - node-event-emitter - node-fs - node-human-signals + - node-os - node-path - node-process - node-streams @@ -1090,20 +1137,18 @@ packages: - partial - posix-types - prelude - - profunctor-lenses - record - refs - safe-coerce - strings - tailrec - - transformers - tuples - unsafe-coerce - unsafe-reference node-fs: type: registry - version: 8.2.0 - integrity: sha256-6X/8KFH5qAF15UDrMadoyAMZxd08bs9IF2XrVgvpH2I= + version: 9.1.0 + integrity: sha256-TzhvGdrwcM0bazDvrWSqh+M/H8GKYf1Na6aGm2Qg4+c= dependencies: - datetime - effect @@ -1122,19 +1167,10 @@ packages: - prelude - strings - unsafe-coerce - node-fs-aff: - type: registry - version: 9.2.2 - integrity: sha256-BPcg35n+cnQzAcediaqTf4hJYbiotZEG72e8JjL/nRo= - dependencies: - - aff - - either - - node-fs - - node-path node-http: type: registry - version: 8.0.0 - integrity: sha256-qN+NeGlqDCzhWMT1uEkwWyGWpNya1B0MccIWVLI5dqo= + version: 9.1.0 + integrity: sha256-53H+0w73kew2VyXE8U0SpNxyzOojdxBMx38vctl8ak4= dependencies: - arraybuffer-types - contravariant @@ -1145,6 +1181,7 @@ packages: - node-buffer - node-net - node-streams + - node-tls - node-url - nullable - options @@ -1163,8 +1200,8 @@ packages: - prelude node-net: type: registry - version: 4.0.0 - integrity: sha256-jdfCj2GwmXH0BEFuV6uqYycfd4I1Rkn1rJVpQnutaTc= + version: 5.1.0 + integrity: sha256-WnYf9RoPBJrTUAEkzc0NbIhOqN0lKbhyDf0JNgZjAKY= dependencies: - effect - either @@ -1172,11 +1209,36 @@ packages: - foreign - maybe - node-buffer + - node-event-emitter - node-fs - nullable - options - prelude - transformers + node-os: + type: registry + version: 5.1.0 + integrity: sha256-K3gcu9AXanN1+qtk1900+Fi+CuO0s3/H/RMNRNgIzso= + dependencies: + - arrays + - bifunctors + - console + - control + - datetime + - effect + - either + - exceptions + - foldable-traversable + - foreign + - foreign-object + - functions + - maybe + - node-buffer + - nullable + - partial + - posix-types + - prelude + - unsafe-coerce node-path: type: registry version: 5.0.0 @@ -1185,33 +1247,59 @@ packages: - effect node-process: type: registry - version: 10.0.0 - integrity: sha256-YzUqf7HWkGEQVRmkxUpL1x2GzKqKLyEyR7mkP68xcZs= + version: 11.2.0 + integrity: sha256-+2MQDYChjGbVbapCyJtuWYwD41jk+BntF/kcOTKBMVs= dependencies: - effect + - foreign - foreign-object - maybe + - node-event-emitter - node-streams - posix-types - prelude - unsafe-coerce node-streams: type: registry - version: 7.0.0 - integrity: sha256-EGCA+hp6chlxDlQ8UG3RIaIIL1R0OckKnqP+KPAX1y4= + version: 9.0.0 + integrity: sha256-2n6dq7YWleTDmD1Kur/ul7Cn08IvWrScgPf+0PgX2TQ= + dependencies: + - aff + - effect + - either + - exceptions + - node-buffer + - node-event-emitter + - nullable + - prelude + node-tls: + type: registry + version: 0.3.1 + integrity: sha256-UlbPVYi2HtxWCelkWO18gTdiSJlpvQOncqXQleK3v9E= dependencies: + - console - effect - either - exceptions + - foreign + - maybe - node-buffer + - node-event-emitter + - node-net - nullable + - partial - prelude + - unsafe-coerce node-url: type: registry - version: 6.0.0 - integrity: sha256-E5wGTcUAGI4xAeE3+3lBeQKTCPHmZWkCZ34JG6Tb5Eo= + version: 7.0.1 + integrity: sha256-V3l1miSKlMcd4rrxmYGzt+vCAbIfgtVEdWbHsM/2g+A= dependencies: + - effect + - foreign - nullable + - prelude + - tuples nonempty: type: registry version: 7.0.0 @@ -1257,8 +1345,8 @@ packages: - tuples ordered-collections: type: registry - version: 3.0.0 - integrity: sha256-R9WddNBRPkY37gw8XkDCLX2vJ5eI9qdaWDdCp61r2+M= + version: 3.1.1 + integrity: sha256-boSYHmlz4aSbwsNN4VxiwCStc0t+y1F7BXmBS+1JNtI= dependencies: - arrays - foldable-traversable @@ -1280,8 +1368,8 @@ packages: - prelude parallel: type: registry - version: 6.0.0 - integrity: sha256-VJbkGD0rAKX+NUEeBJbYJ78bEKaZbgow+QwQEfPB6ko= + version: 7.0.0 + integrity: sha256-gUC9i4Txnx9K9RcMLsjujbwZz6BB1bnE2MLvw4GIw5o= dependencies: - control - effect @@ -1519,8 +1607,8 @@ packages: - unsafe-coerce spec: type: registry - version: 7.5.4 - integrity: sha256-o49xJAmAN//ZYVMTz01xeDqdLOiEYoHbaXZYtOXmUZI= + version: 7.5.5 + integrity: sha256-HdyBH7Ys1/m2SdTq3u2u9LdQ4cGeaohWeEMYay2mHdU= dependencies: - aff - ansi @@ -1580,15 +1668,6 @@ packages: - tuples - unfoldable - unsafe-coerce - sunde: - type: registry - version: 3.0.0 - integrity: sha256-+b+nYymr9tqFPNruhKfuaO7eN2gBLA80PfUgd1kJA4g= - dependencies: - - aff - - effect - - node-child-process - - prelude tailrec: type: registry version: 6.1.0 diff --git a/spago.yaml b/spago.yaml index dea912fd..293af1d2 100644 --- a/spago.yaml +++ b/spago.yaml @@ -1,4 +1,62 @@ workspace: lock: true package_set: - registry: 35.1.0 + registry: 46.0.0 + extra_packages: + dodo-printer: + repo: https://github.com/natefaubion/purescript-dodo-printer.git + version: v2.2.1 + dependencies: + - aff + - ansi + - arrays + - avar + - console + - control + - effect + - either + - exceptions + - foldable-traversable + - integers + - lists + - maybe + - newtype + - parallel + - partial + - posix-types + - prelude + - safe-coerce + - strings + - tuples + language-cst-parser: + repo: https://github.com/natefaubion/purescript-language-cst-parser.git + version: v0.13.0 + dependencies: + - arrays + - console + - const + - control + - effect + - either + - enums + - foldable-traversable + - free + - functions + - functors + - identity + - integers + - lazy + - lists + - maybe + - newtype + - numbers + - ordered-collections + - partial + - prelude + - st + - strings + - transformers + - tuples + - typelevel-prelude + - unfoldable + - unsafe-coerce