From edb3cbd61f297d29ac131214e12facb1898cfcc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Tue, 20 Feb 2024 15:42:46 +0100 Subject: [PATCH] Solve build context issues for 0.12.0 (#1785) --- waspc/cli/src/Wasp/Cli/Command/Build.hs | 36 +- waspc/data/Generator/templates/Dockerfile | 8 +- .../templates/sdk/{ => wasp}/api/events.ts | 0 .../templates/sdk/{ => wasp}/api/index.ts | 0 .../{ => wasp}/auth/email/actions/login.ts | 0 .../auth/email/actions/passwordReset.ts | 0 .../{ => wasp}/auth/email/actions/signup.ts | 0 .../auth/email/actions/verifyEmail.ts | 0 .../sdk/{ => wasp}/auth/email/index.ts | 0 .../sdk/{ => wasp}/auth/forms/Auth.tsx | 0 .../{ => wasp}/auth/forms/ForgotPassword.tsx | 0 .../sdk/{ => wasp}/auth/forms/Login.tsx | 0 .../{ => wasp}/auth/forms/ResetPassword.tsx | 0 .../sdk/{ => wasp}/auth/forms/Signup.tsx | 0 .../sdk/{ => wasp}/auth/forms/VerifyEmail.tsx | 0 .../{ => wasp}/auth/forms/internal/Form.tsx | 0 .../auth/forms/internal/Message.tsx | 0 .../forms/internal/common/LoginSignupForm.tsx | 0 .../internal/email/ForgotPasswordForm.tsx | 0 .../internal/email/ResetPasswordForm.tsx | 0 .../forms/internal/email/VerifyEmailForm.tsx | 0 .../auth/forms/internal/email/useEmail.ts | 0 .../forms/internal/social/SocialButton.tsx | 0 .../forms/internal/social/SocialIcons.tsx | 0 .../useUsernameAndPassword.ts | 0 .../sdk/{ => wasp}/auth/forms/types.ts | 0 .../sdk/{ => wasp}/auth/helpers/Generic.tsx | 0 .../sdk/{ => wasp}/auth/helpers/user.ts | 0 .../templates/sdk/{ => wasp}/auth/index.ts | 0 .../templates/sdk/{ => wasp}/auth/jwt.ts | 0 .../templates/sdk/{ => wasp}/auth/login.ts | 0 .../templates/sdk/{ => wasp}/auth/logout.ts | 0 .../templates/sdk/{ => wasp}/auth/lucia.ts | 0 .../templates/sdk/{ => wasp}/auth/password.ts | 0 .../sdk/{ => wasp}/auth/providers/types.ts | 0 .../templates/sdk/{ => wasp}/auth/session.ts | 0 .../templates/sdk/{ => wasp}/auth/signup.ts | 0 .../templates/sdk/{ => wasp}/auth/types.ts | 0 .../templates/sdk/{ => wasp}/auth/useAuth.ts | 0 .../templates/sdk/{ => wasp}/auth/user.ts | 0 .../templates/sdk/{ => wasp}/auth/utils.ts | 0 .../sdk/{ => wasp}/auth/validation.ts | 0 .../sdk/{ => wasp}/client/auth/email.ts | 0 .../sdk/{ => wasp}/client/auth/github.ts | 0 .../sdk/{ => wasp}/client/auth/google.ts | 0 .../sdk/{ => wasp}/client/auth/index.ts | 0 .../sdk/{ => wasp}/client/auth/ui.ts | 0 .../sdk/{ => wasp}/client/auth/username.ts | 0 .../sdk/{ => wasp}/client/crud/_crud.ts | 0 .../sdk/{ => wasp}/client/crud/index.ts | 0 .../templates/sdk/{ => wasp}/client/index.ts | 0 .../client/operations/actions/core.d.ts | 0 .../client/operations/actions/core.js | 0 .../client/operations/actions/index.ts | 0 .../sdk/{ => wasp}/client/operations/core.ts | 0 .../sdk/{ => wasp}/client/operations/index.ts | 0 .../client/operations/internal/index.ts | 0 .../client/operations/internal/resources.js | 0 .../operations/internal/updateHandlersMap.js | 0 .../client/operations/queries/core.d.ts | 0 .../client/operations/queries/core.js | 0 .../client/operations/queries/index.ts | 0 .../client/operations/queryClient.ts | 0 .../sdk/{ => wasp}/client/router/Link.tsx | 0 .../sdk/{ => wasp}/client/router/index.ts | 0 .../{ => wasp}/client/router/linkHelpers.ts | 0 .../sdk/{ => wasp}/client/router/types.ts | 0 .../sdk/{ => wasp}/client/test/index.ts | 0 .../{ => wasp}/client/test/vitest/helpers.tsx | 0 .../client/webSocket/WebSocketProvider.tsx | 0 .../sdk/{ => wasp}/client/webSocket/index.ts | 0 .../templates/sdk/{ => wasp}/core/auth.ts | 0 .../templates/sdk/{ => wasp}/core/config.ts | 0 .../sdk/{ => wasp}/core/stitches.config.ts | 0 .../templates/sdk/{ => wasp}/core/storage.ts | 0 .../templates/sdk/{ => wasp}/dev/index.ts | 0 .../sdk/{ => wasp}/entities/index.ts | 0 .../templates/sdk/{ => wasp}/package.json | 0 .../sdk/{ => wasp}/server/HttpError.ts | 0 .../sdk/{ => wasp}/server/_types/index.ts | 0 .../{ => wasp}/server/_types/serialization.ts | 0 .../server/_types/taggedEntities.ts | 0 .../sdk/{ => wasp}/server/api/index.ts | 0 .../sdk/{ => wasp}/server/auth/email/index.ts | 0 .../sdk/{ => wasp}/server/auth/email/utils.ts | 0 .../sdk/{ => wasp}/server/auth/index.ts | 0 .../sdk/{ => wasp}/server/auth/username.ts | 0 .../templates/sdk/{ => wasp}/server/config.ts | 0 .../{ => wasp}/server/crud/_operationTypes.ts | 0 .../sdk/{ => wasp}/server/crud/index.ts | 0 .../sdk/{ => wasp}/server/dbClient.ts | 0 .../{ => wasp}/server/email/core/helpers.ts | 0 .../sdk/{ => wasp}/server/email/core/index.ts | 0 .../server/email/core/providers/dummy.ts | 0 .../server/email/core/providers/mailgun.ts | 0 .../server/email/core/providers/sendgrid.ts | 0 .../server/email/core/providers/smtp.ts | 0 .../sdk/{ => wasp}/server/email/core/types.ts | 0 .../sdk/{ => wasp}/server/email/index.ts | 0 .../templates/sdk/{ => wasp}/server/index.ts | 0 .../sdk/{ => wasp}/server/jobs/_job.ts | 0 .../sdk/{ => wasp}/server/jobs/core/job.ts | 0 .../server/jobs/core/pgBoss/index.ts | 0 .../server/jobs/core/pgBoss/pgBoss.ts | 0 .../server/jobs/core/pgBoss/pgBossJob.ts | 0 .../server/jobs/core/pgBoss/types.ts | 0 .../sdk/{ => wasp}/server/jobs/index.ts | 0 .../server/middleware/globalMiddleware.ts | 0 .../sdk/{ => wasp}/server/middleware/index.ts | 0 .../server/operations/actions/index.ts | 0 .../server/operations/actions/types.ts | 0 .../sdk/{ => wasp}/server/operations/index.ts | 0 .../server/operations/queries/index.ts | 0 .../server/operations/queries/types.ts | 0 .../sdk/{ => wasp}/server/types/index.ts | 0 .../templates/sdk/{ => wasp}/server/utils.ts | 0 .../sdk/{ => wasp}/server/webSocket/index.ts | 0 .../templates/sdk/{ => wasp}/tsconfig.json | 0 .../sdk/{ => wasp}/universal/types.ts | 0 .../templates/sdk/{ => wasp}/universal/url.ts | 0 .../sdk/{ => wasp}/universal/validators.ts | 0 .../templates/sdk/{ => wasp}/vite-env.d.ts | 0 .../waspBuild-golden/files.manifest | 185 ++++++++++ .../waspBuild/.wasp/build/.waspchecksums | 2 +- .../waspBuild/.wasp/build/Dockerfile | 6 +- .../waspBuild/.wasp/build/package.json | 13 + .../.wasp/build/sdk/wasp/api/events.ts | 11 + .../.wasp/build/sdk/wasp/api/index.ts | 108 ++++++ .../.wasp/build/sdk/wasp/client/index.ts | 11 + .../wasp/client/operations/actions/core.d.ts | 14 + .../wasp/client/operations/actions/core.js | 36 ++ .../wasp/client/operations/actions/index.ts | 1 + .../build/sdk/wasp/client/operations/core.ts | 346 ++++++++++++++++++ .../build/sdk/wasp/client/operations/index.ts | 22 ++ .../wasp/client/operations/internal/index.ts | 25 ++ .../client/operations/internal/resources.js | 83 +++++ .../operations/internal/updateHandlersMap.js | 37 ++ .../wasp/client/operations/queries/core.d.ts | 25 ++ .../wasp/client/operations/queries/core.js | 32 ++ .../wasp/client/operations/queries/index.ts | 4 + .../sdk/wasp/client/operations/queryClient.ts | 34 ++ .../build/sdk/wasp/client/router/Link.tsx | 21 ++ .../build/sdk/wasp/client/router/index.ts | 22 ++ .../sdk/wasp/client/router/linkHelpers.ts | 45 +++ .../build/sdk/wasp/client/router/types.ts | 41 +++ .../.wasp/build/sdk/wasp/client/test/index.ts | 1 + .../sdk/wasp/client/test/vitest/helpers.tsx | 95 +++++ .../.wasp/build/sdk/wasp/core/config.ts | 9 + .../.wasp/build/sdk/wasp/core/storage.ts | 50 +++ .../.wasp/build/sdk/wasp/dev/index.ts | 17 + .../.wasp/build/sdk/wasp/dist/api/events.d.ts | 7 + .../.wasp/build/sdk/wasp/dist/api/events.js | 4 + .../build/sdk/wasp/dist/api/events.js.map | 1 + .../.wasp/build/sdk/wasp/dist/api/index.d.ts | 15 + .../.wasp/build/sdk/wasp/dist/api/index.js | 96 +++++ .../build/sdk/wasp/dist/api/index.js.map | 1 + .../build/sdk/wasp/dist/client/index.d.ts | 10 + .../.wasp/build/sdk/wasp/dist/client/index.js | 10 + .../build/sdk/wasp/dist/client/index.js.map | 1 + .../dist/client/operations/actions/core.d.ts | 4 + .../dist/client/operations/actions/core.js | 31 ++ .../client/operations/actions/core.js.map | 1 + .../dist/client/operations/actions/index.d.ts | 1 + .../dist/client/operations/actions/index.js | 2 + .../client/operations/actions/index.js.map | 1 + .../sdk/wasp/dist/client/operations/core.d.ts | 44 +++ .../sdk/wasp/dist/client/operations/core.js | 171 +++++++++ .../wasp/dist/client/operations/core.js.map | 1 + .../wasp/dist/client/operations/index.d.ts | 4 + .../sdk/wasp/dist/client/operations/index.js | 17 + .../wasp/dist/client/operations/index.js.map | 1 + .../client/operations/internal/index.d.ts | 9 + .../dist/client/operations/internal/index.js | 19 + .../client/operations/internal/index.js.map | 1 + .../client/operations/internal/resources.d.ts | 11 + .../client/operations/internal/resources.js | 69 ++++ .../operations/internal/resources.js.map | 1 + .../internal/updateHandlersMap.d.ts | 5 + .../operations/internal/updateHandlersMap.js | 31 ++ .../internal/updateHandlersMap.js.map | 1 + .../dist/client/operations/queries/core.d.ts | 6 + .../dist/client/operations/queries/core.js | 19 + .../client/operations/queries/core.js.map | 1 + .../dist/client/operations/queries/index.d.ts | 1 + .../dist/client/operations/queries/index.js | 3 + .../client/operations/queries/index.js.map | 1 + .../dist/client/operations/queryClient.d.ts | 4 + .../dist/client/operations/queryClient.js | 21 ++ .../dist/client/operations/queryClient.js.map | 1 + .../sdk/wasp/dist/client/router/Link.d.ts | 8 + .../sdk/wasp/dist/client/router/Link.jsx | 23 ++ .../sdk/wasp/dist/client/router/Link.jsx.map | 1 + .../sdk/wasp/dist/client/router/index.d.ts | 9 + .../sdk/wasp/dist/client/router/index.js | 11 + .../sdk/wasp/dist/client/router/index.js.map | 1 + .../wasp/dist/client/router/linkHelpers.d.ts | 2 + .../wasp/dist/client/router/linkHelpers.js | 34 ++ .../dist/client/router/linkHelpers.js.map | 1 + .../sdk/wasp/dist/client/router/types.d.ts | 30 ++ .../sdk/wasp/dist/client/router/types.js | 2 + .../sdk/wasp/dist/client/router/types.js.map | 1 + .../sdk/wasp/dist/client/test/index.d.ts | 1 + .../build/sdk/wasp/dist/client/test/index.js | 2 + .../sdk/wasp/dist/client/test/index.js.map | 1 + .../wasp/dist/client/test/vitest/helpers.d.ts | 13 + .../wasp/dist/client/test/vitest/helpers.jsx | 64 ++++ .../dist/client/test/vitest/helpers.jsx.map | 1 + .../build/sdk/wasp/dist/core/config.d.ts | 4 + .../.wasp/build/sdk/wasp/dist/core/config.js | 7 + .../build/sdk/wasp/dist/core/config.js.map | 1 + .../build/sdk/wasp/dist/core/storage.d.ts | 8 + .../.wasp/build/sdk/wasp/dist/core/storage.js | 41 +++ .../build/sdk/wasp/dist/core/storage.js.map | 1 + .../.wasp/build/sdk/wasp/dist/dev/index.d.ts | 11 + .../.wasp/build/sdk/wasp/dist/dev/index.js | 16 + .../build/sdk/wasp/dist/dev/index.js.map | 1 + .../build/sdk/wasp/dist/entities/index.d.ts | 3 + .../build/sdk/wasp/dist/entities/index.js | 2 + .../build/sdk/wasp/dist/entities/index.js.map | 1 + .../build/sdk/wasp/dist/ext-src/MainPage.d.ts | 1 + .../build/sdk/wasp/dist/ext-src/MainPage.jsx | 29 ++ .../sdk/wasp/dist/ext-src/MainPage.jsx.map | 1 + .../build/sdk/wasp/dist/server/HttpError.d.ts | 5 + .../build/sdk/wasp/dist/server/HttpError.js | 17 + .../sdk/wasp/dist/server/HttpError.js.map | 1 + .../sdk/wasp/dist/server/_types/index.d.ts | 18 + .../sdk/wasp/dist/server/_types/index.js | 3 + .../sdk/wasp/dist/server/_types/index.js.map | 1 + .../dist/server/_types/serialization.d.ts | 16 + .../wasp/dist/server/_types/serialization.js | 2 + .../dist/server/_types/serialization.js.map | 1 + .../dist/server/_types/taggedEntities.d.ts | 1 + .../wasp/dist/server/_types/taggedEntities.js | 2 + .../dist/server/_types/taggedEntities.js.map | 1 + .../build/sdk/wasp/dist/server/config.d.ts | 15 + .../build/sdk/wasp/dist/server/config.js | 32 ++ .../build/sdk/wasp/dist/server/config.js.map | 1 + .../build/sdk/wasp/dist/server/dbClient.d.ts | 2 + .../build/sdk/wasp/dist/server/dbClient.js | 12 + .../sdk/wasp/dist/server/dbClient.js.map | 1 + .../build/sdk/wasp/dist/server/index.d.ts | 7 + .../.wasp/build/sdk/wasp/dist/server/index.js | 7 + .../build/sdk/wasp/dist/server/index.js.map | 1 + .../server/middleware/globalMiddleware.d.ts | 3 + .../server/middleware/globalMiddleware.js | 2 + .../server/middleware/globalMiddleware.js.map | 1 + .../wasp/dist/server/middleware/index.d.ts | 1 + .../sdk/wasp/dist/server/middleware/index.js | 2 + .../wasp/dist/server/middleware/index.js.map | 1 + .../dist/server/operations/actions/index.d.ts | 1 + .../dist/server/operations/actions/index.js | 2 + .../server/operations/actions/index.js.map | 1 + .../dist/server/operations/actions/types.d.ts | 1 + .../dist/server/operations/actions/types.js | 2 + .../server/operations/actions/types.js.map | 1 + .../wasp/dist/server/operations/index.d.ts | 2 + .../sdk/wasp/dist/server/operations/index.js | 5 + .../wasp/dist/server/operations/index.js.map | 1 + .../dist/server/operations/queries/index.d.ts | 1 + .../dist/server/operations/queries/index.js | 2 + .../server/operations/queries/index.js.map | 1 + .../dist/server/operations/queries/types.d.ts | 1 + .../dist/server/operations/queries/types.js | 2 + .../server/operations/queries/types.js.map | 1 + .../sdk/wasp/dist/server/types/index.d.ts | 8 + .../build/sdk/wasp/dist/server/types/index.js | 2 + .../sdk/wasp/dist/server/types/index.js.map | 1 + .../build/sdk/wasp/dist/server/utils.d.ts | 12 + .../.wasp/build/sdk/wasp/dist/server/utils.js | 17 + .../build/sdk/wasp/dist/server/utils.js.map | 1 + .../build/sdk/wasp/dist/universal/types.d.ts | 5 + .../build/sdk/wasp/dist/universal/types.js | 2 + .../sdk/wasp/dist/universal/types.js.map | 1 + .../build/sdk/wasp/dist/universal/url.d.ts | 1 + .../build/sdk/wasp/dist/universal/url.js | 4 + .../build/sdk/wasp/dist/universal/url.js.map | 1 + .../sdk/wasp/dist/universal/validators.d.ts | 2 + .../sdk/wasp/dist/universal/validators.js | 22 ++ .../sdk/wasp/dist/universal/validators.js.map | 1 + .../.wasp/build/sdk/wasp/entities/index.ts | 11 + .../.wasp/build/sdk/wasp/ext-src/Main.css | 89 +++++ .../.wasp/build/sdk/wasp/ext-src/MainPage.jsx | 41 +++ .../build/sdk/wasp/ext-src/vite-env.d.ts | 1 + .../.wasp/build/sdk/wasp/ext-src/waspLogo.png | Bin 0 -> 24877 bytes .../.wasp/build/sdk/wasp/package.json | 101 +++++ .../.wasp/build/sdk/wasp/server/HttpError.ts | 23 ++ .../build/sdk/wasp/server/_types/index.ts | 45 +++ .../sdk/wasp/server/_types/serialization.ts | 43 +++ .../sdk/wasp/server/_types/taggedEntities.ts | 16 + .../.wasp/build/sdk/wasp/server/config.ts | 63 ++++ .../.wasp/build/sdk/wasp/server/dbClient.ts | 13 + .../.wasp/build/sdk/wasp/server/index.ts | 15 + .../server/middleware/globalMiddleware.ts | 8 + .../build/sdk/wasp/server/middleware/index.ts | 1 + .../wasp/server/operations/actions/index.ts | 2 + .../wasp/server/operations/actions/types.ts | 4 + .../build/sdk/wasp/server/operations/index.ts | 4 + .../wasp/server/operations/queries/index.ts | 2 + .../wasp/server/operations/queries/types.ts | 5 + .../build/sdk/wasp/server/types/index.ts | 11 + .../.wasp/build/sdk/wasp/server/utils.ts | 34 ++ .../.wasp/build/sdk/wasp/tsconfig.json | 44 +++ .../.wasp/build/sdk/wasp/universal/types.ts | 31 ++ .../.wasp/build/sdk/wasp/universal/url.ts | 3 + .../build/sdk/wasp/universal/validators.ts | 21 ++ .../.wasp/build/sdk/wasp/vite-env.d.ts | 1 + .../waspBuild/.wasp/build/src/Main.css | 89 +++++ .../waspBuild/.wasp/build/src/MainPage.jsx | 41 +++ .../waspBuild/.wasp/build/src/vite-env.d.ts | 1 + .../waspBuild/.wasp/build/src/waspLogo.png | Bin 0 -> 24877 bytes .../waspCompile/.wasp/out/.waspchecksums | 2 +- .../waspCompile/.wasp/out/Dockerfile | 6 +- .../waspComplexTest/.wasp/out/.waspchecksums | 2 +- .../waspComplexTest/.wasp/out/Dockerfile | 8 +- .../waspJob/.wasp/out/.waspchecksums | 2 +- .../waspJob/.wasp/out/Dockerfile | 6 +- .../waspMigrate/.wasp/out/.waspchecksums | 2 +- .../waspMigrate/.wasp/out/Dockerfile | 8 +- .../src/Wasp/Generator/SdkGenerator/Common.hs | 7 +- waspc/src/Wasp/Project/Common.hs | 4 + waspc/src/Wasp/Util/IO.hs | 10 + web/docs/advanced/deployment/manually.md | 15 +- web/docs/advanced/deployment/overview.md | 2 +- 323 files changed, 3362 insertions(+), 34 deletions(-) rename waspc/data/Generator/templates/sdk/{ => wasp}/api/events.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/api/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/email/actions/login.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/email/actions/passwordReset.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/email/actions/signup.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/email/actions/verifyEmail.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/email/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/forms/Auth.tsx (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/forms/ForgotPassword.tsx (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/forms/Login.tsx (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/forms/ResetPassword.tsx (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/forms/Signup.tsx (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/forms/VerifyEmail.tsx (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/forms/internal/Form.tsx (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/forms/internal/Message.tsx (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/forms/internal/common/LoginSignupForm.tsx (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/forms/internal/email/ForgotPasswordForm.tsx (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/forms/internal/email/ResetPasswordForm.tsx (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/forms/internal/email/VerifyEmailForm.tsx (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/forms/internal/email/useEmail.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/forms/internal/social/SocialButton.tsx (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/forms/internal/social/SocialIcons.tsx (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/forms/internal/usernameAndPassword/useUsernameAndPassword.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/forms/types.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/helpers/Generic.tsx (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/helpers/user.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/jwt.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/login.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/logout.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/lucia.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/password.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/providers/types.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/session.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/signup.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/types.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/useAuth.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/user.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/utils.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/auth/validation.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/auth/email.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/auth/github.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/auth/google.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/auth/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/auth/ui.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/auth/username.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/crud/_crud.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/crud/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/operations/actions/core.d.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/operations/actions/core.js (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/operations/actions/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/operations/core.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/operations/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/operations/internal/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/operations/internal/resources.js (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/operations/internal/updateHandlersMap.js (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/operations/queries/core.d.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/operations/queries/core.js (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/operations/queries/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/operations/queryClient.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/router/Link.tsx (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/router/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/router/linkHelpers.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/router/types.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/test/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/test/vitest/helpers.tsx (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/webSocket/WebSocketProvider.tsx (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/client/webSocket/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/core/auth.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/core/config.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/core/stitches.config.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/core/storage.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/dev/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/entities/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/package.json (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/HttpError.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/_types/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/_types/serialization.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/_types/taggedEntities.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/api/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/auth/email/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/auth/email/utils.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/auth/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/auth/username.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/config.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/crud/_operationTypes.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/crud/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/dbClient.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/email/core/helpers.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/email/core/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/email/core/providers/dummy.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/email/core/providers/mailgun.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/email/core/providers/sendgrid.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/email/core/providers/smtp.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/email/core/types.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/email/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/jobs/_job.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/jobs/core/job.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/jobs/core/pgBoss/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/jobs/core/pgBoss/pgBoss.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/jobs/core/pgBoss/pgBossJob.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/jobs/core/pgBoss/types.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/jobs/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/middleware/globalMiddleware.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/middleware/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/operations/actions/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/operations/actions/types.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/operations/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/operations/queries/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/operations/queries/types.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/types/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/utils.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/server/webSocket/index.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/tsconfig.json (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/universal/types.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/universal/url.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/universal/validators.ts (100%) rename waspc/data/Generator/templates/sdk/{ => wasp}/vite-env.d.ts (100%) create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/package.json create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/api/events.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/api/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/actions/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/actions/core.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/actions/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/core.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/internal/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/internal/resources.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/internal/updateHandlersMap.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/queries/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/queries/core.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/queries/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/queryClient.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/Link.tsx create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/linkHelpers.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/types.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/test/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/test/vitest/helpers.tsx create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/core/config.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/core/storage.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dev/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/events.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/events.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/events.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/core.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/core.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/core.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/core.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/resources.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/resources.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/resources.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/core.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/core.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queryClient.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queryClient.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queryClient.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/Link.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/Link.jsx create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/Link.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/types.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/vitest/helpers.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/vitest/helpers.jsx create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/vitest/helpers.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/config.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/config.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/config.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/storage.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/storage.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/storage.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/dev/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/dev/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/dev/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/entities/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/entities/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/entities/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/ext-src/MainPage.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/ext-src/MainPage.jsx create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/ext-src/MainPage.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/serialization.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/serialization.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/serialization.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/taggedEntities.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/taggedEntities.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/taggedEntities.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/dbClient.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/dbClient.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/dbClient.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/globalMiddleware.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/globalMiddleware.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/types.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/types.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/types/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/types/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/types/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/types.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/validators.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/validators.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/validators.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/entities/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/ext-src/Main.css create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/ext-src/MainPage.jsx create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/ext-src/vite-env.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/ext-src/waspLogo.png create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/package.json create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/HttpError.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/_types/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/_types/serialization.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/_types/taggedEntities.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/config.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/dbClient.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/middleware/globalMiddleware.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/middleware/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/actions/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/actions/types.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/queries/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/queries/types.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/types/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/utils.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/tsconfig.json create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/types.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/url.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/validators.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/vite-env.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/src/Main.css create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/src/MainPage.jsx create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/src/vite-env.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/src/waspLogo.png diff --git a/waspc/cli/src/Wasp/Cli/Command/Build.hs b/waspc/cli/src/Wasp/Cli/Command/Build.hs index 2e83e8344..46da0cc76 100644 --- a/waspc/cli/src/Wasp/Cli/Command/Build.hs +++ b/waspc/cli/src/Wasp/Cli/Command/Build.hs @@ -6,7 +6,7 @@ where import Control.Monad (when) import Control.Monad.Except (throwError) import Control.Monad.IO.Class (liftIO) -import StrongPath (Abs, Dir, Path', ()) +import StrongPath (Abs, Dir, Path', castRel, ()) import Wasp.Cli.Command (Command, CommandError (..)) import Wasp.Cli.Command.Compile (compileIOWithOptions, printCompilationResult) import Wasp.Cli.Command.Message (cliSendMessageC) @@ -15,11 +15,11 @@ import Wasp.Cli.Message (cliSendMessage) import Wasp.CompileOptions (CompileOptions (..)) import qualified Wasp.Generator import Wasp.Generator.Monad (GeneratorWarning (GeneratorNeedsMigrationWarning)) -import Wasp.Generator.SdkGenerator.Common (sdkRootDirInProjectRootDir) +import Wasp.Generator.SdkGenerator.Common (sdkRootDirInGeneratedCodeDir, sdkRootDirInProjectRootDir) import qualified Wasp.Message as Msg import Wasp.Project (CompileError, CompileWarning, WaspProjectDir) -import Wasp.Project.Common (buildDirInDotWaspDir, dotWaspDirInWaspProjectDir, generatedCodeDirInDotWaspDir) -import Wasp.Util.IO (doesDirectoryExist, removeDirectory) +import Wasp.Project.Common (buildDirInDotWaspDir, dotWaspDirInWaspProjectDir, generatedCodeDirInDotWaspDir, packageJsonInWaspProjectDir, packageLockJsonInWaspProjectDir, srcDirInWaspProjectDir) +import Wasp.Util.IO (copyDirectory, copyFile, doesDirectoryExist, removeDirectory) -- | Builds Wasp project that the current working directory is part of. -- Does all the steps, from analysis to generation, and at the end writes generated code @@ -53,6 +53,8 @@ build = do cliSendMessageC $ Msg.Start "Building wasp project..." (warnings, errors) <- liftIO $ buildIO waspProjectDir buildDir + liftIO $ copyUserFilesNecessaryForBuild waspProjectDir buildDir + liftIO $ printCompilationResult (warnings, errors) if null errors then do @@ -61,6 +63,32 @@ build = do else throwError $ CommandError "Building of wasp project failed" $ show (length errors) ++ " errors found" + where + -- Until we implement the solution described in https://github.com/wasp-lang/wasp/issues/1769, + -- we're copying all files and folders necessary for the build into the .wasp/build directory. + -- We chose this approach for 0.12.0 (instead of building from the project root) because: + -- - The build context remains small (~1.5 MB vs ~900 MB). + -- - We don't risk copying possible secrets from the project root into the build context. + -- - The commands for building the project stay the same as before + -- 0.12.0, which is good for both us (e.g., for fly deployment) and our + -- users (no changes in CI/CD scripts). + -- For more details, read the issue linked above. + copyUserFilesNecessaryForBuild waspProjectDir buildDir = do + copyDirectory + (waspProjectDir srcDirInWaspProjectDir) + (buildDir castRel srcDirInWaspProjectDir) + + copyDirectory + (waspProjectDir dotWaspDirInWaspProjectDir generatedCodeDirInDotWaspDir sdkRootDirInGeneratedCodeDir) + (buildDir sdkRootDirInGeneratedCodeDir) + + copyFile + (waspProjectDir packageJsonInWaspProjectDir) + (buildDir castRel packageJsonInWaspProjectDir) + + copyFile + (waspProjectDir packageLockJsonInWaspProjectDir) + (buildDir castRel packageLockJsonInWaspProjectDir) buildIO :: Path' Abs (Dir WaspProjectDir) -> diff --git a/waspc/data/Generator/templates/Dockerfile b/waspc/data/Generator/templates/Dockerfile index 095f8c657..f0713ce6d 100644 --- a/waspc/data/Generator/templates/Dockerfile +++ b/waspc/data/Generator/templates/Dockerfile @@ -33,12 +33,12 @@ WORKDIR /app COPY src ./src COPY package.json . COPY package-lock.json . -COPY .wasp/build/server .wasp/build/server -COPY .wasp/out/sdk .wasp/out/sdk +COPY server .wasp/build/server +COPY sdk .wasp/out/sdk # Install npm packages, resulting in node_modules/. RUN npm install && cd .wasp/build/server && npm install {=# usingPrisma =} -COPY .wasp/build/db/schema.prisma .wasp/build/db/ +COPY db/schema.prisma .wasp/build/db/ RUN cd .wasp/build/server && npx prisma generate --schema='{= dbSchemaFileFromServerDir =}' {=/ usingPrisma =} # Building the server should come after Prisma generation. @@ -64,7 +64,7 @@ COPY --from=server-builder /app/.wasp/build/server/node_modules .wasp/build/serv COPY --from=server-builder /app/.wasp/build/server/bundle .wasp/build/server/bundle COPY --from=server-builder /app/.wasp/build/server/package*.json .wasp/build/server/ COPY --from=server-builder /app/.wasp/build/server/scripts .wasp/build/server/scripts -COPY .wasp/build/db/ .wasp/build/db/ +COPY db/ .wasp/build/db/ EXPOSE ${PORT} WORKDIR /app/.wasp/build/server ENTRYPOINT ["npm", "run", "start-production"] diff --git a/waspc/data/Generator/templates/sdk/api/events.ts b/waspc/data/Generator/templates/sdk/wasp/api/events.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/api/events.ts rename to waspc/data/Generator/templates/sdk/wasp/api/events.ts diff --git a/waspc/data/Generator/templates/sdk/api/index.ts b/waspc/data/Generator/templates/sdk/wasp/api/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/api/index.ts rename to waspc/data/Generator/templates/sdk/wasp/api/index.ts diff --git a/waspc/data/Generator/templates/sdk/auth/email/actions/login.ts b/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/login.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/email/actions/login.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/email/actions/login.ts diff --git a/waspc/data/Generator/templates/sdk/auth/email/actions/passwordReset.ts b/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/passwordReset.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/email/actions/passwordReset.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/email/actions/passwordReset.ts diff --git a/waspc/data/Generator/templates/sdk/auth/email/actions/signup.ts b/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/signup.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/email/actions/signup.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/email/actions/signup.ts diff --git a/waspc/data/Generator/templates/sdk/auth/email/actions/verifyEmail.ts b/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/verifyEmail.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/email/actions/verifyEmail.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/email/actions/verifyEmail.ts diff --git a/waspc/data/Generator/templates/sdk/auth/email/index.ts b/waspc/data/Generator/templates/sdk/wasp/auth/email/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/email/index.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/email/index.ts diff --git a/waspc/data/Generator/templates/sdk/auth/forms/Auth.tsx b/waspc/data/Generator/templates/sdk/wasp/auth/forms/Auth.tsx similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/forms/Auth.tsx rename to waspc/data/Generator/templates/sdk/wasp/auth/forms/Auth.tsx diff --git a/waspc/data/Generator/templates/sdk/auth/forms/ForgotPassword.tsx b/waspc/data/Generator/templates/sdk/wasp/auth/forms/ForgotPassword.tsx similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/forms/ForgotPassword.tsx rename to waspc/data/Generator/templates/sdk/wasp/auth/forms/ForgotPassword.tsx diff --git a/waspc/data/Generator/templates/sdk/auth/forms/Login.tsx b/waspc/data/Generator/templates/sdk/wasp/auth/forms/Login.tsx similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/forms/Login.tsx rename to waspc/data/Generator/templates/sdk/wasp/auth/forms/Login.tsx diff --git a/waspc/data/Generator/templates/sdk/auth/forms/ResetPassword.tsx b/waspc/data/Generator/templates/sdk/wasp/auth/forms/ResetPassword.tsx similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/forms/ResetPassword.tsx rename to waspc/data/Generator/templates/sdk/wasp/auth/forms/ResetPassword.tsx diff --git a/waspc/data/Generator/templates/sdk/auth/forms/Signup.tsx b/waspc/data/Generator/templates/sdk/wasp/auth/forms/Signup.tsx similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/forms/Signup.tsx rename to waspc/data/Generator/templates/sdk/wasp/auth/forms/Signup.tsx diff --git a/waspc/data/Generator/templates/sdk/auth/forms/VerifyEmail.tsx b/waspc/data/Generator/templates/sdk/wasp/auth/forms/VerifyEmail.tsx similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/forms/VerifyEmail.tsx rename to waspc/data/Generator/templates/sdk/wasp/auth/forms/VerifyEmail.tsx diff --git a/waspc/data/Generator/templates/sdk/auth/forms/internal/Form.tsx b/waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/Form.tsx similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/forms/internal/Form.tsx rename to waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/Form.tsx diff --git a/waspc/data/Generator/templates/sdk/auth/forms/internal/Message.tsx b/waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/Message.tsx similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/forms/internal/Message.tsx rename to waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/Message.tsx diff --git a/waspc/data/Generator/templates/sdk/auth/forms/internal/common/LoginSignupForm.tsx b/waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/forms/internal/common/LoginSignupForm.tsx rename to waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx diff --git a/waspc/data/Generator/templates/sdk/auth/forms/internal/email/ForgotPasswordForm.tsx b/waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/email/ForgotPasswordForm.tsx similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/forms/internal/email/ForgotPasswordForm.tsx rename to waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/email/ForgotPasswordForm.tsx diff --git a/waspc/data/Generator/templates/sdk/auth/forms/internal/email/ResetPasswordForm.tsx b/waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/email/ResetPasswordForm.tsx similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/forms/internal/email/ResetPasswordForm.tsx rename to waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/email/ResetPasswordForm.tsx diff --git a/waspc/data/Generator/templates/sdk/auth/forms/internal/email/VerifyEmailForm.tsx b/waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/email/VerifyEmailForm.tsx similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/forms/internal/email/VerifyEmailForm.tsx rename to waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/email/VerifyEmailForm.tsx diff --git a/waspc/data/Generator/templates/sdk/auth/forms/internal/email/useEmail.ts b/waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/email/useEmail.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/forms/internal/email/useEmail.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/email/useEmail.ts diff --git a/waspc/data/Generator/templates/sdk/auth/forms/internal/social/SocialButton.tsx b/waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/social/SocialButton.tsx similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/forms/internal/social/SocialButton.tsx rename to waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/social/SocialButton.tsx diff --git a/waspc/data/Generator/templates/sdk/auth/forms/internal/social/SocialIcons.tsx b/waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/social/SocialIcons.tsx similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/forms/internal/social/SocialIcons.tsx rename to waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/social/SocialIcons.tsx diff --git a/waspc/data/Generator/templates/sdk/auth/forms/internal/usernameAndPassword/useUsernameAndPassword.ts b/waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/usernameAndPassword/useUsernameAndPassword.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/forms/internal/usernameAndPassword/useUsernameAndPassword.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/usernameAndPassword/useUsernameAndPassword.ts diff --git a/waspc/data/Generator/templates/sdk/auth/forms/types.ts b/waspc/data/Generator/templates/sdk/wasp/auth/forms/types.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/forms/types.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/forms/types.ts diff --git a/waspc/data/Generator/templates/sdk/auth/helpers/Generic.tsx b/waspc/data/Generator/templates/sdk/wasp/auth/helpers/Generic.tsx similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/helpers/Generic.tsx rename to waspc/data/Generator/templates/sdk/wasp/auth/helpers/Generic.tsx diff --git a/waspc/data/Generator/templates/sdk/auth/helpers/user.ts b/waspc/data/Generator/templates/sdk/wasp/auth/helpers/user.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/helpers/user.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/helpers/user.ts diff --git a/waspc/data/Generator/templates/sdk/auth/index.ts b/waspc/data/Generator/templates/sdk/wasp/auth/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/index.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/index.ts diff --git a/waspc/data/Generator/templates/sdk/auth/jwt.ts b/waspc/data/Generator/templates/sdk/wasp/auth/jwt.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/jwt.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/jwt.ts diff --git a/waspc/data/Generator/templates/sdk/auth/login.ts b/waspc/data/Generator/templates/sdk/wasp/auth/login.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/login.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/login.ts diff --git a/waspc/data/Generator/templates/sdk/auth/logout.ts b/waspc/data/Generator/templates/sdk/wasp/auth/logout.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/logout.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/logout.ts diff --git a/waspc/data/Generator/templates/sdk/auth/lucia.ts b/waspc/data/Generator/templates/sdk/wasp/auth/lucia.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/lucia.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/lucia.ts diff --git a/waspc/data/Generator/templates/sdk/auth/password.ts b/waspc/data/Generator/templates/sdk/wasp/auth/password.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/password.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/password.ts diff --git a/waspc/data/Generator/templates/sdk/auth/providers/types.ts b/waspc/data/Generator/templates/sdk/wasp/auth/providers/types.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/providers/types.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/providers/types.ts diff --git a/waspc/data/Generator/templates/sdk/auth/session.ts b/waspc/data/Generator/templates/sdk/wasp/auth/session.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/session.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/session.ts diff --git a/waspc/data/Generator/templates/sdk/auth/signup.ts b/waspc/data/Generator/templates/sdk/wasp/auth/signup.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/signup.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/signup.ts diff --git a/waspc/data/Generator/templates/sdk/auth/types.ts b/waspc/data/Generator/templates/sdk/wasp/auth/types.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/types.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/types.ts diff --git a/waspc/data/Generator/templates/sdk/auth/useAuth.ts b/waspc/data/Generator/templates/sdk/wasp/auth/useAuth.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/useAuth.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/useAuth.ts diff --git a/waspc/data/Generator/templates/sdk/auth/user.ts b/waspc/data/Generator/templates/sdk/wasp/auth/user.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/user.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/user.ts diff --git a/waspc/data/Generator/templates/sdk/auth/utils.ts b/waspc/data/Generator/templates/sdk/wasp/auth/utils.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/utils.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/utils.ts diff --git a/waspc/data/Generator/templates/sdk/auth/validation.ts b/waspc/data/Generator/templates/sdk/wasp/auth/validation.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/auth/validation.ts rename to waspc/data/Generator/templates/sdk/wasp/auth/validation.ts diff --git a/waspc/data/Generator/templates/sdk/client/auth/email.ts b/waspc/data/Generator/templates/sdk/wasp/client/auth/email.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/auth/email.ts rename to waspc/data/Generator/templates/sdk/wasp/client/auth/email.ts diff --git a/waspc/data/Generator/templates/sdk/client/auth/github.ts b/waspc/data/Generator/templates/sdk/wasp/client/auth/github.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/auth/github.ts rename to waspc/data/Generator/templates/sdk/wasp/client/auth/github.ts diff --git a/waspc/data/Generator/templates/sdk/client/auth/google.ts b/waspc/data/Generator/templates/sdk/wasp/client/auth/google.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/auth/google.ts rename to waspc/data/Generator/templates/sdk/wasp/client/auth/google.ts diff --git a/waspc/data/Generator/templates/sdk/client/auth/index.ts b/waspc/data/Generator/templates/sdk/wasp/client/auth/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/auth/index.ts rename to waspc/data/Generator/templates/sdk/wasp/client/auth/index.ts diff --git a/waspc/data/Generator/templates/sdk/client/auth/ui.ts b/waspc/data/Generator/templates/sdk/wasp/client/auth/ui.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/auth/ui.ts rename to waspc/data/Generator/templates/sdk/wasp/client/auth/ui.ts diff --git a/waspc/data/Generator/templates/sdk/client/auth/username.ts b/waspc/data/Generator/templates/sdk/wasp/client/auth/username.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/auth/username.ts rename to waspc/data/Generator/templates/sdk/wasp/client/auth/username.ts diff --git a/waspc/data/Generator/templates/sdk/client/crud/_crud.ts b/waspc/data/Generator/templates/sdk/wasp/client/crud/_crud.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/crud/_crud.ts rename to waspc/data/Generator/templates/sdk/wasp/client/crud/_crud.ts diff --git a/waspc/data/Generator/templates/sdk/client/crud/index.ts b/waspc/data/Generator/templates/sdk/wasp/client/crud/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/crud/index.ts rename to waspc/data/Generator/templates/sdk/wasp/client/crud/index.ts diff --git a/waspc/data/Generator/templates/sdk/client/index.ts b/waspc/data/Generator/templates/sdk/wasp/client/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/index.ts rename to waspc/data/Generator/templates/sdk/wasp/client/index.ts diff --git a/waspc/data/Generator/templates/sdk/client/operations/actions/core.d.ts b/waspc/data/Generator/templates/sdk/wasp/client/operations/actions/core.d.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/operations/actions/core.d.ts rename to waspc/data/Generator/templates/sdk/wasp/client/operations/actions/core.d.ts diff --git a/waspc/data/Generator/templates/sdk/client/operations/actions/core.js b/waspc/data/Generator/templates/sdk/wasp/client/operations/actions/core.js similarity index 100% rename from waspc/data/Generator/templates/sdk/client/operations/actions/core.js rename to waspc/data/Generator/templates/sdk/wasp/client/operations/actions/core.js diff --git a/waspc/data/Generator/templates/sdk/client/operations/actions/index.ts b/waspc/data/Generator/templates/sdk/wasp/client/operations/actions/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/operations/actions/index.ts rename to waspc/data/Generator/templates/sdk/wasp/client/operations/actions/index.ts diff --git a/waspc/data/Generator/templates/sdk/client/operations/core.ts b/waspc/data/Generator/templates/sdk/wasp/client/operations/core.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/operations/core.ts rename to waspc/data/Generator/templates/sdk/wasp/client/operations/core.ts diff --git a/waspc/data/Generator/templates/sdk/client/operations/index.ts b/waspc/data/Generator/templates/sdk/wasp/client/operations/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/operations/index.ts rename to waspc/data/Generator/templates/sdk/wasp/client/operations/index.ts diff --git a/waspc/data/Generator/templates/sdk/client/operations/internal/index.ts b/waspc/data/Generator/templates/sdk/wasp/client/operations/internal/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/operations/internal/index.ts rename to waspc/data/Generator/templates/sdk/wasp/client/operations/internal/index.ts diff --git a/waspc/data/Generator/templates/sdk/client/operations/internal/resources.js b/waspc/data/Generator/templates/sdk/wasp/client/operations/internal/resources.js similarity index 100% rename from waspc/data/Generator/templates/sdk/client/operations/internal/resources.js rename to waspc/data/Generator/templates/sdk/wasp/client/operations/internal/resources.js diff --git a/waspc/data/Generator/templates/sdk/client/operations/internal/updateHandlersMap.js b/waspc/data/Generator/templates/sdk/wasp/client/operations/internal/updateHandlersMap.js similarity index 100% rename from waspc/data/Generator/templates/sdk/client/operations/internal/updateHandlersMap.js rename to waspc/data/Generator/templates/sdk/wasp/client/operations/internal/updateHandlersMap.js diff --git a/waspc/data/Generator/templates/sdk/client/operations/queries/core.d.ts b/waspc/data/Generator/templates/sdk/wasp/client/operations/queries/core.d.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/operations/queries/core.d.ts rename to waspc/data/Generator/templates/sdk/wasp/client/operations/queries/core.d.ts diff --git a/waspc/data/Generator/templates/sdk/client/operations/queries/core.js b/waspc/data/Generator/templates/sdk/wasp/client/operations/queries/core.js similarity index 100% rename from waspc/data/Generator/templates/sdk/client/operations/queries/core.js rename to waspc/data/Generator/templates/sdk/wasp/client/operations/queries/core.js diff --git a/waspc/data/Generator/templates/sdk/client/operations/queries/index.ts b/waspc/data/Generator/templates/sdk/wasp/client/operations/queries/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/operations/queries/index.ts rename to waspc/data/Generator/templates/sdk/wasp/client/operations/queries/index.ts diff --git a/waspc/data/Generator/templates/sdk/client/operations/queryClient.ts b/waspc/data/Generator/templates/sdk/wasp/client/operations/queryClient.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/operations/queryClient.ts rename to waspc/data/Generator/templates/sdk/wasp/client/operations/queryClient.ts diff --git a/waspc/data/Generator/templates/sdk/client/router/Link.tsx b/waspc/data/Generator/templates/sdk/wasp/client/router/Link.tsx similarity index 100% rename from waspc/data/Generator/templates/sdk/client/router/Link.tsx rename to waspc/data/Generator/templates/sdk/wasp/client/router/Link.tsx diff --git a/waspc/data/Generator/templates/sdk/client/router/index.ts b/waspc/data/Generator/templates/sdk/wasp/client/router/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/router/index.ts rename to waspc/data/Generator/templates/sdk/wasp/client/router/index.ts diff --git a/waspc/data/Generator/templates/sdk/client/router/linkHelpers.ts b/waspc/data/Generator/templates/sdk/wasp/client/router/linkHelpers.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/router/linkHelpers.ts rename to waspc/data/Generator/templates/sdk/wasp/client/router/linkHelpers.ts diff --git a/waspc/data/Generator/templates/sdk/client/router/types.ts b/waspc/data/Generator/templates/sdk/wasp/client/router/types.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/router/types.ts rename to waspc/data/Generator/templates/sdk/wasp/client/router/types.ts diff --git a/waspc/data/Generator/templates/sdk/client/test/index.ts b/waspc/data/Generator/templates/sdk/wasp/client/test/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/test/index.ts rename to waspc/data/Generator/templates/sdk/wasp/client/test/index.ts diff --git a/waspc/data/Generator/templates/sdk/client/test/vitest/helpers.tsx b/waspc/data/Generator/templates/sdk/wasp/client/test/vitest/helpers.tsx similarity index 100% rename from waspc/data/Generator/templates/sdk/client/test/vitest/helpers.tsx rename to waspc/data/Generator/templates/sdk/wasp/client/test/vitest/helpers.tsx diff --git a/waspc/data/Generator/templates/sdk/client/webSocket/WebSocketProvider.tsx b/waspc/data/Generator/templates/sdk/wasp/client/webSocket/WebSocketProvider.tsx similarity index 100% rename from waspc/data/Generator/templates/sdk/client/webSocket/WebSocketProvider.tsx rename to waspc/data/Generator/templates/sdk/wasp/client/webSocket/WebSocketProvider.tsx diff --git a/waspc/data/Generator/templates/sdk/client/webSocket/index.ts b/waspc/data/Generator/templates/sdk/wasp/client/webSocket/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/client/webSocket/index.ts rename to waspc/data/Generator/templates/sdk/wasp/client/webSocket/index.ts diff --git a/waspc/data/Generator/templates/sdk/core/auth.ts b/waspc/data/Generator/templates/sdk/wasp/core/auth.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/core/auth.ts rename to waspc/data/Generator/templates/sdk/wasp/core/auth.ts diff --git a/waspc/data/Generator/templates/sdk/core/config.ts b/waspc/data/Generator/templates/sdk/wasp/core/config.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/core/config.ts rename to waspc/data/Generator/templates/sdk/wasp/core/config.ts diff --git a/waspc/data/Generator/templates/sdk/core/stitches.config.ts b/waspc/data/Generator/templates/sdk/wasp/core/stitches.config.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/core/stitches.config.ts rename to waspc/data/Generator/templates/sdk/wasp/core/stitches.config.ts diff --git a/waspc/data/Generator/templates/sdk/core/storage.ts b/waspc/data/Generator/templates/sdk/wasp/core/storage.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/core/storage.ts rename to waspc/data/Generator/templates/sdk/wasp/core/storage.ts diff --git a/waspc/data/Generator/templates/sdk/dev/index.ts b/waspc/data/Generator/templates/sdk/wasp/dev/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/dev/index.ts rename to waspc/data/Generator/templates/sdk/wasp/dev/index.ts diff --git a/waspc/data/Generator/templates/sdk/entities/index.ts b/waspc/data/Generator/templates/sdk/wasp/entities/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/entities/index.ts rename to waspc/data/Generator/templates/sdk/wasp/entities/index.ts diff --git a/waspc/data/Generator/templates/sdk/package.json b/waspc/data/Generator/templates/sdk/wasp/package.json similarity index 100% rename from waspc/data/Generator/templates/sdk/package.json rename to waspc/data/Generator/templates/sdk/wasp/package.json diff --git a/waspc/data/Generator/templates/sdk/server/HttpError.ts b/waspc/data/Generator/templates/sdk/wasp/server/HttpError.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/HttpError.ts rename to waspc/data/Generator/templates/sdk/wasp/server/HttpError.ts diff --git a/waspc/data/Generator/templates/sdk/server/_types/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/_types/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/_types/index.ts rename to waspc/data/Generator/templates/sdk/wasp/server/_types/index.ts diff --git a/waspc/data/Generator/templates/sdk/server/_types/serialization.ts b/waspc/data/Generator/templates/sdk/wasp/server/_types/serialization.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/_types/serialization.ts rename to waspc/data/Generator/templates/sdk/wasp/server/_types/serialization.ts diff --git a/waspc/data/Generator/templates/sdk/server/_types/taggedEntities.ts b/waspc/data/Generator/templates/sdk/wasp/server/_types/taggedEntities.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/_types/taggedEntities.ts rename to waspc/data/Generator/templates/sdk/wasp/server/_types/taggedEntities.ts diff --git a/waspc/data/Generator/templates/sdk/server/api/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/api/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/api/index.ts rename to waspc/data/Generator/templates/sdk/wasp/server/api/index.ts diff --git a/waspc/data/Generator/templates/sdk/server/auth/email/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/auth/email/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/auth/email/index.ts rename to waspc/data/Generator/templates/sdk/wasp/server/auth/email/index.ts diff --git a/waspc/data/Generator/templates/sdk/server/auth/email/utils.ts b/waspc/data/Generator/templates/sdk/wasp/server/auth/email/utils.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/auth/email/utils.ts rename to waspc/data/Generator/templates/sdk/wasp/server/auth/email/utils.ts diff --git a/waspc/data/Generator/templates/sdk/server/auth/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/auth/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/auth/index.ts rename to waspc/data/Generator/templates/sdk/wasp/server/auth/index.ts diff --git a/waspc/data/Generator/templates/sdk/server/auth/username.ts b/waspc/data/Generator/templates/sdk/wasp/server/auth/username.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/auth/username.ts rename to waspc/data/Generator/templates/sdk/wasp/server/auth/username.ts diff --git a/waspc/data/Generator/templates/sdk/server/config.ts b/waspc/data/Generator/templates/sdk/wasp/server/config.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/config.ts rename to waspc/data/Generator/templates/sdk/wasp/server/config.ts diff --git a/waspc/data/Generator/templates/sdk/server/crud/_operationTypes.ts b/waspc/data/Generator/templates/sdk/wasp/server/crud/_operationTypes.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/crud/_operationTypes.ts rename to waspc/data/Generator/templates/sdk/wasp/server/crud/_operationTypes.ts diff --git a/waspc/data/Generator/templates/sdk/server/crud/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/crud/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/crud/index.ts rename to waspc/data/Generator/templates/sdk/wasp/server/crud/index.ts diff --git a/waspc/data/Generator/templates/sdk/server/dbClient.ts b/waspc/data/Generator/templates/sdk/wasp/server/dbClient.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/dbClient.ts rename to waspc/data/Generator/templates/sdk/wasp/server/dbClient.ts diff --git a/waspc/data/Generator/templates/sdk/server/email/core/helpers.ts b/waspc/data/Generator/templates/sdk/wasp/server/email/core/helpers.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/email/core/helpers.ts rename to waspc/data/Generator/templates/sdk/wasp/server/email/core/helpers.ts diff --git a/waspc/data/Generator/templates/sdk/server/email/core/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/email/core/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/email/core/index.ts rename to waspc/data/Generator/templates/sdk/wasp/server/email/core/index.ts diff --git a/waspc/data/Generator/templates/sdk/server/email/core/providers/dummy.ts b/waspc/data/Generator/templates/sdk/wasp/server/email/core/providers/dummy.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/email/core/providers/dummy.ts rename to waspc/data/Generator/templates/sdk/wasp/server/email/core/providers/dummy.ts diff --git a/waspc/data/Generator/templates/sdk/server/email/core/providers/mailgun.ts b/waspc/data/Generator/templates/sdk/wasp/server/email/core/providers/mailgun.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/email/core/providers/mailgun.ts rename to waspc/data/Generator/templates/sdk/wasp/server/email/core/providers/mailgun.ts diff --git a/waspc/data/Generator/templates/sdk/server/email/core/providers/sendgrid.ts b/waspc/data/Generator/templates/sdk/wasp/server/email/core/providers/sendgrid.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/email/core/providers/sendgrid.ts rename to waspc/data/Generator/templates/sdk/wasp/server/email/core/providers/sendgrid.ts diff --git a/waspc/data/Generator/templates/sdk/server/email/core/providers/smtp.ts b/waspc/data/Generator/templates/sdk/wasp/server/email/core/providers/smtp.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/email/core/providers/smtp.ts rename to waspc/data/Generator/templates/sdk/wasp/server/email/core/providers/smtp.ts diff --git a/waspc/data/Generator/templates/sdk/server/email/core/types.ts b/waspc/data/Generator/templates/sdk/wasp/server/email/core/types.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/email/core/types.ts rename to waspc/data/Generator/templates/sdk/wasp/server/email/core/types.ts diff --git a/waspc/data/Generator/templates/sdk/server/email/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/email/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/email/index.ts rename to waspc/data/Generator/templates/sdk/wasp/server/email/index.ts diff --git a/waspc/data/Generator/templates/sdk/server/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/index.ts rename to waspc/data/Generator/templates/sdk/wasp/server/index.ts diff --git a/waspc/data/Generator/templates/sdk/server/jobs/_job.ts b/waspc/data/Generator/templates/sdk/wasp/server/jobs/_job.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/jobs/_job.ts rename to waspc/data/Generator/templates/sdk/wasp/server/jobs/_job.ts diff --git a/waspc/data/Generator/templates/sdk/server/jobs/core/job.ts b/waspc/data/Generator/templates/sdk/wasp/server/jobs/core/job.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/jobs/core/job.ts rename to waspc/data/Generator/templates/sdk/wasp/server/jobs/core/job.ts diff --git a/waspc/data/Generator/templates/sdk/server/jobs/core/pgBoss/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/jobs/core/pgBoss/index.ts rename to waspc/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/index.ts diff --git a/waspc/data/Generator/templates/sdk/server/jobs/core/pgBoss/pgBoss.ts b/waspc/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/jobs/core/pgBoss/pgBoss.ts rename to waspc/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts diff --git a/waspc/data/Generator/templates/sdk/server/jobs/core/pgBoss/pgBossJob.ts b/waspc/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/jobs/core/pgBoss/pgBossJob.ts rename to waspc/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts diff --git a/waspc/data/Generator/templates/sdk/server/jobs/core/pgBoss/types.ts b/waspc/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/types.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/jobs/core/pgBoss/types.ts rename to waspc/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/types.ts diff --git a/waspc/data/Generator/templates/sdk/server/jobs/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/jobs/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/jobs/index.ts rename to waspc/data/Generator/templates/sdk/wasp/server/jobs/index.ts diff --git a/waspc/data/Generator/templates/sdk/server/middleware/globalMiddleware.ts b/waspc/data/Generator/templates/sdk/wasp/server/middleware/globalMiddleware.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/middleware/globalMiddleware.ts rename to waspc/data/Generator/templates/sdk/wasp/server/middleware/globalMiddleware.ts diff --git a/waspc/data/Generator/templates/sdk/server/middleware/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/middleware/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/middleware/index.ts rename to waspc/data/Generator/templates/sdk/wasp/server/middleware/index.ts diff --git a/waspc/data/Generator/templates/sdk/server/operations/actions/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/operations/actions/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/operations/actions/index.ts rename to waspc/data/Generator/templates/sdk/wasp/server/operations/actions/index.ts diff --git a/waspc/data/Generator/templates/sdk/server/operations/actions/types.ts b/waspc/data/Generator/templates/sdk/wasp/server/operations/actions/types.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/operations/actions/types.ts rename to waspc/data/Generator/templates/sdk/wasp/server/operations/actions/types.ts diff --git a/waspc/data/Generator/templates/sdk/server/operations/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/operations/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/operations/index.ts rename to waspc/data/Generator/templates/sdk/wasp/server/operations/index.ts diff --git a/waspc/data/Generator/templates/sdk/server/operations/queries/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/operations/queries/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/operations/queries/index.ts rename to waspc/data/Generator/templates/sdk/wasp/server/operations/queries/index.ts diff --git a/waspc/data/Generator/templates/sdk/server/operations/queries/types.ts b/waspc/data/Generator/templates/sdk/wasp/server/operations/queries/types.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/operations/queries/types.ts rename to waspc/data/Generator/templates/sdk/wasp/server/operations/queries/types.ts diff --git a/waspc/data/Generator/templates/sdk/server/types/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/types/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/types/index.ts rename to waspc/data/Generator/templates/sdk/wasp/server/types/index.ts diff --git a/waspc/data/Generator/templates/sdk/server/utils.ts b/waspc/data/Generator/templates/sdk/wasp/server/utils.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/utils.ts rename to waspc/data/Generator/templates/sdk/wasp/server/utils.ts diff --git a/waspc/data/Generator/templates/sdk/server/webSocket/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/webSocket/index.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/server/webSocket/index.ts rename to waspc/data/Generator/templates/sdk/wasp/server/webSocket/index.ts diff --git a/waspc/data/Generator/templates/sdk/tsconfig.json b/waspc/data/Generator/templates/sdk/wasp/tsconfig.json similarity index 100% rename from waspc/data/Generator/templates/sdk/tsconfig.json rename to waspc/data/Generator/templates/sdk/wasp/tsconfig.json diff --git a/waspc/data/Generator/templates/sdk/universal/types.ts b/waspc/data/Generator/templates/sdk/wasp/universal/types.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/universal/types.ts rename to waspc/data/Generator/templates/sdk/wasp/universal/types.ts diff --git a/waspc/data/Generator/templates/sdk/universal/url.ts b/waspc/data/Generator/templates/sdk/wasp/universal/url.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/universal/url.ts rename to waspc/data/Generator/templates/sdk/wasp/universal/url.ts diff --git a/waspc/data/Generator/templates/sdk/universal/validators.ts b/waspc/data/Generator/templates/sdk/wasp/universal/validators.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/universal/validators.ts rename to waspc/data/Generator/templates/sdk/wasp/universal/validators.ts diff --git a/waspc/data/Generator/templates/sdk/vite-env.d.ts b/waspc/data/Generator/templates/sdk/wasp/vite-env.d.ts similarity index 100% rename from waspc/data/Generator/templates/sdk/vite-env.d.ts rename to waspc/data/Generator/templates/sdk/wasp/vite-env.d.ts diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest b/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest index b1c17f1d5..2e19f40aa 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest @@ -3,6 +3,187 @@ waspBuild/.wasp/build/.waspchecksums waspBuild/.wasp/build/Dockerfile waspBuild/.wasp/build/db/schema.prisma waspBuild/.wasp/build/installedNpmDepsLog.json +waspBuild/.wasp/build/package.json +waspBuild/.wasp/build/sdk/wasp/api/events.ts +waspBuild/.wasp/build/sdk/wasp/api/index.ts +waspBuild/.wasp/build/sdk/wasp/client/index.ts +waspBuild/.wasp/build/sdk/wasp/client/operations/actions/core.d.ts +waspBuild/.wasp/build/sdk/wasp/client/operations/actions/core.js +waspBuild/.wasp/build/sdk/wasp/client/operations/actions/index.ts +waspBuild/.wasp/build/sdk/wasp/client/operations/core.ts +waspBuild/.wasp/build/sdk/wasp/client/operations/index.ts +waspBuild/.wasp/build/sdk/wasp/client/operations/internal/index.ts +waspBuild/.wasp/build/sdk/wasp/client/operations/internal/resources.js +waspBuild/.wasp/build/sdk/wasp/client/operations/internal/updateHandlersMap.js +waspBuild/.wasp/build/sdk/wasp/client/operations/queries/core.d.ts +waspBuild/.wasp/build/sdk/wasp/client/operations/queries/core.js +waspBuild/.wasp/build/sdk/wasp/client/operations/queries/index.ts +waspBuild/.wasp/build/sdk/wasp/client/operations/queryClient.ts +waspBuild/.wasp/build/sdk/wasp/client/router/Link.tsx +waspBuild/.wasp/build/sdk/wasp/client/router/index.ts +waspBuild/.wasp/build/sdk/wasp/client/router/linkHelpers.ts +waspBuild/.wasp/build/sdk/wasp/client/router/types.ts +waspBuild/.wasp/build/sdk/wasp/client/test/index.ts +waspBuild/.wasp/build/sdk/wasp/client/test/vitest/helpers.tsx +waspBuild/.wasp/build/sdk/wasp/core/config.ts +waspBuild/.wasp/build/sdk/wasp/core/storage.ts +waspBuild/.wasp/build/sdk/wasp/dev/index.ts +waspBuild/.wasp/build/sdk/wasp/dist/api/events.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/api/events.js +waspBuild/.wasp/build/sdk/wasp/dist/api/events.js.map +waspBuild/.wasp/build/sdk/wasp/dist/api/index.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/api/index.js +waspBuild/.wasp/build/sdk/wasp/dist/api/index.js.map +waspBuild/.wasp/build/sdk/wasp/dist/client/index.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/client/index.js +waspBuild/.wasp/build/sdk/wasp/dist/client/index.js.map +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/core.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/core.js +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/core.js.map +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/index.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/index.js +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/index.js.map +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/core.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/core.js +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/core.js.map +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/index.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/index.js +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/index.js.map +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.js +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.js.map +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/resources.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/resources.js +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/resources.js.map +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/core.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/core.js +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/core.js.map +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/index.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/index.js +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/index.js.map +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queryClient.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queryClient.js +waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queryClient.js.map +waspBuild/.wasp/build/sdk/wasp/dist/client/router/Link.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/client/router/Link.jsx +waspBuild/.wasp/build/sdk/wasp/dist/client/router/Link.jsx.map +waspBuild/.wasp/build/sdk/wasp/dist/client/router/index.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/client/router/index.js +waspBuild/.wasp/build/sdk/wasp/dist/client/router/index.js.map +waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.js +waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.js.map +waspBuild/.wasp/build/sdk/wasp/dist/client/router/types.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/client/router/types.js +waspBuild/.wasp/build/sdk/wasp/dist/client/router/types.js.map +waspBuild/.wasp/build/sdk/wasp/dist/client/test/index.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/client/test/index.js +waspBuild/.wasp/build/sdk/wasp/dist/client/test/index.js.map +waspBuild/.wasp/build/sdk/wasp/dist/client/test/vitest/helpers.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/client/test/vitest/helpers.jsx +waspBuild/.wasp/build/sdk/wasp/dist/client/test/vitest/helpers.jsx.map +waspBuild/.wasp/build/sdk/wasp/dist/core/config.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/core/config.js +waspBuild/.wasp/build/sdk/wasp/dist/core/config.js.map +waspBuild/.wasp/build/sdk/wasp/dist/core/storage.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/core/storage.js +waspBuild/.wasp/build/sdk/wasp/dist/core/storage.js.map +waspBuild/.wasp/build/sdk/wasp/dist/dev/index.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/dev/index.js +waspBuild/.wasp/build/sdk/wasp/dist/dev/index.js.map +waspBuild/.wasp/build/sdk/wasp/dist/entities/index.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/entities/index.js +waspBuild/.wasp/build/sdk/wasp/dist/entities/index.js.map +waspBuild/.wasp/build/sdk/wasp/dist/ext-src/MainPage.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/ext-src/MainPage.jsx +waspBuild/.wasp/build/sdk/wasp/dist/ext-src/MainPage.jsx.map +waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js +waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js.map +waspBuild/.wasp/build/sdk/wasp/dist/server/_types/index.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/server/_types/index.js +waspBuild/.wasp/build/sdk/wasp/dist/server/_types/index.js.map +waspBuild/.wasp/build/sdk/wasp/dist/server/_types/serialization.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/server/_types/serialization.js +waspBuild/.wasp/build/sdk/wasp/dist/server/_types/serialization.js.map +waspBuild/.wasp/build/sdk/wasp/dist/server/_types/taggedEntities.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/server/_types/taggedEntities.js +waspBuild/.wasp/build/sdk/wasp/dist/server/_types/taggedEntities.js.map +waspBuild/.wasp/build/sdk/wasp/dist/server/config.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/server/config.js +waspBuild/.wasp/build/sdk/wasp/dist/server/config.js.map +waspBuild/.wasp/build/sdk/wasp/dist/server/dbClient.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/server/dbClient.js +waspBuild/.wasp/build/sdk/wasp/dist/server/dbClient.js.map +waspBuild/.wasp/build/sdk/wasp/dist/server/index.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/server/index.js +waspBuild/.wasp/build/sdk/wasp/dist/server/index.js.map +waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/globalMiddleware.js +waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/globalMiddleware.js.map +waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/index.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/index.js +waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/index.js.map +waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/index.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/index.js +waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/index.js.map +waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/types.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/types.js +waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/types.js.map +waspBuild/.wasp/build/sdk/wasp/dist/server/operations/index.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/server/operations/index.js +waspBuild/.wasp/build/sdk/wasp/dist/server/operations/index.js.map +waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/index.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/index.js +waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/index.js.map +waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/types.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/types.js +waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/types.js.map +waspBuild/.wasp/build/sdk/wasp/dist/server/types/index.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/server/types/index.js +waspBuild/.wasp/build/sdk/wasp/dist/server/types/index.js.map +waspBuild/.wasp/build/sdk/wasp/dist/server/utils.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/server/utils.js +waspBuild/.wasp/build/sdk/wasp/dist/server/utils.js.map +waspBuild/.wasp/build/sdk/wasp/dist/universal/types.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/universal/types.js +waspBuild/.wasp/build/sdk/wasp/dist/universal/types.js.map +waspBuild/.wasp/build/sdk/wasp/dist/universal/url.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/universal/url.js +waspBuild/.wasp/build/sdk/wasp/dist/universal/url.js.map +waspBuild/.wasp/build/sdk/wasp/dist/universal/validators.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/universal/validators.js +waspBuild/.wasp/build/sdk/wasp/dist/universal/validators.js.map +waspBuild/.wasp/build/sdk/wasp/entities/index.ts +waspBuild/.wasp/build/sdk/wasp/ext-src/Main.css +waspBuild/.wasp/build/sdk/wasp/ext-src/MainPage.jsx +waspBuild/.wasp/build/sdk/wasp/ext-src/vite-env.d.ts +waspBuild/.wasp/build/sdk/wasp/ext-src/waspLogo.png +waspBuild/.wasp/build/sdk/wasp/package.json +waspBuild/.wasp/build/sdk/wasp/server/HttpError.ts +waspBuild/.wasp/build/sdk/wasp/server/_types/index.ts +waspBuild/.wasp/build/sdk/wasp/server/_types/serialization.ts +waspBuild/.wasp/build/sdk/wasp/server/_types/taggedEntities.ts +waspBuild/.wasp/build/sdk/wasp/server/config.ts +waspBuild/.wasp/build/sdk/wasp/server/dbClient.ts +waspBuild/.wasp/build/sdk/wasp/server/index.ts +waspBuild/.wasp/build/sdk/wasp/server/middleware/globalMiddleware.ts +waspBuild/.wasp/build/sdk/wasp/server/middleware/index.ts +waspBuild/.wasp/build/sdk/wasp/server/operations/actions/index.ts +waspBuild/.wasp/build/sdk/wasp/server/operations/actions/types.ts +waspBuild/.wasp/build/sdk/wasp/server/operations/index.ts +waspBuild/.wasp/build/sdk/wasp/server/operations/queries/index.ts +waspBuild/.wasp/build/sdk/wasp/server/operations/queries/types.ts +waspBuild/.wasp/build/sdk/wasp/server/types/index.ts +waspBuild/.wasp/build/sdk/wasp/server/utils.ts +waspBuild/.wasp/build/sdk/wasp/tsconfig.json +waspBuild/.wasp/build/sdk/wasp/universal/types.ts +waspBuild/.wasp/build/sdk/wasp/universal/url.ts +waspBuild/.wasp/build/sdk/wasp/universal/validators.ts +waspBuild/.wasp/build/sdk/wasp/vite-env.d.ts waspBuild/.wasp/build/server/.npmrc waspBuild/.wasp/build/server/README.md waspBuild/.wasp/build/server/nodemon.json @@ -20,6 +201,10 @@ waspBuild/.wasp/build/server/src/routes/index.js waspBuild/.wasp/build/server/src/routes/operations/index.js waspBuild/.wasp/build/server/src/server.ts waspBuild/.wasp/build/server/tsconfig.json +waspBuild/.wasp/build/src/Main.css +waspBuild/.wasp/build/src/MainPage.jsx +waspBuild/.wasp/build/src/vite-env.d.ts +waspBuild/.wasp/build/src/waspLogo.png waspBuild/.wasp/build/web-app/.npmrc waspBuild/.wasp/build/web-app/README.md waspBuild/.wasp/build/web-app/index.html diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums index a63bd58ac..6607cfe52 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums @@ -368,7 +368,7 @@ "file", "Dockerfile" ], - "ab6bdf75fb4a56816d65231773dcce1f7133b18da6803f2b035f35bf124ea1c0" + "8851d4e81582d58921a5646dcf063b31dbf8ce9a46f3d4710360d2047dc644b5" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/Dockerfile b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/Dockerfile index ffc14b90b..44152eecd 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/Dockerfile +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/Dockerfile @@ -32,8 +32,8 @@ WORKDIR /app COPY src ./src COPY package.json . COPY package-lock.json . -COPY .wasp/build/server .wasp/build/server -COPY .wasp/out/sdk .wasp/out/sdk +COPY server .wasp/build/server +COPY sdk .wasp/out/sdk # Install npm packages, resulting in node_modules/. RUN npm install && cd .wasp/build/server && npm install # Building the server should come after Prisma generation. @@ -59,7 +59,7 @@ COPY --from=server-builder /app/.wasp/build/server/node_modules .wasp/build/serv COPY --from=server-builder /app/.wasp/build/server/bundle .wasp/build/server/bundle COPY --from=server-builder /app/.wasp/build/server/package*.json .wasp/build/server/ COPY --from=server-builder /app/.wasp/build/server/scripts .wasp/build/server/scripts -COPY .wasp/build/db/ .wasp/build/db/ +COPY db/ .wasp/build/db/ EXPOSE ${PORT} WORKDIR /app/.wasp/build/server ENTRYPOINT ["npm", "run", "start-production"] diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/package.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/package.json new file mode 100644 index 000000000..36fbb8fcd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/package.json @@ -0,0 +1,13 @@ +{ + "dependencies": { + "react": "^18.2.0", + "wasp": "file:.wasp/out/sdk/wasp" + }, + "devDependencies": { + "@types/react": "^18.0.37", + "prisma": "4.16.2", + "typescript": "^5.1.0", + "vite": "^4.3.9" + }, + "name": "waspBuild" +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/api/events.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/api/events.ts new file mode 100644 index 000000000..a72e48dda --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/api/events.ts @@ -0,0 +1,11 @@ +import mitt, { Emitter } from 'mitt'; + +type ApiEvents = { + // key: Event name + // type: Event payload type + 'sessionId.set': void; + 'sessionId.clear': void; +}; + +// Used to allow API clients to register for auth session ID change events. +export const apiEventsEmitter: Emitter = mitt(); diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/api/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/api/index.ts new file mode 100644 index 000000000..d066bd544 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/api/index.ts @@ -0,0 +1,108 @@ +import axios, { type AxiosError } from 'axios' + +import config from 'wasp/core/config' +import { storage } from 'wasp/core/storage' +import { apiEventsEmitter } from './events.js' + +// PUBLIC API +export const api = axios.create({ + baseURL: config.apiUrl, +}) + +const WASP_APP_AUTH_SESSION_ID_NAME = 'sessionId' + +let waspAppAuthSessionId = storage.get(WASP_APP_AUTH_SESSION_ID_NAME) as string | undefined + +// PRIVATE API (sdk) +export function setSessionId(sessionId: string): void { + waspAppAuthSessionId = sessionId + storage.set(WASP_APP_AUTH_SESSION_ID_NAME, sessionId) + apiEventsEmitter.emit('sessionId.set') +} + +// PRIVATE API (sdk) +export function getSessionId(): string | undefined { + return waspAppAuthSessionId +} + +// PRIVATE API (sdk) +export function clearSessionId(): void { + waspAppAuthSessionId = undefined + storage.remove(WASP_APP_AUTH_SESSION_ID_NAME) + apiEventsEmitter.emit('sessionId.clear') +} + +// PRIVATE API (sdk) +export function removeLocalUserData(): void { + waspAppAuthSessionId = undefined + storage.clear() + apiEventsEmitter.emit('sessionId.clear') +} + +api.interceptors.request.use((request) => { + const sessionId = getSessionId() + if (sessionId) { + request.headers['Authorization'] = `Bearer ${sessionId}` + } + return request +}) + +api.interceptors.response.use(undefined, (error) => { + if (error.response?.status === 401) { + clearSessionId() + } + return Promise.reject(error) +}) + +// This handler will run on other tabs (not the active one calling API functions), +// and will ensure they know about auth session ID changes. +// Ref: https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event +// "Note: This won't work on the same page that is making the changes — it is really a way +// for other pages on the domain using the storage to sync any changes that are made." +window.addEventListener('storage', (event) => { + if (event.key === storage.getPrefixedKey(WASP_APP_AUTH_SESSION_ID_NAME)) { + if (!!event.newValue) { + waspAppAuthSessionId = event.newValue + apiEventsEmitter.emit('sessionId.set') + } else { + waspAppAuthSessionId = undefined + apiEventsEmitter.emit('sessionId.clear') + } + } +}) + +// PRIVATE API (sdk) +/** + * Takes an error returned by the app's API (as returned by axios), and transforms into a more + * standard format to be further used by the client. It is also assumed that given API + * error has been formatted as implemented by HttpError on the server. + */ +export function handleApiError(error: AxiosError<{ message?: string, data?: unknown }>): void { + if (error?.response) { + // If error came from HTTP response, we capture most informative message + // and also add .statusCode information to it. + // If error had JSON response, we assume it is of format { message, data } and + // add that info to the error. + // TODO: We might want to use HttpError here instead of just Error, since + // HttpError is also used on server to throw errors like these. + // That would require copying HttpError code to web-app also and using it here. + const responseJson = error.response?.data + const responseStatusCode = error.response.status + throw new WaspHttpError(responseStatusCode, responseJson?.message ?? error.message, responseJson) + } else { + // If any other error, we just propagate it. + throw error + } +} + +class WaspHttpError extends Error { + statusCode: number + + data: unknown + + constructor (statusCode: number, message: string, data: unknown) { + super(message) + this.statusCode = statusCode + this.data = data + } +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/index.ts new file mode 100644 index 000000000..197271394 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/index.ts @@ -0,0 +1,11 @@ +// PUBLIC API +// NOTE: This is enough to cover Operations and our APIs (src/Wasp/AppSpec/Api.hs). +export enum HttpMethod { + Get = 'GET', + Post = 'POST', + Put = 'PUT', + Delete = 'DELETE', +} + +// PUBLIC API +export type Route = { method: HttpMethod; path: string } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/actions/core.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/actions/core.d.ts new file mode 100644 index 000000000..894c01f91 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/actions/core.d.ts @@ -0,0 +1,14 @@ +import { type Action } from '../core.js' +import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types' + +// PRIVATE API +export function createAction( + actionRoute: string, + entitiesUsed: unknown[] +): ActionFor + +type ActionFor = Expand< + Action[0], _Awaited<_ReturnType>> +> + +type GenericBackendAction = (args: never, context: any) => unknown diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/actions/core.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/actions/core.js new file mode 100644 index 000000000..17dd6aba4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/actions/core.js @@ -0,0 +1,36 @@ +import { callOperation, makeOperationRoute } from '../internal/index.js' +import { + registerActionInProgress, + registerActionDone, +} from '../internal/resources.js' + +// PRIVATE API +export function createAction(relativeActionRoute, entitiesUsed) { + const actionRoute = makeOperationRoute(relativeActionRoute) + + async function internalAction(args, specificOptimisticUpdateDefinitions) { + registerActionInProgress(specificOptimisticUpdateDefinitions) + try { + // The `return await` is not redundant here. If we removed the await, the + // `finally` block would execute before the action finishes, prematurely + // registering the action as done. + return await callOperation(actionRoute, args) + } finally { + await registerActionDone(entitiesUsed, specificOptimisticUpdateDefinitions) + } + } + + // We expose (and document) a restricted version of the API for our users, + // while also attaching the full "internal" API to the exposed action. By + // doing this, we can easily use the internal API of an action a users passes + // into our system (e.g., through the `useAction` hook) without needing a + // lookup table. + // + // While it does technically allow our users to access the interal API, it + // shouldn't be a problem in practice. Still, if it turns out to be a problem, + // we can always hide it using a Symbol. + const action = (args) => internalAction(args, []) + action.internal = internalAction + + return action +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/actions/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/actions/index.ts new file mode 100644 index 000000000..32207e1a6 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/actions/index.ts @@ -0,0 +1 @@ +import { createAction } from './core' diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/core.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/core.ts new file mode 100644 index 000000000..282c4698a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/core.ts @@ -0,0 +1,346 @@ +import { + QueryClient, + QueryKey, + useMutation, + UseMutationOptions, + useQueryClient, + useQuery as rqUseQuery, + UseQueryResult, +} from "@tanstack/react-query"; +export { configureQueryClient } from "./queryClient"; + +// PRIVATE API (but should maybe be public, users use values of this type) +export type Query = { + (queryCacheKey: string[], args: Input): Promise; +}; + +// PUBLIC API +export function useQuery( + queryFn: Query, + queryFnArgs?: Input, + options?: any +): UseQueryResult; + +// PUBLIC API +export function useQuery(queryFn, queryFnArgs, options) { + if (typeof queryFn !== "function") { + throw new TypeError("useQuery requires queryFn to be a function."); + } + if (!queryFn.queryCacheKey) { + throw new TypeError( + "queryFn needs to have queryCacheKey property defined." + ); + } + + const queryKey = + queryFnArgs !== undefined + ? [...queryFn.queryCacheKey, queryFnArgs] + : queryFn.queryCacheKey; + return rqUseQuery({ + queryKey, + queryFn: () => queryFn(queryKey, queryFnArgs), + ...options, + }); +} + +// PRIVATE API (but should maybe be public, users use values of this type) +export type Action = [Input] extends [never] + ? (args?: unknown) => Promise + : (args: Input) => Promise; + +// PRIVATE API (but should maybe be public, users define values of this type) +/** + * An options object passed into the `useAction` hook and used to enhance the + * action with extra options. + * + */ +export type ActionOptions = { + optimisticUpdates: OptimisticUpdateDefinition[]; +}; + +// PUBLIC API +/** + * A documented (public) way to define optimistic updates. + */ +export type OptimisticUpdateDefinition = { + getQuerySpecifier: GetQuerySpecifier; + updateQuery: UpdateQuery; +}; + +// PRIVATE API (but should maybe be public, users define values of this type) +/** + * A function that takes an item and returns a Wasp Query specifier. + */ +export type GetQuerySpecifier = ( + item: ActionInput +) => QuerySpecifier; + +// PRIVATE API (but should maybe be public, users define values of this type) +/** + * A function that takes an item and the previous state of the cache, and returns + * the desired (new) state of the cache. + */ +export type UpdateQuery = ( + item: ActionInput, + oldData: CachedData | undefined +) => CachedData; + +// PRIVATE API (but should maybe be public, users define values of this type) +/** + * A public query specifier used for addressing Wasp queries. See our docs for details: + * https://wasp-lang.dev/docs/language/features#the-useaction-hook. + */ +export type QuerySpecifier = [Query, ...any[]]; + +// PUBLIC API +/** + * A hook for adding extra behavior to a Wasp Action (e.g., optimistic updates). + * + * @param actionFn The Wasp Action you wish to enhance/decorate. + * @param actionOptions An options object for enhancing/decorating the given Action. + * @returns A decorated Action with added behavior but an unchanged API. + */ +export function useAction( + actionFn: Action, + actionOptions?: ActionOptions +): typeof actionFn { + const queryClient = useQueryClient(); + + let mutationFn = actionFn; + let options = {}; + if (actionOptions?.optimisticUpdates) { + const optimisticUpdatesDefinitions = actionOptions.optimisticUpdates.map( + translateToInternalDefinition + ); + mutationFn = makeOptimisticUpdateMutationFn( + actionFn, + optimisticUpdatesDefinitions + ); + options = makeRqOptimisticUpdateOptions( + queryClient, + optimisticUpdatesDefinitions + ); + } + + // NOTE: We decided to hide React Query's extra mutation features (e.g., + // isLoading, onSuccess and onError callbacks, synchronous mutate) and only + // expose a simple async function whose API matches the original Action. + // We did this to avoid cluttering the API with stuff we're not sure we need + // yet (e.g., isLoading), to postpone the action vs mutation dilemma, and to + // clearly separate our opinionated API from React Query's lower-level + // advanced API (which users can also use) + const mutation = useMutation(mutationFn, options); + return (args) => mutation.mutateAsync(args); +} + +/** + * An internal (undocumented, private, desugared) way of defining optimistic updates. + */ +type InternalOptimisticUpdateDefinition = { + getQueryKey: (item: ActionInput) => QueryKey; + updateQuery: UpdateQuery; +}; + +/** + * An UpdateQuery function "instantiated" with a specific item. It only takes + * the current state of the cache and returns the desired (new) state of the + * cache. + */ +type SpecificUpdateQuery = (oldData: CachedData) => CachedData; + +/** + * A specific, "instantiated" optimistic update definition which contains a + * fully-constructed query key and a specific update function. + */ +type SpecificOptimisticUpdateDefinition = { + queryKey: QueryKey; + updateQuery: SpecificUpdateQuery; +}; + +type InternalAction = Action & { + internal( + item: Input, + optimisticUpdateDefinitions: SpecificOptimisticUpdateDefinition[] + ): Promise; +}; + +/** + * Translates/Desugars a public optimistic update definition object into a + * definition object our system uses internally. + * + * @param publicOptimisticUpdateDefinition An optimistic update definition + * object that's a part of the public API: + * https://wasp-lang.dev/docs/language/features#the-useaction-hook. + * @returns An internally-used optimistic update definition object. + */ +function translateToInternalDefinition( + publicOptimisticUpdateDefinition: OptimisticUpdateDefinition +): InternalOptimisticUpdateDefinition { + const { getQuerySpecifier, updateQuery } = publicOptimisticUpdateDefinition; + + const definitionErrors = []; + if (typeof getQuerySpecifier !== "function") { + definitionErrors.push("`getQuerySpecifier` is not a function."); + } + if (typeof updateQuery !== "function") { + definitionErrors.push("`updateQuery` is not a function."); + } + if (definitionErrors.length) { + throw new TypeError( + `Invalid optimistic update definition: ${definitionErrors.join(", ")}.` + ); + } + + return { + getQueryKey: (item) => getRqQueryKeyFromSpecifier(getQuerySpecifier(item)), + updateQuery, + }; +} + +/** + * Creates a function that performs an action while telling it about the + * optimistic updates it caused. + * + * @param actionFn The Wasp Action. + * @param optimisticUpdateDefinitions The optimisitc updates the action causes. + * @returns An decorated action which performs optimistic updates. + */ +function makeOptimisticUpdateMutationFn( + actionFn: Action, + optimisticUpdateDefinitions: InternalOptimisticUpdateDefinition< + Input, + CachedData + >[] +): typeof actionFn { + return function performActionWithOptimisticUpdates(item) { + const specificOptimisticUpdateDefinitions = optimisticUpdateDefinitions.map( + (generalDefinition) => + getOptimisticUpdateDefinitionForSpecificItem(generalDefinition, item) + ); + return (actionFn as InternalAction).internal( + item, + specificOptimisticUpdateDefinitions + ); + }; +} + +/** + * Given a ReactQuery query client and our internal definition of optimistic + * updates, this function constructs an object describing those same optimistic + * updates in a format we can pass into React Query's useMutation hook. In other + * words, it translates our optimistic updates definition into React Query's + * optimistic updates definition. Check their docs for details: + * https://tanstack.com/query/v4/docs/guides/optimistic-updates?from=reactQueryV3&original=https://react-query-v3.tanstack.com/guides/optimistic-updates + * + * @param queryClient The QueryClient instance used by React Query. + * @param optimisticUpdateDefinitions A list containing internal optimistic + * updates definition objects (i.e., a list where each object carries the + * instructions for performing particular optimistic update). + * @returns An object containing 'onMutate' and 'onError' functions + * corresponding to the given optimistic update definitions (check the docs + * linked above for details). + */ +function makeRqOptimisticUpdateOptions( + queryClient: QueryClient, + optimisticUpdateDefinitions: InternalOptimisticUpdateDefinition< + ActionInput, + CachedData + >[] +): Pick { + async function onMutate(item) { + const specificOptimisticUpdateDefinitions = optimisticUpdateDefinitions.map( + (generalDefinition) => + getOptimisticUpdateDefinitionForSpecificItem(generalDefinition, item) + ); + + // Cancel any outgoing refetches (so they don't overwrite our optimistic update). + // Theoretically, we can be a bit faster. Instead of awaiting the + // cancellation of all queries, we could cancel and update them in parallel. + // However, awaiting cancellation hasn't yet proven to be a performance bottleneck. + await Promise.all( + specificOptimisticUpdateDefinitions.map(({ queryKey }) => + queryClient.cancelQueries(queryKey) + ) + ); + + // We're using a Map to correctly serialize query keys that contain objects. + const previousData = new Map(); + specificOptimisticUpdateDefinitions.forEach(({ queryKey, updateQuery }) => { + // Snapshot the currently cached value. + const previousDataForQuery: CachedData = + queryClient.getQueryData(queryKey); + + // Attempt to optimistically update the cache using the new value. + try { + queryClient.setQueryData(queryKey, updateQuery); + } catch (e) { + console.error( + "The `updateQuery` function threw an exception, skipping optimistic update:" + ); + console.error(e); + } + + // Remember the snapshotted value to restore in case of an error. + previousData.set(queryKey, previousDataForQuery); + }); + + return { previousData }; + } + + function onError(_err, _item, context) { + // All we do in case of an error is roll back all optimistic updates. We ensure + // not to do anything else because React Query rethrows the error. This allows + // the programmer to handle the error as they usually would (i.e., we want the + // error handling to work as it would if the programmer wasn't using optimistic + // updates). + context.previousData.forEach(async (data, queryKey) => { + await queryClient.cancelQueries(queryKey); + queryClient.setQueryData(queryKey, data); + }); + } + + return { + onMutate, + onError, + }; +} + +/** + * Constructs the definition for optimistically updating a specific item. It + * uses a closure over the updated item to construct an item-specific query key + * (e.g., useful when the query key depends on an ID). + * + * @param optimisticUpdateDefinition The general, "uninstantiated" optimistic + * update definition with a function for constructing the query key. + * @param item The item triggering the Action/optimistic update (i.e., the + * argument passed to the Action). + * @returns A specific optimistic update definition which corresponds to the + * provided definition and closes over the provided item. + */ +function getOptimisticUpdateDefinitionForSpecificItem( + optimisticUpdateDefinition: InternalOptimisticUpdateDefinition< + ActionInput, + CachedData + >, + item: ActionInput +): SpecificOptimisticUpdateDefinition { + const { getQueryKey, updateQuery } = optimisticUpdateDefinition; + return { + queryKey: getQueryKey(item), + updateQuery: (old) => updateQuery(item, old), + }; +} + +/** + * Translates a Wasp query specifier to a query cache key used by React Query. + * + * @param querySpecifier A query specifier that's a part of the public API: + * https://wasp-lang.dev/docs/language/features#the-useaction-hook. + * @returns A cache key React Query internally uses for addressing queries. + */ +function getRqQueryKeyFromSpecifier( + querySpecifier: QuerySpecifier +): QueryKey { + const [queryFn, ...otherKeys] = querySpecifier; + return [...(queryFn as any).queryCacheKey, ...otherKeys]; +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/index.ts new file mode 100644 index 000000000..ec9ca9f68 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/index.ts @@ -0,0 +1,22 @@ +// PUBLIC API +export * from './actions' +// MOSTLY PUBLIC API (see the file for details) +export * from './queries' + +export { + // PUBLIC API + useAction, + // PUBLIC API + useQuery, + // PUBLIC API + type OptimisticUpdateDefinition, +} from './core' + +export { + // PUBLIC API + configureQueryClient, + // PRIVATE API (framework code) + initializeQueryClient, + // PRIVATE API (framework code) + queryClientInitialized +} from './queryClient' diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/internal/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/internal/index.ts new file mode 100644 index 000000000..c274b5aa7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/internal/index.ts @@ -0,0 +1,25 @@ +import { api, handleApiError } from 'wasp/client/api' +import { HttpMethod } from 'wasp/client' +import { + serialize as superjsonSerialize, + deserialize as superjsonDeserialize, + } from 'superjson' + +// PRIVATE API +export type OperationRoute = { method: HttpMethod, path: string } + +// PRIVATE API +export async function callOperation(operationRoute: OperationRoute & { method: HttpMethod.Post }, args: any) { + try { + const superjsonArgs = superjsonSerialize(args) + const response = await api.post(operationRoute.path, superjsonArgs) + return superjsonDeserialize(response.data) + } catch (error) { + handleApiError(error) + } +} + +// PRIVATE API +export function makeOperationRoute(relativeOperationRoute: string): OperationRoute { + return { method: HttpMethod.Post, path: `/${relativeOperationRoute}` } +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/internal/resources.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/internal/resources.js new file mode 100644 index 000000000..470ef70b8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/internal/resources.js @@ -0,0 +1,83 @@ +import { queryClientInitialized } from '../queryClient.js' +import { makeUpdateHandlersMap } from './updateHandlersMap' +import { hashQueryKey } from '@tanstack/react-query' + +// Map where key is resource name and value is Set +// containing query ids of all the queries that use +// that resource. +const resourceToQueryCacheKeys = new Map() + +const updateHandlers = makeUpdateHandlersMap(hashQueryKey) + +// PRIVATE API +/** + * Remembers that specified query is using specified resources. + * If called multiple times for same query, resources are added, not reset. + * @param {string[]} queryCacheKey - Unique key under used to identify query in the cache. + * @param {string[]} resources - Names of resources that query is using. + */ +export function addResourcesUsedByQuery(queryCacheKey, resources) { + for (const resource of resources) { + let cacheKeys = resourceToQueryCacheKeys.get(resource) + if (!cacheKeys) { + cacheKeys = new Set() + resourceToQueryCacheKeys.set(resource, cacheKeys) + } + cacheKeys.add(queryCacheKey) + } +} + +export function registerActionInProgress(optimisticUpdateTuples) { + optimisticUpdateTuples.forEach( + ({ queryKey, updateQuery }) => updateHandlers.add(queryKey, updateQuery) + ) +} + +export async function registerActionDone(resources, optimisticUpdateTuples) { + optimisticUpdateTuples.forEach(({ queryKey }) => updateHandlers.remove(queryKey)) + await invalidateQueriesUsing(resources) +} + +export function getActiveOptimisticUpdates(queryKey) { + return updateHandlers.getUpdateHandlers(queryKey) +} + +export async function invalidateAndRemoveQueries() { + const queryClient = await queryClientInitialized + // If we don't reset the queries before removing them, Wasp will stay on + // the same page. The user would have to manually refresh the page to "finish" + // logging out. + // When a query is removed, the `Observer` is removed as well, and the components + // that are using the query are not re-rendered. This is why we need to reset + // the queries, so that the `Observer` is re-created and the components are re-rendered. + // For more details: https://github.com/wasp-lang/wasp/pull/1014/files#r1111862125 + queryClient.resetQueries() + // If we don't remove the queries after invalidating them, the old query data + // remains in the cache, casuing a potential privacy issue. + queryClient.removeQueries() +} + +/** + * Invalidates all queries that are using specified resources. + * @param {string[]} resources - Names of resources. + */ +async function invalidateQueriesUsing(resources) { + const queryClient = await queryClientInitialized + + const queryCacheKeysToInvalidate = getQueriesUsingResources(resources) + queryCacheKeysToInvalidate.forEach( + queryCacheKey => queryClient.invalidateQueries(queryCacheKey) + ) +} + +/** + * @param {string} resource - Resource name. + * @returns {string[]} Array of "query cache keys" of queries that use specified resource. + */ +function getQueriesUsingResource(resource) { + return Array.from(resourceToQueryCacheKeys.get(resource) || []) +} + +function getQueriesUsingResources(resources) { + return Array.from(new Set(resources.flatMap(getQueriesUsingResource))) +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/internal/updateHandlersMap.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/internal/updateHandlersMap.js new file mode 100644 index 000000000..8c43c0b1b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/internal/updateHandlersMap.js @@ -0,0 +1,37 @@ +export function makeUpdateHandlersMap(calculateHash) { + const updateHandlers = new Map() + + function getHandlerTuples(queryKeyHash) { + return updateHandlers.get(queryKeyHash) || []; + } + + function add(queryKey, updateQuery) { + const queryKeyHash = calculateHash(queryKey) + const handlers = getHandlerTuples(queryKeyHash); + updateHandlers.set(queryKeyHash, [...handlers, { queryKey, updateQuery }]) + } + + function getUpdateHandlers(queryKey) { + const queryKeyHash = calculateHash(queryKey) + return getHandlerTuples(queryKeyHash).map(({ updateQuery }) => updateQuery) + } + + function remove(queryKeyToRemove) { + const queryKeyHash = calculateHash(queryKeyToRemove) + const filteredHandlers = getHandlerTuples(queryKeyHash).filter( + ({ queryKey }) => queryKey !== queryKeyToRemove + ) + + if (filteredHandlers.length > 0) { + updateHandlers.set(queryKeyHash, filteredHandlers) + } else { + updateHandlers.delete(queryKeyHash) + } + } + + return { + add, + remove, + getUpdateHandlers, + } +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/queries/core.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/queries/core.d.ts new file mode 100644 index 000000000..ff8ae4a3b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/queries/core.d.ts @@ -0,0 +1,25 @@ +import { type Query } from '../core.js' +import { Route } from 'wasp/client' +import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types' + +// PRIVATE API +export function createQuery( + queryRoute: string, + entitiesUsed: any[] +): QueryFor + +// PRIVATE API +export function addMetadataToQuery( + query: (...args: any[]) => Promise, + metadata: { + relativeQueryPath: string + queryRoute: Route + entitiesUsed: string[] + } +): void + +type QueryFor = Expand< + Query[0], _Awaited<_ReturnType>> +> + +type GenericBackendQuery = (args: never, context: any) => unknown diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/queries/core.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/queries/core.js new file mode 100644 index 000000000..c4b3e5f2e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/queries/core.js @@ -0,0 +1,32 @@ +import { callOperation, makeOperationRoute } from '../internal/index.js' +import { + addResourcesUsedByQuery, + getActiveOptimisticUpdates, +} from '../internal/resources' + +// PRIVATE API +export function createQuery(relativeQueryPath, entitiesUsed) { + const queryRoute = makeOperationRoute(relativeQueryPath) + + async function query(queryKey, queryArgs) { + const serverResult = await callOperation(queryRoute, queryArgs) + return getActiveOptimisticUpdates(queryKey).reduce( + (result, update) => update(result), + serverResult, + ) + } + + addMetadataToQuery(query, { relativeQueryPath, queryRoute, entitiesUsed }) + + return query +} + +// PRIVATE API +export function addMetadataToQuery( + query, + { relativeQueryPath, queryRoute, entitiesUsed } +) { + query.queryCacheKey = [relativeQueryPath] + query.route = queryRoute + addResourcesUsedByQuery(query.queryCacheKey, entitiesUsed) +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/queries/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/queries/index.ts new file mode 100644 index 000000000..17f6f8e23 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/queries/index.ts @@ -0,0 +1,4 @@ +import { createQuery } from './core' + +// PRIVATE API +export { addMetadataToQuery } from './core' diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/queryClient.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/queryClient.ts new file mode 100644 index 000000000..c2d1cb86d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/queryClient.ts @@ -0,0 +1,34 @@ +import { QueryClient, QueryClientConfig } from '@tanstack/react-query' + +const defaultQueryClientConfig = {}; + +let queryClientConfig: QueryClientConfig, + resolveQueryClientInitialized: (...args: any[]) => any, + isQueryClientInitialized: boolean; + +// PRIVATE API (framework code) +export const queryClientInitialized: Promise = new Promise( + (resolve) => { + resolveQueryClientInitialized = resolve; + } +); + +// PUBLIC API +export function configureQueryClient(config: QueryClientConfig): void { + if (isQueryClientInitialized) { + throw new Error( + "Attempted to configure the QueryClient after initialization" + ); + } + + queryClientConfig = config; +} + +// PRIVATE API (framework code) +export function initializeQueryClient(): void { + const queryClient = new QueryClient( + queryClientConfig ?? defaultQueryClientConfig + ); + isQueryClientInitialized = true; + resolveQueryClientInitialized(queryClient); +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/Link.tsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/Link.tsx new file mode 100644 index 000000000..2215ddc63 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/Link.tsx @@ -0,0 +1,21 @@ +import { useMemo } from 'react' +import { Link as RouterLink } from 'react-router-dom' +import { interpolatePath } from './linkHelpers' +import { type Routes } from './index' + +type RouterLinkProps = Parameters[0] + +// PUBLIC API +export function Link( + { to, params, search, hash, ...restOfProps }: Omit + & { + search?: Record; + hash?: string; + } + & Routes +) { + const toPropWithParams = useMemo(() => { + return interpolatePath(to, params, search, hash) + }, [to, params]) + return +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/index.ts new file mode 100644 index 000000000..90f93b35f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/index.ts @@ -0,0 +1,22 @@ +import { interpolatePath } from './linkHelpers' +import type { + RouteDefinitionsToRoutes, + OptionalRouteOptions, + ParamValue, +} from './types' + +// PUBLIC API +export const routes = { + RootRoute: { + to: "/", + build: ( + options?: OptionalRouteOptions, + ) => interpolatePath("/", undefined, options?.search, options?.hash), + }, +} as const; + +// PRIVATE API +export type Routes = RouteDefinitionsToRoutes + +// PUBLIC API +export { Link } from './Link' diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/linkHelpers.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/linkHelpers.ts new file mode 100644 index 000000000..e10cba928 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/linkHelpers.ts @@ -0,0 +1,45 @@ +import type { Params, Search } from "./types"; + +// PRIVATE API +export function interpolatePath( + path: string, + params?: Params, + search?: Search, + hash?: string +) { + const interpolatedPath = params ? interpolatePathParams(path, params) : path + const interpolatedSearch = search + ? `?${new URLSearchParams(search).toString()}` + : '' + const interpolatedHash = hash ? `#${hash}` : '' + return interpolatedPath + interpolatedSearch + interpolatedHash +} + +function interpolatePathParams(path: string, params: Params) { + function mapPathPart(part: string) { + if (part.startsWith(":")) { + const paramName = extractParamNameFromPathPart(part); + return params[paramName]; + } + return part; + } + + const interpolatedPath = path + .split("/") + .map(mapPathPart) + .filter(isValidPathPart) + .join("/"); + + return path.startsWith("/") ? `/${interpolatedPath}` : interpolatedPath; +} + +function isValidPathPart(part: any): boolean { + return !!part; +} + +function extractParamNameFromPathPart(paramString: string) { + if (paramString.endsWith("?")) { + return paramString.slice(1, -1); + } + return paramString.slice(1); +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/types.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/types.ts new file mode 100644 index 000000000..ffaeb4fe0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/router/types.ts @@ -0,0 +1,41 @@ +// PRIVATE API +export type RouteDefinitionsToRoutes = + RouteDefinitionsToRoutesObj[keyof RouteDefinitionsToRoutesObj] + + // PRIVATE API +export type OptionalRouteOptions = { + search?: Search + hash?: string +} + +// PRIVATE API +export type ParamValue = string | number +// PRIVATE API +export type Params = { [name: string]: ParamValue } +// PRIVATE API +export type Search = + | string[][] + | Record + | string + | URLSearchParams + +type RouteDefinitionsToRoutesObj = { + [K in keyof Routes]: { + to: Routes[K]['to'] + } & ParamsFromBuildFn +} + +type RoutesDefinition = { + [name: string]: { + to: string + build: BuildFn + } +} + +type BuildFn = (params: unknown) => string + +type ParamsFromBuildFn = Parameters[0] extends { + params: infer Params +} + ? { params: Params } + : { params?: never } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/test/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/test/index.ts new file mode 100644 index 000000000..f002be83c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/test/index.ts @@ -0,0 +1 @@ +export { renderInContext, mockServer } from './vitest/helpers' diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/test/vitest/helpers.tsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/test/vitest/helpers.tsx new file mode 100644 index 000000000..8ffbc9a7b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/test/vitest/helpers.tsx @@ -0,0 +1,95 @@ +import { ReactElement } from 'react' +import { serialize as superjsonSerialize } from 'superjson' +import { rest, type ResponseResolver, type RestContext } from 'msw' +import { setupServer, type SetupServer } from 'msw/node' +import { BrowserRouter as Router } from 'react-router-dom' +import { render, RenderResult, cleanup } from '@testing-library/react' +import { QueryClient, QueryClientProvider } from '@tanstack/react-query' +import { beforeAll, afterEach, afterAll } from 'vitest' +import { Query } from 'wasp/client/operations/core' +import config from 'wasp/core/config' +import { HttpMethod, Route } from 'wasp/client' + +// PRIVATE API +export type MockQuery = ( + query: Query, + resJson: MockOutput +) => void + +// PRIVATE API +export type MockApi = (route: Route, resJson: unknown) => void + +// PUBLIC API +// Inspired by the Tanstack React Query helper: +// https://github.com/TanStack/query/blob/4ae99561ca3383d6de3f4aad656a49ba4a17b57a/packages/react-query/src/__tests__/utils.tsx#L7-L26 +export function renderInContext(ui: ReactElement): RenderResult { + const client = new QueryClient() + const { rerender, ...result } = render( + + {ui} + + ) + return { + ...result, + rerender: (rerenderUi: ReactElement) => + rerender( + + {rerenderUi} + + ), + } +} + +// PUBLIC API +export function mockServer(): { + server: SetupServer + mockQuery: MockQuery + mockApi: MockApi +} { + const server: SetupServer = setupServer() + + beforeAll(() => server.listen()) + afterEach(() => { + server.resetHandlers() + cleanup() + }) + afterAll(() => server.close()) + + const mockQuery: MockQuery = (query, mockData) => { + const route = (query as unknown as { route: Route }).route + mockRoute(server, route, (_req, res, ctx) => + res(ctx.json(superjsonSerialize(mockData))) + ) + } + + const mockApi: MockApi = (route, mockData) => { + mockRoute(server, route, (_req, res, ctx) => res(ctx.json(mockData))) + } + + return { server, mockQuery, mockApi } +} + +function mockRoute( + server: SetupServer, + route: Route, + responseHandler: ResponseResolver +) { + if (!Object.values(HttpMethod).includes(route.method)) { + throw new Error( + `Unsupported query method for mocking: ${ + route.method + }. Supported method strings are: ${Object.values(HttpMethod).join(', ')}.` + ) + } + + const url = `${config.apiUrl}${route.path}` + + const handlers: Record[0]> = { + [HttpMethod.Get]: rest.get(url, responseHandler), + [HttpMethod.Post]: rest.post(url, responseHandler), + [HttpMethod.Put]: rest.put(url, responseHandler), + [HttpMethod.Delete]: rest.delete(url, responseHandler), + } + + server.use(handlers[route.method]) +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/core/config.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/core/config.ts new file mode 100644 index 000000000..e9234e6f2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/core/config.ts @@ -0,0 +1,9 @@ +import { stripTrailingSlash } from 'wasp/universal/url' + +const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; + +const config = { + apiUrl, +} + +export default config diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/core/storage.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/core/storage.ts new file mode 100644 index 000000000..0321acea8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/core/storage.ts @@ -0,0 +1,50 @@ +export type DataStore = { + getPrefixedKey(key: string): string + set(key: string, value: unknown): void + get(key: string): unknown + remove(key: string): void + clear(): void +} + +function createLocalStorageDataStore(prefix: string): DataStore { + function getPrefixedKey(key: string): string { + return `${prefix}:${key}` + } + + return { + getPrefixedKey, + set(key, value) { + ensureLocalStorageIsAvailable() + localStorage.setItem(getPrefixedKey(key), JSON.stringify(value)) + }, + get(key) { + ensureLocalStorageIsAvailable() + const value = localStorage.getItem(getPrefixedKey(key)) + try { + return value ? JSON.parse(value) : undefined + } catch (e: any) { + return undefined + } + }, + remove(key) { + ensureLocalStorageIsAvailable() + localStorage.removeItem(getPrefixedKey(key)) + }, + clear() { + ensureLocalStorageIsAvailable() + Object.keys(localStorage).forEach((key) => { + if (key.startsWith(prefix)) { + localStorage.removeItem(key) + } + }) + }, + } +} + +export const storage = createLocalStorageDataStore('wasp') + +function ensureLocalStorageIsAvailable(): void { + if (!window.localStorage) { + throw new Error('Local storage is not available.') + } +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dev/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dev/index.ts new file mode 100644 index 000000000..e9bd93f7d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dev/index.ts @@ -0,0 +1,17 @@ +/** + * Code found in this module is not meant to be used in user's server or client + * code. It is used by the Wasp tooling e.g. in the Tailwind config to resolve + * paths to the project root directory. + */ + +import { join as joinPaths } from 'path' + +// PUBLIC API +/** + * Wasp runs the client code in the `web-app` directory which is nested in the + * .wasp/out/web-app directory. This function resolves a project root dir path + * to be relative to the `web-app` directory i.e. `../../../projectDirPath`. + */ +export function resolveProjectPath(path: string): string { + return joinPaths('../../../', path) +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/events.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/events.d.ts new file mode 100644 index 000000000..c5f6b6e5d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/events.d.ts @@ -0,0 +1,7 @@ +import { Emitter } from 'mitt'; +type ApiEvents = { + 'sessionId.set': void; + 'sessionId.clear': void; +}; +export declare const apiEventsEmitter: Emitter; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/events.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/events.js new file mode 100644 index 000000000..b405507c5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/events.js @@ -0,0 +1,4 @@ +import mitt from 'mitt'; +// Used to allow API clients to register for auth session ID change events. +export const apiEventsEmitter = mitt(); +//# sourceMappingURL=events.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/events.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/events.js.map new file mode 100644 index 000000000..de0637d22 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/events.js.map @@ -0,0 +1 @@ +{"version":3,"file":"events.js","sourceRoot":"","sources":["../../api/events.ts"],"names":[],"mappings":"AAAA,OAAO,IAAiB,MAAM,MAAM,CAAC;AASrC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,gBAAgB,GAAuB,IAAI,EAAa,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.d.ts new file mode 100644 index 000000000..634416ecd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.d.ts @@ -0,0 +1,15 @@ +import { type AxiosError } from 'axios'; +export declare const api: import("axios").AxiosInstance; +export declare function setSessionId(sessionId: string): void; +export declare function getSessionId(): string | undefined; +export declare function clearSessionId(): void; +export declare function removeLocalUserData(): void; +/** + * Takes an error returned by the app's API (as returned by axios), and transforms into a more + * standard format to be further used by the client. It is also assumed that given API + * error has been formatted as implemented by HttpError on the server. + */ +export declare function handleApiError(error: AxiosError<{ + message?: string; + data?: unknown; +}>): void; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.js new file mode 100644 index 000000000..2015c488d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.js @@ -0,0 +1,96 @@ +import axios from 'axios'; +import config from 'wasp/core/config'; +import { storage } from 'wasp/core/storage'; +import { apiEventsEmitter } from './events.js'; +// PUBLIC API +export const api = axios.create({ + baseURL: config.apiUrl, +}); +const WASP_APP_AUTH_SESSION_ID_NAME = 'sessionId'; +let waspAppAuthSessionId = storage.get(WASP_APP_AUTH_SESSION_ID_NAME); +// PRIVATE API (sdk) +export function setSessionId(sessionId) { + waspAppAuthSessionId = sessionId; + storage.set(WASP_APP_AUTH_SESSION_ID_NAME, sessionId); + apiEventsEmitter.emit('sessionId.set'); +} +// PRIVATE API (sdk) +export function getSessionId() { + return waspAppAuthSessionId; +} +// PRIVATE API (sdk) +export function clearSessionId() { + waspAppAuthSessionId = undefined; + storage.remove(WASP_APP_AUTH_SESSION_ID_NAME); + apiEventsEmitter.emit('sessionId.clear'); +} +// PRIVATE API (sdk) +export function removeLocalUserData() { + waspAppAuthSessionId = undefined; + storage.clear(); + apiEventsEmitter.emit('sessionId.clear'); +} +api.interceptors.request.use((request) => { + const sessionId = getSessionId(); + if (sessionId) { + request.headers['Authorization'] = `Bearer ${sessionId}`; + } + return request; +}); +api.interceptors.response.use(undefined, (error) => { + var _a; + if (((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 401) { + clearSessionId(); + } + return Promise.reject(error); +}); +// This handler will run on other tabs (not the active one calling API functions), +// and will ensure they know about auth session ID changes. +// Ref: https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event +// "Note: This won't work on the same page that is making the changes — it is really a way +// for other pages on the domain using the storage to sync any changes that are made." +window.addEventListener('storage', (event) => { + if (event.key === storage.getPrefixedKey(WASP_APP_AUTH_SESSION_ID_NAME)) { + if (!!event.newValue) { + waspAppAuthSessionId = event.newValue; + apiEventsEmitter.emit('sessionId.set'); + } + else { + waspAppAuthSessionId = undefined; + apiEventsEmitter.emit('sessionId.clear'); + } + } +}); +// PRIVATE API (sdk) +/** + * Takes an error returned by the app's API (as returned by axios), and transforms into a more + * standard format to be further used by the client. It is also assumed that given API + * error has been formatted as implemented by HttpError on the server. + */ +export function handleApiError(error) { + var _a, _b; + if (error === null || error === void 0 ? void 0 : error.response) { + // If error came from HTTP response, we capture most informative message + // and also add .statusCode information to it. + // If error had JSON response, we assume it is of format { message, data } and + // add that info to the error. + // TODO: We might want to use HttpError here instead of just Error, since + // HttpError is also used on server to throw errors like these. + // That would require copying HttpError code to web-app also and using it here. + const responseJson = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data; + const responseStatusCode = error.response.status; + throw new WaspHttpError(responseStatusCode, (_b = responseJson === null || responseJson === void 0 ? void 0 : responseJson.message) !== null && _b !== void 0 ? _b : error.message, responseJson); + } + else { + // If any other error, we just propagate it. + throw error; + } +} +class WaspHttpError extends Error { + constructor(statusCode, message, data) { + super(message); + this.statusCode = statusCode; + this.data = data; + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.js.map new file mode 100644 index 000000000..15be79e1e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAA;AAE9C,OAAO,MAAM,MAAM,kBAAkB,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9C,aAAa;AACb,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC,MAAM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OAAe,EAAE,IAAa;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.d.ts new file mode 100644 index 000000000..fd6cf83b9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.d.ts @@ -0,0 +1,10 @@ +export declare enum HttpMethod { + Get = "GET", + Post = "POST", + Put = "PUT", + Delete = "DELETE" +} +export type Route = { + method: HttpMethod; + path: string; +}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.js new file mode 100644 index 000000000..c13afdb0c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.js @@ -0,0 +1,10 @@ +// PUBLIC API +// NOTE: This is enough to cover Operations and our APIs (src/Wasp/AppSpec/Api.hs). +export var HttpMethod; +(function (HttpMethod) { + HttpMethod["Get"] = "GET"; + HttpMethod["Post"] = "POST"; + HttpMethod["Put"] = "PUT"; + HttpMethod["Delete"] = "DELETE"; +})(HttpMethod || (HttpMethod = {})); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.js.map new file mode 100644 index 000000000..b7394b350 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,mFAAmF;AACnF,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AAClB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/core.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/core.d.ts new file mode 100644 index 000000000..e2c6699d1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/core.d.ts @@ -0,0 +1,4 @@ +export function createAction(relativeActionRoute: any, entitiesUsed: any): { + (args: any): Promise; + internal: (args: any, specificOptimisticUpdateDefinitions: any) => Promise; +}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/core.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/core.js new file mode 100644 index 000000000..51abcbe93 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/core.js @@ -0,0 +1,31 @@ +import { callOperation, makeOperationRoute } from '../internal/index.js'; +import { registerActionInProgress, registerActionDone, } from '../internal/resources.js'; +// PRIVATE API +export function createAction(relativeActionRoute, entitiesUsed) { + const actionRoute = makeOperationRoute(relativeActionRoute); + async function internalAction(args, specificOptimisticUpdateDefinitions) { + registerActionInProgress(specificOptimisticUpdateDefinitions); + try { + // The `return await` is not redundant here. If we removed the await, the + // `finally` block would execute before the action finishes, prematurely + // registering the action as done. + return await callOperation(actionRoute, args); + } + finally { + await registerActionDone(entitiesUsed, specificOptimisticUpdateDefinitions); + } + } + // We expose (and document) a restricted version of the API for our users, + // while also attaching the full "internal" API to the exposed action. By + // doing this, we can easily use the internal API of an action a users passes + // into our system (e.g., through the `useAction` hook) without needing a + // lookup table. + // + // While it does technically allow our users to access the interal API, it + // shouldn't be a problem in practice. Still, if it turns out to be a problem, + // we can always hide it using a Symbol. + const action = (args) => internalAction(args, []); + action.internal = internalAction; + return action; +} +//# sourceMappingURL=core.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/core.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/core.js.map new file mode 100644 index 000000000..5834336f1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/core.js.map @@ -0,0 +1 @@ +{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../../client/operations/actions/core.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,EACL,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,0BAA0B,CAAA;AAEjC,cAAc;AACd,MAAM,UAAU,YAAY,CAAC,mBAAmB,EAAE,YAAY;IAC5D,MAAM,WAAW,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAE3D,KAAK,UAAU,cAAc,CAAC,IAAI,EAAE,mCAAmC;QACrE,wBAAwB,CAAC,mCAAmC,CAAC,CAAA;QAC7D,IAAI;YACF,yEAAyE;YACzE,wEAAwE;YACxE,kCAAkC;YAClC,OAAO,MAAM,aAAa,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;SAC9C;gBAAS;YACR,MAAM,kBAAkB,CAAC,YAAY,EAAE,mCAAmC,CAAC,CAAA;SAC5E;IACH,CAAC;IAED,0EAA0E;IAC1E,yEAAyE;IACzE,6EAA6E;IAC7E,yEAAyE;IACzE,gBAAgB;IAChB,EAAE;IACF,0EAA0E;IAC1E,8EAA8E;IAC9E,wCAAwC;IACxC,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IACjD,MAAM,CAAC,QAAQ,GAAG,cAAc,CAAA;IAEhC,OAAO,MAAM,CAAA;AACf,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/index.d.ts new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/index.js new file mode 100644 index 000000000..f8a711af8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/index.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/index.js.map new file mode 100644 index 000000000..58e967cc0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/actions/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../client/operations/actions/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/core.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/core.d.ts new file mode 100644 index 000000000..a23b24ebd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/core.d.ts @@ -0,0 +1,44 @@ +import { UseQueryResult } from "@tanstack/react-query"; +export { configureQueryClient } from "./queryClient"; +export type Query = { + (queryCacheKey: string[], args: Input): Promise; +}; +export declare function useQuery(queryFn: Query, queryFnArgs?: Input, options?: any): UseQueryResult; +export type Action = [Input] extends [never] ? (args?: unknown) => Promise : (args: Input) => Promise; +/** + * An options object passed into the `useAction` hook and used to enhance the + * action with extra options. + * + */ +export type ActionOptions = { + optimisticUpdates: OptimisticUpdateDefinition[]; +}; +/** + * A documented (public) way to define optimistic updates. + */ +export type OptimisticUpdateDefinition = { + getQuerySpecifier: GetQuerySpecifier; + updateQuery: UpdateQuery; +}; +/** + * A function that takes an item and returns a Wasp Query specifier. + */ +export type GetQuerySpecifier = (item: ActionInput) => QuerySpecifier; +/** + * A function that takes an item and the previous state of the cache, and returns + * the desired (new) state of the cache. + */ +export type UpdateQuery = (item: ActionInput, oldData: CachedData | undefined) => CachedData; +/** + * A public query specifier used for addressing Wasp queries. See our docs for details: + * https://wasp-lang.dev/docs/language/features#the-useaction-hook. + */ +export type QuerySpecifier = [Query, ...any[]]; +/** + * A hook for adding extra behavior to a Wasp Action (e.g., optimistic updates). + * + * @param actionFn The Wasp Action you wish to enhance/decorate. + * @param actionOptions An options object for enhancing/decorating the given Action. + * @returns A decorated Action with added behavior but an unchanged API. + */ +export declare function useAction(actionFn: Action, actionOptions?: ActionOptions): typeof actionFn; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/core.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/core.js new file mode 100644 index 000000000..2c94cb01f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/core.js @@ -0,0 +1,171 @@ +import { useMutation, useQueryClient, useQuery as rqUseQuery, } from "@tanstack/react-query"; +export { configureQueryClient } from "./queryClient"; +// PUBLIC API +export function useQuery(queryFn, queryFnArgs, options) { + if (typeof queryFn !== "function") { + throw new TypeError("useQuery requires queryFn to be a function."); + } + if (!queryFn.queryCacheKey) { + throw new TypeError("queryFn needs to have queryCacheKey property defined."); + } + const queryKey = queryFnArgs !== undefined + ? [...queryFn.queryCacheKey, queryFnArgs] + : queryFn.queryCacheKey; + return rqUseQuery(Object.assign({ queryKey, queryFn: () => queryFn(queryKey, queryFnArgs) }, options)); +} +// PUBLIC API +/** + * A hook for adding extra behavior to a Wasp Action (e.g., optimistic updates). + * + * @param actionFn The Wasp Action you wish to enhance/decorate. + * @param actionOptions An options object for enhancing/decorating the given Action. + * @returns A decorated Action with added behavior but an unchanged API. + */ +export function useAction(actionFn, actionOptions) { + const queryClient = useQueryClient(); + let mutationFn = actionFn; + let options = {}; + if (actionOptions === null || actionOptions === void 0 ? void 0 : actionOptions.optimisticUpdates) { + const optimisticUpdatesDefinitions = actionOptions.optimisticUpdates.map(translateToInternalDefinition); + mutationFn = makeOptimisticUpdateMutationFn(actionFn, optimisticUpdatesDefinitions); + options = makeRqOptimisticUpdateOptions(queryClient, optimisticUpdatesDefinitions); + } + // NOTE: We decided to hide React Query's extra mutation features (e.g., + // isLoading, onSuccess and onError callbacks, synchronous mutate) and only + // expose a simple async function whose API matches the original Action. + // We did this to avoid cluttering the API with stuff we're not sure we need + // yet (e.g., isLoading), to postpone the action vs mutation dilemma, and to + // clearly separate our opinionated API from React Query's lower-level + // advanced API (which users can also use) + const mutation = useMutation(mutationFn, options); + return (args) => mutation.mutateAsync(args); +} +/** + * Translates/Desugars a public optimistic update definition object into a + * definition object our system uses internally. + * + * @param publicOptimisticUpdateDefinition An optimistic update definition + * object that's a part of the public API: + * https://wasp-lang.dev/docs/language/features#the-useaction-hook. + * @returns An internally-used optimistic update definition object. + */ +function translateToInternalDefinition(publicOptimisticUpdateDefinition) { + const { getQuerySpecifier, updateQuery } = publicOptimisticUpdateDefinition; + const definitionErrors = []; + if (typeof getQuerySpecifier !== "function") { + definitionErrors.push("`getQuerySpecifier` is not a function."); + } + if (typeof updateQuery !== "function") { + definitionErrors.push("`updateQuery` is not a function."); + } + if (definitionErrors.length) { + throw new TypeError(`Invalid optimistic update definition: ${definitionErrors.join(", ")}.`); + } + return { + getQueryKey: (item) => getRqQueryKeyFromSpecifier(getQuerySpecifier(item)), + updateQuery, + }; +} +/** + * Creates a function that performs an action while telling it about the + * optimistic updates it caused. + * + * @param actionFn The Wasp Action. + * @param optimisticUpdateDefinitions The optimisitc updates the action causes. + * @returns An decorated action which performs optimistic updates. + */ +function makeOptimisticUpdateMutationFn(actionFn, optimisticUpdateDefinitions) { + return function performActionWithOptimisticUpdates(item) { + const specificOptimisticUpdateDefinitions = optimisticUpdateDefinitions.map((generalDefinition) => getOptimisticUpdateDefinitionForSpecificItem(generalDefinition, item)); + return actionFn.internal(item, specificOptimisticUpdateDefinitions); + }; +} +/** + * Given a ReactQuery query client and our internal definition of optimistic + * updates, this function constructs an object describing those same optimistic + * updates in a format we can pass into React Query's useMutation hook. In other + * words, it translates our optimistic updates definition into React Query's + * optimistic updates definition. Check their docs for details: + * https://tanstack.com/query/v4/docs/guides/optimistic-updates?from=reactQueryV3&original=https://react-query-v3.tanstack.com/guides/optimistic-updates + * + * @param queryClient The QueryClient instance used by React Query. + * @param optimisticUpdateDefinitions A list containing internal optimistic + * updates definition objects (i.e., a list where each object carries the + * instructions for performing particular optimistic update). + * @returns An object containing 'onMutate' and 'onError' functions + * corresponding to the given optimistic update definitions (check the docs + * linked above for details). + */ +function makeRqOptimisticUpdateOptions(queryClient, optimisticUpdateDefinitions) { + async function onMutate(item) { + const specificOptimisticUpdateDefinitions = optimisticUpdateDefinitions.map((generalDefinition) => getOptimisticUpdateDefinitionForSpecificItem(generalDefinition, item)); + // Cancel any outgoing refetches (so they don't overwrite our optimistic update). + // Theoretically, we can be a bit faster. Instead of awaiting the + // cancellation of all queries, we could cancel and update them in parallel. + // However, awaiting cancellation hasn't yet proven to be a performance bottleneck. + await Promise.all(specificOptimisticUpdateDefinitions.map(({ queryKey }) => queryClient.cancelQueries(queryKey))); + // We're using a Map to correctly serialize query keys that contain objects. + const previousData = new Map(); + specificOptimisticUpdateDefinitions.forEach(({ queryKey, updateQuery }) => { + // Snapshot the currently cached value. + const previousDataForQuery = queryClient.getQueryData(queryKey); + // Attempt to optimistically update the cache using the new value. + try { + queryClient.setQueryData(queryKey, updateQuery); + } + catch (e) { + console.error("The `updateQuery` function threw an exception, skipping optimistic update:"); + console.error(e); + } + // Remember the snapshotted value to restore in case of an error. + previousData.set(queryKey, previousDataForQuery); + }); + return { previousData }; + } + function onError(_err, _item, context) { + // All we do in case of an error is roll back all optimistic updates. We ensure + // not to do anything else because React Query rethrows the error. This allows + // the programmer to handle the error as they usually would (i.e., we want the + // error handling to work as it would if the programmer wasn't using optimistic + // updates). + context.previousData.forEach(async (data, queryKey) => { + await queryClient.cancelQueries(queryKey); + queryClient.setQueryData(queryKey, data); + }); + } + return { + onMutate, + onError, + }; +} +/** + * Constructs the definition for optimistically updating a specific item. It + * uses a closure over the updated item to construct an item-specific query key + * (e.g., useful when the query key depends on an ID). + * + * @param optimisticUpdateDefinition The general, "uninstantiated" optimistic + * update definition with a function for constructing the query key. + * @param item The item triggering the Action/optimistic update (i.e., the + * argument passed to the Action). + * @returns A specific optimistic update definition which corresponds to the + * provided definition and closes over the provided item. + */ +function getOptimisticUpdateDefinitionForSpecificItem(optimisticUpdateDefinition, item) { + const { getQueryKey, updateQuery } = optimisticUpdateDefinition; + return { + queryKey: getQueryKey(item), + updateQuery: (old) => updateQuery(item, old), + }; +} +/** + * Translates a Wasp query specifier to a query cache key used by React Query. + * + * @param querySpecifier A query specifier that's a part of the public API: + * https://wasp-lang.dev/docs/language/features#the-useaction-hook. + * @returns A cache key React Query internally uses for addressing queries. + */ +function getRqQueryKeyFromSpecifier(querySpecifier) { + const [queryFn, ...otherKeys] = querySpecifier; + return [...queryFn.queryCacheKey, ...otherKeys]; +} +//# sourceMappingURL=core.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/core.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/core.js.map new file mode 100644 index 000000000..68ea114aa --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/core.js.map @@ -0,0 +1 @@ +{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../client/operations/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EAEX,cAAc,EACd,QAAQ,IAAI,UAAU,GAEvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAcrD,aAAa;AACb,MAAM,UAAU,QAAQ,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO;IACpD,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;QACjC,MAAM,IAAI,SAAS,CAAC,6CAA6C,CAAC,CAAC;KACpE;IACD,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;QAC1B,MAAM,IAAI,SAAS,CACjB,uDAAuD,CACxD,CAAC;KACH;IAED,MAAM,QAAQ,GACZ,WAAW,KAAK,SAAS;QACvB,CAAC,CAAC,CA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CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC;KAC7C,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAS,0BAA0B,CACjC,cAAgD;IAEhD,MAAM,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,GAAG,cAAc,CAAC;IAC/C,OAAO,CAAC,GAAI,OAAe,CAAC,aAAa,EAAE,GAAG,SAAS,CAAC,CAAC;AAC3D,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/index.d.ts new file mode 100644 index 000000000..301165fa8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/index.d.ts @@ -0,0 +1,4 @@ +export * from './actions'; +export * from './queries'; +export { useAction, useQuery, type OptimisticUpdateDefinition, } from './core'; +export { configureQueryClient, initializeQueryClient, queryClientInitialized } from './queryClient'; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/index.js new file mode 100644 index 000000000..f83307c7b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/index.js @@ -0,0 +1,17 @@ +// PUBLIC API +export * from './actions'; +// MOSTLY PUBLIC API (see the file for details) +export * from './queries'; +export { +// PUBLIC API +useAction, +// PUBLIC API +useQuery, } from './core'; +export { +// PUBLIC API +configureQueryClient, +// PRIVATE API (framework code) +initializeQueryClient, +// PRIVATE API (framework code) +queryClientInitialized } from './queryClient'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/index.js.map new file mode 100644 index 000000000..982c957a9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/operations/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,cAAc,WAAW,CAAA;AACzB,+CAA+C;AAC/C,cAAc,WAAW,CAAA;AAEzB,OAAO;AACH,aAAa;AACb,SAAS;AACT,aAAa;AACb,QAAQ,GAGX,MAAM,QAAQ,CAAA;AAEf,OAAO;AACH,aAAa;AACb,oBAAoB;AACpB,+BAA+B;AAC/B,qBAAqB;AACrB,+BAA+B;AAC/B,sBAAsB,EACzB,MAAM,eAAe,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.d.ts new file mode 100644 index 000000000..e31c8b5a4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.d.ts @@ -0,0 +1,9 @@ +import { HttpMethod } from 'wasp/client'; +export type OperationRoute = { + method: HttpMethod; + path: string; +}; +export declare function callOperation(operationRoute: OperationRoute & { + method: HttpMethod.Post; +}, args: any): Promise; +export declare function makeOperationRoute(relativeOperationRoute: string): OperationRoute; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.js new file mode 100644 index 000000000..68bbdadf3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.js @@ -0,0 +1,19 @@ +import { api, handleApiError } from 'wasp/client/api'; +import { HttpMethod } from 'wasp/client'; +import { serialize as superjsonSerialize, deserialize as superjsonDeserialize, } from 'superjson'; +// PRIVATE API +export async function callOperation(operationRoute, args) { + try { + const superjsonArgs = superjsonSerialize(args); + const response = await api.post(operationRoute.path, superjsonArgs); + return superjsonDeserialize(response.data); + } + catch (error) { + handleApiError(error); + } +} +// PRIVATE API +export function makeOperationRoute(relativeOperationRoute) { + return { method: HttpMethod.Post, path: `/${relativeOperationRoute}` }; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.js.map new file mode 100644 index 000000000..a4097ef8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../client/operations/internal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EACL,SAAS,IAAI,kBAAkB,EAC/B,WAAW,IAAI,oBAAoB,GACnC,MAAM,WAAW,CAAA;AAKnB,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,cAA4D,EAAE,IAAS;IACzG,IAAI;QACF,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAC9C,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;QACnE,OAAO,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;KAC3C;IAAC,OAAO,KAAK,EAAE;QACd,cAAc,CAAC,KAAK,CAAC,CAAA;KACtB;AACH,CAAC;AAED,cAAc;AACd,MAAM,UAAU,kBAAkB,CAAC,sBAA8B;IAC/D,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,sBAAsB,EAAE,EAAE,CAAA;AACxE,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/resources.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/resources.d.ts new file mode 100644 index 000000000..6f51eab82 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/resources.d.ts @@ -0,0 +1,11 @@ +/** + * Remembers that specified query is using specified resources. + * If called multiple times for same query, resources are added, not reset. + * @param {string[]} queryCacheKey - Unique key under used to identify query in the cache. + * @param {string[]} resources - Names of resources that query is using. + */ +export function addResourcesUsedByQuery(queryCacheKey: string[], resources: string[]): void; +export function registerActionInProgress(optimisticUpdateTuples: any): void; +export function registerActionDone(resources: any, optimisticUpdateTuples: any): Promise; +export function getActiveOptimisticUpdates(queryKey: any): any; +export function invalidateAndRemoveQueries(): Promise; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/resources.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/resources.js new file mode 100644 index 000000000..86ab76333 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/resources.js @@ -0,0 +1,69 @@ +import { queryClientInitialized } from '../queryClient.js'; +import { makeUpdateHandlersMap } from './updateHandlersMap'; +import { hashQueryKey } from '@tanstack/react-query'; +// Map where key is resource name and value is Set +// containing query ids of all the queries that use +// that resource. +const resourceToQueryCacheKeys = new Map(); +const updateHandlers = makeUpdateHandlersMap(hashQueryKey); +// PRIVATE API +/** + * Remembers that specified query is using specified resources. + * If called multiple times for same query, resources are added, not reset. + * @param {string[]} queryCacheKey - Unique key under used to identify query in the cache. + * @param {string[]} resources - Names of resources that query is using. + */ +export function addResourcesUsedByQuery(queryCacheKey, resources) { + for (const resource of resources) { + let cacheKeys = resourceToQueryCacheKeys.get(resource); + if (!cacheKeys) { + cacheKeys = new Set(); + resourceToQueryCacheKeys.set(resource, cacheKeys); + } + cacheKeys.add(queryCacheKey); + } +} +export function registerActionInProgress(optimisticUpdateTuples) { + optimisticUpdateTuples.forEach(({ queryKey, updateQuery }) => updateHandlers.add(queryKey, updateQuery)); +} +export async function registerActionDone(resources, optimisticUpdateTuples) { + optimisticUpdateTuples.forEach(({ queryKey }) => updateHandlers.remove(queryKey)); + await invalidateQueriesUsing(resources); +} +export function getActiveOptimisticUpdates(queryKey) { + return updateHandlers.getUpdateHandlers(queryKey); +} +export async function invalidateAndRemoveQueries() { + const queryClient = await queryClientInitialized; + // If we don't reset the queries before removing them, Wasp will stay on + // the same page. The user would have to manually refresh the page to "finish" + // logging out. + // When a query is removed, the `Observer` is removed as well, and the components + // that are using the query are not re-rendered. This is why we need to reset + // the queries, so that the `Observer` is re-created and the components are re-rendered. + // For more details: https://github.com/wasp-lang/wasp/pull/1014/files#r1111862125 + queryClient.resetQueries(); + // If we don't remove the queries after invalidating them, the old query data + // remains in the cache, casuing a potential privacy issue. + queryClient.removeQueries(); +} +/** + * Invalidates all queries that are using specified resources. + * @param {string[]} resources - Names of resources. + */ +async function invalidateQueriesUsing(resources) { + const queryClient = await queryClientInitialized; + const queryCacheKeysToInvalidate = getQueriesUsingResources(resources); + queryCacheKeysToInvalidate.forEach(queryCacheKey => queryClient.invalidateQueries(queryCacheKey)); +} +/** + * @param {string} resource - Resource name. + * @returns {string[]} Array of "query cache keys" of queries that use specified resource. + */ +function getQueriesUsingResource(resource) { + return Array.from(resourceToQueryCacheKeys.get(resource) || []); +} +function getQueriesUsingResources(resources) { + return Array.from(new Set(resources.flatMap(getQueriesUsingResource))); +} +//# sourceMappingURL=resources.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/resources.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/resources.js.map new file mode 100644 index 000000000..c91fecd3c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/resources.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resources.js","sourceRoot":"","sources":["../../../../client/operations/internal/resources.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD,kDAAkD;AAClD,mDAAmD;AACnD,iBAAiB;AACjB,MAAM,wBAAwB,GAAG,IAAI,GAAG,EAAE,CAAA;AAE1C,MAAM,cAAc,GAAG,qBAAqB,CAAC,YAAY,CAAC,CAAA;AAE1D,cAAc;AACd;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,aAAa,EAAE,SAAS;IAC9D,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;QAChC,IAAI,SAAS,GAAG,wBAAwB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACtD,IAAI,CAAC,SAAS,EAAE;YACd,SAAS,GAAG,IAAI,GAAG,EAAE,CAAA;YACrB,wBAAwB,CAAC,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAA;SAClD;QACD,SA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Q;IACvC,OAAO,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;AACjE,CAAC;AAED,SAAS,wBAAwB,CAAC,SAAS;IACzC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAA;AACxE,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts new file mode 100644 index 000000000..715b6d06a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts @@ -0,0 +1,5 @@ +export function makeUpdateHandlersMap(calculateHash: any): { + add: (queryKey: any, updateQuery: any) => void; + remove: (queryKeyToRemove: any) => void; + getUpdateHandlers: (queryKey: any) => any; +}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js new file mode 100644 index 000000000..34f590b5d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js @@ -0,0 +1,31 @@ +export function makeUpdateHandlersMap(calculateHash) { + const updateHandlers = new Map(); + function getHandlerTuples(queryKeyHash) { + return updateHandlers.get(queryKeyHash) || []; + } + function add(queryKey, updateQuery) { + const queryKeyHash = calculateHash(queryKey); + const handlers = getHandlerTuples(queryKeyHash); + updateHandlers.set(queryKeyHash, [...handlers, { queryKey, updateQuery }]); + } + function getUpdateHandlers(queryKey) { + const queryKeyHash = calculateHash(queryKey); + return getHandlerTuples(queryKeyHash).map(({ updateQuery }) => updateQuery); + } + function remove(queryKeyToRemove) { + const queryKeyHash = calculateHash(queryKeyToRemove); + const filteredHandlers = getHandlerTuples(queryKeyHash).filter(({ queryKey }) => queryKey !== queryKeyToRemove); + if (filteredHandlers.length > 0) { + updateHandlers.set(queryKeyHash, filteredHandlers); + } + else { + updateHandlers.delete(queryKeyHash); + } + } + return { + add, + remove, + getUpdateHandlers, + }; +} +//# sourceMappingURL=updateHandlersMap.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map new file mode 100644 index 000000000..7940fcd97 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map @@ -0,0 +1 @@ +{"version":3,"file":"updateHandlersMap.js","sourceRoot":"","sources":["../../../../client/operations/internal/updateHandlersMap.js"],"names":[],"mappings":"AAAA,MAAM,UAAU,qBAAqB,CAAC,aAAa;IACjD,MAAM,cAAc,GAAG,IAAI,GAAG,EAAE,CAAA;IAEhC,SAAS,gBAAgB,CAAC,YAAY;QACpC,OAAO,cAAc,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;IAChD,CAAC;IAED,SAAS,GAAG,CAAC,QAAQ,EAAE,WAAW;QAChC,MAAM,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAA;QAC5C,MAAM,QAAQ,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC;QAChD,cAAc,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,GAAG,QAAQ,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC,CAAA;IAC5E,CAAC;IAED,SAAS,iBAAiB,CAAC,QAAQ;QACjC,MAAM,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAA;QAC5C,OAAO,gBAAgB,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,CAAA;IAC7E,CAAC;IAED,SAAS,MAAM,CAAC,gBAAgB;QAC9B,MAAM,YAAY,GAAG,aAAa,CAAC,gBAAgB,CAAC,CAAA;QACpD,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC,MAAM,CAC5D,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,KAAK,gBAAgB,CAChD,CAAA;QAED,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;YAC/B,cAAc,CAAC,GAAG,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAA;SACnD;aAAM;YACL,cAAc,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;SACpC;IACH,CAAC;IAED,OAAO;QACL,GAAG;QACH,MAAM;QACN,iBAAiB;KAClB,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/core.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/core.d.ts new file mode 100644 index 000000000..cf16c63f4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/core.d.ts @@ -0,0 +1,6 @@ +export function createQuery(relativeQueryPath: any, entitiesUsed: any): (queryKey: any, queryArgs: any) => Promise; +export function addMetadataToQuery(query: any, { relativeQueryPath, queryRoute, entitiesUsed }: { + relativeQueryPath: any; + queryRoute: any; + entitiesUsed: any; +}): void; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/core.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/core.js new file mode 100644 index 000000000..13b2cdcc9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/core.js @@ -0,0 +1,19 @@ +import { callOperation, makeOperationRoute } from '../internal/index.js'; +import { addResourcesUsedByQuery, getActiveOptimisticUpdates, } from '../internal/resources'; +// PRIVATE API +export function createQuery(relativeQueryPath, entitiesUsed) { + const queryRoute = makeOperationRoute(relativeQueryPath); + async function query(queryKey, queryArgs) { + const serverResult = await callOperation(queryRoute, queryArgs); + return getActiveOptimisticUpdates(queryKey).reduce((result, update) => update(result), serverResult); + } + addMetadataToQuery(query, { relativeQueryPath, queryRoute, entitiesUsed }); + return query; +} +// PRIVATE API +export function addMetadataToQuery(query, { relativeQueryPath, queryRoute, entitiesUsed }) { + query.queryCacheKey = [relativeQueryPath]; + query.route = queryRoute; + addResourcesUsedByQuery(query.queryCacheKey, entitiesUsed); +} +//# sourceMappingURL=core.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/core.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/core.js.map new file mode 100644 index 000000000..f8ad3284b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/core.js.map @@ -0,0 +1 @@ +{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../../client/operations/queries/core.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,EACL,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAA;AAE9B,cAAc;AACd,MAAM,UAAU,WAAW,CAAC,iBAAiB,EAAE,YAAY;IACzD,MAAM,UAAU,GAAG,kBAAkB,CAAC,iBAAiB,CAAC,CAAA;IAExD,KAAK,UAAU,KAAK,CAAC,QAAQ,EAAE,SAAS;QACtC,MAAM,YAAY,GAAG,MAAM,aAAa,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;QAC/D,OAAO,0BAA0B,CAAC,QAAQ,CAAC,CAAC,MAAM,CAChD,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAClC,YAAY,CACb,CAAA;IACH,CAAC;IAED,kBAAkB,CAAC,KAAK,EAAE,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC,CAAA;IAE1E,OAAO,KAAK,CAAA;AACd,CAAC;AAED,cAAc;AACd,MAAM,UAAU,kBAAkB,CAChC,KAAK,EACL,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAE;IAE/C,KAAK,CAAC,aAAa,GAAG,CAAC,iBAAiB,CAAC,CAAA;IACzC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAA;IACxB,uBAAuB,CAAC,KAAK,CAAC,aAAa,EAAE,YAAY,CAAC,CAAA;AAC5D,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/index.d.ts new file mode 100644 index 000000000..575c502be --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/index.d.ts @@ -0,0 +1 @@ +export { addMetadataToQuery } from './core'; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/index.js new file mode 100644 index 000000000..1c28e8d0d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/index.js @@ -0,0 +1,3 @@ +// PRIVATE API +export { addMetadataToQuery } from './core'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/index.js.map new file mode 100644 index 000000000..5c83611fa --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queries/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../client/operations/queries/index.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queryClient.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queryClient.d.ts new file mode 100644 index 000000000..40df1fa86 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queryClient.d.ts @@ -0,0 +1,4 @@ +import { QueryClient, QueryClientConfig } from '@tanstack/react-query'; +export declare const queryClientInitialized: Promise; +export declare function configureQueryClient(config: QueryClientConfig): void; +export declare function initializeQueryClient(): void; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queryClient.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queryClient.js new file mode 100644 index 000000000..9dfeab443 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queryClient.js @@ -0,0 +1,21 @@ +import { QueryClient } from '@tanstack/react-query'; +const defaultQueryClientConfig = {}; +let queryClientConfig, resolveQueryClientInitialized, isQueryClientInitialized; +// PRIVATE API (framework code) +export const queryClientInitialized = new Promise((resolve) => { + resolveQueryClientInitialized = resolve; +}); +// PUBLIC API +export function configureQueryClient(config) { + if (isQueryClientInitialized) { + throw new Error("Attempted to configure the QueryClient after initialization"); + } + queryClientConfig = config; +} +// PRIVATE API (framework code) +export function initializeQueryClient() { + const queryClient = new QueryClient(queryClientConfig !== null && queryClientConfig !== void 0 ? queryClientConfig : defaultQueryClientConfig); + isQueryClientInitialized = true; + resolveQueryClientInitialized(queryClient); +} +//# sourceMappingURL=queryClient.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queryClient.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queryClient.js.map new file mode 100644 index 000000000..82e2b1913 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/queryClient.js.map @@ -0,0 +1 @@ +{"version":3,"file":"queryClient.js","sourceRoot":"","sources":["../../../client/operations/queryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAqB,MAAM,uBAAuB,CAAA;AAEtE,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAEpC,IAAI,iBAAoC,EACtC,6BAAsD,EACtD,wBAAiC,CAAC;AAEpC,+BAA+B;AAC/B,MAAM,CAAC,MAAM,sBAAsB,GAAyB,IAAI,OAAO,CACrE,CAAC,OAAO,EAAE,EAAE;IACV,6BAA6B,GAAG,OAAO,CAAC;AAC1C,CAAC,CACF,CAAC;AAEF,aAAa;AACb,MAAM,UAAU,oBAAoB,CAAC,MAAyB;IAC5D,IAAI,wBAAwB,EAAE;QAC5B,MAAM,IAAI,KAAK,CACb,6DAA6D,CAC9D,CAAC;KACH;IAED,iBAAiB,GAAG,MAAM,CAAC;AAC7B,CAAC;AAED,+BAA+B;AAC/B,MAAM,UAAU,qBAAqB;IACnC,MAAM,WAAW,GAAG,IAAI,WAAW,CACjC,iBAAiB,aAAjB,iBAAiB,cAAjB,iBAAiB,GAAI,wBAAwB,CAC9C,CAAC;IACF,wBAAwB,GAAG,IAAI,CAAC;IAChC,6BAA6B,CAAC,WAAW,CAAC,CAAC;AAC7C,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/Link.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/Link.d.ts new file mode 100644 index 000000000..fe53898b9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/Link.d.ts @@ -0,0 +1,8 @@ +import { Link as RouterLink } from 'react-router-dom'; +import { type Routes } from './index'; +type RouterLinkProps = Parameters[0]; +export declare function Link({ to, params, search, hash, ...restOfProps }: Omit & { + search?: Record; + hash?: string; +} & Routes): import("react").JSX.Element; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/Link.jsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/Link.jsx new file mode 100644 index 000000000..d38b7a9c6 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/Link.jsx @@ -0,0 +1,23 @@ +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +}; +import { useMemo } from 'react'; +import { Link as RouterLink } from 'react-router-dom'; +import { interpolatePath } from './linkHelpers'; +// PUBLIC API +export function Link(_a) { + var { to, params, search, hash } = _a, restOfProps = __rest(_a, ["to", "params", "search", "hash"]); + const toPropWithParams = useMemo(() => { + return interpolatePath(to, params, search, hash); + }, [to, params]); + return ; +} +//# sourceMappingURL=Link.jsx.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/Link.jsx.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/Link.jsx.map new file mode 100644 index 000000000..bb738bdad --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/Link.jsx.map @@ -0,0 +1 @@ +{"version":3,"file":"Link.jsx","sourceRoot":"","sources":["../../../client/router/Link.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAK/C,aAAa;AACb,MAAM,UAAU,IAAI,CAClB,EAKQ;QALR,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,OAKlB,EALuB,WAAW,cAA1C,kCAA4C,CAAF;IAO1C,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,EAAE;QACpC,OAAO,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;IAClD,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAA;IAChB,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,gBAAgB,CAAC,CAAC,IAAI,WAAW,CAAC,EAAG,CAAA;AAC9D,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/index.d.ts new file mode 100644 index 000000000..067b2fbd7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/index.d.ts @@ -0,0 +1,9 @@ +import type { RouteDefinitionsToRoutes, OptionalRouteOptions } from './types'; +export declare const routes: { + readonly RootRoute: { + readonly to: "/"; + readonly build: (options?: OptionalRouteOptions) => string; + }; +}; +export type Routes = RouteDefinitionsToRoutes; +export { Link } from './Link'; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/index.js new file mode 100644 index 000000000..1a84b8d04 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/index.js @@ -0,0 +1,11 @@ +import { interpolatePath } from './linkHelpers'; +// PUBLIC API +export const routes = { + RootRoute: { + to: "/", + build: (options) => interpolatePath("/", undefined, options === null || options === void 0 ? void 0 : options.search, options === null || options === void 0 ? void 0 : options.hash), + }, +}; +// PUBLIC API +export { Link } from './Link'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/index.js.map new file mode 100644 index 000000000..35eeff35e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAO/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OAA8B,EAC9B,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC;KACrE;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.d.ts new file mode 100644 index 000000000..22fd81ec7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.d.ts @@ -0,0 +1,2 @@ +import type { Params, Search } from "./types"; +export declare function interpolatePath(path: string, params?: Params, search?: Search, hash?: string): string; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.js new file mode 100644 index 000000000..144c9efc7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.js @@ -0,0 +1,34 @@ +// PRIVATE API +export function interpolatePath(path, params, search, hash) { + const interpolatedPath = params ? interpolatePathParams(path, params) : path; + const interpolatedSearch = search + ? `?${new URLSearchParams(search).toString()}` + : ''; + const interpolatedHash = hash ? `#${hash}` : ''; + return interpolatedPath + interpolatedSearch + interpolatedHash; +} +function interpolatePathParams(path, params) { + function mapPathPart(part) { + if (part.startsWith(":")) { + const paramName = extractParamNameFromPathPart(part); + return params[paramName]; + } + return part; + } + const interpolatedPath = path + .split("/") + .map(mapPathPart) + .filter(isValidPathPart) + .join("/"); + return path.startsWith("/") ? `/${interpolatedPath}` : interpolatedPath; +} +function isValidPathPart(part) { + return !!part; +} +function extractParamNameFromPathPart(paramString) { + if (paramString.endsWith("?")) { + return paramString.slice(1, -1); + } + return paramString.slice(1); +} +//# sourceMappingURL=linkHelpers.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.js.map new file mode 100644 index 000000000..064bcce59 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/linkHelpers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YACxB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;SAC1B;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC7B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KACjC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/types.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/types.d.ts new file mode 100644 index 000000000..80d69a345 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/types.d.ts @@ -0,0 +1,30 @@ +export type RouteDefinitionsToRoutes = RouteDefinitionsToRoutesObj[keyof RouteDefinitionsToRoutesObj]; +export type OptionalRouteOptions = { + search?: Search; + hash?: string; +}; +export type ParamValue = string | number; +export type Params = { + [name: string]: ParamValue; +}; +export type Search = string[][] | Record | string | URLSearchParams; +type RouteDefinitionsToRoutesObj = { + [K in keyof Routes]: { + to: Routes[K]['to']; + } & ParamsFromBuildFn; +}; +type RoutesDefinition = { + [name: string]: { + to: string; + build: BuildFn; + }; +}; +type BuildFn = (params: unknown) => string; +type ParamsFromBuildFn = Parameters[0] extends { + params: infer Params; +} ? { + params: Params; +} : { + params?: never; +}; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/types.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/types.js new file mode 100644 index 000000000..718fd38ae --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/types.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/types.js.map new file mode 100644 index 000000000..7d60d6050 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/router/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../client/router/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/index.d.ts new file mode 100644 index 000000000..b684c869e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/index.d.ts @@ -0,0 +1 @@ +export { renderInContext, mockServer } from './vitest/helpers'; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/index.js new file mode 100644 index 000000000..be0d1c7d5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/index.js @@ -0,0 +1,2 @@ +export { renderInContext, mockServer } from './vitest/helpers'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/index.js.map new file mode 100644 index 000000000..33c10677b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/test/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/vitest/helpers.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/vitest/helpers.d.ts new file mode 100644 index 000000000..645112861 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/vitest/helpers.d.ts @@ -0,0 +1,13 @@ +import { ReactElement } from 'react'; +import { type SetupServer } from 'msw/node'; +import { RenderResult } from '@testing-library/react'; +import { Query } from 'wasp/client/operations/core'; +import { Route } from 'wasp/client'; +export type MockQuery = (query: Query, resJson: MockOutput) => void; +export type MockApi = (route: Route, resJson: unknown) => void; +export declare function renderInContext(ui: ReactElement): RenderResult; +export declare function mockServer(): { + server: SetupServer; + mockQuery: MockQuery; + mockApi: MockApi; +}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/vitest/helpers.jsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/vitest/helpers.jsx new file mode 100644 index 000000000..fcc9fc0b7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/vitest/helpers.jsx @@ -0,0 +1,64 @@ +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +}; +import { serialize as superjsonSerialize } from 'superjson'; +import { rest } from 'msw'; +import { setupServer } from 'msw/node'; +import { BrowserRouter as Router } from 'react-router-dom'; +import { render, cleanup } from '@testing-library/react'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { beforeAll, afterEach, afterAll } from 'vitest'; +import config from 'wasp/core/config'; +import { HttpMethod } from 'wasp/client'; +// PUBLIC API +// Inspired by the Tanstack React Query helper: +// https://github.com/TanStack/query/blob/4ae99561ca3383d6de3f4aad656a49ba4a17b57a/packages/react-query/src/__tests__/utils.tsx#L7-L26 +export function renderInContext(ui) { + const client = new QueryClient(); + const _a = render( + {ui} + ), { rerender } = _a, result = __rest(_a, ["rerender"]); + return Object.assign(Object.assign({}, result), { rerender: (rerenderUi) => rerender( + {rerenderUi} + ) }); +} +// PUBLIC API +export function mockServer() { + const server = setupServer(); + beforeAll(() => server.listen()); + afterEach(() => { + server.resetHandlers(); + cleanup(); + }); + afterAll(() => server.close()); + const mockQuery = (query, mockData) => { + const route = query.route; + mockRoute(server, route, (_req, res, ctx) => res(ctx.json(superjsonSerialize(mockData)))); + }; + const mockApi = (route, mockData) => { + mockRoute(server, route, (_req, res, ctx) => res(ctx.json(mockData))); + }; + return { server, mockQuery, mockApi }; +} +function mockRoute(server, route, responseHandler) { + if (!Object.values(HttpMethod).includes(route.method)) { + throw new Error(`Unsupported query method for mocking: ${route.method}. Supported method strings are: ${Object.values(HttpMethod).join(', ')}.`); + } + const url = `${config.apiUrl}${route.path}`; + const handlers = { + [HttpMethod.Get]: rest.get(url, responseHandler), + [HttpMethod.Post]: rest.post(url, responseHandler), + [HttpMethod.Put]: rest.put(url, responseHandler), + [HttpMethod.Delete]: rest.delete(url, responseHandler), + }; + server.use(handlers[route.method]); +} +//# sourceMappingURL=helpers.jsx.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/vitest/helpers.jsx.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/vitest/helpers.jsx.map new file mode 100644 index 000000000..de41e6093 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/test/vitest/helpers.jsx.map @@ -0,0 +1 @@ +{"version":3,"file":"helpers.jsx","sourceRoot":"","sources":["../../../../client/test/vitest/helpers.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,WAAW,C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D;QACrE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,eAAe,CAAC;QAChD,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC;QAClD,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,eAAe,CAAC;QAChD,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC;KACvD,CAAA;IAED,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;AACpC,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/config.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/config.d.ts new file mode 100644 index 000000000..b567b37b9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/config.d.ts @@ -0,0 +1,4 @@ +declare const config: { + apiUrl: string; +}; +export default config; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/config.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/config.js new file mode 100644 index 000000000..85d8f7e94 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/config.js @@ -0,0 +1,7 @@ +import { stripTrailingSlash } from 'wasp/universal/url'; +const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; +const config = { + apiUrl, +}; +export default config; +//# sourceMappingURL=config.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/config.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/config.js.map new file mode 100644 index 000000000..aa55beed8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/config.js.map @@ -0,0 +1 @@ +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../core/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAEvD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,uBAAuB,CAAC;AAEhG,MAAM,MAAM,GAAG;IACb,MAAM;CACP,CAAA;AAED,eAAe,MAAM,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/storage.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/storage.d.ts new file mode 100644 index 000000000..1beeea040 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/storage.d.ts @@ -0,0 +1,8 @@ +export type DataStore = { + getPrefixedKey(key: string): string; + set(key: string, value: unknown): void; + get(key: string): unknown; + remove(key: string): void; + clear(): void; +}; +export declare const storage: DataStore; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/storage.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/storage.js new file mode 100644 index 000000000..e54cbb3c5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/storage.js @@ -0,0 +1,41 @@ +function createLocalStorageDataStore(prefix) { + function getPrefixedKey(key) { + return `${prefix}:${key}`; + } + return { + getPrefixedKey, + set(key, value) { + ensureLocalStorageIsAvailable(); + localStorage.setItem(getPrefixedKey(key), JSON.stringify(value)); + }, + get(key) { + ensureLocalStorageIsAvailable(); + const value = localStorage.getItem(getPrefixedKey(key)); + try { + return value ? JSON.parse(value) : undefined; + } + catch (e) { + return undefined; + } + }, + remove(key) { + ensureLocalStorageIsAvailable(); + localStorage.removeItem(getPrefixedKey(key)); + }, + clear() { + ensureLocalStorageIsAvailable(); + Object.keys(localStorage).forEach((key) => { + if (key.startsWith(prefix)) { + localStorage.removeItem(key); + } + }); + }, + }; +} +export const storage = createLocalStorageDataStore('wasp'); +function ensureLocalStorageIsAvailable() { + if (!window.localStorage) { + throw new Error('Local storage is not available.'); + } +} +//# sourceMappingURL=storage.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/storage.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/storage.js.map new file mode 100644 index 000000000..b7cd5db44 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/core/storage.js.map @@ -0,0 +1 @@ +{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../core/storage.ts"],"names":[],"mappings":"AAQA,SAAS,2BAA2B,CAAC,MAAc;IACjD,SAAS,cAAc,CAAC,GAAW;QACjC,OAAO,GAAG,MAAM,IAAI,GAAG,EAAE,CAAA;IAC3B,CAAC;IAED,OAAO;QACL,cAAc;QACd,GAAG,CAAC,GAAG,EAAE,KAAK;YACZ,6BAA6B,EAAE,CAAA;YAC/B,YAAY,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAA;QAClE,CAAC;QACD,GAAG,CAAC,GAAG;YACL,6BAA6B,EAAE,CAAA;YAC/B,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAA;YACvD,IAAI;gBACF,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;aAC7C;YAAC,OAAO,CAAM,EAAE;gBACf,OAAO,SAAS,CAAA;aACjB;QACH,CAAC;QACD,MAAM,CAAC,GAAG;YACR,6BAA6B,EAAE,CAAA;YAC/B,YAAY,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAA;QAC9C,CAAC;QACD,KAAK;YACH,6BAA6B,EAAE,CAAA;YAC/B,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBACxC,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;oBAC1B,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;iBAC7B;YACH,CAAC,CAAC,CAAA;QACJ,CAAC;KACF,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,2BAA2B,CAAC,MAAM,CAAC,CAAA;AAE1D,SAAS,6BAA6B;IACpC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE;QACxB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;KACnD;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/dev/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/dev/index.d.ts new file mode 100644 index 000000000..14157874a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/dev/index.d.ts @@ -0,0 +1,11 @@ +/** + * Code found in this module is not meant to be used in user's server or client + * code. It is used by the Wasp tooling e.g. in the Tailwind config to resolve + * paths to the project root directory. + */ +/** + * Wasp runs the client code in the `web-app` directory which is nested in the + * .wasp/out/web-app directory. This function resolves a project root dir path + * to be relative to the `web-app` directory i.e. `../../../projectDirPath`. + */ +export declare function resolveProjectPath(path: string): string; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/dev/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/dev/index.js new file mode 100644 index 000000000..bd2558941 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/dev/index.js @@ -0,0 +1,16 @@ +/** + * Code found in this module is not meant to be used in user's server or client + * code. It is used by the Wasp tooling e.g. in the Tailwind config to resolve + * paths to the project root directory. + */ +import { join as joinPaths } from 'path'; +// PUBLIC API +/** + * Wasp runs the client code in the `web-app` directory which is nested in the + * .wasp/out/web-app directory. This function resolves a project root dir path + * to be relative to the `web-app` directory i.e. `../../../projectDirPath`. + */ +export function resolveProjectPath(path) { + return joinPaths('../../../', path); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/dev/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/dev/index.js.map new file mode 100644 index 000000000..6874fe15b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/dev/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../dev/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,MAAM,CAAA;AAExC,aAAa;AACb;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;AACrC,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/entities/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/entities/index.d.ts new file mode 100644 index 000000000..0af05cd18 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/entities/index.d.ts @@ -0,0 +1,3 @@ +export {} from "@prisma/client"; +export type Entity = never; +export type EntityName = never; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/entities/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/entities/index.js new file mode 100644 index 000000000..f8a711af8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/entities/index.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/entities/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/entities/index.js.map new file mode 100644 index 000000000..28316c97d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/entities/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../entities/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/ext-src/MainPage.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/ext-src/MainPage.d.ts new file mode 100644 index 000000000..891990a1c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/ext-src/MainPage.d.ts @@ -0,0 +1 @@ +export function MainPage(): import("react").JSX.Element; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/ext-src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/ext-src/MainPage.jsx new file mode 100644 index 000000000..1ecd86d31 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/ext-src/MainPage.jsx @@ -0,0 +1,29 @@ +import waspLogo from "./waspLogo.png"; +import "./Main.css"; +export function MainPage() { + return (
+
+
+ wasp +
+ +

+ Welcome to Wasp - you just started a new app!{" "} +

+

+ This is page MainPage located at route /. + Open src/client/MainPage.jsx to edit it. +

+ + +
+
); +} +//# sourceMappingURL=MainPage.jsx.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/ext-src/MainPage.jsx.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/ext-src/MainPage.jsx.map new file mode 100644 index 000000000..bc78a183b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/ext-src/MainPage.jsx.map @@ -0,0 +1 @@ +{"version":3,"file":"MainPage.jsx","sourceRoot":"","sources":["../../ext-src/MainPage.jsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,YAAY,CAAC;AAEpB,MAAM,UAAU,QAAQ;IACtB,OAAO,CACL,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,CACxB;MAAA,CAAC,IAAI,CACH;QAAA,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CACnB;UAAA,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,MAAM,EAChC;QAAA,EAAE,GAAG,CAEL;;QAAA,CAAC,EAAE,CAAC,SAAS,CAAC,eAAe,CAC3B;uDAA6C,CAAC,GAAG,CACnD;QAAA,EAAE,EAAE,CACJ;QAAA,CAAC,EAAE,CAAC,SAAS,CAAC,kBAAkB,CAC9B;uBAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAE,kBAAiB,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;eAC7D,CAAC,IAAI,CAAC,uBAAuB,EAAE,IAAI,CAAE;QAC5C,EAAE,EAAE,CAEJ;;QAAA,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CACtB;UAAA,CAAC,CAAC,CACA,SAAS,CAAC,sBAAsB,CAChC,IAAI,CAAC,4CAA4C,CACjD,MAAM,CAAC,QAAQ,CACf,GAAG,CAAC,qBAAqB,CAEzB;;UACF,EAAE,CAAC,CACH;UAAA,CAAC,CAAC,CACA,SAAS,CAAC,uBAAuB,CACjC,IAAI,CAAC,oCAAoC,CACzC,MAAM,CAAC,QAAQ,CACf,GAAG,CAAC,qBAAqB,CAEzB;;UACF,EAAE,CAAC,CACL;QAAA,EAAE,GAAG,CACP;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.d.ts new file mode 100644 index 000000000..56b8d88ec --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.d.ts @@ -0,0 +1,5 @@ +export declare class HttpError extends Error { + statusCode: number; + data: unknown; + constructor(statusCode: number, message?: string, data?: Record, ...params: unknown[]); +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js new file mode 100644 index 000000000..3e216e57c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js @@ -0,0 +1,17 @@ +export class HttpError extends Error { + constructor(statusCode, message, data, ...params) { + super(message, ...params); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, HttpError); + } + this.name = this.constructor.name; + if (!(Number.isInteger(statusCode) && statusCode >= 400 && statusCode < 600)) { + throw new Error('statusCode has to be integer in range [400, 600).'); + } + this.statusCode = statusCode; + if (data) { + this.data = data; + } + } +} +//# sourceMappingURL=HttpError.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js.map new file mode 100644 index 000000000..34064e924 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js.map @@ -0,0 +1 @@ +{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YAAa,UAAkB,EAAE,OAAgB,EAAE,IAA8B,EAAE,GAAG,MAAiB;QACrG,KAAK,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAA;QAEzB,IAAI,KAAK,CAAC,iBAAiB,EAAE;YAC3B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;SACzC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EAAE;YAC5E,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;SACrE;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE;YACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;SACjB;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/index.d.ts new file mode 100644 index 000000000..7f50bdcfc --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/index.d.ts @@ -0,0 +1,18 @@ +import { type Expand } from 'wasp/universal/types'; +import { type Request, type Response } from 'express'; +import { type ParamsDictionary as ExpressParams, type Query as ExpressQuery } from 'express-serve-static-core'; +import { type _Entity } from "./taggedEntities"; +import { type Payload } from "./serialization"; +export * from "./taggedEntities"; +export * from "./serialization"; +export type Query = Operation; +export type Action = Operation; +type Operation = (args: Input, context: Context) => Output | Promise; +export type Api> = (req: Request, res: Response, context: Context) => void; +type EntityMap = { + [EntityName in Entities[number]["_entityName"]]: PrismaDelegate[EntityName]; +}; +export type PrismaDelegate = {}; +type Context = Expand<{ + entities: Expand>; +}>; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/index.js new file mode 100644 index 000000000..814a00a31 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/index.js @@ -0,0 +1,3 @@ +export * from "./taggedEntities"; +export * from "./serialization"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/index.js.map new file mode 100644 index 000000000..692d12fac --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/_types/index.ts"],"names":[],"mappings":"AAOA,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/serialization.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/serialization.d.ts new file mode 100644 index 000000000..8338115ad --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/serialization.d.ts @@ -0,0 +1,16 @@ +export type Payload = void | SuperJSONValue; +export type JSONValue = PrimitiveJSONValue | JSONArray | JSONObject; +export interface JSONObject { + [key: string]: JSONValue; +} +type PrimitiveJSONValue = string | number | boolean | undefined | null; +export interface JSONArray extends Array { +} +type SerializableJSONValue = Symbol | Set | Map | undefined | bigint | Date | RegExp; +type SuperJSONValue = JSONValue | SerializableJSONValue | SuperJSONArray | SuperJSONObject; +interface SuperJSONArray extends Array { +} +interface SuperJSONObject { + [key: string]: SuperJSONValue; +} +export {}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/serialization.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/serialization.js new file mode 100644 index 000000000..085463a73 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/serialization.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=serialization.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/serialization.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/serialization.js.map new file mode 100644 index 000000000..4be6f7733 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/serialization.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serialization.js","sourceRoot":"","sources":["../../../server/_types/serialization.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/taggedEntities.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/taggedEntities.d.ts new file mode 100644 index 000000000..5e88022f3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/taggedEntities.d.ts @@ -0,0 +1 @@ +export type _Entity = never; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/taggedEntities.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/taggedEntities.js new file mode 100644 index 000000000..bf72aeef4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/taggedEntities.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=taggedEntities.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/taggedEntities.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/taggedEntities.js.map new file mode 100644 index 000000000..d71698149 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/taggedEntities.js.map @@ -0,0 +1 @@ +{"version":3,"file":"taggedEntities.js","sourceRoot":"","sources":["../../../server/_types/taggedEntities.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.d.ts new file mode 100644 index 000000000..223bb1b22 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.d.ts @@ -0,0 +1,15 @@ +type BaseConfig = { + allowedCORSOrigins: string | string[]; +}; +type CommonConfig = BaseConfig & { + env: string; + isDevelopment: boolean; + port: number; + databaseUrl: string | undefined; +}; +type EnvConfig = BaseConfig & { + frontendUrl: string; +}; +type Config = CommonConfig & EnvConfig; +declare const resolvedConfig: Config; +export default resolvedConfig; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js new file mode 100644 index 000000000..6de1c8d25 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js @@ -0,0 +1,32 @@ +import merge from 'lodash.merge'; +import { stripTrailingSlash } from "wasp/universal/url"; +const env = process.env.NODE_ENV || 'development'; +const config = { + all: { + env, + isDevelopment: env === 'development', + port: parseInt(process.env.PORT) || 3001, + databaseUrl: process.env.DATABASE_URL, + allowedCORSOrigins: [], + }, + development: getDevelopmentConfig(), + production: getProductionConfig(), +}; +const resolvedConfig = merge(config.all, config[env]); +// PUBLIC API +export default resolvedConfig; +function getDevelopmentConfig() { + const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL || 'http://localhost:3000/'); + return { + frontendUrl, + allowedCORSOrigins: '*', + }; +} +function getProductionConfig() { + const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); + return { + frontendUrl, + allowedCORSOrigins: [frontendUrl], + }; +} +//# sourceMappingURL=config.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js.map new file mode 100644 index 000000000..4b121ba37 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js.map @@ -0,0 +1 @@ +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,cAAc,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAA;AAwBjD,MAAM,MAAM,GAIR;IACF,GAAG,EAAE;QACH,GAAG;QACH,aAAa,EAAE,GAAG,KAAK,aAAa;QACpC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI;QACxC,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;QACrC,kBAAkB,EAAE,EAAE;KACvB;IACD,WAAW,EAAE,oBAAoB,EAAE;IACnC,UAAU,EAAE,mBAAmB,EAAE;CAClC,CAAA;AAED,MAAM,cAAc,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;AAC7D,aAAa;AACb,eAAe,cAAc,CAAA;AAE7B,SAAS,oBAAoB;IAC3B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,wBAAwB,CAAC,CAAC;IACpG,OAAO;QACL,WAAW;QACX,kBAAkB,EAAE,GAAG;KACxB,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxE,OAAO;QACL,WAAW;QACX,kBAAkB,EAAE,CAAC,WAAW,CAAC;KAClC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/dbClient.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/dbClient.d.ts new file mode 100644 index 000000000..396ea0891 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/dbClient.d.ts @@ -0,0 +1,2 @@ +declare const dbClient: null; +export default dbClient; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/dbClient.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/dbClient.js new file mode 100644 index 000000000..a5d8ecd5d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/dbClient.js @@ -0,0 +1,12 @@ +// * Prisma will not generate a PrismaClient if there no +// entities in the schema. Trying to init the PrismaClient +// will throw an error. +// * To avoid throwing an error, we return null if there are no +// entities in the schema. +function createDbClient() { + return null; +} +const dbClient = createDbClient(); +// PUBLIC API +export default dbClient; +//# sourceMappingURL=dbClient.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/dbClient.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/dbClient.js.map new file mode 100644 index 000000000..677fd6e5d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/dbClient.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dbClient.js","sourceRoot":"","sources":["../../server/dbClient.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,4DAA4D;AAC5D,yBAAyB;AACzB,+DAA+D;AAC/D,4BAA4B;AAC5B,SAAS,cAAc;IACrB,OAAO,IAAI,CAAA;AACb,CAAC;AAED,MAAM,QAAQ,GAAG,cAAc,EAAE,CAAA;AAEjC,aAAa;AACb,eAAe,QAAQ,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.d.ts new file mode 100644 index 000000000..dee9613a5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.d.ts @@ -0,0 +1,7 @@ +import type { PrismaClient } from '@prisma/client'; +export { default as config } from './config.js'; +export { default as prisma } from './dbClient.js'; +export { type ServerSetupFn } from './types/index.js'; +export { HttpError } from './HttpError.js'; +export { MiddlewareConfigFn } from './middleware/index.js'; +export type DbSeedFn = (prisma: PrismaClient) => Promise; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.js new file mode 100644 index 000000000..0e53e0dea --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.js @@ -0,0 +1,7 @@ +// PUBLIC API +export { default as config } from './config.js'; +// PUBLIC API +export { default as prisma } from './dbClient.js'; +// PUBLIC API +export { HttpError } from './HttpError.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.js.map new file mode 100644 index 000000000..b84ac1b30 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/index.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAA;AAC/C,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,eAAe,CAAA;AAGjD,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts new file mode 100644 index 000000000..617cac8a7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts @@ -0,0 +1,3 @@ +import { type RequestHandler } from 'express'; +export type MiddlewareConfigFn = (middlewareConfig: MiddlewareConfig) => MiddlewareConfig; +export type MiddlewareConfig = Map; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/globalMiddleware.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/globalMiddleware.js new file mode 100644 index 000000000..0926cba3d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/globalMiddleware.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=globalMiddleware.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/globalMiddleware.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/globalMiddleware.js.map new file mode 100644 index 000000000..0490e6f7e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/globalMiddleware.js.map @@ -0,0 +1 @@ +{"version":3,"file":"globalMiddleware.js","sourceRoot":"","sources":["../../../server/middleware/globalMiddleware.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/index.d.ts new file mode 100644 index 000000000..4204eb294 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/index.d.ts @@ -0,0 +1 @@ +export * from './globalMiddleware.js'; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/index.js new file mode 100644 index 000000000..db90d2875 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/index.js @@ -0,0 +1,2 @@ +export * from './globalMiddleware.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/index.js.map new file mode 100644 index 000000000..23374314b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/middleware/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/middleware/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/index.d.ts new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/index.js new file mode 100644 index 000000000..f8a711af8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/index.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/index.js.map new file mode 100644 index 000000000..273573159 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/operations/actions/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/types.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/types.d.ts new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/types.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/types.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/types.js new file mode 100644 index 000000000..718fd38ae --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/types.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/types.js.map new file mode 100644 index 000000000..43367cc65 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/actions/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../server/operations/actions/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/index.d.ts new file mode 100644 index 000000000..ee6ed4259 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/index.d.ts @@ -0,0 +1,2 @@ +export * from './queries/types.js'; +export * from './actions/types.js'; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/index.js new file mode 100644 index 000000000..dde0d8e4a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/index.js @@ -0,0 +1,5 @@ +// PUBLIC API +export * from './queries/types.js'; +// PUBLIC API +export * from './actions/types.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/index.js.map new file mode 100644 index 000000000..3e4a082c0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/operations/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,cAAc,oBAAoB,CAAA;AAClC,aAAa;AACb,cAAc,oBAAoB,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/index.d.ts new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/index.js new file mode 100644 index 000000000..f8a711af8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/index.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/index.js.map new file mode 100644 index 000000000..d36dc482c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/operations/queries/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/types.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/types.d.ts new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/types.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/types.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/types.js new file mode 100644 index 000000000..718fd38ae --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/types.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/types.js.map new file mode 100644 index 000000000..c4eb8778e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/operations/queries/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../server/operations/queries/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/types/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/types/index.d.ts new file mode 100644 index 000000000..ce2e8cb99 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/types/index.d.ts @@ -0,0 +1,8 @@ +/// +import { type Application } from 'express'; +import { Server } from 'http'; +export type ServerSetupFn = (context: ServerSetupFnContext) => Promise; +export type ServerSetupFnContext = { + app: Application; + server: Server; +}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/types/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/types/index.js new file mode 100644 index 000000000..f8a711af8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/types/index.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/types/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/types/index.js.map new file mode 100644 index 000000000..4ab1f1d59 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/types/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/types/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.d.ts new file mode 100644 index 000000000..266b9c6fb --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.d.ts @@ -0,0 +1,12 @@ +import { Request, Response, NextFunction } from 'express'; +type RequestWithExtraFields = Request & {}; +/** + * Decorator for async express middleware that handles promise rejections. + * @param {Func} middleware - Express middleware function. + * @returns Express middleware that is exactly the same as the given middleware but, + * if given middleware returns promise, reject of that promise will be correctly handled, + * meaning that error will be forwarded to next(). + */ +export declare const handleRejection: (middleware: (req: RequestWithExtraFields, res: Response, next: NextFunction) => any) => (req: RequestWithExtraFields, res: Response, next: NextFunction) => Promise; +export declare const sleep: (ms: number) => Promise; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.js new file mode 100644 index 000000000..9b2034006 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.js @@ -0,0 +1,17 @@ +/** + * Decorator for async express middleware that handles promise rejections. + * @param {Func} middleware - Express middleware function. + * @returns Express middleware that is exactly the same as the given middleware but, + * if given middleware returns promise, reject of that promise will be correctly handled, + * meaning that error will be forwarded to next(). + */ +export const handleRejection = (middleware) => async (req, res, next) => { + try { + await middleware(req, res, next); + } + catch (error) { + next(error); + } +}; +export const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.js.map new file mode 100644 index 000000000..f3af56114 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../server/utils.ts"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,UAIQ,EACR,EAAE,CACJ,KAAK,EAAE,GAA2B,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACvE,IAAI;QACF,MAAM,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;KACjC;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,KAAK,CAAC,CAAA;KACZ;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAAU,EAAoB,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/types.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/types.d.ts new file mode 100644 index 000000000..14dd465dc --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/types.d.ts @@ -0,0 +1,5 @@ +export type Expand = T extends (...args: infer A) => infer R ? (...args: A) => R : T extends infer O ? { + [K in keyof O]: O[K]; +} : never; +export type _Awaited = T extends Promise ? _Awaited : T; +export type _ReturnType unknown> = T extends (...args: never[]) => infer R ? R : never; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/types.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/types.js new file mode 100644 index 000000000..718fd38ae --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/types.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/types.js.map new file mode 100644 index 000000000..8c06b33e9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../universal/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.d.ts new file mode 100644 index 000000000..aa893e783 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.d.ts @@ -0,0 +1 @@ +export declare function stripTrailingSlash(url?: string): string | undefined; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.js new file mode 100644 index 000000000..988c0a67a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.js @@ -0,0 +1,4 @@ +export function stripTrailingSlash(url) { + return url === null || url === void 0 ? void 0 : url.replace(/\/$/, ""); +} +//# sourceMappingURL=url.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.js.map new file mode 100644 index 000000000..a7bad9602 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.js.map @@ -0,0 +1 @@ +{"version":3,"file":"url.js","sourceRoot":"","sources":["../../universal/url.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC3C,OAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/validators.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/validators.d.ts new file mode 100644 index 000000000..bd179246a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/validators.d.ts @@ -0,0 +1,2 @@ +export declare function isValidAbsoluteURL(rawUrl: string): boolean; +export declare function throwIfNotValidAbsoluteURL(value: string | undefined, name: string): void; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/validators.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/validators.js new file mode 100644 index 000000000..53462b393 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/validators.js @@ -0,0 +1,22 @@ +export function isValidAbsoluteURL(rawUrl) { + try { + const url = new URL(rawUrl); + /* + URL constructor will parse some invalid absolute URLs as valid URLs + so we need to do some extra checks. + + Example: "localhost:3000" will be parsed as URL with protocol of + "localhost:" and host of "3000" + */ + return url.protocol === "http:" || url.protocol === "https:"; + } + catch (e) { + return false; + } +} +export function throwIfNotValidAbsoluteURL(value, name) { + if (value && !isValidAbsoluteURL(value)) { + throw new Error(`${name} must be a valid absolute URL`); + } +} +//# sourceMappingURL=validators.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/validators.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/validators.js.map new file mode 100644 index 000000000..313c98cef --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/validators.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../universal/validators.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC7C,IAAI;QACA,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;QAC5B;;;;;;UAME;QACF,OAAO,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC;KAChE;IAAC,OAAO,CAAC,EAAE;QACR,OAAO,KAAK,CAAC;KAChB;AACL,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,KAAyB,EAAE,IAAY;IAC9E,IAAI,KAAK,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE;QACrC,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,+BAA+B,CAAC,CAAC;KAC3D;AACL,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/entities/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/entities/index.ts new file mode 100644 index 000000000..faaea5d41 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/entities/index.ts @@ -0,0 +1,11 @@ +import { +} from "@prisma/client" + +export { +} from "@prisma/client" + +export type Entity = + | never + +export type EntityName = + | never diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/ext-src/Main.css b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/ext-src/Main.css new file mode 100644 index 000000000..b6e7ed3f1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/ext-src/Main.css @@ -0,0 +1,89 @@ +* { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + box-sizing: border-box; +} + +body { + margin: 0; + padding: 0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", + "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", + sans-serif; +} + +.container { + min-height: 100vh; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +main { + padding: 5rem 0; + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +main p { + font-size: 1.2rem; +} + +.logo { + margin-bottom: 2rem; +} + +.logo img { + max-height: 200px; +} + +.welcome-title { + font-weight: 500; +} + +.welcome-subtitle { + font-weight: 400; + margin-bottom: 3rem; +} + +.buttons { + display: flex; + flex-direction: row; +} + +.buttons .button:not(:last-child) { + margin-right: 0.5rem; +} + +.button { + border-radius: 3px; + font-size: 1.2rem; + padding: 1rem 2rem; + text-align: center; + font-weight: 700; + text-decoration: none; +} + +.button-filled { + border: 2px solid #bf9900; + background-color: #bf9900; + color: #f4f4f4; +} + +.button-outline { + border: 2px solid #8a9cff; + color: #8a9cff; + background-color: none; +} + +code { + border-radius: 5px; + padding: 0.2rem; + background: #efefef; + font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, + Bitstream Vera Sans Mono, Courier New, monospace; +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/ext-src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/ext-src/MainPage.jsx new file mode 100644 index 000000000..01aae7c3d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/ext-src/MainPage.jsx @@ -0,0 +1,41 @@ +import waspLogo from "./waspLogo.png"; +import "./Main.css"; + +export function MainPage() { + return ( +
+
+
+ wasp +
+ +

