diff --git a/waspc/src/Wasp/Generator/Monad.hs b/waspc/src/Wasp/Generator/Monad.hs index 05fe019bb..905967c7e 100644 --- a/waspc/src/Wasp/Generator/Monad.hs +++ b/waspc/src/Wasp/Generator/Monad.hs @@ -14,7 +14,7 @@ where import Control.Monad.Except (ExceptT, MonadError (throwError), runExceptT) import qualified Control.Monad.Except as MonadExcept import Control.Monad.Identity (Identity (runIdentity)) -import Control.Monad.State (MonadState, StateT (runStateT), modify) +import Control.Monad.State (MonadState, State, modify, runStateT) import Data.List.NonEmpty (NonEmpty, fromList) -- | Generator is a monad transformer stack where we abstract away the underlying @@ -25,7 +25,7 @@ import Data.List.NonEmpty (NonEmpty, fromList) -- The mechanism to catch errors is only there to assist in collecting more errors, not recover. -- There may optionally be additional errors or non-fatal warnings logged in the State. newtype Generator a = Generator - { _runGenerator :: ExceptT GeneratorError (StateT GeneratorState Identity) a + { _runGenerator :: ExceptT GeneratorError (State GeneratorState) a } deriving ( Functor, diff --git a/waspc/src/Wasp/Generator/SdkGenerator.hs b/waspc/src/Wasp/Generator/SdkGenerator.hs index 81a5f1f09..33db46182 100644 --- a/waspc/src/Wasp/Generator/SdkGenerator.hs +++ b/waspc/src/Wasp/Generator/SdkGenerator.hs @@ -61,9 +61,6 @@ import qualified Wasp.Project.Db as Db import qualified Wasp.SemanticVersion as SV import Wasp.Util ((<++>)) -genSdk :: AppSpec -> Generator [FileDraft] -genSdk spec = genSdkReal spec - buildSdk :: Path' Abs (Dir ProjectRootDir) -> IO (Either String ()) buildSdk projectRootDir = do chan <- newChan @@ -77,8 +74,8 @@ buildSdk projectRootDir = do where dstDir = projectRootDir C.sdkRootDirInProjectRootDir -genSdkReal :: AppSpec -> Generator [FileDraft] -genSdkReal spec = +genSdk :: AppSpec -> Generator [FileDraft] +genSdk spec = sequence [ genFileCopy [relfile|vite-env.d.ts|], genFileCopy [relfile|prisma-runtime-library.d.ts|], diff --git a/waspc/src/Wasp/Generator/Setup.hs b/waspc/src/Wasp/Generator/Setup.hs index c89817a00..41749cd88 100644 --- a/waspc/src/Wasp/Generator/Setup.hs +++ b/waspc/src/Wasp/Generator/Setup.hs @@ -22,8 +22,8 @@ runSetup spec projectRootDir sendMessage = do setUpDatabaseResults@(_warnings, _errors@[]) -> do -- todo(filip): Should we consider building SDK as part of code generation? -- todo(filip): Avoid building on each setup if we don't need to. - buildsSdkResults <- buildSdk projectRootDir sendMessage - return $ setUpDatabaseResults <> buildsSdkResults + buildSdkResults <- buildSdk projectRootDir sendMessage + return $ setUpDatabaseResults <> buildSdkResults setUpDatabaseResults -> return setUpDatabaseResults Left npmInstallError -> return ([], [npmInstallError])