diff --git a/waspc/src/Wasp/Project/Common.hs b/waspc/src/Wasp/Project/Common.hs index 9d487adfe4..25b9496c18 100644 --- a/waspc/src/Wasp/Project/Common.hs +++ b/waspc/src/Wasp/Project/Common.hs @@ -23,6 +23,7 @@ module Wasp.Project.Common extPublicDirInWaspProjectDir, prismaSchemaFileInWaspProjectDir, getSrcTsConfigInWaspProjectDir, + tsConfigInWaspLangProject, ) where @@ -86,10 +87,17 @@ dotWaspInfoFileInGeneratedCodeDir = [relfile|.waspinfo|] packageJsonInWaspProjectDir :: Path' (Rel WaspProjectDir) (File PackageJsonFile) packageJsonInWaspProjectDir = [relfile|package.json|] +-- TODO: The entire tsconfig story is very fragile getSrcTsConfigInWaspProjectDir :: WaspFilePath -> Path' (Rel WaspProjectDir) (File SrcTsConfigFile) getSrcTsConfigInWaspProjectDir = \case - WaspTs _ -> [relfile|tsconfig.src.json|] - WaspLang _ -> [relfile|tsconfig.json|] + WaspTs _ -> tsConfigInWaspTsProject + WaspLang _ -> tsConfigInWaspLangProject + +tsConfigInWaspLangProject :: Path' (Rel WaspProjectDir) (File SrcTsConfigFile) +tsConfigInWaspLangProject = [relfile|tsconfig.json|] + +tsConfigInWaspTsProject :: Path' (Rel WaspProjectDir) (File SrcTsConfigFile) +tsConfigInWaspTsProject = [relfile|tsconfig.src.json|] packageLockJsonInWaspProjectDir :: Path' (Rel WaspProjectDir) File' packageLockJsonInWaspProjectDir = [relfile|package-lock.json|] diff --git a/waspc/waspls/src/Wasp/LSP/ExtImport/ExportsCache.hs b/waspc/waspls/src/Wasp/LSP/ExtImport/ExportsCache.hs index dba605eca6..abb7f75ced 100644 --- a/waspc/waspls/src/Wasp/LSP/ExtImport/ExportsCache.hs +++ b/waspc/waspls/src/Wasp/LSP/ExtImport/ExportsCache.hs @@ -22,7 +22,7 @@ import Wasp.LSP.ExtImport.Path (WaspStyleExtFilePath, absPathToCachePath, cacheP import Wasp.LSP.ExtImport.Syntax (ExtImportNode (einName, einPath), getAllExtImports) import Wasp.LSP.ServerMonads (HandlerM, ServerM, getProjectRootDir, handler, modify) import qualified Wasp.LSP.ServerState as State -import Wasp.Project.Common (tsconfigInWaspProjectDir) +import Wasp.Project.Common (tsConfigInWaspLangProject) import qualified Wasp.TypeScript.Inspect.Exports as TS -- | Based on the files imported in the external imports of the current concrete @@ -63,7 +63,7 @@ refreshExportsOfFiles files = do getExportRequestForFile projectRootDir file = TS.TsExportsRequest { TS.filepaths = [SP.fromAbsFile file], - TS.tsconfig = Just $ SP.fromAbsFile $ projectRootDir tsconfigInWaspProjectDir + TS.tsconfig = Just $ SP.fromAbsFile $ projectRootDir tsConfigInWaspLangProject } -- Replaces entries in the exports cache with the exports lists in the