Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes in the generator #2269

Merged
merged 12 commits into from
Sep 27, 2024
7 changes: 0 additions & 7 deletions waspc/src/Wasp/AppSpec/Job.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ data Job = Job
}
deriving (Show, Eq, Data)

instance IsDecl Job

data JobExecutor = PgBoss
deriving (Show, Eq, Data, Ord, Enum, Bounded)

Expand All @@ -39,8 +37,6 @@ data Perform = Perform
}
deriving (Show, Eq, Data)

instance IsDecl Perform

-- Allows jobs to run via some cron schedule.
data Schedule = Schedule
{ cron :: String, -- 5 field cron expression, exe: "*/5 * * * *".
Expand All @@ -49,13 +45,10 @@ data Schedule = Schedule
}
deriving (Show, Eq, Data)

instance IsDecl Schedule

-- These are optional executor-specific JSON options we pass
-- directly through to the executor when submitting jobs.
data ExecutorOptions = ExecutorOptions
{ pgBoss :: Maybe JSON,
simple :: Maybe JSON
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use this as far as I can see, and it's not documented.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Origin story:
Screenshot 2024-09-16 at 15 09 21

}
deriving (Show, Eq, Data)

Expand Down
2 changes: 1 addition & 1 deletion waspc/src/Wasp/Generator/DbGenerator.hs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ generatePrismaClient spec projectRootDir = do
generatePrismaClientIfEntitiesExist :: IO (Maybe GeneratorError)
generatePrismaClientIfEntitiesExist
| entitiesExist =
either (Just . GenericGeneratorError) (const Nothing) <$> DbOps.generatePrismaClient projectRootDir
either (Just . GenericGeneratorError) (const Nothing) <$> DbOps.generatePrismaClient projectRootDir
| otherwise = return Nothing

entitiesExist = not . null $ getEntities spec
Expand Down
4 changes: 2 additions & 2 deletions waspc/src/Wasp/Generator/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down
Loading