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

Post 0.16.0 cleanup #2490

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion waspc/data/Generator/templates/server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"src"
],
"references": [
{ "path": "../../../tsconfig.json" }
{ "path": "{= srcTsConfigPath =}" }
]
}
15 changes: 11 additions & 4 deletions waspc/src/Wasp/Generator/ServerGenerator.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import Data.Maybe
)
import StrongPath
( Dir,
File,
File',
Path,
Path',
Expand All @@ -28,6 +29,7 @@ import StrongPath
relfile,
(</>),
)
import qualified StrongPath as SP
import Wasp.AppSpec (AppSpec)
import qualified Wasp.AppSpec as AS
import qualified Wasp.AppSpec.App as AS.App
Expand Down Expand Up @@ -57,6 +59,7 @@ import Wasp.Generator.ServerGenerator.OperationsG (genOperations)
import Wasp.Generator.ServerGenerator.OperationsRoutesG (genOperationsRoutes)
import Wasp.Generator.ServerGenerator.WebSocketG (depsRequiredByWebSockets, genWebSockets, mkWebSocketFnImport)
import qualified Wasp.Node.Version as NodeVersion
import Wasp.Project.Common (SrcTsConfigFile, waspProjectDirFromAppComponentDir)
import Wasp.Project.Db (databaseUrlEnvVarName)
import qualified Wasp.SemanticVersion as SV
import Wasp.Util ((<++>))
Expand All @@ -67,7 +70,7 @@ genServer spec =
[ genFileCopy [relfile|README.md|],
genFileCopy [relfile|nodemon.json|],
genRollupConfigJs spec,
genTsConfigJson,
genTsConfigJson spec,
genPackageJson spec (npmDepsForWasp spec),
genNpmrc,
genGitignore
Expand Down Expand Up @@ -101,17 +104,21 @@ genDotEnv spec =
dotEnvInServerRootDir :: Path' (Rel ServerRootDir) File'
dotEnvInServerRootDir = [relfile|.env|]

genTsConfigJson :: Generator FileDraft
genTsConfigJson = do
genTsConfigJson :: AppSpec -> Generator FileDraft
genTsConfigJson spec = do
return $
C.mkTmplFdWithDstAndData
(C.asTmplFile [relfile|tsconfig.json|])
(C.asServerFile [relfile|tsconfig.json|])
( Just $
object
[ "majorNodeVersion" .= show (SV.major NodeVersion.oldestWaspSupportedNodeVersion)
[ "majorNodeVersion" .= show (SV.major NodeVersion.oldestWaspSupportedNodeVersion),
"srcTsConfigPath" .= SP.fromRelFile srcTsConfigPath
]
)
where
srcTsConfigPath :: Path' (Rel C.ServerRootDir) (File SrcTsConfigFile) =
waspProjectDirFromAppComponentDir </> AS.srcTsConfigPath spec

genPackageJson :: AppSpec -> N.NpmDepsForWasp -> Generator FileDraft
genPackageJson spec waspDependencies = do
Expand Down
Loading