+ Welcome to Wasp - you just started a new app!{" "} +

+

+ This is page MainPage located at route /. + Open src/client/MainPage.jsx to edit it. +

+ + +
+
+ ); +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/ext-src/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/ext-src/vite-env.d.ts new file mode 100644 index 000000000..11f02fe2a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/ext-src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/ext-src/waspLogo.png b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/ext-src/waspLogo.png new file mode 100644 index 0000000000000000000000000000000000000000..d39a9443a8153b158b76f51dda2e42f3b34a9169 GIT binary patch literal 24877 zcmYg&bwHEf_dk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6NpZxC%AdoL+aLs|J}XUI>AsLZaVqav)+gNlGk$_i@SbTriFZ^bHsC7dJ4mFog1HS`Vl|F0SA`D|hKqjE zpsT}zwGot z7^$C4*AU>N^KpK|+lw9g8of~^JRp*w5A?&qD9(|c>}u}AfUu})`g0`OuUTC#|4mm{ z@?$Z)I3b+t*h%rs4>3~2Ytx~aSMMBEu;DgZ7xfgjD3IorKFqiF8Np={ zQ*{9^fEioJ<+v|M$LBrXGa~xr!Ew|^q5kB&gBAUGTpz^PS<3E}w0NQv{KM)`R|QZ{v8ox& zN*}brATIJsb=(CvcYt7lH~Hh&?EEmP(BCsJ01{h#%V{BJ$;LMxcaY zH0dDS^=F`$ZiHuumotF2qz_xX%1?FeD;Lm9P|aPL_>|Jp#!%wc&|4msLWE}){?wC% z7=R@)cqBQfiKKtcy=>$#R4hxHfwk2Ti$bLH-vRD$QH*K&vyyIa2C0@L54l0HAkfgx zGOsZJl##0WX5SYdB6!EOV|E&R;*k{s=wj4eCL>I7T(MW92}WXZ78}<5xpn9P`!<9W@RMoOdj?Ks?PTt-)|5$$>agZ%9WlWMO~fA~%@h z3Yz=2tYB<*j4my>_32jxHxFv#4yMy6m+V2V1@wH0x|0LzJR}$nW);N9nO!r5YTb+k9&@Vlqb$WWu=JR-B6w@ zTxOiLX~sG0yg9e#j(>yIXcSDb68n7$RAS!)oN|L#e7EI}*=h=y+2cf_di5@h8iWfu zY`Re<9J#_OB9;>FCVQQ=OU4T)`CEDGx=$LlX4r0OR4%>xd>?%WM388~nGY`kV&j5d z#^qgx8fSGj+)boYY360q&E=YEh~|=VMd|OWU&ekrRFg9lddgp;bId&b@!*HIjj^v?44kvS z3yU<>-KmW5bJlm~$E@J{sxd, ...params: unknown[]) { + super(message, ...params) + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, HttpError) + } + + this.name = this.constructor.name + + if (!(Number.isInteger(statusCode) && statusCode >= 400 && statusCode < 600)) { + throw new Error('statusCode has to be integer in range [400, 600).') + } + this.statusCode = statusCode + + if (data) { + this.data = data + } + } +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/_types/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/_types/index.ts new file mode 100644 index 000000000..137aa69a9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/_types/index.ts @@ -0,0 +1,45 @@ +import { type Expand } from 'wasp/universal/types'; +import { type Request, type Response } from 'express' +import { type ParamsDictionary as ExpressParams, type Query as ExpressQuery } from 'express-serve-static-core' +import { prisma } from 'wasp/server' +import { type _Entity } from "./taggedEntities" +import { type Payload } from "./serialization"; + +export * from "./taggedEntities" +export * from "./serialization" + +export type Query = + Operation + +export type Action = + Operation + +type Operation = ( + args: Input, + context: Context, +) => Output | Promise + +export type Api< + Entities extends _Entity[], + Params extends ExpressParams, + ResBody, + ReqBody, + ReqQuery extends ExpressQuery, + Locals extends Record +> = ( + req: Request, + res: Response, + context: Context, +) => void + +type EntityMap = { + [EntityName in Entities[number]["_entityName"]]: PrismaDelegate[EntityName] +} + +export type PrismaDelegate = { +} + +type Context = Expand<{ + entities: Expand> +}> + diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/_types/serialization.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/_types/serialization.ts new file mode 100644 index 000000000..c8ff9c1ae --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/_types/serialization.ts @@ -0,0 +1,43 @@ +export type Payload = void | SuperJSONValue + +// The part below was copied from SuperJSON and slightly modified: +// https://github.com/blitz-js/superjson/blob/ae7dbcefe5d3ece5b04be0c6afe6b40f3a44a22a/src/types.ts +// +// We couldn't use SuperJSON's types directly because: +// 1. They aren't exported publicly. +// 2. They have a werid quirk that turns `SuperJSONValue` into `any`. +// See why here: +// https://github.com/blitz-js/superjson/pull/36#issuecomment-669239876 +// +// We changed the code as little as possible to make future comparisons easier. +export type JSONValue = PrimitiveJSONValue | JSONArray | JSONObject + +export interface JSONObject { + [key: string]: JSONValue +} + +type PrimitiveJSONValue = string | number | boolean | undefined | null + +export interface JSONArray extends Array {} + +type SerializableJSONValue = + | Symbol + | Set + | Map + | undefined + | bigint + | Date + | RegExp + +// Here's where we excluded `ClassInstance` (which was `any`) from the union. +type SuperJSONValue = + | JSONValue + | SerializableJSONValue + | SuperJSONArray + | SuperJSONObject + +interface SuperJSONArray extends Array {} + +interface SuperJSONObject { + [key: string]: SuperJSONValue +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/_types/taggedEntities.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/_types/taggedEntities.ts new file mode 100644 index 000000000..61c6677ae --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/_types/taggedEntities.ts @@ -0,0 +1,16 @@ +// Wasp internally uses the types defined in this file for typing entity maps in +// operation contexts. +// +// We must explicitly tag all entities with their name to avoid issues with +// structural typing. See https://github.com/wasp-lang/wasp/pull/982 for details. +import { + type Entity, + type EntityName, +} from 'wasp/entities' + + +export type _Entity = + | never + +type WithName = + E & { _entityName: Name } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/config.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/config.ts new file mode 100644 index 000000000..07c90ee26 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/config.ts @@ -0,0 +1,63 @@ +import merge from 'lodash.merge' + +import { stripTrailingSlash } from "wasp/universal/url"; + +const env = process.env.NODE_ENV || 'development' + +// TODO: +// - Use dotenv library to consume env vars from a file. +// - Use convict library to define schema and validate env vars. +// https://codingsans.com/blog/node-config-best-practices + +type BaseConfig = { + allowedCORSOrigins: string | string[]; +} + +type CommonConfig = BaseConfig & { + env: string; + isDevelopment: boolean; + port: number; + databaseUrl: string | undefined; +} + +type EnvConfig = BaseConfig & { + frontendUrl: string; +} + +type Config = CommonConfig & EnvConfig + +const config: { + all: CommonConfig, + development: EnvConfig, + production: EnvConfig, +} = { + all: { + env, + isDevelopment: env === 'development', + port: parseInt(process.env.PORT) || 3001, + databaseUrl: process.env.DATABASE_URL, + allowedCORSOrigins: [], + }, + development: getDevelopmentConfig(), + production: getProductionConfig(), +} + +const resolvedConfig: Config = merge(config.all, config[env]) +// PUBLIC API +export default resolvedConfig + +function getDevelopmentConfig(): EnvConfig { + const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL || 'http://localhost:3000/'); + return { + frontendUrl, + allowedCORSOrigins: '*', + } +} + +function getProductionConfig(): EnvConfig { + const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); + return { + frontendUrl, + allowedCORSOrigins: [frontendUrl], + } +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/dbClient.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/dbClient.ts new file mode 100644 index 000000000..0084433d0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/dbClient.ts @@ -0,0 +1,13 @@ +// * Prisma will not generate a PrismaClient if there no +// entities in the schema. Trying to init the PrismaClient +// will throw an error. +// * To avoid throwing an error, we return null if there are no +// entities in the schema. +function createDbClient(): null { + return null +} + +const dbClient = createDbClient() + +// PUBLIC API +export default dbClient diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/index.ts new file mode 100644 index 000000000..535077900 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/index.ts @@ -0,0 +1,15 @@ +import type { PrismaClient } from '@prisma/client' + +// PUBLIC API +export { default as config } from './config.js' +// PUBLIC API +export { default as prisma } from './dbClient.js' +// PUBLIC API +export { type ServerSetupFn } from './types/index.js' +// PUBLIC API +export { HttpError } from './HttpError.js' +// PUBLIC API +export { MiddlewareConfigFn } from './middleware/index.js' + +// PUBLIC API +export type DbSeedFn = (prisma: PrismaClient) => Promise diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/middleware/globalMiddleware.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/middleware/globalMiddleware.ts new file mode 100644 index 000000000..8bab5e470 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/middleware/globalMiddleware.ts @@ -0,0 +1,8 @@ +import { type RequestHandler } from 'express' + +// PUBLIC API +export type MiddlewareConfigFn = (middlewareConfig: MiddlewareConfig) => MiddlewareConfig + +// PRIVATE API +export type MiddlewareConfig = Map + diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/middleware/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/middleware/index.ts new file mode 100644 index 000000000..50996ec27 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/middleware/index.ts @@ -0,0 +1 @@ +export * from './globalMiddleware.js' diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/actions/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/actions/index.ts new file mode 100644 index 000000000..78b2ff0a4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/actions/index.ts @@ -0,0 +1,2 @@ +import { prisma } from 'wasp/server' + diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/actions/types.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/actions/types.ts new file mode 100644 index 000000000..183065b86 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/actions/types.ts @@ -0,0 +1,4 @@ +import { + type Payload, +} from 'wasp/server/_types' + diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/index.ts new file mode 100644 index 000000000..5d50ecb37 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/index.ts @@ -0,0 +1,4 @@ +// PUBLIC API +export * from './queries/types.js' +// PUBLIC API +export * from './actions/types.js' diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/queries/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/queries/index.ts new file mode 100644 index 000000000..78b2ff0a4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/queries/index.ts @@ -0,0 +1,2 @@ +import { prisma } from 'wasp/server' + diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/queries/types.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/queries/types.ts new file mode 100644 index 000000000..a156fb294 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/operations/queries/types.ts @@ -0,0 +1,5 @@ + +import { + type Payload, +} from 'wasp/server/_types' + diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/types/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/types/index.ts new file mode 100644 index 000000000..1bbffc755 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/types/index.ts @@ -0,0 +1,11 @@ +import { type Application } from 'express' +import { Server } from 'http' + +// PUBLIC API +export type ServerSetupFn = (context: ServerSetupFnContext) => Promise + +// PRIVATE API (server) +export type ServerSetupFnContext = { + app: Application, + server: Server, +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/utils.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/utils.ts new file mode 100644 index 000000000..c8cc82334 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/utils.ts @@ -0,0 +1,34 @@ +import crypto from 'crypto' +import { Request, Response, NextFunction } from 'express' + +import { readdir } from 'fs' +import { dirname } from 'path' +import { fileURLToPath } from 'url' + + +type RequestWithExtraFields = Request & { +} + +/** + * Decorator for async express middleware that handles promise rejections. + * @param {Func} middleware - Express middleware function. + * @returns Express middleware that is exactly the same as the given middleware but, + * if given middleware returns promise, reject of that promise will be correctly handled, + * meaning that error will be forwarded to next(). + */ +export const handleRejection = ( + middleware: ( + req: RequestWithExtraFields, + res: Response, + next: NextFunction + ) => any +) => +async (req: RequestWithExtraFields, res: Response, next: NextFunction) => { + try { + await middleware(req, res, next) + } catch (error) { + next(error) + } +} + +export const sleep = (ms: number): Promise => new Promise((r) => setTimeout(r, ms)) diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/tsconfig.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/tsconfig.json new file mode 100644 index 000000000..a7030c61d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/tsconfig.json @@ -0,0 +1,44 @@ +{ + "extends": "@tsconfig/node18/tsconfig.json", + "compilerOptions": { + "jsx": "preserve", + "lib": [ + "esnext", + "dom", + "DOM.Iterable" + ], + "declaration": true, + "strict": false, + // Overriding this because we want to use top-level await + "module": "esnext", + "target": "es2017", + // Enable source map for debugging and go-to-definition + "sourceMap": true, + // The remaining settings should match the extended nodeXY/tsconfig.json, but I kept + // them here to be explicit. + // Enable default imports in TypeScript. + "esModuleInterop": true, + "moduleResolution": "node", + "outDir": "dist", + "allowJs": true, + "types": [ + // This is needed to properly support Vitest testing with jest-dom matchers. + // Types for jest-dom are not recognized automatically and Typescript complains + // about missing types e.g. when using `toBeInTheDocument` and other matchers. + "@testing-library/jest-dom" + ], + // todo(filip): Only works with common js, see https://www.typescriptlang.org/tsconfig#paths and daily-article. + // "paths": { + // "@wasp/*": [ + // "./*.js" + // ] + // } + }, + "include": [ + "." + ], + "exclude": [ + "node_modules", + "dist" + ] +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/types.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/types.ts new file mode 100644 index 000000000..8cadbd740 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/types.ts @@ -0,0 +1,31 @@ +// This is a helper type used exclusively for DX purposes. It's a No-op for the +// compiler, but expands the type's representatoin in IDEs (i.e., inlines all +// type constructors) to make it more readable for the user. +// +// It expands this SO answer to functions: https://stackoverflow.com/a/57683652 +export type Expand = T extends (...args: infer A) => infer R + ? (...args: A) => R + : T extends infer O + ? { [K in keyof O]: O[K] } + : never + +// TypeScript's native Awaited type exhibits strange behavior in VS Code (see +// https://github.com/wasp-lang/wasp/pull/1090#discussion_r1159687537 for +// details). Until it's fixed, we're using our own type for this. +// +// TODO: investigate further. This most likely has something to do with an +// unsatisfied 'extends' constraints. A mismatch is probably happening with +// function parameter types and/or return types (check '_ReturnType' below for +// more). +export type _Awaited = T extends Promise + ? _Awaited + : T + +// TypeScript's native ReturnType does not work for functions of type '(...args: +// never[]) => unknown' (and that's what operations currently use). +// +// TODO: investigate how to properly specify the 'extends' constraint for function +// type (i.e., any vs never and unknown) and stick with that. Take DX into +// consideration. +export type _ReturnType unknown> = + T extends (...args: never[]) => infer R ? R : never diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/url.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/url.ts new file mode 100644 index 000000000..d21c06c65 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/url.ts @@ -0,0 +1,3 @@ +export function stripTrailingSlash(url?: string): string | undefined { + return url?.replace(/\/$/, ""); +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/validators.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/validators.ts new file mode 100644 index 000000000..3d30d9622 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/validators.ts @@ -0,0 +1,21 @@ +export function isValidAbsoluteURL(rawUrl: string): boolean { + try { + const url = new URL(rawUrl); + /* + URL constructor will parse some invalid absolute URLs as valid URLs + so we need to do some extra checks. + + Example: "localhost:3000" will be parsed as URL with protocol of + "localhost:" and host of "3000" + */ + return url.protocol === "http:" || url.protocol === "https:"; + } catch (e) { + return false; + } +} + +export function throwIfNotValidAbsoluteURL(value: string | undefined, name: string): void { + if (value && !isValidAbsoluteURL(value)) { + throw new Error(`${name} must be a valid absolute URL`); + } +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/vite-env.d.ts new file mode 100644 index 000000000..11f02fe2a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/src/Main.css b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/src/Main.css new file mode 100644 index 000000000..b6e7ed3f1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/src/Main.css @@ -0,0 +1,89 @@ +* { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + box-sizing: border-box; +} + +body { + margin: 0; + padding: 0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", + "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", + sans-serif; +} + +.container { + min-height: 100vh; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +main { + padding: 5rem 0; + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +main p { + font-size: 1.2rem; +} + +.logo { + margin-bottom: 2rem; +} + +.logo img { + max-height: 200px; +} + +.welcome-title { + font-weight: 500; +} + +.welcome-subtitle { + font-weight: 400; + margin-bottom: 3rem; +} + +.buttons { + display: flex; + flex-direction: row; +} + +.buttons .button:not(:last-child) { + margin-right: 0.5rem; +} + +.button { + border-radius: 3px; + font-size: 1.2rem; + padding: 1rem 2rem; + text-align: center; + font-weight: 700; + text-decoration: none; +} + +.button-filled { + border: 2px solid #bf9900; + background-color: #bf9900; + color: #f4f4f4; +} + +.button-outline { + border: 2px solid #8a9cff; + color: #8a9cff; + background-color: none; +} + +code { + border-radius: 5px; + padding: 0.2rem; + background: #efefef; + font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, + Bitstream Vera Sans Mono, Courier New, monospace; +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/src/MainPage.jsx new file mode 100644 index 000000000..01aae7c3d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/src/MainPage.jsx @@ -0,0 +1,41 @@ +import waspLogo from "./waspLogo.png"; +import "./Main.css"; + +export function MainPage() { + return ( +
+
+
+ wasp +
+ +

