mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-26 10:35:04 +03:00
Fixes Tailwind setup in client tests (#1766)
This commit is contained in:
parent
3edb2fe921
commit
87e576d66d
829
waspc/examples/todo-typescript/package-lock.json
generated
829
waspc/examples/todo-typescript/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -28,6 +28,7 @@ import qualified Wasp.AppSpec.ExternalFiles as EC
|
||||
import Wasp.AppSpec.Valid (getLowestNodeVersionUserAllows, isAuthEnabled)
|
||||
import qualified Wasp.AppSpec.Valid as AS.Valid
|
||||
import Wasp.Generator.Common (ProjectRootDir, makeJsonWithEntityData, prismaVersion)
|
||||
import qualified Wasp.Generator.ConfigFile as G.CF
|
||||
import Wasp.Generator.DbGenerator (getEntitiesForPrismaSchema)
|
||||
import qualified Wasp.Generator.DbGenerator.Auth as DbAuth
|
||||
import Wasp.Generator.FileDraft (FileDraft)
|
||||
@ -225,7 +226,11 @@ npmDepsForSdk spec =
|
||||
++ depsRequiredByEmail spec
|
||||
++ depsRequiredByWebSockets spec
|
||||
++ depsRequiredForTesting
|
||||
++ depsRequiredByJobs spec,
|
||||
++ depsRequiredByJobs spec
|
||||
-- These deps need to be installed in the SDK becasue when we run client tests,
|
||||
-- we are running them from the project root dir and PostCSS and Tailwind
|
||||
-- can't be resolved from WebApp node_modules, so we need to install them in the SDK.
|
||||
++ depsRequiredByTailwind spec,
|
||||
N.devDependencies =
|
||||
AS.Dependency.fromList
|
||||
[ ("@tsconfig/node" <> majorNodeVersionStr, "latest")
|
||||
@ -276,6 +281,17 @@ depsRequiredForAuth spec =
|
||||
where
|
||||
versionRange = SV.Range [SV.backwardsCompatibleWith (SV.Version 1 2 8)]
|
||||
|
||||
depsRequiredByTailwind :: AppSpec -> [AS.Dependency.Dependency]
|
||||
depsRequiredByTailwind spec =
|
||||
if G.CF.isTailwindUsed spec
|
||||
then
|
||||
AS.Dependency.fromList
|
||||
[ ("tailwindcss", "^3.2.7"),
|
||||
("postcss", "^8.4.21"),
|
||||
("autoprefixer", "^10.4.13")
|
||||
]
|
||||
else []
|
||||
|
||||
-- TODO(filip): Figure out where this belongs. Check https://github.com/wasp-lang/wasp/pull/1602#discussion_r1437144166 .
|
||||
-- Also, fix imports for wasp project.
|
||||
installNpmDependencies :: Path' Abs (Dir WaspProjectDir) -> J.Job
|
||||
|
@ -36,7 +36,6 @@ import Wasp.Generator.Common
|
||||
( makeJsArrayFromHaskellList,
|
||||
makeJsonWithEntityData,
|
||||
)
|
||||
import qualified Wasp.Generator.ConfigFile as G.CF
|
||||
import qualified Wasp.Generator.DbGenerator.Auth as DbAuth
|
||||
import Wasp.Generator.FileDraft (FileDraft, createTextFileDraft)
|
||||
import qualified Wasp.Generator.FileDraft as FD
|
||||
@ -120,7 +119,7 @@ genNpmrc =
|
||||
Nothing
|
||||
|
||||
npmDepsForWasp :: AppSpec -> N.NpmDepsForWasp
|
||||
npmDepsForWasp spec =
|
||||
npmDepsForWasp _spec =
|
||||
N.NpmDepsForWasp
|
||||
{ N.waspDependencies =
|
||||
AS.Dependency.fromList
|
||||
@ -133,8 +132,7 @@ npmDepsForWasp spec =
|
||||
("mitt", "3.0.0"),
|
||||
-- Used for Auth UI
|
||||
("react-hook-form", "^7.45.4")
|
||||
]
|
||||
++ depsRequiredByTailwind spec,
|
||||
],
|
||||
N.waspDevDependencies =
|
||||
AS.Dependency.fromList
|
||||
[ -- TODO: Allow users to choose whether they want to use TypeScript
|
||||
@ -151,17 +149,6 @@ npmDepsForWasp spec =
|
||||
]
|
||||
}
|
||||
|
||||
depsRequiredByTailwind :: AppSpec -> [AS.Dependency.Dependency]
|
||||
depsRequiredByTailwind spec =
|
||||
if G.CF.isTailwindUsed spec
|
||||
then
|
||||
AS.Dependency.fromList
|
||||
[ ("tailwindcss", "^3.2.7"),
|
||||
("postcss", "^8.4.21"),
|
||||
("autoprefixer", "^10.4.13")
|
||||
]
|
||||
else []
|
||||
|
||||
genGitignore :: Generator FileDraft
|
||||
genGitignore =
|
||||
return $
|
||||
|
Loading…
Reference in New Issue
Block a user