+ Welcome to Wasp - you just started a new app!{" "} +

+

+ This is page MainPage located at route /. + Open src/client/MainPage.jsx to edit it. +

+ + +
+
+ ); +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/src/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/src/vite-env.d.ts new file mode 100644 index 000000000..11f02fe2a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/src/waspLogo.png b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/src/waspLogo.png new file mode 100644 index 0000000000000000000000000000000000000000..d39a9443a8153b158b76f51dda2e42f3b34a9169 GIT binary patch literal 24877 zcmYg&bwHEf_dkq*gusvzkd_XWZiaMsk5K8HN=eC7L}^I@=>{1+8fKsfBHazrDJlJX zHhh1+zdt}^&vWj%_q4D&@u0Q`pkmVX8C5AIU~ z)%!TeU$<6)|0vm;sXJ(EgFMLG9itLx;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?&qD9(|c>}u}AfUu})`g0`OuUTC#|4mm{ z@?$Z)I3b+t*h%rs4>3~2Ytx~aSMMBEu;DgZ7xfgjD3IorKFqiF8Np={ zQ*{9^fEioJ<+v|M$LBrXGa~xr!Ew|^q5kB&gBAUGTpz^PS<3E}w0NQv{KM)`R|QZ{v8ox& zN*}brATIJsb=(CvcYt7lH~Hh&?EEmP(BCsJ01{h#%V{BJ$;LMxcaY zH0dDS^=F`$ZiHuumotF2qz_xX%1?FeD;Lm9P|aPL_>|Jp#!%wc&|4msLWE}){?wC% z7=R@)cqBQfiKKtcy=>$#R4hxHfwk2Ti$bLH-vRD$QH*K&vyyIa2C0@L54l0HAkfgx zGOsZJl##0WX5SYdB6!EOV|E&R;*k{s=wj4eCL>I7T(MW92}WXZ78}<5xpn9P`!<9W@RMoOdj?Ks?PTt-)|5$$>agZ%9WlWMO~fA~%@h z3Yz=2tYB<*j4my>_32jxHxFv#4yMy6m+V2V1@wH0x|0LzJR}$nW);N9nO!r5YTb+k9&@Vlqb$WWu=JR-B6w@ zTxOiLX~sG0yg9e#j(>yIXcSDb68n7$RAS!)oN|L#e7EI}*=h=y+2cf_di5@h8iWfu zY`Re<9J#_OB9;>FCVQQ=OU4T)`CEDGx=$LlX4r0OR4%>xd>?%WM388~nGY`kV&j5d z#^qgx8fSGj+)boYY360q&E=YEh~|=VMd|OWU&ekrRFg9lddgp;bId&b@!*HIjj^v?44kvS z3yU<>-KmW5bJlm~$E@J{sxd basename generatedCodeDirInDotWaspDir - [reldir|sdk/wasp|] + sdkRootDirInGeneratedCodeDir + +sdkRootDirInGeneratedCodeDir :: Path' (Rel ProjectRootDir) (Dir SdkRootDir) +sdkRootDirInGeneratedCodeDir = [reldir|sdk/wasp|] sdkTemplatesDirInTemplatesDir :: Path' (Rel TemplatesDir) (Dir SdkTemplatesDir) -sdkTemplatesDirInTemplatesDir = [reldir|sdk|] +sdkTemplatesDirInTemplatesDir = [reldir|sdk/wasp|] extSrcDirInSdkRootDir :: Path' (Rel SdkRootDir) (Dir GeneratedExternalCodeDir) extSrcDirInSdkRootDir = [reldir|ext-src|] diff --git a/waspc/src/Wasp/Project/Common.hs b/waspc/src/Wasp/Project/Common.hs index 1f25691d4..4e2cd4dd3 100644 --- a/waspc/src/Wasp/Project/Common.hs +++ b/waspc/src/Wasp/Project/Common.hs @@ -12,6 +12,7 @@ module Wasp.Project.Common dotWaspRootFileInWaspProjectDir, dotWaspInfoFileInGeneratedCodeDir, packageJsonInWaspProjectDir, + packageLockJsonInWaspProjectDir, nodeModulesDirInWaspProjectDir, srcDirInWaspProjectDir, extPublicDirInWaspProjectDir, @@ -67,6 +68,9 @@ dotWaspInfoFileInGeneratedCodeDir = [relfile|.waspinfo|] packageJsonInWaspProjectDir :: Path' (Rel WaspProjectDir) File' packageJsonInWaspProjectDir = [relfile|package.json|] +packageLockJsonInWaspProjectDir :: Path' (Rel WaspProjectDir) File' +packageLockJsonInWaspProjectDir = [relfile|package-lock.json|] + srcDirInWaspProjectDir :: Path' (Rel WaspProjectDir) (Dir SourceExternalCodeDir) srcDirInWaspProjectDir = [reldir|src|] diff --git a/waspc/src/Wasp/Util/IO.hs b/waspc/src/Wasp/Util/IO.hs index 157c322a3..39b33c2ec 100644 --- a/waspc/src/Wasp/Util/IO.hs +++ b/waspc/src/Wasp/Util/IO.hs @@ -11,7 +11,9 @@ module Wasp.Util.IO readFileStrict, writeFile, removeFile, + copyFile, removeDirectory, + copyDirectory, tryReadFile, isDirectoryEmpty, writeFileFromText, @@ -25,8 +27,10 @@ import qualified Data.ByteString.Lazy as B import Data.Text (Text) import qualified Data.Text.IO as T.IO import qualified Data.Text.IO as Text.IO +import qualified Path.IO as PathIO import StrongPath (Abs, Dir, Dir', File, Path', Rel, basename, parseRelDir, parseRelFile, toFilePath, ()) import qualified StrongPath as SP +import qualified StrongPath.Path as SP.Path import qualified System.Directory as SD import qualified System.FilePath as FilePath import System.IO.Error (isDoesNotExistError) @@ -117,9 +121,15 @@ writeFileFromText = T.IO.writeFile . SP.fromAbsFile removeFile :: Path' Abs (File f) -> IO () removeFile = SD.removeFile . SP.fromAbsFile +copyFile :: Path' Abs (File f1) -> Path' Abs (File f2) -> IO () +copyFile src dst = SD.copyFile (SP.fromAbsFile src) (SP.fromAbsFile dst) + removeDirectory :: Path' Abs (Dir d) -> IO () removeDirectory = SD.removeDirectoryRecursive . SP.fromAbsDir +copyDirectory :: Path' Abs (Dir d1) -> Path' Abs (Dir d2) -> IO () +copyDirectory src dst = PathIO.copyDirRecur (SP.Path.toPathAbsDir src) (SP.Path.toPathAbsDir dst) + tryReadFile :: FilePath -> IO (Maybe Text) tryReadFile fp = (Just <$> Text.IO.readFile fp) diff --git a/web/docs/advanced/deployment/manually.md b/web/docs/advanced/deployment/manually.md index 198ffc2b2..d394ab745 100644 --- a/web/docs/advanced/deployment/manually.md +++ b/web/docs/advanced/deployment/manually.md @@ -7,13 +7,26 @@ import AddExternalAuthEnvVarsReminder from './\_addExternalAuthEnvVarsReminder.m import BuildingTheWebClient from './\_building-the-web-client.md' import { Required } from '@site/src/components/Tag' -We'll cover how to deploy your Wasp app manually to a variety of providers: +This document explains how to build and prepare your Wasp app for deployment. +You can then deploy the built Wasp app wherever and however you want, as long as your provider/server +supports Wasp's build format. + +After going through the general steps that apply to all deployments, you can +follow step-by-step guides for deploying your Wasp app to the most popular +providers: - [Fly.io](#flyio) - [Netlify](#netlify) - [Railway](#railway) - [Heroku](#heroku) +No worries, you can still deploy your app if your desired provider isn't on the +list - it just means we don't yet have a step-by-step guide for you to follow. +Feel free to [open a +PR](https://github.com/wasp-lang/wasp/edit/release/web/docs/advanced/deployment/manually.md) +if you'd like to write one yourself :) + + ## Deploying a Wasp App Deploying a Wasp app comes down to the following: diff --git a/web/docs/advanced/deployment/overview.md b/web/docs/advanced/deployment/overview.md index c4750284e..4d1ac9911 100644 --- a/web/docs/advanced/deployment/overview.md +++ b/web/docs/advanced/deployment/overview.md @@ -11,7 +11,7 @@ Wasp apps are full-stack apps that consist of: You can deploy each part **anywhere** where you can usually deploy Node.js apps or static apps. For example, you can deploy your client on [Netlify](https://www.netlify.com/), the server on [Fly.io](https://fly.io/), and the database on [Neon](https://neon.tech/). -To make deploying as smooth as possible, Wasp also offers a single-command deployment through the **Wasp CLI**. Read more about deploying through the CLI [here](../../advanced/deployment/cli). +To make deploying as smooth as possible, Wasp also offers a single-command deployment through the **Wasp CLI